summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--filter/source/config/fragments/langfilter.xsl2
-rw-r--r--filter/source/docbook/docbooktosoffheadings.xsl2748
-rw-r--r--filter/source/docbook/sofftodocbookheadings.xsl2100
-rw-r--r--filter/source/xslt/common/copy.xsl8
-rw-r--r--filter/source/xslt/common/measure_conversion.xsl880
-rw-r--r--filter/source/xslt/export/spreadsheetml/formular.xsl1164
-rw-r--r--filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl370
-rw-r--r--filter/source/xslt/export/spreadsheetml/style_mapping.xsl720
-rw-r--r--filter/source/xslt/export/spreadsheetml/styles.xsl1324
-rw-r--r--filter/source/xslt/export/spreadsheetml/table.xsl1812
-rw-r--r--filter/source/xslt/export/uof/odf2uof_presentation.xsl6718
-rw-r--r--filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl12330
-rw-r--r--filter/source/xslt/export/uof/odf2uof_text.xsl8828
-rw-r--r--filter/source/xslt/export/wordml/ooo2wordml_border.xsl36
-rw-r--r--filter/source/xslt/export/wordml/ooo2wordml_draw.xsl3478
-rw-r--r--filter/source/xslt/export/wordml/ooo2wordml_field.xsl9
-rw-r--r--filter/source/xslt/export/wordml/ooo2wordml_list.xsl10
-rw-r--r--filter/source/xslt/export/wordml/ooo2wordml_settings.xsl2
-rw-r--r--filter/source/xslt/export/wordml/ooo2wordml_table.xsl2
-rw-r--r--filter/source/xslt/export/wordml/ooo2wordml_text.xsl2
-rw-r--r--filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl17794
-rw-r--r--filter/source/xslt/import/uof/uof2odf_presentation.xsl6914
-rw-r--r--filter/source/xslt/import/uof/uof2odf_spreadsheet.xsl18048
-rw-r--r--filter/source/xslt/import/uof/uof2odf_text.xsl9234
-rw-r--r--filter/source/xslt/import/wordml/wordml2ooo.xsl8
-rw-r--r--filter/source/xslt/import/wordml/wordml2ooo_draw.xsl68
-rw-r--r--filter/source/xslt/import/wordml/wordml2ooo_field.xsl154
-rw-r--r--filter/source/xslt/import/wordml/wordml2ooo_path.xsl28
-rw-r--r--filter/source/xslt/import/wordml/wordml2ooo_props.xsl8
-rw-r--r--filter/source/xslt/import/wordml/wordml2ooo_table.xsl6
-rw-r--r--filter/source/xslt/import/wordml/wordml2ooo_text.xsl4
-rw-r--r--filter/source/xslt/odf2xhtml/export/common/body.xsl855
-rw-r--r--filter/source/xslt/odf2xhtml/export/common/styles/style_collector.xsl1348
-rw-r--r--filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl584
-rw-r--r--filter/source/xslt/odf2xhtml/export/common/table/table.xsl264
-rw-r--r--filter/source/xslt/odf2xhtml/export/common/table/table_cells.xsl452
-rw-r--r--filter/source/xslt/odf2xhtml/export/common/table/table_columns.xsl420
-rw-r--r--filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl360
-rw-r--r--filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl1064
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/body.xsl5922
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/header.xsl788
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl302
-rw-r--r--filter/source/xslt/odf2xhtml/export/xhtml/table.xsl380
-rw-r--r--officecfg/util/alllang.xsl314
-rw-r--r--officecfg/util/data_val.xsl286
-rw-r--r--officecfg/util/resource.xsl8
-rw-r--r--[-rwxr-xr-x]officecfg/util/sanity.xsl8
-rw-r--r--officecfg/util/schema_trim.xsl84
-rw-r--r--officecfg/util/schema_val.xsl172
-rw-r--r--readlicense_oo/docs/readme.xsl320
-rw-r--r--sd/xsl/effect.xsl212
-rw-r--r--swext/mediawiki/src/filter/odt2mediawiki.xsl3872
-rw-r--r--xmlhelp/util/compact.xsl8
-rw-r--r--xmlhelp/util/embed.xsl48
-rw-r--r--xmlhelp/util/idxcaption.xsl38
-rw-r--r--xmlhelp/util/idxcontent.xsl30
-rw-r--r--xmlhelp/util/main_transform.xsl1026
57 files changed, 56985 insertions, 56989 deletions
diff --git a/filter/source/config/fragments/langfilter.xsl b/filter/source/config/fragments/langfilter.xsl
index 7f8f90f44253..b26a522d16b2 100644
--- a/filter/source/config/fragments/langfilter.xsl
+++ b/filter/source/config/fragments/langfilter.xsl
@@ -43,7 +43,7 @@
</xsl:copy>
</xsl:if>
</xsl:template>
-
+
<xsl:template match="text()">
<xsl:if test="../@xml:lang=$lang">
<xsl:copy>
diff --git a/filter/source/docbook/docbooktosoffheadings.xsl b/filter/source/docbook/docbooktosoffheadings.xsl
index 00f18380a315..08d1838632d4 100644
--- a/filter/source/docbook/docbooktosoffheadings.xsl
+++ b/filter/source/docbook/docbooktosoffheadings.xsl
@@ -17,1400 +17,1400 @@
* 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="http://www.w3.org/1999/XSL/Format" xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:config="http://openoffice.org/2001/config" office:class="text" office:version="1.0">
- <xsl:decimal-format name="staff" digit="D"/>
- <xsl:template match="/">
- <xsl:element name="office:document">
- <office:meta>
- <dc:title>
- <xsl:value-of select="/article/articleinfo/title"/>
- </dc:title>
- <dc:description></dc:description>
- <dc:subject></dc:subject>
- <dc:date>
- <xsl:value-of select="article/articleinfo/pubdate"/>
- </dc:date>
- <dc:language>
- <xsl:value-of select="article/@lang"/>
- </dc:language>
- <meta:user-defined meta:name="Info 1"/>
- <meta:user-defined meta:name="Info 2"/>
- <meta:user-defined meta:name="Info 3"/>
- <meta:user-defined meta:name="Info 4"/>
- </office:meta>
- <office:font-decls>
- <style:font-decl style:name="Tahoma1" fo:font-family="Tahoma"/>
- <style:font-decl style:name="Thorndale" fo:font-family="Thorndale" style:font-family-generic="roman" style:font-pitch="variable"/>
- <style:font-decl style:name="Albany" fo:font-family="Albany" style:font-family-generic="swiss" style:font-pitch="variable"/>
- <style:font-decl style:name="Andale Sans UI" fo:font-family="'Andale Sans UI'" style:font-family-generic="system" style:font-pitch="variable"/>
- <style:font-decl style:name="MS Mincho" fo:font-family="'MS Mincho'" style:font-family-generic="system" style:font-pitch="variable"/>
- <style:font-decl style:name="Tahoma" fo:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/>
- </office:font-decls>
- <office:styles>
- <style:default-style style:family="graphics">
- <style:properties draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false" style:use-window-font-color="true" fo:font-size="12pt" fo:language="en" fo:country="US" style:font-size-asian="12pt" style:language-asian="zxx" style:country-asian="none" style:font-size-complex="12pt" style:language-complex="zxx" style:country-complex="none">
- <style:tab-stops/>
- </style:properties>
- </style:default-style>
- <style:default-style style:family="paragraph">
- <style:properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="2.205cm" style:writing-mode="page" style:use-window-font-color="true" style:font-name="Thorndale" fo:font-size="12pt" fo:language="en" fo:country="US" style:font-name-asian="Andale Sans UI" style:font-size-asian="12pt" style:language-asian="zxx" style:country-asian="none" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="zxx" style:country-complex="none" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
- </style:default-style>
- <style:default-style style:family="table">
- <style:properties table:border-model="separating"/>
- </style:default-style>
- <style:default-style style:family="table-row">
- <style:properties fo:keep-together="always"/>
- </style:default-style>
- <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
- <style:style style:name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
- <style:properties fo:margin-top="0cm" fo:margin-bottom="0.212cm"/>
- </style:style>
- <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text body" style:class="text">
- <style:properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" fo:keep-with-next="true" style:font-name="Albany" fo:font-size="14pt" style:font-name-asian="MS Mincho" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-size-complex="14pt"/>
- </style:style>
- <style:style style:name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text body" style:class="text">
- <style:properties fo:font-size="115%" fo:font-weight="bold" style:font-size-asian="115%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/>
- </style:style>
- <style:style style:name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text body" style:class="text">
- <style:properties fo:font-size="14pt" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-style-complex="italic" style:font-weight-complex="bold"/>
- </style:style>
- <style:style style:name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text body" style:class="text">
- <style:properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold"/>
- </style:style>
- <style:style style:name="Heading 4" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text body" style:class="text">
- <style:properties fo:font-size="85%" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="85%" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="85%" style:font-style-complex="italic" style:font-weight-complex="bold"/>
- </style:style>
- <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text body" style:class="list">
- <style:properties style:font-name-complex="Tahoma1"/>
- </style:style>
- <style:style style:name="Table Contents" style:family="paragraph" style:parent-style-name="Text body" style:class="extra">
- <style:properties text:number-lines="false" text:line-number="0"/>
- </style:style>
- <style:style style:name="Table Heading" style:family="paragraph" style:parent-style-name="Table Contents" style:class="extra">
- <style:properties fo:text-align="center" style:justify-single-word="false" text:number-lines="false" text:line-number="0" fo:font-style="italic" fo:font-weight="bold" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-style-complex="italic" style:font-weight-complex="bold"/>
- </style:style>
- <style:style style:name="Caption" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
- <style:properties fo:margin-top="0.212cm" fo:margin-bottom="0.212cm" text:number-lines="false" text:line-number="0" fo:font-size="10pt" fo:font-style="italic" style:font-size-asian="10pt" style:font-style-asian="italic" style:font-size-complex="10pt" style:font-style-complex="italic"/>
- </style:style>
- <style:style style:name="Table" style:family="paragraph" style:parent-style-name="Caption" style:class="extra"/>
- <style:style style:name="Frame contents" style:family="paragraph" style:parent-style-name="Text body" style:class="extra"/>
- <style:style style:name="Footnote" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
- <style:properties fo:margin-left="0.499cm" fo:margin-right="0cm" fo:text-indent="-0.499cm" style:auto-text-indent="false" text:number-lines="false" text:line-number="0" fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
- </style:style>
- <style:style style:name="Index" style:family="paragraph" style:parent-style-name="Standard" style:class="index">
- <style:properties text:number-lines="false" text:line-number="0" style:font-name-complex="Tahoma1"/>
- </style:style>
- <style:style style:name="Subtitle" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text body" style:class="chapter">
- <style:properties fo:text-align="center" style:justify-single-word="false" fo:font-size="14pt" fo:font-style="italic" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-size-complex="14pt" style:font-style-complex="italic"/>
- </style:style>
- <style:style style:name="Mediaobject" style:family="paragraph" style:class="text"/>
- <style:style style:name="Object" style:family="paragraph" style:parent-style-name="Caption" style:class="extra"/>
- <style:style style:name="Section Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
- <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="14pt"/>
- </style:style>
- <style:style style:name="Appendix Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
- <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="14pt"/>
- </style:style>
- <style:style style:name="Section1 Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
- <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="14pt"/>
- </style:style>
- <style:style style:name="Section2 Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
- <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="13pt"/>
- </style:style>
- <style:style style:name="Section3 Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
- <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="12pt"/>
- </style:style>
- <style:style style:name="Section4 Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
- <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="12pt"/>
- </style:style>
- <style:style style:name="Section5 Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
- <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="12pt"/>
- </style:style>
- <style:style style:name="Document Title" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Document SubTitle">
- <style:properties fo:text-align="center" style:justify-single-word="false" fo:font-size="20pt"/>
- </style:style>
- <style:style style:name="Document SubTitle" style:family="paragraph" style:parent-style-name="Document Title" style:next-style-name="Text body">
- <style:properties fo:font-size="14pt"/>
- </style:style>
- <style:style style:name="Section SubTitle" style:family="paragraph" style:parent-style-name="Section Title"/>
- <style:style style:name="CopyRight" style:family="paragraph" style:parent-style-name="Text body"/>
- <style:style style:name="VarList Item" style:family="paragraph" style:parent-style-name="Text body" style:list-style-name="Var List" style:class="text">
- <style:properties fo:margin-left="3cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
- <style:tab-stops>
- <style:tab-stop style:position="0cm"/>
- </style:tab-stops>
- </style:properties>
- </style:style>
- <style:style style:name="VarList Term" style:family="paragraph" style:parent-style-name="Text body" style:list-style-name="Var List" style:class="text">
- <style:properties fo:margin-left="1cm" fo:margin-right="0cm" fo:text-indent="-4.5cm" style:auto-text-indent="false">
- <style:tab-stops>
- <style:tab-stop style:position="0cm"/>
- </style:tab-stops>
- </style:properties>
- </style:style>
- <style:style style:name="Footnote Symbol" style:family="text"/>
- <style:style style:name="Numbering Symbols" style:family="text"/>
- <style:style style:name="Bullet Symbols" style:family="text">
- <style:properties fo:font-size="9pt" style:font-size-asian="9pt" style:font-size-complex="9pt"/>
- </style:style>
- <style:style style:name="Internet link" style:family="text">
- <style:properties fo:color="#000080" style:text-underline-color="font-color" style:text-underline="single"/>
- </style:style>
- <style:style style:name="Endnote Symbol" style:family="text"/>
- <style:style style:name="Emphasis" style:family="text">
- <style:properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
- </style:style>
- <style:style style:name="Source Text" style:family="text"/>
- <style:style style:name="Highlight" style:family="text">
- <style:properties style:text-background-color="#fff000"/>
- </style:style>
- <style:style style:name="KeyCap" style:family="text">
- <style:properties fo:font-weight="bold"/>
- </style:style>
- <style:style style:name="Command" style:family="text">
- <style:properties fo:font-weight="bold"/>
- </style:style>
- <style:style style:name="Application" style:family="text">
- <style:properties fo:font-weight="bold"/>
- </style:style>
- <style:style style:name="FileName" style:family="text">
- <style:properties fo:font-weight="bold"/>
- </style:style>
- <style:style style:name="SuperScript" style:family="text">
- <style:properties style:text-position="super 58%"/>
- </style:style>
- <style:style style:name="SubScript" style:family="text">
- <style:properties style:text-position="sub 58%"/>
- </style:style>
- <style:style style:name="SystemItem" style:family="text">
- <style:properties fo:font-weight="bold"/>
- </style:style>
- <style:style style:name="ComputerOutput" style:family="text">
- <style:properties fo:font-weight="bold"/>
- </style:style>
- <style:style style:name="KeyCombo" style:family="text">
- <style:properties fo:font-weight="bold"/>
- </style:style>
- <style:style style:name="KeySym" style:family="text">
- <style:properties fo:font-weight="bold"/>
- </style:style>
- <style:style style:name="GuiMenu" style:family="text">
- <style:properties fo:color="#000fff" fo:font-style="italic"/>
- </style:style>
- <style:style style:name="GuiSubMenu" style:family="text">
- <style:properties fo:color="#ff9966" fo:font-style="italic"/>
- </style:style>
- <style:style style:name="GuiButton" style:family="text">
- <style:properties fo:color="#00f0ff" fo:font-style="italic"/>
- </style:style>
- <style:style style:name="GuiMenuItem" style:family="text">
- <style:properties fo:color="#00ffff" fo:font-style="italic"/>
- </style:style>
- <style:style style:name="GuiLabel" style:family="text">
- <style:properties fo:color="#00777f" fo:font-style="italic"/>
- </style:style>
- <style:style style:name="Frame" style:family="graphics">
- <style:properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" 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" fo:padding="0.15cm" fo:border="0.002cm solid #000000"/>
- </style:style>
- <text:outline-style>
- <text:outline-level-style text:level="1" style:num-format=""/>
- <text:outline-level-style text:level="2" style:num-format=""/>
- <text:outline-level-style text:level="3" style:num-format=""/>
- <text:outline-level-style text:level="4" style:num-format=""/>
- <text:outline-level-style text:level="5" style:num-format=""/>
- <text:outline-level-style text:level="6" style:num-format=""/>
- <text:outline-level-style text:level="7" style:num-format=""/>
- <text:outline-level-style text:level="8" style:num-format=""/>
- <text:outline-level-style text:level="9" style:num-format=""/>
- <text:outline-level-style text:level="10" style:num-format=""/>
- </text:outline-style>
- <text:list-style style:name="Ordered List">
- <text:list-level-style-number text:level="1" text:style-name="Numbering Symbols" style:num-suffix="." style:num-format="1">
- <style:properties text:min-label-width="0.499cm"/>
- </text:list-level-style-number>
- <text:list-level-style-number text:level="2" style:num-suffix="." style:num-format="1">
- <style:properties text:space-before="0.501cm" text:min-label-width="0.499cm"/>
- </text:list-level-style-number>
- <text:list-level-style-number text:level="3" style:num-suffix="." style:num-format="1">
- <style:properties text:space-before="1cm" text:min-label-width="0.499cm"/>
- </text:list-level-style-number>
- <text:list-level-style-number text:level="4" style:num-suffix="." style:num-format="1">
- <style:properties text:space-before="1.501cm" text:min-label-width="0.499cm"/>
- </text:list-level-style-number>
- <text:list-level-style-number text:level="5" style:num-suffix="." style:num-format="1">
- <style:properties text:space-before="2cm" text:min-label-width="0.499cm"/>
- </text:list-level-style-number>
- <text:list-level-style-number text:level="6" style:num-suffix="." style:num-format="1">
- <style:properties text:space-before="2.501cm" text:min-label-width="0.499cm"/>
- </text:list-level-style-number>
- <text:list-level-style-number text:level="7" style:num-suffix="." style:num-format="1">
- <style:properties text:space-before="3.001cm" text:min-label-width="0.499cm"/>
- </text:list-level-style-number>
- <text:list-level-style-number text:level="8" style:num-suffix="." style:num-format="1">
- <style:properties text:space-before="3.502cm" text:min-label-width="0.499cm"/>
- </text:list-level-style-number>
- <text:list-level-style-number text:level="9" style:num-suffix="." style:num-format="1">
- <style:properties text:space-before="4.001cm" text:min-label-width="0.499cm"/>
- </text:list-level-style-number>
- <text:list-level-style-number text:level="10" style:num-suffix="." style:num-format="1">
- <style:properties text:space-before="4.502cm" text:min-label-width="0.499cm"/>
- </text:list-level-style-number>
- </text:list-style>
- <text:list-style style:name="UnOrdered List">
- <text:list-level-style-bullet text:level="1" text:style-name="Bullet Symbols" text:bullet-char="•">
- <style:properties text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="2" text:style-name="Bullet Symbols" text:bullet-char="•">
- <style:properties text:space-before="0.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="3" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="1cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="4" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="1.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="5" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="2cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="6" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="2.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="7" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="3.001cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="8" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="3.502cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="9" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="4.001cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="10" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="4.502cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- </text:list-style>
- <text:list-style style:name="Var List">
- <text:list-level-style-bullet text:level="1" text:style-name="Bullet Symbols" text:bullet-char="•">
- <style:properties text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="2" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="0.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="3" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="1cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="4" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="1.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="5" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="2cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="6" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="2.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="7" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="3.001cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="8" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="3.502cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="9" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="4.001cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- <text:list-level-style-bullet text:level="10" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
- <style:properties text:space-before="4.502cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </text:list-level-style-bullet>
- </text:list-style>
- <text:footnotes-configuration text:citation-style-name="Footnote Symbol" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="page"/>
- <text:endnotes-configuration text:citation-style-name="Endnote Symbol" text:master-page-name="Endnote" style:num-format="1" text:start-value="0"/>
- <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
- </office:styles>
- <office:automatic-styles>
- <style:page-master style:name="pm1">
- <style:properties fo:page-width="20.999cm" fo:page-height="29.699cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2.54cm" fo:margin-bottom="2.54cm" fo:margin-left="3.175cm" fo:margin-right="3.175cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
- <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
- </style:properties>
- <style:header-style/>
- <style:footer-style/>
- </style:page-master>
- <style:page-master style:name="pm2">
- <style:properties fo:page-width="20.999cm" fo:page-height="29.699cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
- <style:footnote-sep style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
- </style:properties>
- <style:header-style/>
- <style:footer-style/>
- </style:page-master>
- </office:automatic-styles>
- <office:master-styles>
- <style:master-page style:name="Standard" style:page-master-name="pm1"/>
- <style:master-page style:name="Endnote" style:page-master-name="pm2"/>
- </office:master-styles>
- <office:body>
- <xsl:apply-templates/>
- </office:body>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="subtitle">
- <xsl:choose>
- <xsl:when test="parent::table">
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:when test="parent::informaltable">
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="text:p">
- <xsl:attribute name="text:style-name">Section SubTitle</xsl:attribute>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-
-
- <xsl:template match="title">
- <xsl:choose>
- <xsl:when test="parent::figure"></xsl:when>
- <xsl:when test="parent::table"></xsl:when>
- <xsl:when test="parent::sect1"></xsl:when>
- <xsl:when test="parent::sect2"></xsl:when>
- <xsl:when test="parent::sect3"></xsl:when>
- <xsl:when test="parent::sect4"></xsl:when>
- <xsl:when test="parent::sect5"></xsl:when>
- <xsl:when test="parent::informaltable">
- <xsl:apply-templates/>
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:element name="text:p">
- <xsl:choose>
-
- <xsl:when test="parent::appendix">
- <xsl:attribute name="text:style-name">Appendix Title</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="articleinfo">
- <xsl:element name="text:section">
- <xsl:attribute name="text:style-name">ArticleInfo</xsl:attribute>
- <xsl:attribute name="text:name">ArticleInfo</xsl:attribute>
- <xsl:if test="/article/articleinfo/title !=''">
- <xsl:element name="text:p">
- <xsl:attribute name="text:style-name">Document Title</xsl:attribute>
- <xsl:value-of select="/article/articleinfo/title"/>
- </xsl:element>
- <xsl:if test="/article/articleinfo/subtitle !=''">
- <xsl:element name="text:p">
- <xsl:attribute name="text:style-name">Document SubTitle</xsl:attribute>
- <xsl:value-of select="/article/articleinfo/subtitle"/>
- </xsl:element>
- </xsl:if>
- </xsl:if>
- <xsl:apply-templates/>
- </xsl:element>
-
- </xsl:template>
-
- <xsl:template match="appendix">
- <xsl:element name="text:section">
- <xsl:attribute name="text:style-name">Appendix</xsl:attribute>
- <xsl:attribute name="text:name">Appendix</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
-
- </xsl:template>
+ <xsl:decimal-format name="staff" digit="D"/>
+ <xsl:template match="/">
+ <xsl:element name="office:document">
+ <office:meta>
+ <dc:title>
+ <xsl:value-of select="/article/articleinfo/title"/>
+ </dc:title>
+ <dc:description></dc:description>
+ <dc:subject></dc:subject>
+ <dc:date>
+ <xsl:value-of select="article/articleinfo/pubdate"/>
+ </dc:date>
+ <dc:language>
+ <xsl:value-of select="article/@lang"/>
+ </dc:language>
+ <meta:user-defined meta:name="Info 1"/>
+ <meta:user-defined meta:name="Info 2"/>
+ <meta:user-defined meta:name="Info 3"/>
+ <meta:user-defined meta:name="Info 4"/>
+ </office:meta>
+ <office:font-decls>
+ <style:font-decl style:name="Tahoma1" fo:font-family="Tahoma"/>
+ <style:font-decl style:name="Thorndale" fo:font-family="Thorndale" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-decl style:name="Albany" fo:font-family="Albany" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ <style:font-decl style:name="Andale Sans UI" fo:font-family="'Andale Sans UI'" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-decl style:name="MS Mincho" fo:font-family="'MS Mincho'" style:font-family-generic="system" style:font-pitch="variable"/>
+ <style:font-decl style:name="Tahoma" fo:font-family="Tahoma" style:font-family-generic="system" style:font-pitch="variable"/>
+ </office:font-decls>
+ <office:styles>
+ <style:default-style style:family="graphics">
+ <style:properties draw:shadow-offset-x="0.3cm" draw:shadow-offset-y="0.3cm" draw:start-line-spacing-horizontal="0.283cm" draw:start-line-spacing-vertical="0.283cm" draw:end-line-spacing-horizontal="0.283cm" draw:end-line-spacing-vertical="0.283cm" style:text-autospace="ideograph-alpha" style:line-break="strict" style:writing-mode="lr-tb" style:font-independent-line-spacing="false" style:use-window-font-color="true" fo:font-size="12pt" fo:language="en" fo:country="US" style:font-size-asian="12pt" style:language-asian="zxx" style:country-asian="none" style:font-size-complex="12pt" style:language-complex="zxx" style:country-complex="none">
+ <style:tab-stops/>
+ </style:properties>
+ </style:default-style>
+ <style:default-style style:family="paragraph">
+ <style:properties fo:hyphenation-ladder-count="no-limit" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:tab-stop-distance="2.205cm" style:writing-mode="page" style:use-window-font-color="true" style:font-name="Thorndale" fo:font-size="12pt" fo:language="en" fo:country="US" style:font-name-asian="Andale Sans UI" style:font-size-asian="12pt" style:language-asian="zxx" style:country-asian="none" style:font-name-complex="Tahoma" style:font-size-complex="12pt" style:language-complex="zxx" style:country-complex="none" fo:hyphenate="false" fo:hyphenation-remain-char-count="2" fo:hyphenation-push-char-count="2"/>
+ </style:default-style>
+ <style:default-style style:family="table">
+ <style:properties table:border-model="separating"/>
+ </style:default-style>
+ <style:default-style style:family="table-row">
+ <style:properties fo:keep-together="always"/>
+ </style:default-style>
+ <style:style style:name="Standard" style:family="paragraph" style:class="text"/>
+ <style:style style:name="Text body" style:family="paragraph" style:parent-style-name="Standard" style:class="text">
+ <style:properties fo:margin-top="0cm" fo:margin-bottom="0.212cm"/>
+ </style:style>
+ <style:style style:name="Heading" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Text body" style:class="text">
+ <style:properties fo:margin-top="0.423cm" fo:margin-bottom="0.212cm" fo:keep-with-next="true" style:font-name="Albany" fo:font-size="14pt" style:font-name-asian="MS Mincho" style:font-size-asian="14pt" style:font-name-complex="Tahoma" style:font-size-complex="14pt"/>
+ </style:style>
+ <style:style style:name="Heading 1" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text body" style:class="text">
+ <style:properties fo:font-size="115%" fo:font-weight="bold" style:font-size-asian="115%" style:font-weight-asian="bold" style:font-size-complex="115%" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading 2" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text body" style:class="text">
+ <style:properties fo:font-size="14pt" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-style-complex="italic" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading 3" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text body" style:class="text">
+ <style:properties fo:font-size="14pt" fo:font-weight="bold" style:font-size-asian="14pt" style:font-weight-asian="bold" style:font-size-complex="14pt" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Heading 4" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text body" style:class="text">
+ <style:properties fo:font-size="85%" fo:font-style="italic" fo:font-weight="bold" style:font-size-asian="85%" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-size-complex="85%" style:font-style-complex="italic" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="List" style:family="paragraph" style:parent-style-name="Text body" style:class="list">
+ <style:properties style:font-name-complex="Tahoma1"/>
+ </style:style>
+ <style:style style:name="Table Contents" style:family="paragraph" style:parent-style-name="Text body" style:class="extra">
+ <style:properties text:number-lines="false" text:line-number="0"/>
+ </style:style>
+ <style:style style:name="Table Heading" style:family="paragraph" style:parent-style-name="Table Contents" style:class="extra">
+ <style:properties fo:text-align="center" style:justify-single-word="false" text:number-lines="false" text:line-number="0" fo:font-style="italic" fo:font-weight="bold" style:font-style-asian="italic" style:font-weight-asian="bold" style:font-style-complex="italic" style:font-weight-complex="bold"/>
+ </style:style>
+ <style:style style:name="Caption" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ <style:properties fo:margin-top="0.212cm" fo:margin-bottom="0.212cm" text:number-lines="false" text:line-number="0" fo:font-size="10pt" fo:font-style="italic" style:font-size-asian="10pt" style:font-style-asian="italic" style:font-size-complex="10pt" style:font-style-complex="italic"/>
+ </style:style>
+ <style:style style:name="Table" style:family="paragraph" style:parent-style-name="Caption" style:class="extra"/>
+ <style:style style:name="Frame contents" style:family="paragraph" style:parent-style-name="Text body" style:class="extra"/>
+ <style:style style:name="Footnote" style:family="paragraph" style:parent-style-name="Standard" style:class="extra">
+ <style:properties fo:margin-left="0.499cm" fo:margin-right="0cm" fo:text-indent="-0.499cm" style:auto-text-indent="false" text:number-lines="false" text:line-number="0" fo:font-size="10pt" style:font-size-asian="10pt" style:font-size-complex="10pt"/>
+ </style:style>
+ <style:style style:name="Index" style:family="paragraph" style:parent-style-name="Standard" style:class="index">
+ <style:properties text:number-lines="false" text:line-number="0" style:font-name-complex="Tahoma1"/>
+ </style:style>
+ <style:style style:name="Subtitle" style:family="paragraph" style:parent-style-name="Heading" style:next-style-name="Text body" style:class="chapter">
+ <style:properties fo:text-align="center" style:justify-single-word="false" fo:font-size="14pt" fo:font-style="italic" style:font-size-asian="14pt" style:font-style-asian="italic" style:font-size-complex="14pt" style:font-style-complex="italic"/>
+ </style:style>
+ <style:style style:name="Mediaobject" style:family="paragraph" style:class="text"/>
+ <style:style style:name="Object" style:family="paragraph" style:parent-style-name="Caption" style:class="extra"/>
+ <style:style style:name="Section Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
+ <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="14pt"/>
+ </style:style>
+ <style:style style:name="Appendix Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
+ <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="14pt"/>
+ </style:style>
+ <style:style style:name="Section1 Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
+ <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="14pt"/>
+ </style:style>
+ <style:style style:name="Section2 Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
+ <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="13pt"/>
+ </style:style>
+ <style:style style:name="Section3 Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
+ <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="12pt"/>
+ </style:style>
+ <style:style style:name="Section4 Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
+ <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="12pt"/>
+ </style:style>
+ <style:style style:name="Section5 Title" style:family="paragraph" style:next-style-name="Text body" style:master-page-name="">
+ <style:properties fo:line-height="200%" fo:text-transform="capitalize" fo:font-size="12pt"/>
+ </style:style>
+ <style:style style:name="Document Title" style:family="paragraph" style:parent-style-name="Standard" style:next-style-name="Document SubTitle">
+ <style:properties fo:text-align="center" style:justify-single-word="false" fo:font-size="20pt"/>
+ </style:style>
+ <style:style style:name="Document SubTitle" style:family="paragraph" style:parent-style-name="Document Title" style:next-style-name="Text body">
+ <style:properties fo:font-size="14pt"/>
+ </style:style>
+ <style:style style:name="Section SubTitle" style:family="paragraph" style:parent-style-name="Section Title"/>
+ <style:style style:name="CopyRight" style:family="paragraph" style:parent-style-name="Text body"/>
+ <style:style style:name="VarList Item" style:family="paragraph" style:parent-style-name="Text body" style:list-style-name="Var List" style:class="text">
+ <style:properties fo:margin-left="3cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="0cm"/>
+ </style:tab-stops>
+ </style:properties>
+ </style:style>
+ <style:style style:name="VarList Term" style:family="paragraph" style:parent-style-name="Text body" style:list-style-name="Var List" style:class="text">
+ <style:properties fo:margin-left="1cm" fo:margin-right="0cm" fo:text-indent="-4.5cm" style:auto-text-indent="false">
+ <style:tab-stops>
+ <style:tab-stop style:position="0cm"/>
+ </style:tab-stops>
+ </style:properties>
+ </style:style>
+ <style:style style:name="Footnote Symbol" style:family="text"/>
+ <style:style style:name="Numbering Symbols" style:family="text"/>
+ <style:style style:name="Bullet Symbols" style:family="text">
+ <style:properties fo:font-size="9pt" style:font-size-asian="9pt" style:font-size-complex="9pt"/>
+ </style:style>
+ <style:style style:name="Internet link" style:family="text">
+ <style:properties fo:color="#000080" style:text-underline-color="font-color" style:text-underline="single"/>
+ </style:style>
+ <style:style style:name="Endnote Symbol" style:family="text"/>
+ <style:style style:name="Emphasis" style:family="text">
+ <style:properties fo:font-style="italic" style:font-style-asian="italic" style:font-style-complex="italic"/>
+ </style:style>
+ <style:style style:name="Source Text" style:family="text"/>
+ <style:style style:name="Highlight" style:family="text">
+ <style:properties style:text-background-color="#fff000"/>
+ </style:style>
+ <style:style style:name="KeyCap" style:family="text">
+ <style:properties fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="Command" style:family="text">
+ <style:properties fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="Application" style:family="text">
+ <style:properties fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="FileName" style:family="text">
+ <style:properties fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="SuperScript" style:family="text">
+ <style:properties style:text-position="super 58%"/>
+ </style:style>
+ <style:style style:name="SubScript" style:family="text">
+ <style:properties style:text-position="sub 58%"/>
+ </style:style>
+ <style:style style:name="SystemItem" style:family="text">
+ <style:properties fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="ComputerOutput" style:family="text">
+ <style:properties fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="KeyCombo" style:family="text">
+ <style:properties fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="KeySym" style:family="text">
+ <style:properties fo:font-weight="bold"/>
+ </style:style>
+ <style:style style:name="GuiMenu" style:family="text">
+ <style:properties fo:color="#000fff" fo:font-style="italic"/>
+ </style:style>
+ <style:style style:name="GuiSubMenu" style:family="text">
+ <style:properties fo:color="#ff9966" fo:font-style="italic"/>
+ </style:style>
+ <style:style style:name="GuiButton" style:family="text">
+ <style:properties fo:color="#00f0ff" fo:font-style="italic"/>
+ </style:style>
+ <style:style style:name="GuiMenuItem" style:family="text">
+ <style:properties fo:color="#00ffff" fo:font-style="italic"/>
+ </style:style>
+ <style:style style:name="GuiLabel" style:family="text">
+ <style:properties fo:color="#00777f" fo:font-style="italic"/>
+ </style:style>
+ <style:style style:name="Frame" style:family="graphics">
+ <style:properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" fo:margin-left="0.201cm" fo:margin-right="0.201cm" fo:margin-top="0.201cm" fo:margin-bottom="0.201cm" 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" fo:padding="0.15cm" fo:border="0.002cm solid #000000"/>
+ </style:style>
+ <text:outline-style>
+ <text:outline-level-style text:level="1" style:num-format=""/>
+ <text:outline-level-style text:level="2" style:num-format=""/>
+ <text:outline-level-style text:level="3" style:num-format=""/>
+ <text:outline-level-style text:level="4" style:num-format=""/>
+ <text:outline-level-style text:level="5" style:num-format=""/>
+ <text:outline-level-style text:level="6" style:num-format=""/>
+ <text:outline-level-style text:level="7" style:num-format=""/>
+ <text:outline-level-style text:level="8" style:num-format=""/>
+ <text:outline-level-style text:level="9" style:num-format=""/>
+ <text:outline-level-style text:level="10" style:num-format=""/>
+ </text:outline-style>
+ <text:list-style style:name="Ordered List">
+ <text:list-level-style-number text:level="1" text:style-name="Numbering Symbols" style:num-suffix="." style:num-format="1">
+ <style:properties text:min-label-width="0.499cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="2" style:num-suffix="." style:num-format="1">
+ <style:properties text:space-before="0.501cm" text:min-label-width="0.499cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="3" style:num-suffix="." style:num-format="1">
+ <style:properties text:space-before="1cm" text:min-label-width="0.499cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="4" style:num-suffix="." style:num-format="1">
+ <style:properties text:space-before="1.501cm" text:min-label-width="0.499cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="5" style:num-suffix="." style:num-format="1">
+ <style:properties text:space-before="2cm" text:min-label-width="0.499cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="6" style:num-suffix="." style:num-format="1">
+ <style:properties text:space-before="2.501cm" text:min-label-width="0.499cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="7" style:num-suffix="." style:num-format="1">
+ <style:properties text:space-before="3.001cm" text:min-label-width="0.499cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="8" style:num-suffix="." style:num-format="1">
+ <style:properties text:space-before="3.502cm" text:min-label-width="0.499cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="9" style:num-suffix="." style:num-format="1">
+ <style:properties text:space-before="4.001cm" text:min-label-width="0.499cm"/>
+ </text:list-level-style-number>
+ <text:list-level-style-number text:level="10" style:num-suffix="." style:num-format="1">
+ <style:properties text:space-before="4.502cm" text:min-label-width="0.499cm"/>
+ </text:list-level-style-number>
+ </text:list-style>
+ <text:list-style style:name="UnOrdered List">
+ <text:list-level-style-bullet text:level="1" text:style-name="Bullet Symbols" text:bullet-char="•">
+ <style:properties text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="2" text:style-name="Bullet Symbols" text:bullet-char="•">
+ <style:properties text:space-before="0.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="3" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="1cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="4" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="1.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="5" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="2cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="6" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="2.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="7" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="3.001cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="8" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="3.502cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="9" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="4.001cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="10" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="4.502cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ </text:list-style>
+ <text:list-style style:name="Var List">
+ <text:list-level-style-bullet text:level="1" text:style-name="Bullet Symbols" text:bullet-char="•">
+ <style:properties text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="2" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="0.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="3" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="1cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="4" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="1.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="5" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="2cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="6" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="2.501cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="7" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="3.001cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="8" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="3.502cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="9" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="4.001cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ <text:list-level-style-bullet text:level="10" text:style-name="Bullet Symbols" style:num-suffix="." text:bullet-char="•">
+ <style:properties text:space-before="4.502cm" text:min-label-width="0.499cm" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </text:list-level-style-bullet>
+ </text:list-style>
+ <text:footnotes-configuration text:citation-style-name="Footnote Symbol" style:num-format="1" text:start-value="0" text:footnotes-position="page" text:start-numbering-at="page"/>
+ <text:endnotes-configuration text:citation-style-name="Endnote Symbol" text:master-page-name="Endnote" style:num-format="1" text:start-value="0"/>
+ <text:linenumbering-configuration text:number-lines="false" text:offset="0.499cm" style:num-format="1" text:number-position="left" text:increment="5"/>
+ </office:styles>
+ <office:automatic-styles>
+ <style:page-master style:name="pm1">
+ <style:properties fo:page-width="20.999cm" fo:page-height="29.699cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2.54cm" fo:margin-bottom="2.54cm" fo:margin-left="3.175cm" fo:margin-right="3.175cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
+ <style:footnote-sep style:width="0.018cm" style:distance-before-sep="0.101cm" style:distance-after-sep="0.101cm" style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:properties>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-master>
+ <style:page-master style:name="pm2">
+ <style:properties fo:page-width="20.999cm" fo:page-height="29.699cm" style:num-format="1" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb" style:footnote-max-height="0cm">
+ <style:footnote-sep style:adjustment="left" style:rel-width="25%" style:color="#000000"/>
+ </style:properties>
+ <style:header-style/>
+ <style:footer-style/>
+ </style:page-master>
+ </office:automatic-styles>
+ <office:master-styles>
+ <style:master-page style:name="Standard" style:page-master-name="pm1"/>
+ <style:master-page style:name="Endnote" style:page-master-name="pm2"/>
+ </office:master-styles>
+ <office:body>
+ <xsl:apply-templates/>
+ </office:body>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="subtitle">
+ <xsl:choose>
+ <xsl:when test="parent::table">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="parent::informaltable">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="text:p">
+ <xsl:attribute name="text:style-name">Section SubTitle</xsl:attribute>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+
+
+ <xsl:template match="title">
+ <xsl:choose>
+ <xsl:when test="parent::figure"></xsl:when>
+ <xsl:when test="parent::table"></xsl:when>
+ <xsl:when test="parent::sect1"></xsl:when>
+ <xsl:when test="parent::sect2"></xsl:when>
+ <xsl:when test="parent::sect3"></xsl:when>
+ <xsl:when test="parent::sect4"></xsl:when>
+ <xsl:when test="parent::sect5"></xsl:when>
+ <xsl:when test="parent::informaltable">
+ <xsl:apply-templates/>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:element name="text:p">
+ <xsl:choose>
+
+ <xsl:when test="parent::appendix">
+ <xsl:attribute name="text:style-name">Appendix Title</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="articleinfo">
+ <xsl:element name="text:section">
+ <xsl:attribute name="text:style-name">ArticleInfo</xsl:attribute>
+ <xsl:attribute name="text:name">ArticleInfo</xsl:attribute>
+ <xsl:if test="/article/articleinfo/title !=''">
+ <xsl:element name="text:p">
+ <xsl:attribute name="text:style-name">Document Title</xsl:attribute>
+ <xsl:value-of select="/article/articleinfo/title"/>
+ </xsl:element>
+ <xsl:if test="/article/articleinfo/subtitle !=''">
+ <xsl:element name="text:p">
+ <xsl:attribute name="text:style-name">Document SubTitle</xsl:attribute>
+ <xsl:value-of select="/article/articleinfo/subtitle"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:element>
+
+ </xsl:template>
+
+ <xsl:template match="appendix">
+ <xsl:element name="text:section">
+ <xsl:attribute name="text:style-name">Appendix</xsl:attribute>
+ <xsl:attribute name="text:name">Appendix</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+
+ </xsl:template>
<!--
<xsl:template match="author">
- <xsl:apply-templates/>
+ <xsl:apply-templates/>
</xsl:template>
<xsl:template match="firstname">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:name">
- <xsl:if test="ancestor::articleinfo/author">
- <xsl:text disable-output-escaping="yes">articleinfo.author</xsl:text><xsl:value-of select="count(parent::author[preceding-sibling::author])"/><xsl:text disable-output-escaping="yes">.firstname</xsl:text><xsl:value-of select="count(preceding-sibling::firstname)"/>
- </xsl:if>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:name">
+ <xsl:if test="ancestor::articleinfo/author">
+ <xsl:text disable-output-escaping="yes">articleinfo.author</xsl:text><xsl:value-of select="count(parent::author[preceding-sibling::author])"/><xsl:text disable-output-escaping="yes">.firstname</xsl:text><xsl:value-of select="count(preceding-sibling::firstname)"/>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
</xsl:template>-->
- <xsl:template match="articleinfo/title">
- <!-- <xsl:element name="text:variable-decls">
- <xsl:element name="text:variable-decl">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.title</xsl:text>
- </xsl:attribute>
- </xsl:element>
-
- </xsl:element>
- <xsl:element name="text:p">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.title</xsl:text>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>--></xsl:template>
-
- <xsl:template match="articleinfo/subtitle">
- <xsl:element name="text:variable-decls">
- <xsl:element name="text:variable-decl">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.subtitle</xsl:text>
- </xsl:attribute>
- </xsl:element>
- </xsl:element>
- <xsl:element name="text:p">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.subtitle</xsl:text>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="articleinfo/edition">
- <xsl:element name="text:variable-decls">
- <xsl:element name="text:variable-decl">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.edition</xsl:text>
- </xsl:attribute>
- </xsl:element>
- </xsl:element>
- <xsl:element name="text:p">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.edition</xsl:text>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="articleinfo/releaseinfo">
- <xsl:element name="text:variable-decls">
- <xsl:element name="text:variable-decl">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.releaseinfo_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::releaseinfo)"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:element>
- <xsl:element name="text:p">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.releaseinfo_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::releaseinfo)"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match="author/firstname">
- <xsl:element name="text:variable-decls">
- <xsl:element name="text:variable-decl">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
-
- <xsl:attribute name="text:name">
- <xsl:if test="ancestor::articleinfo">
- <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
- <xsl:value-of select="count(parent::author[preceding-sibling::author])"/>
- <xsl:text disable-output-escaping="yes">.firstname_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::firstname)"/>
- </xsl:if>
- </xsl:attribute>
- </xsl:element>
- </xsl:element>
- <xsl:element name="text:p">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:if test="ancestor::articleinfo">
- <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
- <xsl:value-of select="count(parent::author[preceding-sibling::author])"/>
- <xsl:text disable-output-escaping="yes">.firstname_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::firstname)"/>
- </xsl:if>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
-
-
- <xsl:template match="articleinfo/copyright/year">
- <xsl:element name="text:variable-decls">
- <xsl:element name="text:variable-decl">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
-
- <xsl:attribute name="text:name">
- <xsl:if test="ancestor::articleinfo/copyright">
- <xsl:text disable-output-escaping="yes">articleinfo.copyright_</xsl:text>
- <xsl:value-of select="count(parent::copyright[preceding-sibling::copyright])"/>
- <xsl:text disable-output-escaping="yes">.year_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::year)"/>
- </xsl:if>
- </xsl:attribute>
- </xsl:element>
- </xsl:element>
- <xsl:element name="text:p">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:if test="ancestor::articleinfo/copyright">
- <xsl:text disable-output-escaping="yes">articleinfo.copyright_</xsl:text>
- <xsl:value-of select="count(parent::copyright[preceding-sibling::copyright])"/>
- <xsl:text disable-output-escaping="yes">.year_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::year)"/>
- </xsl:if>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="authorgroup">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="articleinfo/copyright/holder">
- <xsl:element name="text:variable-decls">
- <xsl:element name="text:variable-decl">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
-
- <xsl:attribute name="text:name">
- <xsl:if test="ancestor::articleinfo/copyright">
- <xsl:text disable-output-escaping="yes">articleinfo.copyright_</xsl:text>
- <xsl:value-of select="count(parent::copyright[preceding-sibling::copyright])"/>
- <xsl:text disable-output-escaping="yes">.holder_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::holder)"/>
- </xsl:if>
- </xsl:attribute>
- </xsl:element>
- </xsl:element>
- <xsl:element name="text:p">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:if test="ancestor::articleinfo/copyright">
- <xsl:text disable-output-escaping="yes">articleinfo.copyright_</xsl:text>
- <xsl:value-of select="count(parent::copyright[preceding-sibling::copyright])"/>
- <xsl:text disable-output-escaping="yes">.holder_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::holder)"/>
- </xsl:if>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
-
-
-
- <xsl:template name="affiliation">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="author/affiliation/address">
- <xsl:element name="text:variable-decls">
- <xsl:element name="text:variable-decl">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
- <xsl:value-of select="count(ancestor::author[preceding-sibling::author])"/>
- <xsl:text disable-output-escaping="yes">.affiliation_</xsl:text>
- <xsl:value-of select="count(parent::affiliation[preceding-sibling::affiliation])"/>
- <xsl:text disable-output-escaping="yes">.address_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::address)"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:element>
- <xsl:element name="text:p">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
- <xsl:value-of select="count(ancestor::author[preceding-sibling::author])"/>
- <xsl:text disable-output-escaping="yes">.affiliation_</xsl:text>
- <xsl:value-of select="count(parent::affiliation[preceding-sibling::affiliation])"/>
- <xsl:text disable-output-escaping="yes">.address_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::address)"/>
-
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="author/affiliation/orgname">
- <xsl:element name="text:variable-decls">
- <xsl:element name="text:variable-decl">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:if test="ancestor::articleinfo">
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
- <xsl:value-of select="count(ancestor::author[preceding-sibling::author])"/>
- <xsl:text disable-output-escaping="yes">.affiliation_</xsl:text>
- <xsl:value-of select="count(parent::affiliation[preceding-sibling::affiliation])"/>
- <xsl:text disable-output-escaping="yes">.orgname_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::orgname)"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- <xsl:element name="text:p">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:if test="ancestor::articleinfo">
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
- <xsl:value-of select="count(ancestor::author[preceding-sibling::author])"/>
- <xsl:text disable-output-escaping="yes">.affiliation_</xsl:text>
- <xsl:value-of select="count(parent::affiliation[preceding-sibling::affiliation])"/>
- <xsl:text disable-output-escaping="yes">.orgname_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::orgname)"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
-
-
- <xsl:template match="author/surname">
- <xsl:element name="text:variable-decls">
- <xsl:element name="text:variable-decl">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
-
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
- <xsl:value-of select="count(parent::author[preceding-sibling::author])"/>
- <xsl:text disable-output-escaping="yes">.surname_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::surname)"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:element>
- <xsl:element name="text:p">
- <xsl:element name="text:variable-set">
- <xsl:attribute name="text:value-type">
- <xsl:text>string</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="text:name">
- <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
- <xsl:value-of select="count(parent::author[preceding-sibling::author])"/>
- <xsl:text disable-output-escaping="yes">.surname_</xsl:text>
- <xsl:value-of select="count(preceding-sibling::surname)"/>
-
-
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
-
-
-
-
- <xsl:template match="para">
-
- <xsl:element name="text:p">
-
- <xsl:choose>
- <xsl:when test="ancestor-or-self::footnote">
- <xsl:attribute name="text:style-name">Footnote</xsl:attribute>
- </xsl:when>
- <xsl:when test="ancestor-or-self::listitem">
- <xsl:attribute name="text:style-name">VarList Item</xsl:attribute>
- </xsl:when>
- <xsl:when test="ancestor-or-self::informaltable">
- <xsl:if test="ancestor-or-self::informaltable">
- <xsl:attribute name="text:style-name">Table Contents</xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::thead">
- <xsl:attribute name="text:style-name">Table Heading</xsl:attribute>
- </xsl:if>
- </xsl:when>
- <xsl:when test="ancestor-or-self::table">
- <xsl:if test="ancestor-or-self::table">
- <xsl:attribute name="text:style-name">Table Contents</xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::thead">
- <xsl:attribute name="text:style-name">Table Heading</xsl:attribute>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="text:style-name">Text body</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:apply-templates/>
- </xsl:element>
-
- </xsl:template>
-
- <xsl:template match="section">
- <xsl:element name="text:h">
- <xsl:attribute name="text:level">
- <xsl:value-of select="count(ancestor-or-self::section)"/>
- </xsl:attribute>
- <xsl:value-of select="child::title"/>
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="abstract">
- <xsl:element name="text:h">
- <xsl:attribute name="text:level">1</xsl:attribute>
- <xsl:text>abstract</xsl:text>
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:template>
-
-
- <xsl:template match="appendix">
- <xsl:element name="text:h">
- <xsl:attribute name="text:level">1</xsl:attribute>
- <xsl:text>appendix</xsl:text>
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="sect1">
- <xsl:element name="text:h">
- <xsl:attribute name="text:level">1</xsl:attribute>
- <xsl:attribute name="text:style-name">Heading 1</xsl:attribute>
- <xsl:value-of select="child::title"/>
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="sect2">
- <xsl:element name="text:h">
- <xsl:attribute name="text:level">2</xsl:attribute>
- <xsl:attribute name="text:style-name">Heading 2</xsl:attribute>
- <xsl:value-of select="child::title"/>
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="sect3">
- <xsl:element name="text:h">
- <xsl:attribute name="text:level">3</xsl:attribute>
- <xsl:attribute name="text:style-name">Heading 3</xsl:attribute>
- <xsl:value-of select="child::title"/>
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="sect4">
- <xsl:element name="text:h">
- <xsl:attribute name="text:level">4</xsl:attribute>
- <xsl:attribute name="text:style-name">Heading 4</xsl:attribute>
- <xsl:value-of select="child::title"/>
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="sect5">
- <xsl:element name="text:h">
- <xsl:attribute name="text:level">5</xsl:attribute>
- <xsl:value-of select="child::title"/>
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:template>
+ <xsl:template match="articleinfo/title">
+ <!-- <xsl:element name="text:variable-decls">
+ <xsl:element name="text:variable-decl">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.title</xsl:text>
+ </xsl:attribute>
+ </xsl:element>
+
+ </xsl:element>
+ <xsl:element name="text:p">
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.title</xsl:text>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>--></xsl:template>
+
+ <xsl:template match="articleinfo/subtitle">
+ <xsl:element name="text:variable-decls">
+ <xsl:element name="text:variable-decl">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.subtitle</xsl:text>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="text:p">
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.subtitle</xsl:text>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="articleinfo/edition">
+ <xsl:element name="text:variable-decls">
+ <xsl:element name="text:variable-decl">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.edition</xsl:text>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="text:p">
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.edition</xsl:text>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="articleinfo/releaseinfo">
+ <xsl:element name="text:variable-decls">
+ <xsl:element name="text:variable-decl">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.releaseinfo_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::releaseinfo)"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="text:p">
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.releaseinfo_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::releaseinfo)"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+
+ <xsl:template match="author/firstname">
+ <xsl:element name="text:variable-decls">
+ <xsl:element name="text:variable-decl">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+
+ <xsl:attribute name="text:name">
+ <xsl:if test="ancestor::articleinfo">
+ <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
+ <xsl:value-of select="count(parent::author[preceding-sibling::author])"/>
+ <xsl:text disable-output-escaping="yes">.firstname_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::firstname)"/>
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="text:p">
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:if test="ancestor::articleinfo">
+ <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
+ <xsl:value-of select="count(parent::author[preceding-sibling::author])"/>
+ <xsl:text disable-output-escaping="yes">.firstname_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::firstname)"/>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+
+
+ <xsl:template match="articleinfo/copyright/year">
+ <xsl:element name="text:variable-decls">
+ <xsl:element name="text:variable-decl">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+
+ <xsl:attribute name="text:name">
+ <xsl:if test="ancestor::articleinfo/copyright">
+ <xsl:text disable-output-escaping="yes">articleinfo.copyright_</xsl:text>
+ <xsl:value-of select="count(parent::copyright[preceding-sibling::copyright])"/>
+ <xsl:text disable-output-escaping="yes">.year_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::year)"/>
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="text:p">
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:if test="ancestor::articleinfo/copyright">
+ <xsl:text disable-output-escaping="yes">articleinfo.copyright_</xsl:text>
+ <xsl:value-of select="count(parent::copyright[preceding-sibling::copyright])"/>
+ <xsl:text disable-output-escaping="yes">.year_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::year)"/>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="authorgroup">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="articleinfo/copyright/holder">
+ <xsl:element name="text:variable-decls">
+ <xsl:element name="text:variable-decl">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+
+ <xsl:attribute name="text:name">
+ <xsl:if test="ancestor::articleinfo/copyright">
+ <xsl:text disable-output-escaping="yes">articleinfo.copyright_</xsl:text>
+ <xsl:value-of select="count(parent::copyright[preceding-sibling::copyright])"/>
+ <xsl:text disable-output-escaping="yes">.holder_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::holder)"/>
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="text:p">
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:if test="ancestor::articleinfo/copyright">
+ <xsl:text disable-output-escaping="yes">articleinfo.copyright_</xsl:text>
+ <xsl:value-of select="count(parent::copyright[preceding-sibling::copyright])"/>
+ <xsl:text disable-output-escaping="yes">.holder_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::holder)"/>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+
+
+
+ <xsl:template name="affiliation">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="author/affiliation/address">
+ <xsl:element name="text:variable-decls">
+ <xsl:element name="text:variable-decl">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
+ <xsl:value-of select="count(ancestor::author[preceding-sibling::author])"/>
+ <xsl:text disable-output-escaping="yes">.affiliation_</xsl:text>
+ <xsl:value-of select="count(parent::affiliation[preceding-sibling::affiliation])"/>
+ <xsl:text disable-output-escaping="yes">.address_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::address)"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="text:p">
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
+ <xsl:value-of select="count(ancestor::author[preceding-sibling::author])"/>
+ <xsl:text disable-output-escaping="yes">.affiliation_</xsl:text>
+ <xsl:value-of select="count(parent::affiliation[preceding-sibling::affiliation])"/>
+ <xsl:text disable-output-escaping="yes">.address_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::address)"/>
+
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="author/affiliation/orgname">
+ <xsl:element name="text:variable-decls">
+ <xsl:element name="text:variable-decl">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:if test="ancestor::articleinfo">
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
+ <xsl:value-of select="count(ancestor::author[preceding-sibling::author])"/>
+ <xsl:text disable-output-escaping="yes">.affiliation_</xsl:text>
+ <xsl:value-of select="count(parent::affiliation[preceding-sibling::affiliation])"/>
+ <xsl:text disable-output-escaping="yes">.orgname_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::orgname)"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="text:p">
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:if test="ancestor::articleinfo">
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
+ <xsl:value-of select="count(ancestor::author[preceding-sibling::author])"/>
+ <xsl:text disable-output-escaping="yes">.affiliation_</xsl:text>
+ <xsl:value-of select="count(parent::affiliation[preceding-sibling::affiliation])"/>
+ <xsl:text disable-output-escaping="yes">.orgname_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::orgname)"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+
+
+ <xsl:template match="author/surname">
+ <xsl:element name="text:variable-decls">
+ <xsl:element name="text:variable-decl">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
+ <xsl:value-of select="count(parent::author[preceding-sibling::author])"/>
+ <xsl:text disable-output-escaping="yes">.surname_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::surname)"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="text:p">
+ <xsl:element name="text:variable-set">
+ <xsl:attribute name="text:value-type">
+ <xsl:text>string</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="text:name">
+ <xsl:text disable-output-escaping="yes">articleinfo.author_</xsl:text>
+ <xsl:value-of select="count(parent::author[preceding-sibling::author])"/>
+ <xsl:text disable-output-escaping="yes">.surname_</xsl:text>
+ <xsl:value-of select="count(preceding-sibling::surname)"/>
+
+
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+
+
+
+
+ <xsl:template match="para">
+
+ <xsl:element name="text:p">
+
+ <xsl:choose>
+ <xsl:when test="ancestor-or-self::footnote">
+ <xsl:attribute name="text:style-name">Footnote</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="ancestor-or-self::listitem">
+ <xsl:attribute name="text:style-name">VarList Item</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="ancestor-or-self::informaltable">
+ <xsl:if test="ancestor-or-self::informaltable">
+ <xsl:attribute name="text:style-name">Table Contents</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::thead">
+ <xsl:attribute name="text:style-name">Table Heading</xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="ancestor-or-self::table">
+ <xsl:if test="ancestor-or-self::table">
+ <xsl:attribute name="text:style-name">Table Contents</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::thead">
+ <xsl:attribute name="text:style-name">Table Heading</xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="text:style-name">Text body</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:apply-templates/>
+ </xsl:element>
+
+ </xsl:template>
+
+ <xsl:template match="section">
+ <xsl:element name="text:h">
+ <xsl:attribute name="text:level">
+ <xsl:value-of select="count(ancestor-or-self::section)"/>
+ </xsl:attribute>
+ <xsl:value-of select="child::title"/>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="abstract">
+ <xsl:element name="text:h">
+ <xsl:attribute name="text:level">1</xsl:attribute>
+ <xsl:text>abstract</xsl:text>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+
+ <xsl:template match="appendix">
+ <xsl:element name="text:h">
+ <xsl:attribute name="text:level">1</xsl:attribute>
+ <xsl:text>appendix</xsl:text>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="sect1">
+ <xsl:element name="text:h">
+ <xsl:attribute name="text:level">1</xsl:attribute>
+ <xsl:attribute name="text:style-name">Heading 1</xsl:attribute>
+ <xsl:value-of select="child::title"/>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="sect2">
+ <xsl:element name="text:h">
+ <xsl:attribute name="text:level">2</xsl:attribute>
+ <xsl:attribute name="text:style-name">Heading 2</xsl:attribute>
+ <xsl:value-of select="child::title"/>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="sect3">
+ <xsl:element name="text:h">
+ <xsl:attribute name="text:level">3</xsl:attribute>
+ <xsl:attribute name="text:style-name">Heading 3</xsl:attribute>
+ <xsl:value-of select="child::title"/>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="sect4">
+ <xsl:element name="text:h">
+ <xsl:attribute name="text:level">4</xsl:attribute>
+ <xsl:attribute name="text:style-name">Heading 4</xsl:attribute>
+ <xsl:value-of select="child::title"/>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="sect5">
+ <xsl:element name="text:h">
+ <xsl:attribute name="text:level">5</xsl:attribute>
+ <xsl:value-of select="child::title"/>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:template>
<!--<xsl:template match="sect5">
- <xsl:element name="text:section">
- <xsl:attribute name="text:style-name">Sect1</xsl:attribute>
- <xsl:attribute name="text:name"><xsl:value-of select="@id"/></xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
+ <xsl:element name="text:section">
+ <xsl:attribute name="text:style-name">Sect1</xsl:attribute>
+ <xsl:attribute name="text:name"><xsl:value-of select="@id"/></xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
</xsl:template>-->
- <xsl:template match="informaltable">
- <xsl:element name="table:table">
- <xsl:attribute name="table:name"></xsl:attribute>
- <xsl:attribute name="table:style-name">Table1</xsl:attribute>
- <xsl:attribute name="table:name">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match="table">
- <xsl:variable name="tabletitle">
- <xsl:value-of select="title"/>
- </xsl:variable>
- <xsl:element name="table:table">
- <xsl:attribute name="table:name"></xsl:attribute>
- <xsl:attribute name="table:style-name">Table1</xsl:attribute>
- <xsl:attribute name="table:name">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- <xsl:if test="not($tabletitle='')">
- <xsl:element name="text:p">
- <xsl:attribute name="text:style-name">Table</xsl:attribute>
- <xsl:value-of select="$tabletitle"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="tgroup">
- <xsl:element name="table:table-column">
- <xsl:attribute name="table:style-name">Table1.A</xsl:attribute>
- <xsl:choose>
- <xsl:when test="@cols >0">
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="@cols"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="count(child::tbody/row/entry) div count(child::tbody/row)"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:apply-templates/>
- </xsl:template>
-
-
- <xsl:template match="indexterm"></xsl:template>
-
- <xsl:template match="thead">
- <xsl:element name="table:table-header-rows">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="tbody">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="row">
- <xsl:element name="table:table-row">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="entry">
- <xsl:element name="table:table-cell">
- <xsl:if test="ancestor-or-self::thead">
- <xsl:attribute name="table:style-name">Table1.A1</xsl:attribute>
- </xsl:if>
- <xsl:if test="not(ancestor-or-self::thead)">
- <xsl:attribute name="table:style-name">Table1.A2</xsl:attribute>
- </xsl:if>
-
- <xsl:choose>
- <xsl:when test="@spanname">
- <!--<xsl:if test="@spanname">-->
- <xsl:variable name="sname">
- <xsl:value-of select="@spanname"/>
- </xsl:variable>
- <xsl:attribute name="table:number-columns-spanned">
- <xsl:variable name="colnamestart">
- <xsl:value-of select="ancestor::tgroup/spanspec[@spanname=$sname]/@namest"/>
- </xsl:variable>
- <xsl:variable name="colnameend">
- <xsl:value-of select="ancestor::tgroup/spanspec[@spanname=$sname]/@nameend"/>
- </xsl:variable>
- <xsl:variable name="colnumstart">
- <xsl:value-of select="ancestor::tgroup/colspec[@colname=$colnamestart]/@colnum"/>
- </xsl:variable>
- <xsl:variable name="colnumend">
- <xsl:value-of select="ancestor::tgroup/colspec[@colname=$colnameend]/@colnum"/>
- </xsl:variable>
- <xsl:value-of select="$colnumend - $colnumstart + 1"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="@namest and @nameend">
- <!--<xsl:if test="@namest and @nameend">-->
- <xsl:variable name="colnamestart">
- <xsl:value-of select="@namest"/>
- </xsl:variable>
- <xsl:variable name="colnameend">
- <xsl:value-of select="@nameend"/>
- </xsl:variable>
-
- <xsl:attribute name="table:number-columns-spanned">
- <xsl:variable name="colnumstart">
- <xsl:value-of select="ancestor::tgroup/colspec[@colname=$colnamestart]/@colnum"/>
- </xsl:variable>
- <xsl:variable name="colnumend">
- <xsl:value-of select="ancestor::tgroup/colspec[@colname=$colnameend]/@colnum"/>
- </xsl:variable>
- <xsl:value-of select="$colnumend - $colnumstart + 1"/>
-
- </xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <!--
- <xsl:if test="not(@namest = '' ) ">
- <xsl:attribute name="table:number-columns-spanned">
- <xsl:value-of select="(substring-after(@nameend,'c')-substring-after(@namest,'c'))+1"/>
-
- </xsl:attribute>
- </xsl:if>
- -->
- <xsl:choose>
- <xsl:when test="not(child::para)">
- <xsl:element name="text:p">
- <xsl:if test="ancestor-or-self::thead">
- <xsl:attribute name="text:style-name">Table Heading</xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::tbody">
- <xsl:attribute name="text:style-name">Table Contents</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:template>
-
-
-
-
-
-
- <xsl:template match="figure">
- <xsl:apply-templates/>
- </xsl:template>
+ <xsl:template match="informaltable">
+ <xsl:element name="table:table">
+ <xsl:attribute name="table:name"></xsl:attribute>
+ <xsl:attribute name="table:style-name">Table1</xsl:attribute>
+ <xsl:attribute name="table:name">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+
+ <xsl:template match="table">
+ <xsl:variable name="tabletitle">
+ <xsl:value-of select="title"/>
+ </xsl:variable>
+ <xsl:element name="table:table">
+ <xsl:attribute name="table:name"></xsl:attribute>
+ <xsl:attribute name="table:style-name">Table1</xsl:attribute>
+ <xsl:attribute name="table:name">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ <xsl:if test="not($tabletitle='')">
+ <xsl:element name="text:p">
+ <xsl:attribute name="text:style-name">Table</xsl:attribute>
+ <xsl:value-of select="$tabletitle"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="tgroup">
+ <xsl:element name="table:table-column">
+ <xsl:attribute name="table:style-name">Table1.A</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@cols >0">
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="@cols"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="count(child::tbody/row/entry) div count(child::tbody/row)"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:apply-templates/>
+ </xsl:template>
+
+
+ <xsl:template match="indexterm"></xsl:template>
+
+ <xsl:template match="thead">
+ <xsl:element name="table:table-header-rows">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="tbody">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="row">
+ <xsl:element name="table:table-row">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="entry">
+ <xsl:element name="table:table-cell">
+ <xsl:if test="ancestor-or-self::thead">
+ <xsl:attribute name="table:style-name">Table1.A1</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(ancestor-or-self::thead)">
+ <xsl:attribute name="table:style-name">Table1.A2</xsl:attribute>
+ </xsl:if>
+
+ <xsl:choose>
+ <xsl:when test="@spanname">
+ <!--<xsl:if test="@spanname">-->
+ <xsl:variable name="sname">
+ <xsl:value-of select="@spanname"/>
+ </xsl:variable>
+ <xsl:attribute name="table:number-columns-spanned">
+ <xsl:variable name="colnamestart">
+ <xsl:value-of select="ancestor::tgroup/spanspec[@spanname=$sname]/@namest"/>
+ </xsl:variable>
+ <xsl:variable name="colnameend">
+ <xsl:value-of select="ancestor::tgroup/spanspec[@spanname=$sname]/@nameend"/>
+ </xsl:variable>
+ <xsl:variable name="colnumstart">
+ <xsl:value-of select="ancestor::tgroup/colspec[@colname=$colnamestart]/@colnum"/>
+ </xsl:variable>
+ <xsl:variable name="colnumend">
+ <xsl:value-of select="ancestor::tgroup/colspec[@colname=$colnameend]/@colnum"/>
+ </xsl:variable>
+ <xsl:value-of select="$colnumend - $colnumstart + 1"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@namest and @nameend">
+ <!--<xsl:if test="@namest and @nameend">-->
+ <xsl:variable name="colnamestart">
+ <xsl:value-of select="@namest"/>
+ </xsl:variable>
+ <xsl:variable name="colnameend">
+ <xsl:value-of select="@nameend"/>
+ </xsl:variable>
+
+ <xsl:attribute name="table:number-columns-spanned">
+ <xsl:variable name="colnumstart">
+ <xsl:value-of select="ancestor::tgroup/colspec[@colname=$colnamestart]/@colnum"/>
+ </xsl:variable>
+ <xsl:variable name="colnumend">
+ <xsl:value-of select="ancestor::tgroup/colspec[@colname=$colnameend]/@colnum"/>
+ </xsl:variable>
+ <xsl:value-of select="$colnumend - $colnumstart + 1"/>
+
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <!--
+ <xsl:if test="not(@namest = '' ) ">
+ <xsl:attribute name="table:number-columns-spanned">
+ <xsl:value-of select="(substring-after(@nameend,'c')-substring-after(@namest,'c'))+1"/>
+
+ </xsl:attribute>
+ </xsl:if>
+ -->
+ <xsl:choose>
+ <xsl:when test="not(child::para)">
+ <xsl:element name="text:p">
+ <xsl:if test="ancestor-or-self::thead">
+ <xsl:attribute name="text:style-name">Table Heading</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::tbody">
+ <xsl:attribute name="text:style-name">Table Contents</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:template>
+
+
+
+
+
+
+ <xsl:template match="figure">
+ <xsl:apply-templates/>
+ </xsl:template>
<!-- lists Section -->
- <xsl:template match="itemizedlist">
- <xsl:element name="text:unordered-list">
- <xsl:if test="not(ancestor::itemizedlist)">
- <xsl:attribute name="text:style-name">L1</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="variablelist">
- <xsl:element name="text:unordered-list">
- <xsl:attribute name="text:style-name">Var List</xsl:attribute>
- <xsl:attribute name="text:continue-numbering">false</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="orderedlist">
- <xsl:element name="text:ordered-list">
- <xsl:attribute name="text:style-name">Ordered List</xsl:attribute>
- <xsl:attribute name="text:continue-numbering">false</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="term">
- <xsl:if test="parent::varlistentry">
- <text:list-item>
- <xsl:element name="text:p">
- <xsl:attribute name="text:style-name">VarList Term</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </text:list-item>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="listitem">
- <text:list-item>
- <xsl:apply-templates/>
- </text:list-item>
- </xsl:template>
+ <xsl:template match="itemizedlist">
+ <xsl:element name="text:unordered-list">
+ <xsl:if test="not(ancestor::itemizedlist)">
+ <xsl:attribute name="text:style-name">L1</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="variablelist">
+ <xsl:element name="text:unordered-list">
+ <xsl:attribute name="text:style-name">Var List</xsl:attribute>
+ <xsl:attribute name="text:continue-numbering">false</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="orderedlist">
+ <xsl:element name="text:ordered-list">
+ <xsl:attribute name="text:style-name">Ordered List</xsl:attribute>
+ <xsl:attribute name="text:continue-numbering">false</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="term">
+ <xsl:if test="parent::varlistentry">
+ <text:list-item>
+ <xsl:element name="text:p">
+ <xsl:attribute name="text:style-name">VarList Term</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </text:list-item>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="listitem">
+ <text:list-item>
+ <xsl:apply-templates/>
+ </text:list-item>
+ </xsl:template>
<!-- end of lists-->
- <xsl:template match="menuchoice">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="guimenuitem">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">GuiMenuItem</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="guibutton">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">GuiButton</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="guisubmenu">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">GuiSubMenu</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="emphasis">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">Emphasis</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match="guimenu">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">GuiMenu</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="guisubmenu">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">GuiSubMenu</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match="guilabel">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">GuiLabel</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="guibutton">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">GuiButton</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="keycap">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">KeyCap</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match="keysym">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">KeySym</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match="keycombo">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">KeyCombo</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="command">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">Command</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="application">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">Application</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="filename">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">FileName</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="systemitem">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">SystemItem</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="computeroutput">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">ComputerOutput</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="inlinegraphic">
- <xsl:element name="draw:image">
- <xsl:attribute name="draw:style-name">fr1</xsl:attribute>
- <xsl:attribute name="draw:name"></xsl:attribute>
- <xsl:attribute name="text:anchor-type"></xsl:attribute>
- <xsl:attribute name="draw:z-index"></xsl:attribute>
- <xsl:attribute name="xlink:href">
- <xsl:value-of select="@fileref"/>
- </xsl:attribute>
- <xsl:attribute name="xlink:type"></xsl:attribute>
- <xsl:attribute name="svg:width">
- <!--<xsl:value-of select="@width"/>-->
- <xsl:text>1cm</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="svg:height">
- <xsl:text>1cm</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="xlink:show">
- <xsl:text>embed</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="xlink:actuate">
- <xsl:text>onLoad</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="draw:filter-name">
- <xsl:text disable-output-escaping="yes">&lt;All formats&gt;</xsl:text>
- </xsl:attribute>
- </xsl:element>
- </xsl:template>
-
-
- <xsl:template match="footnote">
- <xsl:element name="text:footnote">
- <!--<xsl:element name="text:footnote-citation">Aidan</xsl:element>-->
- <xsl:element name="text:footnote-body">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="highlight">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">Highlight</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="ulink">
- <xsl:element name="text:a">
- <xsl:attribute name="xlink:type">
- <xsl:text>simple</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="xlink:href">
- <xsl:value-of select="@url"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
-
- </xsl:template>
-
- <xsl:template match="link">
- <xsl:element name="text:a">
- <xsl:attribute name="xlink:type">
- <xsl:text>simple</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="xlink:href">
- <xsl:text>#</xsl:text>
- <xsl:value-of select="@linkend"/>
- <xsl:text>%7Cregion</xsl:text>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
-
- </xsl:template>
-
- <xsl:template match="olink">
- <xsl:element name="text:a">
- <xsl:attribute name="xlink:type">
- <xsl:text>simple</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="xlink:href">
- <xsl:value-of select="@targetdocent"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="note">
- <office:annotation>
- <text:p>
- <xsl:apply-templates/>
- </text:p>
- </office:annotation>
- </xsl:template>
-
- <xsl:template match="imageobject">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="textobject"></xsl:template>
-
- <xsl:template match="caption">
- <xsl:apply-templates/>
- </xsl:template>
-
-
- <xsl:template match="imagedata">
- <xsl:element name="draw:image">
- <xsl:attribute name="draw:style-name">fr1</xsl:attribute>
- <xsl:attribute name="draw:name"></xsl:attribute>
- <xsl:attribute name="text:anchor-type"></xsl:attribute>
- <xsl:attribute name="draw:z-index"></xsl:attribute>
- <xsl:attribute name="xlink:href">
- <xsl:value-of select="@fileref"/>
- </xsl:attribute>
- <xsl:attribute name="xlink:type"></xsl:attribute>
- <xsl:attribute name="svg:width">
- <!--<xsl:value-of select="@width"/>-->
- <xsl:text>1cm</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="svg:height">
- <xsl:text>1cm</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="xlink:show">
- <xsl:text>embed</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="xlink:actuate">
- <xsl:text>onLoad</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="draw:filter-name">
- <xsl:text disable-output-escaping="yes">&lt;All formats&gt;</xsl:text>
- </xsl:attribute>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="audioobject">
- <xsl:element name="draw:plugin">
- <xsl:attribute name="draw:style-name">fr1</xsl:attribute>
- <xsl:attribute name="draw:name"></xsl:attribute>
- <xsl:attribute name="text:anchor-type"></xsl:attribute>
- <xsl:attribute name="draw:z-index"></xsl:attribute>
- <xsl:attribute name="xlink:href">
- <xsl:value-of select="@fileref"/>
- </xsl:attribute>
- <xsl:attribute name="xlink:type"></xsl:attribute>
- <xsl:attribute name="svg:width">
- <!--<xsl:value-of select="@width"/>-->
- <xsl:text>1cm</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="svg:height">
- <xsl:text>1cm</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="xlink:show">
- <xsl:text>embed</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="xlink:actuate">
- <xsl:text>onLoad</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="draw:filter-name">
- <xsl:text disable-output-escaping="yes">&lt;All formats&gt;</xsl:text>
- </xsl:attribute>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="remark">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="mediaobject">
- <xsl:element name="text:p">
- <xsl:attribute name="text:style-name">Mediaobject</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="superscript">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">SuperScript</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="subscript">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name">SubScript</xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="anchor">
- <xsl:element name="text:bookmark">
- <xsl:attribute name="text:name"><xsl:value-of select="@id"/></xsl:attribute>
- </xsl:element>
- </xsl:template>
+ <xsl:template match="menuchoice">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="guimenuitem">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">GuiMenuItem</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="guibutton">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">GuiButton</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="guisubmenu">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">GuiSubMenu</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="emphasis">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">Emphasis</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+
+ <xsl:template match="guimenu">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">GuiMenu</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="guisubmenu">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">GuiSubMenu</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+
+ <xsl:template match="guilabel">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">GuiLabel</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="guibutton">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">GuiButton</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="keycap">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">KeyCap</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+
+ <xsl:template match="keysym">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">KeySym</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+
+ <xsl:template match="keycombo">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">KeyCombo</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="command">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">Command</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="application">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">Application</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="filename">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">FileName</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="systemitem">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">SystemItem</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="computeroutput">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">ComputerOutput</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="inlinegraphic">
+ <xsl:element name="draw:image">
+ <xsl:attribute name="draw:style-name">fr1</xsl:attribute>
+ <xsl:attribute name="draw:name"></xsl:attribute>
+ <xsl:attribute name="text:anchor-type"></xsl:attribute>
+ <xsl:attribute name="draw:z-index"></xsl:attribute>
+ <xsl:attribute name="xlink:href">
+ <xsl:value-of select="@fileref"/>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:type"></xsl:attribute>
+ <xsl:attribute name="svg:width">
+ <!--<xsl:value-of select="@width"/>-->
+ <xsl:text>1cm</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="svg:height">
+ <xsl:text>1cm</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:show">
+ <xsl:text>embed</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:actuate">
+ <xsl:text>onLoad</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="draw:filter-name">
+ <xsl:text disable-output-escaping="yes">&lt;All formats&gt;</xsl:text>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+
+
+ <xsl:template match="footnote">
+ <xsl:element name="text:footnote">
+ <!--<xsl:element name="text:footnote-citation">Aidan</xsl:element>-->
+ <xsl:element name="text:footnote-body">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="highlight">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">Highlight</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="ulink">
+ <xsl:element name="text:a">
+ <xsl:attribute name="xlink:type">
+ <xsl:text>simple</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:href">
+ <xsl:value-of select="@url"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+
+ </xsl:template>
+
+ <xsl:template match="link">
+ <xsl:element name="text:a">
+ <xsl:attribute name="xlink:type">
+ <xsl:text>simple</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:href">
+ <xsl:text>#</xsl:text>
+ <xsl:value-of select="@linkend"/>
+ <xsl:text>%7Cregion</xsl:text>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+
+ </xsl:template>
+
+ <xsl:template match="olink">
+ <xsl:element name="text:a">
+ <xsl:attribute name="xlink:type">
+ <xsl:text>simple</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:href">
+ <xsl:value-of select="@targetdocent"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="note">
+ <office:annotation>
+ <text:p>
+ <xsl:apply-templates/>
+ </text:p>
+ </office:annotation>
+ </xsl:template>
+
+ <xsl:template match="imageobject">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="textobject"></xsl:template>
+
+ <xsl:template match="caption">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+
+ <xsl:template match="imagedata">
+ <xsl:element name="draw:image">
+ <xsl:attribute name="draw:style-name">fr1</xsl:attribute>
+ <xsl:attribute name="draw:name"></xsl:attribute>
+ <xsl:attribute name="text:anchor-type"></xsl:attribute>
+ <xsl:attribute name="draw:z-index"></xsl:attribute>
+ <xsl:attribute name="xlink:href">
+ <xsl:value-of select="@fileref"/>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:type"></xsl:attribute>
+ <xsl:attribute name="svg:width">
+ <!--<xsl:value-of select="@width"/>-->
+ <xsl:text>1cm</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="svg:height">
+ <xsl:text>1cm</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:show">
+ <xsl:text>embed</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:actuate">
+ <xsl:text>onLoad</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="draw:filter-name">
+ <xsl:text disable-output-escaping="yes">&lt;All formats&gt;</xsl:text>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="audioobject">
+ <xsl:element name="draw:plugin">
+ <xsl:attribute name="draw:style-name">fr1</xsl:attribute>
+ <xsl:attribute name="draw:name"></xsl:attribute>
+ <xsl:attribute name="text:anchor-type"></xsl:attribute>
+ <xsl:attribute name="draw:z-index"></xsl:attribute>
+ <xsl:attribute name="xlink:href">
+ <xsl:value-of select="@fileref"/>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:type"></xsl:attribute>
+ <xsl:attribute name="svg:width">
+ <!--<xsl:value-of select="@width"/>-->
+ <xsl:text>1cm</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="svg:height">
+ <xsl:text>1cm</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:show">
+ <xsl:text>embed</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="xlink:actuate">
+ <xsl:text>onLoad</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="draw:filter-name">
+ <xsl:text disable-output-escaping="yes">&lt;All formats&gt;</xsl:text>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="remark">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="mediaobject">
+ <xsl:element name="text:p">
+ <xsl:attribute name="text:style-name">Mediaobject</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="superscript">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">SuperScript</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="subscript">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name">SubScript</xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="anchor">
+ <xsl:element name="text:bookmark">
+ <xsl:attribute name="text:name"><xsl:value-of select="@id"/></xsl:attribute>
+ </xsl:element>
+ </xsl:template>
<!-- Change Made By Kevin Fowlks (fowlks@msu.edu) July 2nd, 2003 -->
- <xsl:template match="example">
- <xsl:element name="text:p">
- <xsl:attribute name="text:style-name">Example</xsl:attribute>
- <xsl:value-of select="programlisting"/>
- </xsl:element>
- </xsl:template>
+ <xsl:template match="example">
+ <xsl:element name="text:p">
+ <xsl:attribute name="text:style-name">Example</xsl:attribute>
+ <xsl:value-of select="programlisting"/>
+ </xsl:element>
+ </xsl:template>
</xsl:stylesheet> \ No newline at end of file
diff --git a/filter/source/docbook/sofftodocbookheadings.xsl b/filter/source/docbook/sofftodocbookheadings.xsl
index 1b6c4973bf76..a1e8ff0c7374 100644
--- a/filter/source/docbook/sofftodocbookheadings.xsl
+++ b/filter/source/docbook/sofftodocbookheadings.xsl
@@ -17,122 +17,122 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<xsl:stylesheet version="1.0" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:office="http://openoffice.org/2000/office" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:config="http://openoffice.org/2001/config" office:class="text" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="office meta table number dc fo xlink chart math script xsl draw svg dr3d form config text style">
- <xsl:output method="xml" indent="yes" omit-xml-declaration="no" version="1.0" encoding="UTF-8" doctype-public="-//OASIS//DTD DocBook XML V4.1.2//EN" doctype-system="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/>
-
-
- <!-- Heading will be mapped to sections.
- In OpenDocument headings are not nested, they do not embrace their related content, the XML hierarchy has to be restructured.
-
- Example of OpenDocument content:
-
- <office:body>
- <text:h text:style-name="Heading 1" text:level="1">Heading 1</text:h>
- <text:p text:style-name="Text body">Heading 1 Content</text:p>
- <text:h text:style-name="Heading 2" text:level="2">Heading 2</text:h>
- <text:p text:style-name="Text body">Heading 2 Content</text:p>
- <office:body>
-
- Example of DocBook content:
-
- <article lang="en-US">
- <sect1>
- <title>Heading 1</title>
- <para>Heading 1 Content</para>
- <sect2>
- <title>Heading 2</title>
- <para>Heading 2 Content</para>
- </sect2>
- </sect1>
- </article>
- -->
-
- <!-- The key function "nestedContent" returns all ODF elements that are children of the current heading (i.e. text:h) or their parent office:body in case there is no text:h.
- It works by matching all ODF elements, that text:h refer to (it's sibling or office:body childring)
- Various keyed element sets of these matched elements are being generated. A set is identified by having the same last (closest) preceding text:h or if none existent the parent document.
- All those elements, that have the current heading as last preceding heading (text:h) are returned as a nodeset.
- -->
- <xsl:key name="nestedContent"
- match="text:p | table:table | text:span | text:ordered-list | office:annotation | text:unordered-list | text:footnote | text:a | text:list-item | draw:plugin | draw:text-box | text:footnote-body | text:section"
- use="generate-id((.. | preceding::text:h)[last()])"/>
-
- <!-- The key function "nestedHeadings" returns a nodeset of all heading (text:h) elements, which belong to this heading (follow and have a higher outline number than the current text:h, which ID is given to the function) -->
- <xsl:key name="nestedHeadings"
- match="text:h"
- use="generate-id(preceding::text:h[@text:level &lt; current()/@text:level][1])"/>
-
- <!-- The key function "getHeadingsByOutline" returns all headings of a certain outline level -->
- <xsl:key name="getHeadingsByOutline"
- match="text:h"
- use="@text:level"/>
-
- <!-- A further problem during mapping of Heading to sections is the quantity of levels. In OpenDocument there can exist more than 4 hierarchies (outline levels).
- Furthermore an OpenDocument have not to start with heading outline level 1 nor does a outline level 2 have to follow.
- Therefore all possible existing heading outline levels from 1 to 10 have to be mapped to the section1 to section4 in DocBook.
- The lowest outline number is mapped section1, second is section2... until fourth and higher are all mapped to section4 -->
-
- <!-- Each global variable hold the outline level which has been mapped to one of the four sections in DocBook -->
- <xsl:variable name="section1_OutlineLevel">
- <xsl:call-template name="findOutlineLevel">
- <xsl:with-param name="candidateOutlineLevel" select="1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="section2_OutlineLevel">
- <xsl:call-template name="findOutlineLevel">
- <xsl:with-param name="candidateOutlineLevel" select="$section1_OutlineLevel + 1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="section3_OutlineLevel">
- <xsl:call-template name="findOutlineLevel">
- <xsl:with-param name="candidateOutlineLevel" select="$section2_OutlineLevel + 1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="section4_OutlineLevel">
- <xsl:call-template name="findOutlineLevel">
- <xsl:with-param name="candidateOutlineLevel" select="$section3_OutlineLevel + 1"/>
- </xsl:call-template>
- </xsl:variable>
-
- <!-- get the minimum available heading outline level (usually '1') -->
- <xsl:template name="findOutlineLevel">
- <xsl:param name="candidateOutlineLevel"/>
- <xsl:choose>
- <xsl:when test="key('getHeadingsByOutline', $candidateOutlineLevel)[1]/@text:level != ''">
- <xsl:value-of select="$candidateOutlineLevel"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$candidateOutlineLevel &lt; 11">
- <xsl:call-template name="findOutlineLevel">
- <xsl:with-param name="candidateOutlineLevel" select="$candidateOutlineLevel + 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- START -->
- <xsl:template match="/*">
- <xsl:element name="article">
- <xsl:attribute name="lang">
- <xsl:value-of select="/*/office:meta/dc:language"/>
- </xsl:attribute>
+ <xsl:output method="xml" indent="yes" omit-xml-declaration="no" version="1.0" encoding="UTF-8" doctype-public="-//OASIS//DTD DocBook XML V4.1.2//EN" doctype-system="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/>
+
+
+ <!-- Heading will be mapped to sections.
+ In OpenDocument headings are not nested, they do not embrace their related content, the XML hierarchy has to be restructured.
+
+ Example of OpenDocument content:
+
+ <office:body>
+ <text:h text:style-name="Heading 1" text:level="1">Heading 1</text:h>
+ <text:p text:style-name="Text body">Heading 1 Content</text:p>
+ <text:h text:style-name="Heading 2" text:level="2">Heading 2</text:h>
+ <text:p text:style-name="Text body">Heading 2 Content</text:p>
+ <office:body>
+
+ Example of DocBook content:
+
+ <article lang="en-US">
+ <sect1>
+ <title>Heading 1</title>
+ <para>Heading 1 Content</para>
+ <sect2>
+ <title>Heading 2</title>
+ <para>Heading 2 Content</para>
+ </sect2>
+ </sect1>
+ </article>
+ -->
+
+ <!-- The key function "nestedContent" returns all ODF elements that are children of the current heading (i.e. text:h) or their parent office:body in case there is no text:h.
+ It works by matching all ODF elements, that text:h refer to (it's sibling or office:body childring)
+ Various keyed element sets of these matched elements are being generated. A set is identified by having the same last (closest) preceding text:h or if none existent the parent document.
+ All those elements, that have the current heading as last preceding heading (text:h) are returned as a nodeset.
+ -->
+ <xsl:key name="nestedContent"
+ match="text:p | table:table | text:span | text:ordered-list | office:annotation | text:unordered-list | text:footnote | text:a | text:list-item | draw:plugin | draw:text-box | text:footnote-body | text:section"
+ use="generate-id((.. | preceding::text:h)[last()])"/>
+
+ <!-- The key function "nestedHeadings" returns a nodeset of all heading (text:h) elements, which belong to this heading (follow and have a higher outline number than the current text:h, which ID is given to the function) -->
+ <xsl:key name="nestedHeadings"
+ match="text:h"
+ use="generate-id(preceding::text:h[@text:level &lt; current()/@text:level][1])"/>
+
+ <!-- The key function "getHeadingsByOutline" returns all headings of a certain outline level -->
+ <xsl:key name="getHeadingsByOutline"
+ match="text:h"
+ use="@text:level"/>
+
+ <!-- A further problem during mapping of Heading to sections is the quantity of levels. In OpenDocument there can exist more than 4 hierarchies (outline levels).
+ Furthermore an OpenDocument have not to start with heading outline level 1 nor does a outline level 2 have to follow.
+ Therefore all possible existing heading outline levels from 1 to 10 have to be mapped to the section1 to section4 in DocBook.
+ The lowest outline number is mapped section1, second is section2... until fourth and higher are all mapped to section4 -->
+
+ <!-- Each global variable hold the outline level which has been mapped to one of the four sections in DocBook -->
+ <xsl:variable name="section1_OutlineLevel">
+ <xsl:call-template name="findOutlineLevel">
+ <xsl:with-param name="candidateOutlineLevel" select="1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="section2_OutlineLevel">
+ <xsl:call-template name="findOutlineLevel">
+ <xsl:with-param name="candidateOutlineLevel" select="$section1_OutlineLevel + 1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="section3_OutlineLevel">
+ <xsl:call-template name="findOutlineLevel">
+ <xsl:with-param name="candidateOutlineLevel" select="$section2_OutlineLevel + 1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="section4_OutlineLevel">
+ <xsl:call-template name="findOutlineLevel">
+ <xsl:with-param name="candidateOutlineLevel" select="$section3_OutlineLevel + 1"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+ <!-- get the minimum available heading outline level (usually '1') -->
+ <xsl:template name="findOutlineLevel">
+ <xsl:param name="candidateOutlineLevel"/>
+ <xsl:choose>
+ <xsl:when test="key('getHeadingsByOutline', $candidateOutlineLevel)[1]/@text:level != ''">
+ <xsl:value-of select="$candidateOutlineLevel"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$candidateOutlineLevel &lt; 11">
+ <xsl:call-template name="findOutlineLevel">
+ <xsl:with-param name="candidateOutlineLevel" select="$candidateOutlineLevel + 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- START -->
+ <xsl:template match="/*">
+ <xsl:element name="article">
+ <xsl:attribute name="lang">
+ <xsl:value-of select="/*/office:meta/dc:language"/>
+ </xsl:attribute>
<!-- page style header -->
<xsl:call-template name="page-style">
<xsl:with-param name="area" select="'header'"/>
- </xsl:call-template>
- <xsl:apply-templates select="office:body"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="office:body"/>
<!-- page style footer -->
<xsl:call-template name="page-style"/>
- </xsl:element>
- </xsl:template>
-
-
+ </xsl:element>
+ </xsl:template>
+
+
<xsl:key match="style:master-page" name="styleMasterPage" use="@style:name" />
<!-- using a simple heuristic for "standard" page-style heading/footer from page styles -->
<xsl:template name="page-style">
<xsl:param name="area"/>
-
- <xsl:variable name="defaultPageStyle" select="key('styleMasterPage', 'Standard')"/>
+
+ <xsl:variable name="defaultPageStyle" select="key('styleMasterPage', 'Standard')"/>
<xsl:choose>
<xsl:when test="$area = 'header'">
<xsl:apply-templates select="$defaultPageStyle/style:header/*"/>
@@ -141,19 +141,19 @@
<xsl:apply-templates select="$defaultPageStyle/style:footer/*"/>
</xsl:otherwise>
</xsl:choose>
-
+
</xsl:template>
- <xsl:template match="office:body">
- <!-- here all children of office:body before the first heading are matched -->
- <xsl:apply-templates select="key('nestedContent', generate-id())"/>
- <!-- have to be descendant as text:h can be in a list:item in some list -->
- <xsl:variable name="firstHeading" select="descendant::text:h[1]"/>
- <!-- changing the context node from office:body to text:h as required for used key functions -->
- <xsl:for-each select="descendant::text:h[@text:level=$section1_OutlineLevel][1]">
- <!-- if the first heading is not of the section1 level -->
- <xsl:if test="generate-id(.) != generate-id($firstHeading)">
- <!-- create an anonymous section1 and embrace all headings preceding the first real existent section1 -->
+ <xsl:template match="office:body">
+ <!-- here all children of office:body before the first heading are matched -->
+ <xsl:apply-templates select="key('nestedContent', generate-id())"/>
+ <!-- have to be descendant as text:h can be in a list:item in some list -->
+ <xsl:variable name="firstHeading" select="descendant::text:h[1]"/>
+ <!-- changing the context node from office:body to text:h as required for used key functions -->
+ <xsl:for-each select="descendant::text:h[@text:level=$section1_OutlineLevel][1]">
+ <!-- if the first heading is not of the section1 level -->
+ <xsl:if test="generate-id(.) != generate-id($firstHeading)">
+ <!-- create an anonymous section1 and embrace all headings preceding the first real existent section1 -->
<xsl:element name="sect1">
<title></title>
<!-- create sections for all the first section1 preluding headings -->
@@ -168,70 +168,70 @@
</xsl:call-template>
</xsl:for-each>
</xsl:element>
- </xsl:if>
- </xsl:for-each>
- <!-- match all headings, which are mapped to section1 to create a nested section structure used in docbook (see first comment after copyright) -->
- <xsl:apply-templates mode="recreateStructure" select="descendant::text:h[@text:level = $section1_OutlineLevel]"/>
- </xsl:template>
-
- <xsl:template match="text:h" mode="recreateStructure">
- <!-- relate the current ODF outline level of the heading to one of the four docbook section levels-->
- <xsl:variable name="currentSectionLevel">
- <xsl:call-template name="getSectionLevel">
- <xsl:with-param name="outlineLevel" select="@text:level"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <!-- heading with outline level 1 might be an Abstract -->
- <xsl:when test="$currentSectionLevel = 1">
- <xsl:choose>
- <!-- when the content of a level 1 heading is 'Abstract' the <abstract> docbook element is used instead of <section1> -->
- <xsl:when test=".='Abstract'">
- <abstract>
- <xsl:apply-templates select="key('nestedContent', generate-id())"/>
- <xsl:apply-templates select="key('nestedHeadings', generate-id())" mode="recreateStructure"/>
- </abstract>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="make-section">
- <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
- <xsl:with-param name="previousSectionLevel" select="$currentSectionLevel"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="previousHeading" select="preceding::text:h[@text:level &lt; current()/@text:level][1]"/>
- <xsl:choose>
- <xsl:when test="$previousHeading/@text:level != ''">
- <xsl:call-template name="make-section">
- <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
- <xsl:with-param name="previousSectionLevel">
- <xsl:call-template name="getSectionLevel">
- <xsl:with-param name="outlineLevel" select="$previousHeading/@text:level"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="make-section">
- <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
- <xsl:with-param name="previousSectionLevel" select="$currentSectionLevel"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="text:bookmark | text:bookmark-start">
- <xsl:element name="anchor">
- <xsl:attribute name="id">
- <!-- ID have to be an NCName which have to start with a letter or '_'
- in case of the frequent starting number a '_' will be added as prefix -->
- <xsl:choose>
- <xsl:when test="(starts-with(@text:name, '0') or
- starts-with(@text:name, '1') or
+ </xsl:if>
+ </xsl:for-each>
+ <!-- match all headings, which are mapped to section1 to create a nested section structure used in docbook (see first comment after copyright) -->
+ <xsl:apply-templates mode="recreateStructure" select="descendant::text:h[@text:level = $section1_OutlineLevel]"/>
+ </xsl:template>
+
+ <xsl:template match="text:h" mode="recreateStructure">
+ <!-- relate the current ODF outline level of the heading to one of the four docbook section levels-->
+ <xsl:variable name="currentSectionLevel">
+ <xsl:call-template name="getSectionLevel">
+ <xsl:with-param name="outlineLevel" select="@text:level"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <!-- heading with outline level 1 might be an Abstract -->
+ <xsl:when test="$currentSectionLevel = 1">
+ <xsl:choose>
+ <!-- when the content of a level 1 heading is 'Abstract' the <abstract> docbook element is used instead of <section1> -->
+ <xsl:when test=".='Abstract'">
+ <abstract>
+ <xsl:apply-templates select="key('nestedContent', generate-id())"/>
+ <xsl:apply-templates select="key('nestedHeadings', generate-id())" mode="recreateStructure"/>
+ </abstract>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="make-section">
+ <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
+ <xsl:with-param name="previousSectionLevel" select="$currentSectionLevel"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="previousHeading" select="preceding::text:h[@text:level &lt; current()/@text:level][1]"/>
+ <xsl:choose>
+ <xsl:when test="$previousHeading/@text:level != ''">
+ <xsl:call-template name="make-section">
+ <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
+ <xsl:with-param name="previousSectionLevel">
+ <xsl:call-template name="getSectionLevel">
+ <xsl:with-param name="outlineLevel" select="$previousHeading/@text:level"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="make-section">
+ <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
+ <xsl:with-param name="previousSectionLevel" select="$currentSectionLevel"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="text:bookmark | text:bookmark-start">
+ <xsl:element name="anchor">
+ <xsl:attribute name="id">
+ <!-- ID have to be an NCName which have to start with a letter or '_'
+ in case of the frequent starting number a '_' will be added as prefix -->
+ <xsl:choose>
+ <xsl:when test="(starts-with(@text:name, '0') or
+ starts-with(@text:name, '1') or
starts-with(@text:name, '2') or
starts-with(@text:name, '3') or
starts-with(@text:name, '4') or
@@ -240,35 +240,35 @@
starts-with(@text:name, '7') or
starts-with(@text:name, '8') or
starts-with(@text:name, '9'))">
- <xsl:value-of select="concat('_', @text:name)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@text:name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:element>
- </xsl:template>
-
- <xsl:template name="getSectionLevel">
- <xsl:param name="outlineLevel"/>
- <xsl:choose>
- <xsl:when test="$outlineLevel = $section1_OutlineLevel">1</xsl:when>
- <xsl:when test="$outlineLevel = $section2_OutlineLevel">2</xsl:when>
- <xsl:when test="$outlineLevel = $section3_OutlineLevel">3</xsl:when>
- <xsl:otherwise>4</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- make-section creates the nested section hierarchy and
- in case the difference between the parent section and the new section is higher than one
- a section is inserted to keep the output format valid -->
- <xsl:template name="make-section">
- <xsl:param name="currentSectionLevel"/>
- <xsl:param name="previousSectionLevel"/>
- <xsl:choose>
- <!-- empty title as it is an empty section between two headings with an outline level difference higher than 1 -->
- <xsl:when test="$currentSectionLevel &gt; $previousSectionLevel+1">
+ <xsl:value-of select="concat('_', @text:name)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@text:name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="getSectionLevel">
+ <xsl:param name="outlineLevel"/>
+ <xsl:choose>
+ <xsl:when test="$outlineLevel = $section1_OutlineLevel">1</xsl:when>
+ <xsl:when test="$outlineLevel = $section2_OutlineLevel">2</xsl:when>
+ <xsl:when test="$outlineLevel = $section3_OutlineLevel">3</xsl:when>
+ <xsl:otherwise>4</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- make-section creates the nested section hierarchy and
+ in case the difference between the parent section and the new section is higher than one
+ a section is inserted to keep the output format valid -->
+ <xsl:template name="make-section">
+ <xsl:param name="currentSectionLevel"/>
+ <xsl:param name="previousSectionLevel"/>
+ <xsl:choose>
+ <!-- empty title as it is an empty section between two headings with an outline level difference higher than 1 -->
+ <xsl:when test="$currentSectionLevel &gt; $previousSectionLevel+1">
<xsl:element name="{concat('sect', $previousSectionLevel + 1)}">
<title></title>
<xsl:call-template name="make-section">
@@ -276,8 +276,8 @@
<xsl:with-param name="previousSectionLevel" select="$previousSectionLevel +1"/>
</xsl:call-template>
</xsl:element>
- </xsl:when>
- <xsl:otherwise>
+ </xsl:when>
+ <xsl:otherwise>
<xsl:element name="{concat('sect', $currentSectionLevel)}">
<title>
<xsl:apply-templates/>
@@ -285,868 +285,868 @@
<xsl:apply-templates select="key('nestedContent', generate-id())"/>
<xsl:apply-templates select="key('nestedHeadings', generate-id())" mode="recreateStructure"/>
</xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template match="office:meta">
- <!--<xsl:apply-templates/>--></xsl:template>
-
- <xsl:template match="meta:editing-cycles"></xsl:template>
-
- <xsl:template match="meta:user-defined"></xsl:template>
-
- <xsl:template match="meta:editing-duration"></xsl:template>
-
- <xsl:template match="dc:language"></xsl:template>
-
- <xsl:template match="dc:date">
- <!--<pubdate>
- <xsl:value-of select="substring-before(.,'T')"/>
- </pubdate>--></xsl:template>
-
- <xsl:template match="meta:creation-date"></xsl:template>
-
- <xsl:template match="office:styles">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="office:script"></xsl:template>
-
-
- <xsl:template match="office:settings"></xsl:template>
-
- <xsl:template match="office:font-decls"></xsl:template>
-
- <xsl:template match="text:section">
- <xsl:choose>
- <xsl:when test="@text:name='ArticleInfo'">
- <articleinfo>
- <title>
- <xsl:value-of select="text:p[@text:style-name='Document Title']"/>
- </title>
- <subtitle>
- <xsl:value-of select="text:p[@text:style-name='Document SubTitle']"/>
- </subtitle>
- <edition>
- <xsl:value-of select="text:p/text:variable-set[@text:name='articleinfo.edition']"/>
- </edition>
- <xsl:for-each select="text:p/text:variable-set[substring-after(@text:name,'articleinfo.releaseinfo')]">
- <releaseinfo>
- <xsl:value-of select="."/>
- </releaseinfo>
- </xsl:for-each>
- <xsl:call-template name="ArticleInfo">
- <xsl:with-param name="level" select="0"/>
- </xsl:call-template>
- </articleinfo>
- </xsl:when>
- <xsl:when test="@text:name='Abstract'">
- <abstract>
- <xsl:apply-templates/>
- </abstract>
- </xsl:when>
- <xsl:when test="@text:name='Appendix'">
- <appendix>
- <xsl:apply-templates/>
- </appendix>
- </xsl:when>
- <xsl:otherwise>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template match="office:meta">
+ <!--<xsl:apply-templates/>--></xsl:template>
+
+ <xsl:template match="meta:editing-cycles"></xsl:template>
+
+ <xsl:template match="meta:user-defined"></xsl:template>
+
+ <xsl:template match="meta:editing-duration"></xsl:template>
+
+ <xsl:template match="dc:language"></xsl:template>
+
+ <xsl:template match="dc:date">
+ <!--<pubdate>
+ <xsl:value-of select="substring-before(.,'T')"/>
+ </pubdate>--></xsl:template>
+
+ <xsl:template match="meta:creation-date"></xsl:template>
+
+ <xsl:template match="office:styles">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="office:script"></xsl:template>
+
+
+ <xsl:template match="office:settings"></xsl:template>
+
+ <xsl:template match="office:font-decls"></xsl:template>
+
+ <xsl:template match="text:section">
+ <xsl:choose>
+ <xsl:when test="@text:name='ArticleInfo'">
+ <articleinfo>
+ <title>
+ <xsl:value-of select="text:p[@text:style-name='Document Title']"/>
+ </title>
+ <subtitle>
+ <xsl:value-of select="text:p[@text:style-name='Document SubTitle']"/>
+ </subtitle>
+ <edition>
+ <xsl:value-of select="text:p/text:variable-set[@text:name='articleinfo.edition']"/>
+ </edition>
+ <xsl:for-each select="text:p/text:variable-set[substring-after(@text:name,'articleinfo.releaseinfo')]">
+ <releaseinfo>
+ <xsl:value-of select="."/>
+ </releaseinfo>
+ </xsl:for-each>
+ <xsl:call-template name="ArticleInfo">
+ <xsl:with-param name="level" select="0"/>
+ </xsl:call-template>
+ </articleinfo>
+ </xsl:when>
+ <xsl:when test="@text:name='Abstract'">
+ <abstract>
+ <xsl:apply-templates/>
+ </abstract>
+ </xsl:when>
+ <xsl:when test="@text:name='Appendix'">
+ <appendix>
+ <xsl:apply-templates/>
+ </appendix>
+ </xsl:when>
+ <xsl:otherwise>
<xsl:element name="{concat('sect', count(ancestor::text:section) + 1)}">
<xsl:attribute name="id">
<xsl:value-of select="@text:name"/>
</xsl:attribute>
<xsl:apply-templates/>
</xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="ArticleInfo">
- <xsl:param name="level"/>
- <xsl:variable name="author">
- <xsl:value-of select="concat('articleinfo.author_','', $level)"/>
- </xsl:variable>
- <xsl:if test="text:p/text:variable-set[contains(@text:name, $author )]">
- <xsl:call-template name="Author">
- <xsl:with-param name="AuthorLevel" select="0"/>
- </xsl:call-template>
- <xsl:call-template name="Copyright">
- <xsl:with-param name="CopyrightLevel" select="0"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="Copyright">
- <xsl:param name="CopyrightLevel"/>
-
- <xsl:variable name="Copyright">
- <xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/>
- </xsl:variable>
-
- <xsl:if test="text:p/text:variable-set[contains(@text:name,$Copyright)]">
- <copyright>
- <xsl:call-template name="Year">
- <xsl:with-param name="CopyrightLevel" select="$CopyrightLevel"/>
- <xsl:with-param name="YearlLevel" select="0"/>
- </xsl:call-template>
- <xsl:call-template name="Holder">
- <xsl:with-param name="CopyrightLevel" select="$CopyrightLevel"/>
- <xsl:with-param name="HolderlLevel" select="0"/>
-
- </xsl:call-template>
- </copyright>
- </xsl:if>
- </xsl:template>
-
-
- <xsl:template name="Year">
- <xsl:param name="CopyrightLevel"/>
- <xsl:param name="YearLevel"/>
- <xsl:variable name="Copyright">
- <xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/>
- </xsl:variable>
- <xsl:variable name="Year">
- <xsl:value-of select="concat($Copyright,'',concat('.year_','',$YearLevel))"/>
- </xsl:variable>
-
- <xsl:if test="text:p/text:variable-set[@text:name=$Year]">
- <orgname>
- <xsl:value-of select="text:p/text:variable-set[@text:name=$Year]"/>
- </orgname>
- </xsl:if>
- </xsl:template>
-
-
- <xsl:template name="Holder">
- <xsl:param name="CopyrightLevel"/>
- <xsl:param name="HolderLevel"/>
- <xsl:variable name="Copyright">
- <xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/>
- </xsl:variable>
- <xsl:variable name="Holder">
- <xsl:value-of select="concat($Copyright,'',concat('.holder_','',$HolderLevel))"/>
- </xsl:variable>
-
- <xsl:if test="text:p/text:variable-set[@text:name=$Holder]">
- <orgname>
- <xsl:value-of select="text:p/text:variable-set[@text:name=$Holder]"/>
- </orgname>
- </xsl:if>
- </xsl:template>
-
-
-
- <xsl:template name="Author">
- <xsl:param name="AuthorLevel"/>
- <xsl:variable name="Author">
- <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
- </xsl:variable>
- <xsl:if test="text:p/text:variable-set[contains(@text:name, $Author )]">
- <author>
- <xsl:call-template name="Surname">
- <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
- <xsl:with-param name="SurnameLevel" select="0"/>
- </xsl:call-template>
- <xsl:call-template name="Firstname">
- <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
- <xsl:with-param name="FirstnameLevel" select="0"/>
- </xsl:call-template>
- <xsl:call-template name="Affiliation">
- <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
- <xsl:with-param name="AffilLevel" select="0"/>
- </xsl:call-template>
- </author>
- <xsl:call-template name="Author">
- <xsl:with-param name="AuthorLevel" select="$AuthorLevel+1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
-
- <xsl:template name="Surname">
- <xsl:param name="AuthorLevel"/>
- <xsl:param name="SurnameLevel"/>
- <xsl:variable name="Author">
- <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
- </xsl:variable>
- <xsl:variable name="Surname">
- <xsl:value-of select="concat($Author,'',concat('.surname_','',$SurnameLevel))"/>
- </xsl:variable>
- <xsl:if test="text:p/text:variable-set[@text:name=$Surname]">
- <surname>
- <xsl:value-of select="text:p/text:variable-set[@text:name=$Surname]"/>
- </surname>
- <xsl:call-template name="Surname">
- <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
- <xsl:with-param name="SurnameLevel" select="SurnameLevel+1"/>
- </xsl:call-template>
-
- </xsl:if>
- </xsl:template>
-
-
-
-
- <xsl:template name="Firstname">
- <xsl:param name="AuthorLevel"/>
- <xsl:param name="FirstnameLevel"/>
- <xsl:variable name="Author">
- <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
- </xsl:variable>
- <xsl:variable name="Firstname">
- <xsl:value-of select="concat($Author,'',concat('.firstname_','',$FirstnameLevel))"/>
- </xsl:variable>
- <xsl:if test="text:p/text:variable-set[@text:name=$Firstname]">
- <firstname>
- <xsl:value-of select="text:p/text:variable-set[@text:name=$Firstname]"/>
- </firstname>
- <xsl:call-template name="Surname">
- <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
- <xsl:with-param name="FirstnameLevel" select="FirstnameLevel+1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
-
-
- <xsl:template name="Affiliation">
- <xsl:param name="AuthorLevel"/>
- <xsl:param name="AffilLevel"/>
- <xsl:variable name="Author">
- <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
- </xsl:variable>
- <xsl:variable name="Affil">
- <xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/>
- </xsl:variable>
- <xsl:if test="text:p/text:variable-set[contains(@text:name,$Affil)]">
- <affiliation>
- <xsl:call-template name="Orgname">
- <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
- <xsl:with-param name="AffilLevel" select="$AffilLevel"/>
- <xsl:with-param name="OrgLevel" select="0"/>
- </xsl:call-template>
- <xsl:call-template name="Address">
- <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
- <xsl:with-param name="AffilLevel" select="$AffilLevel"/>
- <xsl:with-param name="AddressLevel" select="0"/>
-
- </xsl:call-template>
- </affiliation>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="Orgname">
- <xsl:param name="AuthorLevel"/>
- <xsl:param name="AffilLevel"/>
- <xsl:param name="OrgLevel"/>
-
- <xsl:variable name="Author">
- <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
- </xsl:variable>
- <xsl:variable name="Affil">
- <xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/>
- </xsl:variable>
- <xsl:variable name="Org">
- <xsl:value-of select="concat($Affil,'',concat('.orgname_','',$OrgLevel))"/>
- </xsl:variable>
-
- <xsl:if test="text:p/text:variable-set[@text:name=$Org]">
- <orgname>
- <xsl:value-of select="text:p/text:variable-set[@text:name=$Org]"/>
- </orgname>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="Address">
- <xsl:param name="AuthorLevel"/>
- <xsl:param name="AffilLevel"/>
- <xsl:param name="AddressLevel"/>
-
- <xsl:variable name="Author">
- <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
- </xsl:variable>
- <xsl:variable name="Affil">
- <xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/>
- </xsl:variable>
- <xsl:variable name="Address">
- <xsl:value-of select="concat($Affil,'',concat('.address_','',$AddressLevel))"/>
- </xsl:variable>
-
- <xsl:if test="text:p/text:variable-set[@text:name=$Address]">
- <address>
- <xsl:value-of select="text:p/text:variable-set[@text:name=$Address]"/>
- </address>
- </xsl:if>
- </xsl:template>
-
-
-
-
- <xsl:template match="text:p[@text:style-name='Document Title']"></xsl:template>
-
- <xsl:template match="text:p[@text:style-name='Document SubTitle']"></xsl:template>
-
-
- <xsl:template match="text:p[@text:style-name='Section Title']">
- <xsl:element name="title">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="text:p[@text:style-name='Appendix Title']">
- <xsl:element name="title">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="ArticleInfo">
+ <xsl:param name="level"/>
+ <xsl:variable name="author">
+ <xsl:value-of select="concat('articleinfo.author_','', $level)"/>
+ </xsl:variable>
+ <xsl:if test="text:p/text:variable-set[contains(@text:name, $author )]">
+ <xsl:call-template name="Author">
+ <xsl:with-param name="AuthorLevel" select="0"/>
+ </xsl:call-template>
+ <xsl:call-template name="Copyright">
+ <xsl:with-param name="CopyrightLevel" select="0"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="Copyright">
+ <xsl:param name="CopyrightLevel"/>
+
+ <xsl:variable name="Copyright">
+ <xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/>
+ </xsl:variable>
+
+ <xsl:if test="text:p/text:variable-set[contains(@text:name,$Copyright)]">
+ <copyright>
+ <xsl:call-template name="Year">
+ <xsl:with-param name="CopyrightLevel" select="$CopyrightLevel"/>
+ <xsl:with-param name="YearlLevel" select="0"/>
+ </xsl:call-template>
+ <xsl:call-template name="Holder">
+ <xsl:with-param name="CopyrightLevel" select="$CopyrightLevel"/>
+ <xsl:with-param name="HolderlLevel" select="0"/>
+
+ </xsl:call-template>
+ </copyright>
+ </xsl:if>
+ </xsl:template>
+
+
+ <xsl:template name="Year">
+ <xsl:param name="CopyrightLevel"/>
+ <xsl:param name="YearLevel"/>
+ <xsl:variable name="Copyright">
+ <xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/>
+ </xsl:variable>
+ <xsl:variable name="Year">
+ <xsl:value-of select="concat($Copyright,'',concat('.year_','',$YearLevel))"/>
+ </xsl:variable>
+
+ <xsl:if test="text:p/text:variable-set[@text:name=$Year]">
+ <orgname>
+ <xsl:value-of select="text:p/text:variable-set[@text:name=$Year]"/>
+ </orgname>
+ </xsl:if>
+ </xsl:template>
+
+
+ <xsl:template name="Holder">
+ <xsl:param name="CopyrightLevel"/>
+ <xsl:param name="HolderLevel"/>
+ <xsl:variable name="Copyright">
+ <xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/>
+ </xsl:variable>
+ <xsl:variable name="Holder">
+ <xsl:value-of select="concat($Copyright,'',concat('.holder_','',$HolderLevel))"/>
+ </xsl:variable>
+
+ <xsl:if test="text:p/text:variable-set[@text:name=$Holder]">
+ <orgname>
+ <xsl:value-of select="text:p/text:variable-set[@text:name=$Holder]"/>
+ </orgname>
+ </xsl:if>
+ </xsl:template>
+
+
+
+ <xsl:template name="Author">
+ <xsl:param name="AuthorLevel"/>
+ <xsl:variable name="Author">
+ <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
+ </xsl:variable>
+ <xsl:if test="text:p/text:variable-set[contains(@text:name, $Author )]">
+ <author>
+ <xsl:call-template name="Surname">
+ <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
+ <xsl:with-param name="SurnameLevel" select="0"/>
+ </xsl:call-template>
+ <xsl:call-template name="Firstname">
+ <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
+ <xsl:with-param name="FirstnameLevel" select="0"/>
+ </xsl:call-template>
+ <xsl:call-template name="Affiliation">
+ <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
+ <xsl:with-param name="AffilLevel" select="0"/>
+ </xsl:call-template>
+ </author>
+ <xsl:call-template name="Author">
+ <xsl:with-param name="AuthorLevel" select="$AuthorLevel+1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+
+ <xsl:template name="Surname">
+ <xsl:param name="AuthorLevel"/>
+ <xsl:param name="SurnameLevel"/>
+ <xsl:variable name="Author">
+ <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
+ </xsl:variable>
+ <xsl:variable name="Surname">
+ <xsl:value-of select="concat($Author,'',concat('.surname_','',$SurnameLevel))"/>
+ </xsl:variable>
+ <xsl:if test="text:p/text:variable-set[@text:name=$Surname]">
+ <surname>
+ <xsl:value-of select="text:p/text:variable-set[@text:name=$Surname]"/>
+ </surname>
+ <xsl:call-template name="Surname">
+ <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
+ <xsl:with-param name="SurnameLevel" select="SurnameLevel+1"/>
+ </xsl:call-template>
+
+ </xsl:if>
+ </xsl:template>
+
+
+
+
+ <xsl:template name="Firstname">
+ <xsl:param name="AuthorLevel"/>
+ <xsl:param name="FirstnameLevel"/>
+ <xsl:variable name="Author">
+ <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
+ </xsl:variable>
+ <xsl:variable name="Firstname">
+ <xsl:value-of select="concat($Author,'',concat('.firstname_','',$FirstnameLevel))"/>
+ </xsl:variable>
+ <xsl:if test="text:p/text:variable-set[@text:name=$Firstname]">
+ <firstname>
+ <xsl:value-of select="text:p/text:variable-set[@text:name=$Firstname]"/>
+ </firstname>
+ <xsl:call-template name="Surname">
+ <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
+ <xsl:with-param name="FirstnameLevel" select="FirstnameLevel+1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+
+
+ <xsl:template name="Affiliation">
+ <xsl:param name="AuthorLevel"/>
+ <xsl:param name="AffilLevel"/>
+ <xsl:variable name="Author">
+ <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
+ </xsl:variable>
+ <xsl:variable name="Affil">
+ <xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/>
+ </xsl:variable>
+ <xsl:if test="text:p/text:variable-set[contains(@text:name,$Affil)]">
+ <affiliation>
+ <xsl:call-template name="Orgname">
+ <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
+ <xsl:with-param name="AffilLevel" select="$AffilLevel"/>
+ <xsl:with-param name="OrgLevel" select="0"/>
+ </xsl:call-template>
+ <xsl:call-template name="Address">
+ <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
+ <xsl:with-param name="AffilLevel" select="$AffilLevel"/>
+ <xsl:with-param name="AddressLevel" select="0"/>
+
+ </xsl:call-template>
+ </affiliation>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="Orgname">
+ <xsl:param name="AuthorLevel"/>
+ <xsl:param name="AffilLevel"/>
+ <xsl:param name="OrgLevel"/>
+
+ <xsl:variable name="Author">
+ <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
+ </xsl:variable>
+ <xsl:variable name="Affil">
+ <xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/>
+ </xsl:variable>
+ <xsl:variable name="Org">
+ <xsl:value-of select="concat($Affil,'',concat('.orgname_','',$OrgLevel))"/>
+ </xsl:variable>
+
+ <xsl:if test="text:p/text:variable-set[@text:name=$Org]">
+ <orgname>
+ <xsl:value-of select="text:p/text:variable-set[@text:name=$Org]"/>
+ </orgname>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="Address">
+ <xsl:param name="AuthorLevel"/>
+ <xsl:param name="AffilLevel"/>
+ <xsl:param name="AddressLevel"/>
+
+ <xsl:variable name="Author">
+ <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
+ </xsl:variable>
+ <xsl:variable name="Affil">
+ <xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/>
+ </xsl:variable>
+ <xsl:variable name="Address">
+ <xsl:value-of select="concat($Affil,'',concat('.address_','',$AddressLevel))"/>
+ </xsl:variable>
+
+ <xsl:if test="text:p/text:variable-set[@text:name=$Address]">
+ <address>
+ <xsl:value-of select="text:p/text:variable-set[@text:name=$Address]"/>
+ </address>
+ </xsl:if>
+ </xsl:template>
+
+
+
+
+ <xsl:template match="text:p[@text:style-name='Document Title']"></xsl:template>
+
+ <xsl:template match="text:p[@text:style-name='Document SubTitle']"></xsl:template>
+
+
+ <xsl:template match="text:p[@text:style-name='Section Title']">
+ <xsl:element name="title">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="text:p[@text:style-name='Appendix Title']">
+ <xsl:element name="title">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
<!--<xsl:template match="text:p[@text:style-name='VarList Item']">
- <xsl:if test="not(preceding-sibling::text:p[@text:style-name='VarList Item'])">
- <xsl:text disable-output-escaping="yes">&lt;listitem&gt;</xsl:text>
- </xsl:if>
- <para>
- <xsl:apply-templates/>
- </para>
- <xsl:if test="not(following-sibling::text:p[@text:style-name='VarList Item'])">
- <xsl:text disable-output-escaping="yes">&lt;/listitem&gt;</xsl:text>
- </xsl:if>
+ <xsl:if test="not(preceding-sibling::text:p[@text:style-name='VarList Item'])">
+ <xsl:text disable-output-escaping="yes">&lt;listitem&gt;</xsl:text>
+ </xsl:if>
+ <para>
+ <xsl:apply-templates/>
+ </para>
+ <xsl:if test="not(following-sibling::text:p[@text:style-name='VarList Item'])">
+ <xsl:text disable-output-escaping="yes">&lt;/listitem&gt;</xsl:text>
+ </xsl:if>
</xsl:template>-->
- <xsl:template match="text:p[@text:style-name='Section1 Title']">
- <xsl:element name="title">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
+ <xsl:template match="text:p[@text:style-name='Section1 Title']">
+ <xsl:element name="title">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
- <xsl:template match="text:p[@text:style-name='Section2 Title']">
- <xsl:element name="title">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
+ <xsl:template match="text:p[@text:style-name='Section2 Title']">
+ <xsl:element name="title">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
- <xsl:template match="text:p[@text:style-name='Section3 Title']">
- <xsl:element name="title">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
+ <xsl:template match="text:p[@text:style-name='Section3 Title']">
+ <xsl:element name="title">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
- <xsl:template match="text:footnote-citation"></xsl:template>
+ <xsl:template match="text:footnote-citation"></xsl:template>
- <xsl:template match="text:p[@text:style-name='Mediaobject']">
- <mediaobject>
- <xsl:apply-templates/>
- </mediaobject>
- </xsl:template>
+ <xsl:template match="text:p[@text:style-name='Mediaobject']">
+ <mediaobject>
+ <xsl:apply-templates/>
+ </mediaobject>
+ </xsl:template>
- <xsl:template match="office:annotation/text:p">
- <note>
- <remark>
- <xsl:apply-templates/>
- </remark>
- </note>
- </xsl:template>
+ <xsl:template match="office:annotation/text:p">
+ <note>
+ <remark>
+ <xsl:apply-templates/>
+ </remark>
+ </note>
+ </xsl:template>
<!--<xsl:template match="meta:initial-creator">
- <author>
- <xsl:apply-templates />
- </author>
+ <author>
+ <xsl:apply-templates />
+ </author>
</xsl:template>-->
- <xsl:template match="table:table">
- <xsl:choose>
- <xsl:when test="following-sibling::text:p[@text:style-name='Table']">
- <table frame="all">
- <xsl:attribute name="id">
- <xsl:value-of select="@table:name"/>
- </xsl:attribute>
- <title>
- <xsl:value-of select="following-sibling::text:p[@text:style-name='Table']"/>
- </title>
- <xsl:call-template name="generictable"/>
- </table>
- </xsl:when>
- <xsl:otherwise>
- <informaltable frame="all">
- <xsl:call-template name="generictable"/>
- </informaltable>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="generictable">
- <xsl:variable name="cells" select="count(descendant::table:table-cell)"></xsl:variable>
- <xsl:variable name="rows">
- <xsl:value-of select="count(descendant::table:table-row)"/>
- </xsl:variable>
- <xsl:variable name="cols">
- <xsl:value-of select="$cells div $rows"/>
- </xsl:variable>
- <xsl:variable name="numcols">
- <xsl:choose>
- <xsl:when test="child::table:table-column/@table:number-columns-repeated">
- <xsl:value-of select="number(table:table-column/@table:number-columns-repeated+1)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$cols"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="tgroup">
- <xsl:attribute name="cols">
- <xsl:value-of select="$numcols"/>
- </xsl:attribute>
- <xsl:call-template name="colspec">
- <xsl:with-param name="left" select="1"/>
- </xsl:call-template>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template name="colspec">
- <xsl:param name="left"/>
- <xsl:if test="number($left &lt; ( table:table-column/@table:number-columns-repeated +2) )">
- <xsl:element name="colspec">
- <xsl:attribute name="colnum">
- <xsl:value-of select="$left"/>
- </xsl:attribute>
- <xsl:attribute name="colname">c<xsl:value-of select="$left"/>
- </xsl:attribute>
- </xsl:element>
- <xsl:call-template name="colspec">
- <xsl:with-param name="left" select="$left+1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="table:table-column">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="table:table-header-rows">
- <thead>
- <xsl:apply-templates/>
- </thead>
- </xsl:template>
-
- <xsl:template match="table:table-header-rows/table:table-row">
- <row>
- <xsl:apply-templates/>
- </row>
- </xsl:template>
-
- <xsl:template match="table:table/table:table-row">
- <xsl:if test="not(preceding-sibling::table:table-row)">
- <xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
- </xsl:if>
- <row>
- <xsl:apply-templates/>
- </row>
- <xsl:if test="not(following-sibling::table:table-row)">
- <xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="table:table-cell">
- <xsl:element name="entry">
- <xsl:if test="@table:number-columns-spanned >'1'">
- <xsl:attribute name="namest">
- <xsl:value-of select="concat('c',count(preceding-sibling::table:table-cell[not(@table:number-columns-spanned)]) +sum(preceding-sibling::table:table-cell/@table:number-columns-spanned)+1)"/>
- </xsl:attribute>
- <xsl:attribute name="nameend">
- <xsl:value-of select="concat('c',count(preceding-sibling::table:table-cell[not(@table:number-columns-spanned)]) +sum(preceding-sibling::table:table-cell/@table:number-columns-spanned)+ @table:number-columns-spanned)"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="text:p">
- <xsl:choose>
- <xsl:when test="@text:style-name='Table'"></xsl:when>
- <xsl:otherwise>
- <para>
- <xsl:apply-templates/>
- </para>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:key match="text:list-style" name="getListStyle" use="@style:name"/>
-
- <xsl:template match="text:ordered-list">
- <xsl:param name="outlineLevel" select="1"/>
-
- <xsl:variable name="listStyle" select="key('getListStyle', @text:style-name)/*[@text:level = $outlineLevel]"/>
-
- <!-- if the list is not recognizable as a list (e.g. no indent, number/bullet, etc.) the list will be ignored -->
- <xsl:if test="$listStyle/style:properties/@*">
- <orderedlist>
- <xsl:apply-templates>
- <xsl:with-param name="itemType" select="'listitem'"/>
- <xsl:with-param name="outlineLevel" select="$outlineLevel + 1"/>
- </xsl:apply-templates>
- </orderedlist>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="text:unordered-list">
- <xsl:param name="outlineLevel" select="1"/>
-
- <xsl:variable name="listStyle" select="key('getListStyle', @text:style-name)/*[@text:level = $outlineLevel]"/>
- <!-- if the list is not recognizable as a list (e.g. no indent, number/bullet, etc.) the list will be ignored -->
- <xsl:if test="$listStyle/style:properties/@*">
- <xsl:choose>
- <xsl:when test="@text:style-name='Var List'">
- <variablelist>
- <xsl:apply-templates>
- <xsl:with-param name="itemType" select="'varlist'"/>
- <xsl:with-param name="outlineLevel" select="$outlineLevel + 1"/>
- </xsl:apply-templates>
- </variablelist>
- </xsl:when>
- <xsl:otherwise>
- <itemizedlist>
- <xsl:apply-templates>
- <xsl:with-param name="itemType" select="'listitem'"/>
- <xsl:with-param name="outlineLevel" select="$outlineLevel + 1"/>
- </xsl:apply-templates>
- </itemizedlist>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="text:list-item | text:list-header">
- <xsl:param name="listType"/>
- <xsl:param name="outlineLevel"/>
-
- <xsl:choose>
- <xsl:when test="$listType='Var List'">
- <xsl:element name="varlistentry">
- <xsl:apply-templates>
- <xsl:with-param name="outlineLevel" select="$outlineLevel"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="listitem">
- <xsl:apply-templates>
- <xsl:with-param name="outlineLevel" select="$outlineLevel"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="text:p[@text:style-name='VarList Term']">
- <xsl:element name="term">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="text:p[@text:style-name='VarList Item']">
- <xsl:element name="para">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
-
- <!-- text headings should only be matched once, when creating a nested docbook section structure, but might be as well become as part of a list a title -->
- <xsl:template match="text:h">
- <title>
- <xsl:apply-templates/>
- </title>
- </xsl:template>
-
- <xsl:template match="dc:title"></xsl:template>
-
- <xsl:template match="dc:description">
- <abstract>
- <para>
- <xsl:apply-templates/>
- </para>
- </abstract>
- </xsl:template>
-
- <xsl:template match="dc:subject"></xsl:template>
-
-
- <xsl:template match="meta:generator"></xsl:template>
-
- <xsl:template match="draw:plugin">
- <xsl:element name="audioobject">
- <xsl:attribute name="fileref">
- <xsl:value-of select="@xlink:href"/>
- </xsl:attribute>
- <xsl:attribute name="width"></xsl:attribute>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="text:footnote">
- <footnote>
- <xsl:apply-templates/>
- </footnote>
- </xsl:template>
-
- <xsl:template match="text:footnote-body">
- <xsl:apply-templates/>
- </xsl:template>
-
-
- <xsl:template match="draw:text-box"></xsl:template>
-
-
-
- <xsl:template match="draw:image">
- <xsl:choose>
- <xsl:when test="parent::text:p[@text:style-name='Mediaobject']">
- <xsl:element name="imageobject">
- <xsl:element name="imagedata">
- <xsl:attribute name="fileref">
- <xsl:value-of select="@xlink:href"/>
- </xsl:attribute>
- </xsl:element>
- <xsl:element name="caption">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="inlinegraphic">
- <xsl:attribute name="fileref">
- <xsl:choose>
- <xsl:when test="@xlink:href != ''">
- <xsl:value-of select="@xlink:href"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>embedded:</xsl:text>
- <xsl:value-of select="@draw:name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="width">
- <xsl:value-of select="@svg:width"/>
- </xsl:attribute>
- <xsl:attribute name="depth">
- <xsl:value-of select="@svg:height"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template match="text:span">
- <xsl:choose>
- <xsl:when test="./@text:style-name='GuiMenu'">
- <xsl:element name="guimenu">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="./@text:style-name='GuiSubMenu'">
- <xsl:element name="guisubmenu">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@text:style-name='GuiMenuItem'">
- <xsl:element name="guimenuitem">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@text:style-name='GuiButton'">
- <xsl:element name="guibutton">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@text:style-name='GuiButton'">
- <xsl:element name="guibutton">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@text:style-name='GuiLabel'">
- <xsl:element name="guilabel">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@text:style-name='Emphasis'">
- <xsl:element name="emphasis">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@text:style-name='FileName'">
- <xsl:element name="filename">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@text:style-name='Application'">
- <xsl:element name="application">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@text:style-name='Command'">
- <command>
- <xsl:apply-templates/>
- </command>
- </xsl:when>
- <xsl:when test="@text:style-name='SubScript'">
- <subscript>
- <xsl:apply-templates/>
- </subscript>
- </xsl:when>
- <xsl:when test="@text:style-name='SuperScript'">
- <superscript>
- <xsl:apply-templates/>
- </superscript>
- </xsl:when>
- <xsl:when test="@text:style-name='SystemItem'">
- <systemitem>
- <xsl:apply-templates/>
- </systemitem>
- </xsl:when>
- <xsl:when test="@text:style-name='ComputerOutput'">
- <computeroutput>
- <xsl:apply-templates/>
- </computeroutput>
- </xsl:when>
- <xsl:when test="@text:style-name='Highlight'">
- <highlight>
- <xsl:apply-templates/>
- </highlight>
- </xsl:when>
- <xsl:when test="@text:style-name='KeyCap'">
- <keycap>
- <xsl:apply-templates/>
- </keycap>
- </xsl:when>
- <xsl:when test="@text:style-name='KeySym'">
- <xsl:element name="keysym">
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@text:style-name='KeyCombo'">
- <keycombo>
- <xsl:apply-templates/>
- </keycombo>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
-
- <xsl:template match="text:a">
- <xsl:choose>
- <xsl:when test="contains(@xlink:href,'://')">
- <xsl:element name="ulink">
- <xsl:attribute name="url">
- <xsl:value-of select="@xlink:href"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="contains(@xlink:href,'mailto:')">
- <xsl:element name="ulink">
- <xsl:attribute name="url">
- <xsl:value-of select="@xlink:href"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="not(contains(@xlink:href,'#'))">
- <xsl:element name="olink">
- <xsl:attribute name="targetdocent">
- <xsl:value-of select="@xlink:href"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="linkvar" select="substring-after(@xlink:href,'#')"/>
- <xsl:element name="link">
- <xsl:attribute name="linkend">
- <xsl:value-of select="substring-before($linkvar,'%')"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:template match="table:table">
+ <xsl:choose>
+ <xsl:when test="following-sibling::text:p[@text:style-name='Table']">
+ <table frame="all">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@table:name"/>
+ </xsl:attribute>
+ <title>
+ <xsl:value-of select="following-sibling::text:p[@text:style-name='Table']"/>
+ </title>
+ <xsl:call-template name="generictable"/>
+ </table>
+ </xsl:when>
+ <xsl:otherwise>
+ <informaltable frame="all">
+ <xsl:call-template name="generictable"/>
+ </informaltable>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="generictable">
+ <xsl:variable name="cells" select="count(descendant::table:table-cell)"></xsl:variable>
+ <xsl:variable name="rows">
+ <xsl:value-of select="count(descendant::table:table-row)"/>
+ </xsl:variable>
+ <xsl:variable name="cols">
+ <xsl:value-of select="$cells div $rows"/>
+ </xsl:variable>
+ <xsl:variable name="numcols">
+ <xsl:choose>
+ <xsl:when test="child::table:table-column/@table:number-columns-repeated">
+ <xsl:value-of select="number(table:table-column/@table:number-columns-repeated+1)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$cols"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="tgroup">
+ <xsl:attribute name="cols">
+ <xsl:value-of select="$numcols"/>
+ </xsl:attribute>
+ <xsl:call-template name="colspec">
+ <xsl:with-param name="left" select="1"/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="colspec">
+ <xsl:param name="left"/>
+ <xsl:if test="number($left &lt; ( table:table-column/@table:number-columns-repeated +2) )">
+ <xsl:element name="colspec">
+ <xsl:attribute name="colnum">
+ <xsl:value-of select="$left"/>
+ </xsl:attribute>
+ <xsl:attribute name="colname">c<xsl:value-of select="$left"/>
+ </xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="colspec">
+ <xsl:with-param name="left" select="$left+1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="table:table-column">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="table:table-header-rows">
+ <thead>
+ <xsl:apply-templates/>
+ </thead>
+ </xsl:template>
+
+ <xsl:template match="table:table-header-rows/table:table-row">
+ <row>
+ <xsl:apply-templates/>
+ </row>
+ </xsl:template>
+
+ <xsl:template match="table:table/table:table-row">
+ <xsl:if test="not(preceding-sibling::table:table-row)">
+ <xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
+ </xsl:if>
+ <row>
+ <xsl:apply-templates/>
+ </row>
+ <xsl:if test="not(following-sibling::table:table-row)">
+ <xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="table:table-cell">
+ <xsl:element name="entry">
+ <xsl:if test="@table:number-columns-spanned >'1'">
+ <xsl:attribute name="namest">
+ <xsl:value-of select="concat('c',count(preceding-sibling::table:table-cell[not(@table:number-columns-spanned)]) +sum(preceding-sibling::table:table-cell/@table:number-columns-spanned)+1)"/>
+ </xsl:attribute>
+ <xsl:attribute name="nameend">
+ <xsl:value-of select="concat('c',count(preceding-sibling::table:table-cell[not(@table:number-columns-spanned)]) +sum(preceding-sibling::table:table-cell/@table:number-columns-spanned)+ @table:number-columns-spanned)"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="text:p">
+ <xsl:choose>
+ <xsl:when test="@text:style-name='Table'"></xsl:when>
+ <xsl:otherwise>
+ <para>
+ <xsl:apply-templates/>
+ </para>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:key match="text:list-style" name="getListStyle" use="@style:name"/>
+
+ <xsl:template match="text:ordered-list">
+ <xsl:param name="outlineLevel" select="1"/>
+
+ <xsl:variable name="listStyle" select="key('getListStyle', @text:style-name)/*[@text:level = $outlineLevel]"/>
+
+ <!-- if the list is not recognizable as a list (e.g. no indent, number/bullet, etc.) the list will be ignored -->
+ <xsl:if test="$listStyle/style:properties/@*">
+ <orderedlist>
+ <xsl:apply-templates>
+ <xsl:with-param name="itemType" select="'listitem'"/>
+ <xsl:with-param name="outlineLevel" select="$outlineLevel + 1"/>
+ </xsl:apply-templates>
+ </orderedlist>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="text:unordered-list">
+ <xsl:param name="outlineLevel" select="1"/>
+
+ <xsl:variable name="listStyle" select="key('getListStyle', @text:style-name)/*[@text:level = $outlineLevel]"/>
+ <!-- if the list is not recognizable as a list (e.g. no indent, number/bullet, etc.) the list will be ignored -->
+ <xsl:if test="$listStyle/style:properties/@*">
+ <xsl:choose>
+ <xsl:when test="@text:style-name='Var List'">
+ <variablelist>
+ <xsl:apply-templates>
+ <xsl:with-param name="itemType" select="'varlist'"/>
+ <xsl:with-param name="outlineLevel" select="$outlineLevel + 1"/>
+ </xsl:apply-templates>
+ </variablelist>
+ </xsl:when>
+ <xsl:otherwise>
+ <itemizedlist>
+ <xsl:apply-templates>
+ <xsl:with-param name="itemType" select="'listitem'"/>
+ <xsl:with-param name="outlineLevel" select="$outlineLevel + 1"/>
+ </xsl:apply-templates>
+ </itemizedlist>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="text:list-item | text:list-header">
+ <xsl:param name="listType"/>
+ <xsl:param name="outlineLevel"/>
+
+ <xsl:choose>
+ <xsl:when test="$listType='Var List'">
+ <xsl:element name="varlistentry">
+ <xsl:apply-templates>
+ <xsl:with-param name="outlineLevel" select="$outlineLevel"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="listitem">
+ <xsl:apply-templates>
+ <xsl:with-param name="outlineLevel" select="$outlineLevel"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="text:p[@text:style-name='VarList Term']">
+ <xsl:element name="term">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="text:p[@text:style-name='VarList Item']">
+ <xsl:element name="para">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- text headings should only be matched once, when creating a nested docbook section structure, but might be as well become as part of a list a title -->
+ <xsl:template match="text:h">
+ <title>
+ <xsl:apply-templates/>
+ </title>
+ </xsl:template>
+
+ <xsl:template match="dc:title"></xsl:template>
+
+ <xsl:template match="dc:description">
+ <abstract>
+ <para>
+ <xsl:apply-templates/>
+ </para>
+ </abstract>
+ </xsl:template>
+
+ <xsl:template match="dc:subject"></xsl:template>
+
+
+ <xsl:template match="meta:generator"></xsl:template>
+
+ <xsl:template match="draw:plugin">
+ <xsl:element name="audioobject">
+ <xsl:attribute name="fileref">
+ <xsl:value-of select="@xlink:href"/>
+ </xsl:attribute>
+ <xsl:attribute name="width"></xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="text:footnote">
+ <footnote>
+ <xsl:apply-templates/>
+ </footnote>
+ </xsl:template>
+
+ <xsl:template match="text:footnote-body">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+
+ <xsl:template match="draw:text-box"></xsl:template>
+
+
+
+ <xsl:template match="draw:image">
+ <xsl:choose>
+ <xsl:when test="parent::text:p[@text:style-name='Mediaobject']">
+ <xsl:element name="imageobject">
+ <xsl:element name="imagedata">
+ <xsl:attribute name="fileref">
+ <xsl:value-of select="@xlink:href"/>
+ </xsl:attribute>
+ </xsl:element>
+ <xsl:element name="caption">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="inlinegraphic">
+ <xsl:attribute name="fileref">
+ <xsl:choose>
+ <xsl:when test="@xlink:href != ''">
+ <xsl:value-of select="@xlink:href"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>embedded:</xsl:text>
+ <xsl:value-of select="@draw:name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="width">
+ <xsl:value-of select="@svg:width"/>
+ </xsl:attribute>
+ <xsl:attribute name="depth">
+ <xsl:value-of select="@svg:height"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template match="text:span">
+ <xsl:choose>
+ <xsl:when test="./@text:style-name='GuiMenu'">
+ <xsl:element name="guimenu">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="./@text:style-name='GuiSubMenu'">
+ <xsl:element name="guisubmenu">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@text:style-name='GuiMenuItem'">
+ <xsl:element name="guimenuitem">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@text:style-name='GuiButton'">
+ <xsl:element name="guibutton">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@text:style-name='GuiButton'">
+ <xsl:element name="guibutton">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@text:style-name='GuiLabel'">
+ <xsl:element name="guilabel">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@text:style-name='Emphasis'">
+ <xsl:element name="emphasis">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@text:style-name='FileName'">
+ <xsl:element name="filename">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@text:style-name='Application'">
+ <xsl:element name="application">
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@text:style-name='Command'">
+ <command>
+ <xsl:apply-templates/>
+ </command>
+ </xsl:when>
+ <xsl:when test="@text:style-name='SubScript'">
+ <subscript>
+ <xsl:apply-templates/>
+ </subscript>
+ </xsl:when>
+ <xsl:when test="@text:style-name='SuperScript'">
+ <superscript>
+ <xsl:apply-templates/>
+ </superscript>
+ </xsl:when>
+ <xsl:when test="@text:style-name='SystemItem'">
+ <systemitem>
+ <xsl:apply-templates/>
+ </systemitem>
+ </xsl:when>
+ <xsl:when test="@text:style-name='ComputerOutput'">
+ <computeroutput>
+ <xsl:apply-templates/>
+ </computeroutput>
+ </xsl:when>
+ <xsl:when test="@text:style-name='Highlight'">
+ <highlight>
+ <xsl:apply-templates/>
+ </highlight>
+ </xsl:when>
+ <xsl:when test="@text:style-name='KeyCap'">
+ <keycap>
+ <xsl:apply-templates/>
+ </keycap>
+ </xsl:when>
+ <xsl:when test="@text:style-name='KeySym'">
+ <xsl:element name="keysym">
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@text:style-name='KeyCombo'">
+ <keycombo>
+ <xsl:apply-templates/>
+ </keycombo>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+
+
+ <xsl:template match="text:a">
+ <xsl:choose>
+ <xsl:when test="contains(@xlink:href,'://')">
+ <xsl:element name="ulink">
+ <xsl:attribute name="url">
+ <xsl:value-of select="@xlink:href"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="contains(@xlink:href,'mailto:')">
+ <xsl:element name="ulink">
+ <xsl:attribute name="url">
+ <xsl:value-of select="@xlink:href"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="not(contains(@xlink:href,'#'))">
+ <xsl:element name="olink">
+ <xsl:attribute name="targetdocent">
+ <xsl:value-of select="@xlink:href"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="linkvar" select="substring-after(@xlink:href,'#')"/>
+ <xsl:element name="link">
+ <xsl:attribute name="linkend">
+ <xsl:value-of select="substring-before($linkvar,'%')"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
<!--
- Change Made By Kevin Fowlks (fowlks@msu.edu) July 2nd, 2003
- This allows users to create example code in DocBook.
+ Change Made By Kevin Fowlks (fowlks@msu.edu) July 2nd, 2003
+ This allows users to create example code in DocBook.
- Note: This type of grouping could also be implemented for
- <notes>,<literallayout>, <blockquote> or any other tag that requires text to be treated as blocked.
+ Note: This type of grouping could also be implemented for
+ <notes>,<literallayout>, <blockquote> or any other tag that requires text to be treated as blocked.
-->
- <xsl:template match="text:p[@text:style-name='Example']">
- <xsl:if test="not(preceding-sibling::*[1][self::text:p[@text:style-name='Example']])">
- <xsl:element name="example">
- <xsl:element name="title"></xsl:element>
- <xsl:element name="programlisting">
- <xsl:value-of select="."/>
- <xsl:text disable-output-escaping="no">&#xD;</xsl:text>
- <xsl:apply-templates mode="in-list" select="following-sibling::*[1][self::text:p[@text:style-name='Example']]"/>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="text:p[@text:style-name='Example']" mode="in-list">
- <xsl:value-of select="."/>
- <xsl:text disable-output-escaping="no">&#xD;</xsl:text>
- <xsl:apply-templates mode="in-list" select="following-sibling::*[1][self::text:p[@text:style-name='Example']]"/>
- </xsl:template>
-
- <!-- ****************** -->
- <!-- *** Whitespace *** -->
- <!-- ****************** -->
-
- <xsl:template match="text:s">
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="@text:c"/>
- </xsl:call-template>
- </xsl:template>
-
-
- <!--write the number of 'whitespaces' -->
- <xsl:template name="write-breakable-whitespace">
- <xsl:param name="whitespaces"/>
-
- <!--write two space chars as the normal white space character will be stripped
- and the other is able to break -->
- <xsl:text>&#160;</xsl:text>
- <xsl:if test="$whitespaces >= 2">
- <xsl:call-template name="write-breakable-whitespace-2">
- <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
-
- <!--write the number of 'whitespaces' -->
- <xsl:template name="write-breakable-whitespace-2">
- <xsl:param name="whitespaces"/>
- <!--write two space chars as the normal white space character will be stripped
- and the other is able to break -->
- <xsl:text> </xsl:text>
- <xsl:if test="$whitespaces >= 2">
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="text:tab-stop">
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="8"/>
- </xsl:call-template>
- </xsl:template>
+ <xsl:template match="text:p[@text:style-name='Example']">
+ <xsl:if test="not(preceding-sibling::*[1][self::text:p[@text:style-name='Example']])">
+ <xsl:element name="example">
+ <xsl:element name="title"></xsl:element>
+ <xsl:element name="programlisting">
+ <xsl:value-of select="."/>
+ <xsl:text disable-output-escaping="no">&#xD;</xsl:text>
+ <xsl:apply-templates mode="in-list" select="following-sibling::*[1][self::text:p[@text:style-name='Example']]"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="text:p[@text:style-name='Example']" mode="in-list">
+ <xsl:value-of select="."/>
+ <xsl:text disable-output-escaping="no">&#xD;</xsl:text>
+ <xsl:apply-templates mode="in-list" select="following-sibling::*[1][self::text:p[@text:style-name='Example']]"/>
+ </xsl:template>
+
+ <!-- ****************** -->
+ <!-- *** Whitespace *** -->
+ <!-- ****************** -->
+
+ <xsl:template match="text:s">
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="@text:c"/>
+ </xsl:call-template>
+ </xsl:template>
+
+
+ <!--write the number of 'whitespaces' -->
+ <xsl:template name="write-breakable-whitespace">
+ <xsl:param name="whitespaces"/>
+
+ <!--write two space chars as the normal white space character will be stripped
+ and the other is able to break -->
+ <xsl:text>&#160;</xsl:text>
+ <xsl:if test="$whitespaces >= 2">
+ <xsl:call-template name="write-breakable-whitespace-2">
+ <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+
+ <!--write the number of 'whitespaces' -->
+ <xsl:template name="write-breakable-whitespace-2">
+ <xsl:param name="whitespaces"/>
+ <!--write two space chars as the normal white space character will be stripped
+ and the other is able to break -->
+ <xsl:text> </xsl:text>
+ <xsl:if test="$whitespaces >= 2">
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="text:tab-stop">
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="8"/>
+ </xsl:call-template>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/common/copy.xsl b/filter/source/xslt/common/copy.xsl
index 71313e82240c..24fbe007afe3 100644
--- a/filter/source/xslt/common/copy.xsl
+++ b/filter/source/xslt/common/copy.xsl
@@ -17,10 +17,10 @@
* 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">
- <xsl:output method="xml" encoding="UTF-8"/>
+ <xsl:output method="xml" encoding="UTF-8"/>
- <xsl:template match="/">
- <xsl:copy-of select="."/>
- </xsl:template>
+ <xsl:template match="/">
+ <xsl:copy-of select="."/>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/common/measure_conversion.xsl b/filter/source/xslt/common/measure_conversion.xsl
index 2828f4bc2407..6357ed0b3a65 100644
--- a/filter/source/xslt/common/measure_conversion.xsl
+++ b/filter/source/xslt/common/measure_conversion.xsl
@@ -17,463 +17,463 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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">
- <!-- 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 -->
- <xsl:param name="dpi" select="111"/>
- <xsl:param name="centimeter-in-mm" select="10"/>
- <xsl:param name="inch-in-mm" select="25.4"/>
- <xsl:param name="didot-point-in-mm" select="0.376065"/>
- <xsl:param name="pica-in-mm" select="4.2333333"/>
- <xsl:param name="point-in-mm" select="0.3527778"/>
- <xsl:param name="twip-in-mm" select="0.017636684"/>
- <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
- <!-- ***** MEASUREMENT CONVERSIONS *****
- PARAM 'value'
- The measure to be converted.
- The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
- directly added to the number.
+ <!-- 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 -->
+ <xsl:param name="dpi" select="111"/>
+ <xsl:param name="centimeter-in-mm" select="10"/>
+ <xsl:param name="inch-in-mm" select="25.4"/>
+ <xsl:param name="didot-point-in-mm" select="0.376065"/>
+ <xsl:param name="pica-in-mm" select="4.2333333"/>
+ <xsl:param name="point-in-mm" select="0.3527778"/>
+ <xsl:param name="twip-in-mm" select="0.017636684"/>
+ <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
+ <!-- ***** MEASUREMENT CONVERSIONS *****
+ PARAM 'value'
+ The measure to be converted.
+ The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
+ directly added to the number.
- PARAM 'rounding-factor'
- Is used for the rounding of decimal places.
- The parameter number is the product of 1 and some '10', where
- every zero represents a decimal place.
+ PARAM 'rounding-factor'
+ Is used for the rounding of decimal places.
+ The parameter number is the product of 1 and some '10', where
+ every zero represents a decimal place.
- For example, providing as parameter:
- <xsl:param name="rounding-factor" select="10000" />
- Gives by default four decimal places.
+ For example, providing as parameter:
+ <xsl:param name="rounding-factor" select="10000" />
+ Gives by default four decimal places.
- To round two decimal places, basically the following is done:
- <xsl:value-of select="round(100 * value) div 100"/>
+ To round two decimal places, basically the following is done:
+ <xsl:value-of select="round(100 * value) div 100"/>
- RETURN The converted number, by default rounded to four decimal places.
- In case the input measure could not be matched the same value is
- returned and a warning message is written out.
+ RETURN The converted number, by default rounded to four decimal places.
+ In case the input measure could not be matched the same value is
+ returned and a warning message is written out.
- MEASURE LIST:
- * 1 milimeter (mm), the basic measure
+ MEASURE LIST:
+ * 1 milimeter (mm), the basic measure
- * 1 centimeter (cm) = 10 mm
+ * 1 centimeter (cm) = 10 mm
- * 1 inch (in) = 25.4 mm
- While the English have already seen the light (read: the metric system), the US
- remains loyal to this medieval system.
+ * 1 inch (in) = 25.4 mm
+ While the English have already seen the light (read: the metric system), the US
+ remains loyal to this medieval system.
- * 1 point (pt) = 0.35277777.. mm
- Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
- There are exactly 72 PostScript points in 1 inch.
+ * 1 point (pt) = 0.35277777.. mm
+ Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
+ There are exactly 72 PostScript points in 1 inch.
- * 1 twip = twentieth of a (PostScript) point
- A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
+ * 1 twip = twentieth of a (PostScript) point
+ A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
- * 1 didot point (dpt) = 0.376065 mm
- Didot point after the French typographer Firmin Didot (1764-1836).
+ * 1 didot point (dpt) = 0.376065 mm
+ Didot point after the French typographer Firmin Didot (1764-1836).
- More details under
- http://www.unc.edu/~rowlett/units/dictP.html:
- "A unit of length used by typographers and printers. When printing was done
- from hand-set metal type, one point represented the smallest element of type
- that could be handled, roughly 1/64 inch. Eventually, the point was standardized
- in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
- about 0.35 mm (351.46 micrometers). In continental Europe, typographers
- traditionally used a slightly larger point of 0.014 83 inch (about
- 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
- after the French typographer Firmin Didot (1764-1836). In the U.S.,
- Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
- or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
- of 0.351 459 8035 mm. The German standards agency DIN has proposed that
- all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
+ More details under
+ http://www.unc.edu/~rowlett/units/dictP.html:
+ "A unit of length used by typographers and printers. When printing was done
+ from hand-set metal type, one point represented the smallest element of type
+ that could be handled, roughly 1/64 inch. Eventually, the point was standardized
+ in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
+ about 0.35 mm (351.46 micrometers). In continental Europe, typographers
+ traditionally used a slightly larger point of 0.014 83 inch (about
+ 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
+ after the French typographer Firmin Didot (1764-1836). In the U.S.,
+ Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
+ or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
+ of 0.351 459 8035 mm. The German standards agency DIN has proposed that
+ all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
- * 1 pica = 4.233333 mm
- 1/6 inch or 12 points
+ * 1 pica = 4.233333 mm
+ 1/6 inch or 12 points
- * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
- Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
+ * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
+ Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
- -->
- <!-- changing measure to mm -->
- <xsl:template name="convert2mm">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="substring-before($value, 'mm')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm' ) * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in' ) * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'mm'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to cm -->
- <xsl:template name="convert2cm">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="substring-before($value, 'cm')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to inch (cp. section comment) -->
- <xsl:template name="convert2in">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $inch-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="substring-before($value, 'in')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $inch-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $inch-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $inch-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $inch-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $inch-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'in'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to dpt (cp. section comment) -->
- <xsl:template name="convert2dpt">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $didot-point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $didot-point-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $didot-point-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="substring-before($value, 'dpt')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $didot-point-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $didot-point-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $didot-point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'dpt'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pica (cp. section comment) -->
- <xsl:template name="convert2pica">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $pica-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $pica-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $pica-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $pica-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="substring-before($value, 'pica')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $pica-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $pica-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pica'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pt (cp. section comment) -->
- <xsl:template name="convert2pt">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $point-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="substring-before($value, 'pt')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $point-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $point-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $point-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pt'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to twip (cp. section comment) -->
- <xsl:template name="convert2twip">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $twip-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $twip-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $twip-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $twip-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $twip-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="substring-before($value, 'twip')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $twip-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'twip'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pixel by via parameter provided dpi (dots per inch) standard factor (cp. section comment) -->
- <xsl:template name="convert2px">
- <xsl:param name="value"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round(number(substring-before($value, 'mm')) div $pixel-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round(number(substring-before($value, 'cm')) div $pixel-in-mm * $centimeter-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round(number(substring-before($value, 'in')) div $pixel-in-mm * $inch-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round(number(substring-before($value, 'pt')) div $pixel-in-mm * $point-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round(number(substring-before($value, 'dpt')) div $pixel-in-mm * $didot-point-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round(number(substring-before($value, 'pica')) div $pixel-in-mm * $pica-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round(number(substring-before($value, 'twip')) div $pixel-in-mm * $twip-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'px'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </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(string($value),'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ','')) = 0">0</xsl:when>
- <xsl:when test="string-length(translate(string($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="string(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="string(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="string(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:template name="Add-With-Measure">
- <xsl:param name="value1"/>
- <xsl:param name="value2"/>
- <xsl:param name="TargetMeasure" select="'in'"/>
- <xsl:variable name="number-value1">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="value" select="$value1"/>
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="number-value2">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="value" select="$value2"/>
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$number-value1 + $number-value2"/>
- </xsl:template>
+ -->
+ <!-- changing measure to mm -->
+ <xsl:template name="convert2mm">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="substring-before($value, 'mm')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm' ) * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in' ) * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'mm'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to cm -->
+ <xsl:template name="convert2cm">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="substring-before($value, 'cm')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to inch (cp. section comment) -->
+ <xsl:template name="convert2in">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $inch-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="substring-before($value, 'in')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $inch-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $inch-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $inch-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $inch-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $inch-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'in'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to dpt (cp. section comment) -->
+ <xsl:template name="convert2dpt">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $didot-point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $didot-point-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $didot-point-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="substring-before($value, 'dpt')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $didot-point-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $didot-point-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $didot-point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'dpt'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pica (cp. section comment) -->
+ <xsl:template name="convert2pica">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $pica-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $pica-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $pica-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $pica-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="substring-before($value, 'pica')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $pica-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $pica-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pica'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pt (cp. section comment) -->
+ <xsl:template name="convert2pt">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $point-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="substring-before($value, 'pt')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $point-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $point-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $point-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pt'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to twip (cp. section comment) -->
+ <xsl:template name="convert2twip">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $twip-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $twip-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $twip-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $twip-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $twip-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="substring-before($value, 'twip')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $twip-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'twip'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pixel by via parameter provided dpi (dots per inch) standard factor (cp. section comment) -->
+ <xsl:template name="convert2px">
+ <xsl:param name="value"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round(number(substring-before($value, 'mm')) div $pixel-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round(number(substring-before($value, 'cm')) div $pixel-in-mm * $centimeter-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round(number(substring-before($value, 'in')) div $pixel-in-mm * $inch-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round(number(substring-before($value, 'pt')) div $pixel-in-mm * $point-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round(number(substring-before($value, 'dpt')) div $pixel-in-mm * $didot-point-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round(number(substring-before($value, 'pica')) div $pixel-in-mm * $pica-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round(number(substring-before($value, 'twip')) div $pixel-in-mm * $twip-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="$value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'px'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </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(string($value),'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ','')) = 0">0</xsl:when>
+ <xsl:when test="string-length(translate(string($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="string(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="string(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="string(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:template name="Add-With-Measure">
+ <xsl:param name="value1"/>
+ <xsl:param name="value2"/>
+ <xsl:param name="TargetMeasure" select="'in'"/>
+ <xsl:variable name="number-value1">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="value" select="$value1"/>
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="number-value2">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="value" select="$value2"/>
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$number-value1 + $number-value2"/>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/export/spreadsheetml/formular.xsl b/filter/source/xslt/export/spreadsheetml/formular.xsl
index f8d1246e69e7..040b706c866c 100644
--- a/filter/source/xslt/export/spreadsheetml/formular.xsl
+++ b/filter/source/xslt/export/spreadsheetml/formular.xsl
@@ -17,615 +17,615 @@
* 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:xt="http://www.jclark.com/xt"
- xmlns:common="http://exslt.org/common"
- xmlns:xalan="http://xml.apache.org/xalan"
- 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 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:xlink="http://www.w3.org/1999/xlink"
+ xmlns:xt="http://www.jclark.com/xt"
+ xmlns:common="http://exslt.org/common"
+ xmlns:xalan="http://xml.apache.org/xalan"
+ 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 xt common xalan">
- <!-- Mapping @table:formula to @ss:Formula translating the expression syntax -->
- <xsl:template match="@table:formula">
- <xsl:param name="calculatedCellPosition" />
- <xsl:param name="calculatedRowPosition" />
+ <!-- Mapping @table:formula to @ss:Formula translating the expression syntax -->
+ <xsl:template match="@table:formula">
+ <xsl:param name="calculatedCellPosition" />
+ <xsl:param name="calculatedRowPosition" />
- <xsl:attribute name="ss:Formula">
- <xsl:call-template name="translate-formular-expression">
- <xsl:with-param name="rowPos" select="$calculatedRowPosition" />
- <xsl:with-param name="columnPos" select="$calculatedCellPosition" />
- <xsl:with-param name="expression" select="." />
- </xsl:call-template>
- </xsl:attribute>
- </xsl:template>
+ <xsl:attribute name="ss:Formula">
+ <xsl:call-template name="translate-formular-expression">
+ <xsl:with-param name="rowPos" select="$calculatedRowPosition" />
+ <xsl:with-param name="columnPos" select="$calculatedCellPosition" />
+ <xsl:with-param name="expression" select="." />
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:template>
- <!-- Translate OOOC formula expressions of table cells to spreadsheetml expression
+ <!-- Translate OOOC formula expressions of table cells to spreadsheetml expression
- For example:
- "oooc:=ROUNDDOWN(123.321;2)"
- to "=ROUNDDOWN(123.321,2)"
- "oooc:=([.B2]-[.C2])"
- to "=(RC[-2]-RC[-1])"
- "oooc:=DCOUNTA([.E14:.F21];[.F14];[.H14:.I15])"
- to "=DCOUNTA(R[-17]C[3]:R[-10]C[4],R[-17]C[4],R[-17]C[6]:R[-16]C[7])" -->
- <xsl:template name="translate-formular-expression">
- <!-- return position or range for formula or other -->
- <xsl:param name="rowPos" /> <!-- the position in row (vertical) of cell -->
- <xsl:param name="columnPos" /> <!-- the position in column (horizontal of cell) -->
- <xsl:param name="expression" /> <!-- the expression string to be converted -->
+ For example:
+ "oooc:=ROUNDDOWN(123.321;2)"
+ to "=ROUNDDOWN(123.321,2)"
+ "oooc:=([.B2]-[.C2])"
+ to "=(RC[-2]-RC[-1])"
+ "oooc:=DCOUNTA([.E14:.F21];[.F14];[.H14:.I15])"
+ to "=DCOUNTA(R[-17]C[3]:R[-10]C[4],R[-17]C[4],R[-17]C[6]:R[-16]C[7])" -->
+ <xsl:template name="translate-formular-expression">
+ <!-- return position or range for formula or other -->
+ <xsl:param name="rowPos" /> <!-- the position in row (vertical) of cell -->
+ <xsl:param name="columnPos" /> <!-- the position in column (horizontal of cell) -->
+ <xsl:param name="expression" /> <!-- the expression string to be converted -->
- <xsl:choose>
- <xsl:when test="$expression != ''">
- <xsl:choose>
- <!-- OASIS Open Document XML formular expressions -->
- <xsl:when test="starts-with($expression,'oooc:')">
- <!-- giving out the '=', which will be removed with 'oooc:=' to enable recursive string parsing -->
- <xsl:text>=</xsl:text>
- <xsl:call-template name="function-parameter-mapping">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <!-- 1) remove 'oooc:=' prefix and exchange ';' with ',' -->
- <xsl:with-param name="expression" select="translate(substring($expression,7),';',',')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$expression" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$expression" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:choose>
+ <xsl:when test="$expression != ''">
+ <xsl:choose>
+ <!-- OASIS Open Document XML formular expressions -->
+ <xsl:when test="starts-with($expression,'oooc:')">
+ <!-- giving out the '=', which will be removed with 'oooc:=' to enable recursive string parsing -->
+ <xsl:text>=</xsl:text>
+ <xsl:call-template name="function-parameter-mapping">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <!-- 1) remove 'oooc:=' prefix and exchange ';' with ',' -->
+ <xsl:with-param name="expression" select="translate(substring($expression,7),';',',')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$expression" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$expression" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <!-- As the function API of our Office and MS Office show differences in the argumentlists,
- - sometimes the last parameter have to be neglected
- - sometimes a default have to be added
- these exchanges have to be done as well -->
- <xsl:template name="function-parameter-mapping">
- <xsl:param name="rowPos" /> <!-- the position in row (vertical of cell) -->
- <xsl:param name="columnPos" /> <!-- the position in column (horizontal of cell) -->
- <xsl:param name="expression" /> <!-- expression to be exchanged -->
+ <!-- As the function API of our Office and MS Office show differences in the argumentlists,
+ - sometimes the last parameter have to be neglected
+ - sometimes a default have to be added
+ these exchanges have to be done as well -->
+ <xsl:template name="function-parameter-mapping">
+ <xsl:param name="rowPos" /> <!-- the position in row (vertical of cell) -->
+ <xsl:param name="columnPos" /> <!-- the position in column (horizontal of cell) -->
+ <xsl:param name="expression" /> <!-- expression to be exchanged -->
- <!-- Choose if the expression contains one of the function, which might need changes -->
- <xsl:choose>
- <!-- if not contain one of the functions, which need parameter mapping -->
- <xsl:when test="not(contains($expression, 'ADDRESS(') or
- contains($expression, 'CEILING(') or
- contains($expression, 'FLOOR(') or
- contains($expression, 'IF(') or
- contains($expression, 'ROUND('))">
- <!-- simply translate possily exisiting column & row references -->
- <xsl:call-template name="translate-oooc-expression">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="$expression"/>
- </xsl:call-template>
- </xsl:when>
- <!-- functions to be mapped -->
- <xsl:otherwise>
- <xsl:variable name="functionPrefix" select="substring-before($expression, '(')" />
- <xsl:variable name="expressionSuffix" select="substring-after($expression, '(')" />
+ <!-- Choose if the expression contains one of the function, which might need changes -->
+ <xsl:choose>
+ <!-- if not contain one of the functions, which need parameter mapping -->
+ <xsl:when test="not(contains($expression, 'ADDRESS(') or
+ contains($expression, 'CEILING(') or
+ contains($expression, 'FLOOR(') or
+ contains($expression, 'IF(') or
+ contains($expression, 'ROUND('))">
+ <!-- simply translate possily exisiting column & row references -->
+ <xsl:call-template name="translate-oooc-expression">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="$expression"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- functions to be mapped -->
+ <xsl:otherwise>
+ <xsl:variable name="functionPrefix" select="substring-before($expression, '(')" />
+ <xsl:variable name="expressionSuffix" select="substring-after($expression, '(')" />
- <!-- translate in case the expression contains row/cell references aside of the function name -->
- <xsl:call-template name="translate-oooc-expression">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="$functionPrefix"/>
- </xsl:call-template>
- <!-- Prefix do not include the bracket -->
- <xsl:text>(</xsl:text>
- <xsl:choose>
- <xsl:when test="not(contains($functionPrefix, 'ADDRESS') or
- contains($functionPrefix, 'CEILING') or
- contains($functionPrefix, 'FLOOR') or
- (contains($functionPrefix, 'IF') and not(
- contains($functionPrefix, 'COUNTIF') or
- contains($functionPrefix, 'SUMIF'))) or
- contains($functionPrefix, 'ROUND'))">
- <xsl:call-template name="function-parameter-mapping">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="$expressionSuffix"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="contains($functionPrefix, 'ADDRESS')">
- <xsl:call-template name="find-parameters">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
- <xsl:with-param name="parameterRemoval" select="4" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains($functionPrefix, 'CEILING') or
- contains($functionPrefix, 'FLOOR')">
- <xsl:call-template name="find-parameters">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
- <xsl:with-param name="parameterRemoval" select="3" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains($functionPrefix, 'IF')">
- <xsl:if test="not(contains($functionPrefix, 'COUNTIF') or
- contains($functionPrefix, 'SUMIF'))">
- <xsl:call-template name="find-parameters">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
- <xsl:with-param name="parameterAddition" select="'true'" />
- <xsl:with-param name="additonAfterLastParameter" select="2" />
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:when test="contains($functionPrefix, 'ROUND')">
- <xsl:call-template name="find-parameters">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
- <xsl:with-param name="parameterAddition" select="'null'" />
- <xsl:with-param name="additonAfterLastParameter" select="1" />
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <!-- translate in case the expression contains row/cell references aside of the function name -->
+ <xsl:call-template name="translate-oooc-expression">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="$functionPrefix"/>
+ </xsl:call-template>
+ <!-- Prefix do not include the bracket -->
+ <xsl:text>(</xsl:text>
+ <xsl:choose>
+ <xsl:when test="not(contains($functionPrefix, 'ADDRESS') or
+ contains($functionPrefix, 'CEILING') or
+ contains($functionPrefix, 'FLOOR') or
+ (contains($functionPrefix, 'IF') and not(
+ contains($functionPrefix, 'COUNTIF') or
+ contains($functionPrefix, 'SUMIF'))) or
+ contains($functionPrefix, 'ROUND'))">
+ <xsl:call-template name="function-parameter-mapping">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="$expressionSuffix"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="contains($functionPrefix, 'ADDRESS')">
+ <xsl:call-template name="find-parameters">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
+ <xsl:with-param name="parameterRemoval" select="4" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains($functionPrefix, 'CEILING') or
+ contains($functionPrefix, 'FLOOR')">
+ <xsl:call-template name="find-parameters">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
+ <xsl:with-param name="parameterRemoval" select="3" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains($functionPrefix, 'IF')">
+ <xsl:if test="not(contains($functionPrefix, 'COUNTIF') or
+ contains($functionPrefix, 'SUMIF'))">
+ <xsl:call-template name="find-parameters">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
+ <xsl:with-param name="parameterAddition" select="'true'" />
+ <xsl:with-param name="additonAfterLastParameter" select="2" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="contains($functionPrefix, 'ROUND')">
+ <xsl:call-template name="find-parameters">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
+ <xsl:with-param name="parameterAddition" select="'null'" />
+ <xsl:with-param name="additonAfterLastParameter" select="1" />
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <!-- Each parameter of the argumentlist have to be determined.
- Due to the low level string functionlity in XSLT it becomes a clumsy task -->
- <xsl:template name="find-parameters">
- <!-- used for mapping of row/column reference -->
- <xsl:param name="rowPos" /> <!-- the position in row (vertical of cell) -->
- <xsl:param name="columnPos" /> <!-- the position in column (horizontal of cell) -->
- <!-- used for mapping of parameter -->
- <xsl:param name="parameterRemoval" />
- <xsl:param name="parameterAddition" />
- <xsl:param name="additonAfterLastParameter" />
- <!-- used as helper to find a parameter -->
- <xsl:param name="expressionSuffix" />
- <xsl:param name="parameterNumber" select="1" />
+ <!-- Each parameter of the argumentlist have to be determined.
+ Due to the low level string functionlity in XSLT it becomes a clumsy task -->
+ <xsl:template name="find-parameters">
+ <!-- used for mapping of row/column reference -->
+ <xsl:param name="rowPos" /> <!-- the position in row (vertical of cell) -->
+ <xsl:param name="columnPos" /> <!-- the position in column (horizontal of cell) -->
+ <!-- used for mapping of parameter -->
+ <xsl:param name="parameterRemoval" />
+ <xsl:param name="parameterAddition" />
+ <xsl:param name="additonAfterLastParameter" />
+ <!-- used as helper to find a parameter -->
+ <xsl:param name="expressionSuffix" />
+ <xsl:param name="parameterNumber" select="1" />
- <xsl:variable name="parameter">
- <xsl:call-template name="getParameter">
- <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
- </xsl:call-template>
- </xsl:variable>
+ <xsl:variable name="parameter">
+ <xsl:call-template name="getParameter">
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
+ </xsl:call-template>
+ </xsl:variable>
- <xsl:choose>
- <!-- if it is not the last parameter -->
- <xsl:when test="starts-with(substring-after($expressionSuffix, $parameter), ',')">
- <!-- searches the argument for functions to be mapped -->
- <xsl:if test="not($parameterRemoval = $parameterNumber)">
- <xsl:call-template name="function-parameter-mapping">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression">
- <xsl:choose>
- <!-- in case a character will be removed the preceding won't make a comma -->
- <xsl:when test="$parameterRemoval = ($parameterNumber + 1)">
- <xsl:value-of select="$parameter" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($parameter, ',')" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <!-- searches for the next parameter -->
- <xsl:call-template name="find-parameters">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expressionSuffix" select="substring-after(substring-after($expressionSuffix, $parameter),',')"/>
- <xsl:with-param name="parameterAddition" select="$parameterAddition" />
- <xsl:with-param name="parameterRemoval" select="$parameterRemoval" />
- <xsl:with-param name="additonAfterLastParameter" select="$additonAfterLastParameter" />
- <xsl:with-param name="parameterNumber" select="$parameterNumber + 1" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- the last parameter -->
- <xsl:choose>
- <xsl:when test="$parameterRemoval = $parameterNumber">
- <!-- searches the rest of the expression for functions to be mapped -->
- <xsl:call-template name="function-parameter-mapping">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="substring-after($expressionSuffix, $parameter)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$parameterAddition and ($parameterNumber = $additonAfterLastParameter)">
- <!-- searches the rest of the expression for functions to be mapped -->
- <xsl:call-template name="function-parameter-mapping">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="$parameter" />
- </xsl:call-template>
- <!-- searches last parameter and additional parameters for functions to be mapped -->
- <xsl:call-template name="function-parameter-mapping">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <!-- for the final parameter the latter substring is the ')' -->
- <xsl:with-param name="expression" select="concat(',', $parameterAddition, substring-after($expressionSuffix, $parameter))"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- searches the argument for functions to be mapped -->
- <xsl:call-template name="function-parameter-mapping">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="$parameter" />
- </xsl:call-template>
- <!-- searches the rest of the expression for functions to be mapped -->
- <xsl:call-template name="function-parameter-mapping">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="substring-after($expressionSuffix, $parameter)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:choose>
+ <!-- if it is not the last parameter -->
+ <xsl:when test="starts-with(substring-after($expressionSuffix, $parameter), ',')">
+ <!-- searches the argument for functions to be mapped -->
+ <xsl:if test="not($parameterRemoval = $parameterNumber)">
+ <xsl:call-template name="function-parameter-mapping">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression">
+ <xsl:choose>
+ <!-- in case a character will be removed the preceding won't make a comma -->
+ <xsl:when test="$parameterRemoval = ($parameterNumber + 1)">
+ <xsl:value-of select="$parameter" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($parameter, ',')" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- searches for the next parameter -->
+ <xsl:call-template name="find-parameters">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expressionSuffix" select="substring-after(substring-after($expressionSuffix, $parameter),',')"/>
+ <xsl:with-param name="parameterAddition" select="$parameterAddition" />
+ <xsl:with-param name="parameterRemoval" select="$parameterRemoval" />
+ <xsl:with-param name="additonAfterLastParameter" select="$additonAfterLastParameter" />
+ <xsl:with-param name="parameterNumber" select="$parameterNumber + 1" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- the last parameter -->
+ <xsl:choose>
+ <xsl:when test="$parameterRemoval = $parameterNumber">
+ <!-- searches the rest of the expression for functions to be mapped -->
+ <xsl:call-template name="function-parameter-mapping">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="substring-after($expressionSuffix, $parameter)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$parameterAddition and ($parameterNumber = $additonAfterLastParameter)">
+ <!-- searches the rest of the expression for functions to be mapped -->
+ <xsl:call-template name="function-parameter-mapping">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="$parameter" />
+ </xsl:call-template>
+ <!-- searches last parameter and additional parameters for functions to be mapped -->
+ <xsl:call-template name="function-parameter-mapping">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <!-- for the final parameter the latter substring is the ')' -->
+ <xsl:with-param name="expression" select="concat(',', $parameterAddition, substring-after($expressionSuffix, $parameter))"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- searches the argument for functions to be mapped -->
+ <xsl:call-template name="function-parameter-mapping">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="$parameter" />
+ </xsl:call-template>
+ <!-- searches the rest of the expression for functions to be mapped -->
+ <xsl:call-template name="function-parameter-mapping">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="substring-after($expressionSuffix, $parameter)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template name="getParameter">
- <xsl:param name="closingBracketCount" select="0" />
- <xsl:param name="openingBracketCount" select="0" />
- <xsl:param name="expressionSuffix" />
- <xsl:param name="parameterCandidate">
- <xsl:choose>
- <!-- if there are multiple parameter -->
- <xsl:when test="contains(substring-before($expressionSuffix, ')'), ',')">
- <xsl:value-of select="substring-before($expressionSuffix, ',')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before($expressionSuffix, ')')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:param name="earlierCandidate" select="$parameterCandidate" />
+ <xsl:template name="getParameter">
+ <xsl:param name="closingBracketCount" select="0" />
+ <xsl:param name="openingBracketCount" select="0" />
+ <xsl:param name="expressionSuffix" />
+ <xsl:param name="parameterCandidate">
+ <xsl:choose>
+ <!-- if there are multiple parameter -->
+ <xsl:when test="contains(substring-before($expressionSuffix, ')'), ',')">
+ <xsl:value-of select="substring-before($expressionSuffix, ',')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before($expressionSuffix, ')')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:param>
+ <xsl:param name="earlierCandidate" select="$parameterCandidate" />
- <xsl:choose>
- <xsl:when test="contains($parameterCandidate, '(') or contains($parameterCandidate, ')')">
- <xsl:choose>
- <!-- contains only closing bracket(s) -->
- <xsl:when test="contains($parameterCandidate, '(') and not(contains($parameterCandidate, ')'))">
- <xsl:call-template name="getParameter">
- <xsl:with-param name="openingBracketCount" select="$openingBracketCount + 1" />
- <xsl:with-param name="closingBracketCount" select="$closingBracketCount" />
- <xsl:with-param name="parameterCandidate" select="substring-after($parameterCandidate, '(')" />
- <xsl:with-param name="earlierCandidate" select="$earlierCandidate" />
- <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
- </xsl:call-template>
- </xsl:when>
- <!-- contains only opening bracket(s) -->
- <xsl:when test="not(contains($parameterCandidate, '(')) and contains($parameterCandidate, ')')">
- <xsl:call-template name="getParameter">
- <xsl:with-param name="openingBracketCount" select="$openingBracketCount" />
- <xsl:with-param name="closingBracketCount" select="$closingBracketCount + 1" />
- <xsl:with-param name="parameterCandidate" select="substring-after($parameterCandidate, ')')" />
- <xsl:with-param name="earlierCandidate" select="$earlierCandidate" />
- <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="string-length(substring-before($parameterCandidate, '(')) &lt;
- string-length(substring-before($parameterCandidate, ')'))">
- <xsl:call-template name="getParameter">
- <xsl:with-param name="openingBracketCount" select="$openingBracketCount + 1" />
- <xsl:with-param name="closingBracketCount" select="$closingBracketCount" />
- <xsl:with-param name="parameterCandidate" select="substring-after($parameterCandidate, '(')" />
- <xsl:with-param name="earlierCandidate" select="$earlierCandidate" />
- <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="getParameter">
- <xsl:with-param name="openingBracketCount" select="$openingBracketCount" />
- <xsl:with-param name="closingBracketCount" select="$closingBracketCount + 1" />
- <xsl:with-param name="parameterCandidate" select="substring-after($parameterCandidate, ')')" />
- <xsl:with-param name="earlierCandidate" select="$earlierCandidate" />
- <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$openingBracketCount = $closingBracketCount">
- <xsl:value-of select="$earlierCandidate" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$earlierCandidate" />
- <xsl:variable name="parameterCandidate2">
- <xsl:variable name="formularAfterCandidate" select="substring-after($expressionSuffix, $earlierCandidate)" />
- <xsl:variable name="parameterTillBracket" select="concat(substring-before($formularAfterCandidate,')'),')')" />
- <xsl:variable name="parameterTillComma" select="substring-before(substring-after($expressionSuffix, $parameterTillBracket),',')" />
- <xsl:choose>
- <xsl:when test="string-length($parameterTillComma) &gt; 0 and
- not(contains($parameterTillComma, '('))">
- <xsl:choose>
- <xsl:when test="starts-with($formularAfterCandidate, ',')">
- <xsl:value-of select="concat(',',substring-before(substring-after($formularAfterCandidate,','),','))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before($formularAfterCandidate,',')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$parameterTillBracket"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="getParameter">
- <xsl:with-param name="closingBracketCount" select="$closingBracketCount" />
- <xsl:with-param name="openingBracketCount" select="$openingBracketCount" />
- <xsl:with-param name="parameterCandidate" select="$parameterCandidate2" />
- <xsl:with-param name="earlierCandidate" select="$parameterCandidate2" />
- <xsl:with-param name="expressionSuffix" select="$expressionSuffix" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:choose>
+ <xsl:when test="contains($parameterCandidate, '(') or contains($parameterCandidate, ')')">
+ <xsl:choose>
+ <!-- contains only closing bracket(s) -->
+ <xsl:when test="contains($parameterCandidate, '(') and not(contains($parameterCandidate, ')'))">
+ <xsl:call-template name="getParameter">
+ <xsl:with-param name="openingBracketCount" select="$openingBracketCount + 1" />
+ <xsl:with-param name="closingBracketCount" select="$closingBracketCount" />
+ <xsl:with-param name="parameterCandidate" select="substring-after($parameterCandidate, '(')" />
+ <xsl:with-param name="earlierCandidate" select="$earlierCandidate" />
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- contains only opening bracket(s) -->
+ <xsl:when test="not(contains($parameterCandidate, '(')) and contains($parameterCandidate, ')')">
+ <xsl:call-template name="getParameter">
+ <xsl:with-param name="openingBracketCount" select="$openingBracketCount" />
+ <xsl:with-param name="closingBracketCount" select="$closingBracketCount + 1" />
+ <xsl:with-param name="parameterCandidate" select="substring-after($parameterCandidate, ')')" />
+ <xsl:with-param name="earlierCandidate" select="$earlierCandidate" />
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="string-length(substring-before($parameterCandidate, '(')) &lt;
+ string-length(substring-before($parameterCandidate, ')'))">
+ <xsl:call-template name="getParameter">
+ <xsl:with-param name="openingBracketCount" select="$openingBracketCount + 1" />
+ <xsl:with-param name="closingBracketCount" select="$closingBracketCount" />
+ <xsl:with-param name="parameterCandidate" select="substring-after($parameterCandidate, '(')" />
+ <xsl:with-param name="earlierCandidate" select="$earlierCandidate" />
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="getParameter">
+ <xsl:with-param name="openingBracketCount" select="$openingBracketCount" />
+ <xsl:with-param name="closingBracketCount" select="$closingBracketCount + 1" />
+ <xsl:with-param name="parameterCandidate" select="substring-after($parameterCandidate, ')')" />
+ <xsl:with-param name="earlierCandidate" select="$earlierCandidate" />
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$openingBracketCount = $closingBracketCount">
+ <xsl:value-of select="$earlierCandidate" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$earlierCandidate" />
+ <xsl:variable name="parameterCandidate2">
+ <xsl:variable name="formularAfterCandidate" select="substring-after($expressionSuffix, $earlierCandidate)" />
+ <xsl:variable name="parameterTillBracket" select="concat(substring-before($formularAfterCandidate,')'),')')" />
+ <xsl:variable name="parameterTillComma" select="substring-before(substring-after($expressionSuffix, $parameterTillBracket),',')" />
+ <xsl:choose>
+ <xsl:when test="string-length($parameterTillComma) &gt; 0 and
+ not(contains($parameterTillComma, '('))">
+ <xsl:choose>
+ <xsl:when test="starts-with($formularAfterCandidate, ',')">
+ <xsl:value-of select="concat(',',substring-before(substring-after($formularAfterCandidate,','),','))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before($formularAfterCandidate,',')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$parameterTillBracket"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="getParameter">
+ <xsl:with-param name="closingBracketCount" select="$closingBracketCount" />
+ <xsl:with-param name="openingBracketCount" select="$openingBracketCount" />
+ <xsl:with-param name="parameterCandidate" select="$parameterCandidate2" />
+ <xsl:with-param name="earlierCandidate" select="$parameterCandidate2" />
+ <xsl:with-param name="expressionSuffix" select="$expressionSuffix" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <!-- Mapping table-cell definitions by exchangomg all table cell definitions:
- a) a pair of cells e.g. "[.E14:.F21]" to "R[-17]C[3]:R[-10]C[4]"
- b) a single cell e.g. "[.F14]" to "R[-17]"-->
- <xsl:template name="translate-oooc-expression">
- <xsl:param name="rowPos" /> <!-- the position in row (vertical of cell) -->
- <xsl:param name="columnPos" /> <!-- the position in column (horizontal of cell) -->
- <xsl:param name="expression" /> <!-- expression to be exchanged -->
+ <!-- Mapping table-cell definitions by exchangomg all table cell definitions:
+ a) a pair of cells e.g. "[.E14:.F21]" to "R[-17]C[3]:R[-10]C[4]"
+ b) a single cell e.g. "[.F14]" to "R[-17]"-->
+ <xsl:template name="translate-oooc-expression">
+ <xsl:param name="rowPos" /> <!-- the position in row (vertical of cell) -->
+ <xsl:param name="columnPos" /> <!-- the position in column (horizontal of cell) -->
+ <xsl:param name="expression" /> <!-- expression to be exchanged -->
- <xsl:choose>
- <xsl:when test="contains($expression, '[')">
+ <xsl:choose>
+ <xsl:when test="contains($expression, '[')">
- <!-- Giving out the part before '[.' -->
- <xsl:value-of select="substring-before($expression, '[')" />
+ <!-- Giving out the part before '[.' -->
+ <xsl:value-of select="substring-before($expression, '[')" />
- <!-- Mapping cell definitions
- 1) a pair of cells e.g. "[.E14:.F21]" to "R[-17]C[3]:R[-10]C[4]"
- 2) a single cell e.g. "[.F14]" to "R[-17]"-->
- <xsl:variable name="remainingExpression" select="substring-after($expression, '[')"/>
- <xsl:choose>
- <xsl:when test="contains(substring-before($remainingExpression, ']'), ':')">
- <xsl:call-template name="translate-cell-expression">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="substring-before($remainingExpression, ':')" />
- </xsl:call-template>
- <xsl:value-of select="':'" />
- <xsl:call-template name="translate-cell-expression">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="substring-after(substring-before($remainingExpression, ']'), ':')" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="translate-cell-expression">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="substring-before($remainingExpression, ']')" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="translate-oooc-expression">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="substring-after($remainingExpression,']')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- Giving out the remaining part -->
- <xsl:value-of select="$expression" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <!-- Mapping cell definitions
+ 1) a pair of cells e.g. "[.E14:.F21]" to "R[-17]C[3]:R[-10]C[4]"
+ 2) a single cell e.g. "[.F14]" to "R[-17]"-->
+ <xsl:variable name="remainingExpression" select="substring-after($expression, '[')"/>
+ <xsl:choose>
+ <xsl:when test="contains(substring-before($remainingExpression, ']'), ':')">
+ <xsl:call-template name="translate-cell-expression">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="substring-before($remainingExpression, ':')" />
+ </xsl:call-template>
+ <xsl:value-of select="':'" />
+ <xsl:call-template name="translate-cell-expression">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="substring-after(substring-before($remainingExpression, ']'), ':')" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="translate-cell-expression">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="substring-before($remainingExpression, ']')" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="translate-oooc-expression">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="substring-after($remainingExpression,']')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Giving out the remaining part -->
+ <xsl:value-of select="$expression" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <!-- A cell expression has usually starts with a '.' otherwise it references to a sheet -->
- <xsl:template name="translate-cell-expression">
- <xsl:param name="rowPos" /> <!-- the vertical position of the current cell -->
- <xsl:param name="columnPos" /> <!-- the horizontal position of the current cell -->
- <xsl:param name="targetRowPos" select="0"/> <!-- the vertical position of the target cell -->
- <xsl:param name="targetColumnPos" select="0"/> <!-- the horizontal position of the target cell -->
- <xsl:param name="charPos" select="0"/> <!-- current column position (needed for multiplying) -->
- <xsl:param name="digitPos" select="0"/> <!-- current row position (needed for multiplying) -->
- <xsl:param name="expression" /> <!-- expression to be parsed by character -->
- <xsl:param name="isRow" select="true()"/> <!-- the string (e.g. $D39 is parsed character per character from the back,
- first the row, later the column is parsed -->
+ <!-- A cell expression has usually starts with a '.' otherwise it references to a sheet -->
+ <xsl:template name="translate-cell-expression">
+ <xsl:param name="rowPos" /> <!-- the vertical position of the current cell -->
+ <xsl:param name="columnPos" /> <!-- the horizontal position of the current cell -->
+ <xsl:param name="targetRowPos" select="0"/> <!-- the vertical position of the target cell -->
+ <xsl:param name="targetColumnPos" select="0"/> <!-- the horizontal position of the target cell -->
+ <xsl:param name="charPos" select="0"/> <!-- current column position (needed for multiplying) -->
+ <xsl:param name="digitPos" select="0"/> <!-- current row position (needed for multiplying) -->
+ <xsl:param name="expression" /> <!-- expression to be parsed by character -->
+ <xsl:param name="isRow" select="true()"/> <!-- the string (e.g. $D39 is parsed character per character from the back,
+ first the row, later the column is parsed -->
- <xsl:choose>
- <xsl:when test="starts-with($expression, '.')">
- <xsl:variable name="expLength" select="string-length($expression)" />
- <xsl:choose>
- <!-- parsing from the end, till only the '.' remains -->
- <xsl:when test="$expLength != 1">
- <xsl:variable name="token" select="substring($expression, $expLength)" />
- <xsl:choose>
- <xsl:when test="$token='0' or $token='1' or $token='2' or $token='3' or $token='4' or $token='5' or $token='6' or $token='7' or $token='8' or $token='9'">
- <xsl:variable name="multiplier">
- <xsl:call-template name="calculate-square-numbers">
- <xsl:with-param name="base" select="10" />
- <xsl:with-param name="exponent" select="$digitPos"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="translate-cell-expression">
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="targetColumnPos" select="$targetColumnPos" />
- <xsl:with-param name="targetRowPos" select="$targetRowPos + $multiplier * $token" />
- <xsl:with-param name="digitPos" select="$digitPos + 1" />
- <xsl:with-param name="charPos" select="$charPos" />
- <!-- removing the last character-->
- <xsl:with-param name="expression" select="substring($expression, 1, $expLength - 1)" />
- <xsl:with-param name="isRow" select="true()" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$token = '$'">
- <xsl:choose>
- <!-- if this is the first '$' after '.' (column-->
- <xsl:when test="$expLength = 2">
- <xsl:text>C</xsl:text><xsl:value-of select="$targetColumnPos"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>R</xsl:text><xsl:value-of select="$targetRowPos"/>
- <xsl:call-template name="translate-cell-expression">
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="targetColumnPos" select="$targetColumnPos" />
- <xsl:with-param name="targetRowPos" select="$targetRowPos" />
- <xsl:with-param name="charPos" select="$charPos" />
- <!-- removing the last character-->
- <xsl:with-param name="expression" select="substring($expression, 1, $expLength - 1)" />
- <xsl:with-param name="isRow" select="false()" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- in case of a letter -->
- <xsl:otherwise>
- <xsl:if test="$isRow">
- <xsl:text>R</xsl:text>
- <xsl:if test="$targetRowPos != $rowPos">
- <xsl:text>[</xsl:text><xsl:value-of select="$targetRowPos - $rowPos"/><xsl:text>]</xsl:text>
- </xsl:if>
- </xsl:if>
- <xsl:variable name="multiplier">
- <xsl:call-template name="calculate-square-numbers">
- <xsl:with-param name="base" select="26" />
- <xsl:with-param name="exponent" select="$charPos"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="tokenNumber">
- <xsl:call-template name="character-to-number">
- <xsl:with-param name="character" select="$token" />
- </xsl:call-template>
- </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with($expression, '.')">
+ <xsl:variable name="expLength" select="string-length($expression)" />
+ <xsl:choose>
+ <!-- parsing from the end, till only the '.' remains -->
+ <xsl:when test="$expLength != 1">
+ <xsl:variable name="token" select="substring($expression, $expLength)" />
+ <xsl:choose>
+ <xsl:when test="$token='0' or $token='1' or $token='2' or $token='3' or $token='4' or $token='5' or $token='6' or $token='7' or $token='8' or $token='9'">
+ <xsl:variable name="multiplier">
+ <xsl:call-template name="calculate-square-numbers">
+ <xsl:with-param name="base" select="10" />
+ <xsl:with-param name="exponent" select="$digitPos"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="translate-cell-expression">
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="targetColumnPos" select="$targetColumnPos" />
+ <xsl:with-param name="targetRowPos" select="$targetRowPos + $multiplier * $token" />
+ <xsl:with-param name="digitPos" select="$digitPos + 1" />
+ <xsl:with-param name="charPos" select="$charPos" />
+ <!-- removing the last character-->
+ <xsl:with-param name="expression" select="substring($expression, 1, $expLength - 1)" />
+ <xsl:with-param name="isRow" select="true()" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$token = '$'">
+ <xsl:choose>
+ <!-- if this is the first '$' after '.' (column-->
+ <xsl:when test="$expLength = 2">
+ <xsl:text>C</xsl:text><xsl:value-of select="$targetColumnPos"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>R</xsl:text><xsl:value-of select="$targetRowPos"/>
+ <xsl:call-template name="translate-cell-expression">
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="targetColumnPos" select="$targetColumnPos" />
+ <xsl:with-param name="targetRowPos" select="$targetRowPos" />
+ <xsl:with-param name="charPos" select="$charPos" />
+ <!-- removing the last character-->
+ <xsl:with-param name="expression" select="substring($expression, 1, $expLength - 1)" />
+ <xsl:with-param name="isRow" select="false()" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- in case of a letter -->
+ <xsl:otherwise>
+ <xsl:if test="$isRow">
+ <xsl:text>R</xsl:text>
+ <xsl:if test="$targetRowPos != $rowPos">
+ <xsl:text>[</xsl:text><xsl:value-of select="$targetRowPos - $rowPos"/><xsl:text>]</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:variable name="multiplier">
+ <xsl:call-template name="calculate-square-numbers">
+ <xsl:with-param name="base" select="26" />
+ <xsl:with-param name="exponent" select="$charPos"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="tokenNumber">
+ <xsl:call-template name="character-to-number">
+ <xsl:with-param name="character" select="$token" />
+ </xsl:call-template>
+ </xsl:variable>
- <xsl:call-template name="translate-cell-expression">
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="targetColumnPos" select="$targetColumnPos + $multiplier * $tokenNumber" />
- <xsl:with-param name="targetRowPos" select="$targetRowPos" />
- <xsl:with-param name="digitPos" select="$digitPos" />
- <xsl:with-param name="charPos" select="$charPos + 1" />
- <!-- removing the last character-->
- <xsl:with-param name="expression" select="substring($expression, 1, $expLength - 1)" />
- <xsl:with-param name="isRow" select="false()" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>C</xsl:text>
- <xsl:if test="$targetColumnPos != $columnPos">
- <xsl:text>[</xsl:text><xsl:value-of select="$targetColumnPos - $columnPos"/><xsl:text>]</xsl:text>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="sheetName" select="substring-before($expression, '.')" />
- <xsl:value-of select="$sheetName"/><xsl:text>!</xsl:text>
- <xsl:call-template name="translate-cell-expression">
- <xsl:with-param name="rowPos" select="$rowPos" />
- <xsl:with-param name="columnPos" select="$columnPos" />
- <xsl:with-param name="expression" select="substring-after($expression, $sheetName)" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:call-template name="translate-cell-expression">
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="targetColumnPos" select="$targetColumnPos + $multiplier * $tokenNumber" />
+ <xsl:with-param name="targetRowPos" select="$targetRowPos" />
+ <xsl:with-param name="digitPos" select="$digitPos" />
+ <xsl:with-param name="charPos" select="$charPos + 1" />
+ <!-- removing the last character-->
+ <xsl:with-param name="expression" select="substring($expression, 1, $expLength - 1)" />
+ <xsl:with-param name="isRow" select="false()" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>C</xsl:text>
+ <xsl:if test="$targetColumnPos != $columnPos">
+ <xsl:text>[</xsl:text><xsl:value-of select="$targetColumnPos - $columnPos"/><xsl:text>]</xsl:text>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="sheetName" select="substring-before($expression, '.')" />
+ <xsl:value-of select="$sheetName"/><xsl:text>!</xsl:text>
+ <xsl:call-template name="translate-cell-expression">
+ <xsl:with-param name="rowPos" select="$rowPos" />
+ <xsl:with-param name="columnPos" select="$columnPos" />
+ <xsl:with-param name="expression" select="substring-after($expression, $sheetName)" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template name="calculate-square-numbers">
- <xsl:param name="base" />
- <xsl:param name="exponent" />
- <xsl:param name="return" select="1" />
+ <xsl:template name="calculate-square-numbers">
+ <xsl:param name="base" />
+ <xsl:param name="exponent" />
+ <xsl:param name="return" select="1" />
- <xsl:choose>
- <xsl:when test="$exponent > '1'">
- <xsl:call-template name="calculate-square-numbers">
- <xsl:with-param name="base" select="$base" />
- <xsl:with-param name="exponent" select="$exponent - 1"/>
- <xsl:with-param name="return" select="$return * $base" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$exponent = '1'">
- <xsl:value-of select="$return * $base"/>
- </xsl:when>
- <!-- if exponent is equal '0' -->
- <xsl:otherwise>
- <xsl:value-of select="1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:choose>
+ <xsl:when test="$exponent > '1'">
+ <xsl:call-template name="calculate-square-numbers">
+ <xsl:with-param name="base" select="$base" />
+ <xsl:with-param name="exponent" select="$exponent - 1"/>
+ <xsl:with-param name="return" select="$return * $base" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$exponent = '1'">
+ <xsl:value-of select="$return * $base"/>
+ </xsl:when>
+ <!-- if exponent is equal '0' -->
+ <xsl:otherwise>
+ <xsl:value-of select="1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template name="character-to-number">
- <xsl:param name="character" />
- <xsl:choose>
- <xsl:when test="$character = 'A'">1</xsl:when>
- <xsl:when test="$character = 'B'">2</xsl:when>
- <xsl:when test="$character = 'C'">3</xsl:when>
- <xsl:when test="$character = 'D'">4</xsl:when>
- <xsl:when test="$character = 'E'">5</xsl:when>
- <xsl:when test="$character = 'F'">6</xsl:when>
- <xsl:when test="$character = 'G'">7</xsl:when>
- <xsl:when test="$character = 'H'">8</xsl:when>
- <xsl:when test="$character = 'I'">9</xsl:when>
- <xsl:when test="$character = 'J'">10</xsl:when>
- <xsl:when test="$character = 'K'">11</xsl:when>
- <xsl:when test="$character = 'L'">12</xsl:when>
- <xsl:when test="$character = 'M'">13</xsl:when>
- <xsl:when test="$character = 'N'">14</xsl:when>
- <xsl:when test="$character = 'O'">15</xsl:when>
- <xsl:when test="$character = 'P'">16</xsl:when>
- <xsl:when test="$character = 'Q'">17</xsl:when>
- <xsl:when test="$character = 'R'">18</xsl:when>
- <xsl:when test="$character = 'S'">19</xsl:when>
- <xsl:when test="$character = 'T'">20</xsl:when>
- <xsl:when test="$character = 'U'">21</xsl:when>
- <xsl:when test="$character = 'V'">22</xsl:when>
- <xsl:when test="$character = 'W'">23</xsl:when>
- <xsl:when test="$character = 'X'">24</xsl:when>
- <xsl:when test="$character = 'Y'">25</xsl:when>
- <xsl:when test="$character = 'Z'">26</xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
+ <xsl:template name="character-to-number">
+ <xsl:param name="character" />
+ <xsl:choose>
+ <xsl:when test="$character = 'A'">1</xsl:when>
+ <xsl:when test="$character = 'B'">2</xsl:when>
+ <xsl:when test="$character = 'C'">3</xsl:when>
+ <xsl:when test="$character = 'D'">4</xsl:when>
+ <xsl:when test="$character = 'E'">5</xsl:when>
+ <xsl:when test="$character = 'F'">6</xsl:when>
+ <xsl:when test="$character = 'G'">7</xsl:when>
+ <xsl:when test="$character = 'H'">8</xsl:when>
+ <xsl:when test="$character = 'I'">9</xsl:when>
+ <xsl:when test="$character = 'J'">10</xsl:when>
+ <xsl:when test="$character = 'K'">11</xsl:when>
+ <xsl:when test="$character = 'L'">12</xsl:when>
+ <xsl:when test="$character = 'M'">13</xsl:when>
+ <xsl:when test="$character = 'N'">14</xsl:when>
+ <xsl:when test="$character = 'O'">15</xsl:when>
+ <xsl:when test="$character = 'P'">16</xsl:when>
+ <xsl:when test="$character = 'Q'">17</xsl:when>
+ <xsl:when test="$character = 'R'">18</xsl:when>
+ <xsl:when test="$character = 'S'">19</xsl:when>
+ <xsl:when test="$character = 'T'">20</xsl:when>
+ <xsl:when test="$character = 'U'">21</xsl:when>
+ <xsl:when test="$character = 'V'">22</xsl:when>
+ <xsl:when test="$character = 'W'">23</xsl:when>
+ <xsl:when test="$character = 'X'">24</xsl:when>
+ <xsl:when test="$character = 'Y'">25</xsl:when>
+ <xsl:when test="$character = 'Z'">26</xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl b/filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl
index 7698bdee2452..763ab241e2b7 100644
--- a/filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl
+++ b/filter/source/xslt/export/spreadsheetml/ooo2spreadsheetml.xsl
@@ -17,121 +17,121 @@
* 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 formalar 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 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 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 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 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 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 havt to log again in for every graphic he liks 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>
@@ -143,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"/>
@@ -327,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">
@@ -369,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>
diff --git a/filter/source/xslt/export/spreadsheetml/style_mapping.xsl b/filter/source/xslt/export/spreadsheetml/style_mapping.xsl
index fd465ac3ea3a..b338afcc2f9c 100644
--- a/filter/source/xslt/export/spreadsheetml/style_mapping.xsl
+++ b/filter/source/xslt/export/spreadsheetml/style_mapping.xsl
@@ -17,365 +17,365 @@
* 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:xt="http://www.jclark.com/xt"
- xmlns:common="http://exslt.org/common"
- xmlns:xalan="http://xml.apache.org/xalan"
- 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 xt common xalan">
-
- <xsl:variable name="namespace-html" select="'http://www.w3.org/TR/REC-html40'" />
-
- <xsl:template match="@table:style-name | @table:default-cell-style-name">
- <xsl:if test="not(name() = 'Default')">
- <xsl:attribute name="ss:StyleID">
- <xsl:value-of select="." />
- </xsl:attribute>
- </xsl:if>
- </xsl:template>
-
- <xsl:key match="table:table-cell" name="getCellByStyle" use="@table:style-name"/>
- <xsl:template match="@table:style-name" mode="table-row">
- <!-- only row styles used by cells are exported,
- as usual row style properties are already written as row attributes -->
- <xsl:if test="key('getCellByStyle', '.')">
- <xsl:attribute name="ss:StyleID">
- <xsl:value-of select="." />
- </xsl:attribute>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="style-and-contents">
- <xsl:param name="cellStyleName" />
-
- <!-- WorkAround of Excel2003 issue:
- Styles from the CellStyle will not be inherited to HTML content (e.g. Colour style).
- -->
- <xsl:choose>
- <xsl:when test="@text:style-name">
- <xsl:variable name="styles">
- <xsl:copy-of select="key('styles', @text:style-name)/*" />
- <xsl:copy-of select="key('styles', $cellStyleName)/*" />
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="create-nested-format-tags">
- <xsl:with-param name="styles" select="xalan:nodeset($styles)" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="create-nested-format-tags">
- <xsl:with-param name="styles" select="xt:node-set($styles)" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="create-nested-format-tags">
- <xsl:with-param name="styles" select="common:node-set($styles)" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@table:style-name">
- <xsl:variable name="styles">
- <xsl:copy-of select="key('styles', @text:style-name)/*" />
- <xsl:copy-of select="key('styles', $cellStyleName)/*" />
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="create-nested-format-tags">
- <xsl:with-param name="styles" select="xalan:nodeset($styles)" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="create-nested-format-tags">
- <xsl:with-param name="styles" select="xt:node-set($styles)" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="create-nested-format-tags">
- <xsl:with-param name="styles" select="common:node-set($styles)" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- *********************************** -->
- <!-- *** creating nested format tags *** -->
- <!-- *********************************** -->
-
- <!-- Bold -->
- <xsl:template name="create-nested-format-tags">
- <xsl:param name="styles" />
- <xsl:param name="cellStyleName" />
-
- <xsl:choose>
- <xsl:when test="$styles/*/@fo:font-weight = 'bold' or $styles/*/@fo:font-weight = 'bolder'">
- <xsl:element namespace="{$namespace-html}" name="B">
- <xsl:call-template name="italic">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="italic">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- Italic -->
- <xsl:template name="italic">
- <xsl:param name="styles" />
- <xsl:param name="cellStyleName" />
-
- <xsl:choose>
- <xsl:when test="$styles/*/@fo:font-style = 'italic' or $styles/*/@fo:font-style = 'oblique'">
- <xsl:element namespace="{$namespace-html}" name="I">
- <xsl:call-template name="underline">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="underline">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- Underline -->
- <xsl:template name="underline">
- <xsl:param name="styles" />
- <xsl:param name="cellStyleName" />
-
- <xsl:choose>
- <xsl:when test="$styles/*/@style:text-underline-type and not($styles/*/@style:text-underline-type = 'none')">
- <xsl:element namespace="{$namespace-html}" name="U">
- <xsl:call-template name="strikethrough">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="strikethrough">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
-
- <!-- strikethrough -->
- <xsl:template name="strikethrough">
- <xsl:param name="styles" />
- <xsl:param name="cellStyleName" />
-
- <xsl:choose>
- <xsl:when test="$styles/*/@style:text-line-through-style and not($styles/*/@style:text-line-through-style = 'none')">
- <xsl:element namespace="{$namespace-html}" name="S">
- <xsl:call-template name="super-subscript">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="super-subscript">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-
- <!-- superscript & subscript -->
- <xsl:template name="super-subscript">
- <xsl:param name="styles" />
- <xsl:param name="cellStyleName" />
-
- <xsl:choose>
- <xsl:when test="$styles/*/@style:text-position">
- <xsl:variable name="textPosition" select="number(substring-before($styles/*/@style:text-position, '% '))" />
- <xsl:choose>
- <xsl:when test="$textPosition &gt; 0">
- <xsl:element namespace="{$namespace-html}" name="Sup">
- <xsl:call-template name="align">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:when test="$textPosition &lt; 0">
- <xsl:element namespace="{$namespace-html}" name="Sub">
- <xsl:call-template name="align">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="align">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="align">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- Alignment - normally called by strikethrough, but no DIV elements in HTML -->
- <xsl:template name="align">
- <xsl:param name="styles" />
- <xsl:param name="cellStyleName" />
-
- <xsl:choose>
- <xsl:when test="$styles/*/@fo:font-align">
- <xsl:element namespace="{$namespace-html}" name="DIV">
- <xsl:attribute name="html:style">
- <xsl:choose>
- <xsl:when test="$styles/*/@fo:font-align = 'start'">
- <xsl:text>text-align:left;</xsl:text>
- </xsl:when>
- <xsl:when test="$styles/*/@fo:font-align = 'end'">
- <xsl:text>text-align:right;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>text-align:center;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:call-template name="font">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="font">
- <xsl:with-param name="styles" select="$styles" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- Font (size and color) -->
- <xsl:template name="font">
- <xsl:param name="styles" />
- <xsl:param name="cellStyleName" />
-
- <xsl:choose>
- <xsl:when test="$styles/*/@style:font-name or
- $styles/*/@fo:font-size or
- $styles/*/@fo:color">
- <xsl:element namespace="{$namespace-html}" name="Font">
- <xsl:if test="$styles/*/@style:font-name">
- <xsl:attribute name="html:Face">
- <xsl:value-of select="$styles/*/@style:font-name" />
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$styles/*/@fo:color">
- <xsl:attribute name="html:Color">
- <xsl:value-of select="$styles/*/@fo:color" />
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$styles/*/@fo:font-size">
- <!-- WORKAROUND TO EXCEL2003 issue where nested FONT elements with size attributes result in unloadable documents -->
- <!-- Only create size attribute if parent do not have already one -->
-
- <!--<xsl:choose>
- <xsl:when test="not(key('styles', parent::*/@text:style-name)/*/@fo:font-size)"> -->
- <xsl:if test="not(key('styles', parent::*/@text:style-name)/*/@fo:font-size)">
- <xsl:attribute name="html:Size">
- <xsl:call-template name="convert2pt">
- <xsl:with-param name="value" select="$styles/*/@fo:font-size" />
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:attribute>
- </xsl:if>
- <!--</xsl:when>
- <xsl:otherwise>
- <xsl:message>Due Excel issue we have to neglect size from @text:style-name '<xsl:value-of select="@text:style-name"/>'!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>-->
- </xsl:if>
- <!-- get the embedded content -->
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:apply-templates>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <!-- get the embedded content -->
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ 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:xt="http://www.jclark.com/xt"
+ xmlns:common="http://exslt.org/common"
+ xmlns:xalan="http://xml.apache.org/xalan"
+ 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 xt common xalan">
+
+ <xsl:variable name="namespace-html" select="'http://www.w3.org/TR/REC-html40'" />
+
+ <xsl:template match="@table:style-name | @table:default-cell-style-name">
+ <xsl:if test="not(name() = 'Default')">
+ <xsl:attribute name="ss:StyleID">
+ <xsl:value-of select="." />
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:key match="table:table-cell" name="getCellByStyle" use="@table:style-name"/>
+ <xsl:template match="@table:style-name" mode="table-row">
+ <!-- only row styles used by cells are exported,
+ as usual row style properties are already written as row attributes -->
+ <xsl:if test="key('getCellByStyle', '.')">
+ <xsl:attribute name="ss:StyleID">
+ <xsl:value-of select="." />
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="style-and-contents">
+ <xsl:param name="cellStyleName" />
+
+ <!-- WorkAround of Excel2003 issue:
+ Styles from the CellStyle will not be inherited to HTML content (e.g. Colour style).
+ -->
+ <xsl:choose>
+ <xsl:when test="@text:style-name">
+ <xsl:variable name="styles">
+ <xsl:copy-of select="key('styles', @text:style-name)/*" />
+ <xsl:copy-of select="key('styles', $cellStyleName)/*" />
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="create-nested-format-tags">
+ <xsl:with-param name="styles" select="xalan:nodeset($styles)" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="create-nested-format-tags">
+ <xsl:with-param name="styles" select="xt:node-set($styles)" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="create-nested-format-tags">
+ <xsl:with-param name="styles" select="common:node-set($styles)" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="@table:style-name">
+ <xsl:variable name="styles">
+ <xsl:copy-of select="key('styles', @text:style-name)/*" />
+ <xsl:copy-of select="key('styles', $cellStyleName)/*" />
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="create-nested-format-tags">
+ <xsl:with-param name="styles" select="xalan:nodeset($styles)" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="create-nested-format-tags">
+ <xsl:with-param name="styles" select="xt:node-set($styles)" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="create-nested-format-tags">
+ <xsl:with-param name="styles" select="common:node-set($styles)" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- *********************************** -->
+ <!-- *** creating nested format tags *** -->
+ <!-- *********************************** -->
+
+ <!-- Bold -->
+ <xsl:template name="create-nested-format-tags">
+ <xsl:param name="styles" />
+ <xsl:param name="cellStyleName" />
+
+ <xsl:choose>
+ <xsl:when test="$styles/*/@fo:font-weight = 'bold' or $styles/*/@fo:font-weight = 'bolder'">
+ <xsl:element namespace="{$namespace-html}" name="B">
+ <xsl:call-template name="italic">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="italic">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- Italic -->
+ <xsl:template name="italic">
+ <xsl:param name="styles" />
+ <xsl:param name="cellStyleName" />
+
+ <xsl:choose>
+ <xsl:when test="$styles/*/@fo:font-style = 'italic' or $styles/*/@fo:font-style = 'oblique'">
+ <xsl:element namespace="{$namespace-html}" name="I">
+ <xsl:call-template name="underline">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="underline">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- Underline -->
+ <xsl:template name="underline">
+ <xsl:param name="styles" />
+ <xsl:param name="cellStyleName" />
+
+ <xsl:choose>
+ <xsl:when test="$styles/*/@style:text-underline-type and not($styles/*/@style:text-underline-type = 'none')">
+ <xsl:element namespace="{$namespace-html}" name="U">
+ <xsl:call-template name="strikethrough">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="strikethrough">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+
+
+ <!-- strikethrough -->
+ <xsl:template name="strikethrough">
+ <xsl:param name="styles" />
+ <xsl:param name="cellStyleName" />
+
+ <xsl:choose>
+ <xsl:when test="$styles/*/@style:text-line-through-style and not($styles/*/@style:text-line-through-style = 'none')">
+ <xsl:element namespace="{$namespace-html}" name="S">
+ <xsl:call-template name="super-subscript">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="super-subscript">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+
+ <!-- superscript & subscript -->
+ <xsl:template name="super-subscript">
+ <xsl:param name="styles" />
+ <xsl:param name="cellStyleName" />
+
+ <xsl:choose>
+ <xsl:when test="$styles/*/@style:text-position">
+ <xsl:variable name="textPosition" select="number(substring-before($styles/*/@style:text-position, '% '))" />
+ <xsl:choose>
+ <xsl:when test="$textPosition &gt; 0">
+ <xsl:element namespace="{$namespace-html}" name="Sup">
+ <xsl:call-template name="align">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="$textPosition &lt; 0">
+ <xsl:element namespace="{$namespace-html}" name="Sub">
+ <xsl:call-template name="align">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="align">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="align">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- Alignment - normally called by strikethrough, but no DIV elements in HTML -->
+ <xsl:template name="align">
+ <xsl:param name="styles" />
+ <xsl:param name="cellStyleName" />
+
+ <xsl:choose>
+ <xsl:when test="$styles/*/@fo:font-align">
+ <xsl:element namespace="{$namespace-html}" name="DIV">
+ <xsl:attribute name="html:style">
+ <xsl:choose>
+ <xsl:when test="$styles/*/@fo:font-align = 'start'">
+ <xsl:text>text-align:left;</xsl:text>
+ </xsl:when>
+ <xsl:when test="$styles/*/@fo:font-align = 'end'">
+ <xsl:text>text-align:right;</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>text-align:center;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:call-template name="font">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="font">
+ <xsl:with-param name="styles" select="$styles" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- Font (size and color) -->
+ <xsl:template name="font">
+ <xsl:param name="styles" />
+ <xsl:param name="cellStyleName" />
+
+ <xsl:choose>
+ <xsl:when test="$styles/*/@style:font-name or
+ $styles/*/@fo:font-size or
+ $styles/*/@fo:color">
+ <xsl:element namespace="{$namespace-html}" name="Font">
+ <xsl:if test="$styles/*/@style:font-name">
+ <xsl:attribute name="html:Face">
+ <xsl:value-of select="$styles/*/@style:font-name" />
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styles/*/@fo:color">
+ <xsl:attribute name="html:Color">
+ <xsl:value-of select="$styles/*/@fo:color" />
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styles/*/@fo:font-size">
+ <!-- WORKAROUND TO EXCEL2003 issue where nested FONT elements with size attributes result in unloadable documents -->
+ <!-- Only create size attribute if parent do not have already one -->
+
+ <!--<xsl:choose>
+ <xsl:when test="not(key('styles', parent::*/@text:style-name)/*/@fo:font-size)"> -->
+ <xsl:if test="not(key('styles', parent::*/@text:style-name)/*/@fo:font-size)">
+ <xsl:attribute name="html:Size">
+ <xsl:call-template name="convert2pt">
+ <xsl:with-param name="value" select="$styles/*/@fo:font-size" />
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ <!--</xsl:when>
+ <xsl:otherwise>
+ <xsl:message>Due Excel issue we have to neglect size from @text:style-name '<xsl:value-of select="@text:style-name"/>'!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>-->
+ </xsl:if>
+ <!-- get the embedded content -->
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- get the embedded content -->
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/export/spreadsheetml/styles.xsl b/filter/source/xslt/export/spreadsheetml/styles.xsl
index b2b64edc6fba..16f9e943a785 100644
--- a/filter/source/xslt/export/spreadsheetml/styles.xsl
+++ b/filter/source/xslt/export/spreadsheetml/styles.xsl
@@ -17,670 +17,670 @@
* 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:xt="http://www.jclark.com/xt"
- xmlns:common="http://exslt.org/common"
- xmlns:xalan="http://xml.apache.org/xalan"
- 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 xt common xalan">
-
- <!-- Used in case of 'style:map', conditional formatting, where a style references to another -->
- <xsl:key name="styles" match="/*/office:styles/style:style | /*/office:automatic-styles/style:style" use="@style:name" />
- <!--
- Mapping of OOo style:name and style:family to excel ss:ID
- Styles form style:style map from style:name to ss:Name
- style:parent-style map to ss:Parent
- -->
- <!-- default styles of the application
- <xsl:template match="style:default-style" mode="styles" >
- <xsl:call-template name="style:style">
- <xsl:with-param name="styleName" select="'Default'" />
- </xsl:call-template>
- </xsl:template>
- -->
-
- <xsl:template match="style:style" mode="styles">
- <xsl:param name="isAutomatic" />
- <xsl:param name="styleName" select="@style:name" />
- <xsl:param name="styleParentName" select="@style:parent-style-name" />
-
- <!-- only row styles used by cells are exported,
- as usual row style properties are already exported as row attributes -->
- <xsl:if test="not(@style:family='table-row') or @style:family='table-row' and key('getCellByStyle', '.')">
- <xsl:element name="Style">
- <xsl:attribute name="ss:ID">
- <!-- neglecting that a style is only unique in conjunction with its family name -->
- <xsl:value-of select="@style:name" />
- </xsl:attribute>
- <xsl:choose>
- <xsl:when test="not($isAutomatic)">
- <xsl:choose>
- <xsl:when test="@style:display-name">
- <xsl:attribute name="ss:Name"><xsl:value-of select="@style:display-name"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="ss:Name"><xsl:value-of select="@style:name" /></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <!-- when a non-allowed parent style is found
- (in spreadsheetml no style with ss:Name is able to have a ss:Parent) -->
- <xsl:when test="@style:parent-style-name">
- <!-- styles have to be merged (flatting heritance tree) -->
- <xsl:variable name="stylePropertiesContainer">
- <xsl:call-template name="merge-all-parent-styles">
- <xsl:with-param name="currentStyle" select="." />
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="write-style-properties">
- <xsl:with-param name="styleProperties" select="xalan:nodeset($stylePropertiesContainer)/*" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="write-style-properties">
- <xsl:with-param name="styleProperties" select="common:node-set($stylePropertiesContainer)/*" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="write-style-properties">
- <xsl:with-param name="styleProperties" select="xt:node-set($stylePropertiesContainer)/*" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">WARNING: The required node set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="write-style-properties" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- automatic styles are implicit inherting from a style called 'Default',
- furthermore nor in spreadsheetml nor in OpenDocument automatic styles are able to inherit from each other -->
- <xsl:choose>
- <xsl:when test="@style:parent-style-name and not(@style:parent-style-name = 'Default')">
- <xsl:attribute name="ss:Parent"><xsl:value-of select="@style:parent-style-name" /></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:call-template name="write-style-properties" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <!-- resolving the style inheritance by starting from uppermost parent and
- overriding exisiting style properties by new found child properties -->
- <xsl:template name="merge-all-parent-styles">
- <xsl:param name="currentStyle" />
-
- <xsl:choose>
- <!-- in case of a parent, styles have to be merged (flatting heritance tree) -->
- <xsl:when test="$currentStyle/@style:parent-style-name">
- <!-- collect parent style properties -->
- <xsl:variable name="parentStyleContainer">
- <!-- take a look if the parent style has a parent himself -->
- <xsl:call-template name="merge-all-parent-styles" >
- <xsl:with-param name="currentStyle" select="key('styles', $currentStyle/@style:parent-style-name)" />
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="merge-style-properties">
- <xsl:with-param name="childStyleContainer" select="$currentStyle" />
- <xsl:with-param name="parentStyleContainer" select="xalan:nodeset($parentStyleContainer)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="merge-style-properties">
- <xsl:with-param name="childStyleContainer" select="$currentStyle" />
- <xsl:with-param name="parentStyleContainer" select="common:node-set($parentStyleContainer)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="merge-style-properties">
- <xsl:with-param name="childStyleContainer" select="$currentStyle" />
- <xsl:with-param name="parentStyleContainer" select="xt:node-set($parentStyleContainer)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">WARNING: The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- called for top parents (or styles without parents) -->
- <xsl:otherwise>
- <xsl:copy-of select="$currentStyle/*"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="merge-style-properties">
- <xsl:param name="childStyleContainer" />
- <xsl:param name="parentStyleContainer" />
-
- <xsl:choose>
- <xsl:when test="$parentStyleContainer/*">
- <xsl:apply-templates select="$parentStyleContainer/*" mode="inheritance">
- <xsl:with-param name="childStyleContainer" select="$childStyleContainer" />
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$childStyleContainer/*"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="*" mode="inheritance">
- <xsl:param name="childStyleContainer" />
-
- <!-- create an element named equal to the current properties parent element (e.g. style:table-cell-properties) -->
- <xsl:element name="{name()}" namespace="urn:oasis:names:tc:opendocument:xmlns:style:1.0">
- <!-- attributes will be automatically replaced -->
- <xsl:copy-of select="@*" />
- <xsl:copy-of select="$childStyleContainer/*[name() = name(current() )]/@*"/>
-
- <!-- elements are not needed yet, will be neglected for simplicity reasons -->
- </xsl:element>
- </xsl:template>
-
- <xsl:key match="/*/office:styles/number:date-style |
- /*/office:styles/number:time-style |
- /*/office:styles/number:number-style |
- /*/office:styles/number:percentage-style |
- /*/office:styles/number:currency-style |
- /*/office:automatic-styles/number:date-style |
- /*/office:automatic-styles/number:time-style |
- /*/office:automatic-styles/number:number-style |
- /*/office:automatic-styles/number:percentage-style |
- /*/office:automatic-styles/number:currency-style" name="number-style" use="@style:name" />
-
-
- <xsl:template name="write-style-properties">
- <xsl:param name="styleProperties" select="key('styles', @style:name)/*" />
-
- <xsl:call-template name="Alignment">
- <xsl:with-param name="styleProperties" select="$styleProperties" />
- </xsl:call-template>
- <xsl:call-template name="Border">
- <xsl:with-param name="styleProperties" select="$styleProperties" />
- </xsl:call-template>
- <xsl:call-template name="Font">
- <xsl:with-param name="styleProperties" select="$styleProperties" />
- <xsl:with-param name="styleParentName" select="@style:parent-style-name" />
- </xsl:call-template>
- <xsl:call-template name="Interior">
- <xsl:with-param name="styleProperties" select="$styleProperties" />
- </xsl:call-template>
- <xsl:call-template name="NumberFormat">
- <xsl:with-param name="styleProperties" select="$styleProperties" />
- </xsl:call-template>
- </xsl:template>
-
- <!-- context is element 'style:style' -->
- <xsl:template name="NumberFormat">
- <xsl:if test="@style:data-style-name">
- <xsl:variable name="numberStyleName" select="@style:data-style-name" />
- <xsl:variable name="numberStyle" select="key('number-style', $numberStyleName)" />
-
- <xsl:element name="NumberFormat">
- <xsl:attribute name="ss:Format">
- <xsl:choose>
- <xsl:when test="not($numberStyle/node())">
- <!-- Excel2003sp1 issue: 'General' and 'General Number' is not supported -->
- <xsl:text>General</xsl:text>
- </xsl:when>
- <xsl:when test="name($numberStyle) = 'number:number-style'">
- <xsl:choose>
- <xsl:when test="$numberStyle/number:scientific-number">
- <xsl:text>Scientific</xsl:text>
- </xsl:when>
- <!-- Excel2003sp1 issue: 'General Number' not supported -->
- <xsl:when test="$numberStyle/number:number/@number:decimal-places and
- $numberStyle/number:number/@number:decimal-places='0'">
- <xsl:text>General</xsl:text>
- </xsl:when>
- <xsl:when test="$numberStyle/number:text">
- <xsl:choose>
- <xsl:when test="$numberStyle/number:text = 'No' or $numberStyle/number:text = 'Nein'">
- <xsl:text>Yes/No</xsl:text>
- </xsl:when>
- <xsl:when test="$numberStyle/number:text = 'False' or $numberStyle/number:text = 'Falsch'">
- <xsl:text>True/False</xsl:text>
- </xsl:when>
- <xsl:when test="$numberStyle/number:text = 'Off' or $numberStyle/number:text = 'Aus'">
- <xsl:text>On/Off</xsl:text>
- </xsl:when>
- <!-- Excel2003sp1 issue: currency is saved as 'float' -->
- <xsl:when test="$numberStyle/number:currency-symbol">
- <xsl:choose>
- <xsl:when test="contains($numberStyle/number:currency-symbol, '€')">
- <xsl:text>Euro Currency</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>Currency</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- Excel2003sp1 issue: 'Currency' is saved as 'float' -->
- <xsl:when test="contains($numberStyle/number:text, '$')">
- <xsl:text>Currency</xsl:text>
- </xsl:when>
- <!-- OASIS XML adapation -->
- <xsl:otherwise>
- <xsl:text>General</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$numberStyle/number:grouping">
- <xsl:text>Standard</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>Fixed</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="name($numberStyle) = 'number:time-style'">
- <xsl:choose>
- <xsl:when test="$numberStyle/number:am-pm">
- <xsl:choose>
- <xsl:when test="$numberStyle/number:seconds">
- <xsl:text>Long Time</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>Medium Time</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>Short Time</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="name($numberStyle) = 'number:percentage-style'">
- <xsl:text>Percent</xsl:text>
- </xsl:when>
- <xsl:when test="name($numberStyle) = 'number:currency-style'">
- <xsl:choose>
- <xsl:when test="contains($numberStyle/number:currency-symbol, '€')">
- <xsl:text>Euro Currency</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>Currency</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$numberStyle/number:month">
- <xsl:choose>
- <xsl:when test="$numberStyle/number:month/@number:textual and
- $numberStyle/number:month/@number:textual=true()">
- <xsl:text>Medium Date</xsl:text>
- <!-- Excel2003 sp1 issue: No difference between 'Long Date' and 'Medium Date' -->
- </xsl:when>
- <xsl:when test="$numberStyle/number:hours">
- <xsl:text>General Date</xsl:text>
- </xsl:when>
- <xsl:when test="$numberStyle/number:year/@number:style and
- $numberStyle/number:year/@number:style='long'">
- <xsl:text>Short Date</xsl:text>
- </xsl:when>
- <!-- OASIS XML adapation -->
- <xsl:otherwise>
- <xsl:text>Short Date</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- OASIS XML adapation -->
- <xsl:otherwise>
- <xsl:text>General</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="Alignment">
- <xsl:param name="styleProperties" />
-
- <!-- An empty Alignment element, might overwrite parents setting by
- the default attributes -->
- <xsl:if test="$styleProperties/@fo:text-align or
- $styleProperties/@style:vertical-align or
- $styleProperties/@fo:wrap-option or
- $styleProperties/@fo:margin-left or
- $styleProperties/@style:rotation-angle or
- $styleProperties/@style:direction">
- <xsl:element name="Alignment">
- <xsl:if test="$styleProperties/@fo:text-align">
- <xsl:attribute name="ss:Horizontal">
- <xsl:choose>
- <xsl:when test="$styleProperties/@fo:text-align = 'center'">Center</xsl:when>
- <xsl:when test="$styleProperties/@fo:text-align = 'end'">Right</xsl:when>
- <xsl:when test="$styleProperties/@fo:text-align = 'justify'">Justify</xsl:when>
- <xsl:otherwise>Left</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:vertical-align">
- <xsl:attribute name="ss:Vertical">
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:vertical-align = 'top'">Top</xsl:when>
- <xsl:when test="$styleProperties/@style:vertical-align = 'bottom'">Bottom</xsl:when>
- <xsl:when test="$styleProperties/@style:vertical-align = 'middle'">Center</xsl:when>
- <xsl:otherwise>Automatic</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@fo:wrap-option = 'wrap'">
- <xsl:attribute name="ss:WrapText">1</xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@fo:margin-left">
- <xsl:attribute name="ss:Indent">
- <xsl:variable name="margin">
- <xsl:call-template name="convert2pt">
- <xsl:with-param name="value" select="$styleProperties/@fo:margin-left" />
- <xsl:with-param name="rounding-factor" select="1" />
- </xsl:call-template>
- </xsl:variable>
- <!-- one ss:Indent is equal to 10 points -->
- <xsl:value-of select="number($margin) div 10"/>
- </xsl:attribute>
- </xsl:if>
- <!-- Excel is only able to rotate between 90 and -90 degree (inclusive).
- Other degrees will be mapped by 180 degrees -->
- <xsl:if test="$styleProperties/@style:rotation-angle">
- <xsl:attribute name="ss:Rotate">
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:rotation-angle &gt; 90">
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:rotation-angle &gt;= 270">
- <xsl:value-of select="$styleProperties/@style:rotation-angle - 360" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$styleProperties/@style:rotation-angle - 180" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$styleProperties/@style:rotation-angle &lt; -90">
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:rotation-angle &lt;= -270">
- <xsl:value-of select="$styleProperties/@style:rotation-angle + 360" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$styleProperties/@style:rotation-angle + 180" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$styleProperties/@style:rotation-angle" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:direction = 'ttb'">
- <xsl:attribute name="ss:VerticalText">1</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
-
- <xsl:template name="Border">
- <xsl:param name="styleProperties" />
-
- <!-- An empty border element, might overwrite parents setting by
- the default attributes -->
- <xsl:if test="$styleProperties/@fo:border or
- $styleProperties/@fo:border-bottom or
- $styleProperties/@fo:border-left or
- $styleProperties/@fo:border-right or
- $styleProperties/@fo:border-top">
- <xsl:element name="Borders">
- <xsl:if test="$styleProperties/@fo:border-bottom and not($styleProperties/@fo:border-bottom = 'none')">
- <xsl:element name="Border">
- <xsl:attribute name="ss:Position">Bottom</xsl:attribute>
- <xsl:call-template name="border-attributes">
- <xsl:with-param name="border_properties" select="$styleProperties/@fo:border-bottom" />
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$styleProperties/@fo:border-left and not($styleProperties/@fo:border-left = 'none')">
- <xsl:element name="Border">
- <xsl:attribute name="ss:Position">Left</xsl:attribute>
- <xsl:call-template name="border-attributes">
- <xsl:with-param name="border_properties" select="$styleProperties/@fo:border-left" />
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$styleProperties/@fo:border-right and not($styleProperties/@fo:border-right = 'none')">
- <xsl:element name="Border">
- <xsl:attribute name="ss:Position">Right</xsl:attribute>
- <xsl:call-template name="border-attributes">
- <xsl:with-param name="border_properties" select="$styleProperties/@fo:border-right" />
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$styleProperties/@fo:border-top and not($styleProperties/@fo:border-top = 'none')">
- <xsl:element name="Border">
- <xsl:attribute name="ss:Position">Top</xsl:attribute>
- <xsl:call-template name="border-attributes">
- <xsl:with-param name="border_properties" select="$styleProperties/@fo:border-top" />
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- <!-- write out all table border -->
- <xsl:if test="$styleProperties/@fo:border and not($styleProperties/@fo:border = 'none')">
- <xsl:element name="Border">
- <xsl:attribute name="ss:Position">Bottom</xsl:attribute>
- <xsl:call-template name="border-attributes">
- <xsl:with-param name="border_properties" select="$styleProperties/@fo:border" />
- </xsl:call-template>
- </xsl:element>
- <xsl:element name="Border">
- <xsl:attribute name="ss:Position">Left</xsl:attribute>
- <xsl:call-template name="border-attributes">
- <xsl:with-param name="border_properties" select="$styleProperties/@fo:border" />
- </xsl:call-template>
- </xsl:element>
- <xsl:element name="Border">
- <xsl:attribute name="ss:Position">Right</xsl:attribute>
- <xsl:call-template name="border-attributes">
- <xsl:with-param name="border_properties" select="$styleProperties/@fo:border" />
- </xsl:call-template>
- </xsl:element>
- <xsl:element name="Border">
- <xsl:attribute name="ss:Position">Top</xsl:attribute>
- <xsl:call-template name="border-attributes">
- <xsl:with-param name="border_properties" select="$styleProperties/@fo:border" />
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
-
- <xsl:template name="border-attributes">
- <xsl:param name="border_properties" />
-
- <xsl:variable name="border-width">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="substring-before($border_properties, ' ')" />
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="border-style" select="substring-before(substring-after($border_properties, ' '), ' ')" />
- <xsl:variable name="border-color" select="substring-after(substring-after($border_properties, ' '), ' ')" />
+ 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:xt="http://www.jclark.com/xt"
+ xmlns:common="http://exslt.org/common"
+ xmlns:xalan="http://xml.apache.org/xalan"
+ 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 xt common xalan">
+
+ <!-- Used in case of 'style:map', conditional formatting, where a style references to another -->
+ <xsl:key name="styles" match="/*/office:styles/style:style | /*/office:automatic-styles/style:style" use="@style:name" />
+ <!--
+ Mapping of OOo style:name and style:family to excel ss:ID
+ Styles form style:style map from style:name to ss:Name
+ style:parent-style map to ss:Parent
+ -->
+ <!-- default styles of the application
+ <xsl:template match="style:default-style" mode="styles" >
+ <xsl:call-template name="style:style">
+ <xsl:with-param name="styleName" select="'Default'" />
+ </xsl:call-template>
+ </xsl:template>
+ -->
+
+ <xsl:template match="style:style" mode="styles">
+ <xsl:param name="isAutomatic" />
+ <xsl:param name="styleName" select="@style:name" />
+ <xsl:param name="styleParentName" select="@style:parent-style-name" />
+
+ <!-- only row styles used by cells are exported,
+ as usual row style properties are already exported as row attributes -->
+ <xsl:if test="not(@style:family='table-row') or @style:family='table-row' and key('getCellByStyle', '.')">
+ <xsl:element name="Style">
+ <xsl:attribute name="ss:ID">
+ <!-- neglecting that a style is only unique in conjunction with its family name -->
+ <xsl:value-of select="@style:name" />
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="not($isAutomatic)">
+ <xsl:choose>
+ <xsl:when test="@style:display-name">
+ <xsl:attribute name="ss:Name"><xsl:value-of select="@style:display-name"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="ss:Name"><xsl:value-of select="@style:name" /></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <!-- when a non-allowed parent style is found
+ (in spreadsheetml no style with ss:Name is able to have a ss:Parent) -->
+ <xsl:when test="@style:parent-style-name">
+ <!-- styles have to be merged (flatting heritance tree) -->
+ <xsl:variable name="stylePropertiesContainer">
+ <xsl:call-template name="merge-all-parent-styles">
+ <xsl:with-param name="currentStyle" select="." />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="write-style-properties">
+ <xsl:with-param name="styleProperties" select="xalan:nodeset($stylePropertiesContainer)/*" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="write-style-properties">
+ <xsl:with-param name="styleProperties" select="common:node-set($stylePropertiesContainer)/*" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="write-style-properties">
+ <xsl:with-param name="styleProperties" select="xt:node-set($stylePropertiesContainer)/*" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">WARNING: The required node set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="write-style-properties" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- automatic styles are implicit inherting from a style called 'Default',
+ furthermore nor in spreadsheetml nor in OpenDocument automatic styles are able to inherit from each other -->
+ <xsl:choose>
+ <xsl:when test="@style:parent-style-name and not(@style:parent-style-name = 'Default')">
+ <xsl:attribute name="ss:Parent"><xsl:value-of select="@style:parent-style-name" /></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:call-template name="write-style-properties" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- resolving the style inheritance by starting from uppermost parent and
+ overriding exisiting style properties by new found child properties -->
+ <xsl:template name="merge-all-parent-styles">
+ <xsl:param name="currentStyle" />
+
+ <xsl:choose>
+ <!-- in case of a parent, styles have to be merged (flatting heritance tree) -->
+ <xsl:when test="$currentStyle/@style:parent-style-name">
+ <!-- collect parent style properties -->
+ <xsl:variable name="parentStyleContainer">
+ <!-- take a look if the parent style has a parent himself -->
+ <xsl:call-template name="merge-all-parent-styles" >
+ <xsl:with-param name="currentStyle" select="key('styles', $currentStyle/@style:parent-style-name)" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="merge-style-properties">
+ <xsl:with-param name="childStyleContainer" select="$currentStyle" />
+ <xsl:with-param name="parentStyleContainer" select="xalan:nodeset($parentStyleContainer)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="merge-style-properties">
+ <xsl:with-param name="childStyleContainer" select="$currentStyle" />
+ <xsl:with-param name="parentStyleContainer" select="common:node-set($parentStyleContainer)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="merge-style-properties">
+ <xsl:with-param name="childStyleContainer" select="$currentStyle" />
+ <xsl:with-param name="parentStyleContainer" select="xt:node-set($parentStyleContainer)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">WARNING: The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- called for top parents (or styles without parents) -->
+ <xsl:otherwise>
+ <xsl:copy-of select="$currentStyle/*"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="merge-style-properties">
+ <xsl:param name="childStyleContainer" />
+ <xsl:param name="parentStyleContainer" />
+
+ <xsl:choose>
+ <xsl:when test="$parentStyleContainer/*">
+ <xsl:apply-templates select="$parentStyleContainer/*" mode="inheritance">
+ <xsl:with-param name="childStyleContainer" select="$childStyleContainer" />
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$childStyleContainer/*"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="*" mode="inheritance">
+ <xsl:param name="childStyleContainer" />
+
+ <!-- create an element named equal to the current properties parent element (e.g. style:table-cell-properties) -->
+ <xsl:element name="{name()}" namespace="urn:oasis:names:tc:opendocument:xmlns:style:1.0">
+ <!-- attributes will be automatically replaced -->
+ <xsl:copy-of select="@*" />
+ <xsl:copy-of select="$childStyleContainer/*[name() = name(current() )]/@*"/>
+
+ <!-- elements are not needed yet, will be neglected for simplicity reasons -->
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:key match="/*/office:styles/number:date-style |
+ /*/office:styles/number:time-style |
+ /*/office:styles/number:number-style |
+ /*/office:styles/number:percentage-style |
+ /*/office:styles/number:currency-style |
+ /*/office:automatic-styles/number:date-style |
+ /*/office:automatic-styles/number:time-style |
+ /*/office:automatic-styles/number:number-style |
+ /*/office:automatic-styles/number:percentage-style |
+ /*/office:automatic-styles/number:currency-style" name="number-style" use="@style:name" />
+
+
+ <xsl:template name="write-style-properties">
+ <xsl:param name="styleProperties" select="key('styles', @style:name)/*" />
+
+ <xsl:call-template name="Alignment">
+ <xsl:with-param name="styleProperties" select="$styleProperties" />
+ </xsl:call-template>
+ <xsl:call-template name="Border">
+ <xsl:with-param name="styleProperties" select="$styleProperties" />
+ </xsl:call-template>
+ <xsl:call-template name="Font">
+ <xsl:with-param name="styleProperties" select="$styleProperties" />
+ <xsl:with-param name="styleParentName" select="@style:parent-style-name" />
+ </xsl:call-template>
+ <xsl:call-template name="Interior">
+ <xsl:with-param name="styleProperties" select="$styleProperties" />
+ </xsl:call-template>
+ <xsl:call-template name="NumberFormat">
+ <xsl:with-param name="styleProperties" select="$styleProperties" />
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- context is element 'style:style' -->
+ <xsl:template name="NumberFormat">
+ <xsl:if test="@style:data-style-name">
+ <xsl:variable name="numberStyleName" select="@style:data-style-name" />
+ <xsl:variable name="numberStyle" select="key('number-style', $numberStyleName)" />
+
+ <xsl:element name="NumberFormat">
+ <xsl:attribute name="ss:Format">
+ <xsl:choose>
+ <xsl:when test="not($numberStyle/node())">
+ <!-- Excel2003sp1 issue: 'General' and 'General Number' is not supported -->
+ <xsl:text>General</xsl:text>
+ </xsl:when>
+ <xsl:when test="name($numberStyle) = 'number:number-style'">
+ <xsl:choose>
+ <xsl:when test="$numberStyle/number:scientific-number">
+ <xsl:text>Scientific</xsl:text>
+ </xsl:when>
+ <!-- Excel2003sp1 issue: 'General Number' not supported -->
+ <xsl:when test="$numberStyle/number:number/@number:decimal-places and
+ $numberStyle/number:number/@number:decimal-places='0'">
+ <xsl:text>General</xsl:text>
+ </xsl:when>
+ <xsl:when test="$numberStyle/number:text">
+ <xsl:choose>
+ <xsl:when test="$numberStyle/number:text = 'No' or $numberStyle/number:text = 'Nein'">
+ <xsl:text>Yes/No</xsl:text>
+ </xsl:when>
+ <xsl:when test="$numberStyle/number:text = 'False' or $numberStyle/number:text = 'Falsch'">
+ <xsl:text>True/False</xsl:text>
+ </xsl:when>
+ <xsl:when test="$numberStyle/number:text = 'Off' or $numberStyle/number:text = 'Aus'">
+ <xsl:text>On/Off</xsl:text>
+ </xsl:when>
+ <!-- Excel2003sp1 issue: currency is saved as 'float' -->
+ <xsl:when test="$numberStyle/number:currency-symbol">
+ <xsl:choose>
+ <xsl:when test="contains($numberStyle/number:currency-symbol, '€')">
+ <xsl:text>Euro Currency</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Currency</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- Excel2003sp1 issue: 'Currency' is saved as 'float' -->
+ <xsl:when test="contains($numberStyle/number:text, '$')">
+ <xsl:text>Currency</xsl:text>
+ </xsl:when>
+ <!-- OASIS XML adapation -->
+ <xsl:otherwise>
+ <xsl:text>General</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$numberStyle/number:grouping">
+ <xsl:text>Standard</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Fixed</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="name($numberStyle) = 'number:time-style'">
+ <xsl:choose>
+ <xsl:when test="$numberStyle/number:am-pm">
+ <xsl:choose>
+ <xsl:when test="$numberStyle/number:seconds">
+ <xsl:text>Long Time</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Medium Time</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Short Time</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="name($numberStyle) = 'number:percentage-style'">
+ <xsl:text>Percent</xsl:text>
+ </xsl:when>
+ <xsl:when test="name($numberStyle) = 'number:currency-style'">
+ <xsl:choose>
+ <xsl:when test="contains($numberStyle/number:currency-symbol, '€')">
+ <xsl:text>Euro Currency</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Currency</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$numberStyle/number:month">
+ <xsl:choose>
+ <xsl:when test="$numberStyle/number:month/@number:textual and
+ $numberStyle/number:month/@number:textual=true()">
+ <xsl:text>Medium Date</xsl:text>
+ <!-- Excel2003 sp1 issue: No difference between 'Long Date' and 'Medium Date' -->
+ </xsl:when>
+ <xsl:when test="$numberStyle/number:hours">
+ <xsl:text>General Date</xsl:text>
+ </xsl:when>
+ <xsl:when test="$numberStyle/number:year/@number:style and
+ $numberStyle/number:year/@number:style='long'">
+ <xsl:text>Short Date</xsl:text>
+ </xsl:when>
+ <!-- OASIS XML adapation -->
+ <xsl:otherwise>
+ <xsl:text>Short Date</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- OASIS XML adapation -->
+ <xsl:otherwise>
+ <xsl:text>General</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="Alignment">
+ <xsl:param name="styleProperties" />
+
+ <!-- An empty Alignment element, might overwrite parents setting by
+ the default attributes -->
+ <xsl:if test="$styleProperties/@fo:text-align or
+ $styleProperties/@style:vertical-align or
+ $styleProperties/@fo:wrap-option or
+ $styleProperties/@fo:margin-left or
+ $styleProperties/@style:rotation-angle or
+ $styleProperties/@style:direction">
+ <xsl:element name="Alignment">
+ <xsl:if test="$styleProperties/@fo:text-align">
+ <xsl:attribute name="ss:Horizontal">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@fo:text-align = 'center'">Center</xsl:when>
+ <xsl:when test="$styleProperties/@fo:text-align = 'end'">Right</xsl:when>
+ <xsl:when test="$styleProperties/@fo:text-align = 'justify'">Justify</xsl:when>
+ <xsl:otherwise>Left</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:vertical-align">
+ <xsl:attribute name="ss:Vertical">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:vertical-align = 'top'">Top</xsl:when>
+ <xsl:when test="$styleProperties/@style:vertical-align = 'bottom'">Bottom</xsl:when>
+ <xsl:when test="$styleProperties/@style:vertical-align = 'middle'">Center</xsl:when>
+ <xsl:otherwise>Automatic</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@fo:wrap-option = 'wrap'">
+ <xsl:attribute name="ss:WrapText">1</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@fo:margin-left">
+ <xsl:attribute name="ss:Indent">
+ <xsl:variable name="margin">
+ <xsl:call-template name="convert2pt">
+ <xsl:with-param name="value" select="$styleProperties/@fo:margin-left" />
+ <xsl:with-param name="rounding-factor" select="1" />
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- one ss:Indent is equal to 10 points -->
+ <xsl:value-of select="number($margin) div 10"/>
+ </xsl:attribute>
+ </xsl:if>
+ <!-- Excel is only able to rotate between 90 and -90 degree (inclusive).
+ Other degrees will be mapped by 180 degrees -->
+ <xsl:if test="$styleProperties/@style:rotation-angle">
+ <xsl:attribute name="ss:Rotate">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:rotation-angle &gt; 90">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:rotation-angle &gt;= 270">
+ <xsl:value-of select="$styleProperties/@style:rotation-angle - 360" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$styleProperties/@style:rotation-angle - 180" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$styleProperties/@style:rotation-angle &lt; -90">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:rotation-angle &lt;= -270">
+ <xsl:value-of select="$styleProperties/@style:rotation-angle + 360" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$styleProperties/@style:rotation-angle + 180" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$styleProperties/@style:rotation-angle" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:direction = 'ttb'">
+ <xsl:attribute name="ss:VerticalText">1</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+
+ <xsl:template name="Border">
+ <xsl:param name="styleProperties" />
+
+ <!-- An empty border element, might overwrite parents setting by
+ the default attributes -->
+ <xsl:if test="$styleProperties/@fo:border or
+ $styleProperties/@fo:border-bottom or
+ $styleProperties/@fo:border-left or
+ $styleProperties/@fo:border-right or
+ $styleProperties/@fo:border-top">
+ <xsl:element name="Borders">
+ <xsl:if test="$styleProperties/@fo:border-bottom and not($styleProperties/@fo:border-bottom = 'none')">
+ <xsl:element name="Border">
+ <xsl:attribute name="ss:Position">Bottom</xsl:attribute>
+ <xsl:call-template name="border-attributes">
+ <xsl:with-param name="border_properties" select="$styleProperties/@fo:border-bottom" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@fo:border-left and not($styleProperties/@fo:border-left = 'none')">
+ <xsl:element name="Border">
+ <xsl:attribute name="ss:Position">Left</xsl:attribute>
+ <xsl:call-template name="border-attributes">
+ <xsl:with-param name="border_properties" select="$styleProperties/@fo:border-left" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@fo:border-right and not($styleProperties/@fo:border-right = 'none')">
+ <xsl:element name="Border">
+ <xsl:attribute name="ss:Position">Right</xsl:attribute>
+ <xsl:call-template name="border-attributes">
+ <xsl:with-param name="border_properties" select="$styleProperties/@fo:border-right" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@fo:border-top and not($styleProperties/@fo:border-top = 'none')">
+ <xsl:element name="Border">
+ <xsl:attribute name="ss:Position">Top</xsl:attribute>
+ <xsl:call-template name="border-attributes">
+ <xsl:with-param name="border_properties" select="$styleProperties/@fo:border-top" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ <!-- write out all table border -->
+ <xsl:if test="$styleProperties/@fo:border and not($styleProperties/@fo:border = 'none')">
+ <xsl:element name="Border">
+ <xsl:attribute name="ss:Position">Bottom</xsl:attribute>
+ <xsl:call-template name="border-attributes">
+ <xsl:with-param name="border_properties" select="$styleProperties/@fo:border" />
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:element name="Border">
+ <xsl:attribute name="ss:Position">Left</xsl:attribute>
+ <xsl:call-template name="border-attributes">
+ <xsl:with-param name="border_properties" select="$styleProperties/@fo:border" />
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:element name="Border">
+ <xsl:attribute name="ss:Position">Right</xsl:attribute>
+ <xsl:call-template name="border-attributes">
+ <xsl:with-param name="border_properties" select="$styleProperties/@fo:border" />
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:element name="Border">
+ <xsl:attribute name="ss:Position">Top</xsl:attribute>
+ <xsl:call-template name="border-attributes">
+ <xsl:with-param name="border_properties" select="$styleProperties/@fo:border" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+
+ <xsl:template name="border-attributes">
+ <xsl:param name="border_properties" />
+
+ <xsl:variable name="border-width">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="substring-before($border_properties, ' ')" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="border-style" select="substring-before(substring-after($border_properties, ' '), ' ')" />
+ <xsl:variable name="border-color" select="substring-after(substring-after($border_properties, ' '), ' ')" />
<!--
- <xsl:message>border-width:<xsl:value-of select="$border-width" /></xsl:message>
- <xsl:message>border-style:<xsl:value-of select="$border-style" /></xsl:message>
- <xsl:message>border-color:<xsl:value-of select="$border-color" /></xsl:message>
+ <xsl:message>border-width:<xsl:value-of select="$border-width" /></xsl:message>
+ <xsl:message>border-style:<xsl:value-of select="$border-style" /></xsl:message>
+ <xsl:message>border-color:<xsl:value-of select="$border-color" /></xsl:message>
-->
- <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
- <xsl:attribute name="ss:LineStyle">
- <xsl:choose>
- <xsl:when test="$border-style = 'none'">None</xsl:when>
- <xsl:when test="$border-style = 'double'">Double</xsl:when>
- <xsl:otherwise>Continuous</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
-
- <xsl:attribute name="ss:Weight">
- <xsl:choose>
- <!-- 0: Hairline -->
- <xsl:when test="$border-width &lt;= 0.002">0</xsl:when>
- <!-- 1: Thin -->
- <xsl:when test="$border-width &lt;= 0.035">1</xsl:when>
- <!-- 2: Medium -->
- <xsl:when test="$border-width &lt;= 0.088">2</xsl:when>
- <!-- 3: Thick -->
- <xsl:otherwise>3</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
-
- <xsl:attribute name="ss:Color">
- <xsl:choose>
- <xsl:when test="$border-color"><xsl:value-of select="$border-color" /></xsl:when>
- <xsl:otherwise>Automatic</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:template>
-
-
- <xsl:template name="Font">
- <xsl:param name="styleProperties" />
- <xsl:param name="styleParentName" />
-
- <!-- An empty font element, might overwrite parents setting by
- the default attributes -->
- <xsl:if test="$styleProperties/@style:font-weight or
- $styleProperties/@fo:color or
- $styleProperties/@style:font-name or
- $styleProperties/@fo:font-style or
- $styleProperties/@style:text-outline or
- $styleProperties/@style:text-shadow or
- $styleProperties/@style:font-size or
- $styleProperties/@style:text-line-through-style or
- $styleProperties/@style:text-underline-type or
- $styleProperties/@style:text-underline-style or
- $styleProperties/@style:text-position">
-
-
- <xsl:element name="Font">
- <xsl:call-template name="getParentBold">
- <xsl:with-param name="styleProperties" select="$styleProperties" />
- <xsl:with-param name="styleParentName" select="$styleParentName" />
- </xsl:call-template>
- <xsl:if test="$styleProperties/@fo:color">
- <xsl:attribute name="ss:Color"><xsl:value-of select="$styleProperties/@fo:color" /></xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:font-name">
- <xsl:attribute name="ss:FontName"><xsl:value-of select="$styleProperties/@style:font-name" /></xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@fo:font-style = 'italic'">
- <xsl:attribute name="ss:Italic">1</xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:text-outline = 'true'">
- <xsl:attribute name="ss:Outline">1</xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:text-shadow = 'shadow'">
- <xsl:attribute name="ss:Shadow">1</xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@fo:font-size">
- <xsl:attribute name="ss:Size">
- <xsl:call-template name="convert2pt">
- <xsl:with-param name="value" select="$styleProperties/@fo:font-size" />
- </xsl:call-template>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:text-line-through-style and $styleProperties/@style:text-line-through-style != 'none'">
- <xsl:attribute name="ss:StrikeThrough">1</xsl:attribute>
- </xsl:if>
- <xsl:if test="($styleProperties/@style:text-underline-type and $styleProperties/@style:text-underline-type != 'none') or
- ($styleProperties/@style:text-underline-style and $styleProperties/@style:text-underline-style != 'none')">
- <xsl:attribute name="ss:Underline">
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:text-underline-type = 'double'">Double</xsl:when>
- <xsl:otherwise>Single</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:text-position">
- <xsl:attribute name="ss:VerticalAlign">
- <xsl:choose>
- <xsl:when test="substring-before($styleProperties/@style:text-position, '% ') &gt; 0">Superscript</xsl:when>
- <xsl:otherwise>Subscript</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="Interior">
- <xsl:param name="styleProperties" />
- <xsl:if test="$styleProperties/@fo:background-color and not($styleProperties/@fo:background-color = 'transparent')">
- <xsl:element name="Interior">
- <xsl:attribute name="ss:Color">
- <xsl:value-of select="$styleProperties/@fo:background-color" />
- </xsl:attribute>
- <!-- Background color (i.e. Interior/ss:Color) not shown without ss:Pattern (or with 'none')
- Therefore a default is set -->
- <xsl:attribute name="ss:Pattern">Solid</xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <!-- Excel issue workaround: <Font ss:Bold="1"> is not inherited -->
- <xsl:template name="getParentBold">
- <xsl:param name="styleProperties" />
- <xsl:param name="styleParentName" />
- <xsl:param name="styleName" />
-
- <xsl:if test="$styleParentName and $styleParentName != $styleName">
- <xsl:choose>
- <xsl:when test="$styleProperties/@fo:font-weight = 'bold'">
- <xsl:attribute name="ss:Bold">1</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="getParentBold">
- <xsl:with-param name="styleProperties" select="key('styles', $styleParentName)/*" />
- <xsl:with-param name="styleParentName" select="key('styles', $styleParentName)/@style:parent-style-name" />
- <xsl:with-param name="styleName" select="$styleParentName" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
+ <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
+ <xsl:attribute name="ss:LineStyle">
+ <xsl:choose>
+ <xsl:when test="$border-style = 'none'">None</xsl:when>
+ <xsl:when test="$border-style = 'double'">Double</xsl:when>
+ <xsl:otherwise>Continuous</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <xsl:attribute name="ss:Weight">
+ <xsl:choose>
+ <!-- 0: Hairline -->
+ <xsl:when test="$border-width &lt;= 0.002">0</xsl:when>
+ <!-- 1: Thin -->
+ <xsl:when test="$border-width &lt;= 0.035">1</xsl:when>
+ <!-- 2: Medium -->
+ <xsl:when test="$border-width &lt;= 0.088">2</xsl:when>
+ <!-- 3: Thick -->
+ <xsl:otherwise>3</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <xsl:attribute name="ss:Color">
+ <xsl:choose>
+ <xsl:when test="$border-color"><xsl:value-of select="$border-color" /></xsl:when>
+ <xsl:otherwise>Automatic</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:template>
+
+
+ <xsl:template name="Font">
+ <xsl:param name="styleProperties" />
+ <xsl:param name="styleParentName" />
+
+ <!-- An empty font element, might overwrite parents setting by
+ the default attributes -->
+ <xsl:if test="$styleProperties/@style:font-weight or
+ $styleProperties/@fo:color or
+ $styleProperties/@style:font-name or
+ $styleProperties/@fo:font-style or
+ $styleProperties/@style:text-outline or
+ $styleProperties/@style:text-shadow or
+ $styleProperties/@style:font-size or
+ $styleProperties/@style:text-line-through-style or
+ $styleProperties/@style:text-underline-type or
+ $styleProperties/@style:text-underline-style or
+ $styleProperties/@style:text-position">
+
+
+ <xsl:element name="Font">
+ <xsl:call-template name="getParentBold">
+ <xsl:with-param name="styleProperties" select="$styleProperties" />
+ <xsl:with-param name="styleParentName" select="$styleParentName" />
+ </xsl:call-template>
+ <xsl:if test="$styleProperties/@fo:color">
+ <xsl:attribute name="ss:Color"><xsl:value-of select="$styleProperties/@fo:color" /></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:font-name">
+ <xsl:attribute name="ss:FontName"><xsl:value-of select="$styleProperties/@style:font-name" /></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@fo:font-style = 'italic'">
+ <xsl:attribute name="ss:Italic">1</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:text-outline = 'true'">
+ <xsl:attribute name="ss:Outline">1</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:text-shadow = 'shadow'">
+ <xsl:attribute name="ss:Shadow">1</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@fo:font-size">
+ <xsl:attribute name="ss:Size">
+ <xsl:call-template name="convert2pt">
+ <xsl:with-param name="value" select="$styleProperties/@fo:font-size" />
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:text-line-through-style and $styleProperties/@style:text-line-through-style != 'none'">
+ <xsl:attribute name="ss:StrikeThrough">1</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="($styleProperties/@style:text-underline-type and $styleProperties/@style:text-underline-type != 'none') or
+ ($styleProperties/@style:text-underline-style and $styleProperties/@style:text-underline-style != 'none')">
+ <xsl:attribute name="ss:Underline">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:text-underline-type = 'double'">Double</xsl:when>
+ <xsl:otherwise>Single</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:text-position">
+ <xsl:attribute name="ss:VerticalAlign">
+ <xsl:choose>
+ <xsl:when test="substring-before($styleProperties/@style:text-position, '% ') &gt; 0">Superscript</xsl:when>
+ <xsl:otherwise>Subscript</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="Interior">
+ <xsl:param name="styleProperties" />
+ <xsl:if test="$styleProperties/@fo:background-color and not($styleProperties/@fo:background-color = 'transparent')">
+ <xsl:element name="Interior">
+ <xsl:attribute name="ss:Color">
+ <xsl:value-of select="$styleProperties/@fo:background-color" />
+ </xsl:attribute>
+ <!-- Background color (i.e. Interior/ss:Color) not shown without ss:Pattern (or with 'none')
+ Therefore a default is set -->
+ <xsl:attribute name="ss:Pattern">Solid</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- Excel issue workaround: <Font ss:Bold="1"> is not inherited -->
+ <xsl:template name="getParentBold">
+ <xsl:param name="styleProperties" />
+ <xsl:param name="styleParentName" />
+ <xsl:param name="styleName" />
+
+ <xsl:if test="$styleParentName and $styleParentName != $styleName">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@fo:font-weight = 'bold'">
+ <xsl:attribute name="ss:Bold">1</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="getParentBold">
+ <xsl:with-param name="styleProperties" select="key('styles', $styleParentName)/*" />
+ <xsl:with-param name="styleParentName" select="key('styles', $styleParentName)/@style:parent-style-name" />
+ <xsl:with-param name="styleName" select="$styleParentName" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/export/spreadsheetml/table.xsl b/filter/source/xslt/export/spreadsheetml/table.xsl
index 5876b8f6fd26..906505c694ff 100644
--- a/filter/source/xslt/export/spreadsheetml/table.xsl
+++ b/filter/source/xslt/export/spreadsheetml/table.xsl
@@ -17,912 +17,912 @@
* 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:xt="http://www.jclark.com/xt"
- xmlns:common="http://exslt.org/common"
- xmlns:xalan="http://xml.apache.org/xalan"
- 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 xt common xalan">
-
-
- <!-- ************** -->
- <!-- *** Table *** -->
- <!-- ************** -->
-
- <!-- check existence of default cell style -->
- <xsl:variable name="firstDefaultCellStyle" select="descendant::table:table-column/@table:default-cell-style-name" />
-
-
- <xsl:template match="table:table" name="table:table">
- <xsl:element name="Table">
- <xsl:apply-templates select="@table:style-name" />
-
- <!-- find all columns in the table -->
- <xsl:variable name="columnNodes" select="descendant::table:table-column" />
- <!-- calculate the overall column amount -->
- <xsl:variable name="maxColumnNo">
- <xsl:choose>
- <xsl:when test="$columnNodes/@table:number-columns-repeated">
- <xsl:value-of select="count($columnNodes)
- + number(sum($columnNodes/@table:number-columns-repeated))
- - count($columnNodes/@table:number-columns-repeated)" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="count($columnNodes)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- create columns -->
- <xsl:apply-templates select="$columnNodes[1]">
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- <xsl:with-param name="maxColumnNo" select="$maxColumnNo" />
- </xsl:apply-templates>
-
- <!-- create rows -->
- <xsl:choose>
- <xsl:when test="not($columnNodes/@table:number-columns-repeated)">
- <xsl:call-template name="optimized-row-handling">
- <xsl:with-param name="rowNodes" select="descendant::table:table-row" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- To be able to match from a cell to the corresponding column to match @table:default-cell-style-name,
- the repeated columns are being resolved by copying them in a helper variable -->
- <xsl:variable name="columnNodes-RTF">
- <xsl:for-each select="$columnNodes">
- <xsl:call-template name="adding-column-styles-entries" />
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="optimized-row-handling">
- <xsl:with-param name="rowNodes" select="descendant::table:table-row" />
- <xsl:with-param name="columnNodes" select="xalan:nodeset($columnNodes-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="optimized-row-handling">
- <xsl:with-param name="rowNodes" select="descendant::table:table-row" />
- <xsl:with-param name="columnNodes" select="common:node-set($columnNodes-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="optimized-row-handling">
- <xsl:with-param name="rowNodes" select="descendant::table:table-row" />
- <xsl:with-param name="columnNodes" select="xt:node-set($columnNodes-RTF)" />
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:template>
-
-
- <!-- **************** -->
- <!-- *** Columns *** -->
- <!-- **************** -->
-
- <xsl:template match="table:table-column">
- <xsl:param name="columnNodes" />
- <xsl:param name="currentColumnNumber" select="1" />
- <xsl:param name="setIndex" select="false()" />
- <xsl:param name="maxColumnNo" />
-
- <xsl:element name="Column">
- <xsl:if test="@table:visibility = 'collapse' or @table:visibility = 'filter'">
- <xsl:attribute name="ss:Hidden">1</xsl:attribute>
- </xsl:if>
-
- <xsl:if test="@table:number-columns-repeated">
- <xsl:attribute name="ss:Span">
- <xsl:value-of select="@table:number-columns-repeated - 1" />
- </xsl:attribute>
- </xsl:if>
-
- <xsl:if test="$setIndex">
- <xsl:attribute name="ss:Index">
- <xsl:value-of select="$currentColumnNumber" />
- </xsl:attribute>
- </xsl:if>
-
- <xsl:choose>
- <xsl:when test="@style:use-optimal-column-width = 'true'">
- <xsl:attribute name="ss:AutoFitWidth">1</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="width" select="key('styles', @table:style-name)/style:table-column-properties/@style:column-width" />
- <xsl:if test="$width">
- <xsl:attribute name="ss:Width">
- <!-- using the absolute width in point -->
- <xsl:call-template name="convert2pt">
- <xsl:with-param name="value" select="$width" />
- </xsl:call-template>
- </xsl:attribute>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:if test="@table:number-columns-repeated">
- <xsl:attribute name="ss:Span">
- <xsl:value-of select="@table:number-columns-repeated - 1" />
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
-
- <xsl:variable name="columnNumber">
- <xsl:choose>
- <xsl:when test="@table:number-columns-repeated">
- <xsl:value-of select="$currentColumnNumber + @table:number-columns-repeated"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$currentColumnNumber"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$columnNumber &lt; $maxColumnNo">
- <xsl:variable name="nextColumnNodes" select="$columnNodes[position() != 1]" />
- <xsl:choose>
- <xsl:when test="@table:number-columns-repeated">
- <xsl:apply-templates select="$nextColumnNodes[1]">
- <xsl:with-param name="columnNodes" select="$nextColumnNodes" />
- <xsl:with-param name="currentColumnNumber" select="$columnNumber" />
- <xsl:with-param name="maxColumnNo" select="$maxColumnNo" />
- <xsl:with-param name="setIndex" select="true()" />
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$nextColumnNodes[1]">
- <xsl:with-param name="columnNodes" select="$nextColumnNodes" />
- <xsl:with-param name="currentColumnNumber" select="$columnNumber + 1" />
- <xsl:with-param name="maxColumnNo" select="$maxColumnNo" />
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-
- <!-- current node is a table:table-column -->
- <xsl:template name="adding-column-styles-entries">
- <xsl:choose>
- <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>
- <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>
-
-
- <!-- current node is a table:table-column -->
- <!-- duplicates column elements in case of column-repeated attribute -->
- <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>
-
-
- <!-- ************* -->
- <!-- *** Rows *** -->
- <!-- ************* -->
-
-
- <!-- Recursions are much faster when the stack size is small -->
- <xsl:template name="optimized-row-handling">
- <xsl:param name="rowNodes" />
- <xsl:param name="columnNodes" />
- <xsl:param name="offset" select="0"/>
- <xsl:param name="threshold" select="10"/>
-
- <xsl:variable name="rowCount" select="count($rowNodes)"/>
- <xsl:choose>
- <xsl:when test="$rowCount &lt;= $threshold">
- <xsl:apply-templates select="$rowNodes[1]">
- <xsl:with-param name="rowNodes" select="$rowNodes" />
- <xsl:with-param name="offset" select="$offset" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="rowCountHalf" select="floor($rowCount div 2)"/>
- <xsl:variable name="rowNodesSetA" select="$rowNodes[position() &lt;= $rowCountHalf]"/>
- <xsl:variable name="rowNodesSetB" select="$rowNodes[position() &gt; $rowCountHalf]"/>
- <!-- to keep track of the rownumber, the repeteated rows have to kept into accounts -->
- <xsl:variable name="rowsCreatedByRepetition">
- <xsl:choose>
- <xsl:when test="$rowNodesSetA/@table:number-rows-repeated">
- <xsl:value-of select="number(sum($rowNodesSetA/@table:number-rows-repeated))
- - count($rowNodesSetA/@table:number-rows-repeated)" />
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$rowCountHalf &gt; $threshold">
- <xsl:call-template name="optimized-row-handling">
- <xsl:with-param name="rowNodes" select="$rowNodesSetA"/>
- <xsl:with-param name="offset" select="$offset" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- <xsl:call-template name="optimized-row-handling">
- <xsl:with-param name="rowNodes" select="$rowNodesSetB"/>
- <xsl:with-param name="offset" select="$offset + $rowCountHalf + $rowsCreatedByRepetition" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$rowNodesSetA[1]">
- <xsl:with-param name="rowNodes" select="$rowNodesSetA"/>
- <xsl:with-param name="offset" select="$offset" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- <xsl:apply-templates select="$rowNodesSetB[1]">
- <xsl:with-param name="rowNodes" select="$rowNodesSetB" />
- <xsl:with-param name="offset" select="$offset + $rowCountHalf + $rowsCreatedByRepetition" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Rows as "table:table-row" might be grouped in
- "table:table-header-rows" or "table:table-row-group"
- This row-tree will be traversed providing each Row with its
- calculatedRowPosition and earlierRowNumber.
- By this repeated empty rows might be neglected in the spreadsheetml output,
- as the following row will notice the 'gap' and provide @ss:Index,
- which results in filling up the gap by a row without style and content.
-
- In Excel created rows by ss:Index are 'default' rows.
- -->
- <xsl:template match="table:table-row">
- <xsl:param name="earlierRowNumber" select="0" />
- <xsl:param name="offset" />
- <xsl:param name="calculatedRowPosition" select="$offset + 1" />
- <xsl:param name="rowNodes" />
- <xsl:param name="columnNodes" />
-
- <xsl:choose>
- <xsl:when test="@table:number-rows-repeated &gt; 1">
- <xsl:call-template name="write-table-row">
- <xsl:with-param name="earlierRowNumber" select="$earlierRowNumber" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- <xsl:if test="@table:number-rows-repeated &gt; 2 and (table:table-cell/@office:value-type or $firstDefaultCellStyle != '')">
- <!-- In case a cell is being repeated, the cell will be created
- in a variabel, which is as many times given out, as being repeated -->
- <xsl:variable name="tableRow">
- <xsl:call-template name="write-table-row">
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="optimized-row-repeating">
- <xsl:with-param name="tableRow" select="$tableRow" />
- <xsl:with-param name="repetition" select="@table:number-rows-repeated - 1" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="write-table-row">
- <xsl:with-param name="earlierRowNumber" select="$earlierRowNumber" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:variable name="nextRowNodes" select="$rowNodes[position()!=1]" />
- <xsl:choose>
- <xsl:when test="@table:number-rows-repeated &gt; 1">
- <xsl:apply-templates select="$nextRowNodes[1]">
- <xsl:with-param name="earlierRowNumber" select="$calculatedRowPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition + @table:number-rows-repeated" />
- <xsl:with-param name="rowNodes" select="$nextRowNodes" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$nextRowNodes[1]">
- <xsl:with-param name="earlierRowNumber" select="$calculatedRowPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition + 1" />
- <xsl:with-param name="rowNodes" select="$nextRowNodes" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="write-table-row">
- <xsl:param name="earlierRowNumber" select="0" />
- <xsl:param name="calculatedRowPosition" select="1" />
- <xsl:param name="columnNodes" />
-
- <xsl:element name="Row">
- <xsl:if test="@table:visibility = 'collapse' or @table:visibility = 'filter'">
- <xsl:attribute name="ss:Hidden">1</xsl:attribute>
- </xsl:if>
- <xsl:if test="not($earlierRowNumber + 1 = $calculatedRowPosition)">
- <xsl:attribute name="ss:Index"><xsl:value-of select="$calculatedRowPosition" /></xsl:attribute>
- </xsl:if>
-
- <!-- writing the style of the row -->
- <xsl:apply-templates select="@table:style-name" mode="table-row" />
-
- <xsl:variable name="rowProperties" select="key('styles', @table:style-name)/*" />
- <xsl:if test="$rowProperties/@style:use-optimal-row-height = 'false'">
- <!-- default is '1', therefore write only '0' -->
- <xsl:attribute name="ss:AutoFitHeight">0</xsl:attribute>
- </xsl:if>
-
- <xsl:variable name="height" select="$rowProperties/@style:row-height" />
- <xsl:if test="$height">
- <xsl:attribute name="ss:Height">
- <!-- using the absolute height in point -->
- <xsl:call-template name="convert2pt">
- <xsl:with-param name="value" select="$height" />
- </xsl:call-template>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="table:table-cell[1]">
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="cellNodes" select="table:table-cell" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
-
-
- <!-- Recursions are much faster when the stack size is small -->
- <xsl:template name="optimized-row-repeating">
- <xsl:param name="tableRow" />
- <xsl:param name="repetition" />
- <!-- resource optimation: instead of '1' it will be '1000' and the column is not full -->
- <xsl:param name="thresholdmax" select="512"/>
- <xsl:param name="thresholdmin" select="256"/>
-
- <xsl:choose>
- <xsl:when test="$repetition &lt;= $thresholdmax">
- <xsl:copy-of select="$tableRow" />
- <xsl:if test="$repetition &lt;= $thresholdmin">
- <xsl:call-template name="optimized-row-repeating">
- <xsl:with-param name="repetition" select="$repetition - 1"/>
- <xsl:with-param name="tableRow" select="$tableRow" />
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$repetition mod 2 = 1">
- <xsl:copy-of select="$tableRow" />
- </xsl:if>
- <xsl:variable name="repetitionHalf" select="floor($repetition div 2)"/>
- <xsl:call-template name="optimized-row-repeating">
- <xsl:with-param name="repetition" select="$repetitionHalf"/>
- <xsl:with-param name="tableRow" select="$tableRow" />
- </xsl:call-template>
- <xsl:call-template name="optimized-row-repeating">
- <xsl:with-param name="repetition" select="$repetitionHalf"/>
- <xsl:with-param name="tableRow" select="$tableRow" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-
- <!-- ************** -->
- <!-- *** Cells *** -->
- <!-- ************** -->
-
- <!-- Table cells are able to be repeated by attribute in StarOffice,
- but not in Excel. If more cells are repeated -->
- <xsl:template name="table:table-cell" match="table:table-cell">
- <xsl:param name="calculatedCellPosition" select="1" /><!-- the later table position of the current cell -->
- <xsl:param name="calculatedRowPosition" /><!-- the later table position of the current row -->
- <xsl:param name="setIndex" select="false()" /> <!-- if not '0' @ss:Index used for neglecting repeteated empty cells -->
- <xsl:param name="repetition" select="@table:number-columns-repeated" /> <!-- used for explicit written out cells -->
- <xsl:param name="repetitionCellPosition" select="$calculatedCellPosition" /><!-- during repetition formula needs exact cell positioning -->
- <xsl:param name="nextMatchedCellPosition"><!-- the later table position of the next cell -->
- <xsl:choose>
- <xsl:when test="not(@table:number-columns-repeated) and not(@table:number-columns-spanned)">
- <xsl:value-of select="$calculatedCellPosition + 1" />
- </xsl:when>
- <xsl:when test="not(@table:number-columns-spanned)">
- <xsl:value-of select="$calculatedCellPosition + @table:number-columns-repeated" />
- </xsl:when>
- <xsl:when test="not(@table:number-columns-repeated)">
- <xsl:value-of select="$calculatedCellPosition + @table:number-columns-spanned" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$calculatedCellPosition + @table:number-columns-spanned * @table:number-columns-repeated" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:param>
- <xsl:param name="cellNodes" /><!-- cells to be handled -->
- <xsl:param name="columnNodes" />
-
- <xsl:choose>
- <!-- in case a repetition took place -->
- <xsl:when test="$repetition &gt; 0">
- <xsl:choose>
- <!-- In case of no cell content (text, subelements, attribute, except repeated style) the ss:Index could be used -->
- <xsl:when test="not(text()) and not(*) and not(@*[name() != 'table:number-columns-repeated'])">
- <xsl:choose>
- <xsl:when test="count($cellNodes) = 1">
- <xsl:call-template name="create-table-cell">
- <xsl:with-param name="setIndex" select="true()" />
- <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition - 1" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$cellNodes[2]">
- <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="setIndex" select="true()" />
- <xsl:with-param name="cellNodes" select="$cellNodes[position() != 1]" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- Fastest cell repetition by creating cell once and copying, works not for
- a) cells with formula (need of actual cell position)
- b) cells, which start with ss:Index (as ss:Index is not allowed to be repeated) -->
- <xsl:when test="not(@table:formula) and not($setIndex)">
- <!-- In case a non-empty cell is being repeated, the cell will be created
- in a variabel, which is as many times given out, as being repeated -->
- <xsl:variable name="tableCell">
- <xsl:call-template name="create-table-cell">
- <xsl:with-param name="setIndex" select="false()" /><!-- copied cells may not have indices -->
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="repeat-copy-table-cell">
- <xsl:with-param name="tableCell" select="$tableCell" />
- <xsl:with-param name="repetition" select="$repetition" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- <xsl:apply-templates select="$cellNodes[2]">
- <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="cellNodes" select="$cellNodes[position() != 1]" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- </xsl:when>
- <!-- explicit writing (instead of copying) of cell for the cases mentioned above -->
- <xsl:otherwise>
- <xsl:call-template name="create-table-cell">
- <xsl:with-param name="setIndex" select="$setIndex" /><!-- a possible Index will be created -->
- <xsl:with-param name="calculatedCellPosition" select="$repetitionCellPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- <xsl:choose>
- <!-- as long there is a repetition (higher '1') stay on the same cell node -->
- <xsl:when test="$repetition &gt; 1">
- <xsl:call-template name="table:table-cell">
- <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="repetitionCellPosition">
- <xsl:choose>
- <xsl:when test="@table:number-columns-spanned">
- <xsl:value-of select="$repetitionCellPosition + @table:number-columns-spanned" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$repetitionCellPosition + 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="nextMatchedCellPosition" select="$nextMatchedCellPosition" />
- <xsl:with-param name="repetition" select="$repetition - 1" />
- <xsl:with-param name="cellNodes" select="$cellNodes" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$cellNodes[2]">
- <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="cellNodes" select="$cellNodes[position() != 1]" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- in case no repetition took place -->
- <xsl:choose>
- <!-- neglect en empty cells by using ss:Index Attribut -->
- <xsl:when test="not(text()) and not(*) and not(@*)">
- <xsl:choose>
- <!-- if it is the last cell, write this cell -->
- <xsl:when test="count($cellNodes) = 1">
- <xsl:call-template name="create-table-cell">
- <xsl:with-param name="setIndex" select="true()" />
- <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition - 1" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$cellNodes[2]">
- <xsl:with-param name="setIndex" select="true()" />
- <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="cellNodes" select="$cellNodes[position() != 1]" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- create cell and use/unset the ss:Index -->
- <xsl:call-template name="create-table-cell">
- <xsl:with-param name="setIndex" select="$setIndex" />
- <xsl:with-param name="calculatedCellPosition" select="$calculatedCellPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:call-template>
- <xsl:apply-templates select="$cellNodes[2]">
- <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- <xsl:with-param name="cellNodes" select="$cellNodes[position() != 1]" />
- <xsl:with-param name="columnNodes" select="$columnNodes" />
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- Copies the variable 'tableCell' to the output as often as 'repetition' -->
- <xsl:template name="repeat-copy-table-cell">
- <xsl:param name="tableCell" />
- <xsl:param name="repetition" />
-
- <xsl:if test="$repetition &gt; 0">
- <xsl:copy-of select="$tableCell"/>
- <xsl:call-template name="repeat-copy-table-cell">
- <xsl:with-param name="tableCell" select="$tableCell" />
- <xsl:with-param name="repetition" select="$repetition - 1" />
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="create-table-cell">
- <xsl:param name="setIndex" select="false()" />
- <xsl:param name="calculatedCellPosition" />
- <xsl:param name="calculatedRowPosition" />
- <xsl:param name="columnNodes" />
-
- <xsl:element name="Cell" namespace="urn:schemas-microsoft-com:office:spreadsheet">
- <xsl:if test="$setIndex">
- <xsl:attribute name="ss:Index">
- <xsl:value-of select="$calculatedCellPosition"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="@table:number-columns-spanned &gt; 1">
- <xsl:attribute name="ss:MergeAcross">
- <xsl:value-of select="@table:number-columns-spanned - 1" />
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="@table:number-rows-spanned &gt; 1">
- <xsl:attribute name="ss:MergeDown">
- <xsl:value-of select="@table:number-rows-spanned - 1" />
- </xsl:attribute>
- </xsl:if>
- <xsl:variable name="link" select="descendant::text:a/@xlink:href" />
- <xsl:if test="$link">
- <xsl:attribute name="ss:HRef">
- <xsl:value-of select="$link" />
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="@table:style-name">
- <xsl:apply-templates select="@table:style-name" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$firstDefaultCellStyle != ''">
- <xsl:variable name="defaultCellStyle" select="$columnNodes/table:table-column[position() = $calculatedCellPosition]/@table:default-cell-style-name" />
- <xsl:if test="$defaultCellStyle">
- <xsl:if test="not($defaultCellStyle = 'Default')">
- <xsl:attribute name="ss:StyleID"><xsl:value-of select="$defaultCellStyle"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="@table:formula">
- <xsl:with-param name="calculatedCellPosition" select="$calculatedCellPosition" />
- <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
- </xsl:apply-templates>
- <xsl:choose>
- <xsl:when test="*">
- <!-- in case it is not an empty cell
-
- As the sequence of comment and data is opposite in Excel and Calc no match work here, in both comments exist only once
- Possible Table Content of interest: text:h|text:p|text:list -->
- <xsl:if test="text:h | text:p | text:list">
- <xsl:variable name="valueType">
- <xsl:choose>
- <xsl:when test="@office:value-type">
- <xsl:value-of select="@office:value-type" />
- </xsl:when>
- <xsl:otherwise>string</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="ss:Data">
- <xsl:with-param name="valueType" select="$valueType" />
- <xsl:with-param name="cellStyleName" select="@table:style-name" />
- </xsl:call-template>
- </xsl:if>
-
- <xsl:if test="office:annotation">
- <xsl:element name="Comment">
- <xsl:if test="office:annotation/@office:author">
- <xsl:attribute name="ss:Author"><xsl:value-of select="office:annotation/@office:author" /></xsl:attribute>
- </xsl:if>
- <xsl:if test="office:annotation/@office:display = 'true'">
- <xsl:attribute name="ss:ShowAlways">1</xsl:attribute>
- </xsl:if>
- <!-- ss:Data is oblicatory, but not the same as the ss:Cell ss:Data child, as it has no attributes -->
- <ss:Data xmlns="http://www.w3.org/TR/REC-html40">
- <xsl:for-each select="office:annotation/text:p">
- <xsl:choose>
- <xsl:when test="*">
- <!-- paragraph style have to be neglected due to Excel error,
- which does not allow shadowing their HTML attributes -->
- <xsl:for-each select="*">
- <xsl:call-template name="style-and-contents" />
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="@text:style-name">
- <xsl:call-template name="style-and-contents" />
- </xsl:when>
- <xsl:otherwise>
- <!-- if no style is set, BOLD is set as default -->
- <B>
- <xsl:call-template name="style-and-contents" />
- </B>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </ss:Data>
- </xsl:element>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:template>
-
- <!-- comments are handled separately in the cell -->
- <xsl:template match="office:annotation" />
- <xsl:template match="dc:date" />
-
- <xsl:template name="ss:Data">
- <!-- the default value is 'String' in the office -->
- <xsl:param name="valueType" select="'string'" />
- <xsl:param name="cellStyleName" />
-
- <xsl:choose>
- <xsl:when test="descendant::*/@text:style-name">
- <xsl:choose>
- <xsl:when test="$valueType = 'string'">
- <ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:apply-templates>
- </ss:Data>
- </xsl:when>
- <xsl:when test="$valueType = 'boolean'">
- <ss:Data ss:Type="Boolean" xmlns="http://www.w3.org/TR/REC-html40">
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:apply-templates>
- </ss:Data>
- </xsl:when>
- <xsl:when test="$valueType = 'date'">
- <ss:Data ss:Type="DateTime" xmlns="http://www.w3.org/TR/REC-html40">
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:apply-templates>
- </ss:Data>
- </xsl:when>
- <!-- float, time, percentage, currency (no 'Error' setting) -->
- <xsl:otherwise>
- <ss:Data ss:Type="Number" xmlns="http://www.w3.org/TR/REC-html40">
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:apply-templates>
- </ss:Data>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="Data">
- <xsl:call-template name="ss:Type">
- <xsl:with-param name="valueType" select="$valueType" />
- </xsl:call-template>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="ss:Type">
- <xsl:param name="valueType" select="'string'" />
-
- <xsl:choose>
- <xsl:when test="$valueType = 'string'">
- <xsl:attribute name="ss:Type">String</xsl:attribute>
- <xsl:apply-templates select="*"/>
- </xsl:when>
- <xsl:when test="$valueType = 'boolean'">
- <xsl:attribute name="ss:Type">Boolean</xsl:attribute>
- <xsl:choose>
- <xsl:when test="@office:boolean-value = 'true'">1</xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$valueType = 'date' or $valueType = 'time'">
- <!-- issue in Excel: can not have an empty 'DateTime' cell -->
- <xsl:attribute name="ss:Type">DateTime</xsl:attribute>
- <!-- Gathering information of two StarOffice date/time attributes
- Excel always needs both pieces of information in one attribute -->
- <xsl:choose>
- <xsl:when test="@office:date-value">
- <!-- office:date-value may contain time (after 'T')-->
- <xsl:choose>
- <xsl:when test="contains(@office:date-value, 'T')">
- <!-- in case time is also part of the date -->
- <xsl:value-of select="substring-before(@office:date-value, 'T')" />
- <xsl:text>T</xsl:text>
- <xsl:value-of select="substring-after(@office:date-value,'T')" />
- <xsl:if test="not(contains(@office:date-value,'.'))">
- <xsl:text>.</xsl:text>
- </xsl:if>
- <xsl:text>000</xsl:text>
- </xsl:when>
- <xsl:when test="@office:time-value">
- <!-- conatains date and time (time will be evaluated later -->
- <xsl:value-of select="@office:date-value" />
- <xsl:text>T</xsl:text>
- <xsl:choose>
- <xsl:when test="@table:formula or contains(@office:time-value,',')">
- <!-- customized number types not implemented yet -->
- <xsl:text>00:00:00.000</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate(substring-after(@office:time-value,'PT'),'HMS','::.')" />
- <xsl:if test="not(contains(@office:time-value,'S'))">
- <xsl:text>.</xsl:text>
- </xsl:if>
- <xsl:text>000</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@office:date-value" />
- <xsl:text>T00:00:00.000</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="@office:time-value">
- <xsl:text>1899-12-31T</xsl:text>
- <xsl:choose>
- <xsl:when test="@table:formula or contains(@office:time-value,',')">
- <!-- customized number types not implemented yet -->
- <xsl:text>00:00:00.000</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate(substring-after(@office:time-value,'PT'),'HMS','::.')" />
- <xsl:if test="not(contains(@office:time-value,'S'))">
- <xsl:text>.</xsl:text>
- </xsl:if>
- <xsl:text>000</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- float, percentage, currency (no 'Error' setting) -->
- <xsl:otherwise>
- <xsl:attribute name="ss:Type">Number</xsl:attribute>
- <xsl:value-of select="@office:value" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- ******************** -->
- <!-- *** Common Rules *** -->
- <!-- ******************** -->
-
- <xsl:template match="*">
- <xsl:param name="cellStyleName" />
-
-<!-- LineBreak in Cell -->
- <xsl:if test="preceding-sibling::text:p[1]"><xsl:text>&#10;</xsl:text></xsl:if>
- <xsl:call-template name="style-and-contents">
- <xsl:with-param name="cellStyleName" select="$cellStyleName" />
- </xsl:call-template>
- </xsl:template>
-
- <!-- disabling draw:frames -->
- <xsl:template match="draw:frame" />
-
- <xsl:template match="text:s">
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="@text:c" />
- </xsl:call-template>
- </xsl:template>
-
- <!--write the number of 'whitespaces' -->
- <xsl:template name="write-breakable-whitespace">
- <xsl:param name="whitespaces" />
-
- <xsl:text> </xsl:text>
- <xsl:if test="$whitespaces >= 1">
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="$whitespaces - 1" />
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <!-- allowing all matched text nodes -->
- <xsl:template match="text()"><xsl:value-of select="." /></xsl:template>
+ 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:xt="http://www.jclark.com/xt"
+ xmlns:common="http://exslt.org/common"
+ xmlns:xalan="http://xml.apache.org/xalan"
+ 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 xt common xalan">
+
+
+ <!-- ************** -->
+ <!-- *** Table *** -->
+ <!-- ************** -->
+
+ <!-- check existence of default cell style -->
+ <xsl:variable name="firstDefaultCellStyle" select="descendant::table:table-column/@table:default-cell-style-name" />
+
+
+ <xsl:template match="table:table" name="table:table">
+ <xsl:element name="Table">
+ <xsl:apply-templates select="@table:style-name" />
+
+ <!-- find all columns in the table -->
+ <xsl:variable name="columnNodes" select="descendant::table:table-column" />
+ <!-- calculate the overall column amount -->
+ <xsl:variable name="maxColumnNo">
+ <xsl:choose>
+ <xsl:when test="$columnNodes/@table:number-columns-repeated">
+ <xsl:value-of select="count($columnNodes)
+ + number(sum($columnNodes/@table:number-columns-repeated))
+ - count($columnNodes/@table:number-columns-repeated)" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="count($columnNodes)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- create columns -->
+ <xsl:apply-templates select="$columnNodes[1]">
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ <xsl:with-param name="maxColumnNo" select="$maxColumnNo" />
+ </xsl:apply-templates>
+
+ <!-- create rows -->
+ <xsl:choose>
+ <xsl:when test="not($columnNodes/@table:number-columns-repeated)">
+ <xsl:call-template name="optimized-row-handling">
+ <xsl:with-param name="rowNodes" select="descendant::table:table-row" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- To be able to match from a cell to the corresponding column to match @table:default-cell-style-name,
+ the repeated columns are being resolved by copying them in a helper variable -->
+ <xsl:variable name="columnNodes-RTF">
+ <xsl:for-each select="$columnNodes">
+ <xsl:call-template name="adding-column-styles-entries" />
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="optimized-row-handling">
+ <xsl:with-param name="rowNodes" select="descendant::table:table-row" />
+ <xsl:with-param name="columnNodes" select="xalan:nodeset($columnNodes-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="optimized-row-handling">
+ <xsl:with-param name="rowNodes" select="descendant::table:table-row" />
+ <xsl:with-param name="columnNodes" select="common:node-set($columnNodes-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="optimized-row-handling">
+ <xsl:with-param name="rowNodes" select="descendant::table:table-row" />
+ <xsl:with-param name="columnNodes" select="xt:node-set($columnNodes-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:template>
+
+
+ <!-- **************** -->
+ <!-- *** Columns *** -->
+ <!-- **************** -->
+
+ <xsl:template match="table:table-column">
+ <xsl:param name="columnNodes" />
+ <xsl:param name="currentColumnNumber" select="1" />
+ <xsl:param name="setIndex" select="false()" />
+ <xsl:param name="maxColumnNo" />
+
+ <xsl:element name="Column">
+ <xsl:if test="@table:visibility = 'collapse' or @table:visibility = 'filter'">
+ <xsl:attribute name="ss:Hidden">1</xsl:attribute>
+ </xsl:if>
+
+ <xsl:if test="@table:number-columns-repeated">
+ <xsl:attribute name="ss:Span">
+ <xsl:value-of select="@table:number-columns-repeated - 1" />
+ </xsl:attribute>
+ </xsl:if>
+
+ <xsl:if test="$setIndex">
+ <xsl:attribute name="ss:Index">
+ <xsl:value-of select="$currentColumnNumber" />
+ </xsl:attribute>
+ </xsl:if>
+
+ <xsl:choose>
+ <xsl:when test="@style:use-optimal-column-width = 'true'">
+ <xsl:attribute name="ss:AutoFitWidth">1</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="width" select="key('styles', @table:style-name)/style:table-column-properties/@style:column-width" />
+ <xsl:if test="$width">
+ <xsl:attribute name="ss:Width">
+ <!-- using the absolute width in point -->
+ <xsl:call-template name="convert2pt">
+ <xsl:with-param name="value" select="$width" />
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:if test="@table:number-columns-repeated">
+ <xsl:attribute name="ss:Span">
+ <xsl:value-of select="@table:number-columns-repeated - 1" />
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+
+ <xsl:variable name="columnNumber">
+ <xsl:choose>
+ <xsl:when test="@table:number-columns-repeated">
+ <xsl:value-of select="$currentColumnNumber + @table:number-columns-repeated"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$currentColumnNumber"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$columnNumber &lt; $maxColumnNo">
+ <xsl:variable name="nextColumnNodes" select="$columnNodes[position() != 1]" />
+ <xsl:choose>
+ <xsl:when test="@table:number-columns-repeated">
+ <xsl:apply-templates select="$nextColumnNodes[1]">
+ <xsl:with-param name="columnNodes" select="$nextColumnNodes" />
+ <xsl:with-param name="currentColumnNumber" select="$columnNumber" />
+ <xsl:with-param name="maxColumnNo" select="$maxColumnNo" />
+ <xsl:with-param name="setIndex" select="true()" />
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$nextColumnNodes[1]">
+ <xsl:with-param name="columnNodes" select="$nextColumnNodes" />
+ <xsl:with-param name="currentColumnNumber" select="$columnNumber + 1" />
+ <xsl:with-param name="maxColumnNo" select="$maxColumnNo" />
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- current node is a table:table-column -->
+ <xsl:template name="adding-column-styles-entries">
+ <xsl:choose>
+ <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>
+ <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>
+
+
+ <!-- current node is a table:table-column -->
+ <!-- duplicates column elements in case of column-repeated attribute -->
+ <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>
+
+
+ <!-- ************* -->
+ <!-- *** Rows *** -->
+ <!-- ************* -->
+
+
+ <!-- Recursions are much faster when the stack size is small -->
+ <xsl:template name="optimized-row-handling">
+ <xsl:param name="rowNodes" />
+ <xsl:param name="columnNodes" />
+ <xsl:param name="offset" select="0"/>
+ <xsl:param name="threshold" select="10"/>
+
+ <xsl:variable name="rowCount" select="count($rowNodes)"/>
+ <xsl:choose>
+ <xsl:when test="$rowCount &lt;= $threshold">
+ <xsl:apply-templates select="$rowNodes[1]">
+ <xsl:with-param name="rowNodes" select="$rowNodes" />
+ <xsl:with-param name="offset" select="$offset" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="rowCountHalf" select="floor($rowCount div 2)"/>
+ <xsl:variable name="rowNodesSetA" select="$rowNodes[position() &lt;= $rowCountHalf]"/>
+ <xsl:variable name="rowNodesSetB" select="$rowNodes[position() &gt; $rowCountHalf]"/>
+ <!-- to keep track of the rownumber, the repeteated rows have to kept into accounts -->
+ <xsl:variable name="rowsCreatedByRepetition">
+ <xsl:choose>
+ <xsl:when test="$rowNodesSetA/@table:number-rows-repeated">
+ <xsl:value-of select="number(sum($rowNodesSetA/@table:number-rows-repeated))
+ - count($rowNodesSetA/@table:number-rows-repeated)" />
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$rowCountHalf &gt; $threshold">
+ <xsl:call-template name="optimized-row-handling">
+ <xsl:with-param name="rowNodes" select="$rowNodesSetA"/>
+ <xsl:with-param name="offset" select="$offset" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ <xsl:call-template name="optimized-row-handling">
+ <xsl:with-param name="rowNodes" select="$rowNodesSetB"/>
+ <xsl:with-param name="offset" select="$offset + $rowCountHalf + $rowsCreatedByRepetition" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$rowNodesSetA[1]">
+ <xsl:with-param name="rowNodes" select="$rowNodesSetA"/>
+ <xsl:with-param name="offset" select="$offset" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ <xsl:apply-templates select="$rowNodesSetB[1]">
+ <xsl:with-param name="rowNodes" select="$rowNodesSetB" />
+ <xsl:with-param name="offset" select="$offset + $rowCountHalf + $rowsCreatedByRepetition" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Rows as "table:table-row" might be grouped in
+ "table:table-header-rows" or "table:table-row-group"
+ This row-tree will be traversed providing each Row with its
+ calculatedRowPosition and earlierRowNumber.
+ By this repeated empty rows might be neglected in the spreadsheetml output,
+ as the following row will notice the 'gap' and provide @ss:Index,
+ which results in filling up the gap by a row without style and content.
+
+ In Excel created rows by ss:Index are 'default' rows.
+ -->
+ <xsl:template match="table:table-row">
+ <xsl:param name="earlierRowNumber" select="0" />
+ <xsl:param name="offset" />
+ <xsl:param name="calculatedRowPosition" select="$offset + 1" />
+ <xsl:param name="rowNodes" />
+ <xsl:param name="columnNodes" />
+
+ <xsl:choose>
+ <xsl:when test="@table:number-rows-repeated &gt; 1">
+ <xsl:call-template name="write-table-row">
+ <xsl:with-param name="earlierRowNumber" select="$earlierRowNumber" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ <xsl:if test="@table:number-rows-repeated &gt; 2 and (table:table-cell/@office:value-type or $firstDefaultCellStyle != '')">
+ <!-- In case a cell is being repeated, the cell will be created
+ in a variabel, which is as many times given out, as being repeated -->
+ <xsl:variable name="tableRow">
+ <xsl:call-template name="write-table-row">
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="optimized-row-repeating">
+ <xsl:with-param name="tableRow" select="$tableRow" />
+ <xsl:with-param name="repetition" select="@table:number-rows-repeated - 1" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="write-table-row">
+ <xsl:with-param name="earlierRowNumber" select="$earlierRowNumber" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:variable name="nextRowNodes" select="$rowNodes[position()!=1]" />
+ <xsl:choose>
+ <xsl:when test="@table:number-rows-repeated &gt; 1">
+ <xsl:apply-templates select="$nextRowNodes[1]">
+ <xsl:with-param name="earlierRowNumber" select="$calculatedRowPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition + @table:number-rows-repeated" />
+ <xsl:with-param name="rowNodes" select="$nextRowNodes" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$nextRowNodes[1]">
+ <xsl:with-param name="earlierRowNumber" select="$calculatedRowPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition + 1" />
+ <xsl:with-param name="rowNodes" select="$nextRowNodes" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="write-table-row">
+ <xsl:param name="earlierRowNumber" select="0" />
+ <xsl:param name="calculatedRowPosition" select="1" />
+ <xsl:param name="columnNodes" />
+
+ <xsl:element name="Row">
+ <xsl:if test="@table:visibility = 'collapse' or @table:visibility = 'filter'">
+ <xsl:attribute name="ss:Hidden">1</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not($earlierRowNumber + 1 = $calculatedRowPosition)">
+ <xsl:attribute name="ss:Index"><xsl:value-of select="$calculatedRowPosition" /></xsl:attribute>
+ </xsl:if>
+
+ <!-- writing the style of the row -->
+ <xsl:apply-templates select="@table:style-name" mode="table-row" />
+
+ <xsl:variable name="rowProperties" select="key('styles', @table:style-name)/*" />
+ <xsl:if test="$rowProperties/@style:use-optimal-row-height = 'false'">
+ <!-- default is '1', therefore write only '0' -->
+ <xsl:attribute name="ss:AutoFitHeight">0</xsl:attribute>
+ </xsl:if>
+
+ <xsl:variable name="height" select="$rowProperties/@style:row-height" />
+ <xsl:if test="$height">
+ <xsl:attribute name="ss:Height">
+ <!-- using the absolute height in point -->
+ <xsl:call-template name="convert2pt">
+ <xsl:with-param name="value" select="$height" />
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="table:table-cell[1]">
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="cellNodes" select="table:table-cell" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:template>
+
+
+ <!-- Recursions are much faster when the stack size is small -->
+ <xsl:template name="optimized-row-repeating">
+ <xsl:param name="tableRow" />
+ <xsl:param name="repetition" />
+ <!-- resource optimation: instead of '1' it will be '1000' and the column is not full -->
+ <xsl:param name="thresholdmax" select="512"/>
+ <xsl:param name="thresholdmin" select="256"/>
+
+ <xsl:choose>
+ <xsl:when test="$repetition &lt;= $thresholdmax">
+ <xsl:copy-of select="$tableRow" />
+ <xsl:if test="$repetition &lt;= $thresholdmin">
+ <xsl:call-template name="optimized-row-repeating">
+ <xsl:with-param name="repetition" select="$repetition - 1"/>
+ <xsl:with-param name="tableRow" select="$tableRow" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$repetition mod 2 = 1">
+ <xsl:copy-of select="$tableRow" />
+ </xsl:if>
+ <xsl:variable name="repetitionHalf" select="floor($repetition div 2)"/>
+ <xsl:call-template name="optimized-row-repeating">
+ <xsl:with-param name="repetition" select="$repetitionHalf"/>
+ <xsl:with-param name="tableRow" select="$tableRow" />
+ </xsl:call-template>
+ <xsl:call-template name="optimized-row-repeating">
+ <xsl:with-param name="repetition" select="$repetitionHalf"/>
+ <xsl:with-param name="tableRow" select="$tableRow" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+
+ <!-- ************** -->
+ <!-- *** Cells *** -->
+ <!-- ************** -->
+
+ <!-- Table cells are able to be repeated by attribute in StarOffice,
+ but not in Excel. If more cells are repeated -->
+ <xsl:template name="table:table-cell" match="table:table-cell">
+ <xsl:param name="calculatedCellPosition" select="1" /><!-- the later table position of the current cell -->
+ <xsl:param name="calculatedRowPosition" /><!-- the later table position of the current row -->
+ <xsl:param name="setIndex" select="false()" /> <!-- if not '0' @ss:Index used for neglecting repeteated empty cells -->
+ <xsl:param name="repetition" select="@table:number-columns-repeated" /> <!-- used for explicit written out cells -->
+ <xsl:param name="repetitionCellPosition" select="$calculatedCellPosition" /><!-- during repetition formula needs exact cell positioning -->
+ <xsl:param name="nextMatchedCellPosition"><!-- the later table position of the next cell -->
+ <xsl:choose>
+ <xsl:when test="not(@table:number-columns-repeated) and not(@table:number-columns-spanned)">
+ <xsl:value-of select="$calculatedCellPosition + 1" />
+ </xsl:when>
+ <xsl:when test="not(@table:number-columns-spanned)">
+ <xsl:value-of select="$calculatedCellPosition + @table:number-columns-repeated" />
+ </xsl:when>
+ <xsl:when test="not(@table:number-columns-repeated)">
+ <xsl:value-of select="$calculatedCellPosition + @table:number-columns-spanned" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$calculatedCellPosition + @table:number-columns-spanned * @table:number-columns-repeated" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:param>
+ <xsl:param name="cellNodes" /><!-- cells to be handled -->
+ <xsl:param name="columnNodes" />
+
+ <xsl:choose>
+ <!-- in case a repetition took place -->
+ <xsl:when test="$repetition &gt; 0">
+ <xsl:choose>
+ <!-- In case of no cell content (text, subelements, attribute, except repeated style) the ss:Index could be used -->
+ <xsl:when test="not(text()) and not(*) and not(@*[name() != 'table:number-columns-repeated'])">
+ <xsl:choose>
+ <xsl:when test="count($cellNodes) = 1">
+ <xsl:call-template name="create-table-cell">
+ <xsl:with-param name="setIndex" select="true()" />
+ <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition - 1" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$cellNodes[2]">
+ <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="setIndex" select="true()" />
+ <xsl:with-param name="cellNodes" select="$cellNodes[position() != 1]" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- Fastest cell repetition by creating cell once and copying, works not for
+ a) cells with formula (need of actual cell position)
+ b) cells, which start with ss:Index (as ss:Index is not allowed to be repeated) -->
+ <xsl:when test="not(@table:formula) and not($setIndex)">
+ <!-- In case a non-empty cell is being repeated, the cell will be created
+ in a variabel, which is as many times given out, as being repeated -->
+ <xsl:variable name="tableCell">
+ <xsl:call-template name="create-table-cell">
+ <xsl:with-param name="setIndex" select="false()" /><!-- copied cells may not have indices -->
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="repeat-copy-table-cell">
+ <xsl:with-param name="tableCell" select="$tableCell" />
+ <xsl:with-param name="repetition" select="$repetition" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ <xsl:apply-templates select="$cellNodes[2]">
+ <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="cellNodes" select="$cellNodes[position() != 1]" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ </xsl:when>
+ <!-- explicit writing (instead of copying) of cell for the cases mentioned above -->
+ <xsl:otherwise>
+ <xsl:call-template name="create-table-cell">
+ <xsl:with-param name="setIndex" select="$setIndex" /><!-- a possible Index will be created -->
+ <xsl:with-param name="calculatedCellPosition" select="$repetitionCellPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ <xsl:choose>
+ <!-- as long there is a repetition (higher '1') stay on the same cell node -->
+ <xsl:when test="$repetition &gt; 1">
+ <xsl:call-template name="table:table-cell">
+ <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="repetitionCellPosition">
+ <xsl:choose>
+ <xsl:when test="@table:number-columns-spanned">
+ <xsl:value-of select="$repetitionCellPosition + @table:number-columns-spanned" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$repetitionCellPosition + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="nextMatchedCellPosition" select="$nextMatchedCellPosition" />
+ <xsl:with-param name="repetition" select="$repetition - 1" />
+ <xsl:with-param name="cellNodes" select="$cellNodes" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$cellNodes[2]">
+ <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="cellNodes" select="$cellNodes[position() != 1]" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- in case no repetition took place -->
+ <xsl:choose>
+ <!-- neglect en empty cells by using ss:Index Attribut -->
+ <xsl:when test="not(text()) and not(*) and not(@*)">
+ <xsl:choose>
+ <!-- if it is the last cell, write this cell -->
+ <xsl:when test="count($cellNodes) = 1">
+ <xsl:call-template name="create-table-cell">
+ <xsl:with-param name="setIndex" select="true()" />
+ <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition - 1" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$cellNodes[2]">
+ <xsl:with-param name="setIndex" select="true()" />
+ <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="cellNodes" select="$cellNodes[position() != 1]" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- create cell and use/unset the ss:Index -->
+ <xsl:call-template name="create-table-cell">
+ <xsl:with-param name="setIndex" select="$setIndex" />
+ <xsl:with-param name="calculatedCellPosition" select="$calculatedCellPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:call-template>
+ <xsl:apply-templates select="$cellNodes[2]">
+ <xsl:with-param name="calculatedCellPosition" select="$nextMatchedCellPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ <xsl:with-param name="cellNodes" select="$cellNodes[position() != 1]" />
+ <xsl:with-param name="columnNodes" select="$columnNodes" />
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Copies the variable 'tableCell' to the output as often as 'repetition' -->
+ <xsl:template name="repeat-copy-table-cell">
+ <xsl:param name="tableCell" />
+ <xsl:param name="repetition" />
+
+ <xsl:if test="$repetition &gt; 0">
+ <xsl:copy-of select="$tableCell"/>
+ <xsl:call-template name="repeat-copy-table-cell">
+ <xsl:with-param name="tableCell" select="$tableCell" />
+ <xsl:with-param name="repetition" select="$repetition - 1" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="create-table-cell">
+ <xsl:param name="setIndex" select="false()" />
+ <xsl:param name="calculatedCellPosition" />
+ <xsl:param name="calculatedRowPosition" />
+ <xsl:param name="columnNodes" />
+
+ <xsl:element name="Cell" namespace="urn:schemas-microsoft-com:office:spreadsheet">
+ <xsl:if test="$setIndex">
+ <xsl:attribute name="ss:Index">
+ <xsl:value-of select="$calculatedCellPosition"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@table:number-columns-spanned &gt; 1">
+ <xsl:attribute name="ss:MergeAcross">
+ <xsl:value-of select="@table:number-columns-spanned - 1" />
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@table:number-rows-spanned &gt; 1">
+ <xsl:attribute name="ss:MergeDown">
+ <xsl:value-of select="@table:number-rows-spanned - 1" />
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="link" select="descendant::text:a/@xlink:href" />
+ <xsl:if test="$link">
+ <xsl:attribute name="ss:HRef">
+ <xsl:value-of select="$link" />
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="@table:style-name">
+ <xsl:apply-templates select="@table:style-name" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$firstDefaultCellStyle != ''">
+ <xsl:variable name="defaultCellStyle" select="$columnNodes/table:table-column[position() = $calculatedCellPosition]/@table:default-cell-style-name" />
+ <xsl:if test="$defaultCellStyle">
+ <xsl:if test="not($defaultCellStyle = 'Default')">
+ <xsl:attribute name="ss:StyleID"><xsl:value-of select="$defaultCellStyle"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates select="@table:formula">
+ <xsl:with-param name="calculatedCellPosition" select="$calculatedCellPosition" />
+ <xsl:with-param name="calculatedRowPosition" select="$calculatedRowPosition" />
+ </xsl:apply-templates>
+ <xsl:choose>
+ <xsl:when test="*">
+ <!-- in case it is not an empty cell
+
+ As the sequence of comment and data is opposite in Excel and Calc no match work here, in both comments exist only once
+ Possible Table Content of interest: text:h|text:p|text:list -->
+ <xsl:if test="text:h | text:p | text:list">
+ <xsl:variable name="valueType">
+ <xsl:choose>
+ <xsl:when test="@office:value-type">
+ <xsl:value-of select="@office:value-type" />
+ </xsl:when>
+ <xsl:otherwise>string</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="ss:Data">
+ <xsl:with-param name="valueType" select="$valueType" />
+ <xsl:with-param name="cellStyleName" select="@table:style-name" />
+ </xsl:call-template>
+ </xsl:if>
+
+ <xsl:if test="office:annotation">
+ <xsl:element name="Comment">
+ <xsl:if test="office:annotation/@office:author">
+ <xsl:attribute name="ss:Author"><xsl:value-of select="office:annotation/@office:author" /></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="office:annotation/@office:display = 'true'">
+ <xsl:attribute name="ss:ShowAlways">1</xsl:attribute>
+ </xsl:if>
+ <!-- ss:Data is oblicatory, but not the same as the ss:Cell ss:Data child, as it has no attributes -->
+ <ss:Data xmlns="http://www.w3.org/TR/REC-html40">
+ <xsl:for-each select="office:annotation/text:p">
+ <xsl:choose>
+ <xsl:when test="*">
+ <!-- paragraph style have to be neglected due to Excel error,
+ which does not allow shadowing their HTML attributes -->
+ <xsl:for-each select="*">
+ <xsl:call-template name="style-and-contents" />
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="@text:style-name">
+ <xsl:call-template name="style-and-contents" />
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- if no style is set, BOLD is set as default -->
+ <B>
+ <xsl:call-template name="style-and-contents" />
+ </B>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </ss:Data>
+ </xsl:element>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- comments are handled separately in the cell -->
+ <xsl:template match="office:annotation" />
+ <xsl:template match="dc:date" />
+
+ <xsl:template name="ss:Data">
+ <!-- the default value is 'String' in the office -->
+ <xsl:param name="valueType" select="'string'" />
+ <xsl:param name="cellStyleName" />
+
+ <xsl:choose>
+ <xsl:when test="descendant::*/@text:style-name">
+ <xsl:choose>
+ <xsl:when test="$valueType = 'string'">
+ <ss:Data ss:Type="String" xmlns="http://www.w3.org/TR/REC-html40">
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:apply-templates>
+ </ss:Data>
+ </xsl:when>
+ <xsl:when test="$valueType = 'boolean'">
+ <ss:Data ss:Type="Boolean" xmlns="http://www.w3.org/TR/REC-html40">
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:apply-templates>
+ </ss:Data>
+ </xsl:when>
+ <xsl:when test="$valueType = 'date'">
+ <ss:Data ss:Type="DateTime" xmlns="http://www.w3.org/TR/REC-html40">
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:apply-templates>
+ </ss:Data>
+ </xsl:when>
+ <!-- float, time, percentage, currency (no 'Error' setting) -->
+ <xsl:otherwise>
+ <ss:Data ss:Type="Number" xmlns="http://www.w3.org/TR/REC-html40">
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:apply-templates>
+ </ss:Data>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="Data">
+ <xsl:call-template name="ss:Type">
+ <xsl:with-param name="valueType" select="$valueType" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="ss:Type">
+ <xsl:param name="valueType" select="'string'" />
+
+ <xsl:choose>
+ <xsl:when test="$valueType = 'string'">
+ <xsl:attribute name="ss:Type">String</xsl:attribute>
+ <xsl:apply-templates select="*"/>
+ </xsl:when>
+ <xsl:when test="$valueType = 'boolean'">
+ <xsl:attribute name="ss:Type">Boolean</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@office:boolean-value = 'true'">1</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$valueType = 'date' or $valueType = 'time'">
+ <!-- issue in Excel: can not have an empty 'DateTime' cell -->
+ <xsl:attribute name="ss:Type">DateTime</xsl:attribute>
+ <!-- Gathering information of two StarOffice date/time attributes
+ Excel always needs both pieces of information in one attribute -->
+ <xsl:choose>
+ <xsl:when test="@office:date-value">
+ <!-- office:date-value may contain time (after 'T')-->
+ <xsl:choose>
+ <xsl:when test="contains(@office:date-value, 'T')">
+ <!-- in case time is also part of the date -->
+ <xsl:value-of select="substring-before(@office:date-value, 'T')" />
+ <xsl:text>T</xsl:text>
+ <xsl:value-of select="substring-after(@office:date-value,'T')" />
+ <xsl:if test="not(contains(@office:date-value,'.'))">
+ <xsl:text>.</xsl:text>
+ </xsl:if>
+ <xsl:text>000</xsl:text>
+ </xsl:when>
+ <xsl:when test="@office:time-value">
+ <!-- conatains date and time (time will be evaluated later -->
+ <xsl:value-of select="@office:date-value" />
+ <xsl:text>T</xsl:text>
+ <xsl:choose>
+ <xsl:when test="@table:formula or contains(@office:time-value,',')">
+ <!-- customized number types not implemented yet -->
+ <xsl:text>00:00:00.000</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate(substring-after(@office:time-value,'PT'),'HMS','::.')" />
+ <xsl:if test="not(contains(@office:time-value,'S'))">
+ <xsl:text>.</xsl:text>
+ </xsl:if>
+ <xsl:text>000</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@office:date-value" />
+ <xsl:text>T00:00:00.000</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="@office:time-value">
+ <xsl:text>1899-12-31T</xsl:text>
+ <xsl:choose>
+ <xsl:when test="@table:formula or contains(@office:time-value,',')">
+ <!-- customized number types not implemented yet -->
+ <xsl:text>00:00:00.000</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate(substring-after(@office:time-value,'PT'),'HMS','::.')" />
+ <xsl:if test="not(contains(@office:time-value,'S'))">
+ <xsl:text>.</xsl:text>
+ </xsl:if>
+ <xsl:text>000</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- float, percentage, currency (no 'Error' setting) -->
+ <xsl:otherwise>
+ <xsl:attribute name="ss:Type">Number</xsl:attribute>
+ <xsl:value-of select="@office:value" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- ******************** -->
+ <!-- *** Common Rules *** -->
+ <!-- ******************** -->
+
+ <xsl:template match="*">
+ <xsl:param name="cellStyleName" />
+
+<!-- LineBreak in Cell -->
+ <xsl:if test="preceding-sibling::text:p[1]"><xsl:text>&#10;</xsl:text></xsl:if>
+ <xsl:call-template name="style-and-contents">
+ <xsl:with-param name="cellStyleName" select="$cellStyleName" />
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- disabling draw:frames -->
+ <xsl:template match="draw:frame" />
+
+ <xsl:template match="text:s">
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="@text:c" />
+ </xsl:call-template>
+ </xsl:template>
+
+ <!--write the number of 'whitespaces' -->
+ <xsl:template name="write-breakable-whitespace">
+ <xsl:param name="whitespaces" />
+
+ <xsl:text> </xsl:text>
+ <xsl:if test="$whitespaces >= 1">
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="$whitespaces - 1" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- allowing all matched text nodes -->
+ <xsl:template match="text()"><xsl:value-of select="." /></xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/export/uof/odf2uof_presentation.xsl b/filter/source/xslt/export/uof/odf2uof_presentation.xsl
index a5b6b65251e7..a18113c5834f 100644
--- a/filter/source/xslt/export/uof/odf2uof_presentation.xsl
+++ b/filter/source/xslt/export/uof/odf2uof_presentation.xsl
@@ -17,3376 +17,3376 @@
* 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: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:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible: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:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation: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:xforms="http://www.w3.org/2002/xforms" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:数="http://www.w3.org/1998/Math/MathML" xmlns:图="http://schemas.uof.org/cn/2003/graph" exclude-result-prefixes="office style text table draw fo xlink dc meta number presentation svg chart dr3d math form script config ooo ooow oooc dom xforms smil anim">
- <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0" standalone="no" omit-xml-declaration="no"/>
- <xsl:variable name="impresswithUnit">
- <xsl:value-of select="/office:document/office:styles/style:style[@style:family='graphic']/style:graphic-properties/@svg:stroke-width"/>
- </xsl:variable>
- <xsl:variable name="uofUnit">
- <xsl:choose>
- <xsl:when test="contains($impresswithUnit,'inch')">inch</xsl:when>
- <xsl:when test="contains($impresswithUnit,'cm')">cm</xsl:when>
- <xsl:when test="contains($impresswithUnit,'mm')">mm</xsl:when>
- <xsl:when test="contains($impresswithUnit,'pt')">pt</xsl:when>
- <xsl:otherwise>cm</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="cm-to-other">
- <xsl:choose>
- <xsl:when test="$uofUnit='cm'">1</xsl:when>
- <xsl:when test="$uofUnit='inch'">0.394</xsl:when>
- <xsl:when test="$uofUnit='pt'">28.346</xsl:when>
- <xsl:when test="$uofUnit='mm'">10</xsl:when>
- <xsl:when test="$uofUnit='pica'">2.364</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:key match="/office:document/office:automatic-styles/style:style | /office:document/office:styles/style:style" name="graphicset" use="@style:name"/>
- <xsl:template match="/">
- <xsl:apply-templates select="office:document"/>
- </xsl:template>
- <xsl:template match="office:document">
- <uof:UOF xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:图="http://schemas.uof.org/cn/2003/graph" xmlns:数="http://www.w3.org/1998/Math/MathML" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" uof:language="cn" uof:version="1.0" uof:locID="u0000" uof:mimetype="vnd.uof.presentation">
- <xsl:apply-templates select="office:meta"/>
- <xsl:if test="//text:bookmark|//text:bookmark-start">
- <uof:书签集 uof:locID="u0027">
- <xsl:for-each select="//text:bookmark|//text:bookmark-start">
- <uof:书签 uof:名称="{@text:name}" uof:locID="u0028" uof:attrList="名称">
- <uof:文本位置 uof:区域引用="{generate-id(.)}" uof:locID="u0029" uof:attrList="区域引用"/>
- </uof:书签>
- </xsl:for-each>
- </uof:书签集>
- </xsl:if>
- <xsl:if test="/office:document/office:body/text:p/text:a | /office:document/office:body/text:p/draw:a">
- <uof:链接集 uof:locID="u0031">
- <xsl:for-each select="/office:document/office:body/text:p/text:a | /office:document/office:body/text:p/draw:a">
- <xsl:variable name="hyperStr" select="@xlink:href"/>
- <uof:超级链接 uof:locID="u0032" uof:attrList="标识符 目标 书签 式样引用 已访问式样引用 提示 链源">
- <xsl:if test="contains($hyperStr,'#')">
- <xsl:attribute name="uof:书签"><xsl:value-of select="substring-after($hyperStr,'#')"/></xsl:attribute>
- <xsl:attribute name="uof:提示"><xsl:value-of select="."/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="num">
- <xsl:number from="/office:document/office:body" level="any" count="text:p[text:a]"/>
- </xsl:variable>
- <xsl:attribute name="uof:链源"><xsl:value-of select="concat('hlnk',$num)"/></xsl:attribute>
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('hyk_','hlnk',$num)"/></xsl:attribute>
- <xsl:if test="not(contains($hyperStr,'#'))">
- <xsl:attribute name="uof:目标"><xsl:value-of select="$hyperStr"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="contains($hyperStr,'@')">
- <xsl:attribute name="uof:提示">链接到邮件地址</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="uof:提示">链接文件</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@text:style-name">
- <xsl:attribute name="uof:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@text:visited-style-name">
- <xsl:attribute name="uof:已访问式样引用"><xsl:value-of select="@text:visited-style-name"/></xsl:attribute>
- </xsl:if>
- </uof:超级链接>
- </xsl:for-each>
- </uof:链接集>
- </xsl:if>
- <uof:对象集 uof:locID="u0033">
- <xsl:apply-templates select="office:master-styles/style:handout-master" mode="styles"/>
- <xsl:apply-templates select="office:master-styles/style:master-page" mode="styles"/>
- <xsl:apply-templates select="office:body/office:presentation/draw:page" mode="styles"/>
- <xsl:apply-templates select="office:styles/style:presentation-page-layout/presentation:placeholder" mode="graphic"/>
- <xsl:apply-templates select="office:body/office:presentation/draw:page/presentation:notes" mode="styles"/>
- <xsl:for-each select="(/office:document/office:styles/draw:fill-image) | (/office:document/office:automatic-styles/draw:fill-image)">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="@draw:name"/></xsl:attribute>
- <xsl:attribute name="uof:公共类型">jpg</xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="office:binary-data"/>
- </uof:数据>
- </uof:其他对象>
- </xsl:for-each>
- <xsl:for-each select="(/office:document/office:styles/style:style/style:graphic-properties/text:list-style/text:list-level-style-image) | (/office:document/office:automatic-styles/style:style/style:graphic-properties/text:list-style/text:list-level-style-image)">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('image_numbering_',count(preceding::text:list-level-style-image))"/></xsl:attribute>
- <xsl:attribute name="uof:公共类型">jpg</xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="office:binary-data"/>
- </uof:数据>
- </uof:其他对象>
- </xsl:for-each>
- </uof:对象集>
- <uof:式样集 uof:locID="u0039">
- <xsl:apply-templates select="office:font-face-decls"/>
- <xsl:element name="uof:自动编号集">
- <xsl:attribute name="uof:locID">u0042</xsl:attribute>
- <xsl:for-each select="/office:document//text:list-style">
- <xsl:element name="字:自动编号">
- <xsl:attribute name="uof:locID">t0169</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 父编号引用 多级编号</xsl:attribute>
- <xsl:attribute name="字:标识符">
- <xsl:variable name="count1" select="count(preceding::text:list-style)"/>
- <xsl:choose><xsl:when test="@style:name"><xsl:value-of select="concat(@style:name,$count1)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(../../@style:name,$count1)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:多级编号">true</xsl:attribute>
- <xsl:for-each select="./* ">
- <xsl:if test="number(@text:level) &lt; 10">
- <xsl:element name="字:级别">
- <xsl:attribute name="uof:locID">t0159</xsl:attribute>
- <xsl:attribute name="uof:attrList">级别值 编号对齐方式 尾随字符</xsl:attribute>
- <xsl:attribute name="字:级别值"><xsl:value-of select="number(@text:level)"/></xsl:attribute>
- <xsl:if test="style:list-level-properties/@fo:text-align">
- <xsl:attribute name="字:编号对齐方式"><xsl:value-of select="style:list-level-properties/@fo:text-align"/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="level">
- <xsl:value-of select="@text:level"/>
- </xsl:variable>
- <xsl:if test="office:binary-data">
- <xsl:element name="字:图片符号引用" uof:locID="t0164" uof:attrList="宽度 高度">
- <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(style:list-level-properties/@fo:width,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="字:高度"><xsl:value-of select="substring-before(style:list-level-properties/@fo:height,$uofUnit)"/></xsl:attribute>
- <xsl:value-of select="concat('image_numbering_',count(preceding::text:list-level-style-image))"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="@text:bullet-char">
- <xsl:element name="字:项目符号">
- <xsl:attribute name="uof:locID">t0171</xsl:attribute>
- <xsl:value-of select="@text:bullet-char"/>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:符号字体">
- <xsl:attribute name="uof:locID">t0160</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:call-template name="字:句属性"/>
- </xsl:element>
- <xsl:if test="@style:num-format">
- <xsl:choose>
- <xsl:when test="string(@style:num-format)='a'">
- <xsl:element name="字:编号格式" uof:locID="t0162">lower-letter</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='A'">
- <xsl:element name="字:编号格式" uof:locID="t0162">upper-letter</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='i'">
- <xsl:element name="字:编号格式" uof:locID="t0162">lower-roman</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='I'">
- <xsl:element name="字:编号格式" uof:locID="t0162">upper-roman</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='①, ②, ③, ...'">
- <xsl:element name="字:编号格式" uof:locID="t0162">decimal-enclosed-circle</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='甲, 乙, 丙, ...'">
- <xsl:element name="字:编号格式" uof:locID="t0162">ideograph-traditional</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='子, 丑, 寅, ...'">
- <xsl:element name="字:编号格式" uof:locID="t0162">ideograph-zodiac</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='一, 二, 三, ...'">
- <xsl:element name="字:编号格式" uof:locID="t0162">chinese-counting</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='壹, 贰, 叁, ...'">
- <xsl:element name="字:编号格式" uof:locID="t0162">chinese-legal-simplified</xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="字:编号格式" uof:locID="t0162">decimal</xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:variable name="jibie">
- <xsl:value-of select="position()"/>
- </xsl:variable>
- <xsl:variable name="xianshijibie">
- <xsl:choose>
- <xsl:when test="@text:display-levels">
- <xsl:value-of select="@text:display-levels"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <字:编号格式表示 uof:locID="t0163">
- <xsl:call-template name="字:编号格式表示">
- <xsl:with-param name="bubianjibie" select="$jibie"/>
- <xsl:with-param name="jibie" select="$jibie"/>
- <xsl:with-param name="xianshijibie" select="$xianshijibie"/>
- <xsl:with-param name="biaoshi" select="concat(string(@style:num-prefix),'%',$jibie,string(@style:num-suffix))"/>
- </xsl:call-template>
- </字:编号格式表示>
- <xsl:element name="字:缩进">
- <xsl:attribute name="uof:locID">t0165</xsl:attribute>
- <xsl:call-template name="字:缩进类型"/>
- </xsl:element>
- <xsl:element name="字:制表符位置">
- <xsl:attribute name="uof:locID">t0166</xsl:attribute>
- <xsl:value-of select="substring-before(style:list-level-properties/@text:min-label-width,$uofUnit)"/>
- </xsl:element>
- <xsl:if test="@text:start-value">
- <xsl:element name="字:起始编号">
- <xsl:value-of select="@text:start-value"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="@text:num-regular-exp">
- <xsl:element name="字:正规格式" uof:locID="t0168" uof:attrList="值">
- <xsl:attribute name="值"><xsl:value-of select="@text:num-regular-exp"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- <xsl:for-each select="/office:document//text:list-style/*">
- <xsl:if test="style:text-properties/@fo:font-family">
- <xsl:element name="uof:句式样">
- <xsl:attribute name="uof:locID">u0043</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用</xsl:attribute>
- <xsl:variable name="count"><xsl:value-of select="count(preceding::node())"/></xsl:variable>
- <xsl:attribute name="字:标识符"><xsl:value-of select="concat('ID',$count)"/></xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="concat(ancestor::style:style/@style:name,@text:level)"/></xsl:attribute>
- <xsl:attribute name="字:类型">auto</xsl:attribute>
- <xsl:if test="ancestor::style:style/@style:parent-style-name">
- <xsl:attribute name="字:基式样引用"><xsl:value-of select="ancestor::style:style/@style:parent-style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="字:句属性"/>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- <xsl:apply-templates select="office:styles | office:automatic-styles" mode="style"/>
- <xsl:for-each select="/office:document/office:master-styles/style:master-page">
- <xsl:for-each select="child::draw:frame">
- <xsl:variable name="stylename" select="@presentation:style-name"/>
- <xsl:variable name="parent" select="/office:document/office:automatic-styles/style:style[@style:name=$stylename]/@style:parent-style-name"/>
- <xsl:for-each select="/office:document/*/style:style[@style:name=$parent]">
- <xsl:if test="not(contains(@style:name,'outline'))">
- <xsl:call-template name="段落式样"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:for-each>
- <xsl:for-each select="/office:document/office:styles/style:style[contains(@style:name,'outline')]">
- <xsl:call-template name="段落式样"/>
- </xsl:for-each>
- </uof:式样集>
- <uof:演示文稿 uof:locID="u0048">
- <演:公用处理规则 uof:locID="p0000">
- <xsl:element name="演:度量单位">
- <xsl:attribute name="uof:locID">p0055</xsl:attribute>
- <xsl:value-of select="$uofUnit"/>
- </xsl:element>
- <演:页面设置集 uof:locID="p0001">
- <xsl:apply-templates select="office:automatic-styles/style:page-layout"/>
- </演:页面设置集>
- <演:配色方案集 uof:locID="p0007">
- <xsl:for-each select="/office:document/office:master-styles/*[@draw:style-name]">
- <xsl:call-template name="配色方案"/>
- </xsl:for-each>
- <xsl:for-each select="/office:document/office:body/office:presentation/draw:page">
- <xsl:call-template name="配色方案"/>
- </xsl:for-each>
- </演:配色方案集>
- <演:页面版式集 uof:locID="p0017">
- <xsl:apply-templates select="office:styles/style:presentation-page-layout" mode="pagestyle"/>
- </演:页面版式集>
- <xsl:if test="office:styles/style:style='标准-title' or office:styles/style:style='标准-outline'" >
- <演:文本式样集 uof:locID="p0131">
- <xsl:for-each select="office:styles/style:style">
- <xsl:variable name="name"><xsl:value-of select="@style:name"/></xsl:variable>
- <xsl:if test="$name='标准-title' or contains($name,'标准-outline')">
- <演:文本式样 uof:locID="p0132" uof:attrList="标识符 名称">
+ <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0" standalone="no" omit-xml-declaration="no"/>
+ <xsl:variable name="impresswithUnit">
+ <xsl:value-of select="/office:document/office:styles/style:style[@style:family='graphic']/style:graphic-properties/@svg:stroke-width"/>
+ </xsl:variable>
+ <xsl:variable name="uofUnit">
+ <xsl:choose>
+ <xsl:when test="contains($impresswithUnit,'inch')">inch</xsl:when>
+ <xsl:when test="contains($impresswithUnit,'cm')">cm</xsl:when>
+ <xsl:when test="contains($impresswithUnit,'mm')">mm</xsl:when>
+ <xsl:when test="contains($impresswithUnit,'pt')">pt</xsl:when>
+ <xsl:otherwise>cm</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="cm-to-other">
+ <xsl:choose>
+ <xsl:when test="$uofUnit='cm'">1</xsl:when>
+ <xsl:when test="$uofUnit='inch'">0.394</xsl:when>
+ <xsl:when test="$uofUnit='pt'">28.346</xsl:when>
+ <xsl:when test="$uofUnit='mm'">10</xsl:when>
+ <xsl:when test="$uofUnit='pica'">2.364</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:key match="/office:document/office:automatic-styles/style:style | /office:document/office:styles/style:style" name="graphicset" use="@style:name"/>
+ <xsl:template match="/">
+ <xsl:apply-templates select="office:document"/>
+ </xsl:template>
+ <xsl:template match="office:document">
+ <uof:UOF xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:图="http://schemas.uof.org/cn/2003/graph" xmlns:数="http://www.w3.org/1998/Math/MathML" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" uof:language="cn" uof:version="1.0" uof:locID="u0000" uof:mimetype="vnd.uof.presentation">
+ <xsl:apply-templates select="office:meta"/>
+ <xsl:if test="//text:bookmark|//text:bookmark-start">
+ <uof:书签集 uof:locID="u0027">
+ <xsl:for-each select="//text:bookmark|//text:bookmark-start">
+ <uof:书签 uof:名称="{@text:name}" uof:locID="u0028" uof:attrList="名称">
+ <uof:文本位置 uof:区域引用="{generate-id(.)}" uof:locID="u0029" uof:attrList="区域引用"/>
+ </uof:书签>
+ </xsl:for-each>
+ </uof:书签集>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/text:p/text:a | /office:document/office:body/text:p/draw:a">
+ <uof:链接集 uof:locID="u0031">
+ <xsl:for-each select="/office:document/office:body/text:p/text:a | /office:document/office:body/text:p/draw:a">
+ <xsl:variable name="hyperStr" select="@xlink:href"/>
+ <uof:超级链接 uof:locID="u0032" uof:attrList="标识符 目标 书签 式样引用 已访问式样引用 提示 链源">
+ <xsl:if test="contains($hyperStr,'#')">
+ <xsl:attribute name="uof:书签"><xsl:value-of select="substring-after($hyperStr,'#')"/></xsl:attribute>
+ <xsl:attribute name="uof:提示"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="num">
+ <xsl:number from="/office:document/office:body" level="any" count="text:p[text:a]"/>
+ </xsl:variable>
+ <xsl:attribute name="uof:链源"><xsl:value-of select="concat('hlnk',$num)"/></xsl:attribute>
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('hyk_','hlnk',$num)"/></xsl:attribute>
+ <xsl:if test="not(contains($hyperStr,'#'))">
+ <xsl:attribute name="uof:目标"><xsl:value-of select="$hyperStr"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="contains($hyperStr,'@')">
+ <xsl:attribute name="uof:提示">链接到邮件地址</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="uof:提示">链接文件</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@text:style-name">
+ <xsl:attribute name="uof:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@text:visited-style-name">
+ <xsl:attribute name="uof:已访问式样引用"><xsl:value-of select="@text:visited-style-name"/></xsl:attribute>
+ </xsl:if>
+ </uof:超级链接>
+ </xsl:for-each>
+ </uof:链接集>
+ </xsl:if>
+ <uof:对象集 uof:locID="u0033">
+ <xsl:apply-templates select="office:master-styles/style:handout-master" mode="styles"/>
+ <xsl:apply-templates select="office:master-styles/style:master-page" mode="styles"/>
+ <xsl:apply-templates select="office:body/office:presentation/draw:page" mode="styles"/>
+ <xsl:apply-templates select="office:styles/style:presentation-page-layout/presentation:placeholder" mode="graphic"/>
+ <xsl:apply-templates select="office:body/office:presentation/draw:page/presentation:notes" mode="styles"/>
+ <xsl:for-each select="(/office:document/office:styles/draw:fill-image) | (/office:document/office:automatic-styles/draw:fill-image)">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="@draw:name"/></xsl:attribute>
+ <xsl:attribute name="uof:公共类型">jpg</xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="office:binary-data"/>
+ </uof:数据>
+ </uof:其他对象>
+ </xsl:for-each>
+ <xsl:for-each select="(/office:document/office:styles/style:style/style:graphic-properties/text:list-style/text:list-level-style-image) | (/office:document/office:automatic-styles/style:style/style:graphic-properties/text:list-style/text:list-level-style-image)">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('image_numbering_',count(preceding::text:list-level-style-image))"/></xsl:attribute>
+ <xsl:attribute name="uof:公共类型">jpg</xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="office:binary-data"/>
+ </uof:数据>
+ </uof:其他对象>
+ </xsl:for-each>
+ </uof:对象集>
+ <uof:式样集 uof:locID="u0039">
+ <xsl:apply-templates select="office:font-face-decls"/>
+ <xsl:element name="uof:自动编号集">
+ <xsl:attribute name="uof:locID">u0042</xsl:attribute>
+ <xsl:for-each select="/office:document//text:list-style">
+ <xsl:element name="字:自动编号">
+ <xsl:attribute name="uof:locID">t0169</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 父编号引用 多级编号</xsl:attribute>
+ <xsl:attribute name="字:标识符">
+ <xsl:variable name="count1" select="count(preceding::text:list-style)"/>
+ <xsl:choose><xsl:when test="@style:name"><xsl:value-of select="concat(@style:name,$count1)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(../../@style:name,$count1)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:多级编号">true</xsl:attribute>
+ <xsl:for-each select="./* ">
+ <xsl:if test="number(@text:level) &lt; 10">
+ <xsl:element name="字:级别">
+ <xsl:attribute name="uof:locID">t0159</xsl:attribute>
+ <xsl:attribute name="uof:attrList">级别值 编号对齐方式 尾随字符</xsl:attribute>
+ <xsl:attribute name="字:级别值"><xsl:value-of select="number(@text:level)"/></xsl:attribute>
+ <xsl:if test="style:list-level-properties/@fo:text-align">
+ <xsl:attribute name="字:编号对齐方式"><xsl:value-of select="style:list-level-properties/@fo:text-align"/></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="level">
+ <xsl:value-of select="@text:level"/>
+ </xsl:variable>
+ <xsl:if test="office:binary-data">
+ <xsl:element name="字:图片符号引用" uof:locID="t0164" uof:attrList="宽度 高度">
+ <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(style:list-level-properties/@fo:width,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:高度"><xsl:value-of select="substring-before(style:list-level-properties/@fo:height,$uofUnit)"/></xsl:attribute>
+ <xsl:value-of select="concat('image_numbering_',count(preceding::text:list-level-style-image))"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="@text:bullet-char">
+ <xsl:element name="字:项目符号">
+ <xsl:attribute name="uof:locID">t0171</xsl:attribute>
+ <xsl:value-of select="@text:bullet-char"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:符号字体">
+ <xsl:attribute name="uof:locID">t0160</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:call-template name="字:句属性"/>
+ </xsl:element>
+ <xsl:if test="@style:num-format">
+ <xsl:choose>
+ <xsl:when test="string(@style:num-format)='a'">
+ <xsl:element name="字:编号格式" uof:locID="t0162">lower-letter</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='A'">
+ <xsl:element name="字:编号格式" uof:locID="t0162">upper-letter</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='i'">
+ <xsl:element name="字:编号格式" uof:locID="t0162">lower-roman</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='I'">
+ <xsl:element name="字:编号格式" uof:locID="t0162">upper-roman</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='①, ②, ③, ...'">
+ <xsl:element name="字:编号格式" uof:locID="t0162">decimal-enclosed-circle</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='甲, 乙, 丙, ...'">
+ <xsl:element name="字:编号格式" uof:locID="t0162">ideograph-traditional</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='子, 丑, 寅, ...'">
+ <xsl:element name="字:编号格式" uof:locID="t0162">ideograph-zodiac</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='一, 二, 三, ...'">
+ <xsl:element name="字:编号格式" uof:locID="t0162">chinese-counting</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='壹, 贰, 叁, ...'">
+ <xsl:element name="字:编号格式" uof:locID="t0162">chinese-legal-simplified</xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="字:编号格式" uof:locID="t0162">decimal</xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:variable name="jibie">
+ <xsl:value-of select="position()"/>
+ </xsl:variable>
+ <xsl:variable name="xianshijibie">
+ <xsl:choose>
+ <xsl:when test="@text:display-levels">
+ <xsl:value-of select="@text:display-levels"/>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <字:编号格式表示 uof:locID="t0163">
+ <xsl:call-template name="字:编号格式表示">
+ <xsl:with-param name="bubianjibie" select="$jibie"/>
+ <xsl:with-param name="jibie" select="$jibie"/>
+ <xsl:with-param name="xianshijibie" select="$xianshijibie"/>
+ <xsl:with-param name="biaoshi" select="concat(string(@style:num-prefix),'%',$jibie,string(@style:num-suffix))"/>
+ </xsl:call-template>
+ </字:编号格式表示>
+ <xsl:element name="字:缩进">
+ <xsl:attribute name="uof:locID">t0165</xsl:attribute>
+ <xsl:call-template name="字:缩进类型"/>
+ </xsl:element>
+ <xsl:element name="字:制表符位置">
+ <xsl:attribute name="uof:locID">t0166</xsl:attribute>
+ <xsl:value-of select="substring-before(style:list-level-properties/@text:min-label-width,$uofUnit)"/>
+ </xsl:element>
+ <xsl:if test="@text:start-value">
+ <xsl:element name="字:起始编号">
+ <xsl:value-of select="@text:start-value"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="@text:num-regular-exp">
+ <xsl:element name="字:正规格式" uof:locID="t0168" uof:attrList="值">
+ <xsl:attribute name="值"><xsl:value-of select="@text:num-regular-exp"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ <xsl:for-each select="/office:document//text:list-style/*">
+ <xsl:if test="style:text-properties/@fo:font-family">
+ <xsl:element name="uof:句式样">
+ <xsl:attribute name="uof:locID">u0043</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用</xsl:attribute>
+ <xsl:variable name="count"><xsl:value-of select="count(preceding::node())"/></xsl:variable>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="concat('ID',$count)"/></xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="concat(ancestor::style:style/@style:name,@text:level)"/></xsl:attribute>
+ <xsl:attribute name="字:类型">auto</xsl:attribute>
+ <xsl:if test="ancestor::style:style/@style:parent-style-name">
+ <xsl:attribute name="字:基式样引用"><xsl:value-of select="ancestor::style:style/@style:parent-style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="字:句属性"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:apply-templates select="office:styles | office:automatic-styles" mode="style"/>
+ <xsl:for-each select="/office:document/office:master-styles/style:master-page">
+ <xsl:for-each select="child::draw:frame">
+ <xsl:variable name="stylename" select="@presentation:style-name"/>
+ <xsl:variable name="parent" select="/office:document/office:automatic-styles/style:style[@style:name=$stylename]/@style:parent-style-name"/>
+ <xsl:for-each select="/office:document/*/style:style[@style:name=$parent]">
+ <xsl:if test="not(contains(@style:name,'outline'))">
+ <xsl:call-template name="段落式样"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:for-each>
+ <xsl:for-each select="/office:document/office:styles/style:style[contains(@style:name,'outline')]">
+ <xsl:call-template name="段落式样"/>
+ </xsl:for-each>
+ </uof:式样集>
+ <uof:演示文稿 uof:locID="u0048">
+ <演:公用处理规则 uof:locID="p0000">
+ <xsl:element name="演:度量单位">
+ <xsl:attribute name="uof:locID">p0055</xsl:attribute>
+ <xsl:value-of select="$uofUnit"/>
+ </xsl:element>
+ <演:页面设置集 uof:locID="p0001">
+ <xsl:apply-templates select="office:automatic-styles/style:page-layout"/>
+ </演:页面设置集>
+ <演:配色方案集 uof:locID="p0007">
+ <xsl:for-each select="/office:document/office:master-styles/*[@draw:style-name]">
+ <xsl:call-template name="配色方案"/>
+ </xsl:for-each>
+ <xsl:for-each select="/office:document/office:body/office:presentation/draw:page">
+ <xsl:call-template name="配色方案"/>
+ </xsl:for-each>
+ </演:配色方案集>
+ <演:页面版式集 uof:locID="p0017">
+ <xsl:apply-templates select="office:styles/style:presentation-page-layout" mode="pagestyle"/>
+ </演:页面版式集>
+ <xsl:if test="office:styles/style:style='标准-title' or office:styles/style:style='标准-outline'" >
+ <演:文本式样集 uof:locID="p0131">
+ <xsl:for-each select="office:styles/style:style">
+ <xsl:variable name="name"><xsl:value-of select="@style:name"/></xsl:variable>
+ <xsl:if test="$name='标准-title' or contains($name,'标准-outline')">
+ <演:文本式样 uof:locID="p0132" uof:attrList="标识符 名称">
<xsl:attribute name="演:标识符">text-style</xsl:attribute>
- <xsl:attribute name="演:名称">文本式样</xsl:attribute>
- <xsl:element name="演:段落式样">
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:类型">auto</xsl:attribute>
- <xsl:if test="@style:parent-style-name">
- <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:别名"><xsl:value-of select="@style:class"/></xsl:attribute>
- <xsl:call-template name="ParaAttribute">
- <xsl:with-param name="text-style-name" select="@text:style-name"/>
- </xsl:call-template>
- <xsl:call-template name="字:句属性"/>
- </xsl:element>
- </演:文本式样>
- </xsl:if>
- </xsl:for-each>
- </演:文本式样集>
- </xsl:if>
- <演:显示比例 uof:locID="p0020">
- <xsl:variable name="VisibleAreaWidth">
- <xsl:value-of select="/office:document/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry/config:config-item[@config:name='VisibleAreaWidth']"/>
- </xsl:variable>
- <xsl:value-of select="substring-before((13997 div $VisibleAreaWidth)*100,'.')"/>
- </演:显示比例>
- <演:放映设置 uof:locID="p0021">
- <演:幻灯片序列 uof:locID="p0022" uof:attrList="标识符 名称 自定义">
- <xsl:attribute name="演:标识符">customList</xsl:attribute>
- <xsl:attribute name="演:名称">幻灯片序列</xsl:attribute>
- <xsl:attribute name="演:自定义">true</xsl:attribute>
- <xsl:choose>
- <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:start-page">
- <xsl:variable name="start-page">
- <xsl:value-of select="office:body/office:presentation/presentation:settings/@presentation:start-page"/>
- </xsl:variable>
- <xsl:variable name="before-slides">
- <xsl:call-template name="幻灯片序列">
- <xsl:with-param name="start-node" select="office:body/office:presentation/draw:page[@draw:name=$start-page]"/>
- <xsl:with-param name="end-node" select="office:body/office:presentation/draw:page[last()]"/>
- <xsl:with-param name="value"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="after-slides">
- <xsl:for-each select="office:body/office:presentation/draw:page[@draw:name=$start-page]">
- <xsl:call-template name="幻灯片序列">
- <xsl:with-param name="start-node" select="/office:document/office:body/office:presentation/draw:page[1]"/>
- <xsl:with-param name="end-node" select="preceding-sibling::node()[1]"/>
- <xsl:with-param name="value"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:variable>
- <xsl:value-of select="concat($before-slides,' ',$after-slides)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="幻灯片序列">
- <xsl:with-param name="start-node" select="office:body/office:presentation/draw:page[1]"/>
- <xsl:with-param name="end-node" select="office:body/office:presentation/draw:page[last()]"/>
- <xsl:with-param name="value"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </演:幻灯片序列>
- <演:放映顺序 uof:locID="p0023" uof:attrList="名称 序列引用">
- <xsl:attribute name="演:名称">放映顺序</xsl:attribute>
- <xsl:attribute name="演:序列引用">customList</xsl:attribute>
- </演:放映顺序>
- <演:全屏放映 uof:locID="p0024">
- <xsl:choose>
- <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:full-screen='false'">false</xsl:when>
- <xsl:otherwise>true</xsl:otherwise>
- </xsl:choose>
- </演:全屏放映>
- <演:循环放映 uof:locID="p0025">
- <xsl:choose>
- <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:endless='true'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </演:循环放映>
- <xsl:if test="office:body/office:presentation/presentation:settings/@presentation:pause">
- <演:放映间隔 uof:locID="p0026">
- <xsl:variable name="hms">
- <xsl:value-of select="substring-after(office:body/office:presentation/presentation:settings/@presentation:pause,'PT')"/>
- </xsl:variable>
- <xsl:value-of select="concat('P0Y0M0DT',$hms)"/>
- </演:放映间隔>
- </xsl:if>
- <演:手动方式 uof:locID="p0027">
- <xsl:choose>
- <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:force-manual='true'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </演:手动方式>
- <演:导航帮助 uof:locID="p0029">
- <xsl:choose>
- <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:start-with-navigator='true'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </演:导航帮助>
- <演:放映动画 uof:locID="p0030">
- <xsl:choose>
- <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:animations='disabled'">false</xsl:when>
- <xsl:otherwise>true</xsl:otherwise>
- </xsl:choose>
- </演:放映动画>
- <演:前端显示 uof:locID="p0031">
- <xsl:choose>
- <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:stay-on-top='true'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </演:前端显示>
- </演:放映设置>
- </演:公用处理规则>
- <演:主体 uof:locID="p0034">
- <演:母版集 uof:locID="p0035">
- <xsl:apply-templates select="office:master-styles"/>
- </演:母版集>
- <演:幻灯片集 uof:locID="p0039">
- <xsl:apply-templates select="office:body/office:presentation/draw:page"/>
- </演:幻灯片集>
- </演:主体>
- </uof:演示文稿>
- </uof:UOF>
- </xsl:template>
+ <xsl:attribute name="演:名称">文本式样</xsl:attribute>
+ <xsl:element name="演:段落式样">
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:类型">auto</xsl:attribute>
+ <xsl:if test="@style:parent-style-name">
+ <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:别名"><xsl:value-of select="@style:class"/></xsl:attribute>
+ <xsl:call-template name="ParaAttribute">
+ <xsl:with-param name="text-style-name" select="@text:style-name"/>
+ </xsl:call-template>
+ <xsl:call-template name="字:句属性"/>
+ </xsl:element>
+ </演:文本式样>
+ </xsl:if>
+ </xsl:for-each>
+ </演:文本式样集>
+ </xsl:if>
+ <演:显示比例 uof:locID="p0020">
+ <xsl:variable name="VisibleAreaWidth">
+ <xsl:value-of select="/office:document/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry/config:config-item[@config:name='VisibleAreaWidth']"/>
+ </xsl:variable>
+ <xsl:value-of select="substring-before((13997 div $VisibleAreaWidth)*100,'.')"/>
+ </演:显示比例>
+ <演:放映设置 uof:locID="p0021">
+ <演:幻灯片序列 uof:locID="p0022" uof:attrList="标识符 名称 自定义">
+ <xsl:attribute name="演:标识符">customList</xsl:attribute>
+ <xsl:attribute name="演:名称">幻灯片序列</xsl:attribute>
+ <xsl:attribute name="演:自定义">true</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:start-page">
+ <xsl:variable name="start-page">
+ <xsl:value-of select="office:body/office:presentation/presentation:settings/@presentation:start-page"/>
+ </xsl:variable>
+ <xsl:variable name="before-slides">
+ <xsl:call-template name="幻灯片序列">
+ <xsl:with-param name="start-node" select="office:body/office:presentation/draw:page[@draw:name=$start-page]"/>
+ <xsl:with-param name="end-node" select="office:body/office:presentation/draw:page[last()]"/>
+ <xsl:with-param name="value"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="after-slides">
+ <xsl:for-each select="office:body/office:presentation/draw:page[@draw:name=$start-page]">
+ <xsl:call-template name="幻灯片序列">
+ <xsl:with-param name="start-node" select="/office:document/office:body/office:presentation/draw:page[1]"/>
+ <xsl:with-param name="end-node" select="preceding-sibling::node()[1]"/>
+ <xsl:with-param name="value"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:value-of select="concat($before-slides,' ',$after-slides)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="幻灯片序列">
+ <xsl:with-param name="start-node" select="office:body/office:presentation/draw:page[1]"/>
+ <xsl:with-param name="end-node" select="office:body/office:presentation/draw:page[last()]"/>
+ <xsl:with-param name="value"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </演:幻灯片序列>
+ <演:放映顺序 uof:locID="p0023" uof:attrList="名称 序列引用">
+ <xsl:attribute name="演:名称">放映顺序</xsl:attribute>
+ <xsl:attribute name="演:序列引用">customList</xsl:attribute>
+ </演:放映顺序>
+ <演:全屏放映 uof:locID="p0024">
+ <xsl:choose>
+ <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:full-screen='false'">false</xsl:when>
+ <xsl:otherwise>true</xsl:otherwise>
+ </xsl:choose>
+ </演:全屏放映>
+ <演:循环放映 uof:locID="p0025">
+ <xsl:choose>
+ <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:endless='true'">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </演:循环放映>
+ <xsl:if test="office:body/office:presentation/presentation:settings/@presentation:pause">
+ <演:放映间隔 uof:locID="p0026">
+ <xsl:variable name="hms">
+ <xsl:value-of select="substring-after(office:body/office:presentation/presentation:settings/@presentation:pause,'PT')"/>
+ </xsl:variable>
+ <xsl:value-of select="concat('P0Y0M0DT',$hms)"/>
+ </演:放映间隔>
+ </xsl:if>
+ <演:手动方式 uof:locID="p0027">
+ <xsl:choose>
+ <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:force-manual='true'">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </演:手动方式>
+ <演:导航帮助 uof:locID="p0029">
+ <xsl:choose>
+ <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:start-with-navigator='true'">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </演:导航帮助>
+ <演:放映动画 uof:locID="p0030">
+ <xsl:choose>
+ <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:animations='disabled'">false</xsl:when>
+ <xsl:otherwise>true</xsl:otherwise>
+ </xsl:choose>
+ </演:放映动画>
+ <演:前端显示 uof:locID="p0031">
+ <xsl:choose>
+ <xsl:when test="office:body/office:presentation/presentation:settings/@presentation:stay-on-top='true'">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </演:前端显示>
+ </演:放映设置>
+ </演:公用处理规则>
+ <演:主体 uof:locID="p0034">
+ <演:母版集 uof:locID="p0035">
+ <xsl:apply-templates select="office:master-styles"/>
+ </演:母版集>
+ <演:幻灯片集 uof:locID="p0039">
+ <xsl:apply-templates select="office:body/office:presentation/draw:page"/>
+ </演:幻灯片集>
+ </演:主体>
+ </uof:演示文稿>
+ </uof:UOF>
+ </xsl:template>
<xsl:template name="配色方案">
<xsl:variable name="page-name"><xsl:value-of select="@draw:style-name"/></xsl:variable>
- <演:配色方案 uof:locID="p0008" uof:attrList="标识符 名称 类型">
- <xsl:attribute name="演:标识符">
- <xsl:choose>
- <xsl:when test="@draw:name"><xsl:value-of select="@draw:name"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@draw:style-name"/></xsl:otherwise>
- </xsl:choose>
-
- </xsl:attribute>
- <xsl:for-each select="/office:document/office:automatic-styles/style:style[@style:name = $page-name]">
- <xsl:attribute name="演:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="演:类型"><xsl:choose><xsl:when test="not(contains(@style:name,'color'))">custom</xsl:when><xsl:otherwise>standard</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="style:drawing-page-properties/@draw:fill-color">
- <演:背景色 uof:locID="p0009">
- <xsl:value-of select="style:drawing-page-properties/@draw:fill-color"/>
- </演:背景色>
- </xsl:if>
- <xsl:if test="style:drawing-page-properties/@svg:stroke-color">
- <演:文本和线条 uof:locID="p0010">
- <xsl:value-of select="style:drawing-page-properties/@svg:stroke-color"/>
- </演:文本和线条>
- </xsl:if>
- <xsl:if test="style:drawing-page-properties/@draw:shadow-color">
- <演:阴影 uof:locID="p0011">
- <xsl:value-of select="style:drawing-page-properties/@draw:shadow-color"/>
- </演:阴影>
- </xsl:if>
- <xsl:if test="style:drawing-page-properties/@svg:stroke-color">
- <演:标题文本 uof:locID="p0012">
- <xsl:value-of select="style:drawing-page-properties/@svg:stroke-color"/>
- </演:标题文本>
- </xsl:if>
- <xsl:if test="style:drawing-page-properties/@draw:fill-color">
- <演:填充 uof:locID="p0013">
- <xsl:value-of select="style:drawing-page-properties/@draw:fill-color"/>
- </演:填充>
- </xsl:if>
- <演:强调 uof:locID="p0014">#FFFFFF</演:强调>
- <演:强调和超级链接 uof:locID="p0015">#FF0000</演:强调和超级链接>
- <演:强调和尾随超级链接 uof:locID="p0016">#FF00FF</演:强调和尾随超级链接>
- </xsl:for-each>
- </演:配色方案>
+ <演:配色方案 uof:locID="p0008" uof:attrList="标识符 名称 类型">
+ <xsl:attribute name="演:标识符">
+ <xsl:choose>
+ <xsl:when test="@draw:name"><xsl:value-of select="@draw:name"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="@draw:style-name"/></xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:attribute>
+ <xsl:for-each select="/office:document/office:automatic-styles/style:style[@style:name = $page-name]">
+ <xsl:attribute name="演:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="演:类型"><xsl:choose><xsl:when test="not(contains(@style:name,'color'))">custom</xsl:when><xsl:otherwise>standard</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="style:drawing-page-properties/@draw:fill-color">
+ <演:背景色 uof:locID="p0009">
+ <xsl:value-of select="style:drawing-page-properties/@draw:fill-color"/>
+ </演:背景色>
+ </xsl:if>
+ <xsl:if test="style:drawing-page-properties/@svg:stroke-color">
+ <演:文本和线条 uof:locID="p0010">
+ <xsl:value-of select="style:drawing-page-properties/@svg:stroke-color"/>
+ </演:文本和线条>
+ </xsl:if>
+ <xsl:if test="style:drawing-page-properties/@draw:shadow-color">
+ <演:阴影 uof:locID="p0011">
+ <xsl:value-of select="style:drawing-page-properties/@draw:shadow-color"/>
+ </演:阴影>
+ </xsl:if>
+ <xsl:if test="style:drawing-page-properties/@svg:stroke-color">
+ <演:标题文本 uof:locID="p0012">
+ <xsl:value-of select="style:drawing-page-properties/@svg:stroke-color"/>
+ </演:标题文本>
+ </xsl:if>
+ <xsl:if test="style:drawing-page-properties/@draw:fill-color">
+ <演:填充 uof:locID="p0013">
+ <xsl:value-of select="style:drawing-page-properties/@draw:fill-color"/>
+ </演:填充>
+ </xsl:if>
+ <演:强调 uof:locID="p0014">#FFFFFF</演:强调>
+ <演:强调和超级链接 uof:locID="p0015">#FF0000</演:强调和超级链接>
+ <演:强调和尾随超级链接 uof:locID="p0016">#FF00FF</演:强调和尾随超级链接>
+ </xsl:for-each>
+ </演:配色方案>
</xsl:template>
- <xsl:template name="幻灯片序列">
- <xsl:param name="start-node"/>
- <xsl:param name="end-node"/>
- <xsl:param name="value"/>
- <xsl:choose>
- <xsl:when test="not($start-node/@draw:name = $end-node/@draw:name)">
- <xsl:for-each select="$start-node">
- <xsl:variable name="value1">
- <xsl:value-of select="concat($value,@draw:name,'_',@draw:style-name,' ')"/>
- </xsl:variable>
- <xsl:call-template name="幻灯片序列">
- <xsl:with-param name="start-node" select="following-sibling::node()[1]"/>
- <xsl:with-param name="end-node" select="$end-node"/>
- <xsl:with-param name="value" select="$value1"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($value,$start-node/@draw:name)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="字:编号格式表示">
- <xsl:param name="bubianjibie"/>
- <xsl:param name="jibie"/>
- <xsl:param name="xianshijibie"/>
- <xsl:param name="biaoshi"/>
- <xsl:choose>
- <xsl:when test="number($xianshijibie)= 1">
- <xsl:value-of select="$biaoshi"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="num-prefix">
- <xsl:value-of select="preceding-sibling::*[number($bubianjibie -$jibie +1)]/@style:num-prefix"/>
- </xsl:variable>
- <xsl:variable name="num-suffix">
- <xsl:value-of select="preceding-sibling::*[number($bubianjibie -$jibie +1)]/@style:num-suffix"/>
- </xsl:variable>
- <xsl:call-template name="字:编号格式表示">
- <xsl:with-param name="bubianjibie" select="$bubianjibie"/>
- <xsl:with-param name="jibie" select="$jibie -1"/>
- <xsl:with-param name="xianshijibie" select="$xianshijibie -1"/>
- <xsl:with-param name="biaoshi" select="concat($num-prefix,'%',number($jibie -1),$num-suffix,'.',$biaoshi)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="字:句属性">
- <xsl:element name="字:字体">
- <xsl:attribute name="uof:locID">t0088</xsl:attribute>
- <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
- <xsl:if test=".//@fo:font-size or .//@style:font-size-asian or .//@style:font-size-complex">
- <xsl:choose>
- <xsl:when test="contains(.//@fo:font-size,'%') or contains(.//@style:font-size-asian,'%')">
- <xsl:attribute name="字:相对字号"><xsl:choose><xsl:when test=".//@fo:font-size"><xsl:value-of select="substring-before(.//@fo:font-size,'%')"/></xsl:when><xsl:when test=".//@style:font-size-asian"><xsl:value-of select="substring-before(.//@style:font-size-asian,'%')"/></xsl:when></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:字号"><xsl:choose><xsl:when test=".//@fo:font-size"><xsl:value-of select="substring-before(.//@fo:font-size,'pt')"/></xsl:when><xsl:when test=".//@style:font-size-asian"><xsl:value-of select="substring-before(.//@style:font-size-asian,'pt')"/></xsl:when><xsl:when test=".//@style:font-size-complex"><xsl:value-of select="substring-before(.//@style:font-size-complex,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test=".//@style:font-name">
- <xsl:attribute name="字:西文字体引用"><xsl:value-of select=".//@style:font-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test=".//@style:font-name-asian">
- <xsl:attribute name="字:中文字体引用"><xsl:value-of select=".//@style:font-name-asian"/></xsl:attribute>
- </xsl:if>
- <xsl:if test=".//@fo:color">
- <xsl:attribute name="字:颜色"><xsl:value-of select=".//@fo:color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:if test=".//@style:text-background-color and not(.//@style:text-background-color='transparent')">
- <xsl:element name="字:填充">
- <xsl:element name="图:图案">
- <xsl:attribute name="uof:locID">g0036</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 图形引用 前景色 背景色</xsl:attribute>
- <xsl:if test=".//@style:text-background-color">
- <xsl:attribute name="图:前景色"><xsl:value-of select=".//@style:text-background-color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:font-weight or .//@style:font-weight-asian">
- <xsl:element name="字:粗体">
- <xsl:attribute name="uof:locID">t0089</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:font-weight-asian='bold' or .//@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:font-style or .//@style:font-style-asian">
- <xsl:element name="字:斜体">
- <xsl:attribute name="uof:locID">t0090</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@fo:font-style='italic' or .//@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:text-crossing-out">
- <xsl:element name="字:删除线">
- <xsl:attribute name="uof:locID">t0094</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"><xsl:with-param name="lineType" select=".//@style:text-crossing-out"/></xsl:call-template></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:text-underline">
- <xsl:element name="字:下划线">
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"><xsl:with-param name="lineType" select=".//@style:text-underline"/></xsl:call-template></xsl:attribute>
- <xsl:attribute name="uof:locID">t0095</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:if test=".//@style:text-underline-color">
- <xsl:attribute name="字:颜色"><xsl:value-of select=".//@style:text-underline-color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:text-shadow and not(.//@fo:text-shadow='none')">
- <xsl:element name="字:阴影">
- <xsl:attribute name="uof:locID">t0100</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:text-emphasize">
- <xsl:element name="字:着重号">
- <xsl:attribute name="uof:locID">t0096</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 颜色 字着重号</xsl:attribute>
- <xsl:choose>
- <xsl:when test=".//@style:text-emphasize='none'">
- <xsl:attribute name="字:字着重号">false</xsl:attribute>
- <xsl:attribute name="字:类型">none</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:字着重号">true</xsl:attribute>
- <xsl:attribute name="字:类型">dot</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test=".//@fo:color">
- <xsl:attribute name="字:颜色"><xsl:value-of select=".//@fo:color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@text:display and not(.//@text:display='none')">
- <xsl:element name="字:隐藏文字">
- <xsl:attribute name="uof:locID">t0097</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:text-outline and not(.//@style:text-outline='none')">
- <xsl:element name="字:空心">
- <xsl:attribute name="uof:locID">t0098</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select=".//@style:text-outline"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:font-relief and not(.//@style:font-relief='none')">
- <xsl:element name="字:浮雕">
- <xsl:attribute name="uof:locID">t0099</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:choose><xsl:when test=".//@style:font-relief='embossed'">emboss</xsl:when><xsl:when test=".//@style:font-relief='engraved'">engrave</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:text-transform or .//@fo:font-variant">
- <xsl:element name="字:醒目字体">
- <xsl:attribute name="uof:locID">t0101</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:choose><xsl:when test=".//@fo:text-transform='uppercase'">uppercase</xsl:when><xsl:when test=".//@fo:text-transform='lowercase'">lowercase</xsl:when><xsl:when test=".//@fo:text-transform='capitalize'">capital</xsl:when><xsl:when test=".//@fo:font-variant='small-caps'">small-caps</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:text-position">
- <xsl:element name="字:位置">
- <xsl:attribute name="uof:locID">t0102</xsl:attribute>
- <xsl:value-of select=".//@style:text-position"/>
- </xsl:element>
- <字:上下标 uof:locID="t0205" uof:attrList="值">
- <xsl:attribute name="字:值">none</xsl:attribute>
- </字:上下标>
- </xsl:if>
- <xsl:if test=".//@style:text-scale">
- <xsl:element name="字:缩放">
- <xsl:attribute name="uof:locID">t0103</xsl:attribute>
- <xsl:value-of select=".//@style:text-scale"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:letter-spacing">
- <xsl:element name="字:字符间距">
- <xsl:attribute name="uof:locID">t0104</xsl:attribute>
- <xsl:value-of select=".//@fo:letter-spacing"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:letter-kerning">
- <xsl:element name="字:调整字间距">
- <xsl:attribute name="uof:locID">t015</xsl:attribute>
- <xsl:value-of select=".//@style:letter-kerning"/>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:字符对齐网格">
- <xsl:attribute name="字:值">false</xsl:attribute>
- <xsl:attribute name="uof:locID">t0106</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="style:presentation-page-layout" mode="pagestyle">
- <演:页面版式 uof:locID="p0018" uof:attrList="标识符 名称">
- <xsl:attribute name="演:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="演:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <演:布局 uof:locID="p0129" uof:attrList="类型">
- <xsl:attribute name="演:类型">
- <xsl:variable name="layout" select="substring-after(@style:name,'T')"/>
- <xsl:choose>
- <xsl:when test="$layout='0'">title-subtitle</xsl:when><xsl:when test="$layout='1'">title-body</xsl:when><xsl:when test="$layout='19'">title-only</xsl:when><xsl:when test="$layout='12'">column-2-rows</xsl:when><xsl:when test="$layout='15'">2-rows-column</xsl:when><xsl:when test="$layout='16'">2-columns-row</xsl:when><xsl:when test="$layout='17'">2-rows</xsl:when><xsl:when test="$layout='18'">4-objects</xsl:when><xsl:when test="$layout='27'">v-2-rows</xsl:when><xsl:when test="$layout='28'">v-title-body</xsl:when><xsl:when test="$layout='29'">big-object</xsl:when><xsl:when test="$layout='30'">2-columns</xsl:when>
- <xsl:otherwise>title-only</xsl:otherwise>
- </xsl:choose></xsl:attribute>
- </演:布局>
- <xsl:apply-templates select="presentation:placeholder" mode="anchor"/>
- </演:页面版式>
- </xsl:template>
- <xsl:template match="presentation:placeholder" mode="anchor">
- <演:占位符 uof:locID="p0130" uof:attrList="类型">
- <xsl:attribute name="演:类型"><xsl:choose><xsl:when test="@presentation:object = 'vertical_outline'">vertical_text</xsl:when><xsl:when test="@presentation:object = 'date-time'">date</xsl:when><xsl:when test="@presentation:object = 'page_number'">number</xsl:when><xsl:otherwise><xsl:value-of select="@presentation:object"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <uof:锚点 uof:locID="u0064" uof:attrList="x坐标 y坐标 宽度 高度 图形引用 随动方式 缩略图 占位符">
- <xsl:attribute name="uof:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(@svg:width,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:高度"><xsl:value-of select="substring-before(@svg:height,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:图形引用"><xsl:variable name="number"><xsl:value-of select="concat('_',count(preceding-sibling::presentation:placeholder))"/></xsl:variable><xsl:value-of select="concat(parent::style:presentation-page-layout/@style:name,$number)"/></xsl:attribute>
- </uof:锚点>
- </演:占位符>
- </xsl:template>
- <xsl:template match="presentation:placeholder" mode="graphic">
- <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象" 图:层次="3">
- <xsl:attribute name="图:标识符"><xsl:variable name="number"><xsl:value-of select="concat('_',count(preceding-sibling::presentation:placeholder))"/></xsl:variable><xsl:value-of select="concat(parent::style:presentation-page-layout/@style:name,$number)"/></xsl:attribute>
- </图:图形>
- </xsl:template>
- <xsl:template match="office:master-styles">
- <xsl:apply-templates select="style:handout-master"/>
- <xsl:apply-templates select="style:master-page"/>
- <xsl:if test="style:master-page/presentation:notes">
- <xsl:apply-templates select="style:master-page/presentation:notes"/>
- </xsl:if>
- </xsl:template>
- <xsl:template match="style:handout-master">
- <演:母版 uof:locID="p0036" uof:attrList="标识符 名称 类型 页面设置引用 配色方案引用 页面版式引用 文本式样引用" 演:名称="handout母版" 演:类型="handout">
- <xsl:attribute name="演:页面设置引用"><xsl:value-of select="@style:page-layout-name"/></xsl:attribute>
- <xsl:if test="@draw:style-name">
- <xsl:attribute name="演:配色方案引用"><xsl:value-of select="@draw:style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@presentation:presentation-page-layout-name">
- <xsl:attribute name="演:页面版式引用"><xsl:value-of select="@presentation:presentation-page-layout-name"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="产生锚点"/>
- </演:母版>
- </xsl:template>
- <xsl:template match="style:master-page">
- <演:母版 uof:locID="p0036" uof:attrList="标识符 名称 类型 页面设置引用 配色方案引用 页面版式引用 文本式样引用" 演:名称="slide母版" 演:类型="slide">
- <xsl:attribute name="演:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="演:页面设置引用"><xsl:value-of select="@style:page-layout-name"/></xsl:attribute>
- <xsl:if test="@draw:style-name">
- <xsl:attribute name="演:配色方案引用"><xsl:value-of select="@draw:style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@presentation:presentation-page-layout-name">
- <xsl:attribute name="演:页面版式引用"><xsl:value-of select="@presentation:presentation-page-layout-name"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="产生锚点"/>
- <xsl:variable name="stylename">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:variable>
- <xsl:variable name="name">
- <xsl:value-of select="name(.)"/>
- </xsl:variable>
- <xsl:for-each select="/office:document/*/style:style[@style:name=$stylename]/style:drawing-page-properties">
- <xsl:if test="@draw:fill and not(@draw:fill='none')">
- <演:背景 uof:locID="p0057">
- <xsl:call-template name="填充">
- <xsl:with-param name="picname" select="$stylename"/>
- <xsl:with-param name="nodename" select="$name"/>
- </xsl:call-template>
- </演:背景>
- </xsl:if>
- </xsl:for-each>
- </演:母版>
- </xsl:template>
- <xsl:template match="presentation:notes">
- <演:母版 uof:locID="p0036" uof:attrList="标识符 名称 类型 页面设置引用 配色方案引用 页面版式引用 文本式样引用" 演:名称="notes母版" 演:类型="notes">
- <xsl:attribute name="演:标识符"><xsl:value-of select="concat('note-',parent::style:master-page/@style:name)"/></xsl:attribute>
- <xsl:attribute name="演:页面设置引用"><xsl:value-of select="@style:page-layout-name"/></xsl:attribute>
- <xsl:if test="@draw:style-name">
- <xsl:attribute name="演:配色方案引用"><xsl:value-of select="@draw:style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@presentation:presentation-page-layout-name">
- <xsl:attribute name="演:页面版式引用"><xsl:value-of select="@presentation:presentation-page-layout-name"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="产生锚点"/>
- </演:母版>
- </xsl:template>
- <xsl:template match="draw:page">
- <演:幻灯片 uof:locID="p0040" uof:attrList="名称 标识符 母版引用 配色方案引用 页面版式引用 显示 显示背景 显示背景对象">
- <xsl:attribute name="演:标识符"><xsl:value-of select="concat(@draw:name,'_',@draw:style-name)"/></xsl:attribute>
- <xsl:attribute name="演:名称"><xsl:value-of select="@draw:name"/></xsl:attribute>
- <xsl:attribute name="演:母版引用"><xsl:value-of select="@draw:master-page-name"/></xsl:attribute>
- <xsl:if test="@presentation:presentation-page-layout-name">
- <xsl:attribute name="演:页面版式引用"><xsl:value-of select="@presentation:presentation-page-layout-name"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="产生锚点"/>
- <xsl:apply-templates select="presentation:notes" mode="page"/>
- <xsl:variable name="stylename">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:variable>
- <xsl:variable name="name">
- <xsl:value-of select="name(.)"/>
- </xsl:variable>
- <xsl:for-each select="/office:document/*/style:style[@style:name=$stylename]/style:drawing-page-properties">
- <xsl:if test="@draw:fill and not(@draw:fill='none')">
- <演:背景 uof:locID="p0057">
- <xsl:call-template name="填充">
- <xsl:with-param name="picname" select="$stylename"/>
- <xsl:with-param name="nodename" select="$name"/>
- </xsl:call-template>
- </演:背景>
- </xsl:if>
- </xsl:for-each>
- <演:切换 uof:locID="p0058" uof:attrList="效果 速度">
- <xsl:for-each select="key('graphicset',$stylename)/style:drawing-page-properties">
- <xsl:attribute name="演:速度"><xsl:choose><xsl:when test="@presentation:transition-speed='slow'">slow</xsl:when><xsl:otherwise>fast</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="演:效果"><xsl:variable name="type"><xsl:value-of select="@smil:type"/></xsl:variable><xsl:variable name="subtype"><xsl:value-of select="@smil:subtype"/></xsl:variable><xsl:choose><xsl:when test="$type='irisWipe' and $subtype='rectangle' and @smil:direction='reverse'">box in</xsl:when><xsl:when test="$type='irisWipe' and $subtype='rectangle'">box out</xsl:when><xsl:when test="$type='checkerBoardWipe' and $subtype='across'">checkerboard across</xsl:when><xsl:when test="$type='checkerBoardWipe' and $subtype='down'">checkerboard down</xsl:when><xsl:when test="$type='pushWipe' and $subtype='combHorizontal'">comb horizontal</xsl:when><xsl:when test="$type='pushWipe' and $subtype='combVertical'">comb vertical</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTop' and @smil:direction='reverse'">uncover down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromRight' and @smil:direction='reverse'">uncover left</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromLeft' and @smil:direction='reverse'">uncover right</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottom' and @smil:direction='reverse'">uncover up</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTopRight' and @smil:direction='reverse'">uncover left-down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottomRight' and @smil:direction='reverse'">uncover left-up</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTopLeft' and @smil:direction='reverse'">uncover right-down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottomLeft' and @smil:direction='reverse'">uncover right-up</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTop'">cover down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromRight'">cover left</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromLeft'">cover right</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottom'">cover up</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTopRight'">cover left-down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottomRight'">cover left-up</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTopLeft'">cover right-down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottomLeft'">cover right-up</xsl:when><xsl:when test="$type='fade' and $subtype='fadeOverColor'">fade through black</xsl:when><xsl:when test="$type='pushWipe' and $subtype='fromTop'">push down</xsl:when><xsl:when test="$type='pushWipe' and $subtype='fromRight'">push left</xsl:when><xsl:when test="$type='pushWipe' and $subtype='fromLeft'">push right</xsl:when><xsl:when test="$type='pushWipe' and $subtype='fromBottom'">push up</xsl:when><xsl:when test="$type='randomBarWipe' and $subtype='horizontal'">random bars horizontal</xsl:when><xsl:when test="$type='randomBarWipe' and $subtype='vertical'">random bars vertical</xsl:when><xsl:when test="$type='ellipseWipe' and $subtype='circle'">shape circle</xsl:when><xsl:when test="$type='irisWipe' and $subtype='diamond'">shape diamond</xsl:when><xsl:when test="$type='fourBoxWipe' and $subtype='cornersOut'">shape plus</xsl:when><xsl:when test="$type='barnDoorWipe' and $subtype='horizontal' and @smil:direction='reverse'">split horizontal in</xsl:when><xsl:when test="$type='barnDoorWipe' and $subtype='horizontal'">split horizontal out</xsl:when><xsl:when test="$type='barnDoorWipe' and $subtype='vertical' and @smil:direction='reverse'">split vertical in</xsl:when><xsl:when test="$type='barnDoorWipe' and $subtype='vertical'">split vertical out</xsl:when><xsl:when test="$type='fanWipe' and $subtype='centerTop'">wedge</xsl:when><xsl:when test="$type='pinWheelWipe' and $subtype='oneBlade'">wheel clockwise – 1 spoke</xsl:when><xsl:when test="$type='pinWheelWipe' and $subtype='twoBladeVertical'">wheel clockwise – 2 spoke</xsl:when><xsl:when test="$type='pinWheelWipe' and $subtype='threeBlade'">wheel clockwise – 3 spoke</xsl:when><xsl:when test="$type='pinWheelWipe' and $subtype='fourBlade'">wheel clockwise – 4 spoke</xsl:when><xsl:when test="$type='pinWheelWipe' and $subtype='eightBlade'">wheel clockwise – 8 spoke</xsl:when><xsl:when test="$type='barWipe' and $subtype='leftToRight' and @smil:direction='reverse'">wipe left</xsl:when><xsl:when test="$type='barWipe' and $subtype='leftToRight'">wipe right</xsl:when><xsl:when test="$type='barWipe' and $subtype='topToBottom' and @smil:direction='reverse'">wipe up</xsl:when><xsl:when test="$type='barWipe' and $subtype='topToBottom'">wipe down</xsl:when><xsl:when test="$type='blindsWipe' and $subtype='vertical'">blinds vertical</xsl:when><xsl:when test="$type='blindsWipe' and $subtype='horizontal'">blinds horizontal</xsl:when><xsl:when test="$type='dissolve'">dissolve</xsl:when><xsl:when test="$type='random'">random transition</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <演:声音 uof:locID="p0061" uof:attrList="预定义声音 自定义声音">
- <xsl:choose>
- <xsl:when test="not(presentation:sound)">
- <xsl:attribute name="演:预定义声音">none</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="lujing">
- <xsl:value-of select="substring-after(presentation:sound/@xlink:href,'share/gallery/sounds/')"/>
- </xsl:variable>
- <xsl:variable name="ming">
- <xsl:value-of select="substring-before($lujing,'.wav')"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$ming='applause'">
- <xsl:attribute name="演:预定义声音">applause</xsl:attribute>
- </xsl:when>
- <xsl:when test="$ming='explos'">
- <xsl:attribute name="演:预定义声音">explosion</xsl:attribute>
- </xsl:when>
- <xsl:when test="$ming='laser'">
- <xsl:attribute name="演:预定义声音">laser</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="演:自定义声音"><xsl:value-of select="presentation:sound/@xlink:href"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </演:声音>
- <演:方式 uof:locID="p0062">
- <演:单击鼠标 uof:locID="p0065">
- <xsl:choose>
- <xsl:when test="@presentation:transition-type='automatic'">false</xsl:when>
- <xsl:otherwise>true</xsl:otherwise>
- </xsl:choose>
- </演:单击鼠标>
- <xsl:if test="@presentation:duration">
- <演:时间间隔 uof:locID="p0066">
- <xsl:variable name="hms">
- <xsl:value-of select="substring-after(@presentation:duration,'PT')"/>
- </xsl:variable>
- <xsl:variable name="h">
- <xsl:value-of select="number(substring-before($hms,'H'))"/>
- </xsl:variable>
- <xsl:variable name="ms">
- <xsl:value-of select="substring-after($hms,'H')"/>
- </xsl:variable>
- <xsl:variable name="m">
- <xsl:value-of select="number(substring-before($ms,'M'))"/>
- </xsl:variable>
- <xsl:variable name="s">
- <xsl:value-of select="number(substring-before(substring-after($ms,'M'),'S'))"/>
- </xsl:variable>
- <xsl:value-of select="$h *3600 + $m * 60 + $s"/>
- </演:时间间隔>
- </xsl:if>
- </演:方式>
- </xsl:for-each>
- </演:切换>
- </演:幻灯片>
- </xsl:template>
- <xsl:template match="presentation:notes" mode="page">
- <演:幻灯片备注 uof:locID="p0054" uof:attrList="备注母版引用">
- <xsl:attribute name="演:备注母版引用"><xsl:variable name="cute"><xsl:value-of select="parent::node()/@draw:master-page-name"/></xsl:variable><xsl:value-of select="concat('note-',$cute)"/></xsl:attribute>
- <xsl:call-template name="产生锚点"/>
- <演:背景 uof:locID="p0057">
- <图:颜色 uof:locID="g0034">#ffffff</图:颜色>
- </演:背景>
- </演:幻灯片备注>
- </xsl:template>
- <xsl:template name="产生锚点">
- <xsl:for-each select="child::node( )">
- <xsl:choose>
- <xsl:when test="substring-before(name(),':')='draw'">
- <uof:锚点 uof:locID="u0064" uof:attrList="x坐标 y坐标 宽度 高度 图形引用 随动方式 缩略图 占位符">
- <xsl:variable name="nodename">
- <xsl:value-of select="name(.)"/>
- </xsl:variable>
- <xsl:variable name="refpicname">
- <xsl:choose>
- <xsl:when test="@draw:style-name">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@presentation:style-name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="picnumber">
- <xsl:choose>
- <xsl:when test="@draw:style-name">
- <xsl:value-of select="count(preceding::*[@draw:style-name=$refpicname])"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="count(preceding::*[@presentation:style-name=$refpicname])"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="uof:x坐标"><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="@svg:x"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x1,$uofUnit)"/></xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:y坐标"><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="@svg:y"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:when><xsl:when test="@svg:y1"><xsl:value-of select="substring-before(@svg:y1,$uofUnit)"/></xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:choose><xsl:when test="@svg:width"><xsl:value-of select="substring-before(@svg:width,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/></xsl:when><xsl:when test="name(.)='draw:g'"><xsl:variable name="minx"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:variable name="svgx"><xsl:value-of select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="number(substring-before(descendant::node()[@svg:x][1]/@svg:width,$uofUnit))"/></xsl:variable><xsl:variable name="maxx"><xsl:call-template name="groupmaxx"><xsl:with-param name="value" select="$svgx + $width"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$maxx - $minx"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:高度"><xsl:choose><xsl:when test="@svg:height"><xsl:value-of select="substring-before(@svg:height,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/></xsl:when><xsl:when test="name(.)='draw:g'"><xsl:variable name="miny"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:variable name="svgy"><xsl:value-of select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/></xsl:variable><xsl:variable name="height"><xsl:value-of select="number(substring-before(descendant::node()[@svg:y][1]/@svg:height,$uofUnit))"/></xsl:variable><xsl:variable name="maxy"><xsl:call-template name="groupmaxy"><xsl:with-param name="value" select="$svgy + $height"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$maxy - $miny"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:图形引用"><xsl:choose><xsl:when test="@draw:id"><xsl:value-of select="@draw:id"/></xsl:when><xsl:when test="not(@draw:style-name) and name()='draw:g'"><xsl:value-of select="concat(child::node()[1]/@draw:style-name,'_',$picnumber)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($refpicname,'_',$picnumber)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:随动方式"><xsl:choose><xsl:when test="key('graphicset',$refpicname)/node()/@style:protect"><xsl:for-each select="key('graphicset',$refpicname)/node()"><xsl:choose><xsl:when test="@style:protect='size'">move</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:for-each></xsl:when><xsl:otherwise>movesize</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="name(.)='draw:page-thumbnail'">
- <xsl:attribute name="uof:缩略图">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="not(name(parent::node())='style:handout-master')">
- <xsl:attribute name="uof:占位符"><xsl:choose><xsl:when test="@presentation:object"><xsl:value-of select="@presentation:object"/></xsl:when><xsl:when test=".//draw:image">graphic</xsl:when></xsl:choose></xsl:attribute>
- <xsl:if test="@presentation:class">
- <xsl:attribute name="uof:占位符"><xsl:value-of select="@presentation:class"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- </uof:锚点>
- </xsl:when>
- <xsl:when test="name()= 'anim:par'">
- <演:动画 uof:locID="p0042">
- <xsl:apply-templates select="anim:seq"/>
- </演:动画>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="anim:seq">
- <xsl:apply-templates select="anim:par/anim:par/anim:par"/>
- <xsl:apply-templates select="anim:par/anim:par/anim:iterate"/>
- </xsl:template>
- <xsl:template match="anim:par | anim:iterate">
- <演:序列 uof:locID="p0043" uof:attrList="段落引用 动画对象">
- <xsl:attribute name="演:动画对象"><xsl:choose>
- <xsl:when test=".//@smil:targetElement"><xsl:value-of select=".//@smil:targetElement"/></xsl:when><xsl:when test="@anim:id"><xsl:value-of select="@anim:id"/></xsl:when><xsl:otherwise><xsl:value-of select="../@smil:targetElement"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:template name="幻灯片序列">
+ <xsl:param name="start-node"/>
+ <xsl:param name="end-node"/>
+ <xsl:param name="value"/>
+ <xsl:choose>
+ <xsl:when test="not($start-node/@draw:name = $end-node/@draw:name)">
+ <xsl:for-each select="$start-node">
+ <xsl:variable name="value1">
+ <xsl:value-of select="concat($value,@draw:name,'_',@draw:style-name,' ')"/>
+ </xsl:variable>
+ <xsl:call-template name="幻灯片序列">
+ <xsl:with-param name="start-node" select="following-sibling::node()[1]"/>
+ <xsl:with-param name="end-node" select="$end-node"/>
+ <xsl:with-param name="value" select="$value1"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($value,$start-node/@draw:name)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="字:编号格式表示">
+ <xsl:param name="bubianjibie"/>
+ <xsl:param name="jibie"/>
+ <xsl:param name="xianshijibie"/>
+ <xsl:param name="biaoshi"/>
+ <xsl:choose>
+ <xsl:when test="number($xianshijibie)= 1">
+ <xsl:value-of select="$biaoshi"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="num-prefix">
+ <xsl:value-of select="preceding-sibling::*[number($bubianjibie -$jibie +1)]/@style:num-prefix"/>
+ </xsl:variable>
+ <xsl:variable name="num-suffix">
+ <xsl:value-of select="preceding-sibling::*[number($bubianjibie -$jibie +1)]/@style:num-suffix"/>
+ </xsl:variable>
+ <xsl:call-template name="字:编号格式表示">
+ <xsl:with-param name="bubianjibie" select="$bubianjibie"/>
+ <xsl:with-param name="jibie" select="$jibie -1"/>
+ <xsl:with-param name="xianshijibie" select="$xianshijibie -1"/>
+ <xsl:with-param name="biaoshi" select="concat($num-prefix,'%',number($jibie -1),$num-suffix,'.',$biaoshi)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="字:句属性">
+ <xsl:element name="字:字体">
+ <xsl:attribute name="uof:locID">t0088</xsl:attribute>
+ <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
+ <xsl:if test=".//@fo:font-size or .//@style:font-size-asian or .//@style:font-size-complex">
+ <xsl:choose>
+ <xsl:when test="contains(.//@fo:font-size,'%') or contains(.//@style:font-size-asian,'%')">
+ <xsl:attribute name="字:相对字号"><xsl:choose><xsl:when test=".//@fo:font-size"><xsl:value-of select="substring-before(.//@fo:font-size,'%')"/></xsl:when><xsl:when test=".//@style:font-size-asian"><xsl:value-of select="substring-before(.//@style:font-size-asian,'%')"/></xsl:when></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:字号"><xsl:choose><xsl:when test=".//@fo:font-size"><xsl:value-of select="substring-before(.//@fo:font-size,'pt')"/></xsl:when><xsl:when test=".//@style:font-size-asian"><xsl:value-of select="substring-before(.//@style:font-size-asian,'pt')"/></xsl:when><xsl:when test=".//@style:font-size-complex"><xsl:value-of select="substring-before(.//@style:font-size-complex,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test=".//@style:font-name">
+ <xsl:attribute name="字:西文字体引用"><xsl:value-of select=".//@style:font-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test=".//@style:font-name-asian">
+ <xsl:attribute name="字:中文字体引用"><xsl:value-of select=".//@style:font-name-asian"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test=".//@fo:color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select=".//@fo:color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test=".//@style:text-background-color and not(.//@style:text-background-color='transparent')">
+ <xsl:element name="字:填充">
+ <xsl:element name="图:图案">
+ <xsl:attribute name="uof:locID">g0036</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 图形引用 前景色 背景色</xsl:attribute>
+ <xsl:if test=".//@style:text-background-color">
+ <xsl:attribute name="图:前景色"><xsl:value-of select=".//@style:text-background-color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:font-weight or .//@style:font-weight-asian">
+ <xsl:element name="字:粗体">
+ <xsl:attribute name="uof:locID">t0089</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:font-weight-asian='bold' or .//@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:font-style or .//@style:font-style-asian">
+ <xsl:element name="字:斜体">
+ <xsl:attribute name="uof:locID">t0090</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@fo:font-style='italic' or .//@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:text-crossing-out">
+ <xsl:element name="字:删除线">
+ <xsl:attribute name="uof:locID">t0094</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"><xsl:with-param name="lineType" select=".//@style:text-crossing-out"/></xsl:call-template></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:text-underline">
+ <xsl:element name="字:下划线">
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"><xsl:with-param name="lineType" select=".//@style:text-underline"/></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0095</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:if test=".//@style:text-underline-color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select=".//@style:text-underline-color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:text-shadow and not(.//@fo:text-shadow='none')">
+ <xsl:element name="字:阴影">
+ <xsl:attribute name="uof:locID">t0100</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:text-emphasize">
+ <xsl:element name="字:着重号">
+ <xsl:attribute name="uof:locID">t0096</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 颜色 字着重号</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test=".//@style:text-emphasize='none'">
+ <xsl:attribute name="字:字着重号">false</xsl:attribute>
+ <xsl:attribute name="字:类型">none</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:字着重号">true</xsl:attribute>
+ <xsl:attribute name="字:类型">dot</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test=".//@fo:color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select=".//@fo:color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@text:display and not(.//@text:display='none')">
+ <xsl:element name="字:隐藏文字">
+ <xsl:attribute name="uof:locID">t0097</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:text-outline and not(.//@style:text-outline='none')">
+ <xsl:element name="字:空心">
+ <xsl:attribute name="uof:locID">t0098</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select=".//@style:text-outline"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:font-relief and not(.//@style:font-relief='none')">
+ <xsl:element name="字:浮雕">
+ <xsl:attribute name="uof:locID">t0099</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:choose><xsl:when test=".//@style:font-relief='embossed'">emboss</xsl:when><xsl:when test=".//@style:font-relief='engraved'">engrave</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:text-transform or .//@fo:font-variant">
+ <xsl:element name="字:醒目字体">
+ <xsl:attribute name="uof:locID">t0101</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:choose><xsl:when test=".//@fo:text-transform='uppercase'">uppercase</xsl:when><xsl:when test=".//@fo:text-transform='lowercase'">lowercase</xsl:when><xsl:when test=".//@fo:text-transform='capitalize'">capital</xsl:when><xsl:when test=".//@fo:font-variant='small-caps'">small-caps</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:text-position">
+ <xsl:element name="字:位置">
+ <xsl:attribute name="uof:locID">t0102</xsl:attribute>
+ <xsl:value-of select=".//@style:text-position"/>
+ </xsl:element>
+ <字:上下标 uof:locID="t0205" uof:attrList="值">
+ <xsl:attribute name="字:值">none</xsl:attribute>
+ </字:上下标>
+ </xsl:if>
+ <xsl:if test=".//@style:text-scale">
+ <xsl:element name="字:缩放">
+ <xsl:attribute name="uof:locID">t0103</xsl:attribute>
+ <xsl:value-of select=".//@style:text-scale"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:letter-spacing">
+ <xsl:element name="字:字符间距">
+ <xsl:attribute name="uof:locID">t0104</xsl:attribute>
+ <xsl:value-of select=".//@fo:letter-spacing"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:letter-kerning">
+ <xsl:element name="字:调整字间距">
+ <xsl:attribute name="uof:locID">t015</xsl:attribute>
+ <xsl:value-of select=".//@style:letter-kerning"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:字符对齐网格">
+ <xsl:attribute name="字:值">false</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0106</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="style:presentation-page-layout" mode="pagestyle">
+ <演:页面版式 uof:locID="p0018" uof:attrList="标识符 名称">
+ <xsl:attribute name="演:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="演:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <演:布局 uof:locID="p0129" uof:attrList="类型">
+ <xsl:attribute name="演:类型">
+ <xsl:variable name="layout" select="substring-after(@style:name,'T')"/>
+ <xsl:choose>
+ <xsl:when test="$layout='0'">title-subtitle</xsl:when><xsl:when test="$layout='1'">title-body</xsl:when><xsl:when test="$layout='19'">title-only</xsl:when><xsl:when test="$layout='12'">column-2-rows</xsl:when><xsl:when test="$layout='15'">2-rows-column</xsl:when><xsl:when test="$layout='16'">2-columns-row</xsl:when><xsl:when test="$layout='17'">2-rows</xsl:when><xsl:when test="$layout='18'">4-objects</xsl:when><xsl:when test="$layout='27'">v-2-rows</xsl:when><xsl:when test="$layout='28'">v-title-body</xsl:when><xsl:when test="$layout='29'">big-object</xsl:when><xsl:when test="$layout='30'">2-columns</xsl:when>
+ <xsl:otherwise>title-only</xsl:otherwise>
+ </xsl:choose></xsl:attribute>
+ </演:布局>
+ <xsl:apply-templates select="presentation:placeholder" mode="anchor"/>
+ </演:页面版式>
+ </xsl:template>
+ <xsl:template match="presentation:placeholder" mode="anchor">
+ <演:占位符 uof:locID="p0130" uof:attrList="类型">
+ <xsl:attribute name="演:类型"><xsl:choose><xsl:when test="@presentation:object = 'vertical_outline'">vertical_text</xsl:when><xsl:when test="@presentation:object = 'date-time'">date</xsl:when><xsl:when test="@presentation:object = 'page_number'">number</xsl:when><xsl:otherwise><xsl:value-of select="@presentation:object"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <uof:锚点 uof:locID="u0064" uof:attrList="x坐标 y坐标 宽度 高度 图形引用 随动方式 缩略图 占位符">
+ <xsl:attribute name="uof:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(@svg:width,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:高度"><xsl:value-of select="substring-before(@svg:height,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:图形引用"><xsl:variable name="number"><xsl:value-of select="concat('_',count(preceding-sibling::presentation:placeholder))"/></xsl:variable><xsl:value-of select="concat(parent::style:presentation-page-layout/@style:name,$number)"/></xsl:attribute>
+ </uof:锚点>
+ </演:占位符>
+ </xsl:template>
+ <xsl:template match="presentation:placeholder" mode="graphic">
+ <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象" 图:层次="3">
+ <xsl:attribute name="图:标识符"><xsl:variable name="number"><xsl:value-of select="concat('_',count(preceding-sibling::presentation:placeholder))"/></xsl:variable><xsl:value-of select="concat(parent::style:presentation-page-layout/@style:name,$number)"/></xsl:attribute>
+ </图:图形>
+ </xsl:template>
+ <xsl:template match="office:master-styles">
+ <xsl:apply-templates select="style:handout-master"/>
+ <xsl:apply-templates select="style:master-page"/>
+ <xsl:if test="style:master-page/presentation:notes">
+ <xsl:apply-templates select="style:master-page/presentation:notes"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="style:handout-master">
+ <演:母版 uof:locID="p0036" uof:attrList="标识符 名称 类型 页面设置引用 配色方案引用 页面版式引用 文本式样引用" 演:名称="handout母版" 演:类型="handout">
+ <xsl:attribute name="演:页面设置引用"><xsl:value-of select="@style:page-layout-name"/></xsl:attribute>
+ <xsl:if test="@draw:style-name">
+ <xsl:attribute name="演:配色方案引用"><xsl:value-of select="@draw:style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@presentation:presentation-page-layout-name">
+ <xsl:attribute name="演:页面版式引用"><xsl:value-of select="@presentation:presentation-page-layout-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="产生锚点"/>
+ </演:母版>
+ </xsl:template>
+ <xsl:template match="style:master-page">
+ <演:母版 uof:locID="p0036" uof:attrList="标识符 名称 类型 页面设置引用 配色方案引用 页面版式引用 文本式样引用" 演:名称="slide母版" 演:类型="slide">
+ <xsl:attribute name="演:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="演:页面设置引用"><xsl:value-of select="@style:page-layout-name"/></xsl:attribute>
+ <xsl:if test="@draw:style-name">
+ <xsl:attribute name="演:配色方案引用"><xsl:value-of select="@draw:style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@presentation:presentation-page-layout-name">
+ <xsl:attribute name="演:页面版式引用"><xsl:value-of select="@presentation:presentation-page-layout-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="产生锚点"/>
+ <xsl:variable name="stylename">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="name">
+ <xsl:value-of select="name(.)"/>
+ </xsl:variable>
+ <xsl:for-each select="/office:document/*/style:style[@style:name=$stylename]/style:drawing-page-properties">
+ <xsl:if test="@draw:fill and not(@draw:fill='none')">
+ <演:背景 uof:locID="p0057">
+ <xsl:call-template name="填充">
+ <xsl:with-param name="picname" select="$stylename"/>
+ <xsl:with-param name="nodename" select="$name"/>
+ </xsl:call-template>
+ </演:背景>
+ </xsl:if>
+ </xsl:for-each>
+ </演:母版>
+ </xsl:template>
+ <xsl:template match="presentation:notes">
+ <演:母版 uof:locID="p0036" uof:attrList="标识符 名称 类型 页面设置引用 配色方案引用 页面版式引用 文本式样引用" 演:名称="notes母版" 演:类型="notes">
+ <xsl:attribute name="演:标识符"><xsl:value-of select="concat('note-',parent::style:master-page/@style:name)"/></xsl:attribute>
+ <xsl:attribute name="演:页面设置引用"><xsl:value-of select="@style:page-layout-name"/></xsl:attribute>
+ <xsl:if test="@draw:style-name">
+ <xsl:attribute name="演:配色方案引用"><xsl:value-of select="@draw:style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@presentation:presentation-page-layout-name">
+ <xsl:attribute name="演:页面版式引用"><xsl:value-of select="@presentation:presentation-page-layout-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="产生锚点"/>
+ </演:母版>
+ </xsl:template>
+ <xsl:template match="draw:page">
+ <演:幻灯片 uof:locID="p0040" uof:attrList="名称 标识符 母版引用 配色方案引用 页面版式引用 显示 显示背景 显示背景对象">
+ <xsl:attribute name="演:标识符"><xsl:value-of select="concat(@draw:name,'_',@draw:style-name)"/></xsl:attribute>
+ <xsl:attribute name="演:名称"><xsl:value-of select="@draw:name"/></xsl:attribute>
+ <xsl:attribute name="演:母版引用"><xsl:value-of select="@draw:master-page-name"/></xsl:attribute>
+ <xsl:if test="@presentation:presentation-page-layout-name">
+ <xsl:attribute name="演:页面版式引用"><xsl:value-of select="@presentation:presentation-page-layout-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="产生锚点"/>
+ <xsl:apply-templates select="presentation:notes" mode="page"/>
+ <xsl:variable name="stylename">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="name">
+ <xsl:value-of select="name(.)"/>
+ </xsl:variable>
+ <xsl:for-each select="/office:document/*/style:style[@style:name=$stylename]/style:drawing-page-properties">
+ <xsl:if test="@draw:fill and not(@draw:fill='none')">
+ <演:背景 uof:locID="p0057">
+ <xsl:call-template name="填充">
+ <xsl:with-param name="picname" select="$stylename"/>
+ <xsl:with-param name="nodename" select="$name"/>
+ </xsl:call-template>
+ </演:背景>
+ </xsl:if>
+ </xsl:for-each>
+ <演:切换 uof:locID="p0058" uof:attrList="效果 速度">
+ <xsl:for-each select="key('graphicset',$stylename)/style:drawing-page-properties">
+ <xsl:attribute name="演:速度"><xsl:choose><xsl:when test="@presentation:transition-speed='slow'">slow</xsl:when><xsl:otherwise>fast</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="演:效果"><xsl:variable name="type"><xsl:value-of select="@smil:type"/></xsl:variable><xsl:variable name="subtype"><xsl:value-of select="@smil:subtype"/></xsl:variable><xsl:choose><xsl:when test="$type='irisWipe' and $subtype='rectangle' and @smil:direction='reverse'">box in</xsl:when><xsl:when test="$type='irisWipe' and $subtype='rectangle'">box out</xsl:when><xsl:when test="$type='checkerBoardWipe' and $subtype='across'">checkerboard across</xsl:when><xsl:when test="$type='checkerBoardWipe' and $subtype='down'">checkerboard down</xsl:when><xsl:when test="$type='pushWipe' and $subtype='combHorizontal'">comb horizontal</xsl:when><xsl:when test="$type='pushWipe' and $subtype='combVertical'">comb vertical</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTop' and @smil:direction='reverse'">uncover down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromRight' and @smil:direction='reverse'">uncover left</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromLeft' and @smil:direction='reverse'">uncover right</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottom' and @smil:direction='reverse'">uncover up</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTopRight' and @smil:direction='reverse'">uncover left-down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottomRight' and @smil:direction='reverse'">uncover left-up</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTopLeft' and @smil:direction='reverse'">uncover right-down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottomLeft' and @smil:direction='reverse'">uncover right-up</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTop'">cover down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromRight'">cover left</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromLeft'">cover right</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottom'">cover up</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTopRight'">cover left-down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottomRight'">cover left-up</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromTopLeft'">cover right-down</xsl:when><xsl:when test="$type='slideWipe' and $subtype='fromBottomLeft'">cover right-up</xsl:when><xsl:when test="$type='fade' and $subtype='fadeOverColor'">fade through black</xsl:when><xsl:when test="$type='pushWipe' and $subtype='fromTop'">push down</xsl:when><xsl:when test="$type='pushWipe' and $subtype='fromRight'">push left</xsl:when><xsl:when test="$type='pushWipe' and $subtype='fromLeft'">push right</xsl:when><xsl:when test="$type='pushWipe' and $subtype='fromBottom'">push up</xsl:when><xsl:when test="$type='randomBarWipe' and $subtype='horizontal'">random bars horizontal</xsl:when><xsl:when test="$type='randomBarWipe' and $subtype='vertical'">random bars vertical</xsl:when><xsl:when test="$type='ellipseWipe' and $subtype='circle'">shape circle</xsl:when><xsl:when test="$type='irisWipe' and $subtype='diamond'">shape diamond</xsl:when><xsl:when test="$type='fourBoxWipe' and $subtype='cornersOut'">shape plus</xsl:when><xsl:when test="$type='barnDoorWipe' and $subtype='horizontal' and @smil:direction='reverse'">split horizontal in</xsl:when><xsl:when test="$type='barnDoorWipe' and $subtype='horizontal'">split horizontal out</xsl:when><xsl:when test="$type='barnDoorWipe' and $subtype='vertical' and @smil:direction='reverse'">split vertical in</xsl:when><xsl:when test="$type='barnDoorWipe' and $subtype='vertical'">split vertical out</xsl:when><xsl:when test="$type='fanWipe' and $subtype='centerTop'">wedge</xsl:when><xsl:when test="$type='pinWheelWipe' and $subtype='oneBlade'">wheel clockwise – 1 spoke</xsl:when><xsl:when test="$type='pinWheelWipe' and $subtype='twoBladeVertical'">wheel clockwise – 2 spoke</xsl:when><xsl:when test="$type='pinWheelWipe' and $subtype='threeBlade'">wheel clockwise – 3 spoke</xsl:when><xsl:when test="$type='pinWheelWipe' and $subtype='fourBlade'">wheel clockwise – 4 spoke</xsl:when><xsl:when test="$type='pinWheelWipe' and $subtype='eightBlade'">wheel clockwise – 8 spoke</xsl:when><xsl:when test="$type='barWipe' and $subtype='leftToRight' and @smil:direction='reverse'">wipe left</xsl:when><xsl:when test="$type='barWipe' and $subtype='leftToRight'">wipe right</xsl:when><xsl:when test="$type='barWipe' and $subtype='topToBottom' and @smil:direction='reverse'">wipe up</xsl:when><xsl:when test="$type='barWipe' and $subtype='topToBottom'">wipe down</xsl:when><xsl:when test="$type='blindsWipe' and $subtype='vertical'">blinds vertical</xsl:when><xsl:when test="$type='blindsWipe' and $subtype='horizontal'">blinds horizontal</xsl:when><xsl:when test="$type='dissolve'">dissolve</xsl:when><xsl:when test="$type='random'">random transition</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <演:声音 uof:locID="p0061" uof:attrList="预定义声音 自定义声音">
+ <xsl:choose>
+ <xsl:when test="not(presentation:sound)">
+ <xsl:attribute name="演:预定义声音">none</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="lujing">
+ <xsl:value-of select="substring-after(presentation:sound/@xlink:href,'share/gallery/sounds/')"/>
+ </xsl:variable>
+ <xsl:variable name="ming">
+ <xsl:value-of select="substring-before($lujing,'.wav')"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$ming='applause'">
+ <xsl:attribute name="演:预定义声音">applause</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$ming='explos'">
+ <xsl:attribute name="演:预定义声音">explosion</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$ming='laser'">
+ <xsl:attribute name="演:预定义声音">laser</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="演:自定义声音"><xsl:value-of select="presentation:sound/@xlink:href"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </演:声音>
+ <演:方式 uof:locID="p0062">
+ <演:单击鼠标 uof:locID="p0065">
+ <xsl:choose>
+ <xsl:when test="@presentation:transition-type='automatic'">false</xsl:when>
+ <xsl:otherwise>true</xsl:otherwise>
+ </xsl:choose>
+ </演:单击鼠标>
+ <xsl:if test="@presentation:duration">
+ <演:时间间隔 uof:locID="p0066">
+ <xsl:variable name="hms">
+ <xsl:value-of select="substring-after(@presentation:duration,'PT')"/>
+ </xsl:variable>
+ <xsl:variable name="h">
+ <xsl:value-of select="number(substring-before($hms,'H'))"/>
+ </xsl:variable>
+ <xsl:variable name="ms">
+ <xsl:value-of select="substring-after($hms,'H')"/>
+ </xsl:variable>
+ <xsl:variable name="m">
+ <xsl:value-of select="number(substring-before($ms,'M'))"/>
+ </xsl:variable>
+ <xsl:variable name="s">
+ <xsl:value-of select="number(substring-before(substring-after($ms,'M'),'S'))"/>
+ </xsl:variable>
+ <xsl:value-of select="$h *3600 + $m * 60 + $s"/>
+ </演:时间间隔>
+ </xsl:if>
+ </演:方式>
+ </xsl:for-each>
+ </演:切换>
+ </演:幻灯片>
+ </xsl:template>
+ <xsl:template match="presentation:notes" mode="page">
+ <演:幻灯片备注 uof:locID="p0054" uof:attrList="备注母版引用">
+ <xsl:attribute name="演:备注母版引用"><xsl:variable name="cute"><xsl:value-of select="parent::node()/@draw:master-page-name"/></xsl:variable><xsl:value-of select="concat('note-',$cute)"/></xsl:attribute>
+ <xsl:call-template name="产生锚点"/>
+ <演:背景 uof:locID="p0057">
+ <图:颜色 uof:locID="g0034">#ffffff</图:颜色>
+ </演:背景>
+ </演:幻灯片备注>
+ </xsl:template>
+ <xsl:template name="产生锚点">
+ <xsl:for-each select="child::node( )">
+ <xsl:choose>
+ <xsl:when test="substring-before(name(),':')='draw'">
+ <uof:锚点 uof:locID="u0064" uof:attrList="x坐标 y坐标 宽度 高度 图形引用 随动方式 缩略图 占位符">
+ <xsl:variable name="nodename">
+ <xsl:value-of select="name(.)"/>
+ </xsl:variable>
+ <xsl:variable name="refpicname">
+ <xsl:choose>
+ <xsl:when test="@draw:style-name">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@presentation:style-name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="picnumber">
+ <xsl:choose>
+ <xsl:when test="@draw:style-name">
+ <xsl:value-of select="count(preceding::*[@draw:style-name=$refpicname])"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="count(preceding::*[@presentation:style-name=$refpicname])"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="uof:x坐标"><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="@svg:x"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x1,$uofUnit)"/></xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:y坐标"><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="@svg:y"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:when><xsl:when test="@svg:y1"><xsl:value-of select="substring-before(@svg:y1,$uofUnit)"/></xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:choose><xsl:when test="@svg:width"><xsl:value-of select="substring-before(@svg:width,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/></xsl:when><xsl:when test="name(.)='draw:g'"><xsl:variable name="minx"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:variable name="svgx"><xsl:value-of select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="number(substring-before(descendant::node()[@svg:x][1]/@svg:width,$uofUnit))"/></xsl:variable><xsl:variable name="maxx"><xsl:call-template name="groupmaxx"><xsl:with-param name="value" select="$svgx + $width"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$maxx - $minx"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:高度"><xsl:choose><xsl:when test="@svg:height"><xsl:value-of select="substring-before(@svg:height,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/></xsl:when><xsl:when test="name(.)='draw:g'"><xsl:variable name="miny"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:variable name="svgy"><xsl:value-of select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/></xsl:variable><xsl:variable name="height"><xsl:value-of select="number(substring-before(descendant::node()[@svg:y][1]/@svg:height,$uofUnit))"/></xsl:variable><xsl:variable name="maxy"><xsl:call-template name="groupmaxy"><xsl:with-param name="value" select="$svgy + $height"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$maxy - $miny"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:图形引用"><xsl:choose><xsl:when test="@draw:id"><xsl:value-of select="@draw:id"/></xsl:when><xsl:when test="not(@draw:style-name) and name()='draw:g'"><xsl:value-of select="concat(child::node()[1]/@draw:style-name,'_',$picnumber)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($refpicname,'_',$picnumber)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:随动方式"><xsl:choose><xsl:when test="key('graphicset',$refpicname)/node()/@style:protect"><xsl:for-each select="key('graphicset',$refpicname)/node()"><xsl:choose><xsl:when test="@style:protect='size'">move</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:for-each></xsl:when><xsl:otherwise>movesize</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="name(.)='draw:page-thumbnail'">
+ <xsl:attribute name="uof:缩略图">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(name(parent::node())='style:handout-master')">
+ <xsl:attribute name="uof:占位符"><xsl:choose><xsl:when test="@presentation:object"><xsl:value-of select="@presentation:object"/></xsl:when><xsl:when test=".//draw:image">graphic</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:if test="@presentation:class">
+ <xsl:attribute name="uof:占位符"><xsl:value-of select="@presentation:class"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </uof:锚点>
+ </xsl:when>
+ <xsl:when test="name()= 'anim:par'">
+ <演:动画 uof:locID="p0042">
+ <xsl:apply-templates select="anim:seq"/>
+ </演:动画>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="anim:seq">
+ <xsl:apply-templates select="anim:par/anim:par/anim:par"/>
+ <xsl:apply-templates select="anim:par/anim:par/anim:iterate"/>
+ </xsl:template>
+ <xsl:template match="anim:par | anim:iterate">
+ <演:序列 uof:locID="p0043" uof:attrList="段落引用 动画对象">
+ <xsl:attribute name="演:动画对象"><xsl:choose>
+ <xsl:when test=".//@smil:targetElement"><xsl:value-of select=".//@smil:targetElement"/></xsl:when><xsl:when test="@anim:id"><xsl:value-of select="@anim:id"/></xsl:when><xsl:otherwise><xsl:value-of select="../@smil:targetElement"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <演:定时 uof:locID="p0067" uof:attrList="事件 延时 速度 重复 回卷">
- <xsl:attribute name="演:事件">
- <xsl:choose>
- <xsl:when test="@presentation:node-type='on-click'">on click</xsl:when>
- <xsl:when test="@presentation:node-type='with-previous'">with previous</xsl:when>
- <xsl:otherwise><xsl:value-of select="@presentation:node-type"/></xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="演:延时"><xsl:value-of select="substring-before(@smil:begin,'s')"/></xsl:attribute>
- <xsl:attribute name="演:速度"><xsl:choose><xsl:when test="anim:animate/@smil:dur='0.5s'">very fast</xsl:when><xsl:when test="anim:animate/@smil:dur='1s'">fast</xsl:when><xsl:when test="anim:animate/@smil:dur='2s'">medium</xsl:when><xsl:when test="anim:animate/@smil:dur='3s'">slow</xsl:when><xsl:when test="anim:animate/@smil:dur='5s'">very slow</xsl:when><xsl:otherwise>medium</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="演:重复"><xsl:choose><xsl:when test="@smil:repeatCount = 'indefinite' "><xsl:choose><xsl:when test="@smil:end='next'">until next click</xsl:when><xsl:otherwise>until next slide</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="@smil:repeatCount ='2' or @smil:repeatCount ='3' or @smil:repeatCount ='4' or @smil:repeatCount ='5' or @smil:repeatCount ='10' "><xsl:value-of select="@smil:repeatCount"/></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="演:回卷"><xsl:choose><xsl:when test="@smil:fill='remove'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </演:定时>
- <演:增强 uof:locID="p0068">
- <演:动画播放后 uof:locID="p0070" uof:attrList="颜色 变暗 播放后隐藏 单击后隐藏">
- <xsl:if test="../anim:animateColor">
- <xsl:attribute name="演:颜色"><xsl:value-of select="../anim:animateColor/@smil:to"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="../anim:animateColor">
- <xsl:attribute name="演:变暗">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="演:变暗">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@presentation:preset-property='Direction;Accelerate;Decelerate' ">
- <xsl:attribute name="演:播放后隐藏">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="演:播放后隐藏">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="../anim:set/@smil:to">
- <xsl:attribute name="演:单击后隐藏">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="演:单击后隐藏">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </演:动画播放后>
- <演:动画文本 uof:locID="p0071" uof:attrList="发送 间隔 动画形状 相反顺序">
- <xsl:attribute name="演:发送"><xsl:choose><xsl:when test="@anim:iterate-type = 'by-word' ">by word</xsl:when><xsl:when test="@anim:iterate-type = 'by-letter' ">by letter</xsl:when><xsl:otherwise>all at once</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="演:间隔"><xsl:choose><xsl:when test="@anim:iterate-interval"><xsl:value-of select="substring-before(@anim:iterate-interval,'s')"/>
+ <演:定时 uof:locID="p0067" uof:attrList="事件 延时 速度 重复 回卷">
+ <xsl:attribute name="演:事件">
+ <xsl:choose>
+ <xsl:when test="@presentation:node-type='on-click'">on click</xsl:when>
+ <xsl:when test="@presentation:node-type='with-previous'">with previous</xsl:when>
+ <xsl:otherwise><xsl:value-of select="@presentation:node-type"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="演:延时"><xsl:value-of select="substring-before(@smil:begin,'s')"/></xsl:attribute>
+ <xsl:attribute name="演:速度"><xsl:choose><xsl:when test="anim:animate/@smil:dur='0.5s'">very fast</xsl:when><xsl:when test="anim:animate/@smil:dur='1s'">fast</xsl:when><xsl:when test="anim:animate/@smil:dur='2s'">medium</xsl:when><xsl:when test="anim:animate/@smil:dur='3s'">slow</xsl:when><xsl:when test="anim:animate/@smil:dur='5s'">very slow</xsl:when><xsl:otherwise>medium</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="演:重复"><xsl:choose><xsl:when test="@smil:repeatCount = 'indefinite' "><xsl:choose><xsl:when test="@smil:end='next'">until next click</xsl:when><xsl:otherwise>until next slide</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="@smil:repeatCount ='2' or @smil:repeatCount ='3' or @smil:repeatCount ='4' or @smil:repeatCount ='5' or @smil:repeatCount ='10' "><xsl:value-of select="@smil:repeatCount"/></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="演:回卷"><xsl:choose><xsl:when test="@smil:fill='remove'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </演:定时>
+ <演:增强 uof:locID="p0068">
+ <演:动画播放后 uof:locID="p0070" uof:attrList="颜色 变暗 播放后隐藏 单击后隐藏">
+ <xsl:if test="../anim:animateColor">
+ <xsl:attribute name="演:颜色"><xsl:value-of select="../anim:animateColor/@smil:to"/></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="../anim:animateColor">
+ <xsl:attribute name="演:变暗">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="演:变暗">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@presentation:preset-property='Direction;Accelerate;Decelerate' ">
+ <xsl:attribute name="演:播放后隐藏">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="演:播放后隐藏">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="../anim:set/@smil:to">
+ <xsl:attribute name="演:单击后隐藏">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="演:单击后隐藏">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </演:动画播放后>
+ <演:动画文本 uof:locID="p0071" uof:attrList="发送 间隔 动画形状 相反顺序">
+ <xsl:attribute name="演:发送"><xsl:choose><xsl:when test="@anim:iterate-type = 'by-word' ">by word</xsl:when><xsl:when test="@anim:iterate-type = 'by-letter' ">by letter</xsl:when><xsl:otherwise>all at once</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="演:间隔"><xsl:choose><xsl:when test="@anim:iterate-interval"><xsl:value-of select="substring-before(@anim:iterate-interval,'s')"/>
</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="演:动画形状">false</xsl:attribute>
- <xsl:attribute name="演:相反顺序">false</xsl:attribute>
- </演:动画文本>
- <xsl:if test="anim:audio">
- <演:声音 uof:locID="p0061" uof:attrList="预定义声音 自定义声音">
- <xsl:variable name="audioname">
- <xsl:value-of select="substring-after(anim:audio/@xlink:href,'gallery/sounds/')"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="not($audioname='')">
- <xsl:attribute name="演:预定义声音"><xsl:choose><xsl:when test="anim:audio/@xlink:href"><xsl:value-of select="anim:audio/@xlink:href"/></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="演:自定义声音"><xsl:value-of select="anim:audio/@xlink:href"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </演:声音>
- </xsl:if>
- </演:增强>
- <演:效果 uof:locID="p0069">
- <xsl:choose>
- <xsl:when test="./@presentation:preset-class = 'entrance'">
- <演:进入 uof:locID="p0073">
- <xsl:apply-templates select="@presentation:preset-id"/>
- </演:进入>
- </xsl:when>
- <xsl:when test="./@presentation:preset-class = 'exit'">
- <演:退出 uof:locID="p0074">
- <xsl:apply-templates select="@presentation:preset-id"/>
- </演:退出>
- </xsl:when>
- <xsl:when test="./@presentation:preset-class = 'emphasis' ">
- <演:强调 uof:locID="p0075">
- <xsl:apply-templates select="@presentation:preset-id"/>
- </演:强调>
- </xsl:when>
- <xsl:otherwise>
- <演:动作路径 uof:locID="p0133" uof:attrList="路径">
- <xsl:attribute name="演:路径">
- <xsl:value-of select="anim:animateMotion/@svg:path"/>
- </xsl:attribute>
- </演:动作路径>
- </xsl:otherwise>
- </xsl:choose>
- </演:效果>
- </演:序列>
- </xsl:template>
- <xsl:template name="anim_speed">
- <xsl:param name="speed"/>
- <xsl:choose>
- <xsl:when test="$speed='0.5s' or $speed='0.25s'">very fast</xsl:when>
- <xsl:when test="$speed='1s'">fast</xsl:when>
- <xsl:when test="$speed='2s'">medium</xsl:when>
- <xsl:when test="$speed='3s'">slow</xsl:when>
- <xsl:when test="$speed='5s'">very slow</xsl:when>
- <xsl:otherwise>medium</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-venetian-blinds']">
- <演:百叶窗 uof:locID="p0080" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:百叶窗>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-appear']">
- <演:出现 uof:locID="p0081">
+ <xsl:attribute name="演:动画形状">false</xsl:attribute>
+ <xsl:attribute name="演:相反顺序">false</xsl:attribute>
+ </演:动画文本>
+ <xsl:if test="anim:audio">
+ <演:声音 uof:locID="p0061" uof:attrList="预定义声音 自定义声音">
+ <xsl:variable name="audioname">
+ <xsl:value-of select="substring-after(anim:audio/@xlink:href,'gallery/sounds/')"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="not($audioname='')">
+ <xsl:attribute name="演:预定义声音"><xsl:choose><xsl:when test="anim:audio/@xlink:href"><xsl:value-of select="anim:audio/@xlink:href"/></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="演:自定义声音"><xsl:value-of select="anim:audio/@xlink:href"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </演:声音>
+ </xsl:if>
+ </演:增强>
+ <演:效果 uof:locID="p0069">
+ <xsl:choose>
+ <xsl:when test="./@presentation:preset-class = 'entrance'">
+ <演:进入 uof:locID="p0073">
+ <xsl:apply-templates select="@presentation:preset-id"/>
+ </演:进入>
+ </xsl:when>
+ <xsl:when test="./@presentation:preset-class = 'exit'">
+ <演:退出 uof:locID="p0074">
+ <xsl:apply-templates select="@presentation:preset-id"/>
+ </演:退出>
+ </xsl:when>
+ <xsl:when test="./@presentation:preset-class = 'emphasis' ">
+ <演:强调 uof:locID="p0075">
+ <xsl:apply-templates select="@presentation:preset-id"/>
+ </演:强调>
+ </xsl:when>
+ <xsl:otherwise>
+ <演:动作路径 uof:locID="p0133" uof:attrList="路径">
+ <xsl:attribute name="演:路径">
+ <xsl:value-of select="anim:animateMotion/@svg:path"/>
+ </xsl:attribute>
+ </演:动作路径>
+ </xsl:otherwise>
+ </xsl:choose>
+ </演:效果>
+ </演:序列>
+ </xsl:template>
+ <xsl:template name="anim_speed">
+ <xsl:param name="speed"/>
+ <xsl:choose>
+ <xsl:when test="$speed='0.5s' or $speed='0.25s'">very fast</xsl:when>
+ <xsl:when test="$speed='1s'">fast</xsl:when>
+ <xsl:when test="$speed='2s'">medium</xsl:when>
+ <xsl:when test="$speed='3s'">slow</xsl:when>
+ <xsl:when test="$speed='5s'">very slow</xsl:when>
+ <xsl:otherwise>medium</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-venetian-blinds']">
+ <演:百叶窗 uof:locID="p0080" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:百叶窗>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-appear']">
+ <演:出现 uof:locID="p0081">
</演:出现>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-box']">
- <演:盒状 uof:locID="p0082" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:盒状>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-diagonal-squares']">
- <演:阶梯状 uof:locID="p0083" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'left-to-bottom' ">left down</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'left-to-top' ">left up</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'right-to-bottom' ">right down</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'right-to-top' ">right up</xsl:when></xsl:choose></xsl:attribute>
- </演:阶梯状>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-wheel']">
- <演:轮子 uof:locID="p0084" uof:attrList="速度 辐射状">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:辐射状"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:轮子>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-checkerboard']">
- <演:棋盘 uof:locID="p0085" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:subtype"/></xsl:attribute>
- </演:棋盘>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-flash-once']">
- <演:闪烁一次 uof:locID="p0086" uof:attrList="速度">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:set/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- </演:闪烁一次>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-plus']">
- <演:十字形扩展 uof:locID="p0087" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:十字形扩展>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-random']">
- <演:随机效果 uof:locID="p0088">
- </演:随机效果>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-circle']">
- <演:圆形扩展 uof:locID="p0089" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:圆形扩展>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-wipe']">
- <演:擦除 uof:locID="p0090" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">from right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">from left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">from top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">from bottom</xsl:when></xsl:choose></xsl:attribute>
- </演:擦除>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fly-in']">
- <演:飞入 uof:locID="p0091" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">from bottom</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top-right'">from top-right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top-left'">from top-left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom-left'">from bottom-left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom-right'">from bottom-right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-right'">from right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">from left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">from top</xsl:when></xsl:choose></xsl:attribute>
- </演:飞入>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fly-in-slow']">
- <演:缓慢飞入 uof:locID="p0092" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">from right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">from left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">from top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">from bottom</xsl:when></xsl:choose></xsl:attribute>
- </演:缓慢飞入>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-diamond']">
- <演:菱形 uof:locID="p0093" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:菱形>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-split']">
- <演:劈裂 uof:locID="p0094" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'horizontal-out'">horizontal out</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'horizontal-in'">horizontal in</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'vertical-in'">vertical in</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'vertical-out'">vertical out</xsl:when></xsl:choose></xsl:attribute>
- </演:劈裂>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-peek-in']">
- <演:切入 uof:locID="p0095" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">from right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">from left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">from top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">from bottom</xsl:when></xsl:choose></xsl:attribute>
- </演:切入>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-wedge']">
- <演:扇形展开 uof:locID="p0096" uof:attrList="速度">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- </演:扇形展开>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-random-bars']">
- <演:随机线条 uof:locID="p0097" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:随机线条>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-dissolve-in']">
- <演:向内溶解 uof:locID="p0098" uof:attrList="速度">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- </演:向内溶解>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-boomerang']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-bounce']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-curve-up']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-falling-in']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-flip']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-float']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fold']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-glide']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-magnify']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-movie-credits']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-pinwheel']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-breaks']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-sling']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-spiral-in']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-swivel']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-thread']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-whip']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'oooo-entrance-ascend']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-center-revolve']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-colored-lettering']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-compress']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-descend']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-ease-in']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-rise-up']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-spin-in']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-stretchy']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-turn-and-grow']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-unfold']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-colored-lettering']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-expand']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fade-in']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fade-in-and-swivel']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fade-in-and-zoom']">
- <演:其他 uof:locID="p0099">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-fill-color']">
- <演:更改填充颜色 uof:locID="p0124" uof:attrList="速度 颜色">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animateColor/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:颜色"><xsl:value-of select="../anim:animateColor/@smil:to"/></xsl:attribute>
- </演:更改填充颜色>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-font-color']">
- <演:更改字体颜色 uof:locID="p0126" uof:attrList="速度 颜色">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animateColor/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:颜色"><xsl:value-of select="../anim:animateColor/@smil:to"/></xsl:attribute>
- </演:更改字体颜色>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-grow-and-shrink']">
- <演:缩放 uof:locID="p0120" uof:attrList="速度 方向 预定义尺寸 自定义尺寸">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animateTransform/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向">horizontal</xsl:attribute>
- <xsl:choose>
- <xsl:when test="../anim:animateTransform/@smil:to='0.25,1' ">
- <xsl:attribute name="演:预定义尺寸">tiny</xsl:attribute>
- </xsl:when>
- <xsl:when test="../anim:animateTransform/@smil:to='0.5,1' ">
- <xsl:attribute name="演:预定义尺寸">smaller</xsl:attribute>
- </xsl:when>
- <xsl:when test="../anim:animateTransform/@smil:to='1.5,1' ">
- <xsl:attribute name="演:预定义尺寸">larger</xsl:attribute>
- </xsl:when>
- <xsl:when test="../anim:animateTransform/@smil:to='4,1' ">
- <xsl:attribute name="演:预定义尺寸">huge</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="演:自定义尺寸"><xsl:choose><xsl:when test="../anim:animateTransform/@smil:to"><xsl:value-of select="../anim:animateTransform/@smil:to"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </演:缩放>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-font-size']">
- <演:更改字号 uof:locID="p0125" uof:attrList="速度 预定义尺寸 自定义尺寸">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:choose>
- <xsl:when test="parent::anim:par/anim:animate/@smil:to='0.25,1' ">
- <xsl:attribute name="演:预定义尺寸">tiny</xsl:attribute>
- </xsl:when>
- <xsl:when test="parent::anim:par/anim:animate/@smil:to='0.5,1' ">
- <xsl:attribute name="演:预定义尺寸">smaller</xsl:attribute>
- </xsl:when>
- <xsl:when test="parent::anim:par/anim:animate/@smil:to='1.5,1' ">
- <xsl:attribute name="演:预定义尺寸">larger</xsl:attribute>
- </xsl:when>
- <xsl:when test="parent::anim:par/anim:animate/@smil:to='4,1' ">
- <xsl:attribute name="演:预定义尺寸">huge</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="演:自定义尺寸"><xsl:choose><xsl:when test="parent::anim:par/anim:animate/@smil:to"><xsl:value-of select="parent::anim:par/anim:animate/@smil:to"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </演:更改字号>
- </xsl:template>
- <xsl:template name="getfontstyle_emphasis">
- <xsl:value-of select="concat(@smil:to,' ')"/>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-font-style']">
- <演:更改字形 uof:locID="p0122" uof:attrList="字形 期间">
- <xsl:attribute name="演:字形"><xsl:variable name="fontstyle"><xsl:for-each select="../anim:set"><xsl:call-template name="getfontstyle_emphasis"/></xsl:for-each></xsl:variable><xsl:value-of select="$fontstyle"/></xsl:attribute>
- <xsl:attribute name="演:期间"><xsl:choose><xsl:when test="../@smil:repeatCount = 'indefinite' "><xsl:choose><xsl:when test="../@smil:end='next'">until next click</xsl:when><xsl:otherwise>until next slide</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="../@smil:repeatCount ='2' or ../@smil:repeatCount ='3' or ../@smil:repeatCount ='4' or ../@smil:repeatCount ='5' or ../@smil:repeatCount ='10'"><xsl:value-of select="../@smil:repeatCount"/></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </演:更改字形>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-line-color']">
- <演:更改线条颜色 uof:locID="p0121" uof:attrList="速度 颜色">
- <xsl:attribute name="演:速度">medium</xsl:attribute>
- <xsl:attribute name="演:颜色"><xsl:value-of select="../anim:animateColor/@smil:to"/></xsl:attribute>
- </演:更改线条颜色>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-spin']">
- <演:陀螺旋 uof:locID="p0123" uof:attrList="速度 顺时针方向 预定义角度 自定义角度">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:animateTransform/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:顺时针方向">true</xsl:attribute>
- <xsl:choose>
- <xsl:when test="parent::anim:par/anim:animateTransform/@smil:by='90'">
- <xsl:attribute name="演:预定义角度">quarter spin</xsl:attribute>
- </xsl:when>
- <xsl:when test="parent::anim:par/anim:animateTransform/@smil:by='180'">
- <xsl:attribute name="演:预定义角度">half spin</xsl:attribute>
- </xsl:when>
- <xsl:when test="parent::anim:par/anim:animateTransform/@smil:by='360'">
- <xsl:attribute name="演:预定义角度">full spin</xsl:attribute>
- </xsl:when>
- <xsl:when test="parent::anim:par/anim:animateTransform/@smil:by='720'">
- <xsl:attribute name="演:预定义角度">two spins</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="演:自定义角度"><xsl:value-of select="parent::anim:par/anim:animateTransform/@smil:by"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </演:陀螺旋>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-transparency']">
- <演:透明 uof:locID="p0127" uof:attrList="预定义透明度 自定义透明度 期间">
- <xsl:choose>
- <xsl:when test="../anim:set/@smil:to='0.25' ">
- <xsl:attribute name="演:预定义透明度">25</xsl:attribute>
- </xsl:when>
- <xsl:when test="../anim:set/@smil:to='0.5' ">
- <xsl:attribute name="演:预定义透明度">50</xsl:attribute>
- </xsl:when>
- <xsl:when test="../anim:set/@smil:to='0.75' ">
- <xsl:attribute name="演:预定义透明度">75</xsl:attribute>
- </xsl:when>
- <xsl:when test="../anim:set/@smil:to='1' ">
- <xsl:attribute name="演:预定义透明度">100</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="演:自定义透明度"><xsl:value-of select="../anim:set/@smil:to"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="演:期间"><xsl:choose><xsl:when test="../@smil:repeatCount = 'indefinite' "><xsl:choose><xsl:when test="../@smil:end='next'">until next click</xsl:when><xsl:otherwise>until next slide</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="../@smil:repeatCount ='2' or ../@smil:repeatCount ='3' or ../@smil:repeatCount ='4' or ../@smil:repeatCount ='5' or ../@smil:repeatCount ='10'"><xsl:value-of select="../@smil:repeatCount"/></xsl:when><xsl:otherwise>until next click</xsl:otherwise></xsl:choose></xsl:attribute>
- </演:透明>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-font']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-blast']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-blink']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-bold-reveal']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-style-emphasis']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-wave']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-flicker']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-grow-with-color']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-shimmer']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-teeter']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-bold-flash']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-color-blend']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-color-over-by-letter']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-color-over-by-word']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-complementary-color']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-complementary-color-2']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-contrasting-color']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-darken']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-desaturate']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-flash-bulb']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-lighten']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-reveal-underline']">
- <演:其他 uof:locID="p0128">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-box']">
- <演:盒状 uof:locID="p0111" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:盒状>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-checkerboard']">
- <演:棋盘 uof:locID="p0114" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:subtype"/></xsl:attribute>
- </演:棋盘>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-circle']">
- <演:圆形扩展 uof:locID="p0109" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:圆形扩展>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-crawl-out']">
- <演:缓慢移出 uof:locID="p0102" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">to right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">to left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">to top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">to bottom</xsl:when></xsl:choose></xsl:attribute>
- </演:缓慢移出>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-diagonal-squares']">
- <演:阶梯状 uof:locID="p0112" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'left-to-bottom' ">left down</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'left-to-top' ">left up</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'right-to-bottom' ">right down</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'right-to-top' ">right up</xsl:when></xsl:choose></xsl:attribute>
- </演:阶梯状>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-diamond']">
- <演:菱形 uof:locID="p0103" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:菱形>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-disappear']">
- <演:消失 uof:locID="p0118">
- </演:消失>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-dissolve']">
- <演:向外溶解 uof:locID="p0108" uof:attrList="速度">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- </演:向外溶解>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-flash-once']">
- <演:闪烁一次 uof:locID="p0115" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- </演:闪烁一次>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-fly-out']">
- <演:飞出 uof:locID="p0101" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">to bottom</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top-right'">to top-right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top-left'">to top-left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom-left'">to bottom-left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom-right'">to bottom-right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-right'">to right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">to left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">to top</xsl:when></xsl:choose></xsl:attribute>
- </演:飞出>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-peek-out']">
- <演:切出 uof:locID="p0105" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">to right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">to left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">to top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">to bottom</xsl:when></xsl:choose></xsl:attribute>
- </演:切出>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-plus']">
- <演:十字形扩展 uof:locID="p0116" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:十字形扩展>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-random-bars']">
- <演:随机线条 uof:locID="p0107" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:随机线条>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-random']">
- <演:随机效果 uof:locID="p0117">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:choose><xsl:when test="parent::anim:par/anim:transitionFilter/@smil:dur"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:when><xsl:otherwise><xsl:value-of select="../anim:animate/@smil:dur"/></xsl:otherwise></xsl:choose></xsl:with-param></xsl:call-template></xsl:attribute>
- </演:随机效果>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-split']">
- <演:劈裂 uof:locID="p0104" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'horizontal-out'">horizontal out</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'horizontal-in'">horizontal in</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'vertical-in'">vertical in</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'vertical-out'">vertical out</xsl:when></xsl:choose></xsl:attribute>
- </演:劈裂>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-venetian-blinds']">
- <演:百叶窗 uof:locID="p0100" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:百叶窗>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-wedge']">
- <演:扇形展开 uof:locID="p0106" uof:attrList="速度">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- </演:扇形展开>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-wheel']">
- <演:轮子 uof:locID="p0113" uof:attrList="速度 轮辐">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:轮辐"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
- </演:轮子>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-wipe']">
- <演:擦除 uof:locID="p0110" uof:attrList="速度 方向">
- <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
- <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">from right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">from left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">from top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">from bottom</xsl:when></xsl:choose></xsl:attribute>
- </演:擦除>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-boomerang']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-bounce']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-curve-down']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-flip']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-float']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-fold']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-glide']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-magnify']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-movie-credits']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-pinwheel']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-breaks']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-sling']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-swish']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-swivel']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-thread']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-whip']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-ascend']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-center-revolve']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-collapse']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-colored-lettering']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-descend']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-ease-out']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-sink-down']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-spin-out']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-stretchy']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-turn-and-grow ']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-unfold']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-zoom']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-contract']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-fade-out']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-fade-out-and-swivel']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="@presentation:preset-id[. = 'ooo-exit-fade-out-and-zoom']">
- <演:其他 uof:locID="p0119">
- <xsl:copy-of select="parent::node()"/>
- </演:其他>
- </xsl:template>
- <xsl:template match="draw:page" mode="styles">
- <xsl:call-template name="creategraphicstyles"/>
- </xsl:template>
- <xsl:template match="style:handout-master" mode="styles">
- <xsl:call-template name="creategraphicstyles"/>
- </xsl:template>
- <xsl:template match="style:master-page" mode="styles">
- <xsl:apply-templates select="presentation:notes" mode="styles"/>
- <xsl:call-template name="creategraphicstyles"/>
- </xsl:template>
- <xsl:template match="presentation:notes" mode="styles">
- <xsl:call-template name="creategraphicstyles"/>
- </xsl:template>
- <xsl:template name="creategraphicstyles">
- <xsl:for-each select="node()">
- <xsl:variable name="nodename1">
- <xsl:value-of select="name()"/>
- </xsl:variable>
- <xsl:if test="(substring-before($nodename1,':') = 'draw')">
- <xsl:call-template name="draw">
- <xsl:with-param name="nodename1" select="$nodename1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="draw">
- <xsl:param name="nodename1"/>
- <xsl:choose>
- <xsl:when test="substring-after($nodename1,':') = 'a'">
- <xsl:for-each select="child::*">
- <xsl:call-template name="draw">
- <xsl:with-param name="nodename">
- <xsl:value-of select="name()"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="substring-after($nodename1,':') = 'g'">
- <xsl:call-template name="draw:g"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="creategraphic"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="draw:g">
- <xsl:for-each select="child::*">
- <xsl:choose>
- <xsl:when test="name()='draw:g'">
- <xsl:call-template name="draw:g"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="creategraphic"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:call-template name="creategraphic"/>
- </xsl:template>
- <xsl:template name="zuheliebiao">
- <xsl:param name="allnode"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="../child::*[$pos]">
- <xsl:for-each select="../child::*[$pos]">
- <xsl:variable name="nodepos">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:variable>
- <xsl:variable name="picnumber1">
- <xsl:value-of select="count(preceding::*[@draw:style-name=$nodepos])"/>
- </xsl:variable>
- <xsl:variable name="pic-name1">
- <xsl:value-of select="concat($nodepos,'_',$picnumber1)"/>
- </xsl:variable>
- <xsl:variable name="allnode1">
- <xsl:value-of select="concat($allnode,',',$pic-name1)"/>
- </xsl:variable>
- <xsl:call-template name="zuheliebiao">
- <xsl:with-param name="allnode" select="$allnode1"/>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$allnode"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="creategraphic">
- <xsl:variable name="nodename">
- <xsl:value-of select="name()"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="@draw:style-name or name()='draw:g'">
- <xsl:variable name="pic-name">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:variable>
- <xsl:variable name="pic-num">
- <xsl:value-of select="count(/descendant::*[@draw:style-name=$pic-name])"/>
- </xsl:variable>
- <xsl:variable name="picnumber">
- <xsl:value-of select="count(preceding::*[@draw:style-name=$pic-name])"/>
- </xsl:variable>
- <xsl:call-template name="pic-process">
- <xsl:with-param name="pic-name" select="$pic-name"/>
- <xsl:with-param name="nodename" select="$nodename"/>
- <xsl:with-param name="picnumber" select="$picnumber"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="@presentation:style-name">
- <xsl:variable name="pic-name">
- <xsl:value-of select="@presentation:style-name"/>
- </xsl:variable>
- <xsl:variable name="pic-num">
- <xsl:value-of select="count(/descendant::*[@presentation:style-name=$pic-name])"/>
- </xsl:variable>
- <xsl:variable name="picnumber">
- <xsl:value-of select="count(preceding::*[@presentation:style-name=$pic-name])"/>
- </xsl:variable>
- <xsl:call-template name="pic-process">
- <xsl:with-param name="pic-name" select="$pic-name"/>
- <xsl:with-param name="picnumber" select="$picnumber"/>
- <xsl:with-param name="nodename" select="$nodename"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="pic-process">
- <xsl:param name="pic-name"/>
- <xsl:param name="nodename"/>
- <xsl:param name="picnumber"/>
- <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
- <xsl:attribute name="图:标识符"><xsl:choose><xsl:when test="@draw:id"><xsl:value-of select="@draw:id"/></xsl:when><xsl:when test="not(@draw:style-name) and name()='draw:g'"><xsl:value-of select="concat(child::node()[1]/@draw:style-name,'-',$picnumber)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:层次"><xsl:choose><xsl:when test="name(parent::node())='draw:g'"><xsl:value-of select="position()"/></xsl:when><xsl:when test="@draw:z-index"><xsl:value-of select="@draw:z-index"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="position()"/></xsl:otherwise>
- </xsl:choose></xsl:attribute>
- <xsl:if test="$nodename='draw:g'">
- <xsl:attribute name="图:组合列表"><xsl:for-each select="child::*[1]"><xsl:variable name="node1"><xsl:value-of select="@draw:style-name"/></xsl:variable><xsl:variable name="picnumber2"><xsl:value-of select="count(preceding::*[@draw:style-name=$node1])"/></xsl:variable><xsl:call-template name="zuheliebiao"><xsl:with-param name="allnode"><xsl:value-of select="concat($node1,'_',$picnumber2)"/></xsl:with-param><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
- </xsl:if>
- <xsl:if test=".//office:binary-data">
- <xsl:attribute name="图:其他对象"><xsl:choose><xsl:when test="@draw:name"><xsl:value-of select="@draw:name"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:variable name="arrow-sign">
- <xsl:choose>
- <xsl:when test="key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-start or key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-end">
- <xsl:value-of select="'1'"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$nodename='draw:line' or $nodename='draw:rect' or $nodename='draw:circle' or $nodename='draw:polygon' or $nodename='draw:polyline' or $nodename='draw:ellipse' or $nodename='draw:page-thumbnail' or $nodename='draw:frame' or $nodename='draw:path'or $nodename='draw:g'">
- <图:预定义图形 uof:locID="g0005">
- <图:类别 uof:locID="g0006">
- <xsl:choose>
- <xsl:when test="$nodename='draw:rect'">11</xsl:when>
- <xsl:when test="$nodename='draw:line'">61</xsl:when>
- <xsl:when test="$nodename='draw:circle'">19</xsl:when>
- <xsl:when test="$nodename='draw:polygon'">65</xsl:when>
- <xsl:when test="$nodename='draw:polyline'">66</xsl:when>
- <xsl:when test="$nodename='draw:ellipse'">19</xsl:when>
- <xsl:when test="$nodename='draw:page-thumbnail'">67</xsl:when>
- <xsl:when test="$nodename='draw:frame'">3</xsl:when>
- <xsl:when test="$nodename='draw:path'">64</xsl:when>
- <xsl:when test="$nodename='draw:g'">4</xsl:when>
- </xsl:choose>
- </图:类别>
- <图:名称 uof:locID="g0007">
- <xsl:choose>
- <xsl:when test="$nodename='draw:rect'">Rectangle</xsl:when>
- <xsl:when test="$nodename='draw:line'">Line</xsl:when>
- <xsl:when test="$nodename='draw:circle'">Oval</xsl:when>
- <xsl:when test="$nodename='draw:polygon'">Freeform</xsl:when>
- <xsl:when test="$nodename='draw:polyline'">Scribble</xsl:when>
- <xsl:when test="$nodename='draw:ellipse'">Oval</xsl:when>
- <xsl:when test="$nodename='draw:page-thumbnail'">缩略图</xsl:when>
- <xsl:when test="$nodename='draw:frame'">文本框</xsl:when>
- <xsl:when test="$nodename='draw:path'">Curve</xsl:when>
- <xsl:when test="$nodename='draw:g'">group</xsl:when>
- </xsl:choose>
- </图:名称>
- <图:生成软件 uof:locID="g0008">PNG</图:生成软件>
- <xsl:if test="./@draw:points or ./@svg:d">
- <图:关键点坐标 uof:locID="g0009" uofattrList="路径">
- <xsl:attribute name="图:路径"><xsl:choose><xsl:when test="@svg:d"><xsl:value-of select="@svg:d"/></xsl:when><xsl:when test="@draw:points"><xsl:call-template name="draw:points"><xsl:with-param name="point" select="@draw:points"/><xsl:with-param name="lujing"/></xsl:call-template></xsl:when></xsl:choose></xsl:attribute>
- </图:关键点坐标>
- </xsl:if>
- <图:属性 uof:locID="g0011">
- <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/*/style:style[@style:name=$pic-name]) ">
- <xsl:for-each select="style:graphic-properties">
- <xsl:if test="not(@draw:fill='none')">
- <图:填充 uof:locID="g0012">
- <xsl:call-template name="填充">
- <xsl:with-param name="nodename" select="$nodename"/>
- <xsl:with-param name="picname" select="$pic-name"/>
- </xsl:call-template>
- </图:填充>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="style:graphic-properties/@svg:stroke-color">
- <图:线颜色 uof:locID="g0013">
- <xsl:value-of select="style:graphic-properties/@svg:stroke-color"/>
- </图:线颜色>
- </xsl:if>
- <图:线型 uof:locID="g0014">
- <xsl:variable name="linetype" select="style:graphic-properties/@draw:stroke-dash"/>
- <xsl:choose>
- <xsl:when test="not(style:graphic-properties/@draw:stroke)">
- <xsl:choose>
- <xsl:when test="not(style:graphic-properties/@svg:stroke-width)">single</xsl:when>
- <xsl:otherwise>thick</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:stroke = 'none'">none</xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$linetype='Fine_20_Dashed' and style:graphic-properties/@svg:stroke-width">dash-long-heavy</xsl:when>
- <xsl:when test="$linetype='Fine_20_Dashed'">dash-long</xsl:when>
- <xsl:when test="$linetype='_32__20_Dots_20_1_20_Dash' and style:graphic-properties/@svg:stroke-width">dash-dot-dot-heavy</xsl:when>
- <xsl:when test="$linetype='_32__20_Dots_20_1_20_Dash'">dot-dot-dash</xsl:when>
- <xsl:when test="$linetype='Ultrafine_20_Dashed' and style:graphic-properties/@svg:stroke-width">dashed-heavy</xsl:when>
- <xsl:when test="$linetype='Ultrafine_20_Dotted_20__28_var_29_'and style:graphic-properties/@svg:stroke-width">dotted-heavy</xsl:when>
- <xsl:when test="$linetype='Ultrafine_20_Dotted_20__28_var_29_'">dotted</xsl:when>
- <xsl:when test="$linetype='Line_20_with_20_Fine_20_Dots'">double</xsl:when>
- <xsl:when test="$linetype='_33__20_Dashes_20_3_20_Dots_20__28_var_29_' and style:graphic-properties/@svg:stroke-width">dash-dot-heavy</xsl:when>
- <xsl:when test="$linetype='_33__20_Dashes_20_3_20_Dots_20__28_var_29_'">dot-dash</xsl:when>
- <xsl:when test="$linetype='Ultrafine_20_2_20_Dots_20_3_20_Dashes'and style:graphic-properties/@svg:stroke-width">wavy-heavy</xsl:when>
- <xsl:when test="$linetype='Ultrafine_20_2_20_Dots_20_3_20_Dashes'">wave</xsl:when>
- <xsl:when test="$linetype='Fine_20_Dashed_20__28_var_29_'">wavy-double</xsl:when>
- <xsl:otherwise>dash</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </图:线型>
- <xsl:if test="style:graphic-properties/@svg:stroke-width">
- <图:线粗细 uof:locID="g0016">
- <xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-width,$uofUnit)"/>
- </图:线粗细>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:marker-start and string-length(style:graphic-properties/@draw:marker-start)&gt;0">
- <图:前端箭头 uof:locID="g0017">
- <图:式样 uof:locID="g0018">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow'">normal</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Line_20_Arrow'">open</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow_20_concave'">stealth</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Circle'">oval</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Square_20_45'">diamond</xsl:when>
- <xsl:otherwise>normal</xsl:otherwise>
- </xsl:choose>
- </图:式样>
- <xsl:if test="style:graphic-properties/@draw:marker-start-width">
- <图:大小 uof:locID="g0019">
- <xsl:variable name="width">
- <xsl:value-of select="substring-before(style:graphic-properties/@draw:marker-start-width,$uofUnit)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="($width&lt;0.05 and 0&lt;$width) or $width=0.05">1</xsl:when>
- <xsl:when test="($width&lt;0.10 and 0.05&lt;$width) or $width=0.10">2</xsl:when>
- <xsl:when test="($width&lt;0.15 and 0.10&lt;$width) or $width=0.15">3</xsl:when>
- <xsl:when test="($width&lt;0.20 and 0.15&lt;$width) or $width=0.20">4</xsl:when>
- <xsl:when test="($width&lt;0.25 and 0.20&lt;$width) or $width=0.25">5</xsl:when>
- <xsl:when test="($width&lt;0.30 and 0.25&lt;$width) or $width=0.30">6</xsl:when>
- <xsl:when test="($width&lt;0.35 and 0.30&lt;$width) or $width=0.35">7</xsl:when>
- <xsl:when test="($width&lt;0.40 and 0.35&lt;$width) or $width=0.40">8</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </图:大小>
- </xsl:if>
- </图:前端箭头>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:marker-end">
- <图:后端箭头 uof:locID="g0020">
- <图:式样 uof:locID="g0021">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow'">normal</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Line_20_Arrow'">open</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow_20_concave'">stealth</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Circle'">oval</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Square_20_45'">diamond</xsl:when>
- <xsl:otherwise>normal</xsl:otherwise>
- </xsl:choose>
- </图:式样>
- <xsl:if test="style:graphic-properties/@draw:marker-end-width">
- <图:大小 uof:locID="g0022">
- <xsl:variable name="width">
- <xsl:value-of select="number(substring-before(style:graphic-properties/@draw:marker-end-width,$uofUnit))"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="($width&lt;0.05 and 0&lt;$width) or $width=0.05">1</xsl:when>
- <xsl:when test="($width&lt;0.10 and 0.05&lt;$width) or $width=0.10">2</xsl:when>
- <xsl:when test="($width&lt;0.15 and 0.10&lt;$width) or $width=0.15">3</xsl:when>
- <xsl:when test="($width&lt;0.20 and 0.15&lt;$width) or $width=0.20">4</xsl:when>
- <xsl:when test="($width&lt;0.25 and 0.20&lt;$width) or $width=0.25">5</xsl:when>
- <xsl:when test="($width&lt;0.30 and 0.25&lt;$width) or $width=0.30">6</xsl:when>
- <xsl:when test="($width&lt;0.35 and 0.30&lt;$width) or $width=0.35">7</xsl:when>
- <xsl:when test="($width&lt;0.40 and 0.35&lt;$width) or $width=0.40">8</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </图:大小>
- </xsl:if>
- </图:后端箭头>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:opacity or style:graphic-properties/@svg:stroke-opacity or style:graphic-properties/@svg:stroke-opacity">
- <图:透明度 uof:locID="g0038">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:opacity">
- <xsl:variable name="transparency">
- <xsl:value-of select="substring-before(style:graphic-properties/@draw:opacity,'%')"/>
- </xsl:variable>
- <xsl:value-of select="(100 - $transparency) div 100"/>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@svg:stroke-opacity">
- <xsl:variable name="transparency">
- <xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-opacity,'%')"/>
- </xsl:variable>
- <xsl:value-of select="(100 - $transparency) div 100"/>
- </xsl:when>
- <xsl:when test="style:properties/@svg:stroke-opacity">
- <xsl:value-of select="substring-before(style:properties/@svg:stroke-opacity,'%')"/>
- </xsl:when>
- </xsl:choose>
- </图:透明度>
- </xsl:if>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="@svg:x1">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- <xsl:when test="@svg:x">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- <xsl:when test="@svg:width">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- </xsl:choose>
- <图:旋转角度 uof:locID="g0025">
- <xsl:choose>
- <xsl:when test="@draw:transform">
- <xsl:variable name="rotate-angle">
- <xsl:value-of select="@draw:transform"/>
- </xsl:variable>
- <xsl:variable name="rotate-temp">
- <xsl:value-of select="substring-before(substring-after($rotate-angle,'rotate ('),')')"/>
- </xsl:variable>
- <xsl:value-of select="($rotate-temp * 360) div (2 * 3.14159265)"/>
- </xsl:when>
- <xsl:otherwise>0.0</xsl:otherwise>
- </xsl:choose>
- </图:旋转角度>
- <图:X-缩放比例 uof:locID="g0026">1</图:X-缩放比例>
- <图:Y-缩放比例 uof:locID="g0027">1</图:Y-缩放比例>
- <图:锁定纵横比 uof:locID="g0028">0</图:锁定纵横比>
- <图:相对原始比例 uof:locID="g0029">1</图:相对原始比例>
- <图:打印对象 uof:locID="g0032">true</图:打印对象>
- <图:Web文字 uof:locID="g0033"/>
- </图:属性>
- </图:预定义图形>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="./text:p or ./draw:text-box">
- <图:文本内容 uof:locID="g0002" uof:attrList="文本框 左边距 右边距 上边距 下边距 水平对齐 垂直对齐 文字排列方向 自动换行 大小适应文字 前一链接 后一链接">
- <xsl:if test="$nodename='draw:text-box'">
- <xsl:attribute name="图:文本框">true</xsl:attribute>
- <xsl:if test="./@draw:name = /office:document/office:body
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-box']">
+ <演:盒状 uof:locID="p0082" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:盒状>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-diagonal-squares']">
+ <演:阶梯状 uof:locID="p0083" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'left-to-bottom' ">left down</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'left-to-top' ">left up</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'right-to-bottom' ">right down</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'right-to-top' ">right up</xsl:when></xsl:choose></xsl:attribute>
+ </演:阶梯状>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-wheel']">
+ <演:轮子 uof:locID="p0084" uof:attrList="速度 辐射状">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:辐射状"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:轮子>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-checkerboard']">
+ <演:棋盘 uof:locID="p0085" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:subtype"/></xsl:attribute>
+ </演:棋盘>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-flash-once']">
+ <演:闪烁一次 uof:locID="p0086" uof:attrList="速度">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:set/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ </演:闪烁一次>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-plus']">
+ <演:十字形扩展 uof:locID="p0087" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:十字形扩展>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-random']">
+ <演:随机效果 uof:locID="p0088">
+ </演:随机效果>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-circle']">
+ <演:圆形扩展 uof:locID="p0089" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:圆形扩展>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-wipe']">
+ <演:擦除 uof:locID="p0090" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">from right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">from left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">from top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">from bottom</xsl:when></xsl:choose></xsl:attribute>
+ </演:擦除>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fly-in']">
+ <演:飞入 uof:locID="p0091" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">from bottom</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top-right'">from top-right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top-left'">from top-left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom-left'">from bottom-left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom-right'">from bottom-right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-right'">from right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">from left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">from top</xsl:when></xsl:choose></xsl:attribute>
+ </演:飞入>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fly-in-slow']">
+ <演:缓慢飞入 uof:locID="p0092" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">from right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">from left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">from top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">from bottom</xsl:when></xsl:choose></xsl:attribute>
+ </演:缓慢飞入>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-diamond']">
+ <演:菱形 uof:locID="p0093" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:菱形>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-split']">
+ <演:劈裂 uof:locID="p0094" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'horizontal-out'">horizontal out</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'horizontal-in'">horizontal in</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'vertical-in'">vertical in</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'vertical-out'">vertical out</xsl:when></xsl:choose></xsl:attribute>
+ </演:劈裂>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-peek-in']">
+ <演:切入 uof:locID="p0095" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">from right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">from left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">from top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">from bottom</xsl:when></xsl:choose></xsl:attribute>
+ </演:切入>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-wedge']">
+ <演:扇形展开 uof:locID="p0096" uof:attrList="速度">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ </演:扇形展开>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-random-bars']">
+ <演:随机线条 uof:locID="p0097" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:随机线条>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-dissolve-in']">
+ <演:向内溶解 uof:locID="p0098" uof:attrList="速度">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ </演:向内溶解>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-boomerang']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-bounce']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-curve-up']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-falling-in']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-flip']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-float']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fold']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-glide']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-magnify']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-movie-credits']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-pinwheel']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-breaks']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-sling']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-spiral-in']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-swivel']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-thread']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-whip']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'oooo-entrance-ascend']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-center-revolve']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-colored-lettering']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-compress']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-descend']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-ease-in']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-rise-up']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-spin-in']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-stretchy']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-turn-and-grow']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-unfold']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-colored-lettering']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-expand']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fade-in']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fade-in-and-swivel']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-entrance-fade-in-and-zoom']">
+ <演:其他 uof:locID="p0099">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-fill-color']">
+ <演:更改填充颜色 uof:locID="p0124" uof:attrList="速度 颜色">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animateColor/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:颜色"><xsl:value-of select="../anim:animateColor/@smil:to"/></xsl:attribute>
+ </演:更改填充颜色>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-font-color']">
+ <演:更改字体颜色 uof:locID="p0126" uof:attrList="速度 颜色">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animateColor/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:颜色"><xsl:value-of select="../anim:animateColor/@smil:to"/></xsl:attribute>
+ </演:更改字体颜色>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-grow-and-shrink']">
+ <演:缩放 uof:locID="p0120" uof:attrList="速度 方向 预定义尺寸 自定义尺寸">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animateTransform/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向">horizontal</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="../anim:animateTransform/@smil:to='0.25,1' ">
+ <xsl:attribute name="演:预定义尺寸">tiny</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="../anim:animateTransform/@smil:to='0.5,1' ">
+ <xsl:attribute name="演:预定义尺寸">smaller</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="../anim:animateTransform/@smil:to='1.5,1' ">
+ <xsl:attribute name="演:预定义尺寸">larger</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="../anim:animateTransform/@smil:to='4,1' ">
+ <xsl:attribute name="演:预定义尺寸">huge</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="演:自定义尺寸"><xsl:choose><xsl:when test="../anim:animateTransform/@smil:to"><xsl:value-of select="../anim:animateTransform/@smil:to"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </演:缩放>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-font-size']">
+ <演:更改字号 uof:locID="p0125" uof:attrList="速度 预定义尺寸 自定义尺寸">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="parent::anim:par/anim:animate/@smil:to='0.25,1' ">
+ <xsl:attribute name="演:预定义尺寸">tiny</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="parent::anim:par/anim:animate/@smil:to='0.5,1' ">
+ <xsl:attribute name="演:预定义尺寸">smaller</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="parent::anim:par/anim:animate/@smil:to='1.5,1' ">
+ <xsl:attribute name="演:预定义尺寸">larger</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="parent::anim:par/anim:animate/@smil:to='4,1' ">
+ <xsl:attribute name="演:预定义尺寸">huge</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="演:自定义尺寸"><xsl:choose><xsl:when test="parent::anim:par/anim:animate/@smil:to"><xsl:value-of select="parent::anim:par/anim:animate/@smil:to"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </演:更改字号>
+ </xsl:template>
+ <xsl:template name="getfontstyle_emphasis">
+ <xsl:value-of select="concat(@smil:to,' ')"/>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-font-style']">
+ <演:更改字形 uof:locID="p0122" uof:attrList="字形 期间">
+ <xsl:attribute name="演:字形"><xsl:variable name="fontstyle"><xsl:for-each select="../anim:set"><xsl:call-template name="getfontstyle_emphasis"/></xsl:for-each></xsl:variable><xsl:value-of select="$fontstyle"/></xsl:attribute>
+ <xsl:attribute name="演:期间"><xsl:choose><xsl:when test="../@smil:repeatCount = 'indefinite' "><xsl:choose><xsl:when test="../@smil:end='next'">until next click</xsl:when><xsl:otherwise>until next slide</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="../@smil:repeatCount ='2' or ../@smil:repeatCount ='3' or ../@smil:repeatCount ='4' or ../@smil:repeatCount ='5' or ../@smil:repeatCount ='10'"><xsl:value-of select="../@smil:repeatCount"/></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </演:更改字形>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-line-color']">
+ <演:更改线条颜色 uof:locID="p0121" uof:attrList="速度 颜色">
+ <xsl:attribute name="演:速度">medium</xsl:attribute>
+ <xsl:attribute name="演:颜色"><xsl:value-of select="../anim:animateColor/@smil:to"/></xsl:attribute>
+ </演:更改线条颜色>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-spin']">
+ <演:陀螺旋 uof:locID="p0123" uof:attrList="速度 顺时针方向 预定义角度 自定义角度">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:animateTransform/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:顺时针方向">true</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="parent::anim:par/anim:animateTransform/@smil:by='90'">
+ <xsl:attribute name="演:预定义角度">quarter spin</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="parent::anim:par/anim:animateTransform/@smil:by='180'">
+ <xsl:attribute name="演:预定义角度">half spin</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="parent::anim:par/anim:animateTransform/@smil:by='360'">
+ <xsl:attribute name="演:预定义角度">full spin</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="parent::anim:par/anim:animateTransform/@smil:by='720'">
+ <xsl:attribute name="演:预定义角度">two spins</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="演:自定义角度"><xsl:value-of select="parent::anim:par/anim:animateTransform/@smil:by"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </演:陀螺旋>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-transparency']">
+ <演:透明 uof:locID="p0127" uof:attrList="预定义透明度 自定义透明度 期间">
+ <xsl:choose>
+ <xsl:when test="../anim:set/@smil:to='0.25' ">
+ <xsl:attribute name="演:预定义透明度">25</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="../anim:set/@smil:to='0.5' ">
+ <xsl:attribute name="演:预定义透明度">50</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="../anim:set/@smil:to='0.75' ">
+ <xsl:attribute name="演:预定义透明度">75</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="../anim:set/@smil:to='1' ">
+ <xsl:attribute name="演:预定义透明度">100</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="演:自定义透明度"><xsl:value-of select="../anim:set/@smil:to"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="演:期间"><xsl:choose><xsl:when test="../@smil:repeatCount = 'indefinite' "><xsl:choose><xsl:when test="../@smil:end='next'">until next click</xsl:when><xsl:otherwise>until next slide</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="../@smil:repeatCount ='2' or ../@smil:repeatCount ='3' or ../@smil:repeatCount ='4' or ../@smil:repeatCount ='5' or ../@smil:repeatCount ='10'"><xsl:value-of select="../@smil:repeatCount"/></xsl:when><xsl:otherwise>until next click</xsl:otherwise></xsl:choose></xsl:attribute>
+ </演:透明>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-font']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-blast']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-blink']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-bold-reveal']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-style-emphasis']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-wave']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-flicker']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-grow-with-color']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-shimmer']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-teeter']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-bold-flash']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-color-blend']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-color-over-by-letter']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-color-over-by-word']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-complementary-color']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-complementary-color-2']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-contrasting-color']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-darken']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-desaturate']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-flash-bulb']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-lighten']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-emphasis-reveal-underline']">
+ <演:其他 uof:locID="p0128">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-box']">
+ <演:盒状 uof:locID="p0111" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:盒状>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-checkerboard']">
+ <演:棋盘 uof:locID="p0114" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:subtype"/></xsl:attribute>
+ </演:棋盘>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-circle']">
+ <演:圆形扩展 uof:locID="p0109" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:圆形扩展>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-crawl-out']">
+ <演:缓慢移出 uof:locID="p0102" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">to right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">to left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">to top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">to bottom</xsl:when></xsl:choose></xsl:attribute>
+ </演:缓慢移出>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-diagonal-squares']">
+ <演:阶梯状 uof:locID="p0112" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'left-to-bottom' ">left down</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'left-to-top' ">left up</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'right-to-bottom' ">right down</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'right-to-top' ">right up</xsl:when></xsl:choose></xsl:attribute>
+ </演:阶梯状>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-diamond']">
+ <演:菱形 uof:locID="p0103" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:菱形>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-disappear']">
+ <演:消失 uof:locID="p0118">
+ </演:消失>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-dissolve']">
+ <演:向外溶解 uof:locID="p0108" uof:attrList="速度">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ </演:向外溶解>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-flash-once']">
+ <演:闪烁一次 uof:locID="p0115" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ </演:闪烁一次>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-fly-out']">
+ <演:飞出 uof:locID="p0101" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="../anim:animate/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">to bottom</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top-right'">to top-right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top-left'">to top-left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom-left'">to bottom-left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom-right'">to bottom-right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-right'">to right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">to left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">to top</xsl:when></xsl:choose></xsl:attribute>
+ </演:飞出>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-peek-out']">
+ <演:切出 uof:locID="p0105" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">to right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">to left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">to top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">to bottom</xsl:when></xsl:choose></xsl:attribute>
+ </演:切出>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-plus']">
+ <演:十字形扩展 uof:locID="p0116" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:十字形扩展>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-random-bars']">
+ <演:随机线条 uof:locID="p0107" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:随机线条>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-random']">
+ <演:随机效果 uof:locID="p0117">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:choose><xsl:when test="parent::anim:par/anim:transitionFilter/@smil:dur"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:when><xsl:otherwise><xsl:value-of select="../anim:animate/@smil:dur"/></xsl:otherwise></xsl:choose></xsl:with-param></xsl:call-template></xsl:attribute>
+ </演:随机效果>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-split']">
+ <演:劈裂 uof:locID="p0104" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'horizontal-out'">horizontal out</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'horizontal-in'">horizontal in</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'vertical-in'">vertical in</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'vertical-out'">vertical out</xsl:when></xsl:choose></xsl:attribute>
+ </演:劈裂>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-venetian-blinds']">
+ <演:百叶窗 uof:locID="p0100" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:百叶窗>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-wedge']">
+ <演:扇形展开 uof:locID="p0106" uof:attrList="速度">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ </演:扇形展开>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-wheel']">
+ <演:轮子 uof:locID="p0113" uof:attrList="速度 轮辐">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:轮辐"><xsl:value-of select="../@presentation:preset-sub-type"/></xsl:attribute>
+ </演:轮子>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-wipe']">
+ <演:擦除 uof:locID="p0110" uof:attrList="速度 方向">
+ <xsl:attribute name="演:速度"><xsl:call-template name="anim_speed"><xsl:with-param name="speed"><xsl:value-of select="parent::anim:par/anim:transitionFilter/@smil:dur"/></xsl:with-param></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="演:方向"><xsl:choose><xsl:when test="../@presentation:preset-sub-type = 'from-right'">from right</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-left'">from left</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-top'">from top</xsl:when><xsl:when test="../@presentation:preset-sub-type = 'from-bottom'">from bottom</xsl:when></xsl:choose></xsl:attribute>
+ </演:擦除>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-boomerang']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-bounce']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-curve-down']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-flip']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-float']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-fold']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-glide']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-magnify']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-movie-credits']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-pinwheel']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-breaks']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-sling']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-swish']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-swivel']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-thread']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-whip']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-ascend']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-center-revolve']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-collapse']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-colored-lettering']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-descend']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-ease-out']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-sink-down']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-spin-out']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-stretchy']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-turn-and-grow ']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-unfold']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-zoom']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-contract']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-fade-out']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-fade-out-and-swivel']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="@presentation:preset-id[. = 'ooo-exit-fade-out-and-zoom']">
+ <演:其他 uof:locID="p0119">
+ <xsl:copy-of select="parent::node()"/>
+ </演:其他>
+ </xsl:template>
+ <xsl:template match="draw:page" mode="styles">
+ <xsl:call-template name="creategraphicstyles"/>
+ </xsl:template>
+ <xsl:template match="style:handout-master" mode="styles">
+ <xsl:call-template name="creategraphicstyles"/>
+ </xsl:template>
+ <xsl:template match="style:master-page" mode="styles">
+ <xsl:apply-templates select="presentation:notes" mode="styles"/>
+ <xsl:call-template name="creategraphicstyles"/>
+ </xsl:template>
+ <xsl:template match="presentation:notes" mode="styles">
+ <xsl:call-template name="creategraphicstyles"/>
+ </xsl:template>
+ <xsl:template name="creategraphicstyles">
+ <xsl:for-each select="node()">
+ <xsl:variable name="nodename1">
+ <xsl:value-of select="name()"/>
+ </xsl:variable>
+ <xsl:if test="(substring-before($nodename1,':') = 'draw')">
+ <xsl:call-template name="draw">
+ <xsl:with-param name="nodename1" select="$nodename1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="draw">
+ <xsl:param name="nodename1"/>
+ <xsl:choose>
+ <xsl:when test="substring-after($nodename1,':') = 'a'">
+ <xsl:for-each select="child::*">
+ <xsl:call-template name="draw">
+ <xsl:with-param name="nodename">
+ <xsl:value-of select="name()"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="substring-after($nodename1,':') = 'g'">
+ <xsl:call-template name="draw:g"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="creategraphic"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="draw:g">
+ <xsl:for-each select="child::*">
+ <xsl:choose>
+ <xsl:when test="name()='draw:g'">
+ <xsl:call-template name="draw:g"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="creategraphic"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ <xsl:call-template name="creategraphic"/>
+ </xsl:template>
+ <xsl:template name="zuheliebiao">
+ <xsl:param name="allnode"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="../child::*[$pos]">
+ <xsl:for-each select="../child::*[$pos]">
+ <xsl:variable name="nodepos">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="picnumber1">
+ <xsl:value-of select="count(preceding::*[@draw:style-name=$nodepos])"/>
+ </xsl:variable>
+ <xsl:variable name="pic-name1">
+ <xsl:value-of select="concat($nodepos,'_',$picnumber1)"/>
+ </xsl:variable>
+ <xsl:variable name="allnode1">
+ <xsl:value-of select="concat($allnode,',',$pic-name1)"/>
+ </xsl:variable>
+ <xsl:call-template name="zuheliebiao">
+ <xsl:with-param name="allnode" select="$allnode1"/>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$allnode"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="creategraphic">
+ <xsl:variable name="nodename">
+ <xsl:value-of select="name()"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="@draw:style-name or name()='draw:g'">
+ <xsl:variable name="pic-name">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="pic-num">
+ <xsl:value-of select="count(/descendant::*[@draw:style-name=$pic-name])"/>
+ </xsl:variable>
+ <xsl:variable name="picnumber">
+ <xsl:value-of select="count(preceding::*[@draw:style-name=$pic-name])"/>
+ </xsl:variable>
+ <xsl:call-template name="pic-process">
+ <xsl:with-param name="pic-name" select="$pic-name"/>
+ <xsl:with-param name="nodename" select="$nodename"/>
+ <xsl:with-param name="picnumber" select="$picnumber"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="@presentation:style-name">
+ <xsl:variable name="pic-name">
+ <xsl:value-of select="@presentation:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="pic-num">
+ <xsl:value-of select="count(/descendant::*[@presentation:style-name=$pic-name])"/>
+ </xsl:variable>
+ <xsl:variable name="picnumber">
+ <xsl:value-of select="count(preceding::*[@presentation:style-name=$pic-name])"/>
+ </xsl:variable>
+ <xsl:call-template name="pic-process">
+ <xsl:with-param name="pic-name" select="$pic-name"/>
+ <xsl:with-param name="picnumber" select="$picnumber"/>
+ <xsl:with-param name="nodename" select="$nodename"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="pic-process">
+ <xsl:param name="pic-name"/>
+ <xsl:param name="nodename"/>
+ <xsl:param name="picnumber"/>
+ <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
+ <xsl:attribute name="图:标识符"><xsl:choose><xsl:when test="@draw:id"><xsl:value-of select="@draw:id"/></xsl:when><xsl:when test="not(@draw:style-name) and name()='draw:g'"><xsl:value-of select="concat(child::node()[1]/@draw:style-name,'-',$picnumber)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:层次"><xsl:choose><xsl:when test="name(parent::node())='draw:g'"><xsl:value-of select="position()"/></xsl:when><xsl:when test="@draw:z-index"><xsl:value-of select="@draw:z-index"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="position()"/></xsl:otherwise>
+ </xsl:choose></xsl:attribute>
+ <xsl:if test="$nodename='draw:g'">
+ <xsl:attribute name="图:组合列表"><xsl:for-each select="child::*[1]"><xsl:variable name="node1"><xsl:value-of select="@draw:style-name"/></xsl:variable><xsl:variable name="picnumber2"><xsl:value-of select="count(preceding::*[@draw:style-name=$node1])"/></xsl:variable><xsl:call-template name="zuheliebiao"><xsl:with-param name="allnode"><xsl:value-of select="concat($node1,'_',$picnumber2)"/></xsl:with-param><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
+ </xsl:if>
+ <xsl:if test=".//office:binary-data">
+ <xsl:attribute name="图:其他对象"><xsl:choose><xsl:when test="@draw:name"><xsl:value-of select="@draw:name"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="arrow-sign">
+ <xsl:choose>
+ <xsl:when test="key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-start or key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-end">
+ <xsl:value-of select="'1'"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$nodename='draw:line' or $nodename='draw:rect' or $nodename='draw:circle' or $nodename='draw:polygon' or $nodename='draw:polyline' or $nodename='draw:ellipse' or $nodename='draw:page-thumbnail' or $nodename='draw:frame' or $nodename='draw:path'or $nodename='draw:g'">
+ <图:预定义图形 uof:locID="g0005">
+ <图:类别 uof:locID="g0006">
+ <xsl:choose>
+ <xsl:when test="$nodename='draw:rect'">11</xsl:when>
+ <xsl:when test="$nodename='draw:line'">61</xsl:when>
+ <xsl:when test="$nodename='draw:circle'">19</xsl:when>
+ <xsl:when test="$nodename='draw:polygon'">65</xsl:when>
+ <xsl:when test="$nodename='draw:polyline'">66</xsl:when>
+ <xsl:when test="$nodename='draw:ellipse'">19</xsl:when>
+ <xsl:when test="$nodename='draw:page-thumbnail'">67</xsl:when>
+ <xsl:when test="$nodename='draw:frame'">3</xsl:when>
+ <xsl:when test="$nodename='draw:path'">64</xsl:when>
+ <xsl:when test="$nodename='draw:g'">4</xsl:when>
+ </xsl:choose>
+ </图:类别>
+ <图:名称 uof:locID="g0007">
+ <xsl:choose>
+ <xsl:when test="$nodename='draw:rect'">Rectangle</xsl:when>
+ <xsl:when test="$nodename='draw:line'">Line</xsl:when>
+ <xsl:when test="$nodename='draw:circle'">Oval</xsl:when>
+ <xsl:when test="$nodename='draw:polygon'">Freeform</xsl:when>
+ <xsl:when test="$nodename='draw:polyline'">Scribble</xsl:when>
+ <xsl:when test="$nodename='draw:ellipse'">Oval</xsl:when>
+ <xsl:when test="$nodename='draw:page-thumbnail'">缩略图</xsl:when>
+ <xsl:when test="$nodename='draw:frame'">文本框</xsl:when>
+ <xsl:when test="$nodename='draw:path'">Curve</xsl:when>
+ <xsl:when test="$nodename='draw:g'">group</xsl:when>
+ </xsl:choose>
+ </图:名称>
+ <图:生成软件 uof:locID="g0008">PNG</图:生成软件>
+ <xsl:if test="./@draw:points or ./@svg:d">
+ <图:关键点坐标 uof:locID="g0009" uofattrList="路径">
+ <xsl:attribute name="图:路径"><xsl:choose><xsl:when test="@svg:d"><xsl:value-of select="@svg:d"/></xsl:when><xsl:when test="@draw:points"><xsl:call-template name="draw:points"><xsl:with-param name="point" select="@draw:points"/><xsl:with-param name="lujing"/></xsl:call-template></xsl:when></xsl:choose></xsl:attribute>
+ </图:关键点坐标>
+ </xsl:if>
+ <图:属性 uof:locID="g0011">
+ <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/*/style:style[@style:name=$pic-name]) ">
+ <xsl:for-each select="style:graphic-properties">
+ <xsl:if test="not(@draw:fill='none')">
+ <图:填充 uof:locID="g0012">
+ <xsl:call-template name="填充">
+ <xsl:with-param name="nodename" select="$nodename"/>
+ <xsl:with-param name="picname" select="$pic-name"/>
+ </xsl:call-template>
+ </图:填充>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="style:graphic-properties/@svg:stroke-color">
+ <图:线颜色 uof:locID="g0013">
+ <xsl:value-of select="style:graphic-properties/@svg:stroke-color"/>
+ </图:线颜色>
+ </xsl:if>
+ <图:线型 uof:locID="g0014">
+ <xsl:variable name="linetype" select="style:graphic-properties/@draw:stroke-dash"/>
+ <xsl:choose>
+ <xsl:when test="not(style:graphic-properties/@draw:stroke)">
+ <xsl:choose>
+ <xsl:when test="not(style:graphic-properties/@svg:stroke-width)">single</xsl:when>
+ <xsl:otherwise>thick</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:stroke = 'none'">none</xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$linetype='Fine_20_Dashed' and style:graphic-properties/@svg:stroke-width">dash-long-heavy</xsl:when>
+ <xsl:when test="$linetype='Fine_20_Dashed'">dash-long</xsl:when>
+ <xsl:when test="$linetype='_32__20_Dots_20_1_20_Dash' and style:graphic-properties/@svg:stroke-width">dash-dot-dot-heavy</xsl:when>
+ <xsl:when test="$linetype='_32__20_Dots_20_1_20_Dash'">dot-dot-dash</xsl:when>
+ <xsl:when test="$linetype='Ultrafine_20_Dashed' and style:graphic-properties/@svg:stroke-width">dashed-heavy</xsl:when>
+ <xsl:when test="$linetype='Ultrafine_20_Dotted_20__28_var_29_'and style:graphic-properties/@svg:stroke-width">dotted-heavy</xsl:when>
+ <xsl:when test="$linetype='Ultrafine_20_Dotted_20__28_var_29_'">dotted</xsl:when>
+ <xsl:when test="$linetype='Line_20_with_20_Fine_20_Dots'">double</xsl:when>
+ <xsl:when test="$linetype='_33__20_Dashes_20_3_20_Dots_20__28_var_29_' and style:graphic-properties/@svg:stroke-width">dash-dot-heavy</xsl:when>
+ <xsl:when test="$linetype='_33__20_Dashes_20_3_20_Dots_20__28_var_29_'">dot-dash</xsl:when>
+ <xsl:when test="$linetype='Ultrafine_20_2_20_Dots_20_3_20_Dashes'and style:graphic-properties/@svg:stroke-width">wavy-heavy</xsl:when>
+ <xsl:when test="$linetype='Ultrafine_20_2_20_Dots_20_3_20_Dashes'">wave</xsl:when>
+ <xsl:when test="$linetype='Fine_20_Dashed_20__28_var_29_'">wavy-double</xsl:when>
+ <xsl:otherwise>dash</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </图:线型>
+ <xsl:if test="style:graphic-properties/@svg:stroke-width">
+ <图:线粗细 uof:locID="g0016">
+ <xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-width,$uofUnit)"/>
+ </图:线粗细>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:marker-start and string-length(style:graphic-properties/@draw:marker-start)&gt;0">
+ <图:前端箭头 uof:locID="g0017">
+ <图:式样 uof:locID="g0018">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow'">normal</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Line_20_Arrow'">open</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow_20_concave'">stealth</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Circle'">oval</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Square_20_45'">diamond</xsl:when>
+ <xsl:otherwise>normal</xsl:otherwise>
+ </xsl:choose>
+ </图:式样>
+ <xsl:if test="style:graphic-properties/@draw:marker-start-width">
+ <图:大小 uof:locID="g0019">
+ <xsl:variable name="width">
+ <xsl:value-of select="substring-before(style:graphic-properties/@draw:marker-start-width,$uofUnit)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="($width&lt;0.05 and 0&lt;$width) or $width=0.05">1</xsl:when>
+ <xsl:when test="($width&lt;0.10 and 0.05&lt;$width) or $width=0.10">2</xsl:when>
+ <xsl:when test="($width&lt;0.15 and 0.10&lt;$width) or $width=0.15">3</xsl:when>
+ <xsl:when test="($width&lt;0.20 and 0.15&lt;$width) or $width=0.20">4</xsl:when>
+ <xsl:when test="($width&lt;0.25 and 0.20&lt;$width) or $width=0.25">5</xsl:when>
+ <xsl:when test="($width&lt;0.30 and 0.25&lt;$width) or $width=0.30">6</xsl:when>
+ <xsl:when test="($width&lt;0.35 and 0.30&lt;$width) or $width=0.35">7</xsl:when>
+ <xsl:when test="($width&lt;0.40 and 0.35&lt;$width) or $width=0.40">8</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </图:大小>
+ </xsl:if>
+ </图:前端箭头>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:marker-end">
+ <图:后端箭头 uof:locID="g0020">
+ <图:式样 uof:locID="g0021">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow'">normal</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Line_20_Arrow'">open</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow_20_concave'">stealth</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Circle'">oval</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Square_20_45'">diamond</xsl:when>
+ <xsl:otherwise>normal</xsl:otherwise>
+ </xsl:choose>
+ </图:式样>
+ <xsl:if test="style:graphic-properties/@draw:marker-end-width">
+ <图:大小 uof:locID="g0022">
+ <xsl:variable name="width">
+ <xsl:value-of select="number(substring-before(style:graphic-properties/@draw:marker-end-width,$uofUnit))"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="($width&lt;0.05 and 0&lt;$width) or $width=0.05">1</xsl:when>
+ <xsl:when test="($width&lt;0.10 and 0.05&lt;$width) or $width=0.10">2</xsl:when>
+ <xsl:when test="($width&lt;0.15 and 0.10&lt;$width) or $width=0.15">3</xsl:when>
+ <xsl:when test="($width&lt;0.20 and 0.15&lt;$width) or $width=0.20">4</xsl:when>
+ <xsl:when test="($width&lt;0.25 and 0.20&lt;$width) or $width=0.25">5</xsl:when>
+ <xsl:when test="($width&lt;0.30 and 0.25&lt;$width) or $width=0.30">6</xsl:when>
+ <xsl:when test="($width&lt;0.35 and 0.30&lt;$width) or $width=0.35">7</xsl:when>
+ <xsl:when test="($width&lt;0.40 and 0.35&lt;$width) or $width=0.40">8</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </图:大小>
+ </xsl:if>
+ </图:后端箭头>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:opacity or style:graphic-properties/@svg:stroke-opacity or style:graphic-properties/@svg:stroke-opacity">
+ <图:透明度 uof:locID="g0038">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:opacity">
+ <xsl:variable name="transparency">
+ <xsl:value-of select="substring-before(style:graphic-properties/@draw:opacity,'%')"/>
+ </xsl:variable>
+ <xsl:value-of select="(100 - $transparency) div 100"/>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@svg:stroke-opacity">
+ <xsl:variable name="transparency">
+ <xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-opacity,'%')"/>
+ </xsl:variable>
+ <xsl:value-of select="(100 - $transparency) div 100"/>
+ </xsl:when>
+ <xsl:when test="style:properties/@svg:stroke-opacity">
+ <xsl:value-of select="substring-before(style:properties/@svg:stroke-opacity,'%')"/>
+ </xsl:when>
+ </xsl:choose>
+ </图:透明度>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="@svg:x1">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ <xsl:when test="@svg:x">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ <xsl:when test="@svg:width">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ </xsl:choose>
+ <图:旋转角度 uof:locID="g0025">
+ <xsl:choose>
+ <xsl:when test="@draw:transform">
+ <xsl:variable name="rotate-angle">
+ <xsl:value-of select="@draw:transform"/>
+ </xsl:variable>
+ <xsl:variable name="rotate-temp">
+ <xsl:value-of select="substring-before(substring-after($rotate-angle,'rotate ('),')')"/>
+ </xsl:variable>
+ <xsl:value-of select="($rotate-temp * 360) div (2 * 3.14159265)"/>
+ </xsl:when>
+ <xsl:otherwise>0.0</xsl:otherwise>
+ </xsl:choose>
+ </图:旋转角度>
+ <图:X-缩放比例 uof:locID="g0026">1</图:X-缩放比例>
+ <图:Y-缩放比例 uof:locID="g0027">1</图:Y-缩放比例>
+ <图:锁定纵横比 uof:locID="g0028">0</图:锁定纵横比>
+ <图:相对原始比例 uof:locID="g0029">1</图:相对原始比例>
+ <图:打印对象 uof:locID="g0032">true</图:打印对象>
+ <图:Web文字 uof:locID="g0033"/>
+ </图:属性>
+ </图:预定义图形>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="./text:p or ./draw:text-box">
+ <图:文本内容 uof:locID="g0002" uof:attrList="文本框 左边距 右边距 上边距 下边距 水平对齐 垂直对齐 文字排列方向 自动换行 大小适应文字 前一链接 后一链接">
+ <xsl:if test="$nodename='draw:text-box'">
+ <xsl:attribute name="图:文本框">true</xsl:attribute>
+ <xsl:if test="./@draw:name = /office:document/office:body
//draw:text-box/@draw:chain-next-name">
- <xsl:attribute name="图:前一链接"><xsl:variable name="drawname"><xsl:value-of select="./@draw:name"/></xsl:variable><xsl:variable name="befor-link-name"><xsl:value-of select="/office:document/office:body
+ <xsl:attribute name="图:前一链接"><xsl:variable name="drawname"><xsl:value-of select="./@draw:name"/></xsl:variable><xsl:variable name="befor-link-name"><xsl:value-of select="/office:document/office:body
//draw:text-box[@draw:name=$drawname]/@draw:style-name"/></xsl:variable><xsl:value-of select="concat($befor-link-name,'_',$picnumber)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="./@draw:chain-next-name">
- <xsl:attribute name="图:后一链接"><xsl:variable name="next-link"><xsl:value-of select="./@draw:chain-next-name"/></xsl:variable><xsl:variable name="link-name"><xsl:value-of select="/office:document/office:body
+ </xsl:if>
+ <xsl:if test="./@draw:chain-next-name">
+ <xsl:attribute name="图:后一链接"><xsl:variable name="next-link"><xsl:value-of select="./@draw:chain-next-name"/></xsl:variable><xsl:variable name="link-name"><xsl:value-of select="/office:document/office:body
//draw:text-box[@draw:name=$next-link]/@draw:style-name"/></xsl:variable><xsl:value-of select="concat($link-name,'_',$picnumber)"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
- <xsl:if test="style:graphic-properties/@fo:padding-left">
- <xsl:attribute name="图:左边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-left,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="图:右边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-right,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="图:上边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-top,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="图:下边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-bottom,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="图:文字排列方向">
- <xsl:choose>
- <xsl:when test="style:paragraph-properties/@style:writing-mode">
- <xsl:choose>
- <xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl' and style:graphic-properties/@draw:textarea-vertical-align='bottom'">vert-l2r</xsl:when>
- <xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@draw:textarea-horizontal-align='right'">hori-r2l</xsl:when>
- <xsl:otherwise>hori-l2r</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:if test="style:graphic-properties/@fo:wrap-option">
- <xsl:attribute name="图:自动换行">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:auto-grow-width='true'">
- <xsl:attribute name="图:大小适应文字">true</xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="./draw:text-box">
- <xsl:for-each select="draw:text-box/node( )">
- <xsl:choose>
- <xsl:when test="name()='text:list'">
- <xsl:call-template name="unordered-ordered-list">
- <xsl:with-param name="currlistlvl" select="number('1')"/>
- <xsl:with-param name="liststylename" select="@text:style-name"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name()='text:p'or name()='text:h'">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="./text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:if>
- </图:文本内容>
- </xsl:if>
- <图:控制点 uof:locID="g0003" uof:attrList="x坐标 y坐标">
- <xsl:attribute name="图:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="图:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
- </图:控制点>
+ </xsl:if>
+ </xsl:if>
+ <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
+ <xsl:if test="style:graphic-properties/@fo:padding-left">
+ <xsl:attribute name="图:左边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-left,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="图:右边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-right,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="图:上边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-top,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="图:下边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-bottom,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="图:文字排列方向">
+ <xsl:choose>
+ <xsl:when test="style:paragraph-properties/@style:writing-mode">
+ <xsl:choose>
+ <xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl' and style:graphic-properties/@draw:textarea-vertical-align='bottom'">vert-l2r</xsl:when>
+ <xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:textarea-horizontal-align='right'">hori-r2l</xsl:when>
+ <xsl:otherwise>hori-l2r</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:if test="style:graphic-properties/@fo:wrap-option">
+ <xsl:attribute name="图:自动换行">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:auto-grow-width='true'">
+ <xsl:attribute name="图:大小适应文字">true</xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="./draw:text-box">
+ <xsl:for-each select="draw:text-box/node( )">
+ <xsl:choose>
+ <xsl:when test="name()='text:list'">
+ <xsl:call-template name="unordered-ordered-list">
+ <xsl:with-param name="currlistlvl" select="number('1')"/>
+ <xsl:with-param name="liststylename" select="@text:style-name"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name()='text:p'or name()='text:h'">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="./text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </图:文本内容>
+ </xsl:if>
+ <图:控制点 uof:locID="g0003" uof:attrList="x坐标 y坐标">
+ <xsl:attribute name="图:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="图:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
+ </图:控制点>
<图:翻转 uof:locID="g0040" uof:attrList="方向" 图:方向="x"/>
- </图:图形>
- <xsl:if test="name(..)='draw:g'">
- <图:组合位置 uof:locID="g0041" uof:attrList="x坐标 y坐标">
- <xsl:attribute name="图:x坐标"><xsl:variable name="minx"><xsl:for-each select="parent::node()"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:variable><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:variable name="current-minx"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$current-minx - $minx"/></xsl:when><xsl:otherwise><xsl:variable name="current-x" select="number(substring-before(@svg:x,$uofUnit))"/><xsl:value-of select="$current-x - $minx"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:y坐标"><xsl:variable name="miny"><xsl:for-each select="parent::node()"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:variable><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:variable name="current-miny"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$current-miny - $miny"/></xsl:when><xsl:otherwise><xsl:variable name="current-y" select="number(substring-before(@svg:y,$uofUnit))"/><xsl:value-of select="$current-y - $miny"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </图:组合位置>
- </xsl:if>
- <xsl:if test="name()='draw:frame' and ./draw:image">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:choose><xsl:when test="@draw:id"><xsl:value-of select="@draw:id"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <xsl:attribute name="uof:公共类型">jpg</xsl:attribute>
- <xsl:if test="./draw:image/office:binary-data">
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="./draw:image/office:binary-data"/>
- </uof:数据>
- </xsl:if>
- <xsl:if test="./draw:image/@xlink:href">
- <uof:路径 uof:locID="u0038">
- <xsl:value-of select="./draw:image/@xlink:href"/>
- </uof:路径>
- </xsl:if>
- </uof:其他对象>
- </xsl:if>
- <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
- <xsl:if test="style:graphic-properties/@draw:fill-image-name and @draw:fill='bitmap'">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:choose><xsl:when test="@draw:id"><xsl:value-of select="@draw:id"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:公共类型">jpg</xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <xsl:variable name="fill-name">
- <xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/>
- </xsl:variable>
- <uof:数据 uof:locID="u0037">
- <xsl:for-each select="/office:document/office:styles/draw:fill-image[@draw:name=$fill-name]">
- <xsl:value-of select="office:binary-data"/>
- </xsl:for-each>
- </uof:数据>
- <uof:路径 uof:locID="u0038">
- <xsl:value-of select="@xlink:href"/>
- </uof:路径>
- </uof:其他对象>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="unordered-ordered-list">
- <xsl:param name="currlistlvl"/>
- <xsl:param name="liststylename"/>
- <xsl:for-each select="text:list-item">
- <xsl:if test="text:p">
- <xsl:for-each select="text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="$currlistlvl"/>
- <xsl:with-param name="liststylename" select="$liststylename"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:for-each select="node( )">
- <xsl:if test="name()='text:list'">
- <xsl:call-template name="unordered-ordered-list">
- <xsl:with-param name="currlistlvl" select="$currlistlvl +1"/>
- <xsl:with-param name="liststylename" select="$liststylename"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="groupminx">
- <xsl:param name="value"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="descendant::node()[@svg:x][position()=$pos]">
- <xsl:variable name="othervalue" select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:x,$uofUnit))"/>
- <xsl:call-template name="groupminx">
- <xsl:with-param name="value">
- <xsl:choose>
- <xsl:when test="$value&gt;$othervalue">
- <xsl:value-of select="$othervalue"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="groupminy">
- <xsl:param name="value"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="descendant::node()[@svg:y][position()=$pos]">
- <xsl:variable name="othervalue" select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:y,$uofUnit))"/>
- <xsl:call-template name="groupminy">
- <xsl:with-param name="value">
- <xsl:choose>
- <xsl:when test="$value&gt;$othervalue">
- <xsl:value-of select="$othervalue"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="groupmaxx">
- <xsl:param name="value"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="descendant::node()[@svg:x][position()=$pos]">
- <xsl:variable name="svgx">
- <xsl:value-of select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:x,$uofUnit))"/>
- </xsl:variable>
- <xsl:variable name="width">
- <xsl:value-of select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:width,$uofUnit))"/>
- </xsl:variable>
- <xsl:variable name="othervalue" select="$svgx + $width"/>
- <xsl:call-template name="groupminx">
- <xsl:with-param name="value">
- <xsl:choose>
- <xsl:when test="$value&gt;$othervalue">
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$othervalue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="groupmaxy">
- <xsl:param name="value"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="descendant::node()[@svg:y][position()=$pos]">
- <xsl:variable name="svgy">
- <xsl:value-of select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:y,$uofUnit))"/>
- </xsl:variable>
- <xsl:variable name="height">
- <xsl:value-of select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:height,$uofUnit))"/>
- </xsl:variable>
- <xsl:variable name="othervalue" select="$svgy + $height"/>
- <xsl:call-template name="groupminy">
- <xsl:with-param name="value">
- <xsl:choose>
- <xsl:when test="$value&gt;$othervalue">
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$othervalue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="draw:points">
- <xsl:param name="point"/>
- <xsl:param name="lujing"/>
- <xsl:choose>
- <xsl:when test="contains($point,' ' )">
- <xsl:variable name="first-point" select="substring-before($point,' ')"/>
- <xsl:variable name="other-point" select="substring-after($point,' ')"/>
- <xsl:variable name="xzuobiao">
- <xsl:value-of select="substring-before($first-point,',') div 1000"/>
- </xsl:variable>
- <xsl:variable name="yzuobiao">
- <xsl:value-of select="substring-after($first-point,',') div 1000"/>
- </xsl:variable>
- <xsl:call-template name="draw:points">
- <xsl:with-param name="point" select="$other-point"/>
- <xsl:with-param name="lujing" select="concat($lujing,$xzuobiao,' ',$yzuobiao,'lineto')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="xzuobiao">
- <xsl:value-of select="substring-before($point,',') div 1000"/>
- </xsl:variable>
- <xsl:variable name="yzuobiao">
- <xsl:value-of select="substring-after($point,',') div 1000"/>
- </xsl:variable>
- <xsl:value-of select="concat($lujing,$xzuobiao,' ',$yzuobiao)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="execParagraph">
- <xsl:param name="currlistlvl"/>
- <xsl:param name="liststylename"/>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <xsl:if test="@text:id">
- <xsl:attribute name="字:动画标识"><xsl:value-of select="@text:id"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="字:段落属性">
- <xsl:attribute name="uof:locID">t0052</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:choose><xsl:when test="@text:id"><xsl:value-of select="@text:id"/></xsl:when><xsl:otherwise><xsl:value-of select="@text:style-name"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="not(number($currlistlvl) =number('0'))">
- <xsl:variable name="parent-position">
- <xsl:number from="/office:document/office:body/text:ordered-list" level="any" count="text:list-item/text:p" format="1"/>
- </xsl:variable>
- <xsl:element name="字:自动编号信息">
- <xsl:attribute name="uof:locID">t0059</xsl:attribute>
- <xsl:attribute name="uof:attrList">编号引用 编号级别 重新编号 起始编号</xsl:attribute>
- <xsl:attribute name="字:编号引用"><xsl:value-of select="$liststylename"/></xsl:attribute>
- <xsl:attribute name="字:编号级别"><xsl:value-of select="$currlistlvl"/></xsl:attribute>
- <xsl:attribute name="字:重新编号"><xsl:choose><xsl:when test="number($parent-position)=number('1')">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="字:起始编号"><xsl:for-each select="//text:list-style[$liststylename=@style:name]/*[number($currlistlvl)=number(@text:level)]"><xsl:choose><xsl:when test="@text:start-value"><xsl:value-of select="@text:start-value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:for-each></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:variable name="stylename">
- <xsl:value-of select="@text:style-name"/>
- </xsl:variable>
- <xsl:for-each select="(//style:style[@style:name=$stylename])">
- <xsl:call-template name="ParaAttribute">
- <xsl:with-param name="text-style-name" select="@text:style-name"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:element>
- <xsl:for-each select="node( )">
- <xsl:choose>
- <xsl:when test="self::node( )[name(.)='text:span']">
- <xsl:call-template name="textspan"/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:time']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:s']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="substring-before(name(.),':')='draw' and not(name(.)='draw:a')">
- </xsl:when>
- <xsl:when test="name(.)='text:a'">
- <字:句 uof:locID="t0085">
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <字:字体 uof:locID="t0088" uof:attrList="西文字体引用 中文字体引用 字号 颜色" 字:颜色="#0000ff"/>
- <字:下划线 uof:locID="t0095" 字:类型="single" 字:颜色="#0000ff" uof:attrList="类型 颜色 字下划线"/>
- </xsl:element>
- <xsl:element name="字:区域开始">
- <xsl:attribute name="字:标识符">hlnk<xsl:number from="/office:document/office:body" level="any" count="text:p[text:a]"/></xsl:attribute>
- <xsl:attribute name="字:名称">Hyperlink</xsl:attribute>
- <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
- <xsl:attribute name="uof:locID">t0121</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
- </xsl:element>
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="."/>
- </字:文本串>
- <xsl:element name="字:区域结束">
- <xsl:attribute name="字:标识符引用">hlnk<xsl:number from="/office:document/office:body" level="any" count="text:p[text:a]"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0122</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
- </xsl:element>
- </字:句>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="字:句"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </字:段落>
- </xsl:template>
- <xsl:template name="字:句">
- <xsl:if test="not(name(.)='text:bookmark-start' or name(.)='text:bookmark-end' or name(.)='draw:image' or name(.)='office:binary-data')">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
- <xsl:choose>
- <xsl:when test="@text:style-name">
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="parent::node( )/@text:style-name"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </字:句属性>
- <xsl:choose>
- <xsl:when test="(preceding-sibling::text:bookmark-start) and (following-sibling::text:bookmark-end)">
- <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
- <xsl:attribute name="字:标识符"><xsl:value-of select="preceding-sibling::text:bookmark-start/@text:name"/></xsl:attribute>
- <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
- <xsl:attribute name="字:类型">bookmark</xsl:attribute>
- </字:区域开始>
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="string(.)"/>
- </字:文本串>
- <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
- <xsl:attribute name="字:标识符引用"><xsl:value-of select="following-sibling::text:bookmark-end/@text:name"/></xsl:attribute>
- </字:区域结束>
- </xsl:when>
- <xsl:when test="preceding-sibling::text:bookmark">
- <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
- <xsl:attribute name="字:标识符"><xsl:value-of select="preceding-sibling::text:bookmark/@text:name"/></xsl:attribute>
- <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
- <xsl:attribute name="字:类型">bookmark</xsl:attribute>
- </字:区域开始>
- <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
- <xsl:attribute name="字:标识符引用"><xsl:value-of select="preceding-sibling::text:bookmark/@text:name"/></xsl:attribute>
- </字:区域结束>
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="string(.)"/>
- </字:文本串>
- </xsl:when>
- <xsl:when test="name(.)='draw:a'">
- <xsl:variable name="link-name">
- <xsl:value-of select="substring-after(@xlink:href,'#')"/>
- </xsl:variable>
- <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
- <xsl:attribute name="字:标识符"><xsl:value-of select="$link-name"/></xsl:attribute>
- <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
- <xsl:attribute name="字:类型">bookmark</xsl:attribute>
- </字:区域开始>
- <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
- <xsl:attribute name="字:标识符引用"><xsl:value-of select="$link-name"/></xsl:attribute>
- </字:区域结束>
- </xsl:when>
- <xsl:when test="self::node( )[name(.)='text:tab-stop']">
- <xsl:element name="字:制表符">
- <xsl:attribute name="uof:locID">t0123</xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:when test="name(.)='text:bookmark-start' or name(.)='text:bookmark-end' or name(.)='draw:image' or name(.)='office:binary-data'">
- </xsl:when>
- <xsl:otherwise>
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="string(.)"/>
- </字:文本串>
- </xsl:otherwise>
- </xsl:choose>
- </字:句>
- </xsl:if>
- </xsl:template>
- <xsl:template name="jiaozhu">
- <字:脚注 uof:locID="t0107" uof:attrList="引文体">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </字:脚注>
- </xsl:template>
- <xsl:template match="text:s">
- <xsl:param name="bText"/>
- <xsl:choose>
- <xsl:when test="$bText='0'">
- <xsl:variable name="count">
- <xsl:choose>
- <xsl:when test="not(@text:c)">1</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@text:c+1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <字:句 uof:locID="t0085">
- <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{$count}"/>
- </字:句>
- </xsl:when>
- <xsl:otherwise>
- <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{@text:c}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="weizhu">
- <字:尾注 uof:locID="t0108" uof:attrList="引文体">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </字:尾注>
- </xsl:template>
- <xsl:template match="text:time">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'TIME'"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:域代码">
- <字:段落 uof:locID="t0051">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <xsl:variable name="timefmt">
- <xsl:variable name="aa" select="@style:data-style-name"/>
- <xsl:for-each select="key('geshi',$aa)/number:hours | key('geshi',$aa)/number:minutes | key('geshi',$aa)/number:am-pm | key('geshi',$aa)/number:seconds | key('geshi',$aa)/number:text">
- <xsl:choose>
- <xsl:when test="@number:style='long' ">
- <xsl:if test="self::node( )[name(.)='number:hours']">HH</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:minutes']">MM</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:seconds']">SS</xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="self::node( )[name(.)='number:text']">
- <xsl:value-of select="."/>
- </xsl:if>
- <xsl:if test="self::node( )[name(.)='number:hours']">H</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:minutes']">M</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:seconds']">S</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:am-pm']">AMPM</xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="quote">"</xsl:variable>
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="concat('TIME \@ ',$quote,$timefmt,$quote,' \* MERGEFORMAT ')"/>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="."/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template name="ParaAttribute">
- <xsl:param name="text-style-name"/>
- <xsl:for-each select="/office:document/office:styles/style:style">
- <xsl:if test="@style:name=$text-style-name and not($text-style-name='Standard')">
- <xsl:element name="字:格式修订">
- <xsl:attribute name="uof:locID">t0053</xsl:attribute>
- <xsl:attribute name="uof:attrList">修订信息引用</xsl:attribute>
- <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:element name="字:段落属性">
- <xsl:attribute name="uof:locID">t0052</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@style:name"/></xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="@style:name='Heading'">
- <xsl:element name="字:大纲级别">
- <xsl:attribute name="uof:locID">t0054</xsl:attribute>
- <xsl:value-of select="substring-after(@style:name,'Heading')"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:text-align or .//@style:vertical-align">
- <xsl:element name="字:对齐">
- <xsl:attribute name="uof:locID">t0055</xsl:attribute>
- <xsl:attribute name="uof:attrList">水平对齐 文字对齐</xsl:attribute>
- <xsl:attribute name="字:水平对齐"><xsl:choose><xsl:when test=".//@fo:text-align='end'">right</xsl:when><xsl:when test=".//@fo:text-align='center'">center</xsl:when><xsl:when test=".//@fo:text-align='justify' and not(.//@fo:text-align-last='justify')">justified</xsl:when><xsl:when test=".//@fo:text-align='justify' and .//@fo:text-align-last='justify'">distributed</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="字:文字对齐"><xsl:choose><xsl:when test=".//@style:vertical-align='baseline'">base</xsl:when><xsl:when test=".//@style:vertical-align='top'">top</xsl:when><xsl:when test=".//@style:vertical-align='middle'">center</xsl:when><xsl:when test=".//@style:vertical-align='bottom'">bottom</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:margin-left or .//@fo:margin-right or .//@fo:text-indent">
- <xsl:element name="字:缩进">
- <xsl:attribute name="uof:locID">t0056</xsl:attribute>
- <xsl:call-template name="字:缩进类型"/>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:行距">
- <xsl:attribute name="uof:locID">t0057</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 值</xsl:attribute>
- <xsl:choose>
- <xsl:when test="contains(.//@fo:line-height,$uofUnit)">
- <xsl:attribute name="字:类型">fixed</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@fo:line-height,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="contains(.//@fo:line-height,'%')">
- <xsl:attribute name="字:类型">multi-lines</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@fo:line-height,'%') div 100"/></xsl:attribute>
- </xsl:when>
- <xsl:when test=".//@style:line-height-at-least">
- <xsl:attribute name="字:类型">at-least</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@style:line-height-at-least,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test=".//@style:line-spacing">
- <xsl:attribute name="字:类型">line-space</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@style:line-spacing,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:类型">multi-lines</xsl:attribute>
- <xsl:attribute name="字:值">1.0</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:if test=".//@fo:orphans">
- <xsl:element name="字:孤行控制">
- <xsl:attribute name="uof:locID">t0060</xsl:attribute>
- <xsl:value-of select=".//@fo:orphans"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:widows">
- <xsl:element name="字:寡行控制">
- <xsl:attribute name="uof:locID">t0061</xsl:attribute>
- <xsl:value-of select=".//@fo:widows"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:break-inside">
- <xsl:element name="字:段中不分页">
- <xsl:attribute name="uof:locID">t0062</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:keep-with-next">
- <xsl:element name="字:与下段同页">
- <xsl:attribute name="uof:locID">t0063</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:break-before">
- <xsl:element name="字:段前分页">
- <xsl:attribute name="uof:locID">t0064</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:snap-to-layout-grid">
- <xsl:element name="字:对齐网格">
- <xsl:attribute name="uof:locID">t0069</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:snap-to-layout-grid='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//style:drop-cap">
- <xsl:element name="字:首字下沉">
- <xsl:attribute name="uof:locID">t0070</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 字体引用 字符数 行数 间距</xsl:attribute>
- <xsl:attribute name="字:类型">dropped</xsl:attribute>
- <xsl:if test=".//style:drop-cap/@style:style-name">
- <xsl:attribute name="字:字体引用"><xsl:value-of select=".//style:drop-cap/@style:style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test=".//style:drop-cap/@style:distance">
- <xsl:attribute name="字:间距"><xsl:value-of select="substring-before(.//style:drop-cap/@style:distance,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test=".//style:drop-cap/@style:length">
- <xsl:attribute name="字:字符数"><xsl:value-of select=".//style:drop-cap/@style:length"/></xsl:attribute>
- </xsl:if>
- <xsl:if test=".//style:drop-cap/@style:lines">
- <xsl:attribute name="字:行数"><xsl:value-of select=".//style:drop-cap/@style:lines"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:hyphenate">
- <xsl:element name="字:取消断字">
- <xsl:attribute name="uof:locID">t0071</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select=".//@fo:hyphenate"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@text:number-lines">
- <xsl:element name="字:取消行号">
- <xsl:attribute name="字:值"><xsl:value-of select=".//@text:number-lines"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0072</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:允许单词断字">
- <xsl:attribute name="字:值">true</xsl:attribute>
- <xsl:attribute name="uof:locID">t0073</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- <xsl:if test=".//@style:punctuation-wrap">
- <xsl:element name="字:行首尾标点控制">
- <xsl:attribute name="uof:locID">t0074</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:punctuation-wrap='hanging'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:是否行首标点压缩">
- <xsl:attribute name="uof:locID">t0075</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">false</xsl:attribute>
- </xsl:element>
- <xsl:if test=".//@style:line-break ">
- <xsl:element name="字:中文习惯首尾字符">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:line-break='strict'">true</xsl:when><xsl:when test=".//@style:line-break='normal'">false</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:locID">t0076</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:text-autospace">
- <xsl:element name="字:自动调整中英文字符间距">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:text-autospace='ideograph-alpha'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:locID">t0077</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@style:text-autospace">
- <xsl:element name="字:自动调整中文与数字间距">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:text-autospace='ideograph-alpha'">true </xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:locID">t0078</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:有网格自动调整右缩进">
- <xsl:attribute name="字:值">false</xsl:attribute>
- <xsl:attribute name="uof:locID">t0195</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- <xsl:if test=".//@fo:border or .//@fo:border-top or .//@fo:border-bottom or .//@fo:border-left or .//@fo:border-right or .//@style:shadow[.!='none']">
- <xsl:element name="字:边框">
- <xsl:attribute name="uof:locID">t0065</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:background-color">
- <xsl:element name="字:填充">
- <xsl:attribute name="uof:locID">t0066</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test=".//@fo:margin-top or .//@fo:margin-bottom">
- <字:段间距 uof:locID="t0058">
- <xsl:if test=".//@fo:margin-top">
- <字:段前距 uof:locID="t0196">
- <字:绝对值 uof:locID="t0199" uof:attrList="值">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@fo:margin-top,$uofUnit)"/></xsl:attribute>
- </字:绝对值>
- </字:段前距>
- </xsl:if>
- <xsl:if test=".//@fo:margin-bottom">
- <字:段后距 uof:locID="t0196">
- <字:绝对值 uof:locID="t0202" uof:attrList="值">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@fo:margin-bottom,$uofUnit)"/></xsl:attribute>
- </字:绝对值>
- </字:段后距>
- </xsl:if>
- </字:段间距>
- </xsl:if>
- <xsl:if test=".//style:tab-stops">
- <xsl:element name="字:制表位设置">
- <xsl:attribute name="uof:locID">t0067</xsl:attribute>
- <xsl:for-each select=".//style:tab-stops/style:tab-stop">
- <xsl:element name="字:制表位">
- <xsl:attribute name="uof:locID">t0068</xsl:attribute>
- <xsl:attribute name="uof:attrList">位置 类型 前导符</xsl:attribute>
- <xsl:attribute name="字:位置"><xsl:value-of select="@style:position"/></xsl:attribute>
- <xsl:variable name="aa">
- <xsl:value-of select="@style:type"/>
- </xsl:variable>
- <xsl:variable name="zbflx">
- <xsl:choose>
- <xsl:when test="$aa='right'">right</xsl:when>
- <xsl:when test="$aa='center'">center</xsl:when>
- <xsl:when test="$aa='char'and @style:char!=''">decimal</xsl:when>
- <xsl:otherwise>left</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="字:类型"><xsl:value-of select="$zbflx"/></xsl:attribute>
- <xsl:if test="$zbflx='decimal'">
- <xsl:attribute name="字:制表位字符"><xsl:value-of select="@style:char"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@style:leader-char">
- <xsl:attribute name="字:前导符"><xsl:value-of select="@style:leader-char"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="textspan">
- <字:句 uof:locID="t0085">
- <xsl:choose>
- <xsl:when test="./text:footnote">
- <xsl:call-template name="jiaozhu"/>
- </xsl:when>
- <xsl:when test="./text:endnote">
- <xsl:call-template name="weizhu"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:variable name="textstyle">
- <xsl:value-of select="@text:style-name"/>
- </xsl:variable>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- <xsl:for-each select="/office:document/office:automatic-styles//style:style[@style:family='text']">
- <xsl:if test="@style:name=$textstyle and not(@style:parent-style-name='Standard')">
- <xsl:if test="@style:parent-style-name=/office:document/office:styles/style:style/@style:name">
- <xsl:call-template name="SentenceXD">
- <xsl:with-param name="Sentencestyle" select="@style:parent-style-name"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="/office:document/office:styles//style:style[@style:family='text']">
- <xsl:if test="@style:name=$textstyle">
- <xsl:call-template name="SentenceXD">
- <xsl:with-param name="Sentencestyle" select="@style:name"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="string(.)"/>
- </字:文本串>
- </xsl:otherwise>
- </xsl:choose>
- </字:句>
- </xsl:template>
- <xsl:template name="SentenceXD">
- <xsl:param name="Sentencestyle"/>
- <xsl:element name="字:格式修订">
- <xsl:attribute name="uof:locID">t0087</xsl:attribute>
- <xsl:attribute name="uof:attrList">修订信息引用</xsl:attribute>
- <xsl:attribute name="字:修订信息引用"><xsl:value-of select="$Sentencestyle"/></xsl:attribute>
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="$Sentencestyle"/></xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="add-space">
- <xsl:param name="number"/>
- <xsl:if test="$number &gt; 1">
- <xsl:call-template name="add-space">
- <xsl:with-param name="number" select="$number - 1"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template match="office:styles | office:automatic-styles" mode="style">
- <xsl:for-each select="style:style[@style:family= 'paragraph' or @style:family= 'text']">
- <xsl:choose>
- <xsl:when test="@style:family = 'text'">
- <xsl:call-template name="句式样"/>
- </xsl:when>
- <xsl:when test="@style:family = 'paragraph'">
- <xsl:call-template name="段落式样"/>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="段落式样">
- <xsl:element name="uof:段落式样">
- <xsl:attribute name="uof:locID">u0044</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用</xsl:attribute>
- <xsl:variable name="count"><xsl:value-of select="count(preceding::style:style)"/></xsl:variable>
- <xsl:attribute name="字:标识符"><xsl:value-of select="concat(@style:name,$count)"/></xsl:attribute>
- <xsl:attribute name="字:类型">default</xsl:attribute>
- <xsl:attribute name="字:基式样引用"><xsl:variable name="stylename" select="@style:name"/><xsl:variable name="frame-parent"><xsl:choose><xsl:when test="/office:document/office:master-styles/style:master-page/draw:frame[draw:text-box//text:p/@text:style-name = $stylename]"><xsl:for-each select="/office:document/office:master-styles/style:master-page/draw:frame[draw:text-box//text:p/@text:style-name = $stylename][1]"><xsl:variable name="frame-style" select="@presentation:style-name"/><xsl:value-of select="/office:document/*/style:style[@style:name=$frame-style]/@style:parent-style-name"/></xsl:for-each></xsl:when><xsl:otherwise>not-master</xsl:otherwise></xsl:choose></xsl:variable><xsl:choose><xsl:when test="@style:parent-style-name"><xsl:value-of select="@style:parent-style-name"/></xsl:when><xsl:when test="not($frame-parent='not-master')"><xsl:value-of select="$frame-parent"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:apply-templates select="style:paragraph-properties"/>
- <xsl:for-each select="style:text-properties">
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:call-template name="字:句属性"/>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template match="style:paragraph-properties">
- <xsl:element name="字:缩进">
- <xsl:attribute name="uof:locID">t0056</xsl:attribute>
- <xsl:call-template name="字:缩进类型"/>
- </xsl:element>
- <xsl:if test="@fo:text-align | @fotext-align-last">
- <xsl:element name="字:对齐">
- <xsl:attribute name="uof:locID">t0055</xsl:attribute>
- <xsl:if test="@fo:text-align">
- <xsl:attribute name="字:水平对齐"><xsl:choose><xsl:when test=".//@fo:text-align='end'">right</xsl:when><xsl:when test=".//@fo:text-align='center'">center</xsl:when><xsl:when test=".//@fo:text-align='justify' and not(.//@fo:text-align-last='justify')">justified</xsl:when><xsl:when test=".//@fo:text-align='justify' and .//@fo:text-align-last='justify'">distributed</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="@style:vertical-align">
- <xsl:attribute name="字:文字对齐"><xsl:choose><xsl:when test=".//@style:vertical-align='baseline'">base</xsl:when><xsl:when test=".//@style:vertical-align='top'">top</xsl:when><xsl:when test=".//@style:vertical-align='middle'">center</xsl:when><xsl:when test=".//@style:vertical-align='bottom'">bottom</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="uof:attrList">水平对齐 文字对齐</xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="句式样">
- <xsl:element name="uof:句式样">
- <xsl:attribute name="uof:locID">u0043</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:类型">auto</xsl:attribute>
- <xsl:call-template name="字:句属性"/>
- </xsl:element>
- </xsl:template>
- <xsl:template match="style:text-properties">
- <xsl:element name="字:字体">
- <xsl:attribute name="uof:locID">t0088</xsl:attribute>
- <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
- <xsl:if test=".//@fo:font-size or .//@style:font-size-asian or .//@style:font-size-complex">
- <xsl:choose>
- <xsl:when test="contains(.//@fo:font-size,'%') or contains(.//@style:font-size-asian,'%')">
- <xsl:attribute name="字:相对字号"><xsl:choose><xsl:when test=".//@fo:font-size"><xsl:value-of select="substring-before(.//@fo:font-size,'%')"/></xsl:when><xsl:when test=".//@style:font-size-asian"><xsl:value-of select="substring-before(.//@style:font-size-asian,'%')"/></xsl:when></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:字号"><xsl:choose><xsl:when test=".//@fo:font-size"><xsl:value-of select="substring-before(.//@fo:font-size,'pt')"/></xsl:when><xsl:when test=".//@style:font-size-asian"><xsl:value-of select="substring-before(.//@style:font-size-asian,'pt')"/></xsl:when><xsl:when test=".//@style:font-size-complex"><xsl:value-of select="substring-before(.//@style:font-size-complex,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test=".//@style:font-name">
- <xsl:attribute name="字:西文字体引用"><xsl:value-of select=".//@style:font-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test=".//@style:font-name-asian">
- <xsl:attribute name="字:中文字体引用"><xsl:value-of select=".//@style:font-name-asian"/></xsl:attribute>
- </xsl:if>
- <xsl:if test=".//@fo:color">
- <xsl:attribute name="字:颜色"><xsl:value-of select=".//@fo:color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:if test="(@fo:font-weight='bold') or (@fo:font-weight-asian='bold') or (@style:font-weight-asian='bold') or (@style:font-weight-complex='bold')">
- <xsl:element name="字:粗体">
- <xsl:attribute name="字:值">1</xsl:attribute>
- <xsl:attribute name="uof:locID">t0089</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="(@style:font-style-asian='italic') or (@style:font-style-complex='italic') or (@fo:font-style-asian='italic') or (@fo:font-style='italic')">
- <xsl:element name="字:斜体">
- <xsl:attribute name="字:值">1</xsl:attribute>
- <xsl:attribute name="uof:locID">t0090</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template match="style:page-layout">
- <xsl:element name="演:页面设置">
- <xsl:attribute name="uof:locID">p0002</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称</xsl:attribute>
- <xsl:attribute name="演:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="演:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="演:名称">页面设置</xsl:attribute>
- <xsl:element name="演:纸张">
- <xsl:attribute name="uof:locID">p0003</xsl:attribute>
- <xsl:attribute name="uof:attrList">宽度 高度 纸型</xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:page-width,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:高度"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:page-height,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:纸型"><xsl:variable name="height"><xsl:value-of select="style:page-layout-properties/@fo:page-height"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="style:page-layout-properties/@fo:page-width"/></xsl:variable><xsl:choose><xsl:when test="$height='29.7cm' and $width='42cm'">A3</xsl:when><xsl:when test="$height='21cm' and $width='29.7cm'">A4</xsl:when><xsl:when test="$height='14.8cm' and $width='21cm'">A5</xsl:when><xsl:when test="$height='25cm' and $width='35.3cm'">B4</xsl:when><xsl:when test="$height='17.6cm' and $width='25cm'">B5</xsl:when><xsl:when test="$height='12.5cm' and $width='17.6cm'">B6</xsl:when><xsl:otherwise>使用者</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:element name="演:页边距">
- <xsl:attribute name="uof:locID">p0004</xsl:attribute>
- <xsl:attribute name="uof:attrList">左 上 右 下</xsl:attribute>
- <xsl:attribute name="uof:左"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-left,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:上"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-top,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:右"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-right,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:下"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-bottom,$uofUnit)"/></xsl:attribute>
- </xsl:element>
- <xsl:variable name="PageNumberFormat">
- <xsl:value-of select="/office:document/office:settings/config:config-item-set/config:config-item[@config:name='PageNumberFormat']"/>
- </xsl:variable>
- <xsl:if test="not($PageNumberFormat='5')">
- <xsl:element name="演:页码格式">
- <xsl:attribute name="uof:locID">p0005</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$PageNumberFormat='0'">upper-letter</xsl:when>
- <xsl:when test="$PageNumberFormat='1'">lower-letter</xsl:when>
- <xsl:when test="$PageNumberFormat='2'">upper-roman</xsl:when>
- <xsl:when test="$PageNumberFormat='3'">lower-letter</xsl:when>
- <xsl:when test="$PageNumberFormat='4'">decimal</xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:element name="演:纸张方向">
- <xsl:attribute name="uof:locID">p0006</xsl:attribute>
- <xsl:choose>
- <xsl:when test="style:page-layout-properties/@style:print-orientation">
- <xsl:value-of select="style:page-layout-properties/@style:print-orientation"/>
- </xsl:when>
- <xsl:otherwise>portrait</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="obtain_anim_type">
- <xsl:param name="flytype"/>
- <xsl:variable name="flytypestr" select="substring-after($flytype,'from-')"/>
- <xsl:choose>
- <xsl:when test="contains($flytypestr,'-')">
- <xsl:value-of select="concat(substring-before($flytypestr,'-'),substring-after($flytypestr,'-'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$flytypestr"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="cm2pt">
- <xsl:param name="cmval"/>
- <xsl:value-of select="substring-before($cmval,$uofUnit)* $cm-to-other "/>
- </xsl:template>
- <xsl:template match="office:font-face-decls">
- <uof:字体集 uof:locID="u0040">
- <uof:默认字体 uof:ascii="Times New Roman" uof:fareast="宋体" uof:h-ansi="宋体" uof:cs="宋体"/>
- <xsl:for-each select="style:font-face">
- <xsl:element name="uof:字体声明">
- <xsl:attribute name="uof:attrList">标识符 名称 字体族</xsl:attribute>
- <xsl:attribute name="uof:locID">u0041</xsl:attribute>
- <xsl:attribute name="uof:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="uof:字体族"><xsl:value-of select="@svg:font-family"/></xsl:attribute>
- <xsl:if test="@style:font-charset= '02'">
- <xsl:attribute name="uof:字符集">x-symbol</xsl:attribute>
- </xsl:if>
- <xsl:if test="@style:font-family-generic">
- <xsl:choose>
- <xsl:when test="@style:font-family-generic = 'swiss'">
- <xsl:attribute name="uof:字体族">Swiss</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='modern'">
- <xsl:attribute name="uof:字符集">Modern</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic='roman'">
- <xsl:attribute name="uof:字符集">Roman</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='script'">
- <xsl:attribute name="uof:字符集">Script</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='decorative'">
- <xsl:attribute name="uof:字符集">Decorative</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='system'">
- <xsl:attribute name="uof:字符集">System</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="uof:字符集">System</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- <xsl:apply-templates select="style:font-decl"/>
- </uof:字体集>
- </xsl:template>
- <xsl:template match="office:meta">
- <uof:元数据 uof:locID="u0001">
- <uof:标题 uof:locID="u0002">
- <xsl:value-of select="dc:title"/>
- </uof:标题>
- <uof:创建应用程序 uof:locID="u0011">
- <xsl:value-of select="meta:generator"/>
- </uof:创建应用程序>
- <uof:摘要 uof:locID="u0007">
- <xsl:value-of select="dc:description"/>
- </uof:摘要>
- <uof:主题 uof:locID="u0003">
- <xsl:value-of select="dc:subject"/>
- </uof:主题>
- <uof:创建者 uof:locID="u0004"/>
- <uof:作者 uof:locID="u0005">
- <xsl:value-of select="meta:initial-creator"/>
- </uof:作者>
- <uof:创建日期 uof:locID="u0008">
- <xsl:value-of select="meta:creation-date"/>
- </uof:创建日期>
- <uof:最后作者 uof:locID="u0006">
- <xsl:value-of select="dc:creator"/>
- </uof:最后作者>
- <uof:关键字集 uof:locID="u0014">
- <xsl:for-each select=".">
- <uof:关键字 uof:locID="u0015">
- <xsl:value-of select="meta:keywords/@meta:keyword"/>
- </uof:关键字>
- </xsl:for-each>
- </uof:关键字集>
- <uof:编辑次数 uof:locID="u0009">
- <xsl:value-of select="meta:editing-cycles"/>
- </uof:编辑次数>
- <xsl:if test="meta:editing-duration">
- <uof:编辑时间 uof:locID="u0010">
- <xsl:value-of select="meta:editing-duration"/>
- </uof:编辑时间>
- </xsl:if>
- <xsl:if test="meta:template/@xlink:href">
- <uof:文档模板 uof:locID="u0013">
- <xsl:value-of select="meta:template/@xlink:href"/>
- </uof:文档模板>
- </xsl:if>
- <xsl:if test="meta:user-defined/@meta:name">
- <uof:用户自定义元数据集 uof:locID="u0016">
- <xsl:for-each select="meta:user-defined">
- <uof:用户自定义元数据 uof:locID="u0017" uof:attrList="名称 类型">
- <xsl:attribute name="uof:名称"><xsl:value-of select="@meta:name"/></xsl:attribute>
- <xsl:attribute name="uof:类型"><xsl:value-of select="'string'"/></xsl:attribute>
- </uof:用户自定义元数据>
- </xsl:for-each>
- </uof:用户自定义元数据集>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:page-count">
- <uof:页数 uof:locID="u0020">
- <xsl:value-of select="meta:document-statistic/@meta:page-count"/>
- </uof:页数>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:paragraph-count">
- <uof:段落数 uof:locID="u0025">
- <xsl:value-of select="meta:document-statistic/@meta:paragraph-count"/>
- </uof:段落数>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:object-count">
- <uof:对象数 uof:locID="u0026">
- <xsl:value-of select="meta:document-statistic/@meta:object-count"/>
- </uof:对象数>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:character-count">
- <uof:字数 uof:locID="u0021">
- <xsl:value-of select="meta:document-statistic/@meta:character-count"/>
- </uof:字数>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:word-count">
- <uof:中文字符数 uof:locID="u0023">
- <xsl:value-of select="meta:document-statistic/@meta:word-count"/>
- </uof:中文字符数>
- </xsl:if>
- </uof:元数据>
- </xsl:template>
- <xsl:template name="填充">
- <xsl:param name="picname"/>
- <xsl:param name="nodename"/>
- <xsl:choose>
- <xsl:when test="@draw:fill='gradient'">
- <xsl:variable name="gradient-name">
- <xsl:value-of select="@draw:fill-gradient-name"/>
- </xsl:variable>
- <xsl:for-each select="/descendant::draw:gradient[@draw:name=$gradient-name]">
- <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
- <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
- <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
- <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
- <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
- <xsl:variable name="angle">
- <xsl:value-of select="@draw:angle div 10"/>
- </xsl:variable>
- <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
- <xsl:if test="@draw:cx">
- <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@draw:cy">
- <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="图:类型">-2</xsl:attribute>
- </图:渐变>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="@draw:fill='bitmap'">
- <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
- <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(@style:repeat)">title</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="@style:repeat = 'repeat'">title</xsl:when><xsl:when test="@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:图形引用"><xsl:value-of select="@draw:fill-image-name"/></xsl:attribute>
- <xsl:attribute name="图:类型">png</xsl:attribute>
- <xsl:attribute name="图:名称"><xsl:value-of select="concat($picname,'_b1')"/></xsl:attribute>
- </图:图片>
- </xsl:when>
- <xsl:when test="@draw:fill='hatch'">
- <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
- <xsl:attribute name="图:类型"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:name"/></xsl:attribute>
- <xsl:attribute name="图:图形引用"/>
- <xsl:attribute name="图:前景色"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:color"/></xsl:attribute>
- <xsl:attribute name="图:背景色"><xsl:choose><xsl:when test="@draw:fill-color"><xsl:value-of select="@draw:fill-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
- </图:图案>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$nodename='draw:frame'">
- <xsl:if test="@draw:fill='solid'">
- <图:颜色 uof:locID="g0034">
- <xsl:value-of select="@draw:fill-color"/>
- </图:颜色>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <图:颜色 uof:locID="g0034">
- <xsl:choose>
- <xsl:when test="@draw:fill-color">
- <xsl:value-of select="@draw:fill-color"/>
- </xsl:when>
- <xsl:otherwise>#99ccff</xsl:otherwise>
- </xsl:choose>
- </图:颜色>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="字:缩进类型">
- <xsl:if test="style:list-level-properties/@text:space-before">
- <字:左 uof:locID="t0182">
- <字:绝对 uof:locID="t0185" uof:attrList="值">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:list-level-properties/@text:space-before,$uofUnit)"/></xsl:attribute>
- </字:绝对>
- </字:左>
- </xsl:if>
- <xsl:if test="style:list-level-properties/@text:min-label-width">
- <字:右 uof:locID="t0183">
- <字:绝对 uof:locID="t0187" uof:attrList="值">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:list-level-properties/@text:min-label-width,$uofUnit)"/></xsl:attribute>
+ </图:图形>
+ <xsl:if test="name(..)='draw:g'">
+ <图:组合位置 uof:locID="g0041" uof:attrList="x坐标 y坐标">
+ <xsl:attribute name="图:x坐标"><xsl:variable name="minx"><xsl:for-each select="parent::node()"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:variable><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:variable name="current-minx"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$current-minx - $minx"/></xsl:when><xsl:otherwise><xsl:variable name="current-x" select="number(substring-before(@svg:x,$uofUnit))"/><xsl:value-of select="$current-x - $minx"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:y坐标"><xsl:variable name="miny"><xsl:for-each select="parent::node()"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:variable><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:variable name="current-miny"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$current-miny - $miny"/></xsl:when><xsl:otherwise><xsl:variable name="current-y" select="number(substring-before(@svg:y,$uofUnit))"/><xsl:value-of select="$current-y - $miny"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </图:组合位置>
+ </xsl:if>
+ <xsl:if test="name()='draw:frame' and ./draw:image">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:choose><xsl:when test="@draw:id"><xsl:value-of select="@draw:id"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <xsl:attribute name="uof:公共类型">jpg</xsl:attribute>
+ <xsl:if test="./draw:image/office:binary-data">
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="./draw:image/office:binary-data"/>
+ </uof:数据>
+ </xsl:if>
+ <xsl:if test="./draw:image/@xlink:href">
+ <uof:路径 uof:locID="u0038">
+ <xsl:value-of select="./draw:image/@xlink:href"/>
+ </uof:路径>
+ </xsl:if>
+ </uof:其他对象>
+ </xsl:if>
+ <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
+ <xsl:if test="style:graphic-properties/@draw:fill-image-name and @draw:fill='bitmap'">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:choose><xsl:when test="@draw:id"><xsl:value-of select="@draw:id"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:公共类型">jpg</xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <xsl:variable name="fill-name">
+ <xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/>
+ </xsl:variable>
+ <uof:数据 uof:locID="u0037">
+ <xsl:for-each select="/office:document/office:styles/draw:fill-image[@draw:name=$fill-name]">
+ <xsl:value-of select="office:binary-data"/>
+ </xsl:for-each>
+ </uof:数据>
+ <uof:路径 uof:locID="u0038">
+ <xsl:value-of select="@xlink:href"/>
+ </uof:路径>
+ </uof:其他对象>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="unordered-ordered-list">
+ <xsl:param name="currlistlvl"/>
+ <xsl:param name="liststylename"/>
+ <xsl:for-each select="text:list-item">
+ <xsl:if test="text:p">
+ <xsl:for-each select="text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="$currlistlvl"/>
+ <xsl:with-param name="liststylename" select="$liststylename"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:for-each select="node( )">
+ <xsl:if test="name()='text:list'">
+ <xsl:call-template name="unordered-ordered-list">
+ <xsl:with-param name="currlistlvl" select="$currlistlvl +1"/>
+ <xsl:with-param name="liststylename" select="$liststylename"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="groupminx">
+ <xsl:param name="value"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="descendant::node()[@svg:x][position()=$pos]">
+ <xsl:variable name="othervalue" select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:x,$uofUnit))"/>
+ <xsl:call-template name="groupminx">
+ <xsl:with-param name="value">
+ <xsl:choose>
+ <xsl:when test="$value&gt;$othervalue">
+ <xsl:value-of select="$othervalue"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="groupminy">
+ <xsl:param name="value"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="descendant::node()[@svg:y][position()=$pos]">
+ <xsl:variable name="othervalue" select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:y,$uofUnit))"/>
+ <xsl:call-template name="groupminy">
+ <xsl:with-param name="value">
+ <xsl:choose>
+ <xsl:when test="$value&gt;$othervalue">
+ <xsl:value-of select="$othervalue"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="groupmaxx">
+ <xsl:param name="value"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="descendant::node()[@svg:x][position()=$pos]">
+ <xsl:variable name="svgx">
+ <xsl:value-of select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:x,$uofUnit))"/>
+ </xsl:variable>
+ <xsl:variable name="width">
+ <xsl:value-of select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:width,$uofUnit))"/>
+ </xsl:variable>
+ <xsl:variable name="othervalue" select="$svgx + $width"/>
+ <xsl:call-template name="groupminx">
+ <xsl:with-param name="value">
+ <xsl:choose>
+ <xsl:when test="$value&gt;$othervalue">
+ <xsl:value-of select="$value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$othervalue"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="groupmaxy">
+ <xsl:param name="value"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="descendant::node()[@svg:y][position()=$pos]">
+ <xsl:variable name="svgy">
+ <xsl:value-of select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:y,$uofUnit))"/>
+ </xsl:variable>
+ <xsl:variable name="height">
+ <xsl:value-of select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:height,$uofUnit))"/>
+ </xsl:variable>
+ <xsl:variable name="othervalue" select="$svgy + $height"/>
+ <xsl:call-template name="groupminy">
+ <xsl:with-param name="value">
+ <xsl:choose>
+ <xsl:when test="$value&gt;$othervalue">
+ <xsl:value-of select="$value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$othervalue"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="draw:points">
+ <xsl:param name="point"/>
+ <xsl:param name="lujing"/>
+ <xsl:choose>
+ <xsl:when test="contains($point,' ' )">
+ <xsl:variable name="first-point" select="substring-before($point,' ')"/>
+ <xsl:variable name="other-point" select="substring-after($point,' ')"/>
+ <xsl:variable name="xzuobiao">
+ <xsl:value-of select="substring-before($first-point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:variable name="yzuobiao">
+ <xsl:value-of select="substring-after($first-point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:call-template name="draw:points">
+ <xsl:with-param name="point" select="$other-point"/>
+ <xsl:with-param name="lujing" select="concat($lujing,$xzuobiao,' ',$yzuobiao,'lineto')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="xzuobiao">
+ <xsl:value-of select="substring-before($point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:variable name="yzuobiao">
+ <xsl:value-of select="substring-after($point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:value-of select="concat($lujing,$xzuobiao,' ',$yzuobiao)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="execParagraph">
+ <xsl:param name="currlistlvl"/>
+ <xsl:param name="liststylename"/>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <xsl:if test="@text:id">
+ <xsl:attribute name="字:动画标识"><xsl:value-of select="@text:id"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="字:段落属性">
+ <xsl:attribute name="uof:locID">t0052</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:choose><xsl:when test="@text:id"><xsl:value-of select="@text:id"/></xsl:when><xsl:otherwise><xsl:value-of select="@text:style-name"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="not(number($currlistlvl) =number('0'))">
+ <xsl:variable name="parent-position">
+ <xsl:number from="/office:document/office:body/text:ordered-list" level="any" count="text:list-item/text:p" format="1"/>
+ </xsl:variable>
+ <xsl:element name="字:自动编号信息">
+ <xsl:attribute name="uof:locID">t0059</xsl:attribute>
+ <xsl:attribute name="uof:attrList">编号引用 编号级别 重新编号 起始编号</xsl:attribute>
+ <xsl:attribute name="字:编号引用"><xsl:value-of select="$liststylename"/></xsl:attribute>
+ <xsl:attribute name="字:编号级别"><xsl:value-of select="$currlistlvl"/></xsl:attribute>
+ <xsl:attribute name="字:重新编号"><xsl:choose><xsl:when test="number($parent-position)=number('1')">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="字:起始编号"><xsl:for-each select="//text:list-style[$liststylename=@style:name]/*[number($currlistlvl)=number(@text:level)]"><xsl:choose><xsl:when test="@text:start-value"><xsl:value-of select="@text:start-value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:for-each></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:variable name="stylename">
+ <xsl:value-of select="@text:style-name"/>
+ </xsl:variable>
+ <xsl:for-each select="(//style:style[@style:name=$stylename])">
+ <xsl:call-template name="ParaAttribute">
+ <xsl:with-param name="text-style-name" select="@text:style-name"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:element>
+ <xsl:for-each select="node( )">
+ <xsl:choose>
+ <xsl:when test="self::node( )[name(.)='text:span']">
+ <xsl:call-template name="textspan"/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:time']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:s']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="substring-before(name(.),':')='draw' and not(name(.)='draw:a')">
+ </xsl:when>
+ <xsl:when test="name(.)='text:a'">
+ <字:句 uof:locID="t0085">
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <字:字体 uof:locID="t0088" uof:attrList="西文字体引用 中文字体引用 字号 颜色" 字:颜色="#0000ff"/>
+ <字:下划线 uof:locID="t0095" 字:类型="single" 字:颜色="#0000ff" uof:attrList="类型 颜色 字下划线"/>
+ </xsl:element>
+ <xsl:element name="字:区域开始">
+ <xsl:attribute name="字:标识符">hlnk<xsl:number from="/office:document/office:body" level="any" count="text:p[text:a]"/></xsl:attribute>
+ <xsl:attribute name="字:名称">Hyperlink</xsl:attribute>
+ <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0121</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
+ </xsl:element>
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="."/>
+ </字:文本串>
+ <xsl:element name="字:区域结束">
+ <xsl:attribute name="字:标识符引用">hlnk<xsl:number from="/office:document/office:body" level="any" count="text:p[text:a]"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0122</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
+ </xsl:element>
+ </字:句>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="字:句"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </字:段落>
+ </xsl:template>
+ <xsl:template name="字:句">
+ <xsl:if test="not(name(.)='text:bookmark-start' or name(.)='text:bookmark-end' or name(.)='draw:image' or name(.)='office:binary-data')">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
+ <xsl:choose>
+ <xsl:when test="@text:style-name">
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="parent::node( )/@text:style-name"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:句属性>
+ <xsl:choose>
+ <xsl:when test="(preceding-sibling::text:bookmark-start) and (following-sibling::text:bookmark-end)">
+ <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
+ <xsl:attribute name="字:标识符"><xsl:value-of select="preceding-sibling::text:bookmark-start/@text:name"/></xsl:attribute>
+ <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
+ <xsl:attribute name="字:类型">bookmark</xsl:attribute>
+ </字:区域开始>
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="string(.)"/>
+ </字:文本串>
+ <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
+ <xsl:attribute name="字:标识符引用"><xsl:value-of select="following-sibling::text:bookmark-end/@text:name"/></xsl:attribute>
+ </字:区域结束>
+ </xsl:when>
+ <xsl:when test="preceding-sibling::text:bookmark">
+ <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
+ <xsl:attribute name="字:标识符"><xsl:value-of select="preceding-sibling::text:bookmark/@text:name"/></xsl:attribute>
+ <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
+ <xsl:attribute name="字:类型">bookmark</xsl:attribute>
+ </字:区域开始>
+ <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
+ <xsl:attribute name="字:标识符引用"><xsl:value-of select="preceding-sibling::text:bookmark/@text:name"/></xsl:attribute>
+ </字:区域结束>
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="string(.)"/>
+ </字:文本串>
+ </xsl:when>
+ <xsl:when test="name(.)='draw:a'">
+ <xsl:variable name="link-name">
+ <xsl:value-of select="substring-after(@xlink:href,'#')"/>
+ </xsl:variable>
+ <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
+ <xsl:attribute name="字:标识符"><xsl:value-of select="$link-name"/></xsl:attribute>
+ <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
+ <xsl:attribute name="字:类型">bookmark</xsl:attribute>
+ </字:区域开始>
+ <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
+ <xsl:attribute name="字:标识符引用"><xsl:value-of select="$link-name"/></xsl:attribute>
+ </字:区域结束>
+ </xsl:when>
+ <xsl:when test="self::node( )[name(.)='text:tab-stop']">
+ <xsl:element name="字:制表符">
+ <xsl:attribute name="uof:locID">t0123</xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="name(.)='text:bookmark-start' or name(.)='text:bookmark-end' or name(.)='draw:image' or name(.)='office:binary-data'">
+ </xsl:when>
+ <xsl:otherwise>
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="string(.)"/>
+ </字:文本串>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:句>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="jiaozhu">
+ <字:脚注 uof:locID="t0107" uof:attrList="引文体">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </字:脚注>
+ </xsl:template>
+ <xsl:template match="text:s">
+ <xsl:param name="bText"/>
+ <xsl:choose>
+ <xsl:when test="$bText='0'">
+ <xsl:variable name="count">
+ <xsl:choose>
+ <xsl:when test="not(@text:c)">1</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@text:c+1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <字:句 uof:locID="t0085">
+ <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{$count}"/>
+ </字:句>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{@text:c}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="weizhu">
+ <字:尾注 uof:locID="t0108" uof:attrList="引文体">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </字:尾注>
+ </xsl:template>
+ <xsl:template match="text:time">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'TIME'"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <字:段落 uof:locID="t0051">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <xsl:variable name="timefmt">
+ <xsl:variable name="aa" select="@style:data-style-name"/>
+ <xsl:for-each select="key('geshi',$aa)/number:hours | key('geshi',$aa)/number:minutes | key('geshi',$aa)/number:am-pm | key('geshi',$aa)/number:seconds | key('geshi',$aa)/number:text">
+ <xsl:choose>
+ <xsl:when test="@number:style='long' ">
+ <xsl:if test="self::node( )[name(.)='number:hours']">HH</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:minutes']">MM</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:seconds']">SS</xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="self::node( )[name(.)='number:text']">
+ <xsl:value-of select="."/>
+ </xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:hours']">H</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:minutes']">M</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:seconds']">S</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:am-pm']">AMPM</xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="quote">"</xsl:variable>
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="concat('TIME \@ ',$quote,$timefmt,$quote,' \* MERGEFORMAT ')"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="."/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="ParaAttribute">
+ <xsl:param name="text-style-name"/>
+ <xsl:for-each select="/office:document/office:styles/style:style">
+ <xsl:if test="@style:name=$text-style-name and not($text-style-name='Standard')">
+ <xsl:element name="字:格式修订">
+ <xsl:attribute name="uof:locID">t0053</xsl:attribute>
+ <xsl:attribute name="uof:attrList">修订信息引用</xsl:attribute>
+ <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:element name="字:段落属性">
+ <xsl:attribute name="uof:locID">t0052</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@style:name"/></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="@style:name='Heading'">
+ <xsl:element name="字:大纲级别">
+ <xsl:attribute name="uof:locID">t0054</xsl:attribute>
+ <xsl:value-of select="substring-after(@style:name,'Heading')"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:text-align or .//@style:vertical-align">
+ <xsl:element name="字:对齐">
+ <xsl:attribute name="uof:locID">t0055</xsl:attribute>
+ <xsl:attribute name="uof:attrList">水平对齐 文字对齐</xsl:attribute>
+ <xsl:attribute name="字:水平对齐"><xsl:choose><xsl:when test=".//@fo:text-align='end'">right</xsl:when><xsl:when test=".//@fo:text-align='center'">center</xsl:when><xsl:when test=".//@fo:text-align='justify' and not(.//@fo:text-align-last='justify')">justified</xsl:when><xsl:when test=".//@fo:text-align='justify' and .//@fo:text-align-last='justify'">distributed</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="字:文字对齐"><xsl:choose><xsl:when test=".//@style:vertical-align='baseline'">base</xsl:when><xsl:when test=".//@style:vertical-align='top'">top</xsl:when><xsl:when test=".//@style:vertical-align='middle'">center</xsl:when><xsl:when test=".//@style:vertical-align='bottom'">bottom</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:margin-left or .//@fo:margin-right or .//@fo:text-indent">
+ <xsl:element name="字:缩进">
+ <xsl:attribute name="uof:locID">t0056</xsl:attribute>
+ <xsl:call-template name="字:缩进类型"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:行距">
+ <xsl:attribute name="uof:locID">t0057</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 值</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="contains(.//@fo:line-height,$uofUnit)">
+ <xsl:attribute name="字:类型">fixed</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@fo:line-height,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains(.//@fo:line-height,'%')">
+ <xsl:attribute name="字:类型">multi-lines</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@fo:line-height,'%') div 100"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test=".//@style:line-height-at-least">
+ <xsl:attribute name="字:类型">at-least</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@style:line-height-at-least,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test=".//@style:line-spacing">
+ <xsl:attribute name="字:类型">line-space</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@style:line-spacing,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:类型">multi-lines</xsl:attribute>
+ <xsl:attribute name="字:值">1.0</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test=".//@fo:orphans">
+ <xsl:element name="字:孤行控制">
+ <xsl:attribute name="uof:locID">t0060</xsl:attribute>
+ <xsl:value-of select=".//@fo:orphans"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:widows">
+ <xsl:element name="字:寡行控制">
+ <xsl:attribute name="uof:locID">t0061</xsl:attribute>
+ <xsl:value-of select=".//@fo:widows"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:break-inside">
+ <xsl:element name="字:段中不分页">
+ <xsl:attribute name="uof:locID">t0062</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:keep-with-next">
+ <xsl:element name="字:与下段同页">
+ <xsl:attribute name="uof:locID">t0063</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:break-before">
+ <xsl:element name="字:段前分页">
+ <xsl:attribute name="uof:locID">t0064</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:snap-to-layout-grid">
+ <xsl:element name="字:对齐网格">
+ <xsl:attribute name="uof:locID">t0069</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:snap-to-layout-grid='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//style:drop-cap">
+ <xsl:element name="字:首字下沉">
+ <xsl:attribute name="uof:locID">t0070</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 字体引用 字符数 行数 间距</xsl:attribute>
+ <xsl:attribute name="字:类型">dropped</xsl:attribute>
+ <xsl:if test=".//style:drop-cap/@style:style-name">
+ <xsl:attribute name="字:字体引用"><xsl:value-of select=".//style:drop-cap/@style:style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test=".//style:drop-cap/@style:distance">
+ <xsl:attribute name="字:间距"><xsl:value-of select="substring-before(.//style:drop-cap/@style:distance,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test=".//style:drop-cap/@style:length">
+ <xsl:attribute name="字:字符数"><xsl:value-of select=".//style:drop-cap/@style:length"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test=".//style:drop-cap/@style:lines">
+ <xsl:attribute name="字:行数"><xsl:value-of select=".//style:drop-cap/@style:lines"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:hyphenate">
+ <xsl:element name="字:取消断字">
+ <xsl:attribute name="uof:locID">t0071</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select=".//@fo:hyphenate"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@text:number-lines">
+ <xsl:element name="字:取消行号">
+ <xsl:attribute name="字:值"><xsl:value-of select=".//@text:number-lines"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0072</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:允许单词断字">
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0073</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ <xsl:if test=".//@style:punctuation-wrap">
+ <xsl:element name="字:行首尾标点控制">
+ <xsl:attribute name="uof:locID">t0074</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:punctuation-wrap='hanging'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:是否行首标点压缩">
+ <xsl:attribute name="uof:locID">t0075</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">false</xsl:attribute>
+ </xsl:element>
+ <xsl:if test=".//@style:line-break ">
+ <xsl:element name="字:中文习惯首尾字符">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:line-break='strict'">true</xsl:when><xsl:when test=".//@style:line-break='normal'">false</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0076</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:text-autospace">
+ <xsl:element name="字:自动调整中英文字符间距">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:text-autospace='ideograph-alpha'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0077</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@style:text-autospace">
+ <xsl:element name="字:自动调整中文与数字间距">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test=".//@style:text-autospace='ideograph-alpha'">true </xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0078</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:有网格自动调整右缩进">
+ <xsl:attribute name="字:值">false</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0195</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ <xsl:if test=".//@fo:border or .//@fo:border-top or .//@fo:border-bottom or .//@fo:border-left or .//@fo:border-right or .//@style:shadow[.!='none']">
+ <xsl:element name="字:边框">
+ <xsl:attribute name="uof:locID">t0065</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:background-color">
+ <xsl:element name="字:填充">
+ <xsl:attribute name="uof:locID">t0066</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test=".//@fo:margin-top or .//@fo:margin-bottom">
+ <字:段间距 uof:locID="t0058">
+ <xsl:if test=".//@fo:margin-top">
+ <字:段前距 uof:locID="t0196">
+ <字:绝对值 uof:locID="t0199" uof:attrList="值">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@fo:margin-top,$uofUnit)"/></xsl:attribute>
+ </字:绝对值>
+ </字:段前距>
+ </xsl:if>
+ <xsl:if test=".//@fo:margin-bottom">
+ <字:段后距 uof:locID="t0196">
+ <字:绝对值 uof:locID="t0202" uof:attrList="值">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(.//@fo:margin-bottom,$uofUnit)"/></xsl:attribute>
+ </字:绝对值>
+ </字:段后距>
+ </xsl:if>
+ </字:段间距>
+ </xsl:if>
+ <xsl:if test=".//style:tab-stops">
+ <xsl:element name="字:制表位设置">
+ <xsl:attribute name="uof:locID">t0067</xsl:attribute>
+ <xsl:for-each select=".//style:tab-stops/style:tab-stop">
+ <xsl:element name="字:制表位">
+ <xsl:attribute name="uof:locID">t0068</xsl:attribute>
+ <xsl:attribute name="uof:attrList">位置 类型 前导符</xsl:attribute>
+ <xsl:attribute name="字:位置"><xsl:value-of select="@style:position"/></xsl:attribute>
+ <xsl:variable name="aa">
+ <xsl:value-of select="@style:type"/>
+ </xsl:variable>
+ <xsl:variable name="zbflx">
+ <xsl:choose>
+ <xsl:when test="$aa='right'">right</xsl:when>
+ <xsl:when test="$aa='center'">center</xsl:when>
+ <xsl:when test="$aa='char'and @style:char!=''">decimal</xsl:when>
+ <xsl:otherwise>left</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="字:类型"><xsl:value-of select="$zbflx"/></xsl:attribute>
+ <xsl:if test="$zbflx='decimal'">
+ <xsl:attribute name="字:制表位字符"><xsl:value-of select="@style:char"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@style:leader-char">
+ <xsl:attribute name="字:前导符"><xsl:value-of select="@style:leader-char"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="textspan">
+ <字:句 uof:locID="t0085">
+ <xsl:choose>
+ <xsl:when test="./text:footnote">
+ <xsl:call-template name="jiaozhu"/>
+ </xsl:when>
+ <xsl:when test="./text:endnote">
+ <xsl:call-template name="weizhu"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:variable name="textstyle">
+ <xsl:value-of select="@text:style-name"/>
+ </xsl:variable>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ <xsl:for-each select="/office:document/office:automatic-styles//style:style[@style:family='text']">
+ <xsl:if test="@style:name=$textstyle and not(@style:parent-style-name='Standard')">
+ <xsl:if test="@style:parent-style-name=/office:document/office:styles/style:style/@style:name">
+ <xsl:call-template name="SentenceXD">
+ <xsl:with-param name="Sentencestyle" select="@style:parent-style-name"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="/office:document/office:styles//style:style[@style:family='text']">
+ <xsl:if test="@style:name=$textstyle">
+ <xsl:call-template name="SentenceXD">
+ <xsl:with-param name="Sentencestyle" select="@style:name"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="string(.)"/>
+ </字:文本串>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:句>
+ </xsl:template>
+ <xsl:template name="SentenceXD">
+ <xsl:param name="Sentencestyle"/>
+ <xsl:element name="字:格式修订">
+ <xsl:attribute name="uof:locID">t0087</xsl:attribute>
+ <xsl:attribute name="uof:attrList">修订信息引用</xsl:attribute>
+ <xsl:attribute name="字:修订信息引用"><xsl:value-of select="$Sentencestyle"/></xsl:attribute>
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="$Sentencestyle"/></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="add-space">
+ <xsl:param name="number"/>
+ <xsl:if test="$number &gt; 1">
+ <xsl:call-template name="add-space">
+ <xsl:with-param name="number" select="$number - 1"/>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="office:styles | office:automatic-styles" mode="style">
+ <xsl:for-each select="style:style[@style:family= 'paragraph' or @style:family= 'text']">
+ <xsl:choose>
+ <xsl:when test="@style:family = 'text'">
+ <xsl:call-template name="句式样"/>
+ </xsl:when>
+ <xsl:when test="@style:family = 'paragraph'">
+ <xsl:call-template name="段落式样"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="段落式样">
+ <xsl:element name="uof:段落式样">
+ <xsl:attribute name="uof:locID">u0044</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用</xsl:attribute>
+ <xsl:variable name="count"><xsl:value-of select="count(preceding::style:style)"/></xsl:variable>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="concat(@style:name,$count)"/></xsl:attribute>
+ <xsl:attribute name="字:类型">default</xsl:attribute>
+ <xsl:attribute name="字:基式样引用"><xsl:variable name="stylename" select="@style:name"/><xsl:variable name="frame-parent"><xsl:choose><xsl:when test="/office:document/office:master-styles/style:master-page/draw:frame[draw:text-box//text:p/@text:style-name = $stylename]"><xsl:for-each select="/office:document/office:master-styles/style:master-page/draw:frame[draw:text-box//text:p/@text:style-name = $stylename][1]"><xsl:variable name="frame-style" select="@presentation:style-name"/><xsl:value-of select="/office:document/*/style:style[@style:name=$frame-style]/@style:parent-style-name"/></xsl:for-each></xsl:when><xsl:otherwise>not-master</xsl:otherwise></xsl:choose></xsl:variable><xsl:choose><xsl:when test="@style:parent-style-name"><xsl:value-of select="@style:parent-style-name"/></xsl:when><xsl:when test="not($frame-parent='not-master')"><xsl:value-of select="$frame-parent"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:apply-templates select="style:paragraph-properties"/>
+ <xsl:for-each select="style:text-properties">
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:call-template name="字:句属性"/>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="style:paragraph-properties">
+ <xsl:element name="字:缩进">
+ <xsl:attribute name="uof:locID">t0056</xsl:attribute>
+ <xsl:call-template name="字:缩进类型"/>
+ </xsl:element>
+ <xsl:if test="@fo:text-align | @fotext-align-last">
+ <xsl:element name="字:对齐">
+ <xsl:attribute name="uof:locID">t0055</xsl:attribute>
+ <xsl:if test="@fo:text-align">
+ <xsl:attribute name="字:水平对齐"><xsl:choose><xsl:when test=".//@fo:text-align='end'">right</xsl:when><xsl:when test=".//@fo:text-align='center'">center</xsl:when><xsl:when test=".//@fo:text-align='justify' and not(.//@fo:text-align-last='justify')">justified</xsl:when><xsl:when test=".//@fo:text-align='justify' and .//@fo:text-align-last='justify'">distributed</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@style:vertical-align">
+ <xsl:attribute name="字:文字对齐"><xsl:choose><xsl:when test=".//@style:vertical-align='baseline'">base</xsl:when><xsl:when test=".//@style:vertical-align='top'">top</xsl:when><xsl:when test=".//@style:vertical-align='middle'">center</xsl:when><xsl:when test=".//@style:vertical-align='bottom'">bottom</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="uof:attrList">水平对齐 文字对齐</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="句式样">
+ <xsl:element name="uof:句式样">
+ <xsl:attribute name="uof:locID">u0043</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:类型">auto</xsl:attribute>
+ <xsl:call-template name="字:句属性"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="style:text-properties">
+ <xsl:element name="字:字体">
+ <xsl:attribute name="uof:locID">t0088</xsl:attribute>
+ <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
+ <xsl:if test=".//@fo:font-size or .//@style:font-size-asian or .//@style:font-size-complex">
+ <xsl:choose>
+ <xsl:when test="contains(.//@fo:font-size,'%') or contains(.//@style:font-size-asian,'%')">
+ <xsl:attribute name="字:相对字号"><xsl:choose><xsl:when test=".//@fo:font-size"><xsl:value-of select="substring-before(.//@fo:font-size,'%')"/></xsl:when><xsl:when test=".//@style:font-size-asian"><xsl:value-of select="substring-before(.//@style:font-size-asian,'%')"/></xsl:when></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:字号"><xsl:choose><xsl:when test=".//@fo:font-size"><xsl:value-of select="substring-before(.//@fo:font-size,'pt')"/></xsl:when><xsl:when test=".//@style:font-size-asian"><xsl:value-of select="substring-before(.//@style:font-size-asian,'pt')"/></xsl:when><xsl:when test=".//@style:font-size-complex"><xsl:value-of select="substring-before(.//@style:font-size-complex,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test=".//@style:font-name">
+ <xsl:attribute name="字:西文字体引用"><xsl:value-of select=".//@style:font-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test=".//@style:font-name-asian">
+ <xsl:attribute name="字:中文字体引用"><xsl:value-of select=".//@style:font-name-asian"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test=".//@fo:color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select=".//@fo:color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test="(@fo:font-weight='bold') or (@fo:font-weight-asian='bold') or (@style:font-weight-asian='bold') or (@style:font-weight-complex='bold')">
+ <xsl:element name="字:粗体">
+ <xsl:attribute name="字:值">1</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0089</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="(@style:font-style-asian='italic') or (@style:font-style-complex='italic') or (@fo:font-style-asian='italic') or (@fo:font-style='italic')">
+ <xsl:element name="字:斜体">
+ <xsl:attribute name="字:值">1</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0090</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="style:page-layout">
+ <xsl:element name="演:页面设置">
+ <xsl:attribute name="uof:locID">p0002</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称</xsl:attribute>
+ <xsl:attribute name="演:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="演:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="演:名称">页面设置</xsl:attribute>
+ <xsl:element name="演:纸张">
+ <xsl:attribute name="uof:locID">p0003</xsl:attribute>
+ <xsl:attribute name="uof:attrList">宽度 高度 纸型</xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:page-width,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:高度"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:page-height,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:纸型"><xsl:variable name="height"><xsl:value-of select="style:page-layout-properties/@fo:page-height"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="style:page-layout-properties/@fo:page-width"/></xsl:variable><xsl:choose><xsl:when test="$height='29.7cm' and $width='42cm'">A3</xsl:when><xsl:when test="$height='21cm' and $width='29.7cm'">A4</xsl:when><xsl:when test="$height='14.8cm' and $width='21cm'">A5</xsl:when><xsl:when test="$height='25cm' and $width='35.3cm'">B4</xsl:when><xsl:when test="$height='17.6cm' and $width='25cm'">B5</xsl:when><xsl:when test="$height='12.5cm' and $width='17.6cm'">B6</xsl:when><xsl:otherwise>使用者</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="演:页边距">
+ <xsl:attribute name="uof:locID">p0004</xsl:attribute>
+ <xsl:attribute name="uof:attrList">左 上 右 下</xsl:attribute>
+ <xsl:attribute name="uof:左"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-left,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:上"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-top,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:右"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-right,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:下"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-bottom,$uofUnit)"/></xsl:attribute>
+ </xsl:element>
+ <xsl:variable name="PageNumberFormat">
+ <xsl:value-of select="/office:document/office:settings/config:config-item-set/config:config-item[@config:name='PageNumberFormat']"/>
+ </xsl:variable>
+ <xsl:if test="not($PageNumberFormat='5')">
+ <xsl:element name="演:页码格式">
+ <xsl:attribute name="uof:locID">p0005</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$PageNumberFormat='0'">upper-letter</xsl:when>
+ <xsl:when test="$PageNumberFormat='1'">lower-letter</xsl:when>
+ <xsl:when test="$PageNumberFormat='2'">upper-roman</xsl:when>
+ <xsl:when test="$PageNumberFormat='3'">lower-letter</xsl:when>
+ <xsl:when test="$PageNumberFormat='4'">decimal</xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="演:纸张方向">
+ <xsl:attribute name="uof:locID">p0006</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="style:page-layout-properties/@style:print-orientation">
+ <xsl:value-of select="style:page-layout-properties/@style:print-orientation"/>
+ </xsl:when>
+ <xsl:otherwise>portrait</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="obtain_anim_type">
+ <xsl:param name="flytype"/>
+ <xsl:variable name="flytypestr" select="substring-after($flytype,'from-')"/>
+ <xsl:choose>
+ <xsl:when test="contains($flytypestr,'-')">
+ <xsl:value-of select="concat(substring-before($flytypestr,'-'),substring-after($flytypestr,'-'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$flytypestr"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="cm2pt">
+ <xsl:param name="cmval"/>
+ <xsl:value-of select="substring-before($cmval,$uofUnit)* $cm-to-other "/>
+ </xsl:template>
+ <xsl:template match="office:font-face-decls">
+ <uof:字体集 uof:locID="u0040">
+ <uof:默认字体 uof:ascii="Times New Roman" uof:fareast="宋体" uof:h-ansi="宋体" uof:cs="宋体"/>
+ <xsl:for-each select="style:font-face">
+ <xsl:element name="uof:字体声明">
+ <xsl:attribute name="uof:attrList">标识符 名称 字体族</xsl:attribute>
+ <xsl:attribute name="uof:locID">u0041</xsl:attribute>
+ <xsl:attribute name="uof:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="uof:字体族"><xsl:value-of select="@svg:font-family"/></xsl:attribute>
+ <xsl:if test="@style:font-charset= '02'">
+ <xsl:attribute name="uof:字符集">x-symbol</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@style:font-family-generic">
+ <xsl:choose>
+ <xsl:when test="@style:font-family-generic = 'swiss'">
+ <xsl:attribute name="uof:字体族">Swiss</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='modern'">
+ <xsl:attribute name="uof:字符集">Modern</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic='roman'">
+ <xsl:attribute name="uof:字符集">Roman</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='script'">
+ <xsl:attribute name="uof:字符集">Script</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='decorative'">
+ <xsl:attribute name="uof:字符集">Decorative</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='system'">
+ <xsl:attribute name="uof:字符集">System</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="uof:字符集">System</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="style:font-decl"/>
+ </uof:字体集>
+ </xsl:template>
+ <xsl:template match="office:meta">
+ <uof:元数据 uof:locID="u0001">
+ <uof:标题 uof:locID="u0002">
+ <xsl:value-of select="dc:title"/>
+ </uof:标题>
+ <uof:创建应用程序 uof:locID="u0011">
+ <xsl:value-of select="meta:generator"/>
+ </uof:创建应用程序>
+ <uof:摘要 uof:locID="u0007">
+ <xsl:value-of select="dc:description"/>
+ </uof:摘要>
+ <uof:主题 uof:locID="u0003">
+ <xsl:value-of select="dc:subject"/>
+ </uof:主题>
+ <uof:创建者 uof:locID="u0004"/>
+ <uof:作者 uof:locID="u0005">
+ <xsl:value-of select="meta:initial-creator"/>
+ </uof:作者>
+ <uof:创建日期 uof:locID="u0008">
+ <xsl:value-of select="meta:creation-date"/>
+ </uof:创建日期>
+ <uof:最后作者 uof:locID="u0006">
+ <xsl:value-of select="dc:creator"/>
+ </uof:最后作者>
+ <uof:关键字集 uof:locID="u0014">
+ <xsl:for-each select=".">
+ <uof:关键字 uof:locID="u0015">
+ <xsl:value-of select="meta:keywords/@meta:keyword"/>
+ </uof:关键字>
+ </xsl:for-each>
+ </uof:关键字集>
+ <uof:编辑次数 uof:locID="u0009">
+ <xsl:value-of select="meta:editing-cycles"/>
+ </uof:编辑次数>
+ <xsl:if test="meta:editing-duration">
+ <uof:编辑时间 uof:locID="u0010">
+ <xsl:value-of select="meta:editing-duration"/>
+ </uof:编辑时间>
+ </xsl:if>
+ <xsl:if test="meta:template/@xlink:href">
+ <uof:文档模板 uof:locID="u0013">
+ <xsl:value-of select="meta:template/@xlink:href"/>
+ </uof:文档模板>
+ </xsl:if>
+ <xsl:if test="meta:user-defined/@meta:name">
+ <uof:用户自定义元数据集 uof:locID="u0016">
+ <xsl:for-each select="meta:user-defined">
+ <uof:用户自定义元数据 uof:locID="u0017" uof:attrList="名称 类型">
+ <xsl:attribute name="uof:名称"><xsl:value-of select="@meta:name"/></xsl:attribute>
+ <xsl:attribute name="uof:类型"><xsl:value-of select="'string'"/></xsl:attribute>
+ </uof:用户自定义元数据>
+ </xsl:for-each>
+ </uof:用户自定义元数据集>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:page-count">
+ <uof:页数 uof:locID="u0020">
+ <xsl:value-of select="meta:document-statistic/@meta:page-count"/>
+ </uof:页数>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:paragraph-count">
+ <uof:段落数 uof:locID="u0025">
+ <xsl:value-of select="meta:document-statistic/@meta:paragraph-count"/>
+ </uof:段落数>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:object-count">
+ <uof:对象数 uof:locID="u0026">
+ <xsl:value-of select="meta:document-statistic/@meta:object-count"/>
+ </uof:对象数>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:character-count">
+ <uof:字数 uof:locID="u0021">
+ <xsl:value-of select="meta:document-statistic/@meta:character-count"/>
+ </uof:字数>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:word-count">
+ <uof:中文字符数 uof:locID="u0023">
+ <xsl:value-of select="meta:document-statistic/@meta:word-count"/>
+ </uof:中文字符数>
+ </xsl:if>
+ </uof:元数据>
+ </xsl:template>
+ <xsl:template name="填充">
+ <xsl:param name="picname"/>
+ <xsl:param name="nodename"/>
+ <xsl:choose>
+ <xsl:when test="@draw:fill='gradient'">
+ <xsl:variable name="gradient-name">
+ <xsl:value-of select="@draw:fill-gradient-name"/>
+ </xsl:variable>
+ <xsl:for-each select="/descendant::draw:gradient[@draw:name=$gradient-name]">
+ <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
+ <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
+ <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
+ <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
+ <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
+ <xsl:variable name="angle">
+ <xsl:value-of select="@draw:angle div 10"/>
+ </xsl:variable>
+ <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
+ <xsl:if test="@draw:cx">
+ <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@draw:cy">
+ <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="图:类型">-2</xsl:attribute>
+ </图:渐变>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="@draw:fill='bitmap'">
+ <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
+ <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(@style:repeat)">title</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="@style:repeat = 'repeat'">title</xsl:when><xsl:when test="@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:图形引用"><xsl:value-of select="@draw:fill-image-name"/></xsl:attribute>
+ <xsl:attribute name="图:类型">png</xsl:attribute>
+ <xsl:attribute name="图:名称"><xsl:value-of select="concat($picname,'_b1')"/></xsl:attribute>
+ </图:图片>
+ </xsl:when>
+ <xsl:when test="@draw:fill='hatch'">
+ <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
+ <xsl:attribute name="图:类型"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:name"/></xsl:attribute>
+ <xsl:attribute name="图:图形引用"/>
+ <xsl:attribute name="图:前景色"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:color"/></xsl:attribute>
+ <xsl:attribute name="图:背景色"><xsl:choose><xsl:when test="@draw:fill-color"><xsl:value-of select="@draw:fill-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
+ </图:图案>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$nodename='draw:frame'">
+ <xsl:if test="@draw:fill='solid'">
+ <图:颜色 uof:locID="g0034">
+ <xsl:value-of select="@draw:fill-color"/>
+ </图:颜色>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <图:颜色 uof:locID="g0034">
+ <xsl:choose>
+ <xsl:when test="@draw:fill-color">
+ <xsl:value-of select="@draw:fill-color"/>
+ </xsl:when>
+ <xsl:otherwise>#99ccff</xsl:otherwise>
+ </xsl:choose>
+ </图:颜色>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="字:缩进类型">
+ <xsl:if test="style:list-level-properties/@text:space-before">
+ <字:左 uof:locID="t0182">
+ <字:绝对 uof:locID="t0185" uof:attrList="值">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:list-level-properties/@text:space-before,$uofUnit)"/></xsl:attribute>
+ </字:绝对>
+ </字:左>
+ </xsl:if>
+ <xsl:if test="style:list-level-properties/@text:min-label-width">
+ <字:右 uof:locID="t0183">
+ <字:绝对 uof:locID="t0187" uof:attrList="值">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:list-level-properties/@text:min-label-width,$uofUnit)"/></xsl:attribute>
</字:绝对>
- </字:右>
- </xsl:if>
- <xsl:if test="style:list-level-properties/@text:min-label-distance">
- <字:首行 uof:locID="t0184">
- <字:绝对 uof:locID="t0189" uof:attrList="值">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:list-level-properties/@text:min-label-distance,$uofUnit)"/></xsl:attribute>
+ </字:右>
+ </xsl:if>
+ <xsl:if test="style:list-level-properties/@text:min-label-distance">
+ <字:首行 uof:locID="t0184">
+ <字:绝对 uof:locID="t0189" uof:attrList="值">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:list-level-properties/@text:min-label-distance,$uofUnit)"/></xsl:attribute>
</字:绝对>
- </字:首行>
- </xsl:if>
- </xsl:template>
- <xsl:template name="uof:线型类型">
- <xsl:param name="lineType"/>
- <xsl:choose>
- <xsl:when test="$lineType='single-line'">single</xsl:when>
- <xsl:when test="$lineType='double-line'">double</xsl:when>
- <xsl:when test="$lineType='single'">single</xsl:when>
- <xsl:when test="$lineType='double'">double</xsl:when>
- <xsl:when test="$lineType='dash'">dash</xsl:when>
- <xsl:when test="$lineType='long-dash'">dash-long</xsl:when>
- <xsl:when test="$lineType='dot-dash'">dot-dash</xsl:when>
- <xsl:when test="$lineType='dot-dot-dash'">dot-dot-dash</xsl:when>
- <xsl:when test="$lineType='wave'">wave</xsl:when>
- <xsl:when test="$lineType='bold-dotted'">dotted-heavy</xsl:when>
- <xsl:when test="$lineType='bold-dash'">dashed-heavy</xsl:when>
- <xsl:when test="$lineType='bold-long-dash'">dash-long-heavy</xsl:when>
- <xsl:when test="$lineType='bold-dot-dash'">dash-dot-heavy</xsl:when>
- <xsl:when test="$lineType='bold-dot-dot-dash'">dash-dot-dot-heavy</xsl:when>
- <xsl:when test="$lineType='bold-wave'">wavy-heavy</xsl:when>
- <xsl:when test="$lineType='double-wave'">wavy-double</xsl:when>
- <xsl:when test="$lineType='bold'">bold</xsl:when>
- <xsl:when test="$lineType='small-wave'">wave</xsl:when>
- <xsl:when test="$lineType='dotted'">dotted</xsl:when>
- <xsl:when test="$lineType='none'">none</xsl:when>
- </xsl:choose>
- </xsl:template>
+ </字:首行>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="uof:线型类型">
+ <xsl:param name="lineType"/>
+ <xsl:choose>
+ <xsl:when test="$lineType='single-line'">single</xsl:when>
+ <xsl:when test="$lineType='double-line'">double</xsl:when>
+ <xsl:when test="$lineType='single'">single</xsl:when>
+ <xsl:when test="$lineType='double'">double</xsl:when>
+ <xsl:when test="$lineType='dash'">dash</xsl:when>
+ <xsl:when test="$lineType='long-dash'">dash-long</xsl:when>
+ <xsl:when test="$lineType='dot-dash'">dot-dash</xsl:when>
+ <xsl:when test="$lineType='dot-dot-dash'">dot-dot-dash</xsl:when>
+ <xsl:when test="$lineType='wave'">wave</xsl:when>
+ <xsl:when test="$lineType='bold-dotted'">dotted-heavy</xsl:when>
+ <xsl:when test="$lineType='bold-dash'">dashed-heavy</xsl:when>
+ <xsl:when test="$lineType='bold-long-dash'">dash-long-heavy</xsl:when>
+ <xsl:when test="$lineType='bold-dot-dash'">dash-dot-heavy</xsl:when>
+ <xsl:when test="$lineType='bold-dot-dot-dash'">dash-dot-dot-heavy</xsl:when>
+ <xsl:when test="$lineType='bold-wave'">wavy-heavy</xsl:when>
+ <xsl:when test="$lineType='double-wave'">wavy-double</xsl:when>
+ <xsl:when test="$lineType='bold'">bold</xsl:when>
+ <xsl:when test="$lineType='small-wave'">wave</xsl:when>
+ <xsl:when test="$lineType='dotted'">dotted</xsl:when>
+ <xsl:when test="$lineType='none'">none</xsl:when>
+ </xsl:choose>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl b/filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl
index 565d890d7800..062600f54e59 100644
--- a/filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl
+++ b/filter/source/xslt/export/uof/odf2uof_spreadsheet.xsl
@@ -17,6195 +17,6195 @@
* 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:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0" exclude-result-prefixes="office style text table draw fo xlink dc meta number presentation svg chart dr3d math form script config ooo ooow oooc dom xforms smil anim">
- <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
- <xsl:variable name="scValueWithUnit">
- <xsl:value-of select="/office:document/office:automatic-styles/style:style[@style:name='co1']/style:table-column-properties/@style:column-width"/>
- </xsl:variable>
- <xsl:variable name="uofUnit">
- <xsl:choose>
- <xsl:when test="contains($scValueWithUnit,'in')">inch</xsl:when>
- <xsl:when test="contains($scValueWithUnit,'cm')">cm</xsl:when>
- <xsl:when test="contains($scValueWithUnit,'mm')">mm</xsl:when>
- <xsl:when test="contains($scValueWithUnit,'pt')">pt</xsl:when>
- <xsl:otherwise>inch</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="ooUnit">
- <xsl:choose>
- <xsl:when test="contains($scValueWithUnit,'inch')">inch</xsl:when>
- <xsl:when test="contains($scValueWithUnit,'cm')">cm</xsl:when>
- <xsl:when test="contains($scValueWithUnit,'mm')">mm</xsl:when>
- <xsl:when test="contains($scValueWithUnit,'pt')">pt</xsl:when>
- <xsl:otherwise>inch</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="office:document">
- <uof:UOF xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" uof:language="cn" uof:locID="u0000" uof:version="1.0" uof:mimetype="vnd.uof.spreadsheet">
- <xsl:apply-templates select="/office:document/office:meta"/>
- <uof:对象集 uof:locID="u0033">
- <xsl:if test="/office:document/office:body/office:spreadsheet/table:table//table:table-cell/office:annotation">
- <xsl:for-each select="/office:document/office:body/office:spreadsheet/table:table//table:table-cell/office:annotation">
- <xsl:variable name="num">
- <xsl:value-of select="substring-after(@draw:style-name,'gr')"/>
- </xsl:variable>
- <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
- <xsl:attribute name="图:标识符"><xsl:value-of select="concat('pz',$num)"/></xsl:attribute>
- <xsl:variable name="name" select="@draw:style-name"/>
- <图:预定义图形 uof:locID="g0005">
- <图:属性 uof:locID="g0011">
- <xsl:for-each select="/office:document/office:automatic-styles/style:style[@style:name=$name]">
- <xsl:call-template name="graphicattr"/>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="@svg:x1">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- <xsl:when test="@svg:x">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- <xsl:when test="@svg:width">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- </xsl:choose>
- <图:旋转角度 uof:locID="g0025">
- <xsl:choose>
- <xsl:when test="@draw:transform">
- <xsl:variable name="rotate-angle">
- <xsl:value-of select="@draw:transform"/>
- </xsl:variable>
- <xsl:variable name="rotate-temp">
- <xsl:value-of select="substring-before(substring-after($rotate-angle,'rotate ('),')')"/>
- </xsl:variable>
- <xsl:value-of select="($rotate-temp * 360) div (2 * 3.14159265)"/>
- </xsl:when>
- <xsl:otherwise>0.0</xsl:otherwise>
- </xsl:choose>
- </图:旋转角度>
- <图:X-缩放比例 uof:locID="g0026">1</图:X-缩放比例>
- <图:Y-缩放比例 uof:locID="g0027">1</图:Y-缩放比例>
- <图:锁定纵横比 uof:locID="g0028">0</图:锁定纵横比>
- <图:相对原始比例 uof:locID="g0029">1</图:相对原始比例>
- <图:打印对象 uof:locID="g0032">true</图:打印对象>
- <图:Web文字 uof:locID="g0033"/>
- </图:属性>
- </图:预定义图形>
- <图:文本内容 uof:locID="g0002" uof:attrList="文本框 左边距 右边距 上边距 下边距 水平对齐 垂直对齐 文字排列方向 自动换行 大小适应文字 前一链接 后一链接">
- <xsl:for-each select="/office:document/office:automatic-styles/style:style[@style:name=$name]">
- <xsl:attribute name="图:文字排列方向"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-lr'">vert-l2r</xsl:when></xsl:choose></xsl:when><xsl:when test="style:graphic-properties/@draw:textarea-horizontal-align='right'">hori-r2l</xsl:when><xsl:otherwise>hori-l2r</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="style:graphic-properties/@draw:textarea-horizontal-align">
- <xsl:attribute name="图:水平对齐"><xsl:value-of select="style:graphic-properties/@draw:textarea-horizontal-align"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:textarea-vertical-align">
- <xsl:attribute name="图:垂直对齐"><xsl:value-of select="style:graphic-properties/@draw:textarea-vertical-align"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@fo:wrap-option">
- <xsl:attribute name="图:自动换行">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:auto-grow-width='true' and style:graphic-properties/@draw:auto-grow-height='true'">
- <xsl:attribute name="图:大小适应文字">true</xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="./text:p">
- <xsl:call-template name="textp"/>
- </xsl:for-each>
- </图:文本内容>
- </图:图形>
- </xsl:for-each>
- </xsl:if>
- <xsl:for-each select="/office:document/office:body/office:spreadsheet/table:table//table:table-cell/office:annotation">
- <xsl:variable name="name1" select="@draw:style-name"/>
- <xsl:for-each select="/office:document/office:automatic-styles/style:style[@style:name=$name1]">
- <xsl:if test="style:graphic-properties/@draw:fill-image-name">
- <xsl:variable name="bsh">
- <xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/>
- </xsl:variable>
- <xsl:for-each select="/office:document/office:styles/draw:fill-image">
- <xsl:if test="@draw:name=$bsh">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($name1,'_b1')"/></xsl:attribute>
- <xsl:attribute name="uof:公共类型">png</xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="office:binary-data"/>
- </uof:数据>
- </uof:其他对象>
- </xsl:if>
- </xsl:for-each>
- </xsl:if>
- </xsl:for-each>
- </xsl:for-each>
- <xsl:for-each select="/office:document/office:body/office:spreadsheet/table:table/table:shapes/child::* | /office:document/office:body/office:spreadsheet/table:table/table:table-row/table:table-cell/child::*">
- <xsl:if test="starts-with(name(.),'draw:')">
- <xsl:choose>
- <xsl:when test="name(.)='draw:frame' and self::node()/draw:object">
- <xsl:for-each select="draw:image">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('chart_image_',count(preceding::draw:fill-image))"/></xsl:attribute>
- <xsl:attribute name="uof:公共类型">png</xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="office:binary-data"/>
- </uof:数据>
- </uof:其他对象>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="draw">
- <xsl:with-param name="nodename1" select="name(.)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </uof:对象集>
- <xsl:if test="/office:document/office:body//text:bookmark-start">
- <uof:书签集 uof:locID="u0027">
- <xsl:for-each select="/office:document/office:body//text:bookmark-start">
- <xsl:element name="uof:书签">
- <xsl:attribute name="uof:名称"><xsl:value-of select="@text:name"/></xsl:attribute>
- <xsl:attribute name="uof:locID">u0028</xsl:attribute>
- <xsl:attribute name="uof:attrList">名称</xsl:attribute>
- <xsl:element name="uof:文本位置">
- <xsl:attribute name="字:区域引用"><xsl:value-of select="concat('bk_',@text:name)"/></xsl:attribute>
- <xsl:attribute name="uof:locID">u0029</xsl:attribute>
- <xsl:attribute name="uof:attrList">区域引用</xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </uof:书签集>
- </xsl:if>
- <xsl:if test="/office:document/office:body/text:p/text:a">
- <uof:链接集 uof:locID="u0031">
- <xsl:for-each select="/office:document/office:body/text:p/text:a">
- <!--chengxz 要改-->
- <xsl:variable name="hyperStr" select="@xlink:href"/>
- <xsl:element name="uof:超级链接">
- <xsl:if test="contains($hyperStr,'#')">
- <xsl:attribute name="uof:书签"><xsl:value-of select="substring-after($hyperStr,'#')"/></xsl:attribute>
- </xsl:if>
- <!--暂时不写uof:提示-->
- <xsl:attribute name="uof:链源">hlnk<xsl:number from="/office:document/office:body" level="any" count="text:p[text:a]"/></xsl:attribute>
- <xsl:if test="contains($hyperStr,'http://') or contains($hyperStr,'mailto')">
- <xsl:attribute name="uof:目标"><xsl:value-of select="$hyperStr"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="uof:locID">u0032</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 目标 书签 式样引用 已访问式样引用 提示 链源</xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </uof:链接集>
- </xsl:if>
- <uof:式样集 uof:locID="u0039">
- <xsl:apply-templates select="/office:document/office:font-face-decls"/>
- <xsl:apply-templates select="/office:document/office:styles/style:style" mode="styles"/>
- <xsl:apply-templates select="/office:document/office:automatic-styles/style:style" mode="styles">
- <xsl:with-param name="isAutomatic" select="true()"/>
- </xsl:apply-templates>
- </uof:式样集>
- <uof:电子表格 uof:locID="u0049">
- <表:公用处理规则 uof:locID="s0000">
- <表:度量单位 uof:locID="s0001">
- <xsl:value-of select="$uofUnit"/>
- </表:度量单位>
- <xsl:apply-templates select="/office:document/office:body/office:spreadsheet/table:calculation-settings" mode="common"/>
- <xsl:apply-templates select="/office:document/office:body/office:spreadsheet/table:content-validations" mode="common"/>
- <xsl:if test="/office:document/office:automatic-styles/style:style[@style:family='table-cell' and style:map]">
- <xsl:element name="表:条件格式化集">
- <xsl:attribute name="uof:locID">s0016</xsl:attribute>
- <xsl:call-template name="create-condition-format"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="/office:document/office:body/office:spreadsheet/table:database-ranges/table:database-range">
- <表:区域公式集 uof:locID="s0122">
- <表:区域公式 uof:locID="s0123" uof:attrList="类型">
- <xsl:attribute name="表:类型">table</xsl:attribute>
- <xsl:for-each select="/office:document/office:body/office:spreadsheet/table:database-ranges/table:database-range">
- <表:区域 uof:locID="s0007">
- <xsl:value-of select="@table:target-range-address"/>
- </表:区域>
- <表:公式 uof:locID="s0125"/>
- </xsl:for-each>
- </表:区域公式>
- </表:区域公式集>
- </xsl:if>
- <表:是否RC引用 uof:locID="s0124" uof:attrList="值" 表:值="false"/>
- </表:公用处理规则>
- <表:主体 uof:locID="s0024">
- <xsl:apply-templates select="office:body"/>
- </表:主体>
- </uof:电子表格>
- </uof:UOF>
- </xsl:template>
- <xsl:template match="office:body">
- <xsl:apply-templates select="office:spreadsheet"/>
- </xsl:template>
- <xsl:template match="office:spreadsheet">
- <xsl:apply-templates select="./*"/>
- </xsl:template>
- <xsl:template match="office:meta">
- <uof:元数据 uof:locID="u0001">
- <uof:标题 uof:locID="u0002">
- <xsl:value-of select="dc:title"/>
- </uof:标题>
- <uof:创建应用程序 uof:locID="u0011">
- <xsl:value-of select="meta:generator"/>
- </uof:创建应用程序>
- <uof:摘要 uof:locID="u0007">
- <xsl:value-of select="dc:description"/>
- </uof:摘要>
- <uof:主题 uof:locID="u0003">
- <xsl:value-of select="dc:subject"/>
- </uof:主题>
- <uof:创建者 uof:locID="u0004"/>
- <uof:作者 uof:locID="u0005">
- <xsl:value-of select="meta:initial-creator"/>
- </uof:作者>
- <uof:创建日期 uof:locID="u0008">
- <xsl:value-of select="meta:creation-date"/>
- </uof:创建日期>
- <xsl:if test="dc:creator">
- <uof:最后作者 uof:locID="u0006">
- <xsl:value-of select="dc:creator"/>
- </uof:最后作者>
- </xsl:if>
- <uof:关键字集 uof:locID="u0014">
- <uof:关键字 uof:locID="u0015">
- <xsl:value-of select="meta:keyword"/>
- </uof:关键字>
- </uof:关键字集>
- <uof:编辑次数 uof:locID="u0009">
- <xsl:value-of select="meta:editing-cycles"/>
- </uof:编辑次数>
- <xsl:if test="meta:editing-duration">
- <uof:编辑时间 uof:locID="u0010">
- <xsl:value-of select="meta:editing-duration"/>
- </uof:编辑时间>
- </xsl:if>
- <xsl:if test="meta:template/@xlink:href">
- <uof:文档模板 uof:locID="u0013">
- <xsl:value-of select="meta:template/@xlink:href"/>
- </uof:文档模板>
- </xsl:if>
- <xsl:if test="meta:user-defined/@meta:name">
- <uof:用户自定义元数据集 uof:locID="u0016">
- <xsl:for-each select="meta:user-defined">
- <uof:用户自定义元数据 uof:locID="u0017" uof:attrList="名称 类型">
- <xsl:attribute name="uof:名称"><xsl:value-of select="@meta:name"/></xsl:attribute>
- <xsl:attribute name="uof:类型"><xsl:value-of select="'string'"/></xsl:attribute>
- <xsl:value-of select="."/>
- </uof:用户自定义元数据>
- </xsl:for-each>
- </uof:用户自定义元数据集>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:page-count">
- <uof:页数 uof:locID="u0020">
- <xsl:value-of select="meta:document-statistic/@meta:page-count"/>
- </uof:页数>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:paragraph-count">
- <uof:段落数 uof:locID="u0025">
- <xsl:value-of select="meta:document-statistic/@meta:paragraph-count"/>
- </uof:段落数>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:object-count">
- <uof:对象数 uof:locID="u0026">
- <xsl:value-of select="meta:document-statistic/@meta:object-count"/>
- </uof:对象数>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:character-count">
- <uof:字数 uof:locID="u0021">
- <xsl:value-of select="meta:document-statistic/@meta:character-count"/>
- </uof:字数>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:word-count">
- <uof:中文字符数 uof:locID="u0023">
- <xsl:value-of select="meta:document-statistic/@meta:word-count"/>
- </uof:中文字符数>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:character-count - meta:document-statistic/@meta:word-count">
- <uof:英文字符数 uof:locID="u0022">
- <xsl:value-of select="meta:document-statistic/@meta:character-count - meta:document-statistic/@meta:word-count"/>
- </uof:英文字符数>
- </xsl:if>
- <xsl:if test="meta:document-statistic/@meta:character-count">
- <uof:行数 uof:locID="u0024">
- <xsl:variable name="quzhi">
- <xsl:value-of select="(meta:document-statistic/@meta:character-count div 39) + 0.9"/>
- </xsl:variable>
- <xsl:value-of select="substring-before($quzhi,'.')"/>
- </uof:行数>
- </xsl:if>
- <xsl:if test="meta:user-defined[@meta:name='Category']">
- <uof:分类 uof:locID="u0012">
- <xsl:value-of select="meta:user-defined[@meta:name='Category']"/>
- </uof:分类>
- </xsl:if>
- <xsl:if test="meta:user-defined[@meta:name='Manager']">
- <uof:经理名称 uof:locID="u0019">
- <xsl:value-of select="meta:user-defined[meta:name='Manager']"/>
- </uof:经理名称>
- </xsl:if>
- <xsl:if test="meta:user-defined[@meta:name='Company']">
- <uof:公司名称 uof:locID="u0018">
- <xsl:value-of select="meta:user-defined[meta:name='Company']"/>
- </uof:公司名称>
- </xsl:if>
- </uof:元数据>
- </xsl:template>
- <xsl:template match="table:table">
- <xsl:element name="表:工作表">
- <xsl:attribute name="uof:locID">s0025</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 隐藏 背景 式样引用</xsl:attribute>
- <xsl:attribute name="表:标识符"><xsl:value-of select="@table:name"/></xsl:attribute>
- <xsl:attribute name="表:名称"><xsl:value-of select="@table:name"/></xsl:attribute>
- <xsl:attribute name="表:隐藏"><xsl:choose><xsl:when test="@table:style-name='ta1'"><xsl:value-of select="'false'"/></xsl:when><xsl:otherwise><xsl:value-of select="'true'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="表:背景"><xsl:choose><xsl:when test="/office:document/office:automatic-styles/style:page-master/style:table-properties/@fo:background-color"><xsl:value-of select="/office:document/office:automatic-styles/style:page-master/style:table-properties/@fo:background-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="表:式样引用"><xsl:value-of select="@table:style-name"/></xsl:attribute>
- <xsl:element name="表:工作表属性">
- <xsl:attribute name="uof:locID">s0026</xsl:attribute>
- <表:标签前景色 uof:locID="s0027">#000000</表:标签前景色>
- <表:标签背景色 uof:locID="s0028">#ffffff</表:标签背景色>
- <xsl:call-template name="create-page-setting">
- <xsl:with-param name="master-page" select="/*/office:master-styles/style:master-page"/>
- <xsl:with-param name="page-master-style" select="/*/office:automatic-styles/style:page-layout/style:page-layout-properties"/>
- </xsl:call-template>
- <xsl:call-template name="create-view">
- <xsl:with-param name="table-name" select="/*/office:body/office:spreadsheet/table:table/@table:name"/>
- <xsl:with-param name="view-id" select="count(preceding-sibling::table:table) + 1"/>
- <xsl:with-param name="aaa" select="/*/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry"/>
- </xsl:call-template>
- </xsl:element>
- <xsl:call-template name="table"/>
- <xsl:variable name="filter" select="/*/office:body/office:spreadsheet/table:database-ranges/table:database-range"/>
- <xsl:if test="$filter">
- <xsl:variable name="target-range-address" select="//table:database-range[table:filter]/@table:target-range-address"/>
- <xsl:element name="表:筛选">
- <xsl:attribute name="uof:locID">s0101</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="$filter/@table:display-filter-buttons">auto</xsl:when><xsl:otherwise>advance</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:element name="表:范围">
- <xsl:attribute name="uof:locID">s0102</xsl:attribute>
- <xsl:value-of select="$filter/@table:target-range-address"/>
- </xsl:element>
- <xsl:variable name="column-and-row" select="substring-before(substring-after($target-range-address,'.'),':')"/>
- <xsl:variable name="dd" select="number(substring($column-and-row,2,1))"/>
- <xsl:variable name="zone-left-column-string">
- <xsl:choose>
- <xsl:when test="contains($dd,'NaN') ">
- <xsl:value-of select="substring($column-and-row,1,2)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($column-and-row,1,1)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="zone-left-column-num">
- <xsl:call-template name="translate-column-char-to-number">
- <xsl:with-param name="string" select="$zone-left-column-string"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="create-filter-conditions">
- <xsl:with-param name="filter-condition-set" select="$filter//table:filter-condition"/>
- <xsl:with-param name="zone-left-column-num" select="$zone-left-column-num"/>
- </xsl:call-template>
- <xsl:if test="$filter/@table:condition-source-range-address">
- <xsl:element name="表:条件区域">
- <xsl:attribute name="uof:locID">s0108</xsl:attribute>
- <xsl:value-of select="$filter/@table:condition-source-range-address"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$filter/@table:display-duplicates">
- <xsl:element name="表:结果区域">
- <xsl:attribute name="uof:locID">s0109</xsl:attribute>
- <xsl:value-of select="$filter/@table:display-duplicates"/>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="key('styles', .//@table:style-name)/style:table-row-properties/@fo:break-before = 'page' or key('styles',.//@table:style-name)/style:table-column-properties/@fo:break-before='page'">
- <xsl:element name="表:分页符集">
- <xsl:attribute name="uof:locID">s0111</xsl:attribute>
- <xsl:call-template name="分页符集"/>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:param name="tableElement" select="'表:工作表内容'"/>
- <xsl:param name="rowElement" select="'表:行'"/>
- <!--xsl:param name="cellElement" select="'表:单元格'" /-->
- <!-- ************** -->
- <!-- *** Table *** -->
- <!-- ************** -->
- <xsl:template name="table">
- <!-- 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:if>
- </xsl:template>
- <xsl:template name="create-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')] | table:table-header-rows/descendant::table:table-row[not(@table:visibility = 'collapse' or @table:visibility = 'filter')] | table:table-row-group/descendant::table:table-row[not(@table:visibility = 'collapse' or @table:visibility = 'filter')]"/>
- <xsl:call-template name="create-table-element">
- <xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template name="create-table-element">
- <xsl:param name="allVisibleTableRows"/>
- <xsl:element name="表:工作表内容">
- <xsl:attribute name="uof:locID">s0018</xsl:attribute>
- <xsl:attribute name="uof:attrList">最大行 最大列 缺省行高 缺省列宽</xsl:attribute>
- <xsl:variable name="group-column" select="./table:table-column-group"/>
- <xsl:variable name="group-row" select="./table:table-row-group"/>
- <xsl:apply-templates select="@table:style-name"/>
- <xsl:for-each select="table:table-column">
- <表:列 uof:locID="s0048" uof:attrList="列号 隐藏 列宽 式样引用 跨度">
- <xsl:attribute name="表:列号"><xsl:value-of select="position()"/></xsl:attribute>
- <xsl:if test="@table:visibility">
- <xsl:attribute name="表:隐藏"><xsl:choose><xsl:when test="@table:visibility='collapse'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="表:列宽"><xsl:value-of select="substring-before(key('styles',@table:style-name)/style:table-column-properties/@style:column-width,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="表:式样引用"><xsl:value-of select="@table:style-name"/></xsl:attribute>
- <xsl:attribute name="表:跨度"><xsl:choose><xsl:when test="@table:number-columns-repeated"><xsl:value-of select="@table:number-columns-repeated"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
- </表:列>
- </xsl:for-each>
- <xsl:variable name="columnNodes" select="table:table-column"/>
- <xsl:variable name="columnsRepeated" select="table:table-column/@table:number-columns-repeated"/>
- <xsl:variable name="columnCount">
- <xsl:choose>
- <xsl:when test="$columnNodes[last()]/@table:number-columns-repeated &gt; 99">
- <xsl:value-of select="count($columnNodes)+ number(sum($columnsRepeated))- count($columnsRepeated)- $columnNodes[last()]/@table:number-columns-repeated+ 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="count($columnNodes)+ number(sum($columnsRepeated))- count($columnsRepeated)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="table-name" select="@table:name"/>
- <xsl:apply-templates select="table:table-row">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- </xsl:apply-templates>
- <xsl:if test="table:table-row-group//table:table-row">
- <xsl:apply-templates select="table:table-row-group//table:table-row">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:for-each select="table:shapes/child::*">
- <xsl:if test="starts-with(name(.),'draw:')">
- <xsl:choose>
- <xsl:when test="name(.)='draw:frame' and self::node()/draw:object">
- <xsl:call-template name="draw:chart-frame">
- <xsl:with-param name="table-name" select="$table-name"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="uof锚点"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="table:table-row-group or table:table-column-group">
- <xsl:element name="表:分组集">
- <xsl:attribute name="uof:locID">s0098</xsl:attribute>
- <xsl:for-each select="table:table-column-group">
- <xsl:variable name="numcolumnrep" select="count(descendant::table:table-column[@table:number-columns-repeated])"/>
- <xsl:variable name="numrep" select="sum(descendant::table:table-column/@table:number-columns-repeated)"/>
- <xsl:variable name="numcolumn" select="count(descendant::table:table-column)"/>
- <xsl:call-template name="table:table-column-group">
- <xsl:with-param name="start" select="count(preceding::table:table-column)"/>
- <xsl:with-param name="end" select="count(preceding::table:table-column) + $numrep + $numcolumn - $numcolumnrep"/>
- </xsl:call-template>
- </xsl:for-each>
- <xsl:for-each select="table:table-row-group">
- <xsl:variable name="numrowrep" select="count(descendant::table:table-row[@table:number-rows-repeated])"/>
- <xsl:variable name="numrep" select="sum(descendant::table:table-row/@table:number-rows-repeated)"/>
- <xsl:variable name="numrow" select="count(descendant::table:table-row)"/>
- <xsl:call-template name="table:table-row-group">
- <xsl:with-param name="start" select="count(preceding::table:table-row)"/>
- <xsl:with-param name="end" select="count(preceding::table:table-row) + $numrep + $numrow - $numrowrep"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="table:table-row-group">
- <xsl:param name="start"/>
- <xsl:param name="end"/>
- <xsl:element name="表:行">
- <xsl:attribute name="uof:locID">s0100</xsl:attribute>
- <xsl:attribute name="uof:attrList">起始 终止 隐藏</xsl:attribute>
- <xsl:attribute name="表:起始"><xsl:value-of select="$start + 1"/></xsl:attribute>
- <xsl:attribute name="表:终止"><xsl:value-of select="$end"/></xsl:attribute>
- <xsl:attribute name="表:隐藏"><xsl:choose><xsl:when test="@table:display"><xsl:value-of select="'true'"/></xsl:when><xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:for-each select="table:table-row-group">
- <xsl:call-template name="table:table-row-group">
- <xsl:with-param name="start" select="count(preceding::table:table-row) + number(sum(preceding::table:table-row/@table:number-rows-repeated)) - count(preceding::table:table-row[@table:number-rows-repeated])"/>
- <xsl:with-param name="end" select="count(preceding::table:table-row) + number(sum(preceding::table:table-row/@table:number-rows-repeated)) - count(preceding::table:table-row[@table:number-rows-repeated]) + number(sum(descendant::table:table-row/@table:number-rows-repeated)) + count(descendant::table:table-row) - count(descendant::table:table-row[@table:number-rows-repeated])"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="table:table-column-group">
- <xsl:param name="start"/>
- <xsl:param name="end"/>
- <xsl:element name="表:列">
- <xsl:attribute name="uof:locID">s0099</xsl:attribute>
- <xsl:attribute name="uof:attrList">起始 终止 隐藏</xsl:attribute>
- <xsl:attribute name="表:起始"><xsl:value-of select="$start + 1"/></xsl:attribute>
- <xsl:attribute name="表:终止"><xsl:value-of select="$end"/></xsl:attribute>
- <xsl:attribute name="表:隐藏"><xsl:choose><xsl:when test="@table:display"><xsl:value-of select="'true'"/></xsl:when><xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:for-each select="table:table-column-group">
- <xsl:call-template name="table:table-column-group">
- <xsl:with-param name="start" select="count(preceding::table:table-column) + number(sum(preceding::table:table-column/@table:number-columns-repeated)) - count(preceding::table:table-column[@table:number-columns-repeated])"/>
- <xsl:with-param name="end" select="count(preceding::table:table-column) + number(sum(preceding::table:table-column/@table:number-columns-repeated)) - count(preceding::table:table-column[@table:number-columns-repeated]) + number(sum(descendant::table:table-column/@table:number-columns-repeated)) + count(descendant::table:table-column) - count(descendant::table:table-column[@table:number-columns-repeated])"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="uof锚点">
- <xsl:if test="not(name(.)='draw:glue-point')">
- <xsl:variable name="name">
- <xsl:value-of select="name(.)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="name='draw:a'">
- <xsl:for-each select="child::node( )">
- <xsl:call-template name="uof锚点"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <uof:锚点 uof:locID="u0064" uof:attrList="x坐标 y坐标 宽度 高度 图形引用 随动方式 缩略图 占位符">
- <xsl:attribute name="uof:x坐标"><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="@svg:x"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x1,$uofUnit)"/></xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:y坐标"><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="@svg:y"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:when><xsl:when test="@svg:y1"><xsl:value-of select="substring-before(@svg:y1,$uofUnit)"/></xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:choose><xsl:when test="@svg:width"><xsl:value-of select="substring-before(@svg:width,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/></xsl:when><xsl:when test="name(.)='draw:g'"><xsl:variable name="minx"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:variable name="svgx"><xsl:value-of select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="number(substring-before(descendant::node()[@svg:x][1]/@svg:width,$uofUnit))"/></xsl:variable><xsl:variable name="maxx"><xsl:call-template name="groupmaxx"><xsl:with-param name="value" select="$svgx + $width"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$maxx - $minx"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:高度"><xsl:choose><xsl:when test="@svg:height"><xsl:value-of select="substring-before(@svg:height,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/></xsl:when><xsl:when test="name(.)='draw:g'"><xsl:variable name="miny"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:variable name="svgy"><xsl:value-of select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/></xsl:variable><xsl:variable name="height"><xsl:value-of select="number(substring-before(descendant::node()[@svg:y][1]/@svg:height,$uofUnit))"/></xsl:variable><xsl:variable name="maxy"><xsl:call-template name="groupmaxy"><xsl:with-param name="value" select="$svgy + $height"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$maxy - $miny"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:variable name="refpicname">
- <xsl:choose>
- <xsl:when test="./@draw:style-name">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:when>
- <xsl:when test="./@table:end-cell-address">
- <xsl:value-of select="@table:end-cell-address"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./@draw:id"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="uof:图形引用"><xsl:variable name="picnumber"><xsl:value-of select="count(preceding::*[@draw:style-name=$refpicname])"/></xsl:variable><xsl:value-of select="concat($refpicname,'_',$picnumber)"/></xsl:attribute>
- <xsl:attribute name="uof:随动方式"><xsl:choose><xsl:when test="key('graphicset',$refpicname)/style:graphic-properties/@style:protect"><xsl:for-each select="key('graphicset',$refpicname)/style:graphic-properties"><xsl:choose><xsl:when test="@style:protect='size'">move</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:for-each></xsl:when><xsl:otherwise>movesize</xsl:otherwise></xsl:choose></xsl:attribute>
- </uof:锚点>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <!--end 06.02.14 -->
- <!-- **************** -->
- <!-- *** Columns *** -->
- <!-- **************** -->
- <!--Redoffice comment liliang 06.05.23-->
- <!--xsl:template name="create-table-column">
- <xsl:param name="columnNodes"/>
- <xsl:param name="currentColumn"/>
- <xsl:param name="columnCount"/>
- <xsl:param name="columnNo"/>
- <xsl:param name="columnNodeNo"/>
- <xsl:param name="index"/>
- <xsl:element name="表:列">
- <xsl:attribute name="locID">s0048</xsl:attribute>
- <xsl:attribute name="attrList">列号 隐藏 列宽 式样引用 跨度</xsl:attribute>
- <xsl:if test="$currentColumn/@table:visibility = 'collapse' or $currentColumn/@table:visibility = 'filter'">
- <xsl:attribute name="表:隐藏">true</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="表:跨度"><xsl:choose><xsl:when test="$currentColumn/@table:number-columns-repeated"><xsl:value-of select="$currentColumn/@table:number-columns-repeated - 1"/></xsl:when><xsl:otherwise><xsl:value-of select="'0'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$index">
- <xsl:attribute name="表:列号"><xsl:value-of select="$columnNo"/></xsl:attribute>
- </xsl:if-->
- <!--自动列宽没有,暂略 autofitwidth-->
- <!--Redoffice comment liliang 06.05.22-->
- <!--xsl:variable name="width">
- <xsl:value-of select="key('styles', $currentColumn/@table:style-name)/style:properties/@style:column-width"/>
- </xsl:variable-->
- <!--end-->
- <!--xsl:if test="$width">
- <xsl:attribute name="表:宽度"><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$width"/></xsl:call-template></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="表:跨度"><xsl:choose><xsl:when test="$currentColumn/@table:number-columns-repeated"><xsl:value-of select="$currentColumn/@table:number-columns-repeated - 1"/></xsl:when><xsl:otherwise><xsl:value-of select="'0'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:if test="$columnNo &lt; $columnCount">
- <xsl:choose>
- <xsl:when test="@table:number-columns-repeated">
- <xsl:call-template name="create-table-column">
- <xsl:with-param name="columnNodes" select="$columnNodes"/>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="columnNo" select="$columnNo + $currentColumn/@table:number-columns-repeated"/>
- <xsl:with-param name="columnNodeNo" select="$columnNodeNo + 1"/>
- <xsl:with-param name="currentColumn" select="$columnNodes[$columnNodeNo + 1]"/>
- <xsl:with-param name="index" select="true()"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="create-table-column">
- <xsl:with-param name="columnNodes" select="$columnNodes"/>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="columnNo" select="$columnNo + 1"/>
- <xsl:with-param name="columnNodeNo" select="$columnNodeNo + 1"/>
- <xsl:with-param name="currentColumn" select="$columnNodes[$columnNodeNo + 1]"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template-->
- <!-- ************* -->
- <!-- *** Rows *** -->
- <!-- ************* -->
- <xsl:template match="table:table-row">
- <xsl:param name="table-name"/>
- <xsl:param name="columnCount"/>
- <xsl:choose>
- <xsl:when test="@table:number-rows-repeated &gt; 1">
- <xsl:choose>
- <xsl:when test="(last() or (last() - 1)) and @table:number-rows-repeated &gt; 99">
- <xsl:call-template name="write-table-row">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="lastRow" select="true()"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- In case a cell is being repeated, the cell will be created
- in a variabel, which is as many times given out, as being repeated -->
- <xsl:variable name="tableRow">
- <xsl:call-template name="write-table-row">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="repeat-write-table-row">
- <xsl:with-param name="tableRow" select="$tableRow"/>
- <xsl:with-param name="repetition" select="@table:number-rows-repeated"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="write-table-row">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="write-table-row">
- <xsl:param name="table-name"/>
- <xsl:param name="columnCount"/>
- <xsl:param name="lastRow"/>
- <xsl:element name="表:行">
- <xsl:attribute name="uof:locID">s0049</xsl:attribute>
- <xsl:attribute name="uof:attrList">行号 隐藏 行高 式样引用 跨度</xsl:attribute>
- <xsl:if test="./table:table-cell/@office:value-type">
- <xsl:attribute name="表:行号"><xsl:value-of select="count(preceding::table:table-row[not(@table:number-rows-repeated)])+1+number(sum(preceding::table:table-row[@table:number-rows-repeated]/@table:number-rows-repeated))"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@table:visibility = 'collapse' or @table:visibility = 'filter'">
- <xsl:attribute name="表:隐藏">true</xsl:attribute>
- </xsl:if>
- <!-- although valid, can not be opened with Excel - issue i31949)
- <xsl:if test="$lastRow">
- <xsl:attribute name="ss:Span"><xsl:value-of select="@table:number-rows-repeated - 1" /></xsl:attribute>
- </xsl:if>-->
- <!-- writing the style of the row -->
- <xsl:apply-templates select="@table:style-name"/>
- <xsl:variable name="rowProperties" select="key('styles', @table:style-name)/*"/>
- <!--xsl:if test="$rowProperties/@style:use-optimal-row-height = 'false'">
- <! - - default is '1', therefore write only '0' - ->
- <xsl:attribute name="ss:AutoFitHeight">0</xsl:attribute>
- </xsl:if-->
- <xsl:variable name="height" select="$rowProperties/@style:row-height"/>
- <xsl:if test="$height">
- <xsl:attribute name="表:行高"><!-- using the absolute height in point --><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$height"/></xsl:call-template></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="table:table-cell">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
- <xsl:template name="repeat-write-table-row">
- <xsl:param name="tableRow"/>
- <xsl:param name="repetition"/>
- <xsl:copy-of select="$tableRow"/>
- <xsl:if test="$repetition &gt; 1">
- <xsl:call-template name="repeat-write-table-row">
- <xsl:with-param name="tableRow" select="$tableRow"/>
- <xsl:with-param name="repetition" select="$repetition - 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <!-- ************** -->
- <!-- *** Cells *** -->
- <!-- ************** -->
- <!-- Table cells are able to be repeated by attribute in StarOffice,
- but not in Excel. If more cells are repeated
- (e.g. for emulating background) only as many cells as columns are
- allowed to be written out. -->
- <xsl:template match="table:table-cell">
- <xsl:param name="table-name"/>
- <xsl:param name="columnCount"/>
- <!--xsl:choose>
- <xsl:when test="@table:number-columns-repeated &gt; 1">
- <xsl:variable name="tableCell">
- <xsl:call-template name="write-table-cell"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="not(following-sibling::table:table-cell)">
- <xsl:call-template name="repeat-write-table-cell">
- <xsl:with-param name="tableCell" select="$tableCell"/>
- <xsl:with-param name="repetition" select="@table:number-columns-repeated"/>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="cellNo" select="position()+ sum(preceding-sibling::table:table-cell/@table:number-columns-repeated)- count(preceding-sibling::table:table-cell/@table:number-columns-repeated)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="repeat-write-table-cell">
- <xsl:with-param name="tableCell" select="$tableCell"/>
- <xsl:with-param name="repetition" select="@table:number-columns-repeated"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="write-table-cell"/>
- </xsl:otherwise>
- </xsl:choose-->
- <xsl:choose>
- <xsl:when test="@table:number-columns-repeated">
- <xsl:call-template name="write-table-cell">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="repeat-table-cell-no" select="@table:number-columns-repeated"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="write-table-cell">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="repeat-table-cell-no" select="number(1)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--xsl:template name="repeat-write-table-cell">
- <xsl:param name="tableCell"/>
- <xsl:param name="repetition"/>
- <xsl:param name="columnCount"/>
- <xsl:param name="cellNo"/>
- <xsl:copy-of select="$tableCell"/>
- <xsl:if test="$repetition &gt; 1">
- <xsl:choose>
- <xsl:when test="$cellNo">
- <xsl:if test="$cellNo &lt; $columnCount">
- <xsl:call-template name="repeat-write-table-cell">
- <xsl:with-param name="tableCell" select="$tableCell"/>
- <xsl:with-param name="repetition" select="$repetition - 1"/>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="cellNo" select="$cellNo + 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="repeat-write-table-cell">
- <xsl:with-param name="tableCell" select="$tableCell"/>
- <xsl:with-param name="repetition" select="$repetition - 1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template-->
- <xsl:template name="write-table-cell">
- <xsl:param name="table-name"/>
- <xsl:param name="repeat-table-cell-no"/>
- <xsl:if test="$repeat-table-cell-no &gt; 0">
- <表:单元格 uof:locID="s0050" uof:attrList="列号 式样引用 超链接引用 合并列数 合并行数">
- <xsl:if test="@table:number-columns-spanned &gt; 1">
- <xsl:attribute name="表:合并列数"><xsl:value-of select="@table:number-columns-spanned - 1"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@table:number-rows-spanned &gt; 1">
- <xsl:attribute name="表:合并行数"><xsl:value-of select="@table:number-rows-spanned - 1"/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="link" select="descendant::text:a/@xlink:href"/>
- <xsl:if test="$link">
- <xsl:attribute name="表:超链接引用"><xsl:value-of select="$link"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="@table:style-name">
- <xsl:apply-templates select="@table:style-name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="ancestor::table:table/table:table-column/@table:default-cell-style-name"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="*">
- <xsl:if test="text:p">
- <xsl:variable name="valueType">
- <xsl:choose>
- <xsl:when test="@office:value-type">
- <xsl:value-of select="@office:value-type"/>
- </xsl:when>
- <xsl:otherwise>string</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="表的数据">
- <xsl:with-param name="valueType" select="$valueType"/>
- <xsl:with-param name="cellStyleName" select="@table:style-name"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="office:annotation">
- <xsl:element name="表:批注">
- <xsl:attribute name="uof:locID">s0053</xsl:attribute>
- <xsl:attribute name="uof:attrList">是否显示</xsl:attribute>
- <xsl:attribute name="表:是否显示"><xsl:choose><xsl:when test="office:annotation/@office:display = 'true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <uof:锚点 uof:locID="u0064" uof:attrList="x坐标 y坐标 宽度 高度 图形引用 随动方式 缩略图 占位符">
- <xsl:variable name="num">
- <xsl:value-of select="substring-after(office:annotation/@draw:style-name,'gr')"/>
- </xsl:variable>
- <xsl:attribute name="uof:图形引用"><xsl:value-of select="concat('pz',$num)"/></xsl:attribute>
- <xsl:attribute name="uof:x坐标"><xsl:value-of select="substring-before(office:annotation/@svg:x,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:y坐标"><xsl:value-of select="substring-before(office:annotation/@svg:y,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(office:annotation/@svg:width,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:高度"><xsl:value-of select="substring-before(office:annotation/@svg:height,$uofUnit)"/></xsl:attribute>
- </uof:锚点>
- </xsl:element>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- <xsl:for-each select="child::*">
- <xsl:if test="starts-with(name(.),'draw:')">
- <xsl:choose>
- <xsl:when test="name(.)='draw:frame' and self::node()/draw:object">
- <xsl:call-template name="draw:chart-frame">
- <xsl:with-param name="table-name" select="$table-name"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="uof锚点"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="/office:document/office:body/office:spreadsheet/table:tracked-changes and not(self::node()/@table:style-name) and self::node()/text:p">
- <xsl:element name="表:数据">
- <xsl:attribute name="uof:locID">s0051</xsl:attribute>
- <xsl:attribute name="uof:attrList">数据类型</xsl:attribute>
- <xsl:element name="字:句">
- <xsl:attribute name="uof:locID">t0085</xsl:attribute>
- <xsl:call-template name="table:tracked-changes"/>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </表:单元格>
- <xsl:variable name="repeat-table-cell-no1">
- <xsl:value-of select="$repeat-table-cell-no - 1"/>
- </xsl:variable>
- <xsl:call-template name="write-table-cell">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="repeat-table-cell-no" select="$repeat-table-cell-no1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template match="office:annotation"/>
- <xsl:template match="dc:date"/>
- <xsl:template name="表的数据">
- <xsl:param name="valueType"/>
- <xsl:param name="cellStyleName"/>
- <xsl:choose>
- <xsl:when test="descendant::*/@text:style-name">
- <xsl:choose>
- <xsl:when test="$valueType = 'string'">
- <表:数据 表:数据类型="string" uof:locID="s0051" uof:attrList="数据类型">
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName"/>
- </xsl:apply-templates>
- </表:数据>
- </xsl:when>
- <xsl:when test="$valueType = 'boolean'">
- <表:数据 表:数据类型="boolean" uof:locID="s0051" uof:attrList="数据类型">
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName"/>
- </xsl:apply-templates>
- </表:数据>
- </xsl:when>
- <xsl:when test="$valueType = 'date'">
- <表:数据 表:数据类型="date" uof:locID="s0051" uof:attrList="数据类型">
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName"/>
- </xsl:apply-templates>
- </表:数据>
- </xsl:when>
- <xsl:otherwise>
- <表:数据 表:数据类型="number" uof:locID="s0051" uof:attrList="数据类型">
- <xsl:apply-templates>
- <xsl:with-param name="cellStyleName" select="$cellStyleName"/>
- </xsl:apply-templates>
- </表:数据>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <表:数据 uof:locID="s0051" uof:attrList="数据类型">
- <xsl:choose>
- <xsl:when test="$valueType = 'string'">
- <xsl:attribute name="表:数据类型">text</xsl:attribute>
- <!--xsl:attribute name="表:数据数值"><xsl:value-of select="@office:string-value"/></xsl:attribute-->
- <!--chengxz schema no this attr-->
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="text:p"/>
- </字:文本串>
- </字:句>
- </xsl:when>
- <xsl:when test="$valueType = 'boolean'">
- <xsl:attribute name="表:数据类型">boolean</xsl:attribute>
- <字:句 uof:locID="t0085">
- <xsl:choose>
- <xsl:when test="@table:boolean-value = 'true'">
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">true</字:文本串>
- </xsl:when>
- <xsl:otherwise>
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">false</字:文本串>
- </xsl:otherwise>
- </xsl:choose>
- </字:句>
- </xsl:when>
- <xsl:when test="$valueType = 'date'">
- <xsl:attribute name="表:数据类型">date</xsl:attribute>
- <xsl:attribute name="表:数据数值"><xsl:value-of select="@office:date-value"/></xsl:attribute>
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="text:p"/>
- </字:文本串>
- </字:句>
- </xsl:when>
- <xsl:when test="$valueType = 'time'">
- <xsl:attribute name="表:数据类型">time</xsl:attribute>
- <xsl:attribute name="表:数据数值"><xsl:value-of select="@office:time-value"/></xsl:attribute>
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="text:p"/>
- </字:文本串>
- </字:句>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="表:数据类型">number</xsl:attribute>
- <xsl:attribute name="表:数据数值"><xsl:value-of select="@office:value"/></xsl:attribute>
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="text:p"/>
- </字:文本串>
- </字:句>
- </xsl:otherwise>
- </xsl:choose>
- </表:数据>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="分页符集">
- <xsl:for-each select="table:table-row">
- <xsl:if test="key('styles', @table:style-name)/style:table-row-properties/@fo:break-before">
- <xsl:variable name="table-break-before">
- <xsl:value-of select="key('styles', @table:style-name)/style:table-row-properties/@fo:break-before"/>
- </xsl:variable>
- <xsl:if test="$table-break-before = 'page'">
- <xsl:element name="表:分页符">
- <xsl:attribute name="uof:locID">s0112</xsl:attribute>
- <xsl:attribute name="uof:attrList">行号 列号</xsl:attribute>
- <xsl:if test="preceding-sibling::table:table-row/@table:number-rows-repeated">
- <xsl:attribute name="表:行号"><xsl:value-of select="sum(preceding-sibling::table:table-row/@table:number-rows-repeated)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="not(preceding-sibling::table:table-row/@table:number-rows-repeated)">
- <xsl:attribute name="表:行号">1</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:if>
- <xsl:if test="key('styles', @table:style-name)/style:table-row-properties/@fo:break-after">
- <xsl:variable name="table-break-after" select="key('styles', @table:style-name)/style:table-row-properties/@fo:break-after"/>
- <xsl:if test="$table-break-after = 'page'">
- <xsl:element name="表:分页符">
- <xsl:attribute name="uof:locID">s0112</xsl:attribute>
- <xsl:attribute name="uof:attrList">行号 列号</xsl:attribute>
- <xsl:if test="preceding-sibling::table:table-row/@table:number-rows-repeated">
- <xsl:attribute name="表:行号"><xsl:value-of select="sum(preceding-sibling::table:table-row/@table:number-rows-repeated)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="not(preceding-sibling::table:table-row/@table:number-rows-repeated)">
- <xsl:attribute name="表:行号">1</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="table:table-column">
- <xsl:if test="key('styles', @table:style-name)/style:table-column-properties/@fo:break-before">
- <xsl:variable name="table-break-before" select="key('styles', @table:style-name)/style:table-column-properties/@fo:break-before"/>
- <xsl:if test="$table-break-before = 'page'">
- <xsl:element name="表:分页符">
- <xsl:attribute name="uof:locID">s0112</xsl:attribute>
- <xsl:attribute name="uof:attrList">行号 列号</xsl:attribute>
- <xsl:if test="preceding-sibling::table:table-column/@table:number-columns-repeated">
- <xsl:attribute name="表:列号"><xsl:value-of select="sum(preceding-sibling::table:table-column/@table:number-columns-repeated)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="not(preceding-sibling::table:table-column/@table:number-columns-repeated)">
- <xsl:attribute name="表:列号">1</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:if>
- <xsl:if test="key('styles', @table:style-name)/style:table-column-properties/@fo:break-after">
- <xsl:variable name="table-break-after" select="key('styles', @table:style-name)/style:table-column-properties/@fo:break-after"/>
- <xsl:if test="$table-break-after = 'page'">
- <xsl:element name="表:分页符">
- <xsl:attribute name="uof:locID">s0112</xsl:attribute>
- <xsl:attribute name="uof:attrList">行号 列号</xsl:attribute>
- <xsl:if test="preceding-sibling::table:table-column/@table:number-columns-repeated">
- <xsl:attribute name="表:列号"><xsl:value-of select="sum(preceding-sibling::table:table-column/@table:number-columns-repeated)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="not(preceding-sibling::table:table-column/@table:number-columns-repeated)">
- <xsl:attribute name="表:列号">1</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="text:s">
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="@text:c"/>
- </xsl:call-template>
- </xsl:template>
- <!--write the number of 'whitespaces' -->
- <xsl:template name="write-breakable-whitespace">
- <xsl:param name="whitespaces"/>
- <xsl:text> </xsl:text>
- <xsl:if test="$whitespaces >= 1">
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <!-- allowing all matched text nodes -->
- <!--chengxz0630-->
- <!--xsl:template match="text()">
- <字:句 uof:locID="t0085">
- <xsl:element name="字:文本串">
- <xsl:attribute name="locID">t0109</xsl:attribute>
-
- <xsl:value-of select="." />
- </xsl:element>
- </字:句>
- </xsl:template-->
- <xsl:variable name="namespace-html" select="'http://www.w3.org/TR/REC-html40'"/>
- <xsl:template match="@table:style-name | @table:default-cell-style-name">
- <xsl:attribute name="表:式样引用"><!--ss:styleID--><xsl:value-of select="."/><!--chengxz 060114--></xsl:attribute>
- </xsl:template>
- <xsl:template name="style-and-contents">
- <xsl:param name="cellStyleName"/>
- <字:句 uof:locID="t0085">
- <xsl:element name="字:文本串">
- <!--chengxz0630-->
- </xsl:element>
- </字:句>
- </xsl:template>
- <!-- *************88-->
- <xsl:param name="dpi" select="111"/>
- <xsl:param name="centimeter-in-mm" select="10"/>
- <xsl:param name="inch-in-mm" select="25.4"/>
- <xsl:param name="didot-point-in-mm" select="0.376065"/>
- <xsl:param name="pica-in-mm" select="4.2333333"/>
- <xsl:param name="point-in-mm" select="0.3527778"/>
- <xsl:param name="twip-in-mm" select="0.017636684"/>
- <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
- <!-- ***** MEASUREMENT CONVERSIONS *****
- PARAM 'value'
- The measure to be converted.
- The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
- directly added to the number.
+ <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
+ <xsl:variable name="scValueWithUnit">
+ <xsl:value-of select="/office:document/office:automatic-styles/style:style[@style:name='co1']/style:table-column-properties/@style:column-width"/>
+ </xsl:variable>
+ <xsl:variable name="uofUnit">
+ <xsl:choose>
+ <xsl:when test="contains($scValueWithUnit,'in')">inch</xsl:when>
+ <xsl:when test="contains($scValueWithUnit,'cm')">cm</xsl:when>
+ <xsl:when test="contains($scValueWithUnit,'mm')">mm</xsl:when>
+ <xsl:when test="contains($scValueWithUnit,'pt')">pt</xsl:when>
+ <xsl:otherwise>inch</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="ooUnit">
+ <xsl:choose>
+ <xsl:when test="contains($scValueWithUnit,'inch')">inch</xsl:when>
+ <xsl:when test="contains($scValueWithUnit,'cm')">cm</xsl:when>
+ <xsl:when test="contains($scValueWithUnit,'mm')">mm</xsl:when>
+ <xsl:when test="contains($scValueWithUnit,'pt')">pt</xsl:when>
+ <xsl:otherwise>inch</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:template match="office:document">
+ <uof:UOF xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" uof:language="cn" uof:locID="u0000" uof:version="1.0" uof:mimetype="vnd.uof.spreadsheet">
+ <xsl:apply-templates select="/office:document/office:meta"/>
+ <uof:对象集 uof:locID="u0033">
+ <xsl:if test="/office:document/office:body/office:spreadsheet/table:table//table:table-cell/office:annotation">
+ <xsl:for-each select="/office:document/office:body/office:spreadsheet/table:table//table:table-cell/office:annotation">
+ <xsl:variable name="num">
+ <xsl:value-of select="substring-after(@draw:style-name,'gr')"/>
+ </xsl:variable>
+ <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
+ <xsl:attribute name="图:标识符"><xsl:value-of select="concat('pz',$num)"/></xsl:attribute>
+ <xsl:variable name="name" select="@draw:style-name"/>
+ <图:预定义图形 uof:locID="g0005">
+ <图:属性 uof:locID="g0011">
+ <xsl:for-each select="/office:document/office:automatic-styles/style:style[@style:name=$name]">
+ <xsl:call-template name="graphicattr"/>
+ </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="@svg:x1">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ <xsl:when test="@svg:x">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ <xsl:when test="@svg:width">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ </xsl:choose>
+ <图:旋转角度 uof:locID="g0025">
+ <xsl:choose>
+ <xsl:when test="@draw:transform">
+ <xsl:variable name="rotate-angle">
+ <xsl:value-of select="@draw:transform"/>
+ </xsl:variable>
+ <xsl:variable name="rotate-temp">
+ <xsl:value-of select="substring-before(substring-after($rotate-angle,'rotate ('),')')"/>
+ </xsl:variable>
+ <xsl:value-of select="($rotate-temp * 360) div (2 * 3.14159265)"/>
+ </xsl:when>
+ <xsl:otherwise>0.0</xsl:otherwise>
+ </xsl:choose>
+ </图:旋转角度>
+ <图:X-缩放比例 uof:locID="g0026">1</图:X-缩放比例>
+ <图:Y-缩放比例 uof:locID="g0027">1</图:Y-缩放比例>
+ <图:锁定纵横比 uof:locID="g0028">0</图:锁定纵横比>
+ <图:相对原始比例 uof:locID="g0029">1</图:相对原始比例>
+ <图:打印对象 uof:locID="g0032">true</图:打印对象>
+ <图:Web文字 uof:locID="g0033"/>
+ </图:属性>
+ </图:预定义图形>
+ <图:文本内容 uof:locID="g0002" uof:attrList="文本框 左边距 右边距 上边距 下边距 水平对齐 垂直对齐 文字排列方向 自动换行 大小适应文字 前一链接 后一链接">
+ <xsl:for-each select="/office:document/office:automatic-styles/style:style[@style:name=$name]">
+ <xsl:attribute name="图:文字排列方向"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-lr'">vert-l2r</xsl:when></xsl:choose></xsl:when><xsl:when test="style:graphic-properties/@draw:textarea-horizontal-align='right'">hori-r2l</xsl:when><xsl:otherwise>hori-l2r</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="style:graphic-properties/@draw:textarea-horizontal-align">
+ <xsl:attribute name="图:水平对齐"><xsl:value-of select="style:graphic-properties/@draw:textarea-horizontal-align"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:textarea-vertical-align">
+ <xsl:attribute name="图:垂直对齐"><xsl:value-of select="style:graphic-properties/@draw:textarea-vertical-align"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@fo:wrap-option">
+ <xsl:attribute name="图:自动换行">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:auto-grow-width='true' and style:graphic-properties/@draw:auto-grow-height='true'">
+ <xsl:attribute name="图:大小适应文字">true</xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="./text:p">
+ <xsl:call-template name="textp"/>
+ </xsl:for-each>
+ </图:文本内容>
+ </图:图形>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:for-each select="/office:document/office:body/office:spreadsheet/table:table//table:table-cell/office:annotation">
+ <xsl:variable name="name1" select="@draw:style-name"/>
+ <xsl:for-each select="/office:document/office:automatic-styles/style:style[@style:name=$name1]">
+ <xsl:if test="style:graphic-properties/@draw:fill-image-name">
+ <xsl:variable name="bsh">
+ <xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/>
+ </xsl:variable>
+ <xsl:for-each select="/office:document/office:styles/draw:fill-image">
+ <xsl:if test="@draw:name=$bsh">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($name1,'_b1')"/></xsl:attribute>
+ <xsl:attribute name="uof:公共类型">png</xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="office:binary-data"/>
+ </uof:数据>
+ </uof:其他对象>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:for-each>
+ <xsl:for-each select="/office:document/office:body/office:spreadsheet/table:table/table:shapes/child::* | /office:document/office:body/office:spreadsheet/table:table/table:table-row/table:table-cell/child::*">
+ <xsl:if test="starts-with(name(.),'draw:')">
+ <xsl:choose>
+ <xsl:when test="name(.)='draw:frame' and self::node()/draw:object">
+ <xsl:for-each select="draw:image">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('chart_image_',count(preceding::draw:fill-image))"/></xsl:attribute>
+ <xsl:attribute name="uof:公共类型">png</xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="office:binary-data"/>
+ </uof:数据>
+ </uof:其他对象>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="draw">
+ <xsl:with-param name="nodename1" select="name(.)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:for-each>
+ </uof:对象集>
+ <xsl:if test="/office:document/office:body//text:bookmark-start">
+ <uof:书签集 uof:locID="u0027">
+ <xsl:for-each select="/office:document/office:body//text:bookmark-start">
+ <xsl:element name="uof:书签">
+ <xsl:attribute name="uof:名称"><xsl:value-of select="@text:name"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">u0028</xsl:attribute>
+ <xsl:attribute name="uof:attrList">名称</xsl:attribute>
+ <xsl:element name="uof:文本位置">
+ <xsl:attribute name="字:区域引用"><xsl:value-of select="concat('bk_',@text:name)"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">u0029</xsl:attribute>
+ <xsl:attribute name="uof:attrList">区域引用</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </uof:书签集>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/text:p/text:a">
+ <uof:链接集 uof:locID="u0031">
+ <xsl:for-each select="/office:document/office:body/text:p/text:a">
+ <!--chengxz 要改-->
+ <xsl:variable name="hyperStr" select="@xlink:href"/>
+ <xsl:element name="uof:超级链接">
+ <xsl:if test="contains($hyperStr,'#')">
+ <xsl:attribute name="uof:书签"><xsl:value-of select="substring-after($hyperStr,'#')"/></xsl:attribute>
+ </xsl:if>
+ <!--暂时不写uof:提示-->
+ <xsl:attribute name="uof:链源">hlnk<xsl:number from="/office:document/office:body" level="any" count="text:p[text:a]"/></xsl:attribute>
+ <xsl:if test="contains($hyperStr,'http://') or contains($hyperStr,'mailto')">
+ <xsl:attribute name="uof:目标"><xsl:value-of select="$hyperStr"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="uof:locID">u0032</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 目标 书签 式样引用 已访问式样引用 提示 链源</xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </uof:链接集>
+ </xsl:if>
+ <uof:式样集 uof:locID="u0039">
+ <xsl:apply-templates select="/office:document/office:font-face-decls"/>
+ <xsl:apply-templates select="/office:document/office:styles/style:style" mode="styles"/>
+ <xsl:apply-templates select="/office:document/office:automatic-styles/style:style" mode="styles">
+ <xsl:with-param name="isAutomatic" select="true()"/>
+ </xsl:apply-templates>
+ </uof:式样集>
+ <uof:电子表格 uof:locID="u0049">
+ <表:公用处理规则 uof:locID="s0000">
+ <表:度量单位 uof:locID="s0001">
+ <xsl:value-of select="$uofUnit"/>
+ </表:度量单位>
+ <xsl:apply-templates select="/office:document/office:body/office:spreadsheet/table:calculation-settings" mode="common"/>
+ <xsl:apply-templates select="/office:document/office:body/office:spreadsheet/table:content-validations" mode="common"/>
+ <xsl:if test="/office:document/office:automatic-styles/style:style[@style:family='table-cell' and style:map]">
+ <xsl:element name="表:条件格式化集">
+ <xsl:attribute name="uof:locID">s0016</xsl:attribute>
+ <xsl:call-template name="create-condition-format"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/office:spreadsheet/table:database-ranges/table:database-range">
+ <表:区域公式集 uof:locID="s0122">
+ <表:区域公式 uof:locID="s0123" uof:attrList="类型">
+ <xsl:attribute name="表:类型">table</xsl:attribute>
+ <xsl:for-each select="/office:document/office:body/office:spreadsheet/table:database-ranges/table:database-range">
+ <表:区域 uof:locID="s0007">
+ <xsl:value-of select="@table:target-range-address"/>
+ </表:区域>
+ <表:公式 uof:locID="s0125"/>
+ </xsl:for-each>
+ </表:区域公式>
+ </表:区域公式集>
+ </xsl:if>
+ <表:是否RC引用 uof:locID="s0124" uof:attrList="值" 表:值="false"/>
+ </表:公用处理规则>
+ <表:主体 uof:locID="s0024">
+ <xsl:apply-templates select="office:body"/>
+ </表:主体>
+ </uof:电子表格>
+ </uof:UOF>
+ </xsl:template>
+ <xsl:template match="office:body">
+ <xsl:apply-templates select="office:spreadsheet"/>
+ </xsl:template>
+ <xsl:template match="office:spreadsheet">
+ <xsl:apply-templates select="./*"/>
+ </xsl:template>
+ <xsl:template match="office:meta">
+ <uof:元数据 uof:locID="u0001">
+ <uof:标题 uof:locID="u0002">
+ <xsl:value-of select="dc:title"/>
+ </uof:标题>
+ <uof:创建应用程序 uof:locID="u0011">
+ <xsl:value-of select="meta:generator"/>
+ </uof:创建应用程序>
+ <uof:摘要 uof:locID="u0007">
+ <xsl:value-of select="dc:description"/>
+ </uof:摘要>
+ <uof:主题 uof:locID="u0003">
+ <xsl:value-of select="dc:subject"/>
+ </uof:主题>
+ <uof:创建者 uof:locID="u0004"/>
+ <uof:作者 uof:locID="u0005">
+ <xsl:value-of select="meta:initial-creator"/>
+ </uof:作者>
+ <uof:创建日期 uof:locID="u0008">
+ <xsl:value-of select="meta:creation-date"/>
+ </uof:创建日期>
+ <xsl:if test="dc:creator">
+ <uof:最后作者 uof:locID="u0006">
+ <xsl:value-of select="dc:creator"/>
+ </uof:最后作者>
+ </xsl:if>
+ <uof:关键字集 uof:locID="u0014">
+ <uof:关键字 uof:locID="u0015">
+ <xsl:value-of select="meta:keyword"/>
+ </uof:关键字>
+ </uof:关键字集>
+ <uof:编辑次数 uof:locID="u0009">
+ <xsl:value-of select="meta:editing-cycles"/>
+ </uof:编辑次数>
+ <xsl:if test="meta:editing-duration">
+ <uof:编辑时间 uof:locID="u0010">
+ <xsl:value-of select="meta:editing-duration"/>
+ </uof:编辑时间>
+ </xsl:if>
+ <xsl:if test="meta:template/@xlink:href">
+ <uof:文档模板 uof:locID="u0013">
+ <xsl:value-of select="meta:template/@xlink:href"/>
+ </uof:文档模板>
+ </xsl:if>
+ <xsl:if test="meta:user-defined/@meta:name">
+ <uof:用户自定义元数据集 uof:locID="u0016">
+ <xsl:for-each select="meta:user-defined">
+ <uof:用户自定义元数据 uof:locID="u0017" uof:attrList="名称 类型">
+ <xsl:attribute name="uof:名称"><xsl:value-of select="@meta:name"/></xsl:attribute>
+ <xsl:attribute name="uof:类型"><xsl:value-of select="'string'"/></xsl:attribute>
+ <xsl:value-of select="."/>
+ </uof:用户自定义元数据>
+ </xsl:for-each>
+ </uof:用户自定义元数据集>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:page-count">
+ <uof:页数 uof:locID="u0020">
+ <xsl:value-of select="meta:document-statistic/@meta:page-count"/>
+ </uof:页数>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:paragraph-count">
+ <uof:段落数 uof:locID="u0025">
+ <xsl:value-of select="meta:document-statistic/@meta:paragraph-count"/>
+ </uof:段落数>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:object-count">
+ <uof:对象数 uof:locID="u0026">
+ <xsl:value-of select="meta:document-statistic/@meta:object-count"/>
+ </uof:对象数>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:character-count">
+ <uof:字数 uof:locID="u0021">
+ <xsl:value-of select="meta:document-statistic/@meta:character-count"/>
+ </uof:字数>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:word-count">
+ <uof:中文字符数 uof:locID="u0023">
+ <xsl:value-of select="meta:document-statistic/@meta:word-count"/>
+ </uof:中文字符数>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:character-count - meta:document-statistic/@meta:word-count">
+ <uof:英文字符数 uof:locID="u0022">
+ <xsl:value-of select="meta:document-statistic/@meta:character-count - meta:document-statistic/@meta:word-count"/>
+ </uof:英文字符数>
+ </xsl:if>
+ <xsl:if test="meta:document-statistic/@meta:character-count">
+ <uof:行数 uof:locID="u0024">
+ <xsl:variable name="quzhi">
+ <xsl:value-of select="(meta:document-statistic/@meta:character-count div 39) + 0.9"/>
+ </xsl:variable>
+ <xsl:value-of select="substring-before($quzhi,'.')"/>
+ </uof:行数>
+ </xsl:if>
+ <xsl:if test="meta:user-defined[@meta:name='Category']">
+ <uof:分类 uof:locID="u0012">
+ <xsl:value-of select="meta:user-defined[@meta:name='Category']"/>
+ </uof:分类>
+ </xsl:if>
+ <xsl:if test="meta:user-defined[@meta:name='Manager']">
+ <uof:经理名称 uof:locID="u0019">
+ <xsl:value-of select="meta:user-defined[meta:name='Manager']"/>
+ </uof:经理名称>
+ </xsl:if>
+ <xsl:if test="meta:user-defined[@meta:name='Company']">
+ <uof:公司名称 uof:locID="u0018">
+ <xsl:value-of select="meta:user-defined[meta:name='Company']"/>
+ </uof:公司名称>
+ </xsl:if>
+ </uof:元数据>
+ </xsl:template>
+ <xsl:template match="table:table">
+ <xsl:element name="表:工作表">
+ <xsl:attribute name="uof:locID">s0025</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 隐藏 背景 式样引用</xsl:attribute>
+ <xsl:attribute name="表:标识符"><xsl:value-of select="@table:name"/></xsl:attribute>
+ <xsl:attribute name="表:名称"><xsl:value-of select="@table:name"/></xsl:attribute>
+ <xsl:attribute name="表:隐藏"><xsl:choose><xsl:when test="@table:style-name='ta1'"><xsl:value-of select="'false'"/></xsl:when><xsl:otherwise><xsl:value-of select="'true'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="表:背景"><xsl:choose><xsl:when test="/office:document/office:automatic-styles/style:page-master/style:table-properties/@fo:background-color"><xsl:value-of select="/office:document/office:automatic-styles/style:page-master/style:table-properties/@fo:background-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="表:式样引用"><xsl:value-of select="@table:style-name"/></xsl:attribute>
+ <xsl:element name="表:工作表属性">
+ <xsl:attribute name="uof:locID">s0026</xsl:attribute>
+ <表:标签前景色 uof:locID="s0027">#000000</表:标签前景色>
+ <表:标签背景色 uof:locID="s0028">#ffffff</表:标签背景色>
+ <xsl:call-template name="create-page-setting">
+ <xsl:with-param name="master-page" select="/*/office:master-styles/style:master-page"/>
+ <xsl:with-param name="page-master-style" select="/*/office:automatic-styles/style:page-layout/style:page-layout-properties"/>
+ </xsl:call-template>
+ <xsl:call-template name="create-view">
+ <xsl:with-param name="table-name" select="/*/office:body/office:spreadsheet/table:table/@table:name"/>
+ <xsl:with-param name="view-id" select="count(preceding-sibling::table:table) + 1"/>
+ <xsl:with-param name="aaa" select="/*/office:settings/config:config-item-set/config:config-item-map-indexed/config:config-item-map-entry"/>
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:call-template name="table"/>
+ <xsl:variable name="filter" select="/*/office:body/office:spreadsheet/table:database-ranges/table:database-range"/>
+ <xsl:if test="$filter">
+ <xsl:variable name="target-range-address" select="//table:database-range[table:filter]/@table:target-range-address"/>
+ <xsl:element name="表:筛选">
+ <xsl:attribute name="uof:locID">s0101</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="$filter/@table:display-filter-buttons">auto</xsl:when><xsl:otherwise>advance</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:element name="表:范围">
+ <xsl:attribute name="uof:locID">s0102</xsl:attribute>
+ <xsl:value-of select="$filter/@table:target-range-address"/>
+ </xsl:element>
+ <xsl:variable name="column-and-row" select="substring-before(substring-after($target-range-address,'.'),':')"/>
+ <xsl:variable name="dd" select="number(substring($column-and-row,2,1))"/>
+ <xsl:variable name="zone-left-column-string">
+ <xsl:choose>
+ <xsl:when test="contains($dd,'NaN') ">
+ <xsl:value-of select="substring($column-and-row,1,2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring($column-and-row,1,1)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="zone-left-column-num">
+ <xsl:call-template name="translate-column-char-to-number">
+ <xsl:with-param name="string" select="$zone-left-column-string"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="create-filter-conditions">
+ <xsl:with-param name="filter-condition-set" select="$filter//table:filter-condition"/>
+ <xsl:with-param name="zone-left-column-num" select="$zone-left-column-num"/>
+ </xsl:call-template>
+ <xsl:if test="$filter/@table:condition-source-range-address">
+ <xsl:element name="表:条件区域">
+ <xsl:attribute name="uof:locID">s0108</xsl:attribute>
+ <xsl:value-of select="$filter/@table:condition-source-range-address"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$filter/@table:display-duplicates">
+ <xsl:element name="表:结果区域">
+ <xsl:attribute name="uof:locID">s0109</xsl:attribute>
+ <xsl:value-of select="$filter/@table:display-duplicates"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="key('styles', .//@table:style-name)/style:table-row-properties/@fo:break-before = 'page' or key('styles',.//@table:style-name)/style:table-column-properties/@fo:break-before='page'">
+ <xsl:element name="表:分页符集">
+ <xsl:attribute name="uof:locID">s0111</xsl:attribute>
+ <xsl:call-template name="分页符集"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:param name="tableElement" select="'表:工作表内容'"/>
+ <xsl:param name="rowElement" select="'表:行'"/>
+ <!--xsl:param name="cellElement" select="'表:单元格'" /-->
+ <!-- ************** -->
+ <!-- *** Table *** -->
+ <!-- ************** -->
+ <xsl:template name="table">
+ <!-- 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:if>
+ </xsl:template>
+ <xsl:template name="create-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')] | table:table-header-rows/descendant::table:table-row[not(@table:visibility = 'collapse' or @table:visibility = 'filter')] | table:table-row-group/descendant::table:table-row[not(@table:visibility = 'collapse' or @table:visibility = 'filter')]"/>
+ <xsl:call-template name="create-table-element">
+ <xsl:with-param name="allVisibleTableRows" select="$allVisibleTableRows"/>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template name="create-table-element">
+ <xsl:param name="allVisibleTableRows"/>
+ <xsl:element name="表:工作表内容">
+ <xsl:attribute name="uof:locID">s0018</xsl:attribute>
+ <xsl:attribute name="uof:attrList">最大行 最大列 缺省行高 缺省列宽</xsl:attribute>
+ <xsl:variable name="group-column" select="./table:table-column-group"/>
+ <xsl:variable name="group-row" select="./table:table-row-group"/>
+ <xsl:apply-templates select="@table:style-name"/>
+ <xsl:for-each select="table:table-column">
+ <表:列 uof:locID="s0048" uof:attrList="列号 隐藏 列宽 式样引用 跨度">
+ <xsl:attribute name="表:列号"><xsl:value-of select="position()"/></xsl:attribute>
+ <xsl:if test="@table:visibility">
+ <xsl:attribute name="表:隐藏"><xsl:choose><xsl:when test="@table:visibility='collapse'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="表:列宽"><xsl:value-of select="substring-before(key('styles',@table:style-name)/style:table-column-properties/@style:column-width,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="表:式样引用"><xsl:value-of select="@table:style-name"/></xsl:attribute>
+ <xsl:attribute name="表:跨度"><xsl:choose><xsl:when test="@table:number-columns-repeated"><xsl:value-of select="@table:number-columns-repeated"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
+ </表:列>
+ </xsl:for-each>
+ <xsl:variable name="columnNodes" select="table:table-column"/>
+ <xsl:variable name="columnsRepeated" select="table:table-column/@table:number-columns-repeated"/>
+ <xsl:variable name="columnCount">
+ <xsl:choose>
+ <xsl:when test="$columnNodes[last()]/@table:number-columns-repeated &gt; 99">
+ <xsl:value-of select="count($columnNodes)+ number(sum($columnsRepeated))- count($columnsRepeated)- $columnNodes[last()]/@table:number-columns-repeated+ 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="count($columnNodes)+ number(sum($columnsRepeated))- count($columnsRepeated)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="table-name" select="@table:name"/>
+ <xsl:apply-templates select="table:table-row">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ </xsl:apply-templates>
+ <xsl:if test="table:table-row-group//table:table-row">
+ <xsl:apply-templates select="table:table-row-group//table:table-row">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ <xsl:for-each select="table:shapes/child::*">
+ <xsl:if test="starts-with(name(.),'draw:')">
+ <xsl:choose>
+ <xsl:when test="name(.)='draw:frame' and self::node()/draw:object">
+ <xsl:call-template name="draw:chart-frame">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="uof锚点"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="table:table-row-group or table:table-column-group">
+ <xsl:element name="表:分组集">
+ <xsl:attribute name="uof:locID">s0098</xsl:attribute>
+ <xsl:for-each select="table:table-column-group">
+ <xsl:variable name="numcolumnrep" select="count(descendant::table:table-column[@table:number-columns-repeated])"/>
+ <xsl:variable name="numrep" select="sum(descendant::table:table-column/@table:number-columns-repeated)"/>
+ <xsl:variable name="numcolumn" select="count(descendant::table:table-column)"/>
+ <xsl:call-template name="table:table-column-group">
+ <xsl:with-param name="start" select="count(preceding::table:table-column)"/>
+ <xsl:with-param name="end" select="count(preceding::table:table-column) + $numrep + $numcolumn - $numcolumnrep"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:for-each select="table:table-row-group">
+ <xsl:variable name="numrowrep" select="count(descendant::table:table-row[@table:number-rows-repeated])"/>
+ <xsl:variable name="numrep" select="sum(descendant::table:table-row/@table:number-rows-repeated)"/>
+ <xsl:variable name="numrow" select="count(descendant::table:table-row)"/>
+ <xsl:call-template name="table:table-row-group">
+ <xsl:with-param name="start" select="count(preceding::table:table-row)"/>
+ <xsl:with-param name="end" select="count(preceding::table:table-row) + $numrep + $numrow - $numrowrep"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="table:table-row-group">
+ <xsl:param name="start"/>
+ <xsl:param name="end"/>
+ <xsl:element name="表:行">
+ <xsl:attribute name="uof:locID">s0100</xsl:attribute>
+ <xsl:attribute name="uof:attrList">起始 终止 隐藏</xsl:attribute>
+ <xsl:attribute name="表:起始"><xsl:value-of select="$start + 1"/></xsl:attribute>
+ <xsl:attribute name="表:终止"><xsl:value-of select="$end"/></xsl:attribute>
+ <xsl:attribute name="表:隐藏"><xsl:choose><xsl:when test="@table:display"><xsl:value-of select="'true'"/></xsl:when><xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:for-each select="table:table-row-group">
+ <xsl:call-template name="table:table-row-group">
+ <xsl:with-param name="start" select="count(preceding::table:table-row) + number(sum(preceding::table:table-row/@table:number-rows-repeated)) - count(preceding::table:table-row[@table:number-rows-repeated])"/>
+ <xsl:with-param name="end" select="count(preceding::table:table-row) + number(sum(preceding::table:table-row/@table:number-rows-repeated)) - count(preceding::table:table-row[@table:number-rows-repeated]) + number(sum(descendant::table:table-row/@table:number-rows-repeated)) + count(descendant::table:table-row) - count(descendant::table:table-row[@table:number-rows-repeated])"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="table:table-column-group">
+ <xsl:param name="start"/>
+ <xsl:param name="end"/>
+ <xsl:element name="表:列">
+ <xsl:attribute name="uof:locID">s0099</xsl:attribute>
+ <xsl:attribute name="uof:attrList">起始 终止 隐藏</xsl:attribute>
+ <xsl:attribute name="表:起始"><xsl:value-of select="$start + 1"/></xsl:attribute>
+ <xsl:attribute name="表:终止"><xsl:value-of select="$end"/></xsl:attribute>
+ <xsl:attribute name="表:隐藏"><xsl:choose><xsl:when test="@table:display"><xsl:value-of select="'true'"/></xsl:when><xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:for-each select="table:table-column-group">
+ <xsl:call-template name="table:table-column-group">
+ <xsl:with-param name="start" select="count(preceding::table:table-column) + number(sum(preceding::table:table-column/@table:number-columns-repeated)) - count(preceding::table:table-column[@table:number-columns-repeated])"/>
+ <xsl:with-param name="end" select="count(preceding::table:table-column) + number(sum(preceding::table:table-column/@table:number-columns-repeated)) - count(preceding::table:table-column[@table:number-columns-repeated]) + number(sum(descendant::table:table-column/@table:number-columns-repeated)) + count(descendant::table:table-column) - count(descendant::table:table-column[@table:number-columns-repeated])"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="uof锚点">
+ <xsl:if test="not(name(.)='draw:glue-point')">
+ <xsl:variable name="name">
+ <xsl:value-of select="name(.)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="name='draw:a'">
+ <xsl:for-each select="child::node( )">
+ <xsl:call-template name="uof锚点"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <uof:锚点 uof:locID="u0064" uof:attrList="x坐标 y坐标 宽度 高度 图形引用 随动方式 缩略图 占位符">
+ <xsl:attribute name="uof:x坐标"><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="@svg:x"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x1,$uofUnit)"/></xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:y坐标"><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:when><xsl:otherwise><xsl:choose><xsl:when test="@svg:y"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:when><xsl:when test="@svg:y1"><xsl:value-of select="substring-before(@svg:y1,$uofUnit)"/></xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:choose><xsl:when test="@svg:width"><xsl:value-of select="substring-before(@svg:width,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/></xsl:when><xsl:when test="name(.)='draw:g'"><xsl:variable name="minx"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:variable name="svgx"><xsl:value-of select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="number(substring-before(descendant::node()[@svg:x][1]/@svg:width,$uofUnit))"/></xsl:variable><xsl:variable name="maxx"><xsl:call-template name="groupmaxx"><xsl:with-param name="value" select="$svgx + $width"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$maxx - $minx"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:高度"><xsl:choose><xsl:when test="@svg:height"><xsl:value-of select="substring-before(@svg:height,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/></xsl:when><xsl:when test="name(.)='draw:g'"><xsl:variable name="miny"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:variable name="svgy"><xsl:value-of select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/></xsl:variable><xsl:variable name="height"><xsl:value-of select="number(substring-before(descendant::node()[@svg:y][1]/@svg:height,$uofUnit))"/></xsl:variable><xsl:variable name="maxy"><xsl:call-template name="groupmaxy"><xsl:with-param name="value" select="$svgy + $height"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$maxy - $miny"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:variable name="refpicname">
+ <xsl:choose>
+ <xsl:when test="./@draw:style-name">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:when>
+ <xsl:when test="./@table:end-cell-address">
+ <xsl:value-of select="@table:end-cell-address"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./@draw:id"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="uof:图形引用"><xsl:variable name="picnumber"><xsl:value-of select="count(preceding::*[@draw:style-name=$refpicname])"/></xsl:variable><xsl:value-of select="concat($refpicname,'_',$picnumber)"/></xsl:attribute>
+ <xsl:attribute name="uof:随动方式"><xsl:choose><xsl:when test="key('graphicset',$refpicname)/style:graphic-properties/@style:protect"><xsl:for-each select="key('graphicset',$refpicname)/style:graphic-properties"><xsl:choose><xsl:when test="@style:protect='size'">move</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:for-each></xsl:when><xsl:otherwise>movesize</xsl:otherwise></xsl:choose></xsl:attribute>
+ </uof:锚点>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <!--end 06.02.14 -->
+ <!-- **************** -->
+ <!-- *** Columns *** -->
+ <!-- **************** -->
+ <!--Redoffice comment liliang 06.05.23-->
+ <!--xsl:template name="create-table-column">
+ <xsl:param name="columnNodes"/>
+ <xsl:param name="currentColumn"/>
+ <xsl:param name="columnCount"/>
+ <xsl:param name="columnNo"/>
+ <xsl:param name="columnNodeNo"/>
+ <xsl:param name="index"/>
+ <xsl:element name="表:列">
+ <xsl:attribute name="locID">s0048</xsl:attribute>
+ <xsl:attribute name="attrList">列号 隐藏 列宽 式样引用 跨度</xsl:attribute>
+ <xsl:if test="$currentColumn/@table:visibility = 'collapse' or $currentColumn/@table:visibility = 'filter'">
+ <xsl:attribute name="表:隐藏">true</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="表:跨度"><xsl:choose><xsl:when test="$currentColumn/@table:number-columns-repeated"><xsl:value-of select="$currentColumn/@table:number-columns-repeated - 1"/></xsl:when><xsl:otherwise><xsl:value-of select="'0'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="$index">
+ <xsl:attribute name="表:列号"><xsl:value-of select="$columnNo"/></xsl:attribute>
+ </xsl:if-->
+ <!--自动列宽没有,暂略 autofitwidth-->
+ <!--Redoffice comment liliang 06.05.22-->
+ <!--xsl:variable name="width">
+ <xsl:value-of select="key('styles', $currentColumn/@table:style-name)/style:properties/@style:column-width"/>
+ </xsl:variable-->
+ <!--end-->
+ <!--xsl:if test="$width">
+ <xsl:attribute name="表:宽度"><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$width"/></xsl:call-template></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="表:跨度"><xsl:choose><xsl:when test="$currentColumn/@table:number-columns-repeated"><xsl:value-of select="$currentColumn/@table:number-columns-repeated - 1"/></xsl:when><xsl:otherwise><xsl:value-of select="'0'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:if test="$columnNo &lt; $columnCount">
+ <xsl:choose>
+ <xsl:when test="@table:number-columns-repeated">
+ <xsl:call-template name="create-table-column">
+ <xsl:with-param name="columnNodes" select="$columnNodes"/>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="columnNo" select="$columnNo + $currentColumn/@table:number-columns-repeated"/>
+ <xsl:with-param name="columnNodeNo" select="$columnNodeNo + 1"/>
+ <xsl:with-param name="currentColumn" select="$columnNodes[$columnNodeNo + 1]"/>
+ <xsl:with-param name="index" select="true()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="create-table-column">
+ <xsl:with-param name="columnNodes" select="$columnNodes"/>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="columnNo" select="$columnNo + 1"/>
+ <xsl:with-param name="columnNodeNo" select="$columnNodeNo + 1"/>
+ <xsl:with-param name="currentColumn" select="$columnNodes[$columnNodeNo + 1]"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template-->
+ <!-- ************* -->
+ <!-- *** Rows *** -->
+ <!-- ************* -->
+ <xsl:template match="table:table-row">
+ <xsl:param name="table-name"/>
+ <xsl:param name="columnCount"/>
+ <xsl:choose>
+ <xsl:when test="@table:number-rows-repeated &gt; 1">
+ <xsl:choose>
+ <xsl:when test="(last() or (last() - 1)) and @table:number-rows-repeated &gt; 99">
+ <xsl:call-template name="write-table-row">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="lastRow" select="true()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- In case a cell is being repeated, the cell will be created
+ in a variabel, which is as many times given out, as being repeated -->
+ <xsl:variable name="tableRow">
+ <xsl:call-template name="write-table-row">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="repeat-write-table-row">
+ <xsl:with-param name="tableRow" select="$tableRow"/>
+ <xsl:with-param name="repetition" select="@table:number-rows-repeated"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="write-table-row">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="write-table-row">
+ <xsl:param name="table-name"/>
+ <xsl:param name="columnCount"/>
+ <xsl:param name="lastRow"/>
+ <xsl:element name="表:行">
+ <xsl:attribute name="uof:locID">s0049</xsl:attribute>
+ <xsl:attribute name="uof:attrList">行号 隐藏 行高 式样引用 跨度</xsl:attribute>
+ <xsl:if test="./table:table-cell/@office:value-type">
+ <xsl:attribute name="表:行号"><xsl:value-of select="count(preceding::table:table-row[not(@table:number-rows-repeated)])+1+number(sum(preceding::table:table-row[@table:number-rows-repeated]/@table:number-rows-repeated))"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@table:visibility = 'collapse' or @table:visibility = 'filter'">
+ <xsl:attribute name="表:隐藏">true</xsl:attribute>
+ </xsl:if>
+ <!-- although valid, can not be opened with Excel - issue i31949)
+ <xsl:if test="$lastRow">
+ <xsl:attribute name="ss:Span"><xsl:value-of select="@table:number-rows-repeated - 1" /></xsl:attribute>
+ </xsl:if>-->
+ <!-- writing the style of the row -->
+ <xsl:apply-templates select="@table:style-name"/>
+ <xsl:variable name="rowProperties" select="key('styles', @table:style-name)/*"/>
+ <!--xsl:if test="$rowProperties/@style:use-optimal-row-height = 'false'">
+ <! - - default is '1', therefore write only '0' - ->
+ <xsl:attribute name="ss:AutoFitHeight">0</xsl:attribute>
+ </xsl:if-->
+ <xsl:variable name="height" select="$rowProperties/@style:row-height"/>
+ <xsl:if test="$height">
+ <xsl:attribute name="表:行高"><!-- using the absolute height in point --><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$height"/></xsl:call-template></xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="table:table-cell">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="repeat-write-table-row">
+ <xsl:param name="tableRow"/>
+ <xsl:param name="repetition"/>
+ <xsl:copy-of select="$tableRow"/>
+ <xsl:if test="$repetition &gt; 1">
+ <xsl:call-template name="repeat-write-table-row">
+ <xsl:with-param name="tableRow" select="$tableRow"/>
+ <xsl:with-param name="repetition" select="$repetition - 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <!-- ************** -->
+ <!-- *** Cells *** -->
+ <!-- ************** -->
+ <!-- Table cells are able to be repeated by attribute in StarOffice,
+ but not in Excel. If more cells are repeated
+ (e.g. for emulating background) only as many cells as columns are
+ allowed to be written out. -->
+ <xsl:template match="table:table-cell">
+ <xsl:param name="table-name"/>
+ <xsl:param name="columnCount"/>
+ <!--xsl:choose>
+ <xsl:when test="@table:number-columns-repeated &gt; 1">
+ <xsl:variable name="tableCell">
+ <xsl:call-template name="write-table-cell"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="not(following-sibling::table:table-cell)">
+ <xsl:call-template name="repeat-write-table-cell">
+ <xsl:with-param name="tableCell" select="$tableCell"/>
+ <xsl:with-param name="repetition" select="@table:number-columns-repeated"/>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="cellNo" select="position()+ sum(preceding-sibling::table:table-cell/@table:number-columns-repeated)- count(preceding-sibling::table:table-cell/@table:number-columns-repeated)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="repeat-write-table-cell">
+ <xsl:with-param name="tableCell" select="$tableCell"/>
+ <xsl:with-param name="repetition" select="@table:number-columns-repeated"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="write-table-cell"/>
+ </xsl:otherwise>
+ </xsl:choose-->
+ <xsl:choose>
+ <xsl:when test="@table:number-columns-repeated">
+ <xsl:call-template name="write-table-cell">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="repeat-table-cell-no" select="@table:number-columns-repeated"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="write-table-cell">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="repeat-table-cell-no" select="number(1)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--xsl:template name="repeat-write-table-cell">
+ <xsl:param name="tableCell"/>
+ <xsl:param name="repetition"/>
+ <xsl:param name="columnCount"/>
+ <xsl:param name="cellNo"/>
+ <xsl:copy-of select="$tableCell"/>
+ <xsl:if test="$repetition &gt; 1">
+ <xsl:choose>
+ <xsl:when test="$cellNo">
+ <xsl:if test="$cellNo &lt; $columnCount">
+ <xsl:call-template name="repeat-write-table-cell">
+ <xsl:with-param name="tableCell" select="$tableCell"/>
+ <xsl:with-param name="repetition" select="$repetition - 1"/>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="cellNo" select="$cellNo + 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="repeat-write-table-cell">
+ <xsl:with-param name="tableCell" select="$tableCell"/>
+ <xsl:with-param name="repetition" select="$repetition - 1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template-->
+ <xsl:template name="write-table-cell">
+ <xsl:param name="table-name"/>
+ <xsl:param name="repeat-table-cell-no"/>
+ <xsl:if test="$repeat-table-cell-no &gt; 0">
+ <表:单元格 uof:locID="s0050" uof:attrList="列号 式样引用 超链接引用 合并列数 合并行数">
+ <xsl:if test="@table:number-columns-spanned &gt; 1">
+ <xsl:attribute name="表:合并列数"><xsl:value-of select="@table:number-columns-spanned - 1"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@table:number-rows-spanned &gt; 1">
+ <xsl:attribute name="表:合并行数"><xsl:value-of select="@table:number-rows-spanned - 1"/></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="link" select="descendant::text:a/@xlink:href"/>
+ <xsl:if test="$link">
+ <xsl:attribute name="表:超链接引用"><xsl:value-of select="$link"/></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="@table:style-name">
+ <xsl:apply-templates select="@table:style-name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="ancestor::table:table/table:table-column/@table:default-cell-style-name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="*">
+ <xsl:if test="text:p">
+ <xsl:variable name="valueType">
+ <xsl:choose>
+ <xsl:when test="@office:value-type">
+ <xsl:value-of select="@office:value-type"/>
+ </xsl:when>
+ <xsl:otherwise>string</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="表的数据">
+ <xsl:with-param name="valueType" select="$valueType"/>
+ <xsl:with-param name="cellStyleName" select="@table:style-name"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="office:annotation">
+ <xsl:element name="表:批注">
+ <xsl:attribute name="uof:locID">s0053</xsl:attribute>
+ <xsl:attribute name="uof:attrList">是否显示</xsl:attribute>
+ <xsl:attribute name="表:是否显示"><xsl:choose><xsl:when test="office:annotation/@office:display = 'true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <uof:锚点 uof:locID="u0064" uof:attrList="x坐标 y坐标 宽度 高度 图形引用 随动方式 缩略图 占位符">
+ <xsl:variable name="num">
+ <xsl:value-of select="substring-after(office:annotation/@draw:style-name,'gr')"/>
+ </xsl:variable>
+ <xsl:attribute name="uof:图形引用"><xsl:value-of select="concat('pz',$num)"/></xsl:attribute>
+ <xsl:attribute name="uof:x坐标"><xsl:value-of select="substring-before(office:annotation/@svg:x,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:y坐标"><xsl:value-of select="substring-before(office:annotation/@svg:y,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(office:annotation/@svg:width,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:高度"><xsl:value-of select="substring-before(office:annotation/@svg:height,$uofUnit)"/></xsl:attribute>
+ </uof:锚点>
+ </xsl:element>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:for-each select="child::*">
+ <xsl:if test="starts-with(name(.),'draw:')">
+ <xsl:choose>
+ <xsl:when test="name(.)='draw:frame' and self::node()/draw:object">
+ <xsl:call-template name="draw:chart-frame">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="uof锚点"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="/office:document/office:body/office:spreadsheet/table:tracked-changes and not(self::node()/@table:style-name) and self::node()/text:p">
+ <xsl:element name="表:数据">
+ <xsl:attribute name="uof:locID">s0051</xsl:attribute>
+ <xsl:attribute name="uof:attrList">数据类型</xsl:attribute>
+ <xsl:element name="字:句">
+ <xsl:attribute name="uof:locID">t0085</xsl:attribute>
+ <xsl:call-template name="table:tracked-changes"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </表:单元格>
+ <xsl:variable name="repeat-table-cell-no1">
+ <xsl:value-of select="$repeat-table-cell-no - 1"/>
+ </xsl:variable>
+ <xsl:call-template name="write-table-cell">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="repeat-table-cell-no" select="$repeat-table-cell-no1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="office:annotation"/>
+ <xsl:template match="dc:date"/>
+ <xsl:template name="表的数据">
+ <xsl:param name="valueType"/>
+ <xsl:param name="cellStyleName"/>
+ <xsl:choose>
+ <xsl:when test="descendant::*/@text:style-name">
+ <xsl:choose>
+ <xsl:when test="$valueType = 'string'">
+ <表:数据 表:数据类型="string" uof:locID="s0051" uof:attrList="数据类型">
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName"/>
+ </xsl:apply-templates>
+ </表:数据>
+ </xsl:when>
+ <xsl:when test="$valueType = 'boolean'">
+ <表:数据 表:数据类型="boolean" uof:locID="s0051" uof:attrList="数据类型">
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName"/>
+ </xsl:apply-templates>
+ </表:数据>
+ </xsl:when>
+ <xsl:when test="$valueType = 'date'">
+ <表:数据 表:数据类型="date" uof:locID="s0051" uof:attrList="数据类型">
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName"/>
+ </xsl:apply-templates>
+ </表:数据>
+ </xsl:when>
+ <xsl:otherwise>
+ <表:数据 表:数据类型="number" uof:locID="s0051" uof:attrList="数据类型">
+ <xsl:apply-templates>
+ <xsl:with-param name="cellStyleName" select="$cellStyleName"/>
+ </xsl:apply-templates>
+ </表:数据>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <表:数据 uof:locID="s0051" uof:attrList="数据类型">
+ <xsl:choose>
+ <xsl:when test="$valueType = 'string'">
+ <xsl:attribute name="表:数据类型">text</xsl:attribute>
+ <!--xsl:attribute name="表:数据数值"><xsl:value-of select="@office:string-value"/></xsl:attribute-->
+ <!--chengxz schema no this attr-->
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="text:p"/>
+ </字:文本串>
+ </字:句>
+ </xsl:when>
+ <xsl:when test="$valueType = 'boolean'">
+ <xsl:attribute name="表:数据类型">boolean</xsl:attribute>
+ <字:句 uof:locID="t0085">
+ <xsl:choose>
+ <xsl:when test="@table:boolean-value = 'true'">
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">true</字:文本串>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">false</字:文本串>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:句>
+ </xsl:when>
+ <xsl:when test="$valueType = 'date'">
+ <xsl:attribute name="表:数据类型">date</xsl:attribute>
+ <xsl:attribute name="表:数据数值"><xsl:value-of select="@office:date-value"/></xsl:attribute>
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="text:p"/>
+ </字:文本串>
+ </字:句>
+ </xsl:when>
+ <xsl:when test="$valueType = 'time'">
+ <xsl:attribute name="表:数据类型">time</xsl:attribute>
+ <xsl:attribute name="表:数据数值"><xsl:value-of select="@office:time-value"/></xsl:attribute>
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="text:p"/>
+ </字:文本串>
+ </字:句>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="表:数据类型">number</xsl:attribute>
+ <xsl:attribute name="表:数据数值"><xsl:value-of select="@office:value"/></xsl:attribute>
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="text:p"/>
+ </字:文本串>
+ </字:句>
+ </xsl:otherwise>
+ </xsl:choose>
+ </表:数据>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="分页符集">
+ <xsl:for-each select="table:table-row">
+ <xsl:if test="key('styles', @table:style-name)/style:table-row-properties/@fo:break-before">
+ <xsl:variable name="table-break-before">
+ <xsl:value-of select="key('styles', @table:style-name)/style:table-row-properties/@fo:break-before"/>
+ </xsl:variable>
+ <xsl:if test="$table-break-before = 'page'">
+ <xsl:element name="表:分页符">
+ <xsl:attribute name="uof:locID">s0112</xsl:attribute>
+ <xsl:attribute name="uof:attrList">行号 列号</xsl:attribute>
+ <xsl:if test="preceding-sibling::table:table-row/@table:number-rows-repeated">
+ <xsl:attribute name="表:行号"><xsl:value-of select="sum(preceding-sibling::table:table-row/@table:number-rows-repeated)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(preceding-sibling::table:table-row/@table:number-rows-repeated)">
+ <xsl:attribute name="表:行号">1</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="key('styles', @table:style-name)/style:table-row-properties/@fo:break-after">
+ <xsl:variable name="table-break-after" select="key('styles', @table:style-name)/style:table-row-properties/@fo:break-after"/>
+ <xsl:if test="$table-break-after = 'page'">
+ <xsl:element name="表:分页符">
+ <xsl:attribute name="uof:locID">s0112</xsl:attribute>
+ <xsl:attribute name="uof:attrList">行号 列号</xsl:attribute>
+ <xsl:if test="preceding-sibling::table:table-row/@table:number-rows-repeated">
+ <xsl:attribute name="表:行号"><xsl:value-of select="sum(preceding-sibling::table:table-row/@table:number-rows-repeated)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(preceding-sibling::table:table-row/@table:number-rows-repeated)">
+ <xsl:attribute name="表:行号">1</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="table:table-column">
+ <xsl:if test="key('styles', @table:style-name)/style:table-column-properties/@fo:break-before">
+ <xsl:variable name="table-break-before" select="key('styles', @table:style-name)/style:table-column-properties/@fo:break-before"/>
+ <xsl:if test="$table-break-before = 'page'">
+ <xsl:element name="表:分页符">
+ <xsl:attribute name="uof:locID">s0112</xsl:attribute>
+ <xsl:attribute name="uof:attrList">行号 列号</xsl:attribute>
+ <xsl:if test="preceding-sibling::table:table-column/@table:number-columns-repeated">
+ <xsl:attribute name="表:列号"><xsl:value-of select="sum(preceding-sibling::table:table-column/@table:number-columns-repeated)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(preceding-sibling::table:table-column/@table:number-columns-repeated)">
+ <xsl:attribute name="表:列号">1</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="key('styles', @table:style-name)/style:table-column-properties/@fo:break-after">
+ <xsl:variable name="table-break-after" select="key('styles', @table:style-name)/style:table-column-properties/@fo:break-after"/>
+ <xsl:if test="$table-break-after = 'page'">
+ <xsl:element name="表:分页符">
+ <xsl:attribute name="uof:locID">s0112</xsl:attribute>
+ <xsl:attribute name="uof:attrList">行号 列号</xsl:attribute>
+ <xsl:if test="preceding-sibling::table:table-column/@table:number-columns-repeated">
+ <xsl:attribute name="表:列号"><xsl:value-of select="sum(preceding-sibling::table:table-column/@table:number-columns-repeated)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(preceding-sibling::table:table-column/@table:number-columns-repeated)">
+ <xsl:attribute name="表:列号">1</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="text:s">
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="@text:c"/>
+ </xsl:call-template>
+ </xsl:template>
+ <!--write the number of 'whitespaces' -->
+ <xsl:template name="write-breakable-whitespace">
+ <xsl:param name="whitespaces"/>
+ <xsl:text> </xsl:text>
+ <xsl:if test="$whitespaces >= 1">
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <!-- allowing all matched text nodes -->
+ <!--chengxz0630-->
+ <!--xsl:template match="text()">
+ <字:句 uof:locID="t0085">
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="locID">t0109</xsl:attribute>
- PARAM 'rounding-factor'
- Is used for the rounding of decimal places.
- The parameter number is the product of 1 and some '10', where
- every zero represents a decimal place.
+ <xsl:value-of select="." />
+ </xsl:element>
+ </字:句>
+ </xsl:template-->
+ <xsl:variable name="namespace-html" select="'http://www.w3.org/TR/REC-html40'"/>
+ <xsl:template match="@table:style-name | @table:default-cell-style-name">
+ <xsl:attribute name="表:式样引用"><!--ss:styleID--><xsl:value-of select="."/><!--chengxz 060114--></xsl:attribute>
+ </xsl:template>
+ <xsl:template name="style-and-contents">
+ <xsl:param name="cellStyleName"/>
+ <字:句 uof:locID="t0085">
+ <xsl:element name="字:文本串">
+ <!--chengxz0630-->
+ </xsl:element>
+ </字:句>
+ </xsl:template>
+ <!-- *************88-->
+ <xsl:param name="dpi" select="111"/>
+ <xsl:param name="centimeter-in-mm" select="10"/>
+ <xsl:param name="inch-in-mm" select="25.4"/>
+ <xsl:param name="didot-point-in-mm" select="0.376065"/>
+ <xsl:param name="pica-in-mm" select="4.2333333"/>
+ <xsl:param name="point-in-mm" select="0.3527778"/>
+ <xsl:param name="twip-in-mm" select="0.017636684"/>
+ <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
+ <!-- ***** MEASUREMENT CONVERSIONS *****
+ PARAM 'value'
+ The measure to be converted.
+ The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
+ directly added to the number.
- For example, providing as parameter:
- <xsl:param name="rounding-factor" select="10000" />
- Gives by default four decimal places.
+ PARAM 'rounding-factor'
+ Is used for the rounding of decimal places.
+ The parameter number is the product of 1 and some '10', where
+ every zero represents a decimal place.
- To round two decimal places, basically the following is done:
- <xsl:value-of select="round(100 * value) div 100"/>
+ For example, providing as parameter:
+ <xsl:param name="rounding-factor" select="10000" />
+ Gives by default four decimal places.
- RETURN The converted number, by default rounded to four decimal places.
- In case the input measure could not be matched the same value is
- returned and a warning message is written out.
+ To round two decimal places, basically the following is done:
+ <xsl:value-of select="round(100 * value) div 100"/>
+ RETURN The converted number, by default rounded to four decimal places.
+ In case the input measure could not be matched the same value is
+ returned and a warning message is written out.
- MEASURE LIST:
- * 1 milimeter (mm), the basic measure
- * 1 centimeter (cm) = 10 mm
+ MEASURE LIST:
+ * 1 milimeter (mm), the basic measure
- * 1 inch (in) = 25.4 mm
- While the English have already seen the light (read: the metric system), the US
- remains loyal to this medieval system.
+ * 1 centimeter (cm) = 10 mm
- * 1 point (pt) = 0.35277777.. mm
- Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
- There are exactly 72 PostScript points in 1 inch.
+ * 1 inch (in) = 25.4 mm
+ While the English have already seen the light (read: the metric system), the US
+ remains loyal to this medieval system.
- * 1 twip = twentieth of a (PostScript) point
- A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
+ * 1 point (pt) = 0.35277777.. mm
+ Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
+ There are exactly 72 PostScript points in 1 inch.
- * 1 didot point (dpt) = 0.376065 mm
- Didot point after the French typographer Firmin Didot (1764-1836).
+ * 1 twip = twentieth of a (PostScript) point
+ A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
- More details under
- http://www.unc.edu/~rowlett/units/dictP.html:
- "A unit of length used by typographers and printers. When printing was done
- from hand-set metal type, one point represented the smallest element of type
- that could be handled, roughly 1/64 inch. Eventually, the point was standardized
- in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
- about 0.35 mm (351.46 micrometers). In continental Europe, typographers
- traditionally used a slightly larger point of 0.014 83 inch (about
- 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
- after the French typographer Firmin Didot (1764-1836). In the U.S.,
- Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
- or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
- of 0.351 459 8035 mm. The German standards agency DIN has proposed that
- all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
+ * 1 didot point (dpt) = 0.376065 mm
+ Didot point after the French typographer Firmin Didot (1764-1836).
- * 1 pica = 4.233333 mm
- 1/6 inch or 12 points
+ More details under
+ http://www.unc.edu/~rowlett/units/dictP.html:
+ "A unit of length used by typographers and printers. When printing was done
+ from hand-set metal type, one point represented the smallest element of type
+ that could be handled, roughly 1/64 inch. Eventually, the point was standardized
+ in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
+ about 0.35 mm (351.46 micrometers). In continental Europe, typographers
+ traditionally used a slightly larger point of 0.014 83 inch (about
+ 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
+ after the French typographer Firmin Didot (1764-1836). In the U.S.,
+ Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
+ or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
+ of 0.351 459 8035 mm. The German standards agency DIN has proposed that
+ all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
- * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
- Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
+ * 1 pica = 4.233333 mm
+ 1/6 inch or 12 points
+ * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
+ Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
- -->
- <!-- changing measure to mm -->
- <xsl:template name="convert2mm">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="substring-before($value, 'mm')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm' ) * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in' ) * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'mm'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to cm -->
- <xsl:template name="convert2cm">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="substring-before($value, 'cm')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to inch (cp. section comment) -->
- <xsl:template name="convert2in">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $inch-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="substring-before($value, 'in')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $inch-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $inch-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $inch-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $inch-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $inch-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'in'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to dpt (cp. section comment) -->
- <xsl:template name="convert2dpt">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $didot-point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $didot-point-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $didot-point-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="substring-before($value, 'dpt')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $didot-point-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $didot-point-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $didot-point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'dpt'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pica (cp. section comment) -->
- <xsl:template name="convert2pica">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $pica-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $pica-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $pica-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $pica-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="substring-before($value, 'pica')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $pica-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $pica-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pica'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pt (cp. section comment) -->
- <xsl:template name="convert2pt">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $point-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="substring-before($value, 'pt')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $point-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $point-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $point-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pt'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pt (cp. section comment) -->
- <xsl:template name="convert2twip">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $twip-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $twip-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $twip-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $twip-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $twip-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="substring-before($value, 'twip')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $twip-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'twip'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="convert2px">
- <xsl:param name="value"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round(number(substring-before($value, 'mm')) div $pixel-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round(number(substring-before($value, 'cm')) div $pixel-in-mm * $centimeter-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round(number(substring-before($value, 'in')) div $pixel-in-mm * $inch-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round(number(substring-before($value, 'pt')) div $pixel-in-mm * $point-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round(number(substring-before($value, 'dpt')) div $pixel-in-mm * $didot-point-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round(number(substring-before($value, 'pica')) div $pixel-in-mm * $pica-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round(number(substring-before($value, 'twip')) div $pixel-in-mm * $twip-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'px'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:key match="draw:object/office:document/office:automatic-styles/style:style" name="chart-style-name" use="@style:name"/>
- <xsl:template name="draw:chart-frame">
- <xsl:param name="table-name"/>
- <表:图表 uof:locID="s0055" uof:attrList="类型 子类型 宽度 高度 x坐标 y坐标 随动方式">
- <xsl:variable name="plot-area">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@chart:style-name"/>
- </xsl:variable>
- <xsl:variable name="data-area">
- <xsl:value-of select="draw:object/@draw:notify-on-update-of-ranges"/>
- </xsl:variable>
- <xsl:variable name="series-generate">
- <xsl:for-each select="key('chart-style-name',$plot-area)">
- <xsl:choose>
- <xsl:when test="style:chart-properties/@chart:series-source='columns'">col</xsl:when>
- <xsl:otherwise>row</xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
- <xsl:call-template name="表:图表">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- </xsl:call-template>
- <表:图表区 uof:locID="s0056">
- <xsl:call-template name="表:图表区">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- </xsl:call-template>
- </表:图表区>
- <表:绘图区 uof:locID="s0060">
- <xsl:attribute name="表:宽度"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@svg:width,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="表:高度"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@svg:height,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="表:x坐标"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@svg:x,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="表:y坐标"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@svg:y,$uofUnit)"/></xsl:attribute>
- <xsl:call-template name="表:绘图区">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- </xsl:call-template>
- </表:绘图区>
- <表:分类轴 uof:locID="s0061" uof:attrList="主刻度类型 次刻度类型 刻度线标志">
- <xsl:variable name="axis-style-name">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[child::chart:categories]/@chart:style-name"/>
- </xsl:variable>
- <xsl:for-each select="draw:object/office:document/office:automatic-styles/style:style[@style:name=$axis-style-name]">
- <xsl:attribute name="表:主刻度类型"><xsl:choose><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='true' and style:chart-properties/@chart:tick-marks-major-outer='true'">cross</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='false'">inside</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='true'">outside</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="表:次刻度类型"><xsl:choose><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true' and style:chart-properties/@chart:tick-marks-minor-outer='true'">cross</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true'">inside</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true'">outside</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="表:刻度线标志"><xsl:choose><xsl:when test="style:chart-properties/@chart:display-label='true'">next to axis</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:call-template name="表:坐标轴类型">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="axis-type" select="category-axis"/>
- </xsl:call-template>
- </xsl:for-each>
- </表:分类轴>
- <表:数值轴 uof:locID="s0082" uof:attrList="主刻度类型 次刻度类型 刻度线标志">
- <xsl:variable name="axis-style-name">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[child::chart:grid]/@chart:style-name"/>
- </xsl:variable>
- <xsl:for-each select="draw:object/office:document/office:automatic-styles/style:style[@style:name=$axis-style-name]">
- <xsl:attribute name="表:主刻度类型"><xsl:choose><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='true' and style:chart-properties/@chart:tick-marks-major-outer='true'">cross</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='true'">inside</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='true'">outside</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="表:次刻度类型"><xsl:choose><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true' and style:chart-properties/@chart:tick-marks-minor-outer='true'">cross</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true'">inside</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true'">outside</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="表:刻度线标志"><xsl:choose><xsl:when test="style:chart-properties/@chart:display-label='true'">next to axis</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:call-template name="表:坐标轴类型">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="axis-type" select="category-axis"/>
- </xsl:call-template>
- </xsl:for-each>
- </表:数值轴>
- <表:图例 uof:locID="s0083" uof:attrList="位置">
- <xsl:attribute name="表:位置"><xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:legend/@chart:legend-position"/></xsl:attribute>
- <xsl:attribute name="表:x坐标"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:legend/@svg:x,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="表:y坐标"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:legend/@svg:y,$uofUnit)"/></xsl:attribute>
- <xsl:call-template name="表:图例">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- </xsl:call-template>
- </表:图例>
- <!--表:数据表 uof:locID="s0085">
- <xsl:call-template name="表:数据表">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- </xsl:call-template>
- </表:数据表-->
- <表:数据系列集 uof:locID="s0086">
- <xsl:variable name="data-series-path" select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:series"/>
- <xsl:call-template name="表:数据系列">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="data-series-path" select="$data-series-path"/>
- </xsl:call-template>
- </表:数据系列集>
- <!--0825 by lil -->
- <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:series">
- <表:数据点集 uof:locID="s0090">
- <xsl:variable name="data-series-path" select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:series"/>
- <xsl:call-template name="表:数据点">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="data-series-path" select="$data-series-path"/>
- </xsl:call-template>
- </表:数据点集>
- </xsl:if>
- <!--end-->
- <表:网格线集 uof:locID="s0092">
- <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='x' and @chart:style-name]/chart:grid">
- <xsl:call-template name="表:网格线">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="grid-type" select="'category axis'"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='y']/@chart:style-name">
- <xsl:call-template name="表:网格线">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="grid-type" select="'value axis'"/>
- </xsl:call-template>
- </xsl:if>
- </表:网格线集>
- <表:数据源 uof:locID="s0094" uof:attrList="数据区域 系列产生">
- <xsl:variable name="series-row-start">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring-before(substring(substring-after($data-area,'.'),2),':')"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="series-row-end">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after(substring-after($data-area,'.'),'.'),2)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="series-col-start">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after($data-area,'.'),1,1)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="series-col-end">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after(substring-after($data-area,'.'),'.'),1,1)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="series-value-count">
- <xsl:choose>
- <xsl:when test="$series-generate='col'">
- <xsl:value-of select="$series-col-end -$series-col-start +1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$series-row-end -$series-row-start +1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="表:数据区域"><xsl:value-of select="draw:object/@draw:notify-on-update-of-ranges"/></xsl:attribute>
- <xsl:attribute name="表:系列产生"><xsl:choose><xsl:when test="contains($series-generate,'col')">col</xsl:when><xsl:when test="contains($series-generate,'row')">row</xsl:when></xsl:choose></xsl:attribute>
- <xsl:call-template name="表:系列">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="series-row-start" select="$series-row-start"/>
- <xsl:with-param name="series-row-end" select="$series-row-end"/>
- <xsl:with-param name="series-col-start" select="$series-col-start"/>
- <xsl:with-param name="series-col-end" select="$series-col-end"/>
- <xsl:with-param name="series-value-current" select="'1'"/>
- <xsl:with-param name="series-value-count" select="$series-value-count"/>
- </xsl:call-template>
- </表:数据源>
- <表:标题集 uof:locID="s0096">
- <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:title">
- <xsl:call-template name="表:标题">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="caption-type" select="'chart'"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='x']">
- <xsl:call-template name="表:标题">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="caption-type" select="'category axis'"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='y']">
- <xsl:call-template name="表:标题">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="caption-type" select="'value axis'"/>
- </xsl:call-template>
- </xsl:if>
- </表:标题集>
- </表:图表>
- </xsl:template>
- <xsl:template name="表:图表">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:variable name="chart-class">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/@chart:class"/>
- </xsl:variable>
- <xsl:variable name="chart-area">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/@chart:style-name"/>
- </xsl:variable>
- <xsl:variable name="plot-area">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@chart:style-name"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$chart-class='chart:bar'">
- <xsl:variable name="chart-sub-class">
- <xsl:value-of select="key('chart-style-name',$plot-area)/style:chart-properties/@chart:vertical"/>
- </xsl:variable>
- <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="$chart-sub-class='true'">bar</xsl:when><xsl:when test="$chart-sub-class='false'">column</xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute>
- <xsl:attribute name="表:子类型"><xsl:choose><xsl:when test="$chart-sub-class='true'"><xsl:choose><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:percentage">bar_percent</xsl:when><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:stacked">bar_stacked</xsl:when><xsl:otherwise>bar_standard</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="$chart-sub-class='false'"><xsl:choose><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:percentage">column_percent</xsl:when><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:stacked">column_stacked</xsl:when><xsl:otherwise>column_standard</xsl:otherwise></xsl:choose></xsl:when></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="$chart-class='chart:line'">
- <xsl:attribute name="表:类型">line</xsl:attribute>
- <xsl:attribute name="表:子类型"><xsl:choose><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:percentage">line_percent</xsl:when><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:stacked">line_stacked</xsl:when><xsl:otherwise>line_standard</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="$chart-class='chart:circle'">
- <xsl:attribute name="表:类型">pie</xsl:attribute>
- <xsl:variable name="data-point-end" select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:series[1]/chart:data-point"/>
- <xsl:choose>
- <xsl:when test="count($data-point-end) &lt;=1">
- <xsl:attribute name="表:子类型">pie_standard</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="data-point-position-1">
- <xsl:for-each select="$data-point-end[position()=1]">
- <xsl:choose>
- <xsl:when test="@chart:style-name">
- <xsl:for-each select="key('chart-style-name',@chart:style-name)">
- <xsl:choose>
- <xsl:when test="style:chart-properties/@chart:pie-offset">1</xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$data-point-position-1='0'">
- <xsl:attribute name="表:子类型">pie_standard</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="$data-point-end[position()=2]">
- <xsl:choose>
- <xsl:when test="@chart:style-name">
- <xsl:for-each select="key('chart-style-name',@chart:style-name)">
- <xsl:choose>
- <xsl:when test="style:chart-properties/@chart:pie-offset">
- <xsl:attribute name="表:子类型">pie_offset2</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="表:子类型">pie_offset1</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="表:子类型">pie_offset1</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$chart-class='chart:ring'">
- <xsl:attribute name="表:类型">pie</xsl:attribute>
- <xsl:attribute name="表:子类型">pie_ring</xsl:attribute>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- <xsl:attribute name="表:宽度"><xsl:value-of select="substring-before(@svg:width,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="表:高度"><xsl:value-of select="substring-before(@svg:height,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="表:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="表:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="@draw:style-name">
- <xsl:variable name="draw-style-name" select="@draw:style-name"/>
- <xsl:for-each select="draw:object//office:document/office:automatic-styles/style:style[@style:name=$draw-style-name]">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:move-protect='true' and style:graphic-properties/@draw:size-protect='true'">
- <xsl:attribute name="表:随动方式">none</xsl:attribute>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@draw:size-protect='true'">
- <xsl:attribute name="表:随动方式">move</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="表:随动方式">move and re-size</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="表:随动方式">move and re-size</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:图表区">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:variable name="chart-style-name" select="draw:object/office:document/office:body/office:chart/chart:chart/@chart:style-name"/>
- <xsl:for-each select="draw:object/office:document/office:automatic-styles/style:style[@style:name=$chart-style-name]">
- <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
- <xsl:call-template name="表:边框"/>
- </表:边框>
- <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
- <表:填充 uof:locID="s0058">
- <xsl:call-template name="图:填充类型"/>
- </表:填充>
- </xsl:if>
- <表:字体 uof:locID="s0059" uof:attrList="式样引用">
- <xsl:call-template name="字:句属性类型">
- </xsl:call-template>
- </表:字体>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:绘图区">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:variable name="plot-style-name" select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:wall/@chart:style-name"/>
- <xsl:for-each select="draw:object/office:document/office:automatic-styles/style:style[@style:name=$plot-style-name]">
- <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
- <xsl:call-template name="表:边框"/>
- </表:边框>
- <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
- <表:填充 uof:locID="s0058">
- <xsl:call-template name="图:填充类型2"/>
- </表:填充>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:图例">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:variable name="legend">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:legend/@chart:style-name"/>
- </xsl:variable>
- <xsl:for-each select="draw:object/office:document/office:automatic-styles/style:style[@style:name=$legend]">
- <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
- <xsl:call-template name="表:边框"/>
- </表:边框>
- <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
- <表:填充 uof:locID="s0058">
- <xsl:call-template name="图:填充类型"/>
- </表:填充>
- </xsl:if>
- <表:字体 uof:locID="s0059" uof:attrList="式样引用">
- <xsl:call-template name="字:句属性类型"/>
- </表:字体>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:图例项">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <表:图例项 uof:locID="s0084" uof:attrList="系列">
- <表:字体 uof:locID="s0059" uof:attrList="式样引用">
- <xsl:call-template name="字:句属性类型"/>
- </表:字体>
- </表:图例项>
- </xsl:template>
- <xsl:template name="表:数据表">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
- <表:填充 uof:locID="s0058">
- <xsl:call-template name="图:填充类型"/>
- </表:填充>
- </xsl:if>
- <表:字体 uof:locID="s0059" uof:attrList="式样引用">
- <xsl:call-template name="字:句属性类型"/>
- </表:字体>
- </xsl:template>
- <xsl:template name="表:数据系列">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:param name="data-series-path"/>
- <xsl:for-each select="$data-series-path">
- <表:数据系列 uof:locID="s0087" uof:attrList="系列">
- <xsl:variable name="data-series-position">
- <xsl:value-of select="position()"/>
- </xsl:variable>
- <xsl:attribute name="表:系列"><xsl:value-of select="$data-series-position"/></xsl:attribute>
- <xsl:variable name="data-series-point" select="@chart:style-name"/>
- <xsl:call-template name="表:数据点类型">
- <xsl:with-param name="data-series-point" select="$data-series-point"/>
- <xsl:with-param name="data-series-position" select="$data-series-position"/>
- </xsl:call-template>
- </表:数据系列>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:数据点">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:param name="data-series-path"/>
- <xsl:for-each select="$data-series-path">
- <xsl:variable name="data-series-position" select="position()"/>
- <xsl:for-each select="chart:data-point">
- <!--xsl:if test="@chart:style-name"-->
- <xsl:variable name="data-point-position">
- <xsl:call-template name="count-chart-data-point">
- <xsl:with-param name="data-point-count" select="'1'"/>
- <xsl:with-param name="data-point-position-temp" select="position() -1"/>
- </xsl:call-template>
- </xsl:variable>
- <表:数据点 uof:locID="s0091" uof:attrList="系列 点">
- <xsl:attribute name="表:系列"><xsl:value-of select="$data-series-position"/></xsl:attribute>
- <xsl:attribute name="表:点"><xsl:value-of select="$data-point-position"/></xsl:attribute>
- <xsl:variable name="data-series-point" select="@chart:style-name"/>
- <xsl:for-each select="../../../../../office:automatic-styles/style:style[@style:name=$data-series-point]">
- <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
- <xsl:call-template name="表:边框"/>
- </表:边框>
- <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
- <表:填充 uof:locID="s0058">
- <xsl:call-template name="图:填充类型"/>
- </表:填充>
- </xsl:if>
- <表:字体 uof:locID="s0059" uof:attrList="式样引用">
- <xsl:call-template name="字:句属性类型"/>
- </表:字体>
- <表:显示标志 uof:locID="s0088" uof:attrList="系列名 类别名 数值 百分数 分隔符 图例标志">
- <xsl:attribute name="表:系列名"/>
- <xsl:attribute name="表:分隔符"/>
- <xsl:if test="style:chart-properties/@chart:data-label-text">
- <xsl:attribute name="表:类别名"><xsl:value-of select="style:chart-properties/@chart:data-label-text"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:chart-properties/@chart:data-label-number">
- <xsl:choose>
- <xsl:when test="style:chart-properties/@chart:data-label-number='value'">
- <xsl:attribute name="表:数值">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="style:chart-properties/@chart:data-label-number='percentage'">
- <xsl:attribute name="表:百分数">true</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="style:chart-properties/@chart:data-label-symbol">
- <xsl:attribute name="表:图例标志"><xsl:value-of select="style:chart-properties/@chart:data-label-symbol"/></xsl:attribute>
- </xsl:if>
- </表:显示标志>
- <表:系列名 uof:locID="s0089">
- <xsl:value-of select="concat('系列',$data-series-position)"/>
- </表:系列名>
- </xsl:for-each>
- </表:数据点>
- <!--/xsl:if-->
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:网格线">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:param name="grid-type"/>
- <xsl:if test="$grid-type='category axis'">
- <xsl:variable name="category-axis-grid">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='x']/@chart:style-name"/>
- </xsl:variable>
- <xsl:for-each select="key('chart-style-name',$category-axis-grid)">
- <表:网格线 uof:locID="s0093" uof:attrList="类型 宽度 边距 颜色 阴影 位置">
- <xsl:call-template name="表:边框"/>
- <xsl:attribute name="表:位置"><xsl:value-of select="$grid-type"/></xsl:attribute>
- </表:网格线>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="$grid-type='value axis'">
- <xsl:variable name="value-axis-grid">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='y']/@chart:style-name"/>
- </xsl:variable>
- <xsl:for-each select="key('chart-style-name',$value-axis-grid)">
- <表:网格线 uof:locID="s0093" uof:attrList="类型 宽度 边距 颜色 阴影 位置">
- <xsl:call-template name="表:边框"/>
- <xsl:attribute name="表:位置"><xsl:value-of select="$grid-type"/></xsl:attribute>
- </表:网格线>
- </xsl:for-each>
- </xsl:if>
- </xsl:template>
- <xsl:template name="表:系列">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:param name="series-row-start"/>
- <xsl:param name="series-row-end"/>
- <xsl:param name="series-col-start"/>
- <xsl:param name="series-col-end"/>
- <xsl:param name="series-value-current"/>
- <xsl:param name="series-value-count"/>
- <xsl:choose>
- <xsl:when test="$series-value-current>$series-value-count"/>
- <xsl:otherwise>
- <表:系列 uof:locID="s0095" uof:attrList="系列名 系列值 分类名">
- <xsl:attribute name="表:系列名"><xsl:value-of select="concat('系列',$series-value-current)"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="$series-generate='col'">
- <xsl:variable name="series-col-letter-start">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="$series-col-start +$series-value-current -1"/>
- <xsl:with-param name="output-type" select="'CHARS_UPPER_LETTER'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="表:系列值"><xsl:value-of select="concat($table-name,'!',$series-col-letter-start,$series-row-start,':',$series-col-letter-start,$series-row-end)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="series-col-letter-start">
- <xsl:value-of select="substring(substring-after($data-area,'.'),1,1)"/>
- </xsl:variable>
- <xsl:variable name="series-col-letter-end">
- <xsl:value-of select="substring(substring-after(substring-after($data-area,'.'),'.'),1,1)"/>
- </xsl:variable>
- <xsl:attribute name="表:系列值"><xsl:value-of select="concat($table-name,'!',$series-col-letter-start,$series-row-start +$series-value-current -1,':',$series-col-letter-end,$series-row-start +$series-value-current -1)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </表:系列>
- <xsl:call-template name="表:系列">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="data-area" select="$data-area"/>
- <xsl:with-param name="series-generate" select="$series-generate"/>
- <xsl:with-param name="series-row-start" select="$series-row-start"/>
- <xsl:with-param name="series-row-end" select="$series-row-end"/>
- <xsl:with-param name="series-col-start" select="$series-col-start"/>
- <xsl:with-param name="series-col-end" select="$series-col-end"/>
- <xsl:with-param name="series-value-current" select="$series-value-current +1"/>
- <xsl:with-param name="series-value-count" select="$series-value-count"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:标题">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:param name="caption-type"/>
- <xsl:if test="$caption-type='chart'">
- <xsl:variable name="chart-title">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:title/@chart:style-name"/>
- </xsl:variable>
- <xsl:variable name="chart-title-name">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:title/text:p"/>
- </xsl:variable>
- <xsl:for-each select="key('chart-style-name',$chart-title)">
- <表:标题 uof:locID="s0097" uof:attrList="名称 位置">
- <xsl:attribute name="表:名称"><xsl:value-of select="$chart-title-name"/></xsl:attribute>
- <xsl:attribute name="表:位置"><xsl:value-of select="$caption-type"/></xsl:attribute>
- <xsl:call-template name="表:标题类型"/>
- </表:标题>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="$caption-type='category axis'">
- <xsl:variable name="category-axis-title">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='x']/chart:title/@chart:style-name"/>
- </xsl:variable>
- <xsl:variable name="category-axis-title-name">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='x']/chart:title/text:p"/>
- </xsl:variable>
- <xsl:for-each select="key('chart-style-name',$category-axis-title)">
- <表:标题 uof:locID="s0097" uof:attrList="名称 位置">
- <xsl:attribute name="表:名称"><xsl:value-of select="$category-axis-title-name"/></xsl:attribute>
- <xsl:attribute name="表:位置"><xsl:value-of select="$caption-type"/></xsl:attribute>
- <xsl:call-template name="表:标题类型"/>
- </表:标题>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="$caption-type='value axis'">
- <xsl:variable name="value-axis-title">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='y']/chart:title/@chart:style-name"/>
- </xsl:variable>
- <xsl:variable name="value-axis-title-name">
- <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='y']/chart:title/text:p"/>
- </xsl:variable>
- <xsl:for-each select="key('chart-style-name',$value-axis-title)">
- <表:标题 uof:locID="s0097" uof:attrList="名称 位置">
- <xsl:attribute name="表:名称"><xsl:value-of select="$value-axis-title-name"/></xsl:attribute>
- <xsl:attribute name="表:位置"><xsl:value-of select="$caption-type"/></xsl:attribute>
- <xsl:call-template name="表:标题类型"/>
- </表:标题>
- </xsl:for-each>
- </xsl:if>
- </xsl:template>
- <xsl:template name="表:坐标轴类型">
- <xsl:param name="table-name"/>
- <xsl:param name="data-area"/>
- <xsl:param name="series-generate"/>
- <xsl:param name="axis-type"/>
- <表:线型 uof:locID="s0062" uof:attrList="类型 宽度 边距 颜色 阴影">
- <xsl:attribute name="uof:类型"><xsl:call-template name="表:线型"/></xsl:attribute>
- </表:线型>
- <表:数值 uof:locID="s0063" uof:attrList="链接到源 分类名称 格式码">
- <xsl:attribute name="表:链接到源"><xsl:choose><xsl:when test="style:chart-properties/@chart:link-data-style-to-source"><xsl:value-of select="style:chart-properties/@chart:link-data-style-to-source"/></xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="@style:data-style-name">
- <xsl:call-template name="Chart-NumberFormat">
- <xsl:with-param name="temp-style" select="@style:data-style-name"/>
- </xsl:call-template>
- </xsl:if>
- </表:数值>
- <表:字体 uof:locID="s0059" uof:attrList="式样引用">
- <xsl:call-template name="字:句属性类型"/>
- </表:字体>
- <表:刻度 uof:locID="s0064">
- <xsl:call-template name="表:刻度类型"/>
- </表:刻度>
- <表:对齐 uof:locID="s0078">
- <xsl:if test="style:chart-properties/@style:direction">
- <xsl:element name="表:文字方向">
- <xsl:attribute name="uof:locID">s0079</xsl:attribute>
- <xsl:choose>
- <xsl:when test="style:chart-properties/@style:direction = 'ttb'">vertical</xsl:when>
- <xsl:otherwise>horizontal</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:chart-properties/@text:rotation-angle">
- <表:旋转角度 uof:locID="s0080">
- <xsl:value-of select="style:chart-properties/@text:rotation-angle"/>
- </表:旋转角度>
- </xsl:if>
- <表:偏移量 uof:locID="s0081"/>
- </表:对齐>
- </xsl:template>
- <xsl:template name="Chart-NumberFormat">
- <xsl:param name="temp-style"/>
- <xsl:for-each select="(preceding-sibling::*[@style:name=$temp-style]) | (following-sibling::*[@style:name=$temp-style])">
- <xsl:attribute name="表:分类名称"><xsl:choose><xsl:when test="name(.)='number:currency-style'">currency</xsl:when><xsl:when test="name(.)='number:percentage-style'">percentage</xsl:when><xsl:when test="name(.)='number:date-style'">date</xsl:when><xsl:when test="name(.)='number:time-style'">time</xsl:when><xsl:when test="name(.)='number:boolean-style'">custom</xsl:when><xsl:when test="name(.)='number:text-style'">text</xsl:when><xsl:when test="name(.)='number:number-style'"><xsl:choose><xsl:when test="number:fraction">fraction</xsl:when><xsl:when test="number:scientific-number">scientific</xsl:when><xsl:otherwise>number</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>general</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="表:格式码"><xsl:call-template name="element-attribute"/><xsl:for-each select="style:map"><xsl:text>[</xsl:text><xsl:value-of select="@style:condition"/><xsl:text>]</xsl:text><xsl:variable name="apply-style" select="@style:apply-style-name"/><xsl:for-each select="../../child::*[@style:name=$apply-style]/*"><xsl:call-template name="general-number-format"/></xsl:for-each><xsl:text>;</xsl:text></xsl:for-each><xsl:for-each select="*[not(name(.)='style:map')]"><xsl:call-template name="general-number-format"/></xsl:for-each></xsl:attribute>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:数据点类型">
- <xsl:param name="data-series-point"/>
- <xsl:param name="data-series-position"/>
- <xsl:for-each select="ancestor::draw:object/office:document/office:automatic-styles/style:style[@style:name=$data-series-point]">
- <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
- <xsl:call-template name="表:边框"/>
- </表:边框>
- <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
- <表:填充 uof:locID="s0058">
- <xsl:call-template name="图:填充类型"/>
- </表:填充>
- </xsl:if>
- <表:字体 uof:locID="s0059" uof:attrList="式样引用">
- <xsl:call-template name="字:句属性类型"/>
- </表:字体>
- <表:显示标志 uof:locID="s0088" uof:attrList="系列名 类别名 数值 百分数 分隔符 图例标志">
- <xsl:attribute name="表:系列名">true</xsl:attribute>
- <xsl:if test="style:chart-properties/@chart:data-label-text">
- <xsl:attribute name="表:类别名"><xsl:value-of select="style:chart-properties/@chart:data-label-text"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:chart-properties/@chart:data-label-number">
- <xsl:choose>
- <xsl:when test="style:chart-properties/@chart:data-label-number='value'">
- <xsl:attribute name="表:数值">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="style:chart-properties/@chart:data-label-number='percentage'">
- <xsl:attribute name="表:百分数">true</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="style:chart-properties/@chart:data-label-symbol">
- <xsl:attribute name="表:图例标志"><xsl:value-of select="style:chart-properties/@chart:data-label-symbol"/></xsl:attribute>
- </xsl:if>
- </表:显示标志>
- <表:系列名 uof:locID="s0089">
- <xsl:value-of select="concat('系列',$data-series-position)"/>
- </表:系列名>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:标题类型">
- <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
- <xsl:call-template name="表:边框"/>
- </表:边框>
- <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
- <表:填充 uof:locID="s0058">
- <xsl:call-template name="图:填充类型"/>
- </表:填充>
- </xsl:if>
- <表:字体 uof:locID="s0059" uof:attrList="式样引用">
- <xsl:call-template name="字:句属性类型"/>
- </表:字体>
- <表:对齐 uof:locID="s0020">
- <xsl:call-template name="表:对齐格式类型"/>
- </表:对齐>
- </xsl:template>
- <xsl:template name="count-chart-data-point">
- <xsl:param name="data-point-count"/>
- <xsl:param name="data-point-position-temp"/>
- <xsl:choose>
- <xsl:when test="$data-point-position-temp=0">
- <xsl:value-of select="$data-point-count"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="temp">
- <xsl:for-each select="../chart:data-point[position()=$data-point-position-temp]">
- <xsl:choose>
- <xsl:when test="@chart:repeated">
- <xsl:value-of select="@chart:repeated"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
- <xsl:call-template name="count-chart-data-point">
- <xsl:with-param name="data-point-count" select="$data-point-count +$temp"/>
- <xsl:with-param name="data-point-position-temp" select="$data-point-position-temp -1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:边框">
- <xsl:attribute name="uof:类型"><xsl:call-template name="表:线型"/></xsl:attribute>
- <xsl:if test="style:graphic-properties/@svg:stroke-width">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-width,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@svg:stroke-color">
- <xsl:attribute name="uof:颜色"><xsl:value-of select="style:graphic-properties/@svg:stroke-color"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="uof:阴影">false</xsl:attribute>
- </xsl:template>
- <xsl:template name="图:填充类型">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:fill='gradient'">
- <xsl:variable name="gradient-name">
- <xsl:value-of select="style:graphic-properties/@draw:fill-gradient-name"/>
- </xsl:variable>
- <xsl:for-each select="/descendant::draw:gradient[@draw:name=$gradient-name]">
- <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
- <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
- <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
- <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
- <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
- <xsl:variable name="angle">
- <xsl:value-of select="@draw:angle div 10"/>
- </xsl:variable>
- <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
- <xsl:if test="@draw:cx">
- <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@draw:cy">
- <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="图:类型">-2</xsl:attribute>
- </图:渐变>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@draw:fill-image-name">
- <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
- <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:graphic-properties/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:graphic-properties/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:图形引用"><xsl:value-of select="concat('chart_image_',count(preceding::draw:fill-image))"/></xsl:attribute>
- <xsl:attribute name="图:类型">png</xsl:attribute>
- <xsl:attribute name="图:名称"><xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/></xsl:attribute>
- </图:图片>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@draw:fill='hatch'">
- <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
- <xsl:attribute name="图:类型"><xsl:value-of select="../../office:styles/draw:hatch/@draw:name"/></xsl:attribute>
- <xsl:attribute name="图:图形引用">gr1</xsl:attribute>
- <xsl:attribute name="图:前景色"><xsl:value-of select="../../office:styles/draw:hatch/@draw:color"/></xsl:attribute>
- <xsl:attribute name="图:背景色"><xsl:choose><xsl:when test="style:graphic-properties/@draw:fill-color"><xsl:value-of select="style:graphic-properties/@draw:fill-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
- </图:图案>
- </xsl:when>
- <xsl:otherwise>
- <图:颜色 uof:locID="g0034">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:fill-color">
- <xsl:value-of select="style:graphic-properties/@draw:fill-color"/>
- </xsl:when>
- <xsl:otherwise>#99ccff</xsl:otherwise>
- </xsl:choose>
- </图:颜色>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="图:填充类型2">
- <xsl:if test="style:graphic-properties/@draw:fill-color">
- <图:颜色 uof:locID="g0034">
- <xsl:value-of select="style:graphic-properties/@draw:fill-color"/>
- </图:颜色>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:fill-image-name">
- <xsl:variable name="chart-image-name" select="style:graphic-properties/@draw:fill-image-name"/>
- <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
- <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:graphic-properties/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:graphic-properties/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:for-each select="../../office:styles/draw:fill-image[@draw:name=$chart-image-name]">
- <xsl:attribute name="图:图形引用"><xsl:value-of select="concat('chart_image_',count(preceding::draw:fill-image))"/></xsl:attribute>
- </xsl:for-each>
- <xsl:attribute name="图:类型">png</xsl:attribute>
- <xsl:attribute name="图:名称"><xsl:value-of select="$chart-image-name"/></xsl:attribute>
- </图:图片>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:fill-hatch-name">
- <xsl:variable name="chart-hatch-name" select="style:graphic-properties/@draw:fill-hatch-name"/>
- <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
- <xsl:for-each select="../../office:styles/draw:hatch[@draw:name=$chart-hatch-name]">
- <xsl:attribute name="图:类型"><xsl:value-of select="@draw:style"/></xsl:attribute>
- <xsl:attribute name="图:前景色"><xsl:value-of select="@draw:color"/></xsl:attribute>
- <xsl:attribute name="图:背景色"/>
- <xsl:attribute name="图:距离"><xsl:value-of select="@draw:distance"/></xsl:attribute>
- <xsl:attribute name="图:旋转度"><xsl:value-of select="@draw:rotation"/></xsl:attribute>
- </xsl:for-each>
- <xsl:attribute name="图:图形引用"><xsl:value-of select="$chart-hatch-name"/></xsl:attribute>
- </图:图案>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:fill-gradient-name">
- <xsl:variable name="chart-gradient-name" select="style:graphic-properties/@draw:fill-gradient-name"/>
- <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
- <xsl:for-each select="../../office:styles/draw:gradient[@draw:name=$chart-gradient-name]">
- <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
- <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
- <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
- <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
- <xsl:variable name="angle">
- <xsl:value-of select="@draw:angle div 10"/>
- </xsl:variable>
- <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
- <xsl:if test="@draw:cx">
- <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@draw:cy">
- <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="图:类型">-2</xsl:attribute>
- </xsl:for-each>
- <xsl:attribute name="图:图形引用"><xsl:value-of select="$chart-gradient-name"/></xsl:attribute>
- </图:渐变>
- </xsl:if>
- </xsl:template>
- <xsl:template name="表:对齐格式类型">
- <xsl:if test="style:chart-properties/@style:rotation-angle">
- <表:文字旋转角度 uof:locID="s0080">
- <xsl:value-of select="style:chart-properties/@style:rotation-angle"/>
- </表:文字旋转角度>
- </xsl:if>
- <xsl:if test="style:chart-properties/@fo:text-align">
- <xsl:element name="表:水平对齐方式">
- <xsl:attribute name="uof:locID">s0115</xsl:attribute>
- <xsl:choose>
- <xsl:when test="style:chart-properties/@fo:text-align = 'center'">center</xsl:when>
- <xsl:when test="style:chart-properties/@fo:text-align = 'end'">right</xsl:when>
- <xsl:when test="style:chart-properties/@fo:text-align = 'justify'">justify</xsl:when>
- <xsl:when test="style:chart-properties/@fo:text-align = 'start'">left</xsl:when>
- <xsl:otherwise>fill</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="(style:chart-properties/@style:vertical-align) or (style:chart-properties/@fo:vertical-align)">
- <xsl:element name="表:垂直对齐方式">
- <xsl:attribute name="uof:locID">s0116</xsl:attribute>
- <xsl:choose>
- <xsl:when test="style:chart-properties/@fo:vertical-align = 'top'">top</xsl:when>
- <xsl:when test="style:chart-propeoperties/@fo:vertical-align = 'middle'">center</xsl:when>
- <xsl:when test="style:charties/@fo:vertical-align = 'bottom'">bottom</xsl:when>
- <xsl:when test="style:chart-prrt-properties/@fo:vertical-align = 'justify'">justify</xsl:when>
- <xsl:when test="style:chart-properties/@fo:vertical-align = 'top'">top</xsl:when>
- <xsl:otherwise>distributed</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@fo:margin-left">
- <表:缩进 uof:locID="s0117">
- <xsl:value-of select="substring-before(style:paragraph-properties/@fo:margin-left,$uofUnit)"/>
- </表:缩进>
- </xsl:if>
- <xsl:element name="表:文字方向">
- <xsl:attribute name="uof:locID">s0118</xsl:attribute>
- <xsl:choose>
- <xsl:when test="style:chart-properties/@style:direction = 'ttb'">vertical</xsl:when>
- <xsl:otherwise>horizontal</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <表:自动换行 uof:locID="s0120" uof:attrList="值">
- <xsl:attribute name="表:值">true</xsl:attribute>
- </表:自动换行>
- <表:缩小字体填充 uof:locID="s0121" uof:attrList="值">
- <xsl:attribute name="表:值">true</xsl:attribute>
- </表:缩小字体填充>
- </xsl:template>
- <xsl:template name="表:线型">
- <xsl:variable name="linetype" select="style:graphic-properties/@draw:stroke-dash"/>
- <xsl:variable name="stroke" select="style:graphic-properties/@draw:stroke"/>
- <xsl:choose>
- <xsl:when test="$stroke='solid'">single</xsl:when>
- <xsl:when test="$stroke='none'">none</xsl:when>
- <xsl:when test="$stroke='dash'">
- <xsl:choose>
- <xsl:when test="$linetype='Ultrafine_20_Dashed'">dash</xsl:when>
- <xsl:when test="$linetype='Fine_20_Dashed'">dashed-heavy</xsl:when>
- <xsl:when test="$linetype='Ultrafine_20_2_20_Dots_20_3_20_Dashes'">dot-dash</xsl:when>
- <xsl:when test="$linetype='Fine_20_Dotted'">dotted</xsl:when>
- <xsl:when test="$linetype='Line_20_with_20_Fine_20_Dots'">dash-long-heavy</xsl:when>
- <xsl:when test="$linetype='Fine_20_Dashed_20__28_var_29_'">dash-long</xsl:when>
- <xsl:when test="$linetype='_33__20_Dashes_20_3_20_Dots_20__28_var_29_'">dash-dot-dot</xsl:when>
- <xsl:when test="$linetype='Ultrafine_20_Dotted_20__28_var_29_'">dotted-heavy</xsl:when>
- <xsl:when test="$linetype='Line_20_Style_20_9'">thick</xsl:when>
- <xsl:when test="$linetype='_32__20_Dots_20_1_20_Dash'">dot-dot-dash</xsl:when>
- <xsl:when test="$linetype='Dashed_20__28_var_29_'">dash-dot-dot-heavy</xsl:when>
- <xsl:when test="$linetype='Dash_20_10'">dash-dot-heavy</xsl:when>
- <xsl:otherwise>single</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>single</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:刻度类型">
- <xsl:if test="style:chart-properties/@chart:minimum">
- <表:最小值 uof:locID="s0065">
- <xsl:value-of select="style:chart-properties/@chart:minimum"/>
- </表:最小值>
- </xsl:if>
- <xsl:if test="style:chart-properties/@chart:maximum">
- <表:最大值 uof:locID="s0066">
- <xsl:value-of select="style:chart-properties/@chart:maximum"/>
- </表:最大值>
- </xsl:if>
- <xsl:if test="style:chart-properties/@chart:interval-major">
- <表:主单位 uof:locID="s0067">
- <xsl:value-of select="style:chart-properties/@chart:interval-major"/>
- </表:主单位>
- </xsl:if>
- <xsl:if test="style:chart-properties/@chart:interval-minor">
- <表:次单位 uof:locID="s0068">
- <xsl:value-of select="style:chart-properties/@chart:interval-minor"/>
- </表:次单位>
- </xsl:if>
- <xsl:if test="style:chart-properties/@chart:origin">
- <表:分类交叉点 uof:locID="s0069">
- <xsl:value-of select="style:chart-properties/@chart:origin"/>
- </表:分类交叉点>
- </xsl:if>
- <表:单位 uof:locID="s0070">none</表:单位>
- <表:显示单位 uof:locID="s0071" uof:attrList="值" 表:值="false"/>
- <表:对数 uof:locID="s0072" uof:attrList="值" 表:值="false"/>
- </xsl:template>
- <xsl:template name="字:句属性类型">
- <xsl:element name="字:字体">
- <xsl:attribute name="uof:locID">t0088</xsl:attribute>
- <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
- <xsl:if test="style:text-properties/@fo:font-size or style:text-properties/@style:font-size-asian or style:text-properties/@style:font-size-complex">
- <xsl:choose>
- <xsl:when test="contains(style:text-properties/@fo:font-size,'%') or contains(style:text-properties/@style:font-size-asian,'%')">
- <xsl:attribute name="字:相对字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'%')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'%')"/></xsl:when></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-complex"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-complex,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:font-family">
- <xsl:attribute name="字:西文字体引用"><xsl:value-of select="style:text-properties/@fo:font-family"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:font-family-asian">
- <xsl:attribute name="字:中文字体引用"><xsl:value-of select="style:text-properties/@style:font-family-asian"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:color">
- <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:if test="style:text-properties/@style:text-background-color and not(style:text-properties/@style:text-background-color='transparent')">
- <xsl:element name="字:填充">
- <xsl:element name="图:图案">
- <xsl:attribute name="uof:locID">g0036</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 图形引用 前景色 背景色</xsl:attribute>
- <xsl:if test="style:text-properties/@style:text-background-color">
- <xsl:attribute name="图:前景色"><xsl:value-of select="style:text-properties/@style:text-background-color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:font-weight or style:text-properties/@style:font-weight-asian">
- <xsl:element name="字:粗体">
- <xsl:attribute name="uof:locID">t0089</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@style:font-weight-asian='bold' or style:text-properties/@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:font-style or style:text-properties/@style:font-style-asian">
- <xsl:element name="字:斜体">
- <xsl:attribute name="uof:locID">t0090</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:font-style='italic' or style:text-properties/@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-line-through-style and not(style:text-properties/@style:text-line-through-style='none')">
- <xsl:element name="字:删除线">
- <xsl:attribute name="uof:locID">t0094</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:delete线型类型"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-underline">
- <xsl:element name="字:下划线">
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0095</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:if test="style:text-properties/@style:text-underline-color">
- <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="style:text-properties/@style:text-underline-color='font-color'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@style:text-underline-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:text-shadow">
- <xsl:element name="字:阴影">
- <xsl:attribute name="uof:locID">t0100</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-emphasize">
- <xsl:element name="字:着重号">
- <xsl:attribute name="uof:locID">t0096</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 颜色 字着重号</xsl:attribute>
- <xsl:choose>
- <xsl:when test="style:text-properties/@style:text-emphasize='none'">
- <xsl:attribute name="字:字着重号">false</xsl:attribute>
- <xsl:attribute name="字:类型">none</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:字着重号">true</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:着重号类型"><xsl:with-param name="te" select="style:text-properties/@style:text-emphasize"/></xsl:call-template></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="style:text-properties/@fo:color">
- <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@text:display">
- <xsl:element name="字:隐藏文字">
- <xsl:attribute name="uof:locID">t0097</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-outline">
- <xsl:element name="字:空心">
- <xsl:attribute name="uof:locID">t0098</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="style:text-properties/@style:text-outline"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:font-relief">
- <xsl:element name="字:浮雕">
- <xsl:attribute name="uof:locID">t0099</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@style:font-relief='embossed'">emboss</xsl:when><xsl:when test="style:text-properties/@style:font-relief='engraved'">engrave</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:text-transform or style:text-properties/@fo:font-variant">
- <xsl:element name="字:醒目字体">
- <xsl:attribute name="uof:locID">t0101</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@fo:text-transform='uppercase'">uppercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='lowercase'">lowercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='capitalize'">capital</xsl:when><xsl:when test="style:text-properties/@fo:font-variant='small-caps'">small-caps</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-position">
- <xsl:element name="字:位置">
- <xsl:attribute name="uof:locID">t0102</xsl:attribute>
- <xsl:value-of select="style:text-properties/@style:text-position"/>
- </xsl:element>
- <字:上下标 uof:locID="t0205" uof:attrList="值">
- <xsl:attribute name="字:值">none</xsl:attribute>
- </字:上下标>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-scale">
- <xsl:element name="字:缩放">
- <xsl:attribute name="uof:locID">t0103</xsl:attribute>
- <xsl:value-of select="style:text-properties/@style:text-scale"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:letter-spacing">
- <xsl:element name="字:字符间距">
- <xsl:attribute name="uof:locID">t0104</xsl:attribute>
- <xsl:value-of select="style:text-properties/@fo:letter-spacing"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:letter-kerning">
- <xsl:element name="字:调整字间距">
- <xsl:attribute name="uof:locID">t015</xsl:attribute>
- <xsl:value-of select="style:text-properties/@style:letter-kerning"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="uof:着重号类型">
- <xsl:param name="te"/>
- <xsl:choose>
- <xsl:when test="$te='disc above' ">disc above</xsl:when>
- <xsl:when test="$te='circle above' ">circle above</xsl:when>
- <xsl:when test="$te='dot above' ">dot above</xsl:when>
- <xsl:when test="$te='accent above' ">accent above</xsl:when>
- <xsl:when test="$te='dot below' ">dot below</xsl:when>
- <xsl:when test="$te='circle below' ">circle below</xsl:when>
- <xsl:when test="$te='disc below' ">disc below</xsl:when>
- <xsl:when test="$te='accent below' ">accent below</xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="uof:线型类型">
- <xsl:variable name="spath" select="style:text-properties/@style:text-underline-style"/>
- <xsl:variable name="wpath" select="style:text-properties/@style:text-underline-width"/>
- <xsl:variable name="tpath" select="style:text-properties/@style:text-underline-type"/>
- <xsl:choose>
- <xsl:when test="$spath='solid' and not($tpath='double' ) and $wpath='auto' ">single</xsl:when>
- <xsl:when test="$spath='solid' and $tpath='double' and $wpath='auto' ">double</xsl:when>
- <xsl:when test="$spath='solid' and not($tpath='double' )and $wpath='bold' ">thick</xsl:when>
- <xsl:when test="$spath='dotted' and not($tpath='double' )and $wpath='auto' ">dotted</xsl:when>
- <xsl:when test="$spath='dotted' and not($tpath='double' )and $wpath='bold' ">dotted-heavy</xsl:when>
- <xsl:when test="$spath='dash' and not($tpath='double' )and $wpath='auto' ">dash</xsl:when>
- <xsl:when test="$spath='dash' and not($tpath='double' )and $wpath='bold' ">dashed-heavy</xsl:when>
- <xsl:when test="$spath='long-dash' and not($tpath='double' )and $wpath='auto' ">dash-long</xsl:when>
- <xsl:when test="$spath='long-dash' and not($tpath='double' )and $wpath='bold' ">dash-long-heavy</xsl:when>
- <xsl:when test="$spath='dot-dash' and not($tpath='double' )and $wpath='auto' ">dot-dash</xsl:when>
- <xsl:when test="$spath='dot-dash' and not($tpath='double' )and $wpath='bold' ">dash-dot-heavy</xsl:when>
- <xsl:when test="$spath='dot-dot-dash' and not($tpath='double' )and $wpath='auto' ">dot-dot-dash</xsl:when>
- <xsl:when test="$spath='dot-dot-dash' and not($tpath='double' )and $wpath='bold' ">dash-dot-dot-heavy</xsl:when>
- <xsl:when test="$spath='wave' and not($tpath='double' )and $wpath='auto' ">wave</xsl:when>
- <xsl:when test="$spath='wave' and not($tpath='double' )and $wpath='bold' ">wavy-heavy</xsl:when>
- <xsl:when test="$spath='wave' and $tpath='double' and $wpath='auto' ">wavy-double</xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="uof:delete线型类型">
- <xsl:variable name="wpath" select="style:text-properties/@style:text-line-through-width"/>
- <xsl:variable name="textpath" select="style:text-properties/@style:text-line-through-text"/>
- <xsl:variable name="umpath" select="style:text-properties/@style:text-underline-mode"/>
- <xsl:variable name="tmpath" select="style:text-properties/@style:text-line-through-mode"/>
- <xsl:variable name="tpath" select="style:text-properties/@style:text-line-through-type"/>
- <xsl:choose>
- <xsl:when test="$umpath='continuous' and $tmpath='continuous'">single</xsl:when>
- <xsl:when test="$tpath='double'">double</xsl:when>
- <xsl:when test="$wpath='bold'">bold</xsl:when>
- <xsl:when test="$textpath='/'">带/</xsl:when>
- <xsl:when test="$textpath='X'">带X</xsl:when>
- <xsl:otherwise>none</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--comment: if input char is Roman,please add a prefix 'Roman_'-->
- <xsl:template name="General-Char-Transition">
- <xsl:param name="input-char"/>
- <xsl:param name="output-type"/>
- <xsl:choose>
- <xsl:when test="$input-char='A' or $input-char='a' or $input-char='1' or $input-char='Roman_I' or $input-char='Roman_i' or $input-char='一' or $input-char='壹' or $input-char='甲' or $input-char='子'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">1</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">a</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">A</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">I</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">i</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">1</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">一</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">1</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">壹</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">1</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">甲</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">子</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='B' or $input-char='b' or $input-char='2' or $input-char='Roman_II' or $input-char='Roman_ii' or $input-char='二' or $input-char='贰' or $input-char='乙' or $input-char='丑'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">2</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">b</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">B</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">II</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">ii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">2</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">2</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">2</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">乙</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">丑</xsl:when>
- <xsl:otherwise>2</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='C' or $input-char='c' or $input-char='3' or $input-char='Roman_III' or $input-char='Roman_iii' or $input-char='三' or $input-char='叁' or $input-char='丙' or $input-char='寅'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">3</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">c</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">C</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">III</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">iii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">3</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">三</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">3</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">叁</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">3</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">丙</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">寅</xsl:when>
- <xsl:otherwise>3</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='D' or $input-char='d' or $input-char='4' or $input-char='Roman_IV' or $input-char='Roman_iv' or $input-char='四' or $input-char='肆' or $input-char='丁' or $input-char='卯'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">4</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">d</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">D</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">IV</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">iv</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">4</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">四</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">4</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">肆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">4</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">丁</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">卯</xsl:when>
- <xsl:otherwise>4</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='E' or $input-char='e' or $input-char='5' or $input-char='Roman_V' or $input-char='Roman_v' or $input-char='五' or $input-char='伍' or $input-char='戊' or $input-char='辰'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">5</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">e</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">E</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">V</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">v</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">5</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">五</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">5</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">伍</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">5</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">戊</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">辰</xsl:when>
- <xsl:otherwise>5</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='F' or $input-char='f' or $input-char='6' or $input-char='Roman_VI' or $input-char='Roman_vi' or $input-char='六' or $input-char='陆' or $input-char='己' or $input-char='巳'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">6</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">f</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">F</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">VI</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">vi</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">6</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">六</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">6</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">陆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">6</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">己</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">巳</xsl:when>
- <xsl:otherwise>6</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='G' or $input-char='g' or $input-char='7' or $input-char='Roman_VII' or $input-char='Roman_vii' or $input-char='七' or $input-char='柒' or $input-char='庚' or $input-char='午'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">7</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">g</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">G</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">VII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">vii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">7</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">七</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">7</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">柒</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">7</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">庚</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">午</xsl:when>
- <xsl:otherwise>7</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='H' or $input-char='h' or $input-char='8' or $input-char='Roman_VIII' or $input-char='Roman_viii' or $input-char='八' or $input-char='捌' or $input-char='辛' or $input-char='未'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">8</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">h</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">H</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">VIII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">viii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">8</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">八</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">8</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">捌</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">8</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">辛</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">未</xsl:when>
- <xsl:otherwise>8</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='I' or $input-char='i' or $input-char='9' or $input-char='Roman_IX' or $input-char='Roman_ix' or $input-char='九' or $input-char='玖' or $input-char='壬' or $input-char='申'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">9</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">i</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">I</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">IX</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">ix</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">9</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">九</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">9</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">玖</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">9</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">壬</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">申</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='J' or $input-char='j' or $input-char='10' or $input-char='Roman_X' or $input-char='Roman_x' or $input-char='十' or $input-char='拾' or $input-char='癸' or $input-char='酉'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">10</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">j</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">J</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">X</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">x</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">10</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">10</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">10</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">癸</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">酉</xsl:when>
- <xsl:otherwise>10</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='K' or $input-char='k' or $input-char='11' or $input-char='Roman_XI' or $input-char='Roman_xi' or $input-char='十一' or $input-char='拾壹' or $input-char='戌'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">11</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">k</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">K</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XI</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xi</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">11</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十一</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">11</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾壹</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">11</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">戌</xsl:when>
- <xsl:otherwise>11</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='L' or $input-char='l' or $input-char='12' or $input-char='Roman_XII' or $input-char='Roman_xii' or $input-char='十二' or $input-char='拾贰' or $input-char='亥'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">12</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">l</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">L</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">12</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十二</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">12</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾贰</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">12</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">亥</xsl:when>
- <xsl:otherwise>12</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='M' or $input-char='m' or $input-char='13' or $input-char='Roman_XIII' or $input-char='Roman_xiii' or $input-char='十三' or $input-char='拾叁'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">13</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">m</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">M</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XIII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xiii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">13</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十三</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">13</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾叁</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">13</xsl:when>
- <xsl:otherwise>13</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='N' or $input-char='n' or $input-char='14' or $input-char='Roman_XIV' or $input-char='Roman_xiv' or $input-char='十四' or $input-char='拾肆'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">14</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">n</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">N</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XIV</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xiv</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">14</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十四</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">14</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾肆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">14</xsl:when>
- <xsl:otherwise>14</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='O' or $input-char='o' or $input-char='15' or $input-char='Roman_XV' or $input-char='Roman_xv' or $input-char='十五' or $input-char='拾伍'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">15</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">o</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">O</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XV</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xv</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">15</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十五</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">15</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾伍</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">15</xsl:when>
- <xsl:otherwise>15</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='P' or $input-char='p' or $input-char='16' or $input-char='Roman_XVI' or $input-char='Roman_xvi' or $input-char='十六' or $input-char='拾陆'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">16</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">p</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">P</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XVI</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xvi</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">16</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十六</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">16</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾陆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">16</xsl:when>
- <xsl:otherwise>16</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='Q' or $input-char='q' or $input-char='17' or $input-char='Roman_XVII' or $input-char='Roman_xvii' or $input-char='十七' or $input-char='拾柒'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">17</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">q</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Q</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XVII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xvii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">17</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十七</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">17</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾柒</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">17</xsl:when>
- <xsl:otherwise>17</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='R' or $input-char='r' or $input-char='18' or $input-char='Roman_XVIII' or $input-char='Roman_xviii' or $input-char='十八' or $input-char='拾捌'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">18</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">r</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">R</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XVIII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xviii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">18</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十八</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">18</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾捌</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">18</xsl:when>
- <xsl:otherwise>18</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='S' or $input-char='s' or $input-char='19' or $input-char='Roman_XIX' or $input-char='Roman_xix' or $input-char='十九' or $input-char='拾玖'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">19</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">s</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">S</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XIX</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xix</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">19</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十九</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">19</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾玖</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">19</xsl:when>
- <xsl:otherwise>19</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='T' or $input-char='t' or $input-char='20' or $input-char='Roman_XX' or $input-char='Roman_xx' or $input-char='二十' or $input-char='贰拾'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">20</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">t</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">T</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XX</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xx</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">20</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">20</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">20</xsl:when>
- <xsl:otherwise>20</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='U' or $input-char='u' or $input-char='21' or $input-char='Roman_XXI' or $input-char='Roman_xxi' or $input-char='二十一' or $input-char='贰拾壹'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">21</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">u</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">U</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXI</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxi</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">21</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十一</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">21</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾壹</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">21</xsl:when>
- <xsl:otherwise>21</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='V' or $input-char='v' or $input-char='22' or $input-char='Roman_XXII' or $input-char='Roman_xxii' or $input-char='二十二' or $input-char='贰拾贰'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">22</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">v</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">V</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">22</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十二</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">22</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾贰</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">22</xsl:when>
- <xsl:otherwise>22</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='W' or $input-char='w' or $input-char='23' or $input-char='Roman_XXIII' or $input-char='Roman_xxiii' or $input-char='二十三' or $input-char='贰拾叁'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">23</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">w</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">W</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXIII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxiii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">23</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十三</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">23</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾叁</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">23</xsl:when>
- <xsl:otherwise>23</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='X' or $input-char='x' or $input-char='24' or $input-char='Roman_XXIV' or $input-char='Roman_xxiv' or $input-char='二十四' or $input-char='贰拾肆'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">24</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">x</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">X</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXIV</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxiv</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">24</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十四</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">24</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾肆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">24</xsl:when>
- <xsl:otherwise>24</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='Y' or $input-char='y' or $input-char='25' or $input-char='Roman_XXV' or $input-char='Roman_xxv' or $input-char='二十五' or $input-char='贰拾伍'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">25</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">y</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Y</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXV</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxv</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">25</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十五</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">25</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾伍</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">25</xsl:when>
- <xsl:otherwise>25</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='Z' or $input-char='z' or $input-char='26' or $input-char='Roman_XXVI' or $input-char='Roman_xxvi' or $input-char='二十六' or $input-char='贰拾陆'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">26</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">z</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Z</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXVI</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxvi</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">26</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十六</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">26</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾陆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">26</xsl:when>
- <xsl:otherwise>26</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">1</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">a</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">A</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">I</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">i</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">1</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">一</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">1</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">壹</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">1</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--RedOffice comment (Zengjh) end charts-->
- <!-- 以下模板的作用是将网格线的R或者G或者B颜色从十进制转换为16进制-->
- <xsl:template name="transform-decimal-to-hexadecimal">
- <xsl:param name="color-decimal"/>
- <xsl:variable name="first-number" select="floor($color-decimal div 16)"/>
- <xsl:variable name="first-char">
- <xsl:call-template name="decimal-to-hex">
- <xsl:with-param name="number" select="$first-number"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="second-number" select="$color-decimal - ($first-number * 16)"/>
- <xsl:variable name="second-char">
- <xsl:call-template name="decimal-to-hex">
- <xsl:with-param name="number" select="$second-number"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat($first-char,$second-char)"/>
- </xsl:template>
- <!-- 以下模板的作用为将0到15的整数转换为16进制数-->
- <xsl:template name="decimal-to-hex">
- <xsl:param name="number"/>
- <xsl:choose>
- <xsl:when test="$number=0">0</xsl:when>
- <xsl:when test="$number=1">1</xsl:when>
- <xsl:when test="$number=2">2</xsl:when>
- <xsl:when test="$number=3">3</xsl:when>
- <xsl:when test="$number=4">4</xsl:when>
- <xsl:when test="$number=5">5</xsl:when>
- <xsl:when test="$number=6">6</xsl:when>
- <xsl:when test="$number=7">7</xsl:when>
- <xsl:when test="$number=8">8</xsl:when>
- <xsl:when test="$number=9">9</xsl:when>
- <xsl:when test="$number=10">a</xsl:when>
- <xsl:when test="$number=11">b</xsl:when>
- <xsl:when test="$number=12">c</xsl:when>
- <xsl:when test="$number=13">d</xsl:when>
- <xsl:when test="$number=14">e</xsl:when>
- <xsl:when test="$number='15'">f</xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="setDefaultPageWidth">
- <xsl:choose>
- <xsl:when test="$uofUnit='inch'">
- <xsl:value-of select="'7.9'"/>
- </xsl:when>
- <xsl:when test="$uofUnit='cm'">
- <xsl:value-of select="'20.999'"/>
- </xsl:when>
- <xsl:when test="$uofUnit='mm'">
- <xsl:value-of select="'200.99'"/>
- </xsl:when>
- <xsl:when test="$uofUnit='pt'">
- <xsl:value-of select="'7870'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'20.990'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="setDefaultPageHeight">
- <xsl:choose>
- <xsl:when test="$uofUnit='inch'">
- <xsl:value-of select="'10.14'"/>
- </xsl:when>
- <xsl:when test="$uofUnit='cm'">
- <xsl:value-of select="'26.999'"/>
- </xsl:when>
- <xsl:when test="$uofUnit='mm'">
- <xsl:value-of select="'269.99'"/>
- </xsl:when>
- <xsl:when test="$uofUnit='pt'">
- <xsl:value-of select="'1023'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'26.990'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--ro000179 chenjh-->
- <xsl:template name="create-condition-format">
- <xsl:variable name="unique-map-cellstyle" select="/office:document/office:automatic-styles/style:style[style:map and not(style:map/@style:condition=preceding-sibling::style:style/style:map/@style:condition and style:map/@style:apply-style-name=preceding-sibling::style:style/style:map/@style:apply-style-name and style:map/@style:base-cell-address=preceding-sibling::style:style/style:map/@style:base-cell-address)]"/>
- <xsl:for-each select="$unique-map-cellstyle">
- <xsl:call-template name="create-cell-condition-format"/>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="create-cell-condition-format">
- <xsl:element name="表:条件格式化">
- <xsl:attribute name="uof:locID">s0017</xsl:attribute>
- <xsl:element name="表:区域">
- <xsl:attribute name="uof:locID">s0007</xsl:attribute>
- <xsl:variable name="cellstylenamelist">
- <xsl:call-template name="createcellnamelist">
- <xsl:with-param name="list">
- <xsl:value-of select="/office:document/office:automatic-styles/style:style[style:map and (style:map/@style:condition=current()/style:map/@style:condition and style:map/@style:apply-style-name=current()/style:map/@style:apply-style-name and style:map/@style:base-cell-address=current()/style:map/@style:base-cell-address)]"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <!-- <xsl:value-of select="concat($cellstylenamelist,'end')"/>-->
- <xsl:variable name="left-top">
- <xsl:call-template name="search-left-top">
- <xsl:with-param name="cellstylenamelist" select="$cellstylenamelist"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- <xsl:value-of select="concat('qqqqqqqq ',$left-top)"/> -->
- <xsl:variable name="after-translated-left-top">
- <xsl:call-template name="translate-left-top-condition">
- <xsl:with-param name="left-top" select="$left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat($after-translated-left-top,':',style:map/@style:base-cell-address)"/>
- </xsl:element>
- <xsl:for-each select="style:map">
- <xsl:element name="表:条件">
- <xsl:attribute name="uof:locID">s0019</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:variable name="conditiontext" select="@style:condition"/>
- <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="contains($conditiontext,'cell-content')">cell value</xsl:when><xsl:when test="contains($conditiontext,'is-true-formula')">formula</xsl:when><xsl:otherwise>条件字符串错误!</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:element name="表:操作码">
- <xsl:attribute name="uof:locID">s0009</xsl:attribute>
- <xsl:choose>
- <xsl:when test="starts-with($conditiontext,'is-true-formula')">equal to</xsl:when>
- <xsl:when test="starts-with($conditiontext,'cell-content()')">
- <xsl:variable name="operatortext" select="substring-after($conditiontext,'cell-content()')"/>
- <xsl:choose>
- <xsl:when test="starts-with($operatortext,'&lt;=')">less than or equal to</xsl:when>
- <xsl:when test="starts-with($operatortext,'&gt;=')">greater than or equal to</xsl:when>
- <xsl:when test="starts-with($operatortext,'&lt;')">less than</xsl:when>
- <xsl:when test="starts-with($operatortext,'&gt;')">greater than</xsl:when>
- <xsl:when test="starts-with($operatortext,'!=')">not equal to</xsl:when>
- <xsl:when test="starts-with($operatortext,'=')">equal to</xsl:when>
- <!-- 注意:uof有的另几种操作码在oo中没有,他们是contain,not contain,start with,not start with, end with,not end with-->
- </xsl:choose>
- </xsl:when>
- <xsl:when test="starts-with($conditiontext,'cell-content-is-between')">between</xsl:when>
- <xsl:when test="starts-with($conditiontext,'cell-content-is-not-between')">not between</xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="表:第一操作数">
- <xsl:attribute name="uof:locID">s0010</xsl:attribute>
- <xsl:choose>
- <xsl:when test="starts-with($conditiontext,'is-true-formula')">
- <xsl:value-of select="substring(substring-after($conditiontext,'is-true-formula('),1,string-length($conditiontext)-1-string-length('is-true-formula('))"/>
- </xsl:when>
- <xsl:when test="starts-with($conditiontext,'cell-content-is-between')">
- <xsl:value-of select="substring-before(substring-after($conditiontext,'cell-content-is-between('),',')"/>
- </xsl:when>
- <xsl:when test="starts-with($conditiontext,'cell-content-is-not-between')">
- <xsl:value-of select="substring-before(substring-after($conditiontext,'cell-content-is-not-between('),',')"/>
- </xsl:when>
- <xsl:when test="starts-with($conditiontext,'cell-content()')">
- <xsl:variable name="operatortext" select="substring-after($conditiontext,'cell-content()')"/>
- <xsl:choose>
- <xsl:when test="starts-with($operatortext,'&lt;=')">
- <xsl:value-of select="substring-after($conditiontext,'&lt;=')"/>
- </xsl:when>
- <xsl:when test="starts-with($operatortext,'&gt;=')">
- <xsl:value-of select="substring-after($conditiontext,'&gt;=')"/>
- </xsl:when>
- <xsl:when test="starts-with($operatortext,'&lt;')">
- <xsl:value-of select="substring-after($conditiontext,'&lt;')"/>
- </xsl:when>
- <xsl:when test="starts-with($operatortext,'&gt;')">
- <xsl:value-of select="substring-after($conditiontext,'&gt;')"/>
- </xsl:when>
- <xsl:when test="starts-with($operatortext,'!=')">
- <xsl:value-of select="substring-after($conditiontext,'!=')"/>
- </xsl:when>
- <xsl:when test="starts-with($operatortext,'=')">
- <xsl:value-of select="substring-after($conditiontext,'=')"/>
- </xsl:when>
- <!-- 注意:uof有的另几种操作码在oo中没有,他们是contain,not contain,start with,not start with, end with,not end with-->
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="starts-with($conditiontext,'cell-content-is-between') or starts-with($conditiontext,'cell-content-is-not-between')">
- <xsl:element name="表:第二操作数">
- <xsl:attribute name="uof:locID">s0011</xsl:attribute>
- <xsl:value-of select="substring(substring-after($conditiontext,','),1,string-length(substring-after($conditiontext,','))-1)"/>
- </xsl:element>
- </xsl:if>
- <xsl:element name="表:格式">
- <xsl:variable name="apply-style-name" select="@style:apply-style-name"/>
- <xsl:attribute name="uof:locID">s0023</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="表:式样引用"><xsl:value-of select="$apply-style-name"/></xsl:attribute>
- <!--xsl:attribute name="表:式样引用"><xsl:value-of select="generate-id(//style:style[@style:name=$apply-style-name])"/></xsl:attribute-->
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template name="createcellnamelist">
- <xsl:param name="list"/>
- <xsl:choose>
- <xsl:when test="$list">
- <xsl:variable name="first" select="$list[1]"/>
- <xsl:variable name="stringlist-of-rest">
- <xsl:call-template name="createcellnamelist">
- <xsl:with-param name="list" select="$list[position()!=1]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat($first/@style:name,' ',$stringlist-of-rest)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="search-left-top">
- <xsl:param name="cellstylenamelist"/>
- <xsl:choose>
- <xsl:when test="$cellstylenamelist!=''">
- <xsl:variable name="first-cellstylename" select="substring-before($cellstylenamelist, ' ')"/>
- <xsl:variable name="tableslist" select="/office:document/office:body/office:spreadsheet/table:table"/>
- <xsl:variable name="first-left-top">
- <xsl:call-template name="search-left-top-with-one-cellstyle">
- <xsl:with-param name="cellstylename" select="$first-cellstylename"/>
- <xsl:with-param name="tableslist" select="$tableslist"/>
- <xsl:with-param name="return" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="rest-left-top">
- <xsl:call-template name="search-left-top">
- <xsl:with-param name="cellstylenamelist" select="substring-after($cellstylenamelist,' ')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="final-left-top">
- <xsl:choose>
- <xsl:when test="$rest-left-top =''">
- <xsl:value-of select="$first-left-top"/>
- </xsl:when>
- <xsl:when test="$first-left-top =''">
- <xsl:value-of select="$rest-left-top"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="after-compared-left-top">
- <xsl:call-template name="compare-two-left-top">
- <xsl:with-param name="first" select="$first-left-top"/>
- <xsl:with-param name="second" select="$rest-left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$after-compared-left-top"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$final-left-top"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="translate-left-top-condition">
- <xsl:param name="left-top"/>
- <xsl:variable name="column-number" select="substring-before(substring-after($left-top,'.'),' ')"/>
- <xsl:variable name="column-number1">
- <xsl:value-of select="floor( $column-number div 26 )"/>
- </xsl:variable>
- <xsl:variable name="column-number2">
- <xsl:value-of select="$column-number mod 26"/>
- </xsl:variable>
- <xsl:variable name="column-character1">
- <xsl:call-template name="number-to-character">
- <xsl:with-param name="number" select="$column-number1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="column-character2">
- <xsl:call-template name="number-to-character">
- <xsl:with-param name="number" select="$column-number2"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat(substring-before($left-top,'.'),'.',$column-character1,$column-character2,substring-after($left-top,' '))"/>
- </xsl:template>
- <xsl:template name="search-left-top-with-one-cellstyle">
- <xsl:param name="cellstylename"/>
- <xsl:param name="tableslist"/>
- <xsl:param name="return"/>
- <xsl:choose>
- <xsl:when test="$tableslist and $return=''">
- <xsl:variable name="firsttablerows" select="$tableslist[1]//table:table-row"/>
- <xsl:variable name="first-left-top">
- <xsl:call-template name="search-left-top-with-one-cellstyle-inatable">
- <xsl:with-param name="row-num" select="'1'"/>
- <xsl:with-param name="firsttablerows" select="$firsttablerows"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="return" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="rest-left-top">
- <xsl:call-template name="search-left-top-with-one-cellstyle">
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="tableslist" select="$tableslist[position()!=1]"/>
- <xsl:with-param name="return" select="$first-left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-left-top!=''">
- <xsl:value-of select="$first-left-top"/>
- </xsl:when>
- <xsl:when test="$rest-left-top!=''">
- <xsl:value-of select="$rest-left-top"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$return"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="compare-two-left-top">
- <xsl:param name="first"/>
- <xsl:param name="second"/>
- <xsl:variable name="first-column" select="substring-before(substring-after($first,'.'),' ')"/>
- <xsl:variable name="first-row" select="substring-after($first,' ')"/>
- <xsl:variable name="second-column" select="substring-before(substring-after($second,'.'),' ')"/>
- <xsl:variable name="second-row" select="substring-after($second,' ')"/>
- <xsl:choose>
- <xsl:when test="$first-row&lt;$second-row">
- <xsl:value-of select="$first"/>
- </xsl:when>
- <xsl:when test="$first-row=$second-row">
- <xsl:choose>
- <xsl:when test="$first-column&lt;=$second-column">
- <xsl:value-of select="$first"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$second"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$second"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="search-left-top-with-one-cellstyle-inatable">
- <xsl:param name="row-num"/>
- <xsl:param name="firsttablerows"/>
- <xsl:param name="cellstylename"/>
- <xsl:param name="return"/>
- <xsl:choose>
- <xsl:when test="$firsttablerows and $return=''">
- <xsl:variable name="firstcells" select="$firsttablerows[1]/table:table-cell"/>
- <xsl:variable name="first-left-top">
- <xsl:call-template name="search-left-top-with-one-cellstyle-inarow">
- <xsl:with-param name="row-num" select="$row-num"/>
- <xsl:with-param name="column-num" select="'1'"/>
- <xsl:with-param name="firstcells" select="$firstcells"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="return" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="row-num-p">
- <xsl:choose>
- <xsl:when test="$firsttablerows[1]/@table:number-rows-repeated">
- <xsl:value-of select="$row-num+ $firsttablerows[1]/@table:number-rows-repeated"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$row-num+1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="rest-left-top">
- <xsl:call-template name="search-left-top-with-one-cellstyle-inatable">
- <xsl:with-param name="row-num" select="$row-num-p"/>
- <xsl:with-param name="firsttablerows" select="$firsttablerows[position()!=1]"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="return" select="$first-left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-left-top!=''">
- <xsl:value-of select="$first-left-top"/>
- </xsl:when>
- <xsl:when test="$rest-left-top !=''">
- <xsl:value-of select="$rest-left-top "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$return"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="search-left-top-with-one-cellstyle-inarow">
- <xsl:param name="row-num"/>
- <xsl:param name="column-num"/>
- <xsl:param name="firstcells"/>
- <xsl:param name="cellstylename"/>
- <xsl:param name="return"/>
- <xsl:choose>
- <xsl:when test="$firstcells and $return=''">
- <xsl:variable name="firstcell" select="$firstcells[1]"/>
- <xsl:variable name="first-left-top">
- <xsl:call-template name="search-left-top-with-one-cellstyle-inacell">
- <xsl:with-param name="row-num" select="$row-num"/>
- <xsl:with-param name="column-num" select="$column-num"/>
- <xsl:with-param name="cell" select="$firstcell"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="column-num-p">
- <xsl:choose>
- <xsl:when test="$firstcell/@table:number-columns-repeated">
- <xsl:value-of select="$column-num+ $firstcell/@table:number-columns-repeated"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$column-num+ 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="rest-left-top">
- <xsl:call-template name="search-left-top-with-one-cellstyle-inarow">
- <xsl:with-param name="row-num" select="$row-num"/>
- <xsl:with-param name="column-num" select="$column-num-p"/>
- <xsl:with-param name="firstcells" select="$firstcells[position()!=1]"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="return" select="$first-left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-left-top!=''">
- <xsl:value-of select="$first-left-top"/>
- </xsl:when>
- <xsl:when test="$rest-left-top !=''">
- <xsl:value-of select="$rest-left-top "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$return"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="search-left-top-with-one-cellstyle-inacell">
- <xsl:param name="row-num"/>
- <xsl:param name="column-num"/>
- <xsl:param name="cell"/>
- <xsl:param name="cellstylename"/>
- <xsl:choose>
- <xsl:when test="$cell/@table:style-name">
- <xsl:if test="$cell/@table:style-name=$cellstylename">
- <xsl:value-of select="concat($cell/ancestor::table:table/@table:name,'.',$column-num,' ',$row-num)"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="style-is-default">
- <xsl:call-template name="is-default-or-not">
- <xsl:with-param name="column-num" select="$column-num"/>
- <xsl:with-param name="cell" select="$cell"/>
- <xsl:with-param name="preceding-cellstylename" select="''"/>
- <xsl:with-param name="temp-num" select="'0'"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="table-collumns" select="$cell/ancestor::table:table//table:table-column "/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$style-is-default='yes' ">
- <xsl:value-of select="concat($cell/ancestor::table:table/@table:name,'.',$column-num,' ',$row-num)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="is-default-or-not">
- <xsl:param name="column-num"/>
- <xsl:param name="cell"/>
- <xsl:param name="preceding-cellstylename"/>
- <xsl:param name="temp-num"/>
- <xsl:param name="cellstylename"/>
- <xsl:param name="table-collumns"/>
- <xsl:choose>
- <xsl:when test="$temp-num&lt;$column-num">
- <xsl:variable name="firstcolumn">
- <xsl:choose>
- <xsl:when test="$table-collumns[1]/@table:number-columns-repeated">
- <xsl:value-of select="$table-collumns[1]/@table:number-columns-repeated"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'1'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="preceding-cellstylename-to-param">
- <xsl:choose>
- <xsl:when test="$table-collumns[1]/@table:default-cell-style-name">
- <xsl:value-of select="$table-collumns[1]/@table:default-cell-style-name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="is-default-or-not">
- <xsl:with-param name="column-num" select="$column-num"/>
- <xsl:with-param name="temp-num" select="$temp-num + $firstcolumn"/>
- <xsl:with-param name="preceding-cellstylename" select="$preceding-cellstylename-to-param"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="table-collumns" select="$table-collumns[position()!=1]"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$cellstylename=$preceding-cellstylename">
- <xsl:value-of select="'yes'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'no'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="table:tracked-changes">
- <xsl:for-each select="/office:document/office:body/office:spreadsheet/table:tracked-changes">
- <xsl:if test="table:cell-content-change/table:cell-address">
- <xsl:variable name="row" select="table:cell-content-change/table:cell-address/@table:row"/>
- <xsl:variable name="column" select="table:cell-content-change/table:cell-address/@table:column"/>
- <xsl:element name="字:修订开始">
- <xsl:attribute name="uof:locID">t0206</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="concat($row,'-',$column)"/></xsl:attribute>
- <xsl:attribute name="字:类型">format</xsl:attribute>
- <xsl:if test="table:cell-content-change/office:change-info and table:cell-content-change/table:previous">
- <xsl:variable name="creator" select="table:cell-content-change/office:change-info/dc:creator"/>
- <xsl:variable name="date" select="table:cell-content-change/office:change-info/dc:date"/>
- <xsl:variable name="text" select="table:cell-content-change/table:previous/table:change-track-table-cell/text:p"/>
- <xsl:attribute name="字:修订信息引用"><xsl:value-of select="concat($creator,'+',$date,'%',$text)"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:element name="字:修订结束">
- <xsl:attribute name="uof:locID">t0207</xsl:attribute>
- <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="office:font-face-decls">
- <uof:字体集 uof:locID="u0040">
- <xsl:for-each select="style:font-face">
- <xsl:element name="uof:字体声明">
- <xsl:attribute name="uof:attrList">标识符 名称 字体族</xsl:attribute>
- <xsl:attribute name="uof:locID">u0041</xsl:attribute>
- <xsl:attribute name="uof:标识符"><xsl:value-of select="translate(@style:name,' ','_')"/></xsl:attribute>
- <xsl:attribute name="uof:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="uof:字体族"><xsl:value-of select="@svg:font-family"/></xsl:attribute>
- <!-- added by glu, for process special fonts e.g. Marlett, -->
- <!--chengxz 060821 delete uof:字符集,because there is no this attr-->
- <!--xsl:if test="@style:font-charset= '02'">
- <xsl:attribute name="uof:字符集">x-symbol</xsl:attribute>
- </xsl:if-->
- <!--xsl:if test="@style:font-family-generic">
- <xsl:choose>
- <xsl:when test="@style:font-family-generic = 'swiss'">
- <xsl:attribute name="uof:字体族">Swiss</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='modern'">
- <xsl:attribute name="uof:字体族">Modern</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic='roman'">
- <xsl:attribute name="uof:字体族">Roman</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='script'">
- <xsl:attribute name="uof:字体族">Script</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='decorative'">
- <xsl:attribute name="uof:字体族">Decorative</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='system'">
- <xsl:attribute name="uof:字体族">System</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="uof:字体族">System</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if-->
- <!--xsl:if test="@style:font-pitch">
- <xsl:attribute name="uof:字号">12</xsl:attribute>
- </xsl:if-->
- </xsl:element>
- </xsl:for-each>
- <xsl:apply-templates select="style:font-face"/>
- </uof:字体集>
- </xsl:template>
- <xsl:key name="styles" match="/*/office:styles/style:style | /*/office:automatic-styles/style:style" use="@style:name"/>
- <xsl:template match="style:style" mode="styles">
- <xsl:param name="isAutomatic"/>
- <xsl:param name="styleName" select="@style:name"/>
- <xsl:choose>
- <xsl:when test="@style:family='text'">
- <xsl:element name="uof:句式样">
- <xsl:attribute name="uof:locID">u0043</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:类型">auto</xsl:attribute>
- <xsl:call-template name="字:字体"/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@style:family='paragraph'">
- <xsl:element name="uof:段落式样">
- <xsl:attribute name="uof:locID">u0044</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:类型">auto</xsl:attribute>
- <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- </xsl:element>
- <xsl:if test="style:text-properties">
- <xsl:element name="uof:句式样">
- <xsl:attribute name="uof:locID">u0043</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:类型">custum</xsl:attribute>
- <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
- <xsl:call-template name="字:字体"/>
- </xsl:element>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="uof:单元格式样">
- <xsl:attribute name="uof:locID">u0046</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
- <xsl:attribute name="表:标识符"><xsl:value-of select="$styleName"/></xsl:attribute>
- <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="ancestor::office:automatic-styles">auto</xsl:when><xsl:when test="ancestor::office:styles">custom</xsl:when><xsl:otherwise>default</xsl:otherwise></xsl:choose></xsl:attribute>
- <!--xsl:attribute name="表:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute-->
- <xsl:choose>
- <xsl:when test="style:map">
- <xsl:attribute name="表:名称"><xsl:value-of select="style:map/@style:apply-style-name"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="表:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="not($isAutomatic)">
- <xsl:choose>
- <xsl:when test="$styleName='Default'">
- <xsl:attribute name="表:名称"><xsl:value-of select="'Normal'"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="表:名称"><xsl:value-of select="$styleName"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <!--xsl:if test="@style:parent-style-name">
- <xsl:attribute name="表:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
- </xsl:if-->
- <!--chengxz chang the order-->
- <xsl:variable name="styleProperties" select="key('styles', $styleName)/*"/>
- <xsl:call-template name="Font">
- <xsl:with-param name="styleProperties" select="$styleProperties"/>
- </xsl:call-template>
- <xsl:call-template name="Alignment">
- <xsl:with-param name="styleProperties" select="$styleProperties"/>
- </xsl:call-template>
- <!--chenjh changed 1103-->
- <!--xsl:if test="/*/office:automatic-styles/style:style[@style:name=/*/office:body/table:table/table:table-row/table:table-cell/@table:style-name]/style:properties/@fo:border"-->
- <xsl:if test="@style:data-style-name">
- <!--RedOffice Comment from Zengjh:UOF0020 2006-04-26-->
- <xsl:call-template name="NumberFormat">
- <xsl:with-param name="temp-style" select="@style:data-style-name"/>
- </xsl:call-template>
- <!--RedOffice comment (Zengjh) end-->
- </xsl:if>
- <xsl:call-template name="Border">
- <xsl:with-param name="styleProperties" select="$styleProperties"/>
- <!--xsl:with-param name="styleProperties" select="/*/office:automatic-styles/style:style"/-->
- </xsl:call-template>
- <!--/xsl:if-->
- <!--chenjh end 1103-->
- <xsl:call-template name="Interior">
- <xsl:with-param name="styleProperties" select="$styleProperties"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="字:字体">
- <xsl:element name="字:字体">
- <xsl:attribute name="uof:locID">t0088</xsl:attribute>
- <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
- <xsl:if test="style:text-properties/@fo:font-size or style:text-properties/@fo:font-size-asian or style:text-properties/@style:font-size-asian or style:text-properties/@style:font-size">
- <xsl:attribute name="字:字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'pt')"/></xsl:when><xsl:when test="style:text-properties/@fo:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size-asian,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size"><xsl:value-of select="substring-before(style:text-properties/@style:font-size,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:font-name">
- <xsl:attribute name="字:西文字体引用"><xsl:value-of select="style:text-properties/@style:font-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:font-name-complex">
- <xsl:attribute name="字:中文字体引用"><xsl:value-of select="style:text-properties/@style:font-name-complex"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:color">
- <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:if test="style:text-properties/@fo:font-weight or style:text-properties/@style:font-weight-asian">
- <xsl:element name="字:粗体">
- <xsl:attribute name="uof:locID">t0089</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@style:font-weight-asian='bold' or style:text-properties/@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:font-style or style:text-properties/@style:font-style-asian">
- <xsl:element name="字:斜体">
- <xsl:attribute name="uof:locID">t0090</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:font-style='italic' or style:text-properties/@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-line-through-style and not(style:text-properties/@style:text-line-through-style='none')">
- <xsl:element name="字:删除线">
- <xsl:attribute name="uof:locID">t0094</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:delete线型类型"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-underline-style">
- <xsl:element name="字:下划线">
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0095</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:if test="style:text-properties/@style:text-underline-color">
- <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="style:text-properties/@style:text-underline-color='font-color'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@style:text-underline-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:text-shadow">
- <xsl:element name="字:阴影">
- <xsl:attribute name="uof:locID">t0100</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-position">
- <xsl:element name="字:位置">
- <xsl:attribute name="uof:locID">t0102</xsl:attribute>
- <xsl:value-of select="style:text-properties/@style:text-position"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <!--RedOffice Comment from Zengjh:UOF0020 2006-04-01 Based on Original-->
- <xsl:template name="NumberFormat">
- <xsl:param name="temp-style"/>
- <xsl:for-each select="(/*/office:styles/child::*[@style:name=$temp-style]) | (/*/office:automatic-styles/child::*[@style:name=$temp-style])">
- <表:数字格式 uof:locID="s0021" uof:attrList="分类名称 格式码">
- <xsl:attribute name="表:分类名称"><xsl:choose><xsl:when test="name(.)='number:currency-style'">currency</xsl:when><xsl:when test="name(.)='number:percentage-style'">percentage</xsl:when><xsl:when test="name(.)='number:date-style'">date</xsl:when><xsl:when test="name(.)='number:time-style'">time</xsl:when><xsl:when test="name(.)='number:boolean-style'">custom</xsl:when><xsl:when test="name(.)='number:text-style'">text</xsl:when><xsl:when test="name(.)='number:number-style'"><xsl:choose><xsl:when test="number:fraction">fraction</xsl:when><xsl:when test="number:scientific-number">scientific</xsl:when><xsl:otherwise>number</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>general</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="表:格式码"><xsl:call-template name="element-attribute"/><xsl:for-each select="style:map"><xsl:text>[</xsl:text><xsl:value-of select="@style:condition"/><xsl:text>]</xsl:text><xsl:variable name="apply-style" select="@style:apply-style-name"/><xsl:for-each select="../../child::*[@style:name=$apply-style]/*"><xsl:call-template name="general-number-format"/></xsl:for-each><xsl:text>;</xsl:text></xsl:for-each><xsl:for-each select="*[not(name(.)='style:map')]"><xsl:call-template name="general-number-format"/></xsl:for-each></xsl:attribute>
- </表:数字格式>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="general-number-format">
- <xsl:choose>
- <xsl:when test="name(.)='style:text-properties'">
- <xsl:call-template name="general-color-format"/>
- </xsl:when>
- <xsl:when test="name(.)='number:text'">&quot;<xsl:value-of select="text()"/>&quot;</xsl:when>
- <xsl:when test="name(.)='number:text-content' ">@</xsl:when>
- <xsl:when test="name(.)='number:boolean'">boolean</xsl:when>
- <xsl:when test="name(.)='number:currency-symbol'">
- <xsl:call-template name="general-currency-format"/>
- </xsl:when>
- <xsl:when test="name(.)='number:fraction' or name(.)='number:number' or name(.)='number:scientific-number'">
- <xsl:if test="@number:min-integer-digits and not(@number:grouping)">
- <xsl:choose>
- <xsl:when test="@number:min-integer-digits='0'">#</xsl:when>
- <xsl:when test="@number:min-integer-digits='1'">0</xsl:when>
- <xsl:when test="@number:min-integer-digits='2'">00</xsl:when>
- <xsl:when test="@number:min-integer-digits='3'">000</xsl:when>
- <xsl:when test="@number:min-integer-digits='4'">0000</xsl:when>
- <xsl:when test="@number:min-integer-digits='5'">00000</xsl:when>
- <xsl:when test="@number:min-integer-digits='6'">000000</xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@number:min-integer-digits and @number:grouping">
- <xsl:choose>
- <xsl:when test="@number:min-integer-digits='0'">#,###</xsl:when>
- <xsl:when test="@number:min-integer-digits='1'">#,##0</xsl:when>
- <xsl:when test="@number:min-integer-digits='2'">#,#00</xsl:when>
- <xsl:when test="@number:min-integer-digits='3'">#,000</xsl:when>
- <xsl:when test="@number:min-integer-digits='4'">##0,000</xsl:when>
- <xsl:when test="@number:min-integer-digits='5'">#00,000</xsl:when>
- <xsl:when test="@number:min-integer-digits='6'">#,000,000</xsl:when>
- <xsl:when test="@number:min-integer-digits='7'">##0,000,000</xsl:when>
- <xsl:when test="@number:min-integer-digits='8'">#,#00,000,000</xsl:when>
- <xsl:otherwise>#,##0</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@number:decimal-places and not(@number:decimal-replacement)">
- <xsl:choose>
- <xsl:when test="@number:decimal-places='0'"/>
- <xsl:when test="@number:decimal-places='1'">.0</xsl:when>
- <xsl:when test="@number:decimal-places='2'">.00</xsl:when>
- <xsl:when test="@number:decimal-places='3'">.000</xsl:when>
- <xsl:when test="@number:decimal-places='4'">.0000</xsl:when>
- <xsl:when test="@number:decimal-places='5'">.00000</xsl:when>
- <xsl:when test="@number:decimal-places='6'">.000000</xsl:when>
- <xsl:otherwise>.00</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@number:decimal-places and @number:decimal-replacement">
- <xsl:choose>
- <xsl:when test="@number:decimal-places='0'"/>
- <xsl:when test="@number:decimal-places='1'">.#</xsl:when>
- <xsl:when test="@number:decimal-places='2'">.##</xsl:when>
- <xsl:when test="@number:decimal-places='3'">.###</xsl:when>
- <xsl:when test="@number:decimal-places='4'">.####</xsl:when>
- <xsl:when test="@number:decimal-places='5'">.#####</xsl:when>
- <xsl:when test="@number:decimal-places='6'">.######</xsl:when>
- <xsl:otherwise>.##</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@number:display-factor">
- <xsl:choose>
- <xsl:when test="@number:display-factor='1000'">,</xsl:when>
- <xsl:when test="@number:display-factor='1000000'">,,</xsl:when>
- <xsl:when test="@number:display-factor='1000000000'">,,,</xsl:when>
- <xsl:when test="@number:display-factor='1000000000000000'">,,,,</xsl:when>
- <xsl:when test="@number:display-factor='1000000000000000000'">,,,,,</xsl:when>
- <xsl:when test="@number:display-factor='1000000000000000000000'">,,,,,</xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@number:min-exponent-digits">
- <xsl:choose>
- <xsl:when test="@number:min-exponent-digits='1'">E+0</xsl:when>
- <xsl:when test="@number:min-exponent-digits='2'">E+00</xsl:when>
- <xsl:when test="@number:min-exponent-digits='3'">E+000</xsl:when>
- <xsl:when test="@number:min-exponent-digits='4'">E+0000</xsl:when>
- <xsl:when test="@number:min-exponent-digits='5'">E+00000</xsl:when>
- <xsl:when test="@number:min-exponent-digits='6'">E+000000</xsl:when>
- <xsl:otherwise>E+00</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@number:min-numerator-digits">
- <xsl:choose>
- <xsl:when test="@number:min-numerator-digits='1' "> ?</xsl:when>
- <xsl:when test="@number:min-numerator-digits='2' "> ??</xsl:when>
- <xsl:when test="@number:min-numerator-digits='3' "> ???</xsl:when>
- <xsl:when test="@number:min-numerator-digits='4' "> ????</xsl:when>
- <xsl:when test="@number:min-numerator-digits='5' "> ?????</xsl:when>
- <xsl:when test="@number:min-numerator-digits='6' "> ??????</xsl:when>
- <xsl:otherwise> ???</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@number:min-denominator-digits">
- <xsl:choose>
- <xsl:when test="@number:min-denominator-digits='1' ">/?</xsl:when>
- <xsl:when test="@number:min-denominator-digits='2' ">/??</xsl:when>
- <xsl:when test="@number:min-denominator-digits='3' ">/???</xsl:when>
- <xsl:when test="@number:min-denominator-digits='4' ">/????</xsl:when>
- <xsl:when test="@number:min-denominator-digits='5' ">/?????</xsl:when>
- <xsl:when test="@number:min-denominator-digits='6' ">/??????</xsl:when>
- <xsl:otherwise>/???</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:when>
- <xsl:when test="name(.)='number:year'">
- <xsl:choose>
- <xsl:when test="@number:style='long'">YYYY</xsl:when>
- <xsl:otherwise>YY</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="name(.)='number:month'">
- <xsl:choose>
- <xsl:when test="@number:style='long' and @number:textual='true'">MMMM</xsl:when>
- <xsl:when test="not(@number:style='long') and @number:textual='true'">MMM</xsl:when>
- <xsl:when test="@number:style='long' and not(@number:textual)">MM</xsl:when>
- <xsl:when test="not(@number:style='long') and not(@number:textual)">M</xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="name(.)='number:day'">
- <xsl:choose>
- <xsl:when test="@number:style='long'">DD</xsl:when>
- <xsl:otherwise>D</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="name(.)='number:day-of-week'">
- <xsl:choose>
- <xsl:when test="@number:style='long'">NNNN</xsl:when>
- <xsl:otherwise>NNN</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="name(.)='number:quarter'">
- <xsl:choose>
- <xsl:when test="@number:style='long'">QQ</xsl:when>
- <xsl:otherwise>Q</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="name(.)='number:hours'">
- <xsl:choose>
- <xsl:when test="@number:style='long' and ../@number:truncate-on-overflow='false'">[HH]</xsl:when>
- <xsl:when test="@number:style='long'">HH</xsl:when>
- <xsl:otherwise>H</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="name(.)='number:minutes'">
- <xsl:choose>
- <xsl:when test="@number:style='long'">MM</xsl:when>
- <xsl:otherwise>M</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="name(.)='number:seconds'">
- <xsl:choose>
- <xsl:when test="@number:style='long' and @number:decimal-places='2'">SS.00</xsl:when>
- <xsl:when test="@number:style='long'">SS</xsl:when>
- <xsl:otherwise>S</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="name(.)='number:am-pm'">AM/PM</xsl:when>
- <xsl:when test="name(.)='number:week-of-year'">
- <xsl:choose>
- <xsl:when test="@number:style='long'">WW</xsl:when>
- <xsl:otherwise>WW</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="general-color-format">
- <xsl:choose>
- <xsl:when test="@fo:color='#000000'">[Black]</xsl:when>
- <xsl:when test="@fo:color='#0000ff'">[Blue]</xsl:when>
- <xsl:when test="@fo:color='#00ffff'">[Cyan]</xsl:when>
- <xsl:when test="@fo:color='#00ff00'">[Green]</xsl:when>
- <xsl:when test="@fo:color='#ff00ff'">[Magenta]</xsl:when>
- <xsl:when test="@fo:color='#ff0000'">[Red]</xsl:when>
- <xsl:when test="@fo:color='#ffffff'">[White]</xsl:when>
- <xsl:when test="@fo:color='#ffff00'">[Yellow]</xsl:when>
- <xsl:otherwise>[Black]</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="general-currency-format">
- <xsl:choose>
- <xsl:when test="text()='¥' and @number:language='zh' and @number:country='CN'">[$¥-804]</xsl:when>
- <xsl:when test="text()='$' and @number:language='en' and @number:country='US'">[$$-409]</xsl:when>
- <xsl:when test="text()='$' and @number:language='es' and @number:country='AR'">[$$-2C0A]</xsl:when>
- <xsl:when test="text()='$' and @number:language='fr' and @number:country='CA'">[$$-C0C]</xsl:when>
- <xsl:when test="text()='CNY'">[$CNY]</xsl:when>
- <xsl:when test="text()='AFA'">[$AFA]</xsl:when>
- <xsl:when test="text()='CCC'">CCC</xsl:when>
- <xsl:otherwise>¥</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="element-attribute">
- <xsl:if test="@number:transliteration-format='一' and @number:transliteration-style='short'">[NatNum1]</xsl:if>
- <xsl:if test="@number:transliteration-format='一' and @number:transliteration-style='medium'">[NatNum7]</xsl:if>
- <xsl:if test="@number:transliteration-format='一' and @number:transliteration-style='long'">[NatNum4]</xsl:if>
- <xsl:if test="@number:transliteration-format='壹' and @number:transliteration-style='short'">[NatNum2]</xsl:if>
- <xsl:if test="@number:transliteration-format='壹' and @number:transliteration-style='medium'">[NatNum8]</xsl:if>
- <xsl:if test="@number:transliteration-format='壹' and @number:transliteration-style='long'">[NatNum5]</xsl:if>
- <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='short'">[NatNum3]</xsl:if>
- <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='medium'">[NatNum0]</xsl:if>
- <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='long'">[NatNum6]</xsl:if>
- <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='short'">[NatNum0]</xsl:if>
- <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='medium'">[NatNum0]</xsl:if>
- <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='long'">[NatNum0]</xsl:if>
- <xsl:if test="@number:transliteration-language='zh' and @number:transliteration-country='CN'">[$-804]</xsl:if>
- </xsl:template>
- <!--RedOffice comment (Zengjh) end-->
- <!--huangzf0715-->
- <xsl:template name="Alignment">
- <xsl:param name="styleProperties"/>
- <xsl:if test="($styleProperties/@fo:text-align) or ($styleProperties/@style:vertical-align) or ($styleProperties/@fo:wrap-option) or($styleProperties/@fo:margin-left) or ($styleProperties/@style:rotation-angle) or ($styleProperties/@style:direction)">
- <xsl:element name="表:对齐格式">
- <xsl:attribute name="uof:locID">s0114</xsl:attribute>
- <xsl:if test="$styleProperties/@fo:margin-left">
- <xsl:attribute name="表:缩进"><xsl:variable name="margin"><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$styleProperties/@fo:margin-left"/><xsl:with-param name="rounding-factor" select="1"/></xsl:call-template></xsl:variable><xsl:value-of select="number($margin) div 10"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="表:水平对齐方式">
- <xsl:attribute name="uof:locID">s0115</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$styleProperties/@fo:text-align">
- <xsl:choose>
- <xsl:when test="$styleProperties/@fo:text-align = 'center'">center</xsl:when>
- <xsl:when test="$styleProperties/@fo:text-align = 'end'">right</xsl:when>
- <xsl:when test="$styleProperties/@fo:text-align = 'justify'">justify</xsl:when>
- <xsl:when test="$styleProperties/@fo:text-align = 'start'">left</xsl:when>
- <xsl:otherwise>fill</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>general</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="($styleProperties/@style:vertical-align) or ($styleProperties/@fo:vertical-align)">
- <xsl:element name="表:垂直对齐方式">
- <xsl:attribute name="uof:locID">s0116</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$styleProperties/@fo:vertical-align = 'top'">top</xsl:when>
- <xsl:when test="$styleProperties/@fo:vertical-align = 'bottom'">bottom</xsl:when>
- <xsl:when test="$styleProperties/@fo:vertical-align = 'middle'">center</xsl:when>
- <xsl:when test="$styleProperties/@fo:vertical-align = 'justify'">justify</xsl:when>
- <xsl:when test="$styleProperties/@fo:vertical-align = 'top'">top</xsl:when>
- <xsl:otherwise>distributed</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:element name="表:文字方向">
- <xsl:attribute name="uof:locID">s0118</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:direction = 'ttb'">vertical</xsl:when>
- <xsl:otherwise>horizontal</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="$styleProperties/@style:rotation-angle">
- <xsl:element name="表:文字旋转角度">
- <xsl:attribute name="uof:locID">s0119</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:rotation-angle &gt; 90">
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:rotation-angle &gt;= 270">
- <xsl:value-of select="$styleProperties/@style:rotation-angle - 360"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$styleProperties/@style:rotation-angle - 180"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$styleProperties/@style:rotation-angle &lt; -90">
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:rotation-angle &lt;= -270">
- <xsl:value-of select="$styleProperties/@style:rotation-angle + 360"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$styleProperties/@style:rotation-angle + 180"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$styleProperties/@style:rotation-angle"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$styleProperties/@fo:wrap-option = 'wrap'">
- <xsl:element name="表:自动换行">
- <xsl:attribute name="uof:locID">s0120</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="表:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:shrink-to-fit">
- <xsl:element name="表:缩小字体填充">
- <xsl:attribute name="uof:locID">s0121</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="表:值"><xsl:value-of select="$styleProperties/@style:shrink-to-fit"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="Font">
- <xsl:param name="styleProperties"/>
- <!--xsl:if test="(style:text-properties/@fo:font-weight) or (style:text-properties/@fo:color) or ($styleProperties/@style:font-name) or ($styleProperties/@fo:font-style) or ($styleProperties/@style:text-outline) or ($styleProperties/@style:text-shadow) or ($styleProperties/@style:font-size) or ($styleProperties/@style:text-crossing-out) or ($styleProperties/@style:text-underline) or ($styleProperties/@style:text-underline-style) or ($styleProperties/@style:text-position)"-->
- <xsl:if test="not(@style:name='Default')">
- <xsl:element name="表:字体格式">
- <xsl:attribute name="uof:locID">s0113</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:if test="$styleProperties/@fo:font-weight or $styleProperties/@style:font-weight-asian">
- <xsl:element name="字:粗体">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="$styleProperties/@style:font-weight-asian='bold' or $styleProperties/@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:locID">t0089</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$styleProperties/@fo:font-style or $styleProperties/@style:font-style-asian">
- <xsl:element name="字:斜体">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="$styleProperties/@fo:font-style='italic' or $styleProperties/@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:locID">t0090</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:text-outline = 'true'">
- <字:空心 uof:locID="t0098" uof:attrList="值" 字:值="true"/>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:text-shadow = 'shadow'">
- <字:阴影 uof:locID="t0100" uof:attrList="值" 字:值="true"/>
- </xsl:if>
- <xsl:if test="(style:text-properties/@style:text-underline-style) and ($styleProperties/@style:text-underline-style != 'none')">
- <xsl:element name="字:下划线">
- <xsl:attribute name="uof:locID">t0095</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 颜色 字下划线</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"/></xsl:attribute>
- <xsl:attribute name="字:字下划线">true</xsl:attribute>
- <xsl:if test="$styleProperties/@style:text-underline-color">
- <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="$styleProperties/@style:text-underline-color='font-color'">auto</xsl:when><xsl:otherwise><xsl:value-of select="$styleProperties/@style:text-underline-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:text-line-through-style and not($styleProperties/@style:text-line-through-style='none')">
- <xsl:element name="字:删除线">
- <xsl:attribute name="uof:locID">t0094</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:delete线型类型"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:text-emphasize">
- <xsl:element name="字:着重号">
- <xsl:attribute name="uof:locID">t0096</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 颜色 字着重号</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:text-emphasize='none'">
- <xsl:attribute name="字:字着重号">false</xsl:attribute>
- <xsl:attribute name="字:类型">none</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:字着重号">true</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:着重号类型"><xsl:with-param name="te" select="$styleProperties/@style:text-emphasize"/></xsl:call-template></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$styleProperties/@fo:color">
- <xsl:attribute name="字:颜色"><xsl:value-of select="$styleProperties/@fo:color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:text-position">
- <xsl:element name="字:上下标">
- <xsl:choose>
- <xsl:when test="substring-before($styleProperties/@style:text-position, '% ') &gt; 0">
- <xsl:attribute name="字:上下标">sup</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:上下标">sub</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:字体">
- <xsl:attribute name="uof:locID">t0088</xsl:attribute>
- <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
- <xsl:if test="$styleProperties/@style:font-name-asian">
- <xsl:attribute name="字:中文字体引用"><xsl:value-of select="translate($styleProperties/@style:font-name-asian,' ','_')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$styleProperties/@style:font-name or $styleProperties/@fo:font-family">
- <xsl:choose>
- <xsl:when test="$styleProperties/@style:font-name">
- <xsl:attribute name="字:西文字体引用"><xsl:value-of select="translate($styleProperties/@style:font-name,' ','_')"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:西文字体引用"><xsl:value-of select="translate($styleProperties/@fo:font-family,' ','_')"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="$styleProperties/@fo:color">
- <xsl:attribute name="字:颜色"><xsl:value-of select="$styleProperties/@fo:color"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$styleProperties/@fo:font-size">
- <xsl:attribute name="字:字号"><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$styleProperties/@fo:font-size"/></xsl:call-template></xsl:attribute>
- </xsl:when>
- <xsl:when test="$styleProperties/@style:font-size-asian">
- <xsl:attribute name="字:字号"><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$styleProperties/@style:font-size-asian"/></xsl:call-template></xsl:attribute>
- </xsl:when>
- <xsl:when test="$styleProperties/@style:font-size-complex">
- <xsl:attribute name="字:字号"><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$styleProperties/@style:font-size-complex"/></xsl:call-template></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="style:text-properties/@style:font-relief">
- <xsl:element name="字:浮雕">
- <xsl:attribute name="uof:locID">t0099</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@style:font-relief='embossed'">emboss</xsl:when><xsl:when test="style:text-properties/@style:font-relief='engraved'">engrave</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:text-transform or style:text-properties/@fo:font-variant">
- <xsl:element name="字:醒目字体">
- <xsl:attribute name="uof:locID">t0101</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@fo:text-transform='uppercase'">uppercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='lowercase'">lowercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='capitalize'">capital</xsl:when><xsl:when test="style:text-properties/@fo:font-variant='small-caps'">small-caps</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:text-shadow">
- <xsl:element name="字:阴影">
- <xsl:attribute name="uof:locID">t0100</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="Border">
- <xsl:param name="styleProperties"/>
- <xsl:if test="style:table-cell-properties/@fo:border and not($styleProperties/@fo:border-top or $styleProperties/@fo:border-left or $styleProperties/@fo:border-bottom or $styleProperties/@fo:border-right)">
- <xsl:element name="表:边框">
- <xsl:attribute name="uof:locID">s0022</xsl:attribute>
- <xsl:variable name="border">
- <xsl:value-of select="$styleProperties/@fo:border"/>
- </xsl:variable>
- <xsl:element name="uof:左">
- <xsl:attribute name="uof:locID">u0057</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+
+ -->
+ <!-- changing measure to mm -->
+ <xsl:template name="convert2mm">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="substring-before($value, 'mm')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm' ) * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in' ) * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'mm'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to cm -->
+ <xsl:template name="convert2cm">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="substring-before($value, 'cm')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to inch (cp. section comment) -->
+ <xsl:template name="convert2in">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $inch-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="substring-before($value, 'in')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $inch-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $inch-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $inch-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $inch-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $inch-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'in'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to dpt (cp. section comment) -->
+ <xsl:template name="convert2dpt">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $didot-point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $didot-point-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $didot-point-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="substring-before($value, 'dpt')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $didot-point-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $didot-point-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $didot-point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'dpt'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pica (cp. section comment) -->
+ <xsl:template name="convert2pica">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $pica-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $pica-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $pica-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $pica-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="substring-before($value, 'pica')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $pica-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $pica-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pica'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pt (cp. section comment) -->
+ <xsl:template name="convert2pt">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $point-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="substring-before($value, 'pt')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $point-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $point-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $point-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pt'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pt (cp. section comment) -->
+ <xsl:template name="convert2twip">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $twip-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $twip-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $twip-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $twip-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $twip-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="substring-before($value, 'twip')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $twip-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'twip'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="convert2px">
+ <xsl:param name="value"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round(number(substring-before($value, 'mm')) div $pixel-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round(number(substring-before($value, 'cm')) div $pixel-in-mm * $centimeter-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round(number(substring-before($value, 'in')) div $pixel-in-mm * $inch-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round(number(substring-before($value, 'pt')) div $pixel-in-mm * $point-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round(number(substring-before($value, 'dpt')) div $pixel-in-mm * $didot-point-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round(number(substring-before($value, 'pica')) div $pixel-in-mm * $pica-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round(number(substring-before($value, 'twip')) div $pixel-in-mm * $twip-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="$value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'px'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:key match="draw:object/office:document/office:automatic-styles/style:style" name="chart-style-name" use="@style:name"/>
+ <xsl:template name="draw:chart-frame">
+ <xsl:param name="table-name"/>
+ <表:图表 uof:locID="s0055" uof:attrList="类型 子类型 宽度 高度 x坐标 y坐标 随动方式">
+ <xsl:variable name="plot-area">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="data-area">
+ <xsl:value-of select="draw:object/@draw:notify-on-update-of-ranges"/>
+ </xsl:variable>
+ <xsl:variable name="series-generate">
+ <xsl:for-each select="key('chart-style-name',$plot-area)">
+ <xsl:choose>
+ <xsl:when test="style:chart-properties/@chart:series-source='columns'">col</xsl:when>
+ <xsl:otherwise>row</xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:call-template name="表:图表">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ </xsl:call-template>
+ <表:图表区 uof:locID="s0056">
+ <xsl:call-template name="表:图表区">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ </xsl:call-template>
+ </表:图表区>
+ <表:绘图区 uof:locID="s0060">
+ <xsl:attribute name="表:宽度"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@svg:width,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="表:高度"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@svg:height,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="表:x坐标"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@svg:x,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="表:y坐标"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@svg:y,$uofUnit)"/></xsl:attribute>
+ <xsl:call-template name="表:绘图区">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ </xsl:call-template>
+ </表:绘图区>
+ <表:分类轴 uof:locID="s0061" uof:attrList="主刻度类型 次刻度类型 刻度线标志">
+ <xsl:variable name="axis-style-name">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[child::chart:categories]/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:for-each select="draw:object/office:document/office:automatic-styles/style:style[@style:name=$axis-style-name]">
+ <xsl:attribute name="表:主刻度类型"><xsl:choose><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='true' and style:chart-properties/@chart:tick-marks-major-outer='true'">cross</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='false'">inside</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='true'">outside</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="表:次刻度类型"><xsl:choose><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true' and style:chart-properties/@chart:tick-marks-minor-outer='true'">cross</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true'">inside</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true'">outside</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="表:刻度线标志"><xsl:choose><xsl:when test="style:chart-properties/@chart:display-label='true'">next to axis</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:call-template name="表:坐标轴类型">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="axis-type" select="category-axis"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </表:分类轴>
+ <表:数值轴 uof:locID="s0082" uof:attrList="主刻度类型 次刻度类型 刻度线标志">
+ <xsl:variable name="axis-style-name">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[child::chart:grid]/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:for-each select="draw:object/office:document/office:automatic-styles/style:style[@style:name=$axis-style-name]">
+ <xsl:attribute name="表:主刻度类型"><xsl:choose><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='true' and style:chart-properties/@chart:tick-marks-major-outer='true'">cross</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='true'">inside</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-major-inner='true'">outside</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="表:次刻度类型"><xsl:choose><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true' and style:chart-properties/@chart:tick-marks-minor-outer='true'">cross</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true'">inside</xsl:when><xsl:when test="style:chart-properties/@chart:tick-marks-minor-inner='true'">outside</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="表:刻度线标志"><xsl:choose><xsl:when test="style:chart-properties/@chart:display-label='true'">next to axis</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:call-template name="表:坐标轴类型">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="axis-type" select="category-axis"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </表:数值轴>
+ <表:图例 uof:locID="s0083" uof:attrList="位置">
+ <xsl:attribute name="表:位置"><xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:legend/@chart:legend-position"/></xsl:attribute>
+ <xsl:attribute name="表:x坐标"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:legend/@svg:x,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="表:y坐标"><xsl:value-of select="substring-before(draw:object/office:document/office:body/office:chart/chart:chart/chart:legend/@svg:y,$uofUnit)"/></xsl:attribute>
+ <xsl:call-template name="表:图例">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ </xsl:call-template>
+ </表:图例>
+ <!--表:数据表 uof:locID="s0085">
+ <xsl:call-template name="表:数据表">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ </xsl:call-template>
+ </表:数据表-->
+ <表:数据系列集 uof:locID="s0086">
+ <xsl:variable name="data-series-path" select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:series"/>
+ <xsl:call-template name="表:数据系列">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="data-series-path" select="$data-series-path"/>
+ </xsl:call-template>
+ </表:数据系列集>
+ <!--0825 by lil -->
+ <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:series">
+ <表:数据点集 uof:locID="s0090">
+ <xsl:variable name="data-series-path" select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:series"/>
+ <xsl:call-template name="表:数据点">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="data-series-path" select="$data-series-path"/>
+ </xsl:call-template>
+ </表:数据点集>
+ </xsl:if>
+ <!--end-->
+ <表:网格线集 uof:locID="s0092">
+ <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='x' and @chart:style-name]/chart:grid">
+ <xsl:call-template name="表:网格线">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="grid-type" select="'category axis'"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='y']/@chart:style-name">
+ <xsl:call-template name="表:网格线">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="grid-type" select="'value axis'"/>
+ </xsl:call-template>
+ </xsl:if>
+ </表:网格线集>
+ <表:数据源 uof:locID="s0094" uof:attrList="数据区域 系列产生">
+ <xsl:variable name="series-row-start">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring-before(substring(substring-after($data-area,'.'),2),':')"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="series-row-end">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after(substring-after($data-area,'.'),'.'),2)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="series-col-start">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after($data-area,'.'),1,1)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="series-col-end">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after(substring-after($data-area,'.'),'.'),1,1)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="series-value-count">
+ <xsl:choose>
+ <xsl:when test="$series-generate='col'">
+ <xsl:value-of select="$series-col-end -$series-col-start +1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$series-row-end -$series-row-start +1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="表:数据区域"><xsl:value-of select="draw:object/@draw:notify-on-update-of-ranges"/></xsl:attribute>
+ <xsl:attribute name="表:系列产生"><xsl:choose><xsl:when test="contains($series-generate,'col')">col</xsl:when><xsl:when test="contains($series-generate,'row')">row</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:call-template name="表:系列">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="series-row-start" select="$series-row-start"/>
+ <xsl:with-param name="series-row-end" select="$series-row-end"/>
+ <xsl:with-param name="series-col-start" select="$series-col-start"/>
+ <xsl:with-param name="series-col-end" select="$series-col-end"/>
+ <xsl:with-param name="series-value-current" select="'1'"/>
+ <xsl:with-param name="series-value-count" select="$series-value-count"/>
+ </xsl:call-template>
+ </表:数据源>
+ <表:标题集 uof:locID="s0096">
+ <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:title">
+ <xsl:call-template name="表:标题">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="caption-type" select="'chart'"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='x']">
+ <xsl:call-template name="表:标题">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="caption-type" select="'category axis'"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='y']">
+ <xsl:call-template name="表:标题">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="caption-type" select="'value axis'"/>
+ </xsl:call-template>
+ </xsl:if>
+ </表:标题集>
+ </表:图表>
+ </xsl:template>
+ <xsl:template name="表:图表">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:variable name="chart-class">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/@chart:class"/>
+ </xsl:variable>
+ <xsl:variable name="chart-area">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="plot-area">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$chart-class='chart:bar'">
+ <xsl:variable name="chart-sub-class">
+ <xsl:value-of select="key('chart-style-name',$plot-area)/style:chart-properties/@chart:vertical"/>
+ </xsl:variable>
+ <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="$chart-sub-class='true'">bar</xsl:when><xsl:when test="$chart-sub-class='false'">column</xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute>
+ <xsl:attribute name="表:子类型"><xsl:choose><xsl:when test="$chart-sub-class='true'"><xsl:choose><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:percentage">bar_percent</xsl:when><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:stacked">bar_stacked</xsl:when><xsl:otherwise>bar_standard</xsl:otherwise></xsl:choose></xsl:when><xsl:when test="$chart-sub-class='false'"><xsl:choose><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:percentage">column_percent</xsl:when><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:stacked">column_stacked</xsl:when><xsl:otherwise>column_standard</xsl:otherwise></xsl:choose></xsl:when></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$chart-class='chart:line'">
+ <xsl:attribute name="表:类型">line</xsl:attribute>
+ <xsl:attribute name="表:子类型"><xsl:choose><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:percentage">line_percent</xsl:when><xsl:when test="key('chart-style-name',$plot-area)/style:chart-properties/@chart:stacked">line_stacked</xsl:when><xsl:otherwise>line_standard</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$chart-class='chart:circle'">
+ <xsl:attribute name="表:类型">pie</xsl:attribute>
+ <xsl:variable name="data-point-end" select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:series[1]/chart:data-point"/>
+ <xsl:choose>
+ <xsl:when test="count($data-point-end) &lt;=1">
+ <xsl:attribute name="表:子类型">pie_standard</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="data-point-position-1">
+ <xsl:for-each select="$data-point-end[position()=1]">
+ <xsl:choose>
+ <xsl:when test="@chart:style-name">
+ <xsl:for-each select="key('chart-style-name',@chart:style-name)">
+ <xsl:choose>
+ <xsl:when test="style:chart-properties/@chart:pie-offset">1</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$data-point-position-1='0'">
+ <xsl:attribute name="表:子类型">pie_standard</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="$data-point-end[position()=2]">
+ <xsl:choose>
+ <xsl:when test="@chart:style-name">
+ <xsl:for-each select="key('chart-style-name',@chart:style-name)">
+ <xsl:choose>
+ <xsl:when test="style:chart-properties/@chart:pie-offset">
+ <xsl:attribute name="表:子类型">pie_offset2</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="表:子类型">pie_offset1</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="表:子类型">pie_offset1</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$chart-class='chart:ring'">
+ <xsl:attribute name="表:类型">pie</xsl:attribute>
+ <xsl:attribute name="表:子类型">pie_ring</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ <xsl:attribute name="表:宽度"><xsl:value-of select="substring-before(@svg:width,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="表:高度"><xsl:value-of select="substring-before(@svg:height,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="表:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="表:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@draw:style-name">
+ <xsl:variable name="draw-style-name" select="@draw:style-name"/>
+ <xsl:for-each select="draw:object//office:document/office:automatic-styles/style:style[@style:name=$draw-style-name]">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:move-protect='true' and style:graphic-properties/@draw:size-protect='true'">
+ <xsl:attribute name="表:随动方式">none</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:size-protect='true'">
+ <xsl:attribute name="表:随动方式">move</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="表:随动方式">move and re-size</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="表:随动方式">move and re-size</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:图表区">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:variable name="chart-style-name" select="draw:object/office:document/office:body/office:chart/chart:chart/@chart:style-name"/>
+ <xsl:for-each select="draw:object/office:document/office:automatic-styles/style:style[@style:name=$chart-style-name]">
+ <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
+ <xsl:call-template name="表:边框"/>
+ </表:边框>
+ <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
+ <表:填充 uof:locID="s0058">
+ <xsl:call-template name="图:填充类型"/>
+ </表:填充>
+ </xsl:if>
+ <表:字体 uof:locID="s0059" uof:attrList="式样引用">
+ <xsl:call-template name="字:句属性类型">
+ </xsl:call-template>
+ </表:字体>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:绘图区">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:variable name="plot-style-name" select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:wall/@chart:style-name"/>
+ <xsl:for-each select="draw:object/office:document/office:automatic-styles/style:style[@style:name=$plot-style-name]">
+ <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
+ <xsl:call-template name="表:边框"/>
+ </表:边框>
+ <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
+ <表:填充 uof:locID="s0058">
+ <xsl:call-template name="图:填充类型2"/>
+ </表:填充>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:图例">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:variable name="legend">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:legend/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:for-each select="draw:object/office:document/office:automatic-styles/style:style[@style:name=$legend]">
+ <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
+ <xsl:call-template name="表:边框"/>
+ </表:边框>
+ <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
+ <表:填充 uof:locID="s0058">
+ <xsl:call-template name="图:填充类型"/>
+ </表:填充>
+ </xsl:if>
+ <表:字体 uof:locID="s0059" uof:attrList="式样引用">
+ <xsl:call-template name="字:句属性类型"/>
+ </表:字体>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:图例项">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <表:图例项 uof:locID="s0084" uof:attrList="系列">
+ <表:字体 uof:locID="s0059" uof:attrList="式样引用">
+ <xsl:call-template name="字:句属性类型"/>
+ </表:字体>
+ </表:图例项>
+ </xsl:template>
+ <xsl:template name="表:数据表">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
+ <表:填充 uof:locID="s0058">
+ <xsl:call-template name="图:填充类型"/>
+ </表:填充>
+ </xsl:if>
+ <表:字体 uof:locID="s0059" uof:attrList="式样引用">
+ <xsl:call-template name="字:句属性类型"/>
+ </表:字体>
+ </xsl:template>
+ <xsl:template name="表:数据系列">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:param name="data-series-path"/>
+ <xsl:for-each select="$data-series-path">
+ <表:数据系列 uof:locID="s0087" uof:attrList="系列">
+ <xsl:variable name="data-series-position">
+ <xsl:value-of select="position()"/>
+ </xsl:variable>
+ <xsl:attribute name="表:系列"><xsl:value-of select="$data-series-position"/></xsl:attribute>
+ <xsl:variable name="data-series-point" select="@chart:style-name"/>
+ <xsl:call-template name="表:数据点类型">
+ <xsl:with-param name="data-series-point" select="$data-series-point"/>
+ <xsl:with-param name="data-series-position" select="$data-series-position"/>
+ </xsl:call-template>
+ </表:数据系列>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:数据点">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:param name="data-series-path"/>
+ <xsl:for-each select="$data-series-path">
+ <xsl:variable name="data-series-position" select="position()"/>
+ <xsl:for-each select="chart:data-point">
+ <!--xsl:if test="@chart:style-name"-->
+ <xsl:variable name="data-point-position">
+ <xsl:call-template name="count-chart-data-point">
+ <xsl:with-param name="data-point-count" select="'1'"/>
+ <xsl:with-param name="data-point-position-temp" select="position() -1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <表:数据点 uof:locID="s0091" uof:attrList="系列 点">
+ <xsl:attribute name="表:系列"><xsl:value-of select="$data-series-position"/></xsl:attribute>
+ <xsl:attribute name="表:点"><xsl:value-of select="$data-point-position"/></xsl:attribute>
+ <xsl:variable name="data-series-point" select="@chart:style-name"/>
+ <xsl:for-each select="../../../../../office:automatic-styles/style:style[@style:name=$data-series-point]">
+ <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
+ <xsl:call-template name="表:边框"/>
+ </表:边框>
+ <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
+ <表:填充 uof:locID="s0058">
+ <xsl:call-template name="图:填充类型"/>
+ </表:填充>
+ </xsl:if>
+ <表:字体 uof:locID="s0059" uof:attrList="式样引用">
+ <xsl:call-template name="字:句属性类型"/>
+ </表:字体>
+ <表:显示标志 uof:locID="s0088" uof:attrList="系列名 类别名 数值 百分数 分隔符 图例标志">
+ <xsl:attribute name="表:系列名"/>
+ <xsl:attribute name="表:分隔符"/>
+ <xsl:if test="style:chart-properties/@chart:data-label-text">
+ <xsl:attribute name="表:类别名"><xsl:value-of select="style:chart-properties/@chart:data-label-text"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:chart-properties/@chart:data-label-number">
+ <xsl:choose>
+ <xsl:when test="style:chart-properties/@chart:data-label-number='value'">
+ <xsl:attribute name="表:数值">true</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="style:chart-properties/@chart:data-label-number='percentage'">
+ <xsl:attribute name="表:百分数">true</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="style:chart-properties/@chart:data-label-symbol">
+ <xsl:attribute name="表:图例标志"><xsl:value-of select="style:chart-properties/@chart:data-label-symbol"/></xsl:attribute>
+ </xsl:if>
+ </表:显示标志>
+ <表:系列名 uof:locID="s0089">
+ <xsl:value-of select="concat('系列',$data-series-position)"/>
+ </表:系列名>
+ </xsl:for-each>
+ </表:数据点>
+ <!--/xsl:if-->
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:网格线">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:param name="grid-type"/>
+ <xsl:if test="$grid-type='category axis'">
+ <xsl:variable name="category-axis-grid">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='x']/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:for-each select="key('chart-style-name',$category-axis-grid)">
+ <表:网格线 uof:locID="s0093" uof:attrList="类型 宽度 边距 颜色 阴影 位置">
+ <xsl:call-template name="表:边框"/>
+ <xsl:attribute name="表:位置"><xsl:value-of select="$grid-type"/></xsl:attribute>
+ </表:网格线>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="$grid-type='value axis'">
+ <xsl:variable name="value-axis-grid">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='y']/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:for-each select="key('chart-style-name',$value-axis-grid)">
+ <表:网格线 uof:locID="s0093" uof:attrList="类型 宽度 边距 颜色 阴影 位置">
+ <xsl:call-template name="表:边框"/>
+ <xsl:attribute name="表:位置"><xsl:value-of select="$grid-type"/></xsl:attribute>
+ </表:网格线>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="表:系列">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:param name="series-row-start"/>
+ <xsl:param name="series-row-end"/>
+ <xsl:param name="series-col-start"/>
+ <xsl:param name="series-col-end"/>
+ <xsl:param name="series-value-current"/>
+ <xsl:param name="series-value-count"/>
+ <xsl:choose>
+ <xsl:when test="$series-value-current>$series-value-count"/>
+ <xsl:otherwise>
+ <表:系列 uof:locID="s0095" uof:attrList="系列名 系列值 分类名">
+ <xsl:attribute name="表:系列名"><xsl:value-of select="concat('系列',$series-value-current)"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$series-generate='col'">
+ <xsl:variable name="series-col-letter-start">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="$series-col-start +$series-value-current -1"/>
+ <xsl:with-param name="output-type" select="'CHARS_UPPER_LETTER'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="表:系列值"><xsl:value-of select="concat($table-name,'!',$series-col-letter-start,$series-row-start,':',$series-col-letter-start,$series-row-end)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="series-col-letter-start">
+ <xsl:value-of select="substring(substring-after($data-area,'.'),1,1)"/>
+ </xsl:variable>
+ <xsl:variable name="series-col-letter-end">
+ <xsl:value-of select="substring(substring-after(substring-after($data-area,'.'),'.'),1,1)"/>
+ </xsl:variable>
+ <xsl:attribute name="表:系列值"><xsl:value-of select="concat($table-name,'!',$series-col-letter-start,$series-row-start +$series-value-current -1,':',$series-col-letter-end,$series-row-start +$series-value-current -1)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </表:系列>
+ <xsl:call-template name="表:系列">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="data-area" select="$data-area"/>
+ <xsl:with-param name="series-generate" select="$series-generate"/>
+ <xsl:with-param name="series-row-start" select="$series-row-start"/>
+ <xsl:with-param name="series-row-end" select="$series-row-end"/>
+ <xsl:with-param name="series-col-start" select="$series-col-start"/>
+ <xsl:with-param name="series-col-end" select="$series-col-end"/>
+ <xsl:with-param name="series-value-current" select="$series-value-current +1"/>
+ <xsl:with-param name="series-value-count" select="$series-value-count"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:标题">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:param name="caption-type"/>
+ <xsl:if test="$caption-type='chart'">
+ <xsl:variable name="chart-title">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:title/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="chart-title-name">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:title/text:p"/>
+ </xsl:variable>
+ <xsl:for-each select="key('chart-style-name',$chart-title)">
+ <表:标题 uof:locID="s0097" uof:attrList="名称 位置">
+ <xsl:attribute name="表:名称"><xsl:value-of select="$chart-title-name"/></xsl:attribute>
+ <xsl:attribute name="表:位置"><xsl:value-of select="$caption-type"/></xsl:attribute>
+ <xsl:call-template name="表:标题类型"/>
+ </表:标题>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="$caption-type='category axis'">
+ <xsl:variable name="category-axis-title">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='x']/chart:title/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="category-axis-title-name">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='x']/chart:title/text:p"/>
+ </xsl:variable>
+ <xsl:for-each select="key('chart-style-name',$category-axis-title)">
+ <表:标题 uof:locID="s0097" uof:attrList="名称 位置">
+ <xsl:attribute name="表:名称"><xsl:value-of select="$category-axis-title-name"/></xsl:attribute>
+ <xsl:attribute name="表:位置"><xsl:value-of select="$caption-type"/></xsl:attribute>
+ <xsl:call-template name="表:标题类型"/>
+ </表:标题>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="$caption-type='value axis'">
+ <xsl:variable name="value-axis-title">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='y']/chart:title/@chart:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="value-axis-title-name">
+ <xsl:value-of select="draw:object/office:document/office:body/office:chart/chart:chart/chart:plot-area/chart:axis[@chart:dimension='y']/chart:title/text:p"/>
+ </xsl:variable>
+ <xsl:for-each select="key('chart-style-name',$value-axis-title)">
+ <表:标题 uof:locID="s0097" uof:attrList="名称 位置">
+ <xsl:attribute name="表:名称"><xsl:value-of select="$value-axis-title-name"/></xsl:attribute>
+ <xsl:attribute name="表:位置"><xsl:value-of select="$caption-type"/></xsl:attribute>
+ <xsl:call-template name="表:标题类型"/>
+ </表:标题>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="表:坐标轴类型">
+ <xsl:param name="table-name"/>
+ <xsl:param name="data-area"/>
+ <xsl:param name="series-generate"/>
+ <xsl:param name="axis-type"/>
+ <表:线型 uof:locID="s0062" uof:attrList="类型 宽度 边距 颜色 阴影">
+ <xsl:attribute name="uof:类型"><xsl:call-template name="表:线型"/></xsl:attribute>
+ </表:线型>
+ <表:数值 uof:locID="s0063" uof:attrList="链接到源 分类名称 格式码">
+ <xsl:attribute name="表:链接到源"><xsl:choose><xsl:when test="style:chart-properties/@chart:link-data-style-to-source"><xsl:value-of select="style:chart-properties/@chart:link-data-style-to-source"/></xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="@style:data-style-name">
+ <xsl:call-template name="Chart-NumberFormat">
+ <xsl:with-param name="temp-style" select="@style:data-style-name"/>
+ </xsl:call-template>
+ </xsl:if>
+ </表:数值>
+ <表:字体 uof:locID="s0059" uof:attrList="式样引用">
+ <xsl:call-template name="字:句属性类型"/>
+ </表:字体>
+ <表:刻度 uof:locID="s0064">
+ <xsl:call-template name="表:刻度类型"/>
+ </表:刻度>
+ <表:对齐 uof:locID="s0078">
+ <xsl:if test="style:chart-properties/@style:direction">
+ <xsl:element name="表:文字方向">
+ <xsl:attribute name="uof:locID">s0079</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="style:chart-properties/@style:direction = 'ttb'">vertical</xsl:when>
+ <xsl:otherwise>horizontal</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:chart-properties/@text:rotation-angle">
+ <表:旋转角度 uof:locID="s0080">
+ <xsl:value-of select="style:chart-properties/@text:rotation-angle"/>
+ </表:旋转角度>
+ </xsl:if>
+ <表:偏移量 uof:locID="s0081"/>
+ </表:对齐>
+ </xsl:template>
+ <xsl:template name="Chart-NumberFormat">
+ <xsl:param name="temp-style"/>
+ <xsl:for-each select="(preceding-sibling::*[@style:name=$temp-style]) | (following-sibling::*[@style:name=$temp-style])">
+ <xsl:attribute name="表:分类名称"><xsl:choose><xsl:when test="name(.)='number:currency-style'">currency</xsl:when><xsl:when test="name(.)='number:percentage-style'">percentage</xsl:when><xsl:when test="name(.)='number:date-style'">date</xsl:when><xsl:when test="name(.)='number:time-style'">time</xsl:when><xsl:when test="name(.)='number:boolean-style'">custom</xsl:when><xsl:when test="name(.)='number:text-style'">text</xsl:when><xsl:when test="name(.)='number:number-style'"><xsl:choose><xsl:when test="number:fraction">fraction</xsl:when><xsl:when test="number:scientific-number">scientific</xsl:when><xsl:otherwise>number</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>general</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="表:格式码"><xsl:call-template name="element-attribute"/><xsl:for-each select="style:map"><xsl:text>[</xsl:text><xsl:value-of select="@style:condition"/><xsl:text>]</xsl:text><xsl:variable name="apply-style" select="@style:apply-style-name"/><xsl:for-each select="../../child::*[@style:name=$apply-style]/*"><xsl:call-template name="general-number-format"/></xsl:for-each><xsl:text>;</xsl:text></xsl:for-each><xsl:for-each select="*[not(name(.)='style:map')]"><xsl:call-template name="general-number-format"/></xsl:for-each></xsl:attribute>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:数据点类型">
+ <xsl:param name="data-series-point"/>
+ <xsl:param name="data-series-position"/>
+ <xsl:for-each select="ancestor::draw:object/office:document/office:automatic-styles/style:style[@style:name=$data-series-point]">
+ <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
+ <xsl:call-template name="表:边框"/>
+ </表:边框>
+ <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
+ <表:填充 uof:locID="s0058">
+ <xsl:call-template name="图:填充类型"/>
+ </表:填充>
+ </xsl:if>
+ <表:字体 uof:locID="s0059" uof:attrList="式样引用">
+ <xsl:call-template name="字:句属性类型"/>
+ </表:字体>
+ <表:显示标志 uof:locID="s0088" uof:attrList="系列名 类别名 数值 百分数 分隔符 图例标志">
+ <xsl:attribute name="表:系列名">true</xsl:attribute>
+ <xsl:if test="style:chart-properties/@chart:data-label-text">
+ <xsl:attribute name="表:类别名"><xsl:value-of select="style:chart-properties/@chart:data-label-text"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:chart-properties/@chart:data-label-number">
+ <xsl:choose>
+ <xsl:when test="style:chart-properties/@chart:data-label-number='value'">
+ <xsl:attribute name="表:数值">true</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="style:chart-properties/@chart:data-label-number='percentage'">
+ <xsl:attribute name="表:百分数">true</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="style:chart-properties/@chart:data-label-symbol">
+ <xsl:attribute name="表:图例标志"><xsl:value-of select="style:chart-properties/@chart:data-label-symbol"/></xsl:attribute>
+ </xsl:if>
+ </表:显示标志>
+ <表:系列名 uof:locID="s0089">
+ <xsl:value-of select="concat('系列',$data-series-position)"/>
+ </表:系列名>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:标题类型">
+ <表:边框 uof:locID="s0057" uof:attrList="类型 宽度 边距 颜色 阴影">
+ <xsl:call-template name="表:边框"/>
+ </表:边框>
+ <xsl:if test="style:graphic-properties/@draw:fill-color or (style:graphic-properties/@draw:fill and not(style:graphic-properties/@draw:fill='none'))">
+ <表:填充 uof:locID="s0058">
+ <xsl:call-template name="图:填充类型"/>
+ </表:填充>
+ </xsl:if>
+ <表:字体 uof:locID="s0059" uof:attrList="式样引用">
+ <xsl:call-template name="字:句属性类型"/>
+ </表:字体>
+ <表:对齐 uof:locID="s0020">
+ <xsl:call-template name="表:对齐格式类型"/>
+ </表:对齐>
+ </xsl:template>
+ <xsl:template name="count-chart-data-point">
+ <xsl:param name="data-point-count"/>
+ <xsl:param name="data-point-position-temp"/>
+ <xsl:choose>
+ <xsl:when test="$data-point-position-temp=0">
+ <xsl:value-of select="$data-point-count"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="temp">
+ <xsl:for-each select="../chart:data-point[position()=$data-point-position-temp]">
+ <xsl:choose>
+ <xsl:when test="@chart:repeated">
+ <xsl:value-of select="@chart:repeated"/>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:call-template name="count-chart-data-point">
+ <xsl:with-param name="data-point-count" select="$data-point-count +$temp"/>
+ <xsl:with-param name="data-point-position-temp" select="$data-point-position-temp -1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:边框">
+ <xsl:attribute name="uof:类型"><xsl:call-template name="表:线型"/></xsl:attribute>
+ <xsl:if test="style:graphic-properties/@svg:stroke-width">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-width,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@svg:stroke-color">
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="style:graphic-properties/@svg:stroke-color"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="uof:阴影">false</xsl:attribute>
+ </xsl:template>
+ <xsl:template name="图:填充类型">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:fill='gradient'">
+ <xsl:variable name="gradient-name">
+ <xsl:value-of select="style:graphic-properties/@draw:fill-gradient-name"/>
+ </xsl:variable>
+ <xsl:for-each select="/descendant::draw:gradient[@draw:name=$gradient-name]">
+ <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
+ <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
+ <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
+ <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
+ <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
+ <xsl:variable name="angle">
+ <xsl:value-of select="@draw:angle div 10"/>
+ </xsl:variable>
+ <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
+ <xsl:if test="@draw:cx">
+ <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@draw:cy">
+ <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="图:类型">-2</xsl:attribute>
+ </图:渐变>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:fill-image-name">
+ <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
+ <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:graphic-properties/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:graphic-properties/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:图形引用"><xsl:value-of select="concat('chart_image_',count(preceding::draw:fill-image))"/></xsl:attribute>
+ <xsl:attribute name="图:类型">png</xsl:attribute>
+ <xsl:attribute name="图:名称"><xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/></xsl:attribute>
+ </图:图片>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:fill='hatch'">
+ <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
+ <xsl:attribute name="图:类型"><xsl:value-of select="../../office:styles/draw:hatch/@draw:name"/></xsl:attribute>
+ <xsl:attribute name="图:图形引用">gr1</xsl:attribute>
+ <xsl:attribute name="图:前景色"><xsl:value-of select="../../office:styles/draw:hatch/@draw:color"/></xsl:attribute>
+ <xsl:attribute name="图:背景色"><xsl:choose><xsl:when test="style:graphic-properties/@draw:fill-color"><xsl:value-of select="style:graphic-properties/@draw:fill-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
+ </图:图案>
+ </xsl:when>
+ <xsl:otherwise>
+ <图:颜色 uof:locID="g0034">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:fill-color">
+ <xsl:value-of select="style:graphic-properties/@draw:fill-color"/>
+ </xsl:when>
+ <xsl:otherwise>#99ccff</xsl:otherwise>
+ </xsl:choose>
+ </图:颜色>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="图:填充类型2">
+ <xsl:if test="style:graphic-properties/@draw:fill-color">
+ <图:颜色 uof:locID="g0034">
+ <xsl:value-of select="style:graphic-properties/@draw:fill-color"/>
+ </图:颜色>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:fill-image-name">
+ <xsl:variable name="chart-image-name" select="style:graphic-properties/@draw:fill-image-name"/>
+ <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
+ <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:graphic-properties/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:graphic-properties/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:for-each select="../../office:styles/draw:fill-image[@draw:name=$chart-image-name]">
+ <xsl:attribute name="图:图形引用"><xsl:value-of select="concat('chart_image_',count(preceding::draw:fill-image))"/></xsl:attribute>
+ </xsl:for-each>
+ <xsl:attribute name="图:类型">png</xsl:attribute>
+ <xsl:attribute name="图:名称"><xsl:value-of select="$chart-image-name"/></xsl:attribute>
+ </图:图片>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:fill-hatch-name">
+ <xsl:variable name="chart-hatch-name" select="style:graphic-properties/@draw:fill-hatch-name"/>
+ <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
+ <xsl:for-each select="../../office:styles/draw:hatch[@draw:name=$chart-hatch-name]">
+ <xsl:attribute name="图:类型"><xsl:value-of select="@draw:style"/></xsl:attribute>
+ <xsl:attribute name="图:前景色"><xsl:value-of select="@draw:color"/></xsl:attribute>
+ <xsl:attribute name="图:背景色"/>
+ <xsl:attribute name="图:距离"><xsl:value-of select="@draw:distance"/></xsl:attribute>
+ <xsl:attribute name="图:旋转度"><xsl:value-of select="@draw:rotation"/></xsl:attribute>
+ </xsl:for-each>
+ <xsl:attribute name="图:图形引用"><xsl:value-of select="$chart-hatch-name"/></xsl:attribute>
+ </图:图案>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:fill-gradient-name">
+ <xsl:variable name="chart-gradient-name" select="style:graphic-properties/@draw:fill-gradient-name"/>
+ <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
+ <xsl:for-each select="../../office:styles/draw:gradient[@draw:name=$chart-gradient-name]">
+ <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
+ <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
+ <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
+ <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
+ <xsl:variable name="angle">
+ <xsl:value-of select="@draw:angle div 10"/>
+ </xsl:variable>
+ <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
+ <xsl:if test="@draw:cx">
+ <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@draw:cy">
+ <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="图:类型">-2</xsl:attribute>
+ </xsl:for-each>
+ <xsl:attribute name="图:图形引用"><xsl:value-of select="$chart-gradient-name"/></xsl:attribute>
+ </图:渐变>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="表:对齐格式类型">
+ <xsl:if test="style:chart-properties/@style:rotation-angle">
+ <表:文字旋转角度 uof:locID="s0080">
+ <xsl:value-of select="style:chart-properties/@style:rotation-angle"/>
+ </表:文字旋转角度>
+ </xsl:if>
+ <xsl:if test="style:chart-properties/@fo:text-align">
+ <xsl:element name="表:水平对齐方式">
+ <xsl:attribute name="uof:locID">s0115</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="style:chart-properties/@fo:text-align = 'center'">center</xsl:when>
+ <xsl:when test="style:chart-properties/@fo:text-align = 'end'">right</xsl:when>
+ <xsl:when test="style:chart-properties/@fo:text-align = 'justify'">justify</xsl:when>
+ <xsl:when test="style:chart-properties/@fo:text-align = 'start'">left</xsl:when>
+ <xsl:otherwise>fill</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="(style:chart-properties/@style:vertical-align) or (style:chart-properties/@fo:vertical-align)">
+ <xsl:element name="表:垂直对齐方式">
+ <xsl:attribute name="uof:locID">s0116</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="style:chart-properties/@fo:vertical-align = 'top'">top</xsl:when>
+ <xsl:when test="style:chart-propeoperties/@fo:vertical-align = 'middle'">center</xsl:when>
+ <xsl:when test="style:charties/@fo:vertical-align = 'bottom'">bottom</xsl:when>
+ <xsl:when test="style:chart-prrt-properties/@fo:vertical-align = 'justify'">justify</xsl:when>
+ <xsl:when test="style:chart-properties/@fo:vertical-align = 'top'">top</xsl:when>
+ <xsl:otherwise>distributed</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@fo:margin-left">
+ <表:缩进 uof:locID="s0117">
+ <xsl:value-of select="substring-before(style:paragraph-properties/@fo:margin-left,$uofUnit)"/>
+ </表:缩进>
+ </xsl:if>
+ <xsl:element name="表:文字方向">
+ <xsl:attribute name="uof:locID">s0118</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="style:chart-properties/@style:direction = 'ttb'">vertical</xsl:when>
+ <xsl:otherwise>horizontal</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <表:自动换行 uof:locID="s0120" uof:attrList="值">
+ <xsl:attribute name="表:值">true</xsl:attribute>
+ </表:自动换行>
+ <表:缩小字体填充 uof:locID="s0121" uof:attrList="值">
+ <xsl:attribute name="表:值">true</xsl:attribute>
+ </表:缩小字体填充>
+ </xsl:template>
+ <xsl:template name="表:线型">
+ <xsl:variable name="linetype" select="style:graphic-properties/@draw:stroke-dash"/>
+ <xsl:variable name="stroke" select="style:graphic-properties/@draw:stroke"/>
+ <xsl:choose>
+ <xsl:when test="$stroke='solid'">single</xsl:when>
+ <xsl:when test="$stroke='none'">none</xsl:when>
+ <xsl:when test="$stroke='dash'">
+ <xsl:choose>
+ <xsl:when test="$linetype='Ultrafine_20_Dashed'">dash</xsl:when>
+ <xsl:when test="$linetype='Fine_20_Dashed'">dashed-heavy</xsl:when>
+ <xsl:when test="$linetype='Ultrafine_20_2_20_Dots_20_3_20_Dashes'">dot-dash</xsl:when>
+ <xsl:when test="$linetype='Fine_20_Dotted'">dotted</xsl:when>
+ <xsl:when test="$linetype='Line_20_with_20_Fine_20_Dots'">dash-long-heavy</xsl:when>
+ <xsl:when test="$linetype='Fine_20_Dashed_20__28_var_29_'">dash-long</xsl:when>
+ <xsl:when test="$linetype='_33__20_Dashes_20_3_20_Dots_20__28_var_29_'">dash-dot-dot</xsl:when>
+ <xsl:when test="$linetype='Ultrafine_20_Dotted_20__28_var_29_'">dotted-heavy</xsl:when>
+ <xsl:when test="$linetype='Line_20_Style_20_9'">thick</xsl:when>
+ <xsl:when test="$linetype='_32__20_Dots_20_1_20_Dash'">dot-dot-dash</xsl:when>
+ <xsl:when test="$linetype='Dashed_20__28_var_29_'">dash-dot-dot-heavy</xsl:when>
+ <xsl:when test="$linetype='Dash_20_10'">dash-dot-heavy</xsl:when>
+ <xsl:otherwise>single</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>single</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:刻度类型">
+ <xsl:if test="style:chart-properties/@chart:minimum">
+ <表:最小值 uof:locID="s0065">
+ <xsl:value-of select="style:chart-properties/@chart:minimum"/>
+ </表:最小值>
+ </xsl:if>
+ <xsl:if test="style:chart-properties/@chart:maximum">
+ <表:最大值 uof:locID="s0066">
+ <xsl:value-of select="style:chart-properties/@chart:maximum"/>
+ </表:最大值>
+ </xsl:if>
+ <xsl:if test="style:chart-properties/@chart:interval-major">
+ <表:主单位 uof:locID="s0067">
+ <xsl:value-of select="style:chart-properties/@chart:interval-major"/>
+ </表:主单位>
+ </xsl:if>
+ <xsl:if test="style:chart-properties/@chart:interval-minor">
+ <表:次单位 uof:locID="s0068">
+ <xsl:value-of select="style:chart-properties/@chart:interval-minor"/>
+ </表:次单位>
+ </xsl:if>
+ <xsl:if test="style:chart-properties/@chart:origin">
+ <表:分类交叉点 uof:locID="s0069">
+ <xsl:value-of select="style:chart-properties/@chart:origin"/>
+ </表:分类交叉点>
+ </xsl:if>
+ <表:单位 uof:locID="s0070">none</表:单位>
+ <表:显示单位 uof:locID="s0071" uof:attrList="值" 表:值="false"/>
+ <表:对数 uof:locID="s0072" uof:attrList="值" 表:值="false"/>
+ </xsl:template>
+ <xsl:template name="字:句属性类型">
+ <xsl:element name="字:字体">
+ <xsl:attribute name="uof:locID">t0088</xsl:attribute>
+ <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
+ <xsl:if test="style:text-properties/@fo:font-size or style:text-properties/@style:font-size-asian or style:text-properties/@style:font-size-complex">
+ <xsl:choose>
+ <xsl:when test="contains(style:text-properties/@fo:font-size,'%') or contains(style:text-properties/@style:font-size-asian,'%')">
+ <xsl:attribute name="字:相对字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'%')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'%')"/></xsl:when></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-complex"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-complex,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:font-family">
+ <xsl:attribute name="字:西文字体引用"><xsl:value-of select="style:text-properties/@fo:font-family"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:font-family-asian">
+ <xsl:attribute name="字:中文字体引用"><xsl:value-of select="style:text-properties/@style:font-family-asian"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test="style:text-properties/@style:text-background-color and not(style:text-properties/@style:text-background-color='transparent')">
+ <xsl:element name="字:填充">
+ <xsl:element name="图:图案">
+ <xsl:attribute name="uof:locID">g0036</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 图形引用 前景色 背景色</xsl:attribute>
+ <xsl:if test="style:text-properties/@style:text-background-color">
+ <xsl:attribute name="图:前景色"><xsl:value-of select="style:text-properties/@style:text-background-color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:font-weight or style:text-properties/@style:font-weight-asian">
+ <xsl:element name="字:粗体">
+ <xsl:attribute name="uof:locID">t0089</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@style:font-weight-asian='bold' or style:text-properties/@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:font-style or style:text-properties/@style:font-style-asian">
+ <xsl:element name="字:斜体">
+ <xsl:attribute name="uof:locID">t0090</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:font-style='italic' or style:text-properties/@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-line-through-style and not(style:text-properties/@style:text-line-through-style='none')">
+ <xsl:element name="字:删除线">
+ <xsl:attribute name="uof:locID">t0094</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:delete线型类型"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-underline">
+ <xsl:element name="字:下划线">
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0095</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:if test="style:text-properties/@style:text-underline-color">
+ <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="style:text-properties/@style:text-underline-color='font-color'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@style:text-underline-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:text-shadow">
+ <xsl:element name="字:阴影">
+ <xsl:attribute name="uof:locID">t0100</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-emphasize">
+ <xsl:element name="字:着重号">
+ <xsl:attribute name="uof:locID">t0096</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 颜色 字着重号</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="style:text-properties/@style:text-emphasize='none'">
+ <xsl:attribute name="字:字着重号">false</xsl:attribute>
+ <xsl:attribute name="字:类型">none</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:字着重号">true</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:着重号类型"><xsl:with-param name="te" select="style:text-properties/@style:text-emphasize"/></xsl:call-template></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="style:text-properties/@fo:color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@text:display">
+ <xsl:element name="字:隐藏文字">
+ <xsl:attribute name="uof:locID">t0097</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-outline">
+ <xsl:element name="字:空心">
+ <xsl:attribute name="uof:locID">t0098</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="style:text-properties/@style:text-outline"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:font-relief">
+ <xsl:element name="字:浮雕">
+ <xsl:attribute name="uof:locID">t0099</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@style:font-relief='embossed'">emboss</xsl:when><xsl:when test="style:text-properties/@style:font-relief='engraved'">engrave</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:text-transform or style:text-properties/@fo:font-variant">
+ <xsl:element name="字:醒目字体">
+ <xsl:attribute name="uof:locID">t0101</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@fo:text-transform='uppercase'">uppercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='lowercase'">lowercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='capitalize'">capital</xsl:when><xsl:when test="style:text-properties/@fo:font-variant='small-caps'">small-caps</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-position">
+ <xsl:element name="字:位置">
+ <xsl:attribute name="uof:locID">t0102</xsl:attribute>
+ <xsl:value-of select="style:text-properties/@style:text-position"/>
+ </xsl:element>
+ <字:上下标 uof:locID="t0205" uof:attrList="值">
+ <xsl:attribute name="字:值">none</xsl:attribute>
+ </字:上下标>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-scale">
+ <xsl:element name="字:缩放">
+ <xsl:attribute name="uof:locID">t0103</xsl:attribute>
+ <xsl:value-of select="style:text-properties/@style:text-scale"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:letter-spacing">
+ <xsl:element name="字:字符间距">
+ <xsl:attribute name="uof:locID">t0104</xsl:attribute>
+ <xsl:value-of select="style:text-properties/@fo:letter-spacing"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:letter-kerning">
+ <xsl:element name="字:调整字间距">
+ <xsl:attribute name="uof:locID">t015</xsl:attribute>
+ <xsl:value-of select="style:text-properties/@style:letter-kerning"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="uof:着重号类型">
+ <xsl:param name="te"/>
+ <xsl:choose>
+ <xsl:when test="$te='disc above' ">disc above</xsl:when>
+ <xsl:when test="$te='circle above' ">circle above</xsl:when>
+ <xsl:when test="$te='dot above' ">dot above</xsl:when>
+ <xsl:when test="$te='accent above' ">accent above</xsl:when>
+ <xsl:when test="$te='dot below' ">dot below</xsl:when>
+ <xsl:when test="$te='circle below' ">circle below</xsl:when>
+ <xsl:when test="$te='disc below' ">disc below</xsl:when>
+ <xsl:when test="$te='accent below' ">accent below</xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="uof:线型类型">
+ <xsl:variable name="spath" select="style:text-properties/@style:text-underline-style"/>
+ <xsl:variable name="wpath" select="style:text-properties/@style:text-underline-width"/>
+ <xsl:variable name="tpath" select="style:text-properties/@style:text-underline-type"/>
+ <xsl:choose>
+ <xsl:when test="$spath='solid' and not($tpath='double' ) and $wpath='auto' ">single</xsl:when>
+ <xsl:when test="$spath='solid' and $tpath='double' and $wpath='auto' ">double</xsl:when>
+ <xsl:when test="$spath='solid' and not($tpath='double' )and $wpath='bold' ">thick</xsl:when>
+ <xsl:when test="$spath='dotted' and not($tpath='double' )and $wpath='auto' ">dotted</xsl:when>
+ <xsl:when test="$spath='dotted' and not($tpath='double' )and $wpath='bold' ">dotted-heavy</xsl:when>
+ <xsl:when test="$spath='dash' and not($tpath='double' )and $wpath='auto' ">dash</xsl:when>
+ <xsl:when test="$spath='dash' and not($tpath='double' )and $wpath='bold' ">dashed-heavy</xsl:when>
+ <xsl:when test="$spath='long-dash' and not($tpath='double' )and $wpath='auto' ">dash-long</xsl:when>
+ <xsl:when test="$spath='long-dash' and not($tpath='double' )and $wpath='bold' ">dash-long-heavy</xsl:when>
+ <xsl:when test="$spath='dot-dash' and not($tpath='double' )and $wpath='auto' ">dot-dash</xsl:when>
+ <xsl:when test="$spath='dot-dash' and not($tpath='double' )and $wpath='bold' ">dash-dot-heavy</xsl:when>
+ <xsl:when test="$spath='dot-dot-dash' and not($tpath='double' )and $wpath='auto' ">dot-dot-dash</xsl:when>
+ <xsl:when test="$spath='dot-dot-dash' and not($tpath='double' )and $wpath='bold' ">dash-dot-dot-heavy</xsl:when>
+ <xsl:when test="$spath='wave' and not($tpath='double' )and $wpath='auto' ">wave</xsl:when>
+ <xsl:when test="$spath='wave' and not($tpath='double' )and $wpath='bold' ">wavy-heavy</xsl:when>
+ <xsl:when test="$spath='wave' and $tpath='double' and $wpath='auto' ">wavy-double</xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="uof:delete线型类型">
+ <xsl:variable name="wpath" select="style:text-properties/@style:text-line-through-width"/>
+ <xsl:variable name="textpath" select="style:text-properties/@style:text-line-through-text"/>
+ <xsl:variable name="umpath" select="style:text-properties/@style:text-underline-mode"/>
+ <xsl:variable name="tmpath" select="style:text-properties/@style:text-line-through-mode"/>
+ <xsl:variable name="tpath" select="style:text-properties/@style:text-line-through-type"/>
+ <xsl:choose>
+ <xsl:when test="$umpath='continuous' and $tmpath='continuous'">single</xsl:when>
+ <xsl:when test="$tpath='double'">double</xsl:when>
+ <xsl:when test="$wpath='bold'">bold</xsl:when>
+ <xsl:when test="$textpath='/'">带/</xsl:when>
+ <xsl:when test="$textpath='X'">带X</xsl:when>
+ <xsl:otherwise>none</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--comment: if input char is Roman,please add a prefix 'Roman_'-->
+ <xsl:template name="General-Char-Transition">
+ <xsl:param name="input-char"/>
+ <xsl:param name="output-type"/>
+ <xsl:choose>
+ <xsl:when test="$input-char='A' or $input-char='a' or $input-char='1' or $input-char='Roman_I' or $input-char='Roman_i' or $input-char='一' or $input-char='壹' or $input-char='甲' or $input-char='子'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">1</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">a</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">A</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">I</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">i</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">1</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">一</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">1</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">壹</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">1</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">甲</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">子</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='B' or $input-char='b' or $input-char='2' or $input-char='Roman_II' or $input-char='Roman_ii' or $input-char='二' or $input-char='贰' or $input-char='乙' or $input-char='丑'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">2</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">b</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">B</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">II</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">ii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">2</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">2</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">2</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">乙</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">丑</xsl:when>
+ <xsl:otherwise>2</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='C' or $input-char='c' or $input-char='3' or $input-char='Roman_III' or $input-char='Roman_iii' or $input-char='三' or $input-char='叁' or $input-char='丙' or $input-char='寅'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">3</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">c</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">C</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">III</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">iii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">3</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">三</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">3</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">叁</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">3</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">丙</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">寅</xsl:when>
+ <xsl:otherwise>3</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='D' or $input-char='d' or $input-char='4' or $input-char='Roman_IV' or $input-char='Roman_iv' or $input-char='四' or $input-char='肆' or $input-char='丁' or $input-char='卯'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">4</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">d</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">D</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">IV</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">iv</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">4</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">四</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">4</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">肆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">4</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">丁</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">卯</xsl:when>
+ <xsl:otherwise>4</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='E' or $input-char='e' or $input-char='5' or $input-char='Roman_V' or $input-char='Roman_v' or $input-char='五' or $input-char='伍' or $input-char='戊' or $input-char='辰'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">5</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">e</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">E</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">V</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">v</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">5</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">五</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">5</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">伍</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">5</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">戊</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">辰</xsl:when>
+ <xsl:otherwise>5</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='F' or $input-char='f' or $input-char='6' or $input-char='Roman_VI' or $input-char='Roman_vi' or $input-char='六' or $input-char='陆' or $input-char='己' or $input-char='巳'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">6</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">f</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">F</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">VI</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">vi</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">6</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">六</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">6</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">陆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">6</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">己</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">巳</xsl:when>
+ <xsl:otherwise>6</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='G' or $input-char='g' or $input-char='7' or $input-char='Roman_VII' or $input-char='Roman_vii' or $input-char='七' or $input-char='柒' or $input-char='庚' or $input-char='午'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">7</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">g</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">G</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">VII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">vii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">7</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">七</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">7</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">柒</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">7</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">庚</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">午</xsl:when>
+ <xsl:otherwise>7</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='H' or $input-char='h' or $input-char='8' or $input-char='Roman_VIII' or $input-char='Roman_viii' or $input-char='八' or $input-char='捌' or $input-char='辛' or $input-char='未'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">8</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">h</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">H</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">VIII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">viii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">8</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">八</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">8</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">捌</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">8</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">辛</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">未</xsl:when>
+ <xsl:otherwise>8</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='I' or $input-char='i' or $input-char='9' or $input-char='Roman_IX' or $input-char='Roman_ix' or $input-char='九' or $input-char='玖' or $input-char='壬' or $input-char='申'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">9</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">i</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">I</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">IX</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">ix</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">9</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">九</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">9</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">玖</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">9</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">壬</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">申</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='J' or $input-char='j' or $input-char='10' or $input-char='Roman_X' or $input-char='Roman_x' or $input-char='十' or $input-char='拾' or $input-char='癸' or $input-char='酉'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">10</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">j</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">J</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">X</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">x</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">10</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">10</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">10</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">癸</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">酉</xsl:when>
+ <xsl:otherwise>10</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='K' or $input-char='k' or $input-char='11' or $input-char='Roman_XI' or $input-char='Roman_xi' or $input-char='十一' or $input-char='拾壹' or $input-char='戌'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">11</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">k</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">K</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XI</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xi</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">11</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十一</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">11</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾壹</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">11</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">戌</xsl:when>
+ <xsl:otherwise>11</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='L' or $input-char='l' or $input-char='12' or $input-char='Roman_XII' or $input-char='Roman_xii' or $input-char='十二' or $input-char='拾贰' or $input-char='亥'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">12</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">l</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">L</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">12</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十二</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">12</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾贰</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">12</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">亥</xsl:when>
+ <xsl:otherwise>12</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='M' or $input-char='m' or $input-char='13' or $input-char='Roman_XIII' or $input-char='Roman_xiii' or $input-char='十三' or $input-char='拾叁'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">13</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">m</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">M</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XIII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xiii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">13</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十三</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">13</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾叁</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">13</xsl:when>
+ <xsl:otherwise>13</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='N' or $input-char='n' or $input-char='14' or $input-char='Roman_XIV' or $input-char='Roman_xiv' or $input-char='十四' or $input-char='拾肆'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">14</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">n</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">N</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XIV</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xiv</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">14</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十四</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">14</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾肆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">14</xsl:when>
+ <xsl:otherwise>14</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='O' or $input-char='o' or $input-char='15' or $input-char='Roman_XV' or $input-char='Roman_xv' or $input-char='十五' or $input-char='拾伍'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">15</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">o</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">O</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XV</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xv</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">15</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十五</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">15</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾伍</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">15</xsl:when>
+ <xsl:otherwise>15</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='P' or $input-char='p' or $input-char='16' or $input-char='Roman_XVI' or $input-char='Roman_xvi' or $input-char='十六' or $input-char='拾陆'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">16</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">p</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">P</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XVI</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xvi</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">16</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十六</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">16</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾陆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">16</xsl:when>
+ <xsl:otherwise>16</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='Q' or $input-char='q' or $input-char='17' or $input-char='Roman_XVII' or $input-char='Roman_xvii' or $input-char='十七' or $input-char='拾柒'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">17</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">q</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Q</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XVII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xvii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">17</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十七</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">17</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾柒</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">17</xsl:when>
+ <xsl:otherwise>17</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='R' or $input-char='r' or $input-char='18' or $input-char='Roman_XVIII' or $input-char='Roman_xviii' or $input-char='十八' or $input-char='拾捌'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">18</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">r</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">R</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XVIII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xviii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">18</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十八</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">18</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾捌</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">18</xsl:when>
+ <xsl:otherwise>18</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='S' or $input-char='s' or $input-char='19' or $input-char='Roman_XIX' or $input-char='Roman_xix' or $input-char='十九' or $input-char='拾玖'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">19</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">s</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">S</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XIX</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xix</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">19</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十九</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">19</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾玖</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">19</xsl:when>
+ <xsl:otherwise>19</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='T' or $input-char='t' or $input-char='20' or $input-char='Roman_XX' or $input-char='Roman_xx' or $input-char='二十' or $input-char='贰拾'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">20</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">t</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">T</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XX</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xx</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">20</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">20</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">20</xsl:when>
+ <xsl:otherwise>20</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='U' or $input-char='u' or $input-char='21' or $input-char='Roman_XXI' or $input-char='Roman_xxi' or $input-char='二十一' or $input-char='贰拾壹'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">21</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">u</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">U</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXI</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxi</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">21</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十一</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">21</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾壹</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">21</xsl:when>
+ <xsl:otherwise>21</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='V' or $input-char='v' or $input-char='22' or $input-char='Roman_XXII' or $input-char='Roman_xxii' or $input-char='二十二' or $input-char='贰拾贰'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">22</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">v</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">V</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">22</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十二</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">22</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾贰</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">22</xsl:when>
+ <xsl:otherwise>22</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='W' or $input-char='w' or $input-char='23' or $input-char='Roman_XXIII' or $input-char='Roman_xxiii' or $input-char='二十三' or $input-char='贰拾叁'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">23</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">w</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">W</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXIII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxiii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">23</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十三</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">23</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾叁</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">23</xsl:when>
+ <xsl:otherwise>23</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='X' or $input-char='x' or $input-char='24' or $input-char='Roman_XXIV' or $input-char='Roman_xxiv' or $input-char='二十四' or $input-char='贰拾肆'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">24</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">x</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">X</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXIV</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxiv</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">24</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十四</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">24</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾肆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">24</xsl:when>
+ <xsl:otherwise>24</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='Y' or $input-char='y' or $input-char='25' or $input-char='Roman_XXV' or $input-char='Roman_xxv' or $input-char='二十五' or $input-char='贰拾伍'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">25</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">y</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Y</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXV</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxv</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">25</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十五</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">25</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾伍</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">25</xsl:when>
+ <xsl:otherwise>25</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='Z' or $input-char='z' or $input-char='26' or $input-char='Roman_XXVI' or $input-char='Roman_xxvi' or $input-char='二十六' or $input-char='贰拾陆'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">26</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">z</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Z</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXVI</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxvi</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">26</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十六</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">26</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾陆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">26</xsl:when>
+ <xsl:otherwise>26</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">1</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">a</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">A</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">I</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">i</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">1</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">一</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">1</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">壹</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">1</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--RedOffice comment (Zengjh) end charts-->
+ <!-- 以下模板的作用是将网格线的R或者G或者B颜色从十进制转换为16进制-->
+ <xsl:template name="transform-decimal-to-hexadecimal">
+ <xsl:param name="color-decimal"/>
+ <xsl:variable name="first-number" select="floor($color-decimal div 16)"/>
+ <xsl:variable name="first-char">
+ <xsl:call-template name="decimal-to-hex">
+ <xsl:with-param name="number" select="$first-number"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="second-number" select="$color-decimal - ($first-number * 16)"/>
+ <xsl:variable name="second-char">
+ <xsl:call-template name="decimal-to-hex">
+ <xsl:with-param name="number" select="$second-number"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat($first-char,$second-char)"/>
+ </xsl:template>
+ <!-- 以下模板的作用为将0到15的整数转换为16进制数-->
+ <xsl:template name="decimal-to-hex">
+ <xsl:param name="number"/>
+ <xsl:choose>
+ <xsl:when test="$number=0">0</xsl:when>
+ <xsl:when test="$number=1">1</xsl:when>
+ <xsl:when test="$number=2">2</xsl:when>
+ <xsl:when test="$number=3">3</xsl:when>
+ <xsl:when test="$number=4">4</xsl:when>
+ <xsl:when test="$number=5">5</xsl:when>
+ <xsl:when test="$number=6">6</xsl:when>
+ <xsl:when test="$number=7">7</xsl:when>
+ <xsl:when test="$number=8">8</xsl:when>
+ <xsl:when test="$number=9">9</xsl:when>
+ <xsl:when test="$number=10">a</xsl:when>
+ <xsl:when test="$number=11">b</xsl:when>
+ <xsl:when test="$number=12">c</xsl:when>
+ <xsl:when test="$number=13">d</xsl:when>
+ <xsl:when test="$number=14">e</xsl:when>
+ <xsl:when test="$number='15'">f</xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="setDefaultPageWidth">
+ <xsl:choose>
+ <xsl:when test="$uofUnit='inch'">
+ <xsl:value-of select="'7.9'"/>
+ </xsl:when>
+ <xsl:when test="$uofUnit='cm'">
+ <xsl:value-of select="'20.999'"/>
+ </xsl:when>
+ <xsl:when test="$uofUnit='mm'">
+ <xsl:value-of select="'200.99'"/>
+ </xsl:when>
+ <xsl:when test="$uofUnit='pt'">
+ <xsl:value-of select="'7870'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'20.990'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="setDefaultPageHeight">
+ <xsl:choose>
+ <xsl:when test="$uofUnit='inch'">
+ <xsl:value-of select="'10.14'"/>
+ </xsl:when>
+ <xsl:when test="$uofUnit='cm'">
+ <xsl:value-of select="'26.999'"/>
+ </xsl:when>
+ <xsl:when test="$uofUnit='mm'">
+ <xsl:value-of select="'269.99'"/>
+ </xsl:when>
+ <xsl:when test="$uofUnit='pt'">
+ <xsl:value-of select="'1023'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'26.990'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--ro000179 chenjh-->
+ <xsl:template name="create-condition-format">
+ <xsl:variable name="unique-map-cellstyle" select="/office:document/office:automatic-styles/style:style[style:map and not(style:map/@style:condition=preceding-sibling::style:style/style:map/@style:condition and style:map/@style:apply-style-name=preceding-sibling::style:style/style:map/@style:apply-style-name and style:map/@style:base-cell-address=preceding-sibling::style:style/style:map/@style:base-cell-address)]"/>
+ <xsl:for-each select="$unique-map-cellstyle">
+ <xsl:call-template name="create-cell-condition-format"/>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="create-cell-condition-format">
+ <xsl:element name="表:条件格式化">
+ <xsl:attribute name="uof:locID">s0017</xsl:attribute>
+ <xsl:element name="表:区域">
+ <xsl:attribute name="uof:locID">s0007</xsl:attribute>
+ <xsl:variable name="cellstylenamelist">
+ <xsl:call-template name="createcellnamelist">
+ <xsl:with-param name="list">
+ <xsl:value-of select="/office:document/office:automatic-styles/style:style[style:map and (style:map/@style:condition=current()/style:map/@style:condition and style:map/@style:apply-style-name=current()/style:map/@style:apply-style-name and style:map/@style:base-cell-address=current()/style:map/@style:base-cell-address)]"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- <xsl:value-of select="concat($cellstylenamelist,'end')"/>-->
+ <xsl:variable name="left-top">
+ <xsl:call-template name="search-left-top">
+ <xsl:with-param name="cellstylenamelist" select="$cellstylenamelist"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- <xsl:value-of select="concat('qqqqqqqq ',$left-top)"/> -->
+ <xsl:variable name="after-translated-left-top">
+ <xsl:call-template name="translate-left-top-condition">
+ <xsl:with-param name="left-top" select="$left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat($after-translated-left-top,':',style:map/@style:base-cell-address)"/>
+ </xsl:element>
+ <xsl:for-each select="style:map">
+ <xsl:element name="表:条件">
+ <xsl:attribute name="uof:locID">s0019</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:variable name="conditiontext" select="@style:condition"/>
+ <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="contains($conditiontext,'cell-content')">cell value</xsl:when><xsl:when test="contains($conditiontext,'is-true-formula')">formula</xsl:when><xsl:otherwise>条件字符串错误!</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:element name="表:操作码">
+ <xsl:attribute name="uof:locID">s0009</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="starts-with($conditiontext,'is-true-formula')">equal to</xsl:when>
+ <xsl:when test="starts-with($conditiontext,'cell-content()')">
+ <xsl:variable name="operatortext" select="substring-after($conditiontext,'cell-content()')"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($operatortext,'&lt;=')">less than or equal to</xsl:when>
+ <xsl:when test="starts-with($operatortext,'&gt;=')">greater than or equal to</xsl:when>
+ <xsl:when test="starts-with($operatortext,'&lt;')">less than</xsl:when>
+ <xsl:when test="starts-with($operatortext,'&gt;')">greater than</xsl:when>
+ <xsl:when test="starts-with($operatortext,'!=')">not equal to</xsl:when>
+ <xsl:when test="starts-with($operatortext,'=')">equal to</xsl:when>
+ <!-- 注意:uof有的另几种操作码在oo中没有,他们是contain,not contain,start with,not start with, end with,not end with-->
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="starts-with($conditiontext,'cell-content-is-between')">between</xsl:when>
+ <xsl:when test="starts-with($conditiontext,'cell-content-is-not-between')">not between</xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="表:第一操作数">
+ <xsl:attribute name="uof:locID">s0010</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="starts-with($conditiontext,'is-true-formula')">
+ <xsl:value-of select="substring(substring-after($conditiontext,'is-true-formula('),1,string-length($conditiontext)-1-string-length('is-true-formula('))"/>
+ </xsl:when>
+ <xsl:when test="starts-with($conditiontext,'cell-content-is-between')">
+ <xsl:value-of select="substring-before(substring-after($conditiontext,'cell-content-is-between('),',')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($conditiontext,'cell-content-is-not-between')">
+ <xsl:value-of select="substring-before(substring-after($conditiontext,'cell-content-is-not-between('),',')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($conditiontext,'cell-content()')">
+ <xsl:variable name="operatortext" select="substring-after($conditiontext,'cell-content()')"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($operatortext,'&lt;=')">
+ <xsl:value-of select="substring-after($conditiontext,'&lt;=')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operatortext,'&gt;=')">
+ <xsl:value-of select="substring-after($conditiontext,'&gt;=')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operatortext,'&lt;')">
+ <xsl:value-of select="substring-after($conditiontext,'&lt;')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operatortext,'&gt;')">
+ <xsl:value-of select="substring-after($conditiontext,'&gt;')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operatortext,'!=')">
+ <xsl:value-of select="substring-after($conditiontext,'!=')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operatortext,'=')">
+ <xsl:value-of select="substring-after($conditiontext,'=')"/>
+ </xsl:when>
+ <!-- 注意:uof有的另几种操作码在oo中没有,他们是contain,not contain,start with,not start with, end with,not end with-->
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="starts-with($conditiontext,'cell-content-is-between') or starts-with($conditiontext,'cell-content-is-not-between')">
+ <xsl:element name="表:第二操作数">
+ <xsl:attribute name="uof:locID">s0011</xsl:attribute>
+ <xsl:value-of select="substring(substring-after($conditiontext,','),1,string-length(substring-after($conditiontext,','))-1)"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="表:格式">
+ <xsl:variable name="apply-style-name" select="@style:apply-style-name"/>
+ <xsl:attribute name="uof:locID">s0023</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="表:式样引用"><xsl:value-of select="$apply-style-name"/></xsl:attribute>
+ <!--xsl:attribute name="表:式样引用"><xsl:value-of select="generate-id(//style:style[@style:name=$apply-style-name])"/></xsl:attribute-->
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="createcellnamelist">
+ <xsl:param name="list"/>
+ <xsl:choose>
+ <xsl:when test="$list">
+ <xsl:variable name="first" select="$list[1]"/>
+ <xsl:variable name="stringlist-of-rest">
+ <xsl:call-template name="createcellnamelist">
+ <xsl:with-param name="list" select="$list[position()!=1]"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat($first/@style:name,' ',$stringlist-of-rest)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="search-left-top">
+ <xsl:param name="cellstylenamelist"/>
+ <xsl:choose>
+ <xsl:when test="$cellstylenamelist!=''">
+ <xsl:variable name="first-cellstylename" select="substring-before($cellstylenamelist, ' ')"/>
+ <xsl:variable name="tableslist" select="/office:document/office:body/office:spreadsheet/table:table"/>
+ <xsl:variable name="first-left-top">
+ <xsl:call-template name="search-left-top-with-one-cellstyle">
+ <xsl:with-param name="cellstylename" select="$first-cellstylename"/>
+ <xsl:with-param name="tableslist" select="$tableslist"/>
+ <xsl:with-param name="return" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="rest-left-top">
+ <xsl:call-template name="search-left-top">
+ <xsl:with-param name="cellstylenamelist" select="substring-after($cellstylenamelist,' ')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="final-left-top">
+ <xsl:choose>
+ <xsl:when test="$rest-left-top =''">
+ <xsl:value-of select="$first-left-top"/>
+ </xsl:when>
+ <xsl:when test="$first-left-top =''">
+ <xsl:value-of select="$rest-left-top"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="after-compared-left-top">
+ <xsl:call-template name="compare-two-left-top">
+ <xsl:with-param name="first" select="$first-left-top"/>
+ <xsl:with-param name="second" select="$rest-left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$after-compared-left-top"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="$final-left-top"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="translate-left-top-condition">
+ <xsl:param name="left-top"/>
+ <xsl:variable name="column-number" select="substring-before(substring-after($left-top,'.'),' ')"/>
+ <xsl:variable name="column-number1">
+ <xsl:value-of select="floor( $column-number div 26 )"/>
+ </xsl:variable>
+ <xsl:variable name="column-number2">
+ <xsl:value-of select="$column-number mod 26"/>
+ </xsl:variable>
+ <xsl:variable name="column-character1">
+ <xsl:call-template name="number-to-character">
+ <xsl:with-param name="number" select="$column-number1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="column-character2">
+ <xsl:call-template name="number-to-character">
+ <xsl:with-param name="number" select="$column-number2"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat(substring-before($left-top,'.'),'.',$column-character1,$column-character2,substring-after($left-top,' '))"/>
+ </xsl:template>
+ <xsl:template name="search-left-top-with-one-cellstyle">
+ <xsl:param name="cellstylename"/>
+ <xsl:param name="tableslist"/>
+ <xsl:param name="return"/>
+ <xsl:choose>
+ <xsl:when test="$tableslist and $return=''">
+ <xsl:variable name="firsttablerows" select="$tableslist[1]//table:table-row"/>
+ <xsl:variable name="first-left-top">
+ <xsl:call-template name="search-left-top-with-one-cellstyle-inatable">
+ <xsl:with-param name="row-num" select="'1'"/>
+ <xsl:with-param name="firsttablerows" select="$firsttablerows"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="return" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="rest-left-top">
+ <xsl:call-template name="search-left-top-with-one-cellstyle">
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="tableslist" select="$tableslist[position()!=1]"/>
+ <xsl:with-param name="return" select="$first-left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-left-top!=''">
+ <xsl:value-of select="$first-left-top"/>
+ </xsl:when>
+ <xsl:when test="$rest-left-top!=''">
+ <xsl:value-of select="$rest-left-top"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$return"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="compare-two-left-top">
+ <xsl:param name="first"/>
+ <xsl:param name="second"/>
+ <xsl:variable name="first-column" select="substring-before(substring-after($first,'.'),' ')"/>
+ <xsl:variable name="first-row" select="substring-after($first,' ')"/>
+ <xsl:variable name="second-column" select="substring-before(substring-after($second,'.'),' ')"/>
+ <xsl:variable name="second-row" select="substring-after($second,' ')"/>
+ <xsl:choose>
+ <xsl:when test="$first-row&lt;$second-row">
+ <xsl:value-of select="$first"/>
+ </xsl:when>
+ <xsl:when test="$first-row=$second-row">
+ <xsl:choose>
+ <xsl:when test="$first-column&lt;=$second-column">
+ <xsl:value-of select="$first"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$second"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$second"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="search-left-top-with-one-cellstyle-inatable">
+ <xsl:param name="row-num"/>
+ <xsl:param name="firsttablerows"/>
+ <xsl:param name="cellstylename"/>
+ <xsl:param name="return"/>
+ <xsl:choose>
+ <xsl:when test="$firsttablerows and $return=''">
+ <xsl:variable name="firstcells" select="$firsttablerows[1]/table:table-cell"/>
+ <xsl:variable name="first-left-top">
+ <xsl:call-template name="search-left-top-with-one-cellstyle-inarow">
+ <xsl:with-param name="row-num" select="$row-num"/>
+ <xsl:with-param name="column-num" select="'1'"/>
+ <xsl:with-param name="firstcells" select="$firstcells"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="return" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="row-num-p">
+ <xsl:choose>
+ <xsl:when test="$firsttablerows[1]/@table:number-rows-repeated">
+ <xsl:value-of select="$row-num+ $firsttablerows[1]/@table:number-rows-repeated"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$row-num+1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="rest-left-top">
+ <xsl:call-template name="search-left-top-with-one-cellstyle-inatable">
+ <xsl:with-param name="row-num" select="$row-num-p"/>
+ <xsl:with-param name="firsttablerows" select="$firsttablerows[position()!=1]"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="return" select="$first-left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-left-top!=''">
+ <xsl:value-of select="$first-left-top"/>
+ </xsl:when>
+ <xsl:when test="$rest-left-top !=''">
+ <xsl:value-of select="$rest-left-top "/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$return"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="search-left-top-with-one-cellstyle-inarow">
+ <xsl:param name="row-num"/>
+ <xsl:param name="column-num"/>
+ <xsl:param name="firstcells"/>
+ <xsl:param name="cellstylename"/>
+ <xsl:param name="return"/>
+ <xsl:choose>
+ <xsl:when test="$firstcells and $return=''">
+ <xsl:variable name="firstcell" select="$firstcells[1]"/>
+ <xsl:variable name="first-left-top">
+ <xsl:call-template name="search-left-top-with-one-cellstyle-inacell">
+ <xsl:with-param name="row-num" select="$row-num"/>
+ <xsl:with-param name="column-num" select="$column-num"/>
+ <xsl:with-param name="cell" select="$firstcell"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="column-num-p">
+ <xsl:choose>
+ <xsl:when test="$firstcell/@table:number-columns-repeated">
+ <xsl:value-of select="$column-num+ $firstcell/@table:number-columns-repeated"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$column-num+ 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="rest-left-top">
+ <xsl:call-template name="search-left-top-with-one-cellstyle-inarow">
+ <xsl:with-param name="row-num" select="$row-num"/>
+ <xsl:with-param name="column-num" select="$column-num-p"/>
+ <xsl:with-param name="firstcells" select="$firstcells[position()!=1]"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="return" select="$first-left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-left-top!=''">
+ <xsl:value-of select="$first-left-top"/>
+ </xsl:when>
+ <xsl:when test="$rest-left-top !=''">
+ <xsl:value-of select="$rest-left-top "/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$return"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="search-left-top-with-one-cellstyle-inacell">
+ <xsl:param name="row-num"/>
+ <xsl:param name="column-num"/>
+ <xsl:param name="cell"/>
+ <xsl:param name="cellstylename"/>
+ <xsl:choose>
+ <xsl:when test="$cell/@table:style-name">
+ <xsl:if test="$cell/@table:style-name=$cellstylename">
+ <xsl:value-of select="concat($cell/ancestor::table:table/@table:name,'.',$column-num,' ',$row-num)"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="style-is-default">
+ <xsl:call-template name="is-default-or-not">
+ <xsl:with-param name="column-num" select="$column-num"/>
+ <xsl:with-param name="cell" select="$cell"/>
+ <xsl:with-param name="preceding-cellstylename" select="''"/>
+ <xsl:with-param name="temp-num" select="'0'"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="table-collumns" select="$cell/ancestor::table:table//table:table-column "/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$style-is-default='yes' ">
+ <xsl:value-of select="concat($cell/ancestor::table:table/@table:name,'.',$column-num,' ',$row-num)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="is-default-or-not">
+ <xsl:param name="column-num"/>
+ <xsl:param name="cell"/>
+ <xsl:param name="preceding-cellstylename"/>
+ <xsl:param name="temp-num"/>
+ <xsl:param name="cellstylename"/>
+ <xsl:param name="table-collumns"/>
+ <xsl:choose>
+ <xsl:when test="$temp-num&lt;$column-num">
+ <xsl:variable name="firstcolumn">
+ <xsl:choose>
+ <xsl:when test="$table-collumns[1]/@table:number-columns-repeated">
+ <xsl:value-of select="$table-collumns[1]/@table:number-columns-repeated"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'1'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="preceding-cellstylename-to-param">
+ <xsl:choose>
+ <xsl:when test="$table-collumns[1]/@table:default-cell-style-name">
+ <xsl:value-of select="$table-collumns[1]/@table:default-cell-style-name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="is-default-or-not">
+ <xsl:with-param name="column-num" select="$column-num"/>
+ <xsl:with-param name="temp-num" select="$temp-num + $firstcolumn"/>
+ <xsl:with-param name="preceding-cellstylename" select="$preceding-cellstylename-to-param"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="table-collumns" select="$table-collumns[position()!=1]"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$cellstylename=$preceding-cellstylename">
+ <xsl:value-of select="'yes'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'no'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="table:tracked-changes">
+ <xsl:for-each select="/office:document/office:body/office:spreadsheet/table:tracked-changes">
+ <xsl:if test="table:cell-content-change/table:cell-address">
+ <xsl:variable name="row" select="table:cell-content-change/table:cell-address/@table:row"/>
+ <xsl:variable name="column" select="table:cell-content-change/table:cell-address/@table:column"/>
+ <xsl:element name="字:修订开始">
+ <xsl:attribute name="uof:locID">t0206</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="concat($row,'-',$column)"/></xsl:attribute>
+ <xsl:attribute name="字:类型">format</xsl:attribute>
+ <xsl:if test="table:cell-content-change/office:change-info and table:cell-content-change/table:previous">
+ <xsl:variable name="creator" select="table:cell-content-change/office:change-info/dc:creator"/>
+ <xsl:variable name="date" select="table:cell-content-change/office:change-info/dc:date"/>
+ <xsl:variable name="text" select="table:cell-content-change/table:previous/table:change-track-table-cell/text:p"/>
+ <xsl:attribute name="字:修订信息引用"><xsl:value-of select="concat($creator,'+',$date,'%',$text)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:element name="字:修订结束">
+ <xsl:attribute name="uof:locID">t0207</xsl:attribute>
+ <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="office:font-face-decls">
+ <uof:字体集 uof:locID="u0040">
+ <xsl:for-each select="style:font-face">
+ <xsl:element name="uof:字体声明">
+ <xsl:attribute name="uof:attrList">标识符 名称 字体族</xsl:attribute>
+ <xsl:attribute name="uof:locID">u0041</xsl:attribute>
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="translate(@style:name,' ','_')"/></xsl:attribute>
+ <xsl:attribute name="uof:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="uof:字体族"><xsl:value-of select="@svg:font-family"/></xsl:attribute>
+ <!-- added by glu, for process special fonts e.g. Marlett, -->
+ <!--chengxz 060821 delete uof:字符集,because there is no this attr-->
+ <!--xsl:if test="@style:font-charset= '02'">
+ <xsl:attribute name="uof:字符集">x-symbol</xsl:attribute>
+ </xsl:if-->
+ <!--xsl:if test="@style:font-family-generic">
+ <xsl:choose>
+ <xsl:when test="@style:font-family-generic = 'swiss'">
+ <xsl:attribute name="uof:字体族">Swiss</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='modern'">
+ <xsl:attribute name="uof:字体族">Modern</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic='roman'">
+ <xsl:attribute name="uof:字体族">Roman</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='script'">
+ <xsl:attribute name="uof:字体族">Script</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='decorative'">
+ <xsl:attribute name="uof:字体族">Decorative</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='system'">
+ <xsl:attribute name="uof:字体族">System</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="uof:字体族">System</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if-->
+ <!--xsl:if test="@style:font-pitch">
+ <xsl:attribute name="uof:字号">12</xsl:attribute>
+ </xsl:if-->
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="style:font-face"/>
+ </uof:字体集>
+ </xsl:template>
+ <xsl:key name="styles" match="/*/office:styles/style:style | /*/office:automatic-styles/style:style" use="@style:name"/>
+ <xsl:template match="style:style" mode="styles">
+ <xsl:param name="isAutomatic"/>
+ <xsl:param name="styleName" select="@style:name"/>
+ <xsl:choose>
+ <xsl:when test="@style:family='text'">
+ <xsl:element name="uof:句式样">
+ <xsl:attribute name="uof:locID">u0043</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:类型">auto</xsl:attribute>
+ <xsl:call-template name="字:字体"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@style:family='paragraph'">
+ <xsl:element name="uof:段落式样">
+ <xsl:attribute name="uof:locID">u0044</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:类型">auto</xsl:attribute>
+ <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ </xsl:element>
+ <xsl:if test="style:text-properties">
+ <xsl:element name="uof:句式样">
+ <xsl:attribute name="uof:locID">u0043</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:类型">custum</xsl:attribute>
+ <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
+ <xsl:call-template name="字:字体"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="uof:单元格式样">
+ <xsl:attribute name="uof:locID">u0046</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
+ <xsl:attribute name="表:标识符"><xsl:value-of select="$styleName"/></xsl:attribute>
+ <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="ancestor::office:automatic-styles">auto</xsl:when><xsl:when test="ancestor::office:styles">custom</xsl:when><xsl:otherwise>default</xsl:otherwise></xsl:choose></xsl:attribute>
+ <!--xsl:attribute name="表:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute-->
+ <xsl:choose>
+ <xsl:when test="style:map">
+ <xsl:attribute name="表:名称"><xsl:value-of select="style:map/@style:apply-style-name"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="表:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="not($isAutomatic)">
+ <xsl:choose>
+ <xsl:when test="$styleName='Default'">
+ <xsl:attribute name="表:名称"><xsl:value-of select="'Normal'"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="表:名称"><xsl:value-of select="$styleName"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <!--xsl:if test="@style:parent-style-name">
+ <xsl:attribute name="表:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
+ </xsl:if-->
+ <!--chengxz chang the order-->
+ <xsl:variable name="styleProperties" select="key('styles', $styleName)/*"/>
+ <xsl:call-template name="Font">
+ <xsl:with-param name="styleProperties" select="$styleProperties"/>
+ </xsl:call-template>
+ <xsl:call-template name="Alignment">
+ <xsl:with-param name="styleProperties" select="$styleProperties"/>
+ </xsl:call-template>
+ <!--chenjh changed 1103-->
+ <!--xsl:if test="/*/office:automatic-styles/style:style[@style:name=/*/office:body/table:table/table:table-row/table:table-cell/@table:style-name]/style:properties/@fo:border"-->
+ <xsl:if test="@style:data-style-name">
+ <!--RedOffice Comment from Zengjh:UOF0020 2006-04-26-->
+ <xsl:call-template name="NumberFormat">
+ <xsl:with-param name="temp-style" select="@style:data-style-name"/>
+ </xsl:call-template>
+ <!--RedOffice comment (Zengjh) end-->
+ </xsl:if>
+ <xsl:call-template name="Border">
+ <xsl:with-param name="styleProperties" select="$styleProperties"/>
+ <!--xsl:with-param name="styleProperties" select="/*/office:automatic-styles/style:style"/-->
+ </xsl:call-template>
+ <!--/xsl:if-->
+ <!--chenjh end 1103-->
+ <xsl:call-template name="Interior">
+ <xsl:with-param name="styleProperties" select="$styleProperties"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="字:字体">
+ <xsl:element name="字:字体">
+ <xsl:attribute name="uof:locID">t0088</xsl:attribute>
+ <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
+ <xsl:if test="style:text-properties/@fo:font-size or style:text-properties/@fo:font-size-asian or style:text-properties/@style:font-size-asian or style:text-properties/@style:font-size">
+ <xsl:attribute name="字:字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'pt')"/></xsl:when><xsl:when test="style:text-properties/@fo:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size-asian,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size"><xsl:value-of select="substring-before(style:text-properties/@style:font-size,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:font-name">
+ <xsl:attribute name="字:西文字体引用"><xsl:value-of select="style:text-properties/@style:font-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:font-name-complex">
+ <xsl:attribute name="字:中文字体引用"><xsl:value-of select="style:text-properties/@style:font-name-complex"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test="style:text-properties/@fo:font-weight or style:text-properties/@style:font-weight-asian">
+ <xsl:element name="字:粗体">
+ <xsl:attribute name="uof:locID">t0089</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@style:font-weight-asian='bold' or style:text-properties/@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:font-style or style:text-properties/@style:font-style-asian">
+ <xsl:element name="字:斜体">
+ <xsl:attribute name="uof:locID">t0090</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:font-style='italic' or style:text-properties/@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-line-through-style and not(style:text-properties/@style:text-line-through-style='none')">
+ <xsl:element name="字:删除线">
+ <xsl:attribute name="uof:locID">t0094</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:delete线型类型"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-underline-style">
+ <xsl:element name="字:下划线">
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0095</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:if test="style:text-properties/@style:text-underline-color">
+ <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="style:text-properties/@style:text-underline-color='font-color'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@style:text-underline-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:text-shadow">
+ <xsl:element name="字:阴影">
+ <xsl:attribute name="uof:locID">t0100</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-position">
+ <xsl:element name="字:位置">
+ <xsl:attribute name="uof:locID">t0102</xsl:attribute>
+ <xsl:value-of select="style:text-properties/@style:text-position"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <!--RedOffice Comment from Zengjh:UOF0020 2006-04-01 Based on Original-->
+ <xsl:template name="NumberFormat">
+ <xsl:param name="temp-style"/>
+ <xsl:for-each select="(/*/office:styles/child::*[@style:name=$temp-style]) | (/*/office:automatic-styles/child::*[@style:name=$temp-style])">
+ <表:数字格式 uof:locID="s0021" uof:attrList="分类名称 格式码">
+ <xsl:attribute name="表:分类名称"><xsl:choose><xsl:when test="name(.)='number:currency-style'">currency</xsl:when><xsl:when test="name(.)='number:percentage-style'">percentage</xsl:when><xsl:when test="name(.)='number:date-style'">date</xsl:when><xsl:when test="name(.)='number:time-style'">time</xsl:when><xsl:when test="name(.)='number:boolean-style'">custom</xsl:when><xsl:when test="name(.)='number:text-style'">text</xsl:when><xsl:when test="name(.)='number:number-style'"><xsl:choose><xsl:when test="number:fraction">fraction</xsl:when><xsl:when test="number:scientific-number">scientific</xsl:when><xsl:otherwise>number</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>general</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="表:格式码"><xsl:call-template name="element-attribute"/><xsl:for-each select="style:map"><xsl:text>[</xsl:text><xsl:value-of select="@style:condition"/><xsl:text>]</xsl:text><xsl:variable name="apply-style" select="@style:apply-style-name"/><xsl:for-each select="../../child::*[@style:name=$apply-style]/*"><xsl:call-template name="general-number-format"/></xsl:for-each><xsl:text>;</xsl:text></xsl:for-each><xsl:for-each select="*[not(name(.)='style:map')]"><xsl:call-template name="general-number-format"/></xsl:for-each></xsl:attribute>
+ </表:数字格式>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="general-number-format">
+ <xsl:choose>
+ <xsl:when test="name(.)='style:text-properties'">
+ <xsl:call-template name="general-color-format"/>
+ </xsl:when>
+ <xsl:when test="name(.)='number:text'">&quot;<xsl:value-of select="text()"/>&quot;</xsl:when>
+ <xsl:when test="name(.)='number:text-content' ">@</xsl:when>
+ <xsl:when test="name(.)='number:boolean'">boolean</xsl:when>
+ <xsl:when test="name(.)='number:currency-symbol'">
+ <xsl:call-template name="general-currency-format"/>
+ </xsl:when>
+ <xsl:when test="name(.)='number:fraction' or name(.)='number:number' or name(.)='number:scientific-number'">
+ <xsl:if test="@number:min-integer-digits and not(@number:grouping)">
+ <xsl:choose>
+ <xsl:when test="@number:min-integer-digits='0'">#</xsl:when>
+ <xsl:when test="@number:min-integer-digits='1'">0</xsl:when>
+ <xsl:when test="@number:min-integer-digits='2'">00</xsl:when>
+ <xsl:when test="@number:min-integer-digits='3'">000</xsl:when>
+ <xsl:when test="@number:min-integer-digits='4'">0000</xsl:when>
+ <xsl:when test="@number:min-integer-digits='5'">00000</xsl:when>
+ <xsl:when test="@number:min-integer-digits='6'">000000</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@number:min-integer-digits and @number:grouping">
+ <xsl:choose>
+ <xsl:when test="@number:min-integer-digits='0'">#,###</xsl:when>
+ <xsl:when test="@number:min-integer-digits='1'">#,##0</xsl:when>
+ <xsl:when test="@number:min-integer-digits='2'">#,#00</xsl:when>
+ <xsl:when test="@number:min-integer-digits='3'">#,000</xsl:when>
+ <xsl:when test="@number:min-integer-digits='4'">##0,000</xsl:when>
+ <xsl:when test="@number:min-integer-digits='5'">#00,000</xsl:when>
+ <xsl:when test="@number:min-integer-digits='6'">#,000,000</xsl:when>
+ <xsl:when test="@number:min-integer-digits='7'">##0,000,000</xsl:when>
+ <xsl:when test="@number:min-integer-digits='8'">#,#00,000,000</xsl:when>
+ <xsl:otherwise>#,##0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@number:decimal-places and not(@number:decimal-replacement)">
+ <xsl:choose>
+ <xsl:when test="@number:decimal-places='0'"/>
+ <xsl:when test="@number:decimal-places='1'">.0</xsl:when>
+ <xsl:when test="@number:decimal-places='2'">.00</xsl:when>
+ <xsl:when test="@number:decimal-places='3'">.000</xsl:when>
+ <xsl:when test="@number:decimal-places='4'">.0000</xsl:when>
+ <xsl:when test="@number:decimal-places='5'">.00000</xsl:when>
+ <xsl:when test="@number:decimal-places='6'">.000000</xsl:when>
+ <xsl:otherwise>.00</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@number:decimal-places and @number:decimal-replacement">
+ <xsl:choose>
+ <xsl:when test="@number:decimal-places='0'"/>
+ <xsl:when test="@number:decimal-places='1'">.#</xsl:when>
+ <xsl:when test="@number:decimal-places='2'">.##</xsl:when>
+ <xsl:when test="@number:decimal-places='3'">.###</xsl:when>
+ <xsl:when test="@number:decimal-places='4'">.####</xsl:when>
+ <xsl:when test="@number:decimal-places='5'">.#####</xsl:when>
+ <xsl:when test="@number:decimal-places='6'">.######</xsl:when>
+ <xsl:otherwise>.##</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@number:display-factor">
+ <xsl:choose>
+ <xsl:when test="@number:display-factor='1000'">,</xsl:when>
+ <xsl:when test="@number:display-factor='1000000'">,,</xsl:when>
+ <xsl:when test="@number:display-factor='1000000000'">,,,</xsl:when>
+ <xsl:when test="@number:display-factor='1000000000000000'">,,,,</xsl:when>
+ <xsl:when test="@number:display-factor='1000000000000000000'">,,,,,</xsl:when>
+ <xsl:when test="@number:display-factor='1000000000000000000000'">,,,,,</xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@number:min-exponent-digits">
+ <xsl:choose>
+ <xsl:when test="@number:min-exponent-digits='1'">E+0</xsl:when>
+ <xsl:when test="@number:min-exponent-digits='2'">E+00</xsl:when>
+ <xsl:when test="@number:min-exponent-digits='3'">E+000</xsl:when>
+ <xsl:when test="@number:min-exponent-digits='4'">E+0000</xsl:when>
+ <xsl:when test="@number:min-exponent-digits='5'">E+00000</xsl:when>
+ <xsl:when test="@number:min-exponent-digits='6'">E+000000</xsl:when>
+ <xsl:otherwise>E+00</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@number:min-numerator-digits">
+ <xsl:choose>
+ <xsl:when test="@number:min-numerator-digits='1' "> ?</xsl:when>
+ <xsl:when test="@number:min-numerator-digits='2' "> ??</xsl:when>
+ <xsl:when test="@number:min-numerator-digits='3' "> ???</xsl:when>
+ <xsl:when test="@number:min-numerator-digits='4' "> ????</xsl:when>
+ <xsl:when test="@number:min-numerator-digits='5' "> ?????</xsl:when>
+ <xsl:when test="@number:min-numerator-digits='6' "> ??????</xsl:when>
+ <xsl:otherwise> ???</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@number:min-denominator-digits">
+ <xsl:choose>
+ <xsl:when test="@number:min-denominator-digits='1' ">/?</xsl:when>
+ <xsl:when test="@number:min-denominator-digits='2' ">/??</xsl:when>
+ <xsl:when test="@number:min-denominator-digits='3' ">/???</xsl:when>
+ <xsl:when test="@number:min-denominator-digits='4' ">/????</xsl:when>
+ <xsl:when test="@number:min-denominator-digits='5' ">/?????</xsl:when>
+ <xsl:when test="@number:min-denominator-digits='6' ">/??????</xsl:when>
+ <xsl:otherwise>/???</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="name(.)='number:year'">
+ <xsl:choose>
+ <xsl:when test="@number:style='long'">YYYY</xsl:when>
+ <xsl:otherwise>YY</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="name(.)='number:month'">
+ <xsl:choose>
+ <xsl:when test="@number:style='long' and @number:textual='true'">MMMM</xsl:when>
+ <xsl:when test="not(@number:style='long') and @number:textual='true'">MMM</xsl:when>
+ <xsl:when test="@number:style='long' and not(@number:textual)">MM</xsl:when>
+ <xsl:when test="not(@number:style='long') and not(@number:textual)">M</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="name(.)='number:day'">
+ <xsl:choose>
+ <xsl:when test="@number:style='long'">DD</xsl:when>
+ <xsl:otherwise>D</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="name(.)='number:day-of-week'">
+ <xsl:choose>
+ <xsl:when test="@number:style='long'">NNNN</xsl:when>
+ <xsl:otherwise>NNN</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="name(.)='number:quarter'">
+ <xsl:choose>
+ <xsl:when test="@number:style='long'">QQ</xsl:when>
+ <xsl:otherwise>Q</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="name(.)='number:hours'">
+ <xsl:choose>
+ <xsl:when test="@number:style='long' and ../@number:truncate-on-overflow='false'">[HH]</xsl:when>
+ <xsl:when test="@number:style='long'">HH</xsl:when>
+ <xsl:otherwise>H</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="name(.)='number:minutes'">
+ <xsl:choose>
+ <xsl:when test="@number:style='long'">MM</xsl:when>
+ <xsl:otherwise>M</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="name(.)='number:seconds'">
+ <xsl:choose>
+ <xsl:when test="@number:style='long' and @number:decimal-places='2'">SS.00</xsl:when>
+ <xsl:when test="@number:style='long'">SS</xsl:when>
+ <xsl:otherwise>S</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="name(.)='number:am-pm'">AM/PM</xsl:when>
+ <xsl:when test="name(.)='number:week-of-year'">
+ <xsl:choose>
+ <xsl:when test="@number:style='long'">WW</xsl:when>
+ <xsl:otherwise>WW</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="general-color-format">
+ <xsl:choose>
+ <xsl:when test="@fo:color='#000000'">[Black]</xsl:when>
+ <xsl:when test="@fo:color='#0000ff'">[Blue]</xsl:when>
+ <xsl:when test="@fo:color='#00ffff'">[Cyan]</xsl:when>
+ <xsl:when test="@fo:color='#00ff00'">[Green]</xsl:when>
+ <xsl:when test="@fo:color='#ff00ff'">[Magenta]</xsl:when>
+ <xsl:when test="@fo:color='#ff0000'">[Red]</xsl:when>
+ <xsl:when test="@fo:color='#ffffff'">[White]</xsl:when>
+ <xsl:when test="@fo:color='#ffff00'">[Yellow]</xsl:when>
+ <xsl:otherwise>[Black]</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="general-currency-format">
+ <xsl:choose>
+ <xsl:when test="text()='¥' and @number:language='zh' and @number:country='CN'">[$¥-804]</xsl:when>
+ <xsl:when test="text()='$' and @number:language='en' and @number:country='US'">[$$-409]</xsl:when>
+ <xsl:when test="text()='$' and @number:language='es' and @number:country='AR'">[$$-2C0A]</xsl:when>
+ <xsl:when test="text()='$' and @number:language='fr' and @number:country='CA'">[$$-C0C]</xsl:when>
+ <xsl:when test="text()='CNY'">[$CNY]</xsl:when>
+ <xsl:when test="text()='AFA'">[$AFA]</xsl:when>
+ <xsl:when test="text()='CCC'">CCC</xsl:when>
+ <xsl:otherwise>¥</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="element-attribute">
+ <xsl:if test="@number:transliteration-format='一' and @number:transliteration-style='short'">[NatNum1]</xsl:if>
+ <xsl:if test="@number:transliteration-format='一' and @number:transliteration-style='medium'">[NatNum7]</xsl:if>
+ <xsl:if test="@number:transliteration-format='一' and @number:transliteration-style='long'">[NatNum4]</xsl:if>
+ <xsl:if test="@number:transliteration-format='壹' and @number:transliteration-style='short'">[NatNum2]</xsl:if>
+ <xsl:if test="@number:transliteration-format='壹' and @number:transliteration-style='medium'">[NatNum8]</xsl:if>
+ <xsl:if test="@number:transliteration-format='壹' and @number:transliteration-style='long'">[NatNum5]</xsl:if>
+ <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='short'">[NatNum3]</xsl:if>
+ <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='medium'">[NatNum0]</xsl:if>
+ <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='long'">[NatNum6]</xsl:if>
+ <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='short'">[NatNum0]</xsl:if>
+ <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='medium'">[NatNum0]</xsl:if>
+ <xsl:if test="@number:transliteration-format='1' and @number:transliteration-style='long'">[NatNum0]</xsl:if>
+ <xsl:if test="@number:transliteration-language='zh' and @number:transliteration-country='CN'">[$-804]</xsl:if>
+ </xsl:template>
+ <!--RedOffice comment (Zengjh) end-->
+ <!--huangzf0715-->
+ <xsl:template name="Alignment">
+ <xsl:param name="styleProperties"/>
+ <xsl:if test="($styleProperties/@fo:text-align) or ($styleProperties/@style:vertical-align) or ($styleProperties/@fo:wrap-option) or($styleProperties/@fo:margin-left) or ($styleProperties/@style:rotation-angle) or ($styleProperties/@style:direction)">
+ <xsl:element name="表:对齐格式">
+ <xsl:attribute name="uof:locID">s0114</xsl:attribute>
+ <xsl:if test="$styleProperties/@fo:margin-left">
+ <xsl:attribute name="表:缩进"><xsl:variable name="margin"><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$styleProperties/@fo:margin-left"/><xsl:with-param name="rounding-factor" select="1"/></xsl:call-template></xsl:variable><xsl:value-of select="number($margin) div 10"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="表:水平对齐方式">
+ <xsl:attribute name="uof:locID">s0115</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@fo:text-align">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@fo:text-align = 'center'">center</xsl:when>
+ <xsl:when test="$styleProperties/@fo:text-align = 'end'">right</xsl:when>
+ <xsl:when test="$styleProperties/@fo:text-align = 'justify'">justify</xsl:when>
+ <xsl:when test="$styleProperties/@fo:text-align = 'start'">left</xsl:when>
+ <xsl:otherwise>fill</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>general</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="($styleProperties/@style:vertical-align) or ($styleProperties/@fo:vertical-align)">
+ <xsl:element name="表:垂直对齐方式">
+ <xsl:attribute name="uof:locID">s0116</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@fo:vertical-align = 'top'">top</xsl:when>
+ <xsl:when test="$styleProperties/@fo:vertical-align = 'bottom'">bottom</xsl:when>
+ <xsl:when test="$styleProperties/@fo:vertical-align = 'middle'">center</xsl:when>
+ <xsl:when test="$styleProperties/@fo:vertical-align = 'justify'">justify</xsl:when>
+ <xsl:when test="$styleProperties/@fo:vertical-align = 'top'">top</xsl:when>
+ <xsl:otherwise>distributed</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="表:文字方向">
+ <xsl:attribute name="uof:locID">s0118</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:direction = 'ttb'">vertical</xsl:when>
+ <xsl:otherwise>horizontal</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="$styleProperties/@style:rotation-angle">
+ <xsl:element name="表:文字旋转角度">
+ <xsl:attribute name="uof:locID">s0119</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:rotation-angle &gt; 90">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:rotation-angle &gt;= 270">
+ <xsl:value-of select="$styleProperties/@style:rotation-angle - 360"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$styleProperties/@style:rotation-angle - 180"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$styleProperties/@style:rotation-angle &lt; -90">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:rotation-angle &lt;= -270">
+ <xsl:value-of select="$styleProperties/@style:rotation-angle + 360"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$styleProperties/@style:rotation-angle + 180"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$styleProperties/@style:rotation-angle"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@fo:wrap-option = 'wrap'">
+ <xsl:element name="表:自动换行">
+ <xsl:attribute name="uof:locID">s0120</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="表:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:shrink-to-fit">
+ <xsl:element name="表:缩小字体填充">
+ <xsl:attribute name="uof:locID">s0121</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="表:值"><xsl:value-of select="$styleProperties/@style:shrink-to-fit"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="Font">
+ <xsl:param name="styleProperties"/>
+ <!--xsl:if test="(style:text-properties/@fo:font-weight) or (style:text-properties/@fo:color) or ($styleProperties/@style:font-name) or ($styleProperties/@fo:font-style) or ($styleProperties/@style:text-outline) or ($styleProperties/@style:text-shadow) or ($styleProperties/@style:font-size) or ($styleProperties/@style:text-crossing-out) or ($styleProperties/@style:text-underline) or ($styleProperties/@style:text-underline-style) or ($styleProperties/@style:text-position)"-->
+ <xsl:if test="not(@style:name='Default')">
+ <xsl:element name="表:字体格式">
+ <xsl:attribute name="uof:locID">s0113</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:if test="$styleProperties/@fo:font-weight or $styleProperties/@style:font-weight-asian">
+ <xsl:element name="字:粗体">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="$styleProperties/@style:font-weight-asian='bold' or $styleProperties/@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0089</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@fo:font-style or $styleProperties/@style:font-style-asian">
+ <xsl:element name="字:斜体">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="$styleProperties/@fo:font-style='italic' or $styleProperties/@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0090</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:text-outline = 'true'">
+ <字:空心 uof:locID="t0098" uof:attrList="值" 字:值="true"/>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:text-shadow = 'shadow'">
+ <字:阴影 uof:locID="t0100" uof:attrList="值" 字:值="true"/>
+ </xsl:if>
+ <xsl:if test="(style:text-properties/@style:text-underline-style) and ($styleProperties/@style:text-underline-style != 'none')">
+ <xsl:element name="字:下划线">
+ <xsl:attribute name="uof:locID">t0095</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 颜色 字下划线</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"/></xsl:attribute>
+ <xsl:attribute name="字:字下划线">true</xsl:attribute>
+ <xsl:if test="$styleProperties/@style:text-underline-color">
+ <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="$styleProperties/@style:text-underline-color='font-color'">auto</xsl:when><xsl:otherwise><xsl:value-of select="$styleProperties/@style:text-underline-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:text-line-through-style and not($styleProperties/@style:text-line-through-style='none')">
+ <xsl:element name="字:删除线">
+ <xsl:attribute name="uof:locID">t0094</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:delete线型类型"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:text-emphasize">
+ <xsl:element name="字:着重号">
+ <xsl:attribute name="uof:locID">t0096</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 颜色 字着重号</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:text-emphasize='none'">
+ <xsl:attribute name="字:字着重号">false</xsl:attribute>
+ <xsl:attribute name="字:类型">none</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:字着重号">true</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:着重号类型"><xsl:with-param name="te" select="$styleProperties/@style:text-emphasize"/></xsl:call-template></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="$styleProperties/@fo:color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select="$styleProperties/@fo:color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:text-position">
+ <xsl:element name="字:上下标">
+ <xsl:choose>
+ <xsl:when test="substring-before($styleProperties/@style:text-position, '% ') &gt; 0">
+ <xsl:attribute name="字:上下标">sup</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:上下标">sub</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:字体">
+ <xsl:attribute name="uof:locID">t0088</xsl:attribute>
+ <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
+ <xsl:if test="$styleProperties/@style:font-name-asian">
+ <xsl:attribute name="字:中文字体引用"><xsl:value-of select="translate($styleProperties/@style:font-name-asian,' ','_')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@style:font-name or $styleProperties/@fo:font-family">
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@style:font-name">
+ <xsl:attribute name="字:西文字体引用"><xsl:value-of select="translate($styleProperties/@style:font-name,' ','_')"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:西文字体引用"><xsl:value-of select="translate($styleProperties/@fo:font-family,' ','_')"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="$styleProperties/@fo:color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select="$styleProperties/@fo:color"/></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@fo:font-size">
+ <xsl:attribute name="字:字号"><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$styleProperties/@fo:font-size"/></xsl:call-template></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$styleProperties/@style:font-size-asian">
+ <xsl:attribute name="字:字号"><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$styleProperties/@style:font-size-asian"/></xsl:call-template></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$styleProperties/@style:font-size-complex">
+ <xsl:attribute name="字:字号"><xsl:call-template name="convert2pt"><xsl:with-param name="value" select="$styleProperties/@style:font-size-complex"/></xsl:call-template></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="style:text-properties/@style:font-relief">
+ <xsl:element name="字:浮雕">
+ <xsl:attribute name="uof:locID">t0099</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@style:font-relief='embossed'">emboss</xsl:when><xsl:when test="style:text-properties/@style:font-relief='engraved'">engrave</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:text-transform or style:text-properties/@fo:font-variant">
+ <xsl:element name="字:醒目字体">
+ <xsl:attribute name="uof:locID">t0101</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@fo:text-transform='uppercase'">uppercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='lowercase'">lowercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='capitalize'">capital</xsl:when><xsl:when test="style:text-properties/@fo:font-variant='small-caps'">small-caps</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:text-shadow">
+ <xsl:element name="字:阴影">
+ <xsl:attribute name="uof:locID">t0100</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="Border">
+ <xsl:param name="styleProperties"/>
+ <xsl:if test="style:table-cell-properties/@fo:border and not($styleProperties/@fo:border-top or $styleProperties/@fo:border-left or $styleProperties/@fo:border-bottom or $styleProperties/@fo:border-right)">
+ <xsl:element name="表:边框">
+ <xsl:attribute name="uof:locID">s0022</xsl:attribute>
+ <xsl:variable name="border">
+ <xsl:value-of select="$styleProperties/@fo:border"/>
+ </xsl:variable>
+ <xsl:element name="uof:左">
+ <xsl:attribute name="uof:locID">u0057</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$border!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="contains(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),'-')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:element name="uof:上">
- <xsl:attribute name="uof:locID">u0058</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:if test="$border!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="contains(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),'-')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:element name="uof:上">
+ <xsl:attribute name="uof:locID">u0058</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$border!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="contains(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),'-')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:element name="uof:右">
- <xsl:attribute name="uof:locID">u0059</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:if test="$border!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="contains(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),'-')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:element name="uof:右">
+ <xsl:attribute name="uof:locID">u0059</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$border!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="substring-before(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),$uofUnit) &gt;0 or contains(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),'+')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:element name="uof:下">
- <xsl:attribute name="uof:locID">u0060</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:if test="$border!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="substring-before(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),$uofUnit) &gt;0 or contains(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),'+')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:element name="uof:下">
+ <xsl:attribute name="uof:locID">u0060</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$border!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="substring-before(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),$uofUnit) &gt;0 or contains(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),'+')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:if test="$styleProperties/@style:diagonal-bl-tr">
- <xsl:element name="uof:对角线1">
- <xsl:attribute name="uof:locID">u0061</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
- <xsl:variable name="border-width">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-bl-tr, ' ')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
- <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
- <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style='solid'">single</xsl:when><xsl:when test="$border-style='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:value-of select="$border-width"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:choose><xsl:when test="$border-color"><xsl:value-of select="$border-color"/></xsl:when><xsl:otherwise>Automatic</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <!--end of uo:对角线1-->
- <!--xsl:if test="$styleProperties/@fo:border and $styleProperties/@style:diagonal-tl-br"-->
- <xsl:if test="$styleProperties/@style:diagonal-tl-br">
- <xsl:element name="uof:对角线2">
- <xsl:attribute name="uof:locID">u0062</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
- <xsl:variable name="border-width">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-tl-br, ' ')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
- <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
- <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style='solid'">single</xsl:when><xsl:when test="$border-style='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:value-of select="$border-width"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:choose><xsl:when test="$border-color"><xsl:value-of select="$border-color"/></xsl:when><xsl:otherwise>Automatic</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <!--end of uo:对角线2-->
- </xsl:element>
- </xsl:if>
- <!--end of fo:border-->
- <xsl:if test="$styleProperties/@fo:border-top or $styleProperties/@fo:border-left or $styleProperties/@fo:border-bottom or $styleProperties/@fo:border-right or $styleProperties/@style:diagonal-tl-br or $styleProperties/@style:diagonal-bl-tr">
- <xsl:element name="表:边框">
- <xsl:attribute name="uof:locID">s0022</xsl:attribute>
- <xsl:if test="$styleProperties/@fo:border-left or $styleProperties/@style:shadow">
- <xsl:element name="uof:左">
- <xsl:attribute name="uof:locID">u0057</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
- <xsl:variable name="borderleft">
- <xsl:value-of select="$styleProperties/@fo:border-left"/>
- </xsl:variable>
- <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$borderleft!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($borderleft,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($borderleft,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$borderleft!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($borderleft,' '),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($borderleft,' '),' ')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="contains(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),'-')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <!--end of uof:左-->
- <xsl:if test="$styleProperties/@fo:border-top or $styleProperties/@style:shadow">
- <xsl:element name="uof:上">
- <xsl:attribute name="uof:locID">u0058</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
- <xsl:variable name="bordertop">
- <xsl:value-of select="$styleProperties/@fo:border-top"/>
- </xsl:variable>
- <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$bordertop!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($bordertop,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($bordertop,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$bordertop!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($bordertop,' '),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($bordertop,' '),' ')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="contains(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),'-')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <!--end of uof:上-->
- <xsl:if test="$styleProperties/@fo:border-right or $styleProperties/@style:shadow">
- <xsl:element name="uof:右">
- <xsl:attribute name="uof:locID">u0059</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
- <xsl:variable name="borderright">
- <xsl:value-of select="$styleProperties/@fo:border-right"/>
- </xsl:variable>
- <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$borderright!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($borderright,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($borderright,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$borderright!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($borderright,' '),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($borderright,' '),' ')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="substring-before(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),$uofUnit)&gt;0 or contains(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),'+')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <!--end of uof:右-->
- <xsl:if test="$styleProperties/@fo:border-bottom or $styleProperties/@style:shadow">
- <xsl:element name="uof:下">
- <xsl:attribute name="uof:locID">u0060</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
- <xsl:variable name="borderbottom">
- <xsl:value-of select="$styleProperties/@fo:border-bottom"/>
- </xsl:variable>
- <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$borderbottom!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($borderbottom,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($borderbottom,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$borderbottom!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($borderbottom,' '),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($borderbottom,' '),' ')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="substring-before(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),$uofUnit) &gt;0 or contains(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),'+')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <!--end of uof:下-->
- <xsl:if test="$styleProperties/@style:diagonal-bl-tr">
- <xsl:element name="uof:对角线1">
- <xsl:attribute name="uof:locID">u0061</xsl:attribute>
- <xsl:attribute name="attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
- <xsl:variable name="border-width">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-bl-tr, ' ')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
- <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
- <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style='solid'">single</xsl:when><xsl:when test="$border-style='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:value-of select="$border-width"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:choose><xsl:when test="$border-color"><xsl:value-of select="$border-color"/></xsl:when><xsl:otherwise>Automatic</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <!--end of uo:对角线1-->
- <xsl:if test="$styleProperties/@style:diagonal-tl-br">
- <xsl:element name="uof:对角线2">
- <xsl:attribute name="uof:locID">u0062</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
- <xsl:variable name="border-width">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-tl-br, ' ')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
- <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
- <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style='solid'">single</xsl:when><xsl:when test="$border-style='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:value-of select="$border-width"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:choose><xsl:when test="$border-color"><xsl:value-of select="$border-color"/></xsl:when><xsl:otherwise>Automatic</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <!--end of uo:对角线2-->
- </xsl:element>
- <!--end of 表:边框-->
- </xsl:if>
- <!--chenjh 边框 E -->
- </xsl:template>
- <xsl:template name="border-attributes">
- <xsl:param name="border_properties"/>
- <xsl:attribute name="attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
- <xsl:variable name="border-width">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="substring-before($border_properties, ' ')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="border-style" select="substring-before(substring-after($border_properties, ' '), ' ')"/>
- <xsl:variable name="border-color" select="substring-after(substring-after($border_properties, ' '), ' ')"/>
- <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:otherwise><xsl:value-of select="$border-style"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:value-of select="$border-width"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:choose><xsl:when test="$border-color"><xsl:value-of select="$border-color"/></xsl:when><xsl:otherwise>Automatic</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:template>
- <xsl:template name="Interior">
- <xsl:param name="styleProperties"/>
- <xsl:if test="style:table-cell-properties/@fo:background-color and not($styleProperties/@fo:background-color = 'transparent')">
- <xsl:element name="表:填充">
- <!--chenp modify redo0000047-->
- <xsl:attribute name="uof:locID">s0058</xsl:attribute>
- <!--0821 by lil -->
- <xsl:choose>
- <xsl:when test="$styleProperties/@fo:background-color">
- <xsl:element name="图:颜色">
- <xsl:attribute name="uof:locID">g0034</xsl:attribute>
- <xsl:value-of select="$styleProperties/@fo:background-color"/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="表:图案">
- <xsl:value-of select="' Solid'"/>
- <xsl:attribute name="xsl:lodID">g0036</xsl:attribute>
- <xsl:attribute name="attrList">类型 图形引用 前景色 背景色</xsl:attribute>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- <!--end-->
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <!--chengxz 0621 E-->
- <!--xsl:template name="image">
-
- <xsl:element name="图:图形">
- <xsl:attribute name="图:标识符"><xsl:value-of select="@draw:name"/></xsl:attribute>
- <xsl:attribute name="uof:locID">g0000</xsl:attribute>
- <xsl:attribute name="uof:attrList">层次 标识符 组合列表 其他对象</xsl:attribute>
- <xsl:element name="图:预定义图形">
- <xsl:attribute name="uof:locID">g0005</xsl:attribute>
- <xsl:element name="图:类别">图片</xsl:element>
- <xsl:element name="图:生成软件"><xsl:value-of select="office:binary-data" ></xsl:value-of></xsl:element>
- <xsl:element name="图:属性">
- <xsl:element name="图:宽度"><xsl:value-of select="substring-before(@svg:width,'cm')"/></xsl:element>
- <xsl:element name="图:高度"><xsl:value-of select="substring-before(@svg:height,'cm')"/></xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:template-->
- <!--1新增内容-->
- <xsl:key match="/office:document/office:automatic-styles/style:style | /office:document/office:styles/style:style" name="graphicset" use="@style:name"/>
- <xsl:template name="draw">
- <xsl:param name="nodename1"/>
- <xsl:choose>
- <xsl:when test="substring-after($nodename1,':') = 'a'">
- <xsl:for-each select="child::*">
- <xsl:call-template name="draw">
- <xsl:with-param name="nodename">
- <xsl:value-of select="name()"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="substring-after($nodename1,':') = 'g'">
- <xsl:call-template name="draw:g"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="creategraphicstyles"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="draw:g">
- <!--xsl:variable name="picnumber1">
- <xsl:value-of select="count(preceding::draw:g)"/>
- </xsl:variable>
- <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
- <xsl:attribute name="图:标识符"><xsl:value-of select="concat(@draw:style-name,'_',$picnumber1)"/></xsl:attribute>
- <xsl:attribute name="图:层次"><xsl:value-of select="@draw:z-index"/></xsl:attribute>
- <xsl:attribute name="图:组合列表"><xsl:for-each select="child::*[1]"><xsl:variable name="node1"><xsl:value-of select="@draw:style-name"/></xsl:variable><xsl:variable name="picnumber2"><xsl:value-of select="count(preceding::*[@draw:style-name=$node1])"/></xsl:variable><xsl:call-template name="zuheliebiao"><xsl:with-param name="allnode"><xsl:value-of select="concat($node1,'_',$picnumber2)"/></xsl:with-param><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
- </图:图形>
- <xsl:for-each select="child::*">
- <xsl:choose>
- <xsl:when test="name()='draw:g'">
- <xsl:call-template name="draw:g"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="creategraphicstyles"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each-->
- <!--根据新修改的Schema做的修改-->
- <xsl:for-each select="child::*">
- <xsl:choose>
- <xsl:when test="name()='draw:g'">
- <xsl:call-template name="draw:g"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="creategraphicstyles"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:call-template name="creategraphicstyles"/>
- </xsl:template>
- <xsl:template name="zuheliebiao">
- <xsl:param name="allnode"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="../child::*[$pos]">
- <xsl:for-each select="../child::*[$pos]">
- <xsl:variable name="nodepos">
- <!--add by lvxg -->
- <xsl:choose>
- <xsl:when test="./@draw:style-name">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@draw:id"/>
- </xsl:otherwise>
- </xsl:choose>
- <!--end-->
- </xsl:variable>
- <xsl:variable name="picnumber1">
- <xsl:value-of select="count(preceding::*[@draw:style-name=$nodepos])"/>
- </xsl:variable>
- <xsl:variable name="pic-name1">
- <xsl:value-of select="concat($nodepos,'_',$picnumber1)"/>
- </xsl:variable>
- <xsl:variable name="allnode1">
- <xsl:value-of select="concat($allnode,',',$pic-name1)"/>
- </xsl:variable>
- <xsl:call-template name="zuheliebiao">
- <xsl:with-param name="allnode" select="$allnode1"/>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$allnode"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="creategraphicstyles">
- <xsl:variable name="nodename">
- <xsl:value-of select="name()"/>
- </xsl:variable>
- <xsl:variable name="pic-name">
- <xsl:choose>
- <xsl:when test="./@draw:style-name">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:when>
- <xsl:when test="./@table:end-cell-address">
- <xsl:value-of select="@table:end-cell-address"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./@draw:id"/>
- </xsl:otherwise>
- </xsl:choose>
- <!--end -->
- </xsl:variable>
- <xsl:variable name="pic-num">
- <xsl:value-of select="count(/descendant::*[@draw:style-name=$pic-name])"/>
- </xsl:variable>
- <xsl:variable name="picnumber">
- <xsl:value-of select="count(preceding::*[@draw:style-name=$pic-name])"/>
- </xsl:variable>
- <xsl:call-template name="pic-process">
- <xsl:with-param name="pic-name" select="$pic-name"/>
- <xsl:with-param name="nodename" select="$nodename"/>
- <xsl:with-param name="picnumber" select="$picnumber"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template name="pic-process">
- <xsl:param name="pic-name"/>
- <xsl:param name="nodename"/>
- <xsl:param name="picnumber"/>
- <xsl:variable name="aa">
- <xsl:choose>
- <xsl:when test="./@draw:style-name">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:when>
- <xsl:when test="./@table:end-cell-address">
- <xsl:value-of select="@table:end-cell-address"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./@draw:id"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
- <xsl:attribute name="图:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
- <xsl:attribute name="图:层次"><xsl:choose><xsl:when test="name(parent::node())='draw:g'"><xsl:value-of select="position()"/></xsl:when><xsl:when test="@draw:z-index"><xsl:value-of select="@draw:z-index"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:if test="$nodename='draw:g'">
- <xsl:attribute name="图:组合列表"><xsl:for-each select="child::*[1]"><xsl:variable name="node1"><xsl:value-of select="@draw:style-name | @draw:id"/></xsl:variable><xsl:variable name="picnumber2"><xsl:value-of select="count(preceding::*[@draw:style-name=$node1 or @draw:id=$node1])"/></xsl:variable><xsl:call-template name="zuheliebiao"><xsl:with-param name="allnode"><xsl:value-of select="concat($node1,'_',$picnumber2)"/></xsl:with-param><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
- </xsl:if>
- <xsl:if test=".//office:binary-data">
- <xsl:attribute name="图:其他对象"><xsl:choose><xsl:when test="@draw:name"><xsl:value-of select="@draw:name"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:variable name="arrow-sign">
- <xsl:choose>
- <xsl:when test="key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-start or key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-end">
- <xsl:value-of select="'1'"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$nodename='draw:line' or $nodename='draw:rect' or $nodename='draw:circle' or $nodename='draw:polygon' or $nodename='draw:polyline' or $nodename='draw:ellipse' or $nodename='draw:path'or $nodename='draw:g'">
- <图:预定义图形 uof:locID="g0005">
- <图:类别 uof:locID="g0006">
- <xsl:choose>
- <xsl:when test="$nodename='draw:line' and $arrow-sign='1'">62</xsl:when>
- <xsl:when test="$nodename='draw:rect'">11</xsl:when>
- <xsl:when test="$nodename='draw:line'">61</xsl:when>
- <xsl:when test="$nodename='draw:circle'">19</xsl:when>
- <xsl:when test="$nodename='draw:polygon'">65</xsl:when>
- <xsl:when test="$nodename='draw:polyline'">66</xsl:when>
- <xsl:when test="$nodename='draw:ellipse'">19</xsl:when>
- <xsl:when test="$nodename='draw:path'">64</xsl:when>
- <xsl:when test="$nodename='draw:g'">4</xsl:when>
- </xsl:choose>
- </图:类别>
- <图:名称 uof:locID="g0007">
- <xsl:choose>
- <xsl:when test="$nodename='draw:rect'">Rectangle</xsl:when>
- <xsl:when test="$nodename='draw:line'">Line</xsl:when>
- <xsl:when test="$nodename='draw:circle'">Oval</xsl:when>
- <xsl:when test="$nodename='draw:polygon'">Freeform</xsl:when>
- <xsl:when test="$nodename='draw:polyline'">Scribble</xsl:when>
- <xsl:when test="$nodename='draw:ellipse'">Oval</xsl:when>
- <xsl:when test="$nodename='draw:path'">Curve</xsl:when>
- <xsl:when test="$nodename='draw:g'">group</xsl:when>
- </xsl:choose>
- </图:名称>
- <图:生成软件 uof:locID="g0008">PNG</图:生成软件>
- <xsl:if test="./@draw:points or ./@svg:d">
- <图:关键点坐标 uof:locID="g0009" uofattrList="路径">
- <!--xsl:call-template name="draw:points">
+ <xsl:if test="$border!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="substring-before(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),$uofUnit) &gt;0 or contains(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),'+')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test="$styleProperties/@style:diagonal-bl-tr">
+ <xsl:element name="uof:对角线1">
+ <xsl:attribute name="uof:locID">u0061</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:variable name="border-width">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-bl-tr, ' ')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
+ <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
+ <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style='solid'">single</xsl:when><xsl:when test="$border-style='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="$border-width"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:choose><xsl:when test="$border-color"><xsl:value-of select="$border-color"/></xsl:when><xsl:otherwise>Automatic</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <!--end of uo:对角线1-->
+ <!--xsl:if test="$styleProperties/@fo:border and $styleProperties/@style:diagonal-tl-br"-->
+ <xsl:if test="$styleProperties/@style:diagonal-tl-br">
+ <xsl:element name="uof:对角线2">
+ <xsl:attribute name="uof:locID">u0062</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:variable name="border-width">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-tl-br, ' ')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
+ <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
+ <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style='solid'">single</xsl:when><xsl:when test="$border-style='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="$border-width"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:choose><xsl:when test="$border-color"><xsl:value-of select="$border-color"/></xsl:when><xsl:otherwise>Automatic</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <!--end of uo:对角线2-->
+ </xsl:element>
+ </xsl:if>
+ <!--end of fo:border-->
+ <xsl:if test="$styleProperties/@fo:border-top or $styleProperties/@fo:border-left or $styleProperties/@fo:border-bottom or $styleProperties/@fo:border-right or $styleProperties/@style:diagonal-tl-br or $styleProperties/@style:diagonal-bl-tr">
+ <xsl:element name="表:边框">
+ <xsl:attribute name="uof:locID">s0022</xsl:attribute>
+ <xsl:if test="$styleProperties/@fo:border-left or $styleProperties/@style:shadow">
+ <xsl:element name="uof:左">
+ <xsl:attribute name="uof:locID">u0057</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:variable name="borderleft">
+ <xsl:value-of select="$styleProperties/@fo:border-left"/>
+ </xsl:variable>
+ <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$borderleft!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($borderleft,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($borderleft,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="$borderleft!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($borderleft,' '),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($borderleft,' '),' ')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="contains(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),'-')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <!--end of uof:左-->
+ <xsl:if test="$styleProperties/@fo:border-top or $styleProperties/@style:shadow">
+ <xsl:element name="uof:上">
+ <xsl:attribute name="uof:locID">u0058</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:variable name="bordertop">
+ <xsl:value-of select="$styleProperties/@fo:border-top"/>
+ </xsl:variable>
+ <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$bordertop!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($bordertop,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($bordertop,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="$bordertop!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($bordertop,' '),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($bordertop,' '),' ')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="contains(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),'-')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <!--end of uof:上-->
+ <xsl:if test="$styleProperties/@fo:border-right or $styleProperties/@style:shadow">
+ <xsl:element name="uof:右">
+ <xsl:attribute name="uof:locID">u0059</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:variable name="borderright">
+ <xsl:value-of select="$styleProperties/@fo:border-right"/>
+ </xsl:variable>
+ <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$borderright!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($borderright,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($borderright,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="$borderright!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($borderright,' '),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($borderright,' '),' ')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="substring-before(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),$uofUnit)&gt;0 or contains(substring-before(substring-after($styleProperties/@style:shadow,' '),' '),'+')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <!--end of uof:右-->
+ <xsl:if test="$styleProperties/@fo:border-bottom or $styleProperties/@style:shadow">
+ <xsl:element name="uof:下">
+ <xsl:attribute name="uof:locID">u0060</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:variable name="borderbottom">
+ <xsl:value-of select="$styleProperties/@fo:border-bottom"/>
+ </xsl:variable>
+ <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$borderbottom!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($borderbottom,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($borderbottom,' '),' ')='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="$borderbottom!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($borderbottom,' '),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($borderbottom,' '),' ')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="substring-before(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),$uofUnit) &gt;0 or contains(substring-after(substring-after($styleProperties/@style:shadow,' '),' '),'+')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <!--end of uof:下-->
+ <xsl:if test="$styleProperties/@style:diagonal-bl-tr">
+ <xsl:element name="uof:对角线1">
+ <xsl:attribute name="uof:locID">u0061</xsl:attribute>
+ <xsl:attribute name="attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:variable name="border-width">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-bl-tr, ' ')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
+ <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-bl-tr, ' '), ' ')"/>
+ <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style='solid'">single</xsl:when><xsl:when test="$border-style='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="$border-width"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:choose><xsl:when test="$border-color"><xsl:value-of select="$border-color"/></xsl:when><xsl:otherwise>Automatic</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <!--end of uo:对角线1-->
+ <xsl:if test="$styleProperties/@style:diagonal-tl-br">
+ <xsl:element name="uof:对角线2">
+ <xsl:attribute name="uof:locID">u0062</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:variable name="border-width">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="substring-before($styleProperties/@style:diagonal-tl-br, ' ')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="border-style" select="substring-before(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
+ <xsl:variable name="border-color" select="substring-after(substring-after($styleProperties/@style:diagonal-tl-br, ' '), ' ')"/>
+ <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:when test="$border-style='solid'">single</xsl:when><xsl:when test="$border-style='double'">double</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="$border-width"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:choose><xsl:when test="$border-color"><xsl:value-of select="$border-color"/></xsl:when><xsl:otherwise>Automatic</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <!--end of uo:对角线2-->
+ </xsl:element>
+ <!--end of 表:边框-->
+ </xsl:if>
+ <!--chenjh 边框 E -->
+ </xsl:template>
+ <xsl:template name="border-attributes">
+ <xsl:param name="border_properties"/>
+ <xsl:attribute name="attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:variable name="border-width">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="substring-before($border_properties, ' ')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="border-style" select="substring-before(substring-after($border_properties, ' '), ' ')"/>
+ <xsl:variable name="border-color" select="substring-after(substring-after($border_properties, ' '), ' ')"/>
+ <xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border-style = 'none'">none</xsl:when><xsl:otherwise><xsl:value-of select="$border-style"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="$border-width"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:choose><xsl:when test="$border-color"><xsl:value-of select="$border-color"/></xsl:when><xsl:otherwise>Automatic</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:template>
+ <xsl:template name="Interior">
+ <xsl:param name="styleProperties"/>
+ <xsl:if test="style:table-cell-properties/@fo:background-color and not($styleProperties/@fo:background-color = 'transparent')">
+ <xsl:element name="表:填充">
+ <!--chenp modify redo0000047-->
+ <xsl:attribute name="uof:locID">s0058</xsl:attribute>
+ <!--0821 by lil -->
+ <xsl:choose>
+ <xsl:when test="$styleProperties/@fo:background-color">
+ <xsl:element name="图:颜色">
+ <xsl:attribute name="uof:locID">g0034</xsl:attribute>
+ <xsl:value-of select="$styleProperties/@fo:background-color"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="表:图案">
+ <xsl:value-of select="' Solid'"/>
+ <xsl:attribute name="xsl:lodID">g0036</xsl:attribute>
+ <xsl:attribute name="attrList">类型 图形引用 前景色 背景色</xsl:attribute>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!--end-->
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <!--chengxz 0621 E-->
+ <!--xsl:template name="image">
+
+ <xsl:element name="图:图形">
+ <xsl:attribute name="图:标识符"><xsl:value-of select="@draw:name"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">g0000</xsl:attribute>
+ <xsl:attribute name="uof:attrList">层次 标识符 组合列表 其他对象</xsl:attribute>
+ <xsl:element name="图:预定义图形">
+ <xsl:attribute name="uof:locID">g0005</xsl:attribute>
+ <xsl:element name="图:类别">图片</xsl:element>
+ <xsl:element name="图:生成软件"><xsl:value-of select="office:binary-data" ></xsl:value-of></xsl:element>
+ <xsl:element name="图:属性">
+ <xsl:element name="图:宽度"><xsl:value-of select="substring-before(@svg:width,'cm')"/></xsl:element>
+ <xsl:element name="图:高度"><xsl:value-of select="substring-before(@svg:height,'cm')"/></xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template-->
+ <!--1新增内容-->
+ <xsl:key match="/office:document/office:automatic-styles/style:style | /office:document/office:styles/style:style" name="graphicset" use="@style:name"/>
+ <xsl:template name="draw">
+ <xsl:param name="nodename1"/>
+ <xsl:choose>
+ <xsl:when test="substring-after($nodename1,':') = 'a'">
+ <xsl:for-each select="child::*">
+ <xsl:call-template name="draw">
+ <xsl:with-param name="nodename">
+ <xsl:value-of select="name()"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="substring-after($nodename1,':') = 'g'">
+ <xsl:call-template name="draw:g"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="creategraphicstyles"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="draw:g">
+ <!--xsl:variable name="picnumber1">
+ <xsl:value-of select="count(preceding::draw:g)"/>
+ </xsl:variable>
+ <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
+ <xsl:attribute name="图:标识符"><xsl:value-of select="concat(@draw:style-name,'_',$picnumber1)"/></xsl:attribute>
+ <xsl:attribute name="图:层次"><xsl:value-of select="@draw:z-index"/></xsl:attribute>
+ <xsl:attribute name="图:组合列表"><xsl:for-each select="child::*[1]"><xsl:variable name="node1"><xsl:value-of select="@draw:style-name"/></xsl:variable><xsl:variable name="picnumber2"><xsl:value-of select="count(preceding::*[@draw:style-name=$node1])"/></xsl:variable><xsl:call-template name="zuheliebiao"><xsl:with-param name="allnode"><xsl:value-of select="concat($node1,'_',$picnumber2)"/></xsl:with-param><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
+ </图:图形>
+ <xsl:for-each select="child::*">
+ <xsl:choose>
+ <xsl:when test="name()='draw:g'">
+ <xsl:call-template name="draw:g"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="creategraphicstyles"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each-->
+ <!--根据新修改的Schema做的修改-->
+ <xsl:for-each select="child::*">
+ <xsl:choose>
+ <xsl:when test="name()='draw:g'">
+ <xsl:call-template name="draw:g"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="creategraphicstyles"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ <xsl:call-template name="creategraphicstyles"/>
+ </xsl:template>
+ <xsl:template name="zuheliebiao">
+ <xsl:param name="allnode"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="../child::*[$pos]">
+ <xsl:for-each select="../child::*[$pos]">
+ <xsl:variable name="nodepos">
+ <!--add by lvxg -->
+ <xsl:choose>
+ <xsl:when test="./@draw:style-name">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@draw:id"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!--end-->
+ </xsl:variable>
+ <xsl:variable name="picnumber1">
+ <xsl:value-of select="count(preceding::*[@draw:style-name=$nodepos])"/>
+ </xsl:variable>
+ <xsl:variable name="pic-name1">
+ <xsl:value-of select="concat($nodepos,'_',$picnumber1)"/>
+ </xsl:variable>
+ <xsl:variable name="allnode1">
+ <xsl:value-of select="concat($allnode,',',$pic-name1)"/>
+ </xsl:variable>
+ <xsl:call-template name="zuheliebiao">
+ <xsl:with-param name="allnode" select="$allnode1"/>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$allnode"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="creategraphicstyles">
+ <xsl:variable name="nodename">
+ <xsl:value-of select="name()"/>
+ </xsl:variable>
+ <xsl:variable name="pic-name">
+ <xsl:choose>
+ <xsl:when test="./@draw:style-name">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:when>
+ <xsl:when test="./@table:end-cell-address">
+ <xsl:value-of select="@table:end-cell-address"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./@draw:id"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!--end -->
+ </xsl:variable>
+ <xsl:variable name="pic-num">
+ <xsl:value-of select="count(/descendant::*[@draw:style-name=$pic-name])"/>
+ </xsl:variable>
+ <xsl:variable name="picnumber">
+ <xsl:value-of select="count(preceding::*[@draw:style-name=$pic-name])"/>
+ </xsl:variable>
+ <xsl:call-template name="pic-process">
+ <xsl:with-param name="pic-name" select="$pic-name"/>
+ <xsl:with-param name="nodename" select="$nodename"/>
+ <xsl:with-param name="picnumber" select="$picnumber"/>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template name="pic-process">
+ <xsl:param name="pic-name"/>
+ <xsl:param name="nodename"/>
+ <xsl:param name="picnumber"/>
+ <xsl:variable name="aa">
+ <xsl:choose>
+ <xsl:when test="./@draw:style-name">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:when>
+ <xsl:when test="./@table:end-cell-address">
+ <xsl:value-of select="@table:end-cell-address"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./@draw:id"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
+ <xsl:attribute name="图:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
+ <xsl:attribute name="图:层次"><xsl:choose><xsl:when test="name(parent::node())='draw:g'"><xsl:value-of select="position()"/></xsl:when><xsl:when test="@draw:z-index"><xsl:value-of select="@draw:z-index"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:if test="$nodename='draw:g'">
+ <xsl:attribute name="图:组合列表"><xsl:for-each select="child::*[1]"><xsl:variable name="node1"><xsl:value-of select="@draw:style-name | @draw:id"/></xsl:variable><xsl:variable name="picnumber2"><xsl:value-of select="count(preceding::*[@draw:style-name=$node1 or @draw:id=$node1])"/></xsl:variable><xsl:call-template name="zuheliebiao"><xsl:with-param name="allnode"><xsl:value-of select="concat($node1,'_',$picnumber2)"/></xsl:with-param><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
+ </xsl:if>
+ <xsl:if test=".//office:binary-data">
+ <xsl:attribute name="图:其他对象"><xsl:choose><xsl:when test="@draw:name"><xsl:value-of select="@draw:name"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="arrow-sign">
+ <xsl:choose>
+ <xsl:when test="key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-start or key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-end">
+ <xsl:value-of select="'1'"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$nodename='draw:line' or $nodename='draw:rect' or $nodename='draw:circle' or $nodename='draw:polygon' or $nodename='draw:polyline' or $nodename='draw:ellipse' or $nodename='draw:path'or $nodename='draw:g'">
+ <图:预定义图形 uof:locID="g0005">
+ <图:类别 uof:locID="g0006">
+ <xsl:choose>
+ <xsl:when test="$nodename='draw:line' and $arrow-sign='1'">62</xsl:when>
+ <xsl:when test="$nodename='draw:rect'">11</xsl:when>
+ <xsl:when test="$nodename='draw:line'">61</xsl:when>
+ <xsl:when test="$nodename='draw:circle'">19</xsl:when>
+ <xsl:when test="$nodename='draw:polygon'">65</xsl:when>
+ <xsl:when test="$nodename='draw:polyline'">66</xsl:when>
+ <xsl:when test="$nodename='draw:ellipse'">19</xsl:when>
+ <xsl:when test="$nodename='draw:path'">64</xsl:when>
+ <xsl:when test="$nodename='draw:g'">4</xsl:when>
+ </xsl:choose>
+ </图:类别>
+ <图:名称 uof:locID="g0007">
+ <xsl:choose>
+ <xsl:when test="$nodename='draw:rect'">Rectangle</xsl:when>
+ <xsl:when test="$nodename='draw:line'">Line</xsl:when>
+ <xsl:when test="$nodename='draw:circle'">Oval</xsl:when>
+ <xsl:when test="$nodename='draw:polygon'">Freeform</xsl:when>
+ <xsl:when test="$nodename='draw:polyline'">Scribble</xsl:when>
+ <xsl:when test="$nodename='draw:ellipse'">Oval</xsl:when>
+ <xsl:when test="$nodename='draw:path'">Curve</xsl:when>
+ <xsl:when test="$nodename='draw:g'">group</xsl:when>
+ </xsl:choose>
+ </图:名称>
+ <图:生成软件 uof:locID="g0008">PNG</图:生成软件>
+ <xsl:if test="./@draw:points or ./@svg:d">
+ <图:关键点坐标 uof:locID="g0009" uofattrList="路径">
+ <!--xsl:call-template name="draw:points">
<xsl:with-param name="point" select="./@draw:points"/>
</xsl:call-template-->
- <xsl:attribute name="图:路径"><xsl:choose><xsl:when test="@svg:d"><xsl:value-of select="@svg:d"/></xsl:when><xsl:when test="@draw:points"><xsl:call-template name="draw:points"><xsl:with-param name="point" select="@draw:points"/><xsl:with-param name="lujing"/></xsl:call-template></xsl:when></xsl:choose></xsl:attribute>
- </图:关键点坐标>
- </xsl:if>
- <图:属性 uof:locID="g0011">
- <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$aa]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$aa]) ">
- <xsl:call-template name="graphicattr"/>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="@svg:x1">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- <xsl:when test="@svg:x">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- <xsl:when test="@svg:width">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- </xsl:choose>
- <图:旋转角度 uof:locID="g0025">
- <xsl:choose>
- <xsl:when test="@draw:transform">
- <xsl:variable name="rotate-angle">
- <xsl:value-of select="@draw:transform"/>
- </xsl:variable>
- <xsl:variable name="rotate-temp">
- <xsl:value-of select="substring-before(substring-after($rotate-angle,'rotate ('),')')"/>
- </xsl:variable>
- <xsl:value-of select="($rotate-temp * 360) div (2 * 3.14159265)"/>
- </xsl:when>
- <xsl:otherwise>0.0</xsl:otherwise>
- </xsl:choose>
- </图:旋转角度>
- <图:X-缩放比例 uof:locID="g0026">1</图:X-缩放比例>
- <图:Y-缩放比例 uof:locID="g0027">1</图:Y-缩放比例>
- <图:锁定纵横比 uof:locID="g0028">0</图:锁定纵横比>
- <图:相对原始比例 uof:locID="g0029">1</图:相对原始比例>
- <图:打印对象 uof:locID="g0032">true</图:打印对象>
- <图:Web文字 uof:locID="g0033"/>
- <!--0820 by lil -->
- </图:属性>
- </图:预定义图形>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="string(.//text:p)">
- <图:文本内容 uof:locID="g0002" uof:attrList="文本框 左边距 右边距 上边距 下边距 水平对齐 垂直对齐 文字排列方向 自动换行 大小适应文字 前一链接 后一链接">
- <xsl:if test="$nodename='draw:text-box'">
- <xsl:attribute name="图:文本框">true</xsl:attribute>
- <xsl:if test="./@draw:name = /office:document/office:body
+ <xsl:attribute name="图:路径"><xsl:choose><xsl:when test="@svg:d"><xsl:value-of select="@svg:d"/></xsl:when><xsl:when test="@draw:points"><xsl:call-template name="draw:points"><xsl:with-param name="point" select="@draw:points"/><xsl:with-param name="lujing"/></xsl:call-template></xsl:when></xsl:choose></xsl:attribute>
+ </图:关键点坐标>
+ </xsl:if>
+ <图:属性 uof:locID="g0011">
+ <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$aa]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$aa]) ">
+ <xsl:call-template name="graphicattr"/>
+ </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="@svg:x1">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ <xsl:when test="@svg:x">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ <xsl:when test="@svg:width">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ </xsl:choose>
+ <图:旋转角度 uof:locID="g0025">
+ <xsl:choose>
+ <xsl:when test="@draw:transform">
+ <xsl:variable name="rotate-angle">
+ <xsl:value-of select="@draw:transform"/>
+ </xsl:variable>
+ <xsl:variable name="rotate-temp">
+ <xsl:value-of select="substring-before(substring-after($rotate-angle,'rotate ('),')')"/>
+ </xsl:variable>
+ <xsl:value-of select="($rotate-temp * 360) div (2 * 3.14159265)"/>
+ </xsl:when>
+ <xsl:otherwise>0.0</xsl:otherwise>
+ </xsl:choose>
+ </图:旋转角度>
+ <图:X-缩放比例 uof:locID="g0026">1</图:X-缩放比例>
+ <图:Y-缩放比例 uof:locID="g0027">1</图:Y-缩放比例>
+ <图:锁定纵横比 uof:locID="g0028">0</图:锁定纵横比>
+ <图:相对原始比例 uof:locID="g0029">1</图:相对原始比例>
+ <图:打印对象 uof:locID="g0032">true</图:打印对象>
+ <图:Web文字 uof:locID="g0033"/>
+ <!--0820 by lil -->
+ </图:属性>
+ </图:预定义图形>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="string(.//text:p)">
+ <图:文本内容 uof:locID="g0002" uof:attrList="文本框 左边距 右边距 上边距 下边距 水平对齐 垂直对齐 文字排列方向 自动换行 大小适应文字 前一链接 后一链接">
+ <xsl:if test="$nodename='draw:text-box'">
+ <xsl:attribute name="图:文本框">true</xsl:attribute>
+ <xsl:if test="./@draw:name = /office:document/office:body
//draw:text-box/@draw:chain-next-name">
- <xsl:attribute name="图:前一链接"><xsl:variable name="drawname"><xsl:value-of select="./@draw:name"/></xsl:variable><xsl:variable name="befor-link-name"><xsl:value-of select="/office:document/office:body
+ <xsl:attribute name="图:前一链接"><xsl:variable name="drawname"><xsl:value-of select="./@draw:name"/></xsl:variable><xsl:variable name="befor-link-name"><xsl:value-of select="/office:document/office:body
//draw:text-box[@draw:name=$drawname]/@draw:style-name"/></xsl:variable><xsl:value-of select="concat($befor-link-name,'_',$picnumber)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="./@draw:chain-next-name">
- <xsl:attribute name="图:后一链接"><xsl:variable name="next-link"><xsl:value-of select="./@draw:chain-next-name"/></xsl:variable><xsl:variable name="link-name"><xsl:value-of select="/office:document/office:body
+ </xsl:if>
+ <xsl:if test="./@draw:chain-next-name">
+ <xsl:attribute name="图:后一链接"><xsl:variable name="next-link"><xsl:value-of select="./@draw:chain-next-name"/></xsl:variable><xsl:variable name="link-name"><xsl:value-of select="/office:document/office:body
//draw:text-box[@draw:name=$next-link]/@draw:style-name"/></xsl:variable><xsl:value-of select="concat($link-name,'_',$picnumber)"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
- <xsl:if test="style:graphic-properties/@fo:padding-left">
- <xsl:attribute name="图:左边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-left,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="图:右边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-right,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="图:上边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-top,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="图:下边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-bottom,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="图:文字排列方向"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-lr'">vert-l2r</xsl:when><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when></xsl:choose></xsl:when><xsl:when test="style:graphic-properties/@draw:textarea-horizontal-align='right'">hori-r2l</xsl:when><xsl:otherwise>hori-l2r</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="style:graphic-properties/@fo:wrap-option">
- <xsl:attribute name="图:自动换行">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:auto-grow-width='true' or style:graphic-properties/@draw:auto-grow-height='true'">
- <xsl:attribute name="图:大小适应文字">true</xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="text:p">
- <xsl:attribute name="字:标识符"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- <xsl:if test="style:paragraph-properties">
- <xsl:apply-templates select="style:paragraph-properties"/>
- </xsl:if>
- <xsl:call-template name="textp"/>
- </xsl:for-each>
- </图:文本内容>
- </xsl:if>
- <图:控制点 uof:locID="g0003" uof:attrList="x坐标 y坐标">
- <xsl:attribute name="图:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="图:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
- </图:控制点>
- <!--新增内容-->
- <xsl:if test="name(..)='draw:g'">
- <图:组合位置 uof:locID="g0041" uof:attrList="x坐标 y坐标">
- <xsl:attribute name="图:x坐标"><xsl:variable name="minx"><xsl:for-each select="parent::node()"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:variable><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:variable name="current-minx"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$current-minx - $minx"/></xsl:when><xsl:otherwise><xsl:variable name="current-x" select="number(substring-before(@svg:x,$uofUnit))"/><xsl:value-of select="$current-x - $minx"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:y坐标"><xsl:variable name="miny"><xsl:for-each select="parent::node()"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:variable><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:variable name="current-miny"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$current-miny - $miny"/></xsl:when><xsl:otherwise><xsl:variable name="current-y" select="number(substring-before(@svg:y,$uofUnit))"/><xsl:value-of select="$current-y - $miny"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </图:组合位置>
- </xsl:if>
- <!--Redoffice comment liliang 06.03.28 end-->
- </图:图形>
- <xsl:if test="name()='draw:image'">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <xsl:attribute name="uof:公共类型">png</xsl:attribute>
- <xsl:if test="./office:binary-data">
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="./office:binary-data"/>
- </uof:数据>
- </xsl:if>
- <xsl:if test="@xlink:href">
- <uof:路径 uof:locID="u0038">
- <xsl:value-of select="@xlink:href"/>
- </uof:路径>
- </xsl:if>
- </uof:其他对象>
- </xsl:if>
- <xsl:if test="name()='draw:frame'">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <xsl:attribute name="uof:公共类型">png</xsl:attribute>
- <xsl:if test="draw:image/office:binary-data">
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="draw:image/office:binary-data"/>
- </uof:数据>
- </xsl:if>
- <xsl:if test="@xlink:href">
- <uof:路径 uof:locID="u0038">
- <xsl:value-of select="@xlink:href"/>
- </uof:路径>
- </xsl:if>
- </uof:其他对象>
- </xsl:if>
- <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
- <xsl:if test="style:graphic-properties/@draw:fill-image-name">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:attribute>
- <xsl:attribute name="uof:公共类型">png</xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <xsl:variable name="fill-name">
- <xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/>
- </xsl:variable>
- <uof:数据 uof:locID="u0037">
- <xsl:for-each select="/office:document/office:styles/draw:fill-image[@draw:name=$fill-name]">
- <xsl:value-of select="office:binary-data"/>
- </xsl:for-each>
- </uof:数据>
- <uof:路径 uof:locID="u0038">
- <xsl:value-of select="@xlink:href"/>
- </uof:路径>
- </uof:其他对象>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <!--Redoffice comment liliang 06.03.29-->
- <!--新增内容-->
- <xsl:template name="graphicattr">
- <xsl:variable name="aa" select="@style:name"/>
- <xsl:if test="not(style:graphic-properties/@draw:fill='none')">
- <图:填充 uof:locID="g0012">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:fill='gradient'">
- <xsl:variable name="gradient-name">
- <xsl:value-of select="style:graphic-properties/@draw:fill-gradient-name"/>
- </xsl:variable>
- <xsl:for-each select="/descendant::draw:gradient[@draw:name=$gradient-name]">
- <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
- <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
- <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
- <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
- <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
- <xsl:variable name="angle">
- <xsl:value-of select="@draw:angle div 10"/>
- </xsl:variable>
- <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
- <xsl:if test="@draw:cx">
- <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@draw:cy">
- <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="图:类型">-2</xsl:attribute>
- </图:渐变>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@draw:fill-image-name">
- <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
- <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:graphic-properties/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:graphic-properties/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:图形引用"><xsl:value-of select="concat($aa,'_b1')"/></xsl:attribute>
- <xsl:attribute name="图:类型">png</xsl:attribute>
- <xsl:attribute name="图:名称"><xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/></xsl:attribute>
- </图:图片>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@draw:fill='hatch'">
- <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
- <xsl:if test="/office:document/office:styles/draw:hatch/@draw:name">
- <xsl:attribute name="图:类型"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:name"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="图:图形引用">rogr1</xsl:attribute>
- <xsl:if test="/office:document/office:styles/draw:hatch/@draw:color">
- <xsl:attribute name="图:前景色"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:color"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="图:背景色"><xsl:choose><xsl:when test="style:graphic-properties/@draw:fill-color"><xsl:value-of select="style:graphic-properties/@draw:fill-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
- </图:图案>
- </xsl:when>
- <xsl:otherwise>
- <图:颜色 uof:locID="g0034">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:fill-color">
- <xsl:value-of select="style:graphic-properties/@draw:fill-color"/>
- </xsl:when>
- <xsl:otherwise>#99ccff</xsl:otherwise>
- </xsl:choose>
- </图:颜色>
- </xsl:otherwise>
- </xsl:choose>
- </图:填充>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@svg:stroke-color">
- <图:线颜色 uof:locID="g0013">
- <xsl:value-of select="style:graphic-properties/@svg:stroke-color"/>
- </图:线颜色>
- </xsl:if>
- <图:线型 uof:locID="g0014">
- <xsl:call-template name="表:线型"/>
- </图:线型>
- <xsl:if test="style:graphic-properties/@svg:stroke-width">
- <图:线粗细 uof:locID="g0016">
- <xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-width,$uofUnit)"/>
- </图:线粗细>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:marker-start and string-length(style:graphic-properties/@draw:marker-start)&gt;0">
- <图:前端箭头 uof:locID="g0017">
- <图:式样 uof:locID="g0018">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow'">normal</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Line Arrow'">open</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow concave'">stealth</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Circle'">oval</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Square 45'">diamond</xsl:when>
- <xsl:otherwise>normal</xsl:otherwise>
- </xsl:choose>
- </图:式样>
- <xsl:if test="style:graphic-properties/@draw:marker-start-width">
- <图:大小 uof:locID="g0019">
- <xsl:variable name="width">
- <xsl:value-of select="substring-before(style:graphic-properties/@draw:marker-start-width,$uofUnit)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="($width&lt;0.05 and 0&lt;$width) or $width=0.05">1</xsl:when>
- <xsl:when test="($width&lt;0.10 and 0.05&lt;$width) or $width=0.10">2</xsl:when>
- <xsl:when test="($width&lt;0.15 and 0.10&lt;$width) or $width=0.15">3</xsl:when>
- <xsl:when test="($width&lt;0.20 and 0.15&lt;$width) or $width=0.20">4</xsl:when>
- <xsl:when test="($width&lt;0.25 and 0.20&lt;$width) or $width=0.25">5</xsl:when>
- <xsl:when test="($width&lt;0.30 and 0.25&lt;$width) or $width=0.30">6</xsl:when>
- <xsl:when test="($width&lt;0.35 and 0.30&lt;$width) or $width=0.35">7</xsl:when>
- <xsl:when test="($width&lt;0.40 and 0.35&lt;$width) or $width=0.40">8</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </图:大小>
- </xsl:if>
- </图:前端箭头>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:marker-end">
- <!--0820 by lil -->
- <图:后端箭头 uof:locID="g0020">
- <图:式样 uof:locID="g0021">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow'">normal</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Line Arrow'">open</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow concave'">stealth</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Circle'">oval</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Square 45'">diamond</xsl:when>
- <xsl:otherwise>normal</xsl:otherwise>
- </xsl:choose>
- </图:式样>
- <xsl:if test="style:graphic-properties/@draw:marker-end-width">
- <图:大小 uof:locID="g0022">
- <xsl:variable name="width">
- <xsl:value-of select="number(substring-before(style:graphic-properties/@draw:marker-end-width,$uofUnit))"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="($width&lt;0.05 and 0&lt;$width) or $width=0.05">1</xsl:when>
- <xsl:when test="($width&lt;0.10 and 0.05&lt;$width) or $width=0.10">2</xsl:when>
- <xsl:when test="($width&lt;0.15 and 0.10&lt;$width) or $width=0.15">3</xsl:when>
- <xsl:when test="($width&lt;0.20 and 0.15&lt;$width) or $width=0.20">4</xsl:when>
- <xsl:when test="($width&lt;0.25 and 0.20&lt;$width) or $width=0.25">5</xsl:when>
- <xsl:when test="($width&lt;0.30 and 0.25&lt;$width) or $width=0.30">6</xsl:when>
- <xsl:when test="($width&lt;0.35 and 0.30&lt;$width) or $width=0.35">7</xsl:when>
- <xsl:when test="($width&lt;0.40 and 0.35&lt;$width) or $width=0.40">8</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </图:大小>
- </xsl:if>
- </图:后端箭头>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:opacity">
- <xsl:variable name="trans" select="style:graphic-properties/@draw:opacity"/>
- <图:透明度 uof:locID="g0038">
- <xsl:value-of select="substring($trans,1,2)"/>
- </图:透明度>
- </xsl:if>
- </xsl:template>
- <xsl:template name="groupminx">
- <xsl:param name="value"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="descendant::node()[@svg:x][position()=$pos]">
- <xsl:variable name="othervalue" select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:x,$uofUnit))"/>
- <xsl:call-template name="groupminx">
- <xsl:with-param name="value">
- <xsl:choose>
- <xsl:when test="$value&gt;$othervalue">
- <xsl:value-of select="$othervalue"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--Redoffice comment liliang end 06.03.29-->
- <!--Redoffice comment liliang 06.03.29-->
- <!--新增内容-->
- <xsl:template name="groupminy">
- <xsl:param name="value"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="descendant::node()[@svg:y][position()=$pos]">
- <xsl:variable name="othervalue" select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:y,$uofUnit))"/>
- <xsl:call-template name="groupminy">
- <xsl:with-param name="value">
- <xsl:choose>
- <xsl:when test="$value&gt;$othervalue">
- <xsl:value-of select="$othervalue"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="groupmaxx">
- <xsl:param name="value"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="descendant::node()[@svg:x][position()=$pos]">
- <xsl:variable name="svgx">
- <xsl:value-of select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:x,$uofUnit))"/>
- </xsl:variable>
- <xsl:variable name="width">
- <xsl:value-of select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:width,$uofUnit))"/>
- </xsl:variable>
- <xsl:variable name="othervalue" select="$svgx + $width"/>
- <xsl:call-template name="groupminx">
- <xsl:with-param name="value">
- <xsl:choose>
- <xsl:when test="$value&gt;$othervalue">
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$othervalue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="groupmaxy">
- <xsl:param name="value"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="descendant::node()[@svg:y][position()=$pos]">
- <xsl:variable name="svgy">
- <xsl:value-of select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:y,$uofUnit))"/>
- </xsl:variable>
- <xsl:variable name="height">
- <xsl:value-of select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:height,$uofUnit))"/>
- </xsl:variable>
- <xsl:variable name="othervalue" select="$svgy + $height"/>
- <xsl:call-template name="groupminy">
- <xsl:with-param name="value">
- <xsl:choose>
- <xsl:when test="$value&gt;$othervalue">
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$othervalue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--Redoffice comment liliang end 06.03.29-->
- <xsl:template name="draw:points">
- <xsl:param name="point"/>
- <xsl:param name="lujing"/>
- <xsl:choose>
- <xsl:when test="contains($point,' ' )">
- <xsl:variable name="first-point" select="substring-before($point,' ')"/>
- <xsl:variable name="other-point" select="substring-after($point,' ')"/>
- <xsl:variable name="xzuobiao">
- <xsl:value-of select="substring-before($first-point,',') div 1000"/>
- </xsl:variable>
- <xsl:variable name="yzuobiao">
- <xsl:value-of select="substring-after($first-point,',') div 1000"/>
- </xsl:variable>
- <xsl:call-template name="draw:points">
- <xsl:with-param name="point" select="$other-point"/>
- <xsl:with-param name="lujing" select="concat($lujing,$xzuobiao,' ',$yzuobiao,'lineto')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="xzuobiao">
- <xsl:value-of select="substring-before($point,',') div 1000"/>
- </xsl:variable>
- <xsl:variable name="yzuobiao">
- <xsl:value-of select="substring-after($point,',') div 1000"/>
- </xsl:variable>
- <xsl:value-of select="concat($lujing,$xzuobiao,' ',$yzuobiao)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--Redoffice comment end liliang-->
- <!--chenjh add 20050624-->
- <xsl:template name="create-page-setting">
- <xsl:param name="master-page"/>
- <xsl:param name="page-master-style"/>
- <xsl:element name="表:页面设置">
- <xsl:attribute name="uof:locID">s0029</xsl:attribute>
- <xsl:attribute name="uof:attrList">名称</xsl:attribute>
- <xsl:attribute name="表:名称"><xsl:value-of select="$master-page/@style:name"/></xsl:attribute>
- <xsl:element name="表:纸张">
- <xsl:attribute name="uof:locID">s0030</xsl:attribute>
- <xsl:attribute name="uof:attrList">纸型 宽度 高度</xsl:attribute>
- <xsl:attribute name="uof:纸型"><xsl:variable name="height"><xsl:value-of select="$page-master-style/@fo:page-height"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="$page-master-style/@fo:page-width"/></xsl:variable><xsl:choose><xsl:when test="$width='29.699cm' and $height='42cm'">A3</xsl:when><xsl:when test="not($page-master-style/@fo:page-height) and not($page-master-style/@fo:page-width)">A4</xsl:when><xsl:when test="$width='14.799cm' and $height='20.999cm'">A5</xsl:when><xsl:when test="$width='25cm' and $height='35.299cm'">B4</xsl:when><xsl:when test="$width='17.598cm' and $height='25cm'">B5</xsl:when><xsl:when test="$width='12.499cm' and $height='17.598cm'">B6</xsl:when><xsl:otherwise>使用者</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:choose><xsl:when test="$page-master-style/@fo:page-width"><xsl:value-of select="substring-before($page-master-style/@fo:page-width,$uofUnit)"/></xsl:when><xsl:otherwise><xsl:call-template name="setDefaultPageWidth"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:高度"><xsl:choose><xsl:when test="$page-master-style/@fo:page-height"><xsl:value-of select="substring-before($page-master-style/@fo:page-height,$uofUnit)"/></xsl:when><xsl:otherwise><xsl:call-template name="setDefaultPageHeight"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:element name="表:纸张方向">
- <xsl:attribute name="uof:locID">s0031</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$page-master-style/@style:print-orientation">
- <xsl:value-of select="$page-master-style/@style:print-orientation"/>
- </xsl:when>
- <xsl:otherwise>portrait</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="表:缩放">
- <xsl:attribute name="uof:locID">s0032</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$page-master-style/@style:scale-to">
- <xsl:value-of select="$page-master-style/@style:scale-to"/>
- </xsl:when>
- <xsl:otherwise>100</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="$page-master-style/@fo:margin-left or $page-master-style/@fo:margin-top or $page-master-style/@fo:margin-right or $page-master-style/@fo:margin-bottom">
- <xsl:element name="表:页边距">
- <xsl:attribute name="uof:locID">s0033</xsl:attribute>
- <xsl:attribute name="uof:attrList">左 上 右 下</xsl:attribute>
- <xsl:attribute name="uof:左"><xsl:value-of select="substring-before($page-master-style/@fo:margin-left,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:上"><xsl:value-of select="substring-before($page-master-style/@fo:margin-top,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:右"><xsl:value-of select="substring-before($page-master-style/@fo:margin-right,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:下"><xsl:value-of select="substring-before($page-master-style/@fo:margin-bottom,$uofUnit)"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:for-each select="$master-page[@style:page-layout-name='pm1']/style:header/child::*">
- <表:页眉页脚 uof:locID="s0034" uof:attrList="位置">
- <xsl:attribute name="表:位置"><xsl:choose><xsl:when test="name()='style:region-left'">headerleft</xsl:when><xsl:when test="name()='style:region-right'">headerright</xsl:when><xsl:otherwise>headercenter</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:call-template name="create-page-header-footer-paragraph">
- <xsl:with-param name="paragraph-set" select="text:p"/>
- </xsl:call-template>
- </表:页眉页脚>
- </xsl:for-each>
- <xsl:for-each select="$master-page[@style:page-layout-name='pm1']/style:footer/child::*">
- <表:页眉页脚 uof:locID="s0034" uof:attrList="位置">
- <xsl:attribute name="表:位置"><xsl:choose><xsl:when test="name()='style:region-left'">footerleft</xsl:when><xsl:when test="name()='style:region-right'">footerright</xsl:when><xsl:otherwise>footercenter</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:call-template name="create-page-header-footer-paragraph">
- <xsl:with-param name="paragraph-set" select="text:p"/>
- </xsl:call-template>
- </表:页眉页脚>
- </xsl:for-each>
- <xsl:if test="$page-master-style/@style:print-page-order or $page-master-style/@style:print">
- <表:打印 uof:locID="s126" uof:attrList="网格线 行号列标 按草稿方式 先列后行">
- <xsl:if test="$page-master-style/@style:print-page-order='ltr'">
- <xsl:attribute name="表:先列后行">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="contains($page-master-style/@style:print,'grid')">
- <xsl:attribute name="表:网格线">true</xsl:attribute>
- </xsl:if>
- </表:打印>
- </xsl:if>
- <xsl:if test="$page-master-style/@style:table-centering='vertical' or $page-master-style/@style:table-centering='both'">
- <表:垂直对齐 uof:locID="s0128" uof:attrList="对齐方式">
- <xsl:attribute name="表:对齐方式">center</xsl:attribute>
- </表:垂直对齐>
- </xsl:if>
- <xsl:if test="$page-master-style/@style:table-centering='horizontal' or $page-master-style/@style:table-centering='both'">
- <表:水平对齐 uof:locID="s0129" uof:attrList="对齐方式">
- <xsl:attribute name="表:对齐方式">center</xsl:attribute>
- </表:水平对齐>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="create-page-header-footer-paragraph">
- <xsl:param name="paragraph-set"/>
- <xsl:choose>
- <xsl:when test="$paragraph-set">
- <xsl:element name="字:段落">
- <xsl:attribute name="uof:locID">t0051</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:element name="字:句">
- <xsl:attribute name="uof:locID">t0085</xsl:attribute>
- <xsl:apply-templates select="$paragraph-set//text()">
- <xsl:with-param name="bText" select="'0'"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:element>
- <xsl:call-template name="create-page-header-footer-paragraph">
- <xsl:with-param name="paragraph-set" select="$paragraph-set[position()!=1]"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="text:p" name="textp">
- <xsl:apply-templates select="text()|text:span|text:tab-stop|text:line-break|text:s|text:ruby|text:bookmark|text:bookmark-start|text:bookmark-end|text:a|text:footnote|text:endnote">
- <xsl:with-param name="bText" select="'1'"/>
- <xsl:with-param name="sText" select="'1'"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="text:a">
- <xsl:param name="bText"/>
- <xsl:choose>
- <xsl:when test="$bText='0'">
- <xsl:element name="字:句">
- <xsl:attribute name="uof:locID">t0085</xsl:attribute>
- <xsl:element name="字:区域开始">
- <xsl:attribute name="字:标识符"><xsl:value-of select="generate-id(.)"/></xsl:attribute>
- <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
- <xsl:attribute name="uof:locID">t0121</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="字:区域开始">
- <xsl:attribute name="字:标识符"><xsl:value-of select="generate-id(.)"/></xsl:attribute>
- <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
- <xsl:attribute name="uof:locID">t0121</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="text()">
- <xsl:param name="bText"/>
- <xsl:param name="sText"/>
- <xsl:if test="normalize-space(.)!=''">
- <xsl:choose>
- <xsl:when test="$bText='1' and $sText='1'">
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="."/>
- </字:文本串>
- </字:句>
- </xsl:when>
- <xsl:otherwise>
- <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
- <xsl:value-of select="."/>
- </字:文本串>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template match="text:span">
- <xsl:param name="bText"/>
- <xsl:choose>
- <xsl:when test="$bText='0'">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </字:句属性>
- <xsl:apply-templates select="text:s|text()|text:line-break|text:tab-stop| text:a | text:footnote|text:endnote|draw:image|office:annotation|draw:frame">
- <xsl:with-param name="bText" select="1"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用" 字:式样引用="{@text:style-name}"/>
- <xsl:apply-templates select="text:s|text()|text:line-break|text:tab-stop| text:a |text:footnote|text:endnote|draw:image|office:annotation|draw:frame">
- <xsl:with-param name="bText" select="1"/>
- </xsl:apply-templates>
- </字:句>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="text:s">
- <xsl:param name="bText"/>
- <xsl:choose>
- <xsl:when test="$bText='0'">
- <xsl:variable name="count">
- <xsl:choose>
- <xsl:when test="not(@text:c)">1</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@text:c"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <字:句 uof:locID="t0085">
- <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{$count}"/>
- </字:句>
- </xsl:when>
- <xsl:otherwise>
- <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{@text:c}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="text:line-break">
- <xsl:param name="bText"/>
- <xsl:choose>
- <xsl:when test="$bText='0'">
- <字:句 uof:locID="t0085">
- <字:换行符 uof:locID="t0124"/>
- </字:句>
- </xsl:when>
- <xsl:otherwise>
- <字:换行符 uof:locID="t0124"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="text:tab-stop">
- <xsl:param name="bText"/>
- <xsl:choose>
- <xsl:when test="$bText='0'">
- <字:句 uof:locID="t0085">
- <字:制表符 uof:locID="t0123"/>
- </字:句>
- </xsl:when>
- <xsl:otherwise>
- <字:制表符 uof:locID="t0123"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--chenjh0713-->
- <!--chenjh0629E-->
- <!--chenjh add 20050629 -->
- <!--字符串转换为数字-->
- <xsl:template name="translate-column-char-to-number">
- <xsl:param name="string"/>
- <xsl:choose>
- <xsl:when test="string-length($string)=1">
- <xsl:call-template name="char-to-number">
- <xsl:with-param name="char" select="$string"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="tens-place">
- <xsl:call-template name="char-to-number">
- <xsl:with-param name="char" select="substring($string,1,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="units-place">
- <xsl:call-template name="char-to-number">
- <xsl:with-param name="char" select="substring($string,2,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$tens-place * 26 + $units-place"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="char-to-number">
- <xsl:param name="char"/>
- <xsl:choose>
- <xsl:when test="$char='A'">1</xsl:when>
- <xsl:when test="$char='B'">2</xsl:when>
- <xsl:when test="$char='C'">3</xsl:when>
- <xsl:when test="$char='D'">4</xsl:when>
- <xsl:when test="$char='E'">5</xsl:when>
- <xsl:when test="$char='F'">6</xsl:when>
- <xsl:when test="$char='G'">7</xsl:when>
- <xsl:when test="$char='H'">8</xsl:when>
- <xsl:when test="$char='I'">9</xsl:when>
- <xsl:when test="$char='J'">10</xsl:when>
- <xsl:when test="$char='K'">11</xsl:when>
- <xsl:when test="$char='L'">12</xsl:when>
- <xsl:when test="$char='M'">13</xsl:when>
- <xsl:when test="$char='N'">14</xsl:when>
- <xsl:when test="$char='O'">15</xsl:when>
- <xsl:when test="$char='P'">16</xsl:when>
- <xsl:when test="$char='Q'">17</xsl:when>
- <xsl:when test="$char='R'">18</xsl:when>
- <xsl:when test="$char='S'">19</xsl:when>
- <xsl:when test="$char='T'">20</xsl:when>
- <xsl:when test="$char='U'">21</xsl:when>
- <xsl:when test="$char='V'">22</xsl:when>
- <xsl:when test="$char='W'">23</xsl:when>
- <xsl:when test="$char='X'">24</xsl:when>
- <xsl:when test="$char='Y'">25</xsl:when>
- <xsl:when test="$char='Z'">26</xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="create-filter-conditions">
- <xsl:param name="filter-condition-set"/>
- <xsl:param name="zone-left-column-num"/>
- <xsl:if test="$filter-condition-set">
- <xsl:variable name="first-condition" select="$filter-condition-set"/>
- <xsl:element name="表:条件">
- <xsl:attribute name="uof:locID">s0103</xsl:attribute>
- <xsl:attribute name="uof:attrList">列号</xsl:attribute>
- <xsl:attribute name="表:列号"><xsl:value-of select="$zone-left-column-num + $first-condition/@table:field-number"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="$first-condition/@table:operator ='top values'">
- <xsl:element name="表:普通">
- <xsl:attribute name="uof:locID">s0104</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 值</xsl:attribute>
- <xsl:attribute name="表:类型">topitem</xsl:attribute>
- <xsl:attribute name="表:值"><xsl:value-of select="$first-condition/@table:value"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="表:自定义">
- <xsl:attribute name="uof:locID">s0105</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:element name="表:操作条件">
- <xsl:attribute name="uof:locID">s0106</xsl:attribute>
- <!--redoffice comment from lvxg 8.27-->
- <xsl:if test="$first-condition/@table:operator">
- <xsl:element name="表:操作码">
- <xsl:attribute name="uof:locID">s0009</xsl:attribute>
- <xsl:variable name="operator-text" select="$first-condition/@table:operator"/>
- <xsl:choose>
- <xsl:when test="$operator-text ='&lt;' ">less than</xsl:when>
- <xsl:when test="$operator-text ='&gt;' ">greater than</xsl:when>
- <xsl:when test="$operator-text ='=' ">equal to</xsl:when>
- <xsl:when test="$operator-text ='&gt;=' ">greater than or equal to</xsl:when>
- <xsl:when test="$operator-text ='&lt;=' ">less than or equal to</xsl:when>
- <xsl:when test="$operator-text ='!=' ">not equal to</xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:element name="表:值">
- <xsl:attribute name="uof:locID">s0107</xsl:attribute>
- <xsl:value-of select="$first-condition/@table:value"/>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:call-template name="create-filter-conditions">
- <xsl:with-param name="filter-condition-set" select="$filter-condition-set[position()!=1]"/>
- <xsl:with-param name="zone-left-column-num" select="$zone-left-column-num"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="create-view">
- <xsl:param name="table-name"/>
- <xsl:param name="view-id"/>
- <!--xsl:param name="ActiveTable"/-->
- <xsl:param name="aaa"/>
- <!--xsl:variable name="aaa" select="/*/office:settings/config:config-item-set/config:config-item-map-indexed"-->
- <xsl:element name="表:视图">
- <xsl:attribute name="uof:locID">s0035</xsl:attribute>
- <xsl:attribute name="uof:attrList">窗口标识符</xsl:attribute>
- <xsl:attribute name="表:窗口标识符"><xsl:value-of select="$view-id"/></xsl:attribute>
- <xsl:if test="$table-name='ActiveTable'">
- <xsl:element name="表:选中">
- <xsl:attribute name="uof:locID">s0036</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="表:值">1</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:variable name="name" select="./@table:name"/>
- <xsl:choose>
- <xsl:when test="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='HorizontalSplitMode']/text()='2' or $aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=name]/config:config-item[@config:name='VerticalSplitMode']/text()='2' ">
- <xsl:element name="表:冻结">
- <xsl:attribute name="uof:locID">s0038</xsl:attribute>
- <xsl:attribute name="uof:attrList">行号 列号</xsl:attribute>
- <xsl:attribute name="表:行号"><xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='VerticalSplitPosition']/text()"/></xsl:attribute>
- <xsl:attribute name="表:列号"><xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='HorizontalSplitPosition']/text()"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="表:拆分">
- <xsl:attribute name="uof:locID">s0037</xsl:attribute>
- <xsl:attribute name="uof:attrList">宽度 高度</xsl:attribute>
- <xsl:attribute name="表:宽度"><xsl:choose><xsl:when test="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='HorizontalSplitMode']/text()='1'"><xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='HorizontalSplitPosition']/text()"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="表:高度"><xsl:choose><xsl:when test="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='VerticalSplitMode']/text()='1'"><xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='VerticalSplitPosition']/text()"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:element name="表:最上行">
- <xsl:attribute name="uof:locID">s0039</xsl:attribute>
- <!--xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$table-name]/config:config-item[@config:name='PositionBottom']/text()+1"/-->
- <xsl:choose>
- <xsl:when test="$aaa/config:config-item-map-named/config:config-item-map-entry/config:config-item[@config:name='PositionBottom']/text()">
- <xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry/config:config-item[@config:name='PositionBottom']/text()"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="表:最左列">
- <xsl:attribute name="uof:locID">s0040</xsl:attribute>
- <!--xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$table-name]/config:config-item[@config:name='PositionLeft']/text() + 1"/-->
- <xsl:choose>
- <xsl:when test="$aaa/config:config-item-map-named/config:config-item-map-entry/config:config-item[@config:name='PositionRight']/text()">
- <xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry/config:config-item[@config:name='PositionRight']/text()"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="表:当前视图">
- <xsl:attribute name="uof:locID">s0041</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="$aaa/config:config-item[@config:name='ShowPageBreakPreview']/text()='true'">page</xsl:when><xsl:otherwise>normal</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:element name="表:网格">
- <xsl:attribute name="uof:locID">s0043</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="表:值"><xsl:choose><xsl:when test="/*/office:settings/config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='ShowGrid']/text()='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:element name="表:网格颜色">
- <xsl:attribute name="uof:locID">s0044</xsl:attribute>
- <xsl:variable name="GridColor-text">
- <xsl:value-of select="//config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='GridColor']/text()"/>
- </xsl:variable>
- <xsl:variable name="R-color" select="floor($GridColor-text div 65536)"/>
- <xsl:variable name="G-color" select="floor(($GridColor-text - ($R-color * 65536)) div 256)"/>
- <xsl:variable name="B-color" select="$GridColor-text - ($R-color * 65536)- ($G-color * 256)"/>
- <xsl:variable name="R-color-in-16">
- <xsl:call-template name="transform-decimal-to-hexadecimal">
- <xsl:with-param name="color-decimal" select="$R-color"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="G-color-in-16">
- <xsl:call-template name="transform-decimal-to-hexadecimal">
- <xsl:with-param name="color-decimal" select="$G-color"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="B-color-in-16">
- <xsl:call-template name="transform-decimal-to-hexadecimal">
- <xsl:with-param name="color-decimal" select="$B-color"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat('#',$R-color-in-16,$G-color-in-16,$B-color-in-16)"/>
- </xsl:element>
- <xsl:if test="/*/office:settings/config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='ZoomType']/text()=0">
- <xsl:element name="表:缩放">
- <xsl:attribute name="uof:locID">s0045</xsl:attribute>
- <xsl:value-of select="/*/office:settings/config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='ZoomValue']/text()"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="/*/office:settings/config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='ZoomType']/text()=1">
- <xsl:element name="表:分页缩放">
- <xsl:attribute name="uof:locID">s0046</xsl:attribute>
- <xsl:value-of select="/*/office:settings/config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='ZoomValue']/text()"/>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="hexNumber2dec">
- <xsl:param name="hex-value"/>
- <xsl:choose>
- <xsl:when test="$hex-value = 'A' or ($hex-value = 'a')">
- <xsl:value-of select="10"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'B' or ($hex-value = 'b')">
- <xsl:value-of select="11"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'C' or ($hex-value = 'c')">
- <xsl:value-of select="12"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'D' or ($hex-value = 'd')">
- <xsl:value-of select="13"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'E' or ($hex-value = 'e')">
- <xsl:value-of select="14"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'F' or ($hex-value = 'f')">
- <xsl:value-of select="15"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$hex-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="hex2decimal">
- <xsl:param name="hex-number"/>
- <xsl:param name="index"/>
- <xsl:param name="str-length"/>
- <xsl:param name="last-value"/>
- <xsl:variable name="dec-char">
- <xsl:call-template name="hexNumber2dec">
- <xsl:with-param name="hex-value" select="substring($hex-number, $index ,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="current-value" select="$last-value * 16 + $dec-char"/>
- <xsl:if test="$index &lt; $str-length">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="$hex-number"/>
- <xsl:with-param name="index" select="$index + 1"/>
- <xsl:with-param name="str-length" select="$str-length"/>
- <xsl:with-param name="last-value" select="$current-value"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$index = $str-length">
- <xsl:value-of select="$current-value"/>
- </xsl:if>
- </xsl:template>
- <xsl:template match="table:calculation-settings" mode="common">
- <xsl:if test="@table:precision-as-shown">
- <xsl:element name="表:精确度以显示值为准">
- <xsl:attribute name="uof:locID">s0002</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="表:值"><xsl:value-of select="@table:precision-as-shown"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="表:日期系统-1904">
- <xsl:attribute name="uof:locID">s0003</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="表:值"><xsl:choose><xsl:when test="table:null-date/@table:date-value='1904-01-01'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:if test="table:iteration/@table:status='enable'">
- <表:计算设置 uof:locID="s0004" uof:attrList="迭代次数 偏差值">
- <xsl:attribute name="表:迭代次数"><xsl:value-of select="table:iteration/@table:steps"/></xsl:attribute>
- <xsl:attribute name="表:偏差值"><xsl:choose><xsl:when test="table:iteration/@table:maximum-difference"><xsl:value-of select="table:iteration/@table:maximum-difference"/></xsl:when><xsl:otherwise>0.001</xsl:otherwise></xsl:choose><!--xsl:value-of select="table:iteration/@table:maximum-difference"/--></xsl:attribute>
- </表:计算设置>
- </xsl:if>
- </xsl:template>
- <xsl:template match="office:automatic-styles" mode="common">
- <xsl:element name="表:条件格式化集">
- <xsl:attribute name="uof:locID">s0016</xsl:attribute>
- <xsl:variable name="temp-path" select="../office:automatic-styles/style:style"/>
- <xsl:for-each select="$temp-path/style:map">
- <xsl:element name="表:条件格式化">
- <xsl:attribute name="uof:locID">s0017</xsl:attribute>
- <xsl:element name="表:区域">
- <xsl:attribute name="uof:locID">s0007</xsl:attribute>
- <xsl:variable name="range-name">
- <xsl:value-of select="substring-before(@style:base-cell-address,'.')"/>
- </xsl:variable>
- <xsl:variable name="range-value">
- <xsl:value-of select="substring-after(@style:base-cell-address,'.')"/>
- </xsl:variable>
- <xsl:value-of select="concat(&quot;&apos;&quot;,$range-name,&quot;&apos;&quot;,'!$',substring($range-value,1,1),'$',substring($range-value,2))"/>
- </xsl:element>
- <xsl:element name="表:条件">
- <xsl:attribute name="uof:locID">s0019</xsl:attribute>
- <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="contains(@style:condition,'formula')"><xsl:value-of select="'formula'"/></xsl:when><xsl:otherwise><xsl:value-of select="'cell value'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:element name="表:操作码">
- <xsl:attribute name="uof:locID">s0009</xsl:attribute>
- <xsl:choose>
- <xsl:when test="contains(@style:condition,'!=')">
- <xsl:value-of select="'not equal to'"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'&lt;=')">
- <xsl:value-of select="'less than or equal to'"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'&gt;=')">
- <xsl:value-of select="'greater than or equal to'"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'&lt;')">
- <xsl:value-of select="'less than'"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'&gt;')">
- <xsl:value-of select="'greater than'"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'=')">
- <xsl:value-of select="'equal to'"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'not-between')">
- <xsl:value-of select="'not-between'"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'between')">
- <xsl:value-of select="'between'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="表:第一操作数">
- <xsl:attribute name="uof:locID">s0010</xsl:attribute>
- <xsl:choose>
- <xsl:when test="contains(@style:condition,'formula')">
- <xsl:value-of select="substring-after(substring-before(@style:condition,')'),'(')"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'=')">
- <xsl:value-of select="substring-after(@style:condition,'=')"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'&lt;') and not(contains(@style:condition,'&lt;='))">
- <xsl:value-of select="substring-after(@style:condition,'&lt;')"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'&gt;') and not(contains(@style:condition,'&gt;='))">
- <xsl:value-of select="substring-after(@style:condition,'&gt;')"/>
- </xsl:when>
- <xsl:when test="contains(@style:condition,'between')">
- <xsl:value-of select="substring-before(substring-after(@style:condition,'('),',')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="contains(@style:condition,',')">
- <xsl:element name="表:第二操作数">
- <xsl:attribute name="uof:locID">s0011</xsl:attribute>
- <xsl:choose>
- <xsl:when test="contains(@style:condition,'between')">
- <xsl:value-of select="substring-before(substring-after(@style:condition,','),')')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:element name="表:格式">
- <xsl:attribute name="uof:locID">s0023</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="表:式样引用"><xsl:value-of select="@style:apply-style-name"/></xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template match="table:content-validations" mode="common">
- <xsl:element name="表:数据有效性集">
- <xsl:attribute name="uof:locID">s0005</xsl:attribute>
- <xsl:call-template name="create-validation-set">
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="create-validation-set">
- <xsl:for-each select="//table:content-validation">
- <xsl:element name="表:数据有效性">
- <xsl:attribute name="uof:locID">s0006</xsl:attribute>
- <xsl:variable name="conditiontext" select="@table:condition"/>
- <xsl:variable name="operatortext" select="substring-after($conditiontext,'and ')"/>
- <xsl:element name="表:区域">
- <xsl:attribute name="uof:locID">s0007</xsl:attribute>
- <xsl:variable name="left-top">
- <xsl:call-template name="search-left-top-validation">
- <xsl:with-param name="validation-name" select="@table:name"/>
- <xsl:with-param name="tableslist" select="/*/office:body/office:spreadsheet/table:table"/>
- <xsl:with-param name="return" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="after-translated-left-top">
- <xsl:call-template name="translate-left-top">
- <xsl:with-param name="left-top" select="$left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="base" select="@table:base-cell-address"/>
- <xsl:variable name="base-column-and-row" select="substring-after($base,'.')"/>
- <xsl:variable name="dd" select="number(substring($base-column-and-row,2,1))"/>
- <xsl:variable name="base-column">
- <xsl:choose>
- <xsl:when test="contains($dd,'NaN') ">
- <xsl:value-of select="substring($base-column-and-row,1,2)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($base-column-and-row,1,1)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="base-row" select="substring-after($base,$base-column)"/>
- <xsl:variable name="after-translated-base-left-top">
- <xsl:value-of select="concat('$',substring-before($base,'.'),'.$',$base-column,'$',$base-row)"/>
- </xsl:variable>
- <xsl:value-of select="concat('$',$after-translated-left-top,':',$after-translated-base-left-top)"/>
- </xsl:element>
- <xsl:element name="表:校验类型">
- <xsl:attribute name="uof:locID">s0008</xsl:attribute>
- <xsl:variable name="listtest">cell-content-is-in-list("</xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($conditiontext,'cell-content-is-whole-number()')">whole number</xsl:when>
- <xsl:when test="contains($conditiontext,'cell-content-is-decimal-number()')">decimal</xsl:when>
- <xsl:when test="contains($conditiontext,'cell-content-is-date()')">date</xsl:when>
- <xsl:when test="contains($conditiontext,'cell-content-is-time()')">time</xsl:when>
- <xsl:when test="contains($conditiontext,'cell-content-is-in-list') and not(contains($conditiontext,$listtest))">cell range</xsl:when>
- <xsl:when test="contains($conditiontext,'cell-content-is-in-list') and contains($conditiontext,$listtest)">list</xsl:when>
- <xsl:when test="contains($conditiontext,'cell-content-text-length')">text length</xsl:when>
- <xsl:otherwise>any value</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="表:操作码">
- <xsl:attribute name="uof:locID">s0009</xsl:attribute>
- <xsl:choose>
- <xsl:when test="starts-with($operatortext,'cell-content()&lt;=')">less than or equal to</xsl:when>
- <xsl:when test="starts-with($operatortext,'cell-content()&gt;=')">greater than or equal to</xsl:when>
- <xsl:when test="starts-with($operatortext,'cell-content()&lt;')">less than</xsl:when>
- <xsl:when test="starts-with($operatortext,'cell-content()&gt;')">greater than</xsl:when>
- <xsl:when test="starts-with($operatortext,'cell-content()!=')">not equal to</xsl:when>
- <xsl:when test="starts-with($operatortext,'cell-content()=')">equal to</xsl:when>
- <xsl:when test="starts-with($conditiontext,'oooc:cell-content-text-length()')">
- <xsl:variable name="operator" select="substring-after($conditiontext,'oooc:cell-content-text-length()')"/>
- <xsl:choose>
- <xsl:when test="starts-with($operator,'&lt;=')">less than or equal to</xsl:when>
- <xsl:when test="starts-with($operator,'&gt;=')">greater than or equal to</xsl:when>
- <xsl:when test="starts-with($operator,'&lt;')">less than</xsl:when>
- <xsl:when test="starts-with($operator,'&gt;')">greater than</xsl:when>
- <xsl:when test="starts-with($operator,'!=')">not equal to</xsl:when>
- <xsl:when test="starts-with($operator,'=')">equal to</xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="contains($conditiontext,'is-between')">between</xsl:when>
- <xsl:when test="contains($conditiontext,'is-not-between')">not between</xsl:when>
- <!-- 注意:uof有的另几种操作码在oo中没有,他们是contain,not contain,start with,not start with, end with,not end with-->
- </xsl:choose>
- </xsl:element>
- <xsl:element name="表:第一操作数">
- <xsl:attribute name="uof:locID">s0010</xsl:attribute>
- <xsl:choose>
- <xsl:when test="starts-with($operatortext,'cell-content-is-between')">
- <xsl:value-of select="substring-before(substring-after($operatortext,'cell-content-is-between('),',')"/>
- </xsl:when>
- <xsl:when test="starts-with($operatortext,'cell-content-is-not-between')">
- <xsl:value-of select="substring-before(substring-after($operatortext,'cell-content-is-not-between('),',')"/>
- </xsl:when>
- <xsl:when test="starts-with($conditiontext,'oooc:cell-content-text-length()')">
- <xsl:variable name="operator" select="substring-after($conditiontext,'cell-content-text-length()')"/>
- <xsl:choose>
- <xsl:when test="starts-with($operator,'&lt;=')">
- <xsl:value-of select="substring-after($operator,'&lt;=')"/>
- </xsl:when>
- <xsl:when test="starts-with($operator,'&gt;=')">
- <xsl:value-of select="substring-after($operator,'&gt;=')"/>
- </xsl:when>
- <xsl:when test="starts-with($operator,'&lt;')">
- <xsl:value-of select="substring-after($operator,'&lt;')"/>
- </xsl:when>
- <xsl:when test="starts-with($operator,'&gt;')">
- <xsl:value-of select="substring-after($operator,'&gt;')"/>
- </xsl:when>
- <xsl:when test="starts-with($operator,'!=')">
- <xsl:value-of select="substring-after($operator,'!=')"/>
- </xsl:when>
- <xsl:when test="starts-with($operator,'=')">
- <xsl:value-of select="substring-after($operator,'=')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="starts-with($conditiontext,'oooc:cell-content-is-in-list')">
- <xsl:value-of select="substring-after($conditiontext,'oooc:cell-content-is-in-list')"/>
- </xsl:when>
- <xsl:when test="starts-with($conditiontext,'oooc:cell-content-text-length-is-not-between')">
- <xsl:value-of select="substring-before(substring-after($conditiontext,'oooc:cell-content-text-length-is-not-between('),',')"/>
- </xsl:when>
- <xsl:when test="starts-with($conditiontext,'oooc:cell-content-text-length-is-between')">
- <xsl:value-of select="substring-before(substring-after($conditiontext,'oooc:cell-content-text-length-is-between('),',')"/>
- </xsl:when>
- <xsl:when test="starts-with($operatortext,'cell-content()')">
- <xsl:variable name="operator" select="substring-after($conditiontext,'oooc:cell-content()')"/>
- <xsl:choose>
- <xsl:when test="starts-with($operator,'&lt;=')">
- <xsl:value-of select="substring-after($operator,'&lt;=')"/>
- </xsl:when>
- <xsl:when test="starts-with($operator,'&gt;=')">
- <xsl:value-of select="substring-after($operator,'&gt;=')"/>
- </xsl:when>
- <xsl:when test="starts-with($operator,'&lt;')">
- <xsl:value-of select="substring-after($operator,'&lt;')"/>
- </xsl:when>
- <xsl:when test="starts-with($operator,'&gt;')">
- <xsl:value-of select="substring-after($operator,'&gt;')"/>
- </xsl:when>
- <xsl:when test="starts-with($operator,'!=')">
- <xsl:value-of select="substring-after($operator,'!=')"/>
- </xsl:when>
- <xsl:when test="starts-with($operator,'=')">
- <xsl:value-of select="substring-after($operator,'=')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="starts-with($operatortext,'cell-content-is-between') or starts-with($operatortext,'cell-content-is-not-between')">
- <xsl:element name="表:第二操作数">
- <xsl:attribute name="uof:locID">s0011</xsl:attribute>
- <xsl:value-of select="substring-before(substring-after($operatortext,','),')')"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="starts-with($conditiontext,'oooc:cell-content-text-length-is-not-between') or starts-with($conditiontext,'oooc:cell-content-text-length-is-between')">
- <xsl:element name="表:第二操作数">
- <xsl:attribute name="uof:locID">s0011</xsl:attribute>
- <xsl:value-of select="substring-before(substring-after($conditiontext,','),')')"/>
- </xsl:element>
- </xsl:if>
- <xsl:element name="表:忽略空格">
- <xsl:attribute name="uof:locID">s0012</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="表:值"><xsl:value-of select="@table:allow-empty-cell"/></xsl:attribute>
- </xsl:element>
- <xsl:if test="contains($conditiontext,'cell-content-is-in-list') ">
- <xsl:element name="表:下拉箭头">
- <xsl:attribute name="uof:locID">s0013</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="表:值">false</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="table:help-message">
- <xsl:element name="表:输入提示">
- <xsl:attribute name="uof:locID">s0014</xsl:attribute>
- <xsl:attribute name="uof:attrList">显示 标题 内容</xsl:attribute>
- <xsl:attribute name="表:显示"><xsl:value-of select="table:help-message/@table:display"/></xsl:attribute>
- <xsl:attribute name="表:标题"><xsl:choose><xsl:when test="table:help-message/@table:title"><xsl:value-of select="table:help-message/@table:title"/></xsl:when><xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:variable name="content">
- <xsl:call-template name="create-help-error-message-content">
- <xsl:with-param name="text-p-set" select="table:help-message/text:p"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="表:内容"><xsl:value-of select="$content"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="table:error-message">
- <xsl:element name="表:错误提示">
- <xsl:attribute name="uof:locID">s0015</xsl:attribute>
- <xsl:attribute name="uof:attrList">显示 类型 标题 内容</xsl:attribute>
- <xsl:attribute name="表:显示"><xsl:value-of select="table:error-message/@table:display"/></xsl:attribute>
- <xsl:attribute name="表:类型"><xsl:value-of select="table:error-message/@table:message-type"/></xsl:attribute>
- <xsl:attribute name="表:标题"><xsl:choose><xsl:when test="table:error-message/@table:title"><xsl:value-of select="table:error-message/@table:title"/></xsl:when><xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:variable name="content">
- <xsl:call-template name="create-help-error-message-content">
- <xsl:with-param name="text-p-set" select="table:error-message/text:p"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="表:内容"><xsl:value-of select="$content"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="search-left-top-validation">
- <xsl:param name="validation-name"/>
- <xsl:param name="tableslist"/>
- <xsl:param name="return"/>
- <xsl:choose>
- <xsl:when test="$tableslist and $return=''">
- <xsl:variable name="firsttablerows" select="$tableslist[1]//table:table-row"/>
- <xsl:variable name="first-left-top">
- <xsl:call-template name="search-left-top-validation-inatable">
- <xsl:with-param name="row-num" select="'1'"/>
- <xsl:with-param name="firsttablerows" select="$firsttablerows"/>
- <xsl:with-param name="validation-name" select="$validation-name"/>
- <xsl:with-param name="return" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="rest-left-top">
- <xsl:call-template name="search-left-top-validation">
- <xsl:with-param name="validation-name" select="$validation-name"/>
- <xsl:with-param name="tableslist" select="$tableslist[position()!=1]"/>
- <xsl:with-param name="return" select="$first-left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-left-top!=''">
- <xsl:value-of select="$first-left-top"/>
- </xsl:when>
- <xsl:when test="$rest-left-top!=''">
- <xsl:value-of select="$rest-left-top"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$return"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="translate-left-top">
- <xsl:param name="left-top"/>
- <xsl:variable name="column-number" select="substring-before(substring-after($left-top,'.'),' ')"/>
- <xsl:variable name="column-number1">
- <xsl:value-of select="floor( $column-number div 26 )"/>
- </xsl:variable>
- <xsl:variable name="column-number2">
- <xsl:value-of select="$column-number mod 26"/>
- </xsl:variable>
- <xsl:variable name="column-character1">
- <xsl:call-template name="number-to-character">
- <xsl:with-param name="number" select="$column-number1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="column-character2">
- <xsl:call-template name="number-to-character">
- <xsl:with-param name="number" select="$column-number2"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat(substring-before($left-top,'.'),'.','$',$column-character1,$column-character2,'$',substring-after($left-top,' '))"/>
- </xsl:template>
- <xsl:template name="create-help-error-message-content">
- <xsl:param name="text-p-set"/>
- <xsl:if test="$text-p-set">
- <!--此处有问题!!!!应该是有一个模块调用等-->
- <!--xsl:value-of select="'&#10;'"/-->
- <xsl:value-of select="$text-p-set"/>
- <xsl:call-template name="create-help-error-message-content">
- <xsl:with-param name="text-p-set" select="$text-p-set[position()!=1]"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="search-left-top-validation-inatable">
- <xsl:param name="row-num"/>
- <xsl:param name="firsttablerows"/>
- <xsl:param name="validation-name"/>
- <xsl:param name="return"/>
- <xsl:choose>
- <xsl:when test="$firsttablerows and $return=''">
- <xsl:variable name="firstcells" select="$firsttablerows[1]/table:table-cell"/>
- <xsl:variable name="first-left-top">
- <xsl:call-template name="search-left-top-validation-inarow">
- <xsl:with-param name="row-num" select="$row-num"/>
- <xsl:with-param name="column-num" select="'1'"/>
- <xsl:with-param name="firstcells" select="$firstcells"/>
- <xsl:with-param name="validation-name" select="$validation-name"/>
- <xsl:with-param name="return" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="row-num-p">
- <xsl:choose>
- <xsl:when test="$firsttablerows[1]/@table:number-rows-repeated">
- <xsl:value-of select="$row-num+ $firsttablerows[1]/@table:number-rows-repeated"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$row-num+1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="rest-left-top">
- <xsl:call-template name="search-left-top-validation-inatable">
- <xsl:with-param name="row-num" select="$row-num-p"/>
- <xsl:with-param name="firsttablerows" select="$firsttablerows[position()!=1]"/>
- <xsl:with-param name="validation-name" select="$validation-name"/>
- <xsl:with-param name="return" select="$first-left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-left-top!=''">
- <xsl:value-of select="$first-left-top"/>
- </xsl:when>
- <xsl:when test="$rest-left-top !=''">
- <xsl:value-of select="$rest-left-top "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$return"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="number-to-character">
- <xsl:param name="number"/>
- <xsl:choose>
- <xsl:when test="$number = 0"/>
- <xsl:when test="$number = 1">A</xsl:when>
- <xsl:when test="$number = 2">B</xsl:when>
- <xsl:when test="$number = 3">C</xsl:when>
- <xsl:when test="$number = 4">D</xsl:when>
- <xsl:when test="$number = 5">E</xsl:when>
- <xsl:when test="$number = 6">F</xsl:when>
- <xsl:when test="$number = 7">G</xsl:when>
- <xsl:when test="$number = 8">H</xsl:when>
- <xsl:when test="$number = 9">I</xsl:when>
- <xsl:when test="$number = 10">J</xsl:when>
- <xsl:when test="$number = 11">K</xsl:when>
- <xsl:when test="$number = 12">L</xsl:when>
- <xsl:when test="$number = 13">M</xsl:when>
- <xsl:when test="$number = 14">N</xsl:when>
- <xsl:when test="$number = 15">O</xsl:when>
- <xsl:when test="$number = 16">P</xsl:when>
- <xsl:when test="$number = 17">Q</xsl:when>
- <xsl:when test="$number = 18">R</xsl:when>
- <xsl:when test="$number = 19">S</xsl:when>
- <xsl:when test="$number = 20">T</xsl:when>
- <xsl:when test="$number = 21">U</xsl:when>
- <xsl:when test="$number = 22">V</xsl:when>
- <xsl:when test="$number = 23">W</xsl:when>
- <xsl:when test="$number = 24">X</xsl:when>
- <xsl:when test="$number = 25">Y</xsl:when>
- <xsl:when test="$number = 26">Z</xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="search-left-top-validation-inacell">
- <xsl:param name="row-num"/>
- <xsl:param name="column-num"/>
- <xsl:param name="cell"/>
- <xsl:param name="validation-name"/>
- <xsl:choose>
- <xsl:when test="$cell/@table:content-validation-name=$validation-name">
- <xsl:value-of select="concat($cell/ancestor::table:table/@table:name,'.',$column-num,' ',$row-num)"/>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="search-left-top-validation-inarow">
- <xsl:param name="row-num"/>
- <xsl:param name="column-num"/>
- <xsl:param name="firstcells"/>
- <xsl:param name="validation-name"/>
- <xsl:param name="return"/>
- <xsl:choose>
- <xsl:when test="$firstcells and $return=''">
- <xsl:variable name="firstcell" select="$firstcells[1]"/>
- <xsl:variable name="first-left-top">
- <xsl:call-template name="search-left-top-validation-inacell">
- <xsl:with-param name="row-num" select="$row-num"/>
- <xsl:with-param name="column-num" select="$column-num"/>
- <xsl:with-param name="cell" select="$firstcell"/>
- <xsl:with-param name="validation-name" select="$validation-name"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="column-num-p">
- <xsl:choose>
- <xsl:when test="$firstcell/@table:number-columns-repeated">
- <xsl:value-of select="$column-num+ $firstcell/@table:number-columns-repeated"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$column-num+ 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="rest-left-top">
- <xsl:call-template name="search-left-top-validation-inarow">
- <xsl:with-param name="row-num" select="$row-num"/>
- <xsl:with-param name="column-num" select="$column-num-p"/>
- <xsl:with-param name="firstcells" select="$firstcells[position()!=1]"/>
- <xsl:with-param name="validation-name" select="$validation-name"/>
- <xsl:with-param name="return" select="$first-left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-left-top!=''">
- <xsl:value-of select="$first-left-top"/>
- </xsl:when>
- <xsl:when test="$rest-left-top !=''">
- <xsl:value-of select="$rest-left-top "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$return"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ </xsl:if>
+ </xsl:if>
+ <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
+ <xsl:if test="style:graphic-properties/@fo:padding-left">
+ <xsl:attribute name="图:左边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-left,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="图:右边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-right,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="图:上边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-top,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="图:下边距"><xsl:value-of select="substring-before(style:graphic-properties/@fo:padding-bottom,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="图:文字排列方向"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-lr'">vert-l2r</xsl:when><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when></xsl:choose></xsl:when><xsl:when test="style:graphic-properties/@draw:textarea-horizontal-align='right'">hori-r2l</xsl:when><xsl:otherwise>hori-l2r</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="style:graphic-properties/@fo:wrap-option">
+ <xsl:attribute name="图:自动换行">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:auto-grow-width='true' or style:graphic-properties/@draw:auto-grow-height='true'">
+ <xsl:attribute name="图:大小适应文字">true</xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="text:p">
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ <xsl:if test="style:paragraph-properties">
+ <xsl:apply-templates select="style:paragraph-properties"/>
+ </xsl:if>
+ <xsl:call-template name="textp"/>
+ </xsl:for-each>
+ </图:文本内容>
+ </xsl:if>
+ <图:控制点 uof:locID="g0003" uof:attrList="x坐标 y坐标">
+ <xsl:attribute name="图:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="图:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
+ </图:控制点>
+ <!--新增内容-->
+ <xsl:if test="name(..)='draw:g'">
+ <图:组合位置 uof:locID="g0041" uof:attrList="x坐标 y坐标">
+ <xsl:attribute name="图:x坐标"><xsl:variable name="minx"><xsl:for-each select="parent::node()"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:variable><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:variable name="current-minx"><xsl:call-template name="groupminx"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:x][1]/@svg:x,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$current-minx - $minx"/></xsl:when><xsl:otherwise><xsl:variable name="current-x" select="number(substring-before(@svg:x,$uofUnit))"/><xsl:value-of select="$current-x - $minx"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:y坐标"><xsl:variable name="miny"><xsl:for-each select="parent::node()"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:variable><xsl:choose><xsl:when test="name(.)='draw:g'"><xsl:variable name="current-miny"><xsl:call-template name="groupminy"><xsl:with-param name="value" select="number(substring-before(descendant::node()[@svg:y][1]/@svg:y,$uofUnit))"/><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:variable><xsl:value-of select="$current-miny - $miny"/></xsl:when><xsl:otherwise><xsl:variable name="current-y" select="number(substring-before(@svg:y,$uofUnit))"/><xsl:value-of select="$current-y - $miny"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </图:组合位置>
+ </xsl:if>
+ <!--Redoffice comment liliang 06.03.28 end-->
+ </图:图形>
+ <xsl:if test="name()='draw:image'">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <xsl:attribute name="uof:公共类型">png</xsl:attribute>
+ <xsl:if test="./office:binary-data">
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="./office:binary-data"/>
+ </uof:数据>
+ </xsl:if>
+ <xsl:if test="@xlink:href">
+ <uof:路径 uof:locID="u0038">
+ <xsl:value-of select="@xlink:href"/>
+ </uof:路径>
+ </xsl:if>
+ </uof:其他对象>
+ </xsl:if>
+ <xsl:if test="name()='draw:frame'">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <xsl:attribute name="uof:公共类型">png</xsl:attribute>
+ <xsl:if test="draw:image/office:binary-data">
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="draw:image/office:binary-data"/>
+ </uof:数据>
+ </xsl:if>
+ <xsl:if test="@xlink:href">
+ <uof:路径 uof:locID="u0038">
+ <xsl:value-of select="@xlink:href"/>
+ </uof:路径>
+ </xsl:if>
+ </uof:其他对象>
+ </xsl:if>
+ <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
+ <xsl:if test="style:graphic-properties/@draw:fill-image-name">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:attribute>
+ <xsl:attribute name="uof:公共类型">png</xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <xsl:variable name="fill-name">
+ <xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/>
+ </xsl:variable>
+ <uof:数据 uof:locID="u0037">
+ <xsl:for-each select="/office:document/office:styles/draw:fill-image[@draw:name=$fill-name]">
+ <xsl:value-of select="office:binary-data"/>
+ </xsl:for-each>
+ </uof:数据>
+ <uof:路径 uof:locID="u0038">
+ <xsl:value-of select="@xlink:href"/>
+ </uof:路径>
+ </uof:其他对象>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <!--Redoffice comment liliang 06.03.29-->
+ <!--新增内容-->
+ <xsl:template name="graphicattr">
+ <xsl:variable name="aa" select="@style:name"/>
+ <xsl:if test="not(style:graphic-properties/@draw:fill='none')">
+ <图:填充 uof:locID="g0012">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:fill='gradient'">
+ <xsl:variable name="gradient-name">
+ <xsl:value-of select="style:graphic-properties/@draw:fill-gradient-name"/>
+ </xsl:variable>
+ <xsl:for-each select="/descendant::draw:gradient[@draw:name=$gradient-name]">
+ <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
+ <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
+ <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
+ <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
+ <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
+ <xsl:variable name="angle">
+ <xsl:value-of select="@draw:angle div 10"/>
+ </xsl:variable>
+ <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
+ <xsl:if test="@draw:cx">
+ <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@draw:cy">
+ <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="图:类型">-2</xsl:attribute>
+ </图:渐变>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:fill-image-name">
+ <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
+ <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:graphic-properties/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:graphic-properties/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:图形引用"><xsl:value-of select="concat($aa,'_b1')"/></xsl:attribute>
+ <xsl:attribute name="图:类型">png</xsl:attribute>
+ <xsl:attribute name="图:名称"><xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/></xsl:attribute>
+ </图:图片>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:fill='hatch'">
+ <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
+ <xsl:if test="/office:document/office:styles/draw:hatch/@draw:name">
+ <xsl:attribute name="图:类型"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="图:图形引用">rogr1</xsl:attribute>
+ <xsl:if test="/office:document/office:styles/draw:hatch/@draw:color">
+ <xsl:attribute name="图:前景色"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:color"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="图:背景色"><xsl:choose><xsl:when test="style:graphic-properties/@draw:fill-color"><xsl:value-of select="style:graphic-properties/@draw:fill-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
+ </图:图案>
+ </xsl:when>
+ <xsl:otherwise>
+ <图:颜色 uof:locID="g0034">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:fill-color">
+ <xsl:value-of select="style:graphic-properties/@draw:fill-color"/>
+ </xsl:when>
+ <xsl:otherwise>#99ccff</xsl:otherwise>
+ </xsl:choose>
+ </图:颜色>
+ </xsl:otherwise>
+ </xsl:choose>
+ </图:填充>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@svg:stroke-color">
+ <图:线颜色 uof:locID="g0013">
+ <xsl:value-of select="style:graphic-properties/@svg:stroke-color"/>
+ </图:线颜色>
+ </xsl:if>
+ <图:线型 uof:locID="g0014">
+ <xsl:call-template name="表:线型"/>
+ </图:线型>
+ <xsl:if test="style:graphic-properties/@svg:stroke-width">
+ <图:线粗细 uof:locID="g0016">
+ <xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-width,$uofUnit)"/>
+ </图:线粗细>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:marker-start and string-length(style:graphic-properties/@draw:marker-start)&gt;0">
+ <图:前端箭头 uof:locID="g0017">
+ <图:式样 uof:locID="g0018">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow'">normal</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Line Arrow'">open</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow concave'">stealth</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Circle'">oval</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Square 45'">diamond</xsl:when>
+ <xsl:otherwise>normal</xsl:otherwise>
+ </xsl:choose>
+ </图:式样>
+ <xsl:if test="style:graphic-properties/@draw:marker-start-width">
+ <图:大小 uof:locID="g0019">
+ <xsl:variable name="width">
+ <xsl:value-of select="substring-before(style:graphic-properties/@draw:marker-start-width,$uofUnit)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="($width&lt;0.05 and 0&lt;$width) or $width=0.05">1</xsl:when>
+ <xsl:when test="($width&lt;0.10 and 0.05&lt;$width) or $width=0.10">2</xsl:when>
+ <xsl:when test="($width&lt;0.15 and 0.10&lt;$width) or $width=0.15">3</xsl:when>
+ <xsl:when test="($width&lt;0.20 and 0.15&lt;$width) or $width=0.20">4</xsl:when>
+ <xsl:when test="($width&lt;0.25 and 0.20&lt;$width) or $width=0.25">5</xsl:when>
+ <xsl:when test="($width&lt;0.30 and 0.25&lt;$width) or $width=0.30">6</xsl:when>
+ <xsl:when test="($width&lt;0.35 and 0.30&lt;$width) or $width=0.35">7</xsl:when>
+ <xsl:when test="($width&lt;0.40 and 0.35&lt;$width) or $width=0.40">8</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </图:大小>
+ </xsl:if>
+ </图:前端箭头>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:marker-end">
+ <!--0820 by lil -->
+ <图:后端箭头 uof:locID="g0020">
+ <图:式样 uof:locID="g0021">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow'">normal</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Line Arrow'">open</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow concave'">stealth</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Circle'">oval</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Square 45'">diamond</xsl:when>
+ <xsl:otherwise>normal</xsl:otherwise>
+ </xsl:choose>
+ </图:式样>
+ <xsl:if test="style:graphic-properties/@draw:marker-end-width">
+ <图:大小 uof:locID="g0022">
+ <xsl:variable name="width">
+ <xsl:value-of select="number(substring-before(style:graphic-properties/@draw:marker-end-width,$uofUnit))"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="($width&lt;0.05 and 0&lt;$width) or $width=0.05">1</xsl:when>
+ <xsl:when test="($width&lt;0.10 and 0.05&lt;$width) or $width=0.10">2</xsl:when>
+ <xsl:when test="($width&lt;0.15 and 0.10&lt;$width) or $width=0.15">3</xsl:when>
+ <xsl:when test="($width&lt;0.20 and 0.15&lt;$width) or $width=0.20">4</xsl:when>
+ <xsl:when test="($width&lt;0.25 and 0.20&lt;$width) or $width=0.25">5</xsl:when>
+ <xsl:when test="($width&lt;0.30 and 0.25&lt;$width) or $width=0.30">6</xsl:when>
+ <xsl:when test="($width&lt;0.35 and 0.30&lt;$width) or $width=0.35">7</xsl:when>
+ <xsl:when test="($width&lt;0.40 and 0.35&lt;$width) or $width=0.40">8</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </图:大小>
+ </xsl:if>
+ </图:后端箭头>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:opacity">
+ <xsl:variable name="trans" select="style:graphic-properties/@draw:opacity"/>
+ <图:透明度 uof:locID="g0038">
+ <xsl:value-of select="substring($trans,1,2)"/>
+ </图:透明度>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="groupminx">
+ <xsl:param name="value"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="descendant::node()[@svg:x][position()=$pos]">
+ <xsl:variable name="othervalue" select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:x,$uofUnit))"/>
+ <xsl:call-template name="groupminx">
+ <xsl:with-param name="value">
+ <xsl:choose>
+ <xsl:when test="$value&gt;$othervalue">
+ <xsl:value-of select="$othervalue"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--Redoffice comment liliang end 06.03.29-->
+ <!--Redoffice comment liliang 06.03.29-->
+ <!--新增内容-->
+ <xsl:template name="groupminy">
+ <xsl:param name="value"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="descendant::node()[@svg:y][position()=$pos]">
+ <xsl:variable name="othervalue" select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:y,$uofUnit))"/>
+ <xsl:call-template name="groupminy">
+ <xsl:with-param name="value">
+ <xsl:choose>
+ <xsl:when test="$value&gt;$othervalue">
+ <xsl:value-of select="$othervalue"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="groupmaxx">
+ <xsl:param name="value"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="descendant::node()[@svg:x][position()=$pos]">
+ <xsl:variable name="svgx">
+ <xsl:value-of select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:x,$uofUnit))"/>
+ </xsl:variable>
+ <xsl:variable name="width">
+ <xsl:value-of select="number(substring-before(descendant::node()[@svg:x][position()=$pos]/@svg:width,$uofUnit))"/>
+ </xsl:variable>
+ <xsl:variable name="othervalue" select="$svgx + $width"/>
+ <xsl:call-template name="groupminx">
+ <xsl:with-param name="value">
+ <xsl:choose>
+ <xsl:when test="$value&gt;$othervalue">
+ <xsl:value-of select="$value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$othervalue"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="groupmaxy">
+ <xsl:param name="value"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="descendant::node()[@svg:y][position()=$pos]">
+ <xsl:variable name="svgy">
+ <xsl:value-of select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:y,$uofUnit))"/>
+ </xsl:variable>
+ <xsl:variable name="height">
+ <xsl:value-of select="number(substring-before(descendant::node()[@svg:y][position()=$pos]/@svg:height,$uofUnit))"/>
+ </xsl:variable>
+ <xsl:variable name="othervalue" select="$svgy + $height"/>
+ <xsl:call-template name="groupminy">
+ <xsl:with-param name="value">
+ <xsl:choose>
+ <xsl:when test="$value&gt;$othervalue">
+ <xsl:value-of select="$value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$othervalue"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--Redoffice comment liliang end 06.03.29-->
+ <xsl:template name="draw:points">
+ <xsl:param name="point"/>
+ <xsl:param name="lujing"/>
+ <xsl:choose>
+ <xsl:when test="contains($point,' ' )">
+ <xsl:variable name="first-point" select="substring-before($point,' ')"/>
+ <xsl:variable name="other-point" select="substring-after($point,' ')"/>
+ <xsl:variable name="xzuobiao">
+ <xsl:value-of select="substring-before($first-point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:variable name="yzuobiao">
+ <xsl:value-of select="substring-after($first-point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:call-template name="draw:points">
+ <xsl:with-param name="point" select="$other-point"/>
+ <xsl:with-param name="lujing" select="concat($lujing,$xzuobiao,' ',$yzuobiao,'lineto')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="xzuobiao">
+ <xsl:value-of select="substring-before($point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:variable name="yzuobiao">
+ <xsl:value-of select="substring-after($point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:value-of select="concat($lujing,$xzuobiao,' ',$yzuobiao)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--Redoffice comment end liliang-->
+ <!--chenjh add 20050624-->
+ <xsl:template name="create-page-setting">
+ <xsl:param name="master-page"/>
+ <xsl:param name="page-master-style"/>
+ <xsl:element name="表:页面设置">
+ <xsl:attribute name="uof:locID">s0029</xsl:attribute>
+ <xsl:attribute name="uof:attrList">名称</xsl:attribute>
+ <xsl:attribute name="表:名称"><xsl:value-of select="$master-page/@style:name"/></xsl:attribute>
+ <xsl:element name="表:纸张">
+ <xsl:attribute name="uof:locID">s0030</xsl:attribute>
+ <xsl:attribute name="uof:attrList">纸型 宽度 高度</xsl:attribute>
+ <xsl:attribute name="uof:纸型"><xsl:variable name="height"><xsl:value-of select="$page-master-style/@fo:page-height"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="$page-master-style/@fo:page-width"/></xsl:variable><xsl:choose><xsl:when test="$width='29.699cm' and $height='42cm'">A3</xsl:when><xsl:when test="not($page-master-style/@fo:page-height) and not($page-master-style/@fo:page-width)">A4</xsl:when><xsl:when test="$width='14.799cm' and $height='20.999cm'">A5</xsl:when><xsl:when test="$width='25cm' and $height='35.299cm'">B4</xsl:when><xsl:when test="$width='17.598cm' and $height='25cm'">B5</xsl:when><xsl:when test="$width='12.499cm' and $height='17.598cm'">B6</xsl:when><xsl:otherwise>使用者</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:choose><xsl:when test="$page-master-style/@fo:page-width"><xsl:value-of select="substring-before($page-master-style/@fo:page-width,$uofUnit)"/></xsl:when><xsl:otherwise><xsl:call-template name="setDefaultPageWidth"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:高度"><xsl:choose><xsl:when test="$page-master-style/@fo:page-height"><xsl:value-of select="substring-before($page-master-style/@fo:page-height,$uofUnit)"/></xsl:when><xsl:otherwise><xsl:call-template name="setDefaultPageHeight"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="表:纸张方向">
+ <xsl:attribute name="uof:locID">s0031</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$page-master-style/@style:print-orientation">
+ <xsl:value-of select="$page-master-style/@style:print-orientation"/>
+ </xsl:when>
+ <xsl:otherwise>portrait</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="表:缩放">
+ <xsl:attribute name="uof:locID">s0032</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$page-master-style/@style:scale-to">
+ <xsl:value-of select="$page-master-style/@style:scale-to"/>
+ </xsl:when>
+ <xsl:otherwise>100</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="$page-master-style/@fo:margin-left or $page-master-style/@fo:margin-top or $page-master-style/@fo:margin-right or $page-master-style/@fo:margin-bottom">
+ <xsl:element name="表:页边距">
+ <xsl:attribute name="uof:locID">s0033</xsl:attribute>
+ <xsl:attribute name="uof:attrList">左 上 右 下</xsl:attribute>
+ <xsl:attribute name="uof:左"><xsl:value-of select="substring-before($page-master-style/@fo:margin-left,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:上"><xsl:value-of select="substring-before($page-master-style/@fo:margin-top,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:右"><xsl:value-of select="substring-before($page-master-style/@fo:margin-right,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:下"><xsl:value-of select="substring-before($page-master-style/@fo:margin-bottom,$uofUnit)"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:for-each select="$master-page[@style:page-layout-name='pm1']/style:header/child::*">
+ <表:页眉页脚 uof:locID="s0034" uof:attrList="位置">
+ <xsl:attribute name="表:位置"><xsl:choose><xsl:when test="name()='style:region-left'">headerleft</xsl:when><xsl:when test="name()='style:region-right'">headerright</xsl:when><xsl:otherwise>headercenter</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:call-template name="create-page-header-footer-paragraph">
+ <xsl:with-param name="paragraph-set" select="text:p"/>
+ </xsl:call-template>
+ </表:页眉页脚>
+ </xsl:for-each>
+ <xsl:for-each select="$master-page[@style:page-layout-name='pm1']/style:footer/child::*">
+ <表:页眉页脚 uof:locID="s0034" uof:attrList="位置">
+ <xsl:attribute name="表:位置"><xsl:choose><xsl:when test="name()='style:region-left'">footerleft</xsl:when><xsl:when test="name()='style:region-right'">footerright</xsl:when><xsl:otherwise>footercenter</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:call-template name="create-page-header-footer-paragraph">
+ <xsl:with-param name="paragraph-set" select="text:p"/>
+ </xsl:call-template>
+ </表:页眉页脚>
+ </xsl:for-each>
+ <xsl:if test="$page-master-style/@style:print-page-order or $page-master-style/@style:print">
+ <表:打印 uof:locID="s126" uof:attrList="网格线 行号列标 按草稿方式 先列后行">
+ <xsl:if test="$page-master-style/@style:print-page-order='ltr'">
+ <xsl:attribute name="表:先列后行">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="contains($page-master-style/@style:print,'grid')">
+ <xsl:attribute name="表:网格线">true</xsl:attribute>
+ </xsl:if>
+ </表:打印>
+ </xsl:if>
+ <xsl:if test="$page-master-style/@style:table-centering='vertical' or $page-master-style/@style:table-centering='both'">
+ <表:垂直对齐 uof:locID="s0128" uof:attrList="对齐方式">
+ <xsl:attribute name="表:对齐方式">center</xsl:attribute>
+ </表:垂直对齐>
+ </xsl:if>
+ <xsl:if test="$page-master-style/@style:table-centering='horizontal' or $page-master-style/@style:table-centering='both'">
+ <表:水平对齐 uof:locID="s0129" uof:attrList="对齐方式">
+ <xsl:attribute name="表:对齐方式">center</xsl:attribute>
+ </表:水平对齐>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="create-page-header-footer-paragraph">
+ <xsl:param name="paragraph-set"/>
+ <xsl:choose>
+ <xsl:when test="$paragraph-set">
+ <xsl:element name="字:段落">
+ <xsl:attribute name="uof:locID">t0051</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:element name="字:句">
+ <xsl:attribute name="uof:locID">t0085</xsl:attribute>
+ <xsl:apply-templates select="$paragraph-set//text()">
+ <xsl:with-param name="bText" select="'0'"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:element>
+ <xsl:call-template name="create-page-header-footer-paragraph">
+ <xsl:with-param name="paragraph-set" select="$paragraph-set[position()!=1]"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="text:p" name="textp">
+ <xsl:apply-templates select="text()|text:span|text:tab-stop|text:line-break|text:s|text:ruby|text:bookmark|text:bookmark-start|text:bookmark-end|text:a|text:footnote|text:endnote">
+ <xsl:with-param name="bText" select="'1'"/>
+ <xsl:with-param name="sText" select="'1'"/>
+ </xsl:apply-templates>
+ </xsl:template>
+ <xsl:template match="text:a">
+ <xsl:param name="bText"/>
+ <xsl:choose>
+ <xsl:when test="$bText='0'">
+ <xsl:element name="字:句">
+ <xsl:attribute name="uof:locID">t0085</xsl:attribute>
+ <xsl:element name="字:区域开始">
+ <xsl:attribute name="字:标识符"><xsl:value-of select="generate-id(.)"/></xsl:attribute>
+ <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0121</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="字:区域开始">
+ <xsl:attribute name="字:标识符"><xsl:value-of select="generate-id(.)"/></xsl:attribute>
+ <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0121</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="text()">
+ <xsl:param name="bText"/>
+ <xsl:param name="sText"/>
+ <xsl:if test="normalize-space(.)!=''">
+ <xsl:choose>
+ <xsl:when test="$bText='1' and $sText='1'">
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="."/>
+ </字:文本串>
+ </字:句>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:文本串 uof:locID="t0109" uof:attrList="udsPath">
+ <xsl:value-of select="."/>
+ </字:文本串>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="text:span">
+ <xsl:param name="bText"/>
+ <xsl:choose>
+ <xsl:when test="$bText='0'">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </字:句属性>
+ <xsl:apply-templates select="text:s|text()|text:line-break|text:tab-stop| text:a | text:footnote|text:endnote|draw:image|office:annotation|draw:frame">
+ <xsl:with-param name="bText" select="1"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用" 字:式样引用="{@text:style-name}"/>
+ <xsl:apply-templates select="text:s|text()|text:line-break|text:tab-stop| text:a |text:footnote|text:endnote|draw:image|office:annotation|draw:frame">
+ <xsl:with-param name="bText" select="1"/>
+ </xsl:apply-templates>
+ </字:句>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="text:s">
+ <xsl:param name="bText"/>
+ <xsl:choose>
+ <xsl:when test="$bText='0'">
+ <xsl:variable name="count">
+ <xsl:choose>
+ <xsl:when test="not(@text:c)">1</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@text:c"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <字:句 uof:locID="t0085">
+ <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{$count}"/>
+ </字:句>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{@text:c}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="text:line-break">
+ <xsl:param name="bText"/>
+ <xsl:choose>
+ <xsl:when test="$bText='0'">
+ <字:句 uof:locID="t0085">
+ <字:换行符 uof:locID="t0124"/>
+ </字:句>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:换行符 uof:locID="t0124"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="text:tab-stop">
+ <xsl:param name="bText"/>
+ <xsl:choose>
+ <xsl:when test="$bText='0'">
+ <字:句 uof:locID="t0085">
+ <字:制表符 uof:locID="t0123"/>
+ </字:句>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:制表符 uof:locID="t0123"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--chenjh0713-->
+ <!--chenjh0629E-->
+ <!--chenjh add 20050629 -->
+ <!--字符串转换为数字-->
+ <xsl:template name="translate-column-char-to-number">
+ <xsl:param name="string"/>
+ <xsl:choose>
+ <xsl:when test="string-length($string)=1">
+ <xsl:call-template name="char-to-number">
+ <xsl:with-param name="char" select="$string"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="tens-place">
+ <xsl:call-template name="char-to-number">
+ <xsl:with-param name="char" select="substring($string,1,1)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="units-place">
+ <xsl:call-template name="char-to-number">
+ <xsl:with-param name="char" select="substring($string,2,1)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$tens-place * 26 + $units-place"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="char-to-number">
+ <xsl:param name="char"/>
+ <xsl:choose>
+ <xsl:when test="$char='A'">1</xsl:when>
+ <xsl:when test="$char='B'">2</xsl:when>
+ <xsl:when test="$char='C'">3</xsl:when>
+ <xsl:when test="$char='D'">4</xsl:when>
+ <xsl:when test="$char='E'">5</xsl:when>
+ <xsl:when test="$char='F'">6</xsl:when>
+ <xsl:when test="$char='G'">7</xsl:when>
+ <xsl:when test="$char='H'">8</xsl:when>
+ <xsl:when test="$char='I'">9</xsl:when>
+ <xsl:when test="$char='J'">10</xsl:when>
+ <xsl:when test="$char='K'">11</xsl:when>
+ <xsl:when test="$char='L'">12</xsl:when>
+ <xsl:when test="$char='M'">13</xsl:when>
+ <xsl:when test="$char='N'">14</xsl:when>
+ <xsl:when test="$char='O'">15</xsl:when>
+ <xsl:when test="$char='P'">16</xsl:when>
+ <xsl:when test="$char='Q'">17</xsl:when>
+ <xsl:when test="$char='R'">18</xsl:when>
+ <xsl:when test="$char='S'">19</xsl:when>
+ <xsl:when test="$char='T'">20</xsl:when>
+ <xsl:when test="$char='U'">21</xsl:when>
+ <xsl:when test="$char='V'">22</xsl:when>
+ <xsl:when test="$char='W'">23</xsl:when>
+ <xsl:when test="$char='X'">24</xsl:when>
+ <xsl:when test="$char='Y'">25</xsl:when>
+ <xsl:when test="$char='Z'">26</xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="create-filter-conditions">
+ <xsl:param name="filter-condition-set"/>
+ <xsl:param name="zone-left-column-num"/>
+ <xsl:if test="$filter-condition-set">
+ <xsl:variable name="first-condition" select="$filter-condition-set"/>
+ <xsl:element name="表:条件">
+ <xsl:attribute name="uof:locID">s0103</xsl:attribute>
+ <xsl:attribute name="uof:attrList">列号</xsl:attribute>
+ <xsl:attribute name="表:列号"><xsl:value-of select="$zone-left-column-num + $first-condition/@table:field-number"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$first-condition/@table:operator ='top values'">
+ <xsl:element name="表:普通">
+ <xsl:attribute name="uof:locID">s0104</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 值</xsl:attribute>
+ <xsl:attribute name="表:类型">topitem</xsl:attribute>
+ <xsl:attribute name="表:值"><xsl:value-of select="$first-condition/@table:value"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="表:自定义">
+ <xsl:attribute name="uof:locID">s0105</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:element name="表:操作条件">
+ <xsl:attribute name="uof:locID">s0106</xsl:attribute>
+ <!--redoffice comment from lvxg 8.27-->
+ <xsl:if test="$first-condition/@table:operator">
+ <xsl:element name="表:操作码">
+ <xsl:attribute name="uof:locID">s0009</xsl:attribute>
+ <xsl:variable name="operator-text" select="$first-condition/@table:operator"/>
+ <xsl:choose>
+ <xsl:when test="$operator-text ='&lt;' ">less than</xsl:when>
+ <xsl:when test="$operator-text ='&gt;' ">greater than</xsl:when>
+ <xsl:when test="$operator-text ='=' ">equal to</xsl:when>
+ <xsl:when test="$operator-text ='&gt;=' ">greater than or equal to</xsl:when>
+ <xsl:when test="$operator-text ='&lt;=' ">less than or equal to</xsl:when>
+ <xsl:when test="$operator-text ='!=' ">not equal to</xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="表:值">
+ <xsl:attribute name="uof:locID">s0107</xsl:attribute>
+ <xsl:value-of select="$first-condition/@table:value"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:call-template name="create-filter-conditions">
+ <xsl:with-param name="filter-condition-set" select="$filter-condition-set[position()!=1]"/>
+ <xsl:with-param name="zone-left-column-num" select="$zone-left-column-num"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="create-view">
+ <xsl:param name="table-name"/>
+ <xsl:param name="view-id"/>
+ <!--xsl:param name="ActiveTable"/-->
+ <xsl:param name="aaa"/>
+ <!--xsl:variable name="aaa" select="/*/office:settings/config:config-item-set/config:config-item-map-indexed"-->
+ <xsl:element name="表:视图">
+ <xsl:attribute name="uof:locID">s0035</xsl:attribute>
+ <xsl:attribute name="uof:attrList">窗口标识符</xsl:attribute>
+ <xsl:attribute name="表:窗口标识符"><xsl:value-of select="$view-id"/></xsl:attribute>
+ <xsl:if test="$table-name='ActiveTable'">
+ <xsl:element name="表:选中">
+ <xsl:attribute name="uof:locID">s0036</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="表:值">1</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:variable name="name" select="./@table:name"/>
+ <xsl:choose>
+ <xsl:when test="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='HorizontalSplitMode']/text()='2' or $aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=name]/config:config-item[@config:name='VerticalSplitMode']/text()='2' ">
+ <xsl:element name="表:冻结">
+ <xsl:attribute name="uof:locID">s0038</xsl:attribute>
+ <xsl:attribute name="uof:attrList">行号 列号</xsl:attribute>
+ <xsl:attribute name="表:行号"><xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='VerticalSplitPosition']/text()"/></xsl:attribute>
+ <xsl:attribute name="表:列号"><xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='HorizontalSplitPosition']/text()"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="表:拆分">
+ <xsl:attribute name="uof:locID">s0037</xsl:attribute>
+ <xsl:attribute name="uof:attrList">宽度 高度</xsl:attribute>
+ <xsl:attribute name="表:宽度"><xsl:choose><xsl:when test="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='HorizontalSplitMode']/text()='1'"><xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='HorizontalSplitPosition']/text()"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="表:高度"><xsl:choose><xsl:when test="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='VerticalSplitMode']/text()='1'"><xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$name]/config:config-item[@config:name='VerticalSplitPosition']/text()"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:element name="表:最上行">
+ <xsl:attribute name="uof:locID">s0039</xsl:attribute>
+ <!--xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$table-name]/config:config-item[@config:name='PositionBottom']/text()+1"/-->
+ <xsl:choose>
+ <xsl:when test="$aaa/config:config-item-map-named/config:config-item-map-entry/config:config-item[@config:name='PositionBottom']/text()">
+ <xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry/config:config-item[@config:name='PositionBottom']/text()"/>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="表:最左列">
+ <xsl:attribute name="uof:locID">s0040</xsl:attribute>
+ <!--xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry[@config:name=$table-name]/config:config-item[@config:name='PositionLeft']/text() + 1"/-->
+ <xsl:choose>
+ <xsl:when test="$aaa/config:config-item-map-named/config:config-item-map-entry/config:config-item[@config:name='PositionRight']/text()">
+ <xsl:value-of select="$aaa/config:config-item-map-named/config:config-item-map-entry/config:config-item[@config:name='PositionRight']/text()"/>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="表:当前视图">
+ <xsl:attribute name="uof:locID">s0041</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="$aaa/config:config-item[@config:name='ShowPageBreakPreview']/text()='true'">page</xsl:when><xsl:otherwise>normal</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="表:网格">
+ <xsl:attribute name="uof:locID">s0043</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="表:值"><xsl:choose><xsl:when test="/*/office:settings/config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='ShowGrid']/text()='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="表:网格颜色">
+ <xsl:attribute name="uof:locID">s0044</xsl:attribute>
+ <xsl:variable name="GridColor-text">
+ <xsl:value-of select="//config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='GridColor']/text()"/>
+ </xsl:variable>
+ <xsl:variable name="R-color" select="floor($GridColor-text div 65536)"/>
+ <xsl:variable name="G-color" select="floor(($GridColor-text - ($R-color * 65536)) div 256)"/>
+ <xsl:variable name="B-color" select="$GridColor-text - ($R-color * 65536)- ($G-color * 256)"/>
+ <xsl:variable name="R-color-in-16">
+ <xsl:call-template name="transform-decimal-to-hexadecimal">
+ <xsl:with-param name="color-decimal" select="$R-color"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="G-color-in-16">
+ <xsl:call-template name="transform-decimal-to-hexadecimal">
+ <xsl:with-param name="color-decimal" select="$G-color"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="B-color-in-16">
+ <xsl:call-template name="transform-decimal-to-hexadecimal">
+ <xsl:with-param name="color-decimal" select="$B-color"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat('#',$R-color-in-16,$G-color-in-16,$B-color-in-16)"/>
+ </xsl:element>
+ <xsl:if test="/*/office:settings/config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='ZoomType']/text()=0">
+ <xsl:element name="表:缩放">
+ <xsl:attribute name="uof:locID">s0045</xsl:attribute>
+ <xsl:value-of select="/*/office:settings/config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='ZoomValue']/text()"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="/*/office:settings/config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='ZoomType']/text()=1">
+ <xsl:element name="表:分页缩放">
+ <xsl:attribute name="uof:locID">s0046</xsl:attribute>
+ <xsl:value-of select="/*/office:settings/config:config-item-set[@config:name='ooo:view-settings']//config:config-item[@config:name='ZoomValue']/text()"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="hexNumber2dec">
+ <xsl:param name="hex-value"/>
+ <xsl:choose>
+ <xsl:when test="$hex-value = 'A' or ($hex-value = 'a')">
+ <xsl:value-of select="10"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'B' or ($hex-value = 'b')">
+ <xsl:value-of select="11"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'C' or ($hex-value = 'c')">
+ <xsl:value-of select="12"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'D' or ($hex-value = 'd')">
+ <xsl:value-of select="13"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'E' or ($hex-value = 'e')">
+ <xsl:value-of select="14"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'F' or ($hex-value = 'f')">
+ <xsl:value-of select="15"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$hex-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="hex2decimal">
+ <xsl:param name="hex-number"/>
+ <xsl:param name="index"/>
+ <xsl:param name="str-length"/>
+ <xsl:param name="last-value"/>
+ <xsl:variable name="dec-char">
+ <xsl:call-template name="hexNumber2dec">
+ <xsl:with-param name="hex-value" select="substring($hex-number, $index ,1)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="current-value" select="$last-value * 16 + $dec-char"/>
+ <xsl:if test="$index &lt; $str-length">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="$hex-number"/>
+ <xsl:with-param name="index" select="$index + 1"/>
+ <xsl:with-param name="str-length" select="$str-length"/>
+ <xsl:with-param name="last-value" select="$current-value"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$index = $str-length">
+ <xsl:value-of select="$current-value"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="table:calculation-settings" mode="common">
+ <xsl:if test="@table:precision-as-shown">
+ <xsl:element name="表:精确度以显示值为准">
+ <xsl:attribute name="uof:locID">s0002</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="表:值"><xsl:value-of select="@table:precision-as-shown"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="表:日期系统-1904">
+ <xsl:attribute name="uof:locID">s0003</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="表:值"><xsl:choose><xsl:when test="table:null-date/@table:date-value='1904-01-01'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:if test="table:iteration/@table:status='enable'">
+ <表:计算设置 uof:locID="s0004" uof:attrList="迭代次数 偏差值">
+ <xsl:attribute name="表:迭代次数"><xsl:value-of select="table:iteration/@table:steps"/></xsl:attribute>
+ <xsl:attribute name="表:偏差值"><xsl:choose><xsl:when test="table:iteration/@table:maximum-difference"><xsl:value-of select="table:iteration/@table:maximum-difference"/></xsl:when><xsl:otherwise>0.001</xsl:otherwise></xsl:choose><!--xsl:value-of select="table:iteration/@table:maximum-difference"/--></xsl:attribute>
+ </表:计算设置>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="office:automatic-styles" mode="common">
+ <xsl:element name="表:条件格式化集">
+ <xsl:attribute name="uof:locID">s0016</xsl:attribute>
+ <xsl:variable name="temp-path" select="../office:automatic-styles/style:style"/>
+ <xsl:for-each select="$temp-path/style:map">
+ <xsl:element name="表:条件格式化">
+ <xsl:attribute name="uof:locID">s0017</xsl:attribute>
+ <xsl:element name="表:区域">
+ <xsl:attribute name="uof:locID">s0007</xsl:attribute>
+ <xsl:variable name="range-name">
+ <xsl:value-of select="substring-before(@style:base-cell-address,'.')"/>
+ </xsl:variable>
+ <xsl:variable name="range-value">
+ <xsl:value-of select="substring-after(@style:base-cell-address,'.')"/>
+ </xsl:variable>
+ <xsl:value-of select="concat(&quot;&apos;&quot;,$range-name,&quot;&apos;&quot;,'!$',substring($range-value,1,1),'$',substring($range-value,2))"/>
+ </xsl:element>
+ <xsl:element name="表:条件">
+ <xsl:attribute name="uof:locID">s0019</xsl:attribute>
+ <xsl:attribute name="表:类型"><xsl:choose><xsl:when test="contains(@style:condition,'formula')"><xsl:value-of select="'formula'"/></xsl:when><xsl:otherwise><xsl:value-of select="'cell value'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:element name="表:操作码">
+ <xsl:attribute name="uof:locID">s0009</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="contains(@style:condition,'!=')">
+ <xsl:value-of select="'not equal to'"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'&lt;=')">
+ <xsl:value-of select="'less than or equal to'"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'&gt;=')">
+ <xsl:value-of select="'greater than or equal to'"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'&lt;')">
+ <xsl:value-of select="'less than'"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'&gt;')">
+ <xsl:value-of select="'greater than'"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'=')">
+ <xsl:value-of select="'equal to'"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'not-between')">
+ <xsl:value-of select="'not-between'"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'between')">
+ <xsl:value-of select="'between'"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="表:第一操作数">
+ <xsl:attribute name="uof:locID">s0010</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="contains(@style:condition,'formula')">
+ <xsl:value-of select="substring-after(substring-before(@style:condition,')'),'(')"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'=')">
+ <xsl:value-of select="substring-after(@style:condition,'=')"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'&lt;') and not(contains(@style:condition,'&lt;='))">
+ <xsl:value-of select="substring-after(@style:condition,'&lt;')"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'&gt;') and not(contains(@style:condition,'&gt;='))">
+ <xsl:value-of select="substring-after(@style:condition,'&gt;')"/>
+ </xsl:when>
+ <xsl:when test="contains(@style:condition,'between')">
+ <xsl:value-of select="substring-before(substring-after(@style:condition,'('),',')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="contains(@style:condition,',')">
+ <xsl:element name="表:第二操作数">
+ <xsl:attribute name="uof:locID">s0011</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="contains(@style:condition,'between')">
+ <xsl:value-of select="substring-before(substring-after(@style:condition,','),')')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="表:格式">
+ <xsl:attribute name="uof:locID">s0023</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="表:式样引用"><xsl:value-of select="@style:apply-style-name"/></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="table:content-validations" mode="common">
+ <xsl:element name="表:数据有效性集">
+ <xsl:attribute name="uof:locID">s0005</xsl:attribute>
+ <xsl:call-template name="create-validation-set">
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="create-validation-set">
+ <xsl:for-each select="//table:content-validation">
+ <xsl:element name="表:数据有效性">
+ <xsl:attribute name="uof:locID">s0006</xsl:attribute>
+ <xsl:variable name="conditiontext" select="@table:condition"/>
+ <xsl:variable name="operatortext" select="substring-after($conditiontext,'and ')"/>
+ <xsl:element name="表:区域">
+ <xsl:attribute name="uof:locID">s0007</xsl:attribute>
+ <xsl:variable name="left-top">
+ <xsl:call-template name="search-left-top-validation">
+ <xsl:with-param name="validation-name" select="@table:name"/>
+ <xsl:with-param name="tableslist" select="/*/office:body/office:spreadsheet/table:table"/>
+ <xsl:with-param name="return" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="after-translated-left-top">
+ <xsl:call-template name="translate-left-top">
+ <xsl:with-param name="left-top" select="$left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="base" select="@table:base-cell-address"/>
+ <xsl:variable name="base-column-and-row" select="substring-after($base,'.')"/>
+ <xsl:variable name="dd" select="number(substring($base-column-and-row,2,1))"/>
+ <xsl:variable name="base-column">
+ <xsl:choose>
+ <xsl:when test="contains($dd,'NaN') ">
+ <xsl:value-of select="substring($base-column-and-row,1,2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring($base-column-and-row,1,1)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="base-row" select="substring-after($base,$base-column)"/>
+ <xsl:variable name="after-translated-base-left-top">
+ <xsl:value-of select="concat('$',substring-before($base,'.'),'.$',$base-column,'$',$base-row)"/>
+ </xsl:variable>
+ <xsl:value-of select="concat('$',$after-translated-left-top,':',$after-translated-base-left-top)"/>
+ </xsl:element>
+ <xsl:element name="表:校验类型">
+ <xsl:attribute name="uof:locID">s0008</xsl:attribute>
+ <xsl:variable name="listtest">cell-content-is-in-list("</xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($conditiontext,'cell-content-is-whole-number()')">whole number</xsl:when>
+ <xsl:when test="contains($conditiontext,'cell-content-is-decimal-number()')">decimal</xsl:when>
+ <xsl:when test="contains($conditiontext,'cell-content-is-date()')">date</xsl:when>
+ <xsl:when test="contains($conditiontext,'cell-content-is-time()')">time</xsl:when>
+ <xsl:when test="contains($conditiontext,'cell-content-is-in-list') and not(contains($conditiontext,$listtest))">cell range</xsl:when>
+ <xsl:when test="contains($conditiontext,'cell-content-is-in-list') and contains($conditiontext,$listtest)">list</xsl:when>
+ <xsl:when test="contains($conditiontext,'cell-content-text-length')">text length</xsl:when>
+ <xsl:otherwise>any value</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="表:操作码">
+ <xsl:attribute name="uof:locID">s0009</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="starts-with($operatortext,'cell-content()&lt;=')">less than or equal to</xsl:when>
+ <xsl:when test="starts-with($operatortext,'cell-content()&gt;=')">greater than or equal to</xsl:when>
+ <xsl:when test="starts-with($operatortext,'cell-content()&lt;')">less than</xsl:when>
+ <xsl:when test="starts-with($operatortext,'cell-content()&gt;')">greater than</xsl:when>
+ <xsl:when test="starts-with($operatortext,'cell-content()!=')">not equal to</xsl:when>
+ <xsl:when test="starts-with($operatortext,'cell-content()=')">equal to</xsl:when>
+ <xsl:when test="starts-with($conditiontext,'oooc:cell-content-text-length()')">
+ <xsl:variable name="operator" select="substring-after($conditiontext,'oooc:cell-content-text-length()')"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($operator,'&lt;=')">less than or equal to</xsl:when>
+ <xsl:when test="starts-with($operator,'&gt;=')">greater than or equal to</xsl:when>
+ <xsl:when test="starts-with($operator,'&lt;')">less than</xsl:when>
+ <xsl:when test="starts-with($operator,'&gt;')">greater than</xsl:when>
+ <xsl:when test="starts-with($operator,'!=')">not equal to</xsl:when>
+ <xsl:when test="starts-with($operator,'=')">equal to</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="contains($conditiontext,'is-between')">between</xsl:when>
+ <xsl:when test="contains($conditiontext,'is-not-between')">not between</xsl:when>
+ <!-- 注意:uof有的另几种操作码在oo中没有,他们是contain,not contain,start with,not start with, end with,not end with-->
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="表:第一操作数">
+ <xsl:attribute name="uof:locID">s0010</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="starts-with($operatortext,'cell-content-is-between')">
+ <xsl:value-of select="substring-before(substring-after($operatortext,'cell-content-is-between('),',')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operatortext,'cell-content-is-not-between')">
+ <xsl:value-of select="substring-before(substring-after($operatortext,'cell-content-is-not-between('),',')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($conditiontext,'oooc:cell-content-text-length()')">
+ <xsl:variable name="operator" select="substring-after($conditiontext,'cell-content-text-length()')"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($operator,'&lt;=')">
+ <xsl:value-of select="substring-after($operator,'&lt;=')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operator,'&gt;=')">
+ <xsl:value-of select="substring-after($operator,'&gt;=')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operator,'&lt;')">
+ <xsl:value-of select="substring-after($operator,'&lt;')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operator,'&gt;')">
+ <xsl:value-of select="substring-after($operator,'&gt;')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operator,'!=')">
+ <xsl:value-of select="substring-after($operator,'!=')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operator,'=')">
+ <xsl:value-of select="substring-after($operator,'=')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="starts-with($conditiontext,'oooc:cell-content-is-in-list')">
+ <xsl:value-of select="substring-after($conditiontext,'oooc:cell-content-is-in-list')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($conditiontext,'oooc:cell-content-text-length-is-not-between')">
+ <xsl:value-of select="substring-before(substring-after($conditiontext,'oooc:cell-content-text-length-is-not-between('),',')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($conditiontext,'oooc:cell-content-text-length-is-between')">
+ <xsl:value-of select="substring-before(substring-after($conditiontext,'oooc:cell-content-text-length-is-between('),',')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operatortext,'cell-content()')">
+ <xsl:variable name="operator" select="substring-after($conditiontext,'oooc:cell-content()')"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($operator,'&lt;=')">
+ <xsl:value-of select="substring-after($operator,'&lt;=')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operator,'&gt;=')">
+ <xsl:value-of select="substring-after($operator,'&gt;=')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operator,'&lt;')">
+ <xsl:value-of select="substring-after($operator,'&lt;')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operator,'&gt;')">
+ <xsl:value-of select="substring-after($operator,'&gt;')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operator,'!=')">
+ <xsl:value-of select="substring-after($operator,'!=')"/>
+ </xsl:when>
+ <xsl:when test="starts-with($operator,'=')">
+ <xsl:value-of select="substring-after($operator,'=')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="starts-with($operatortext,'cell-content-is-between') or starts-with($operatortext,'cell-content-is-not-between')">
+ <xsl:element name="表:第二操作数">
+ <xsl:attribute name="uof:locID">s0011</xsl:attribute>
+ <xsl:value-of select="substring-before(substring-after($operatortext,','),')')"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="starts-with($conditiontext,'oooc:cell-content-text-length-is-not-between') or starts-with($conditiontext,'oooc:cell-content-text-length-is-between')">
+ <xsl:element name="表:第二操作数">
+ <xsl:attribute name="uof:locID">s0011</xsl:attribute>
+ <xsl:value-of select="substring-before(substring-after($conditiontext,','),')')"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="表:忽略空格">
+ <xsl:attribute name="uof:locID">s0012</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="表:值"><xsl:value-of select="@table:allow-empty-cell"/></xsl:attribute>
+ </xsl:element>
+ <xsl:if test="contains($conditiontext,'cell-content-is-in-list') ">
+ <xsl:element name="表:下拉箭头">
+ <xsl:attribute name="uof:locID">s0013</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="表:值">false</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="table:help-message">
+ <xsl:element name="表:输入提示">
+ <xsl:attribute name="uof:locID">s0014</xsl:attribute>
+ <xsl:attribute name="uof:attrList">显示 标题 内容</xsl:attribute>
+ <xsl:attribute name="表:显示"><xsl:value-of select="table:help-message/@table:display"/></xsl:attribute>
+ <xsl:attribute name="表:标题"><xsl:choose><xsl:when test="table:help-message/@table:title"><xsl:value-of select="table:help-message/@table:title"/></xsl:when><xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:variable name="content">
+ <xsl:call-template name="create-help-error-message-content">
+ <xsl:with-param name="text-p-set" select="table:help-message/text:p"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="表:内容"><xsl:value-of select="$content"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="table:error-message">
+ <xsl:element name="表:错误提示">
+ <xsl:attribute name="uof:locID">s0015</xsl:attribute>
+ <xsl:attribute name="uof:attrList">显示 类型 标题 内容</xsl:attribute>
+ <xsl:attribute name="表:显示"><xsl:value-of select="table:error-message/@table:display"/></xsl:attribute>
+ <xsl:attribute name="表:类型"><xsl:value-of select="table:error-message/@table:message-type"/></xsl:attribute>
+ <xsl:attribute name="表:标题"><xsl:choose><xsl:when test="table:error-message/@table:title"><xsl:value-of select="table:error-message/@table:title"/></xsl:when><xsl:otherwise><xsl:value-of select="''"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:variable name="content">
+ <xsl:call-template name="create-help-error-message-content">
+ <xsl:with-param name="text-p-set" select="table:error-message/text:p"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="表:内容"><xsl:value-of select="$content"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="search-left-top-validation">
+ <xsl:param name="validation-name"/>
+ <xsl:param name="tableslist"/>
+ <xsl:param name="return"/>
+ <xsl:choose>
+ <xsl:when test="$tableslist and $return=''">
+ <xsl:variable name="firsttablerows" select="$tableslist[1]//table:table-row"/>
+ <xsl:variable name="first-left-top">
+ <xsl:call-template name="search-left-top-validation-inatable">
+ <xsl:with-param name="row-num" select="'1'"/>
+ <xsl:with-param name="firsttablerows" select="$firsttablerows"/>
+ <xsl:with-param name="validation-name" select="$validation-name"/>
+ <xsl:with-param name="return" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="rest-left-top">
+ <xsl:call-template name="search-left-top-validation">
+ <xsl:with-param name="validation-name" select="$validation-name"/>
+ <xsl:with-param name="tableslist" select="$tableslist[position()!=1]"/>
+ <xsl:with-param name="return" select="$first-left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-left-top!=''">
+ <xsl:value-of select="$first-left-top"/>
+ </xsl:when>
+ <xsl:when test="$rest-left-top!=''">
+ <xsl:value-of select="$rest-left-top"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$return"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="translate-left-top">
+ <xsl:param name="left-top"/>
+ <xsl:variable name="column-number" select="substring-before(substring-after($left-top,'.'),' ')"/>
+ <xsl:variable name="column-number1">
+ <xsl:value-of select="floor( $column-number div 26 )"/>
+ </xsl:variable>
+ <xsl:variable name="column-number2">
+ <xsl:value-of select="$column-number mod 26"/>
+ </xsl:variable>
+ <xsl:variable name="column-character1">
+ <xsl:call-template name="number-to-character">
+ <xsl:with-param name="number" select="$column-number1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="column-character2">
+ <xsl:call-template name="number-to-character">
+ <xsl:with-param name="number" select="$column-number2"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat(substring-before($left-top,'.'),'.','$',$column-character1,$column-character2,'$',substring-after($left-top,' '))"/>
+ </xsl:template>
+ <xsl:template name="create-help-error-message-content">
+ <xsl:param name="text-p-set"/>
+ <xsl:if test="$text-p-set">
+ <!--此处有问题!!!!应该是有一个模块调用等-->
+ <!--xsl:value-of select="'&#10;'"/-->
+ <xsl:value-of select="$text-p-set"/>
+ <xsl:call-template name="create-help-error-message-content">
+ <xsl:with-param name="text-p-set" select="$text-p-set[position()!=1]"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="search-left-top-validation-inatable">
+ <xsl:param name="row-num"/>
+ <xsl:param name="firsttablerows"/>
+ <xsl:param name="validation-name"/>
+ <xsl:param name="return"/>
+ <xsl:choose>
+ <xsl:when test="$firsttablerows and $return=''">
+ <xsl:variable name="firstcells" select="$firsttablerows[1]/table:table-cell"/>
+ <xsl:variable name="first-left-top">
+ <xsl:call-template name="search-left-top-validation-inarow">
+ <xsl:with-param name="row-num" select="$row-num"/>
+ <xsl:with-param name="column-num" select="'1'"/>
+ <xsl:with-param name="firstcells" select="$firstcells"/>
+ <xsl:with-param name="validation-name" select="$validation-name"/>
+ <xsl:with-param name="return" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="row-num-p">
+ <xsl:choose>
+ <xsl:when test="$firsttablerows[1]/@table:number-rows-repeated">
+ <xsl:value-of select="$row-num+ $firsttablerows[1]/@table:number-rows-repeated"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$row-num+1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="rest-left-top">
+ <xsl:call-template name="search-left-top-validation-inatable">
+ <xsl:with-param name="row-num" select="$row-num-p"/>
+ <xsl:with-param name="firsttablerows" select="$firsttablerows[position()!=1]"/>
+ <xsl:with-param name="validation-name" select="$validation-name"/>
+ <xsl:with-param name="return" select="$first-left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-left-top!=''">
+ <xsl:value-of select="$first-left-top"/>
+ </xsl:when>
+ <xsl:when test="$rest-left-top !=''">
+ <xsl:value-of select="$rest-left-top "/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$return"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="number-to-character">
+ <xsl:param name="number"/>
+ <xsl:choose>
+ <xsl:when test="$number = 0"/>
+ <xsl:when test="$number = 1">A</xsl:when>
+ <xsl:when test="$number = 2">B</xsl:when>
+ <xsl:when test="$number = 3">C</xsl:when>
+ <xsl:when test="$number = 4">D</xsl:when>
+ <xsl:when test="$number = 5">E</xsl:when>
+ <xsl:when test="$number = 6">F</xsl:when>
+ <xsl:when test="$number = 7">G</xsl:when>
+ <xsl:when test="$number = 8">H</xsl:when>
+ <xsl:when test="$number = 9">I</xsl:when>
+ <xsl:when test="$number = 10">J</xsl:when>
+ <xsl:when test="$number = 11">K</xsl:when>
+ <xsl:when test="$number = 12">L</xsl:when>
+ <xsl:when test="$number = 13">M</xsl:when>
+ <xsl:when test="$number = 14">N</xsl:when>
+ <xsl:when test="$number = 15">O</xsl:when>
+ <xsl:when test="$number = 16">P</xsl:when>
+ <xsl:when test="$number = 17">Q</xsl:when>
+ <xsl:when test="$number = 18">R</xsl:when>
+ <xsl:when test="$number = 19">S</xsl:when>
+ <xsl:when test="$number = 20">T</xsl:when>
+ <xsl:when test="$number = 21">U</xsl:when>
+ <xsl:when test="$number = 22">V</xsl:when>
+ <xsl:when test="$number = 23">W</xsl:when>
+ <xsl:when test="$number = 24">X</xsl:when>
+ <xsl:when test="$number = 25">Y</xsl:when>
+ <xsl:when test="$number = 26">Z</xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="search-left-top-validation-inacell">
+ <xsl:param name="row-num"/>
+ <xsl:param name="column-num"/>
+ <xsl:param name="cell"/>
+ <xsl:param name="validation-name"/>
+ <xsl:choose>
+ <xsl:when test="$cell/@table:content-validation-name=$validation-name">
+ <xsl:value-of select="concat($cell/ancestor::table:table/@table:name,'.',$column-num,' ',$row-num)"/>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="search-left-top-validation-inarow">
+ <xsl:param name="row-num"/>
+ <xsl:param name="column-num"/>
+ <xsl:param name="firstcells"/>
+ <xsl:param name="validation-name"/>
+ <xsl:param name="return"/>
+ <xsl:choose>
+ <xsl:when test="$firstcells and $return=''">
+ <xsl:variable name="firstcell" select="$firstcells[1]"/>
+ <xsl:variable name="first-left-top">
+ <xsl:call-template name="search-left-top-validation-inacell">
+ <xsl:with-param name="row-num" select="$row-num"/>
+ <xsl:with-param name="column-num" select="$column-num"/>
+ <xsl:with-param name="cell" select="$firstcell"/>
+ <xsl:with-param name="validation-name" select="$validation-name"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="column-num-p">
+ <xsl:choose>
+ <xsl:when test="$firstcell/@table:number-columns-repeated">
+ <xsl:value-of select="$column-num+ $firstcell/@table:number-columns-repeated"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$column-num+ 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="rest-left-top">
+ <xsl:call-template name="search-left-top-validation-inarow">
+ <xsl:with-param name="row-num" select="$row-num"/>
+ <xsl:with-param name="column-num" select="$column-num-p"/>
+ <xsl:with-param name="firstcells" select="$firstcells[position()!=1]"/>
+ <xsl:with-param name="validation-name" select="$validation-name"/>
+ <xsl:with-param name="return" select="$first-left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-left-top!=''">
+ <xsl:value-of select="$first-left-top"/>
+ </xsl:when>
+ <xsl:when test="$rest-left-top !=''">
+ <xsl:value-of select="$rest-left-top "/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$return"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/export/uof/odf2uof_text.xsl b/filter/source/xslt/export/uof/odf2uof_text.xsl
index d1ed99ba89ae..ea5f9f65bc5a 100644
--- a/filter/source/xslt/export/uof/odf2uof_text.xsl
+++ b/filter/source/xslt/export/uof/odf2uof_text.xsl
@@ -17,4440 +17,4440 @@
* 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:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0" exclude-result-prefixes="office style text table draw fo xlink dc meta number presentation svg chart dr3d math form script config ooo ooow oooc dom xforms smil anim">
- <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
- <!--xsl:key name="colWidth" match="/office:automatic/style:style/" use="@style:column-width"/-->
- <xsl:variable name="swValueWithUnit">
- <xsl:value-of select="/office:document/office:automatic-styles/style:page-layout/style:page-layout-properties/@fo:page-width"/>
- </xsl:variable>
- <xsl:variable name="uofUnit">
- <xsl:choose>
- <xsl:when test="contains($swValueWithUnit,'in')">inch</xsl:when>
- <xsl:when test="contains($swValueWithUnit,'cm')">cm</xsl:when>
- <xsl:when test="contains($swValueWithUnit,'mm')">mm</xsl:when>
- <xsl:when test="contains($swValueWithUnit,'pt')">pt</xsl:when>
- <xsl:otherwise>inch</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="ooUnit">
- <xsl:choose>
- <xsl:when test="contains($swValueWithUnit,'in')">inch</xsl:when>
- <xsl:when test="contains($swValueWithUnit,'cm')">cm</xsl:when>
- <xsl:when test="contains($swValueWithUnit,'mm')">mm</xsl:when>
- <xsl:when test="contains($swValueWithUnit,'pt')">pt</xsl:when>
- <xsl:otherwise>inch</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="/">
- <xsl:apply-templates select="office:document"/>
- </xsl:template>
- <xsl:template match="office:document">
- <uof:UOF xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" uof:language="cn" uof:locID="u0000" uof:version="1.0" uof:mimetype="vnd.uof.text">
- <xsl:apply-templates select="office:meta"/>
- <xsl:if test="/office:document/office:body/office:text/text:p/text:bookmark-start|/office:document/office:body/office:text/text:p/text:bookmark">
- <uof:书签集 uof:locID="u0027">
- <xsl:for-each select="/office:document/office:body/office:text/text:p/text:bookmark-start|/office:document/office:body/office:text/text:p/text:bookmark">
- <uof:书签 uof:locID="u0028" uof:attrList="名称">
- <xsl:attribute name="uof:名称"><xsl:value-of select="@text:name"/></xsl:attribute>
- <uof:文本位置 uof:locID="u0029" uof:attrList="区域引用">
- <xsl:attribute name="字:区域引用"><xsl:value-of select="generate-id()"/></xsl:attribute>
- </uof:文本位置>
- </uof:书签>
- </xsl:for-each>
- </uof:书签集>
- </xsl:if>
- <xsl:if test="/office:document/office:body/office:text/text:p/text:a | /office:document/office:body/office:text/text:p/draw:a | /office:document/office:body/office:text/table:table/table:table-row/table:table-cell/text:p/text:a | /office:document/office:body/office:text/text:table-of-content/text:index-body/text:p/text:a">
- <uof:链接集 uof:locID="u0031">
- <xsl:for-each select="/office:document/office:body/office:text/text:p/text:a | /office:document/office:body/office:text/text:p/draw:a | /office:document/office:body/office:text/table:table/table:table-row/table:table-cell/text:p/text:a | /office:document/office:body/office:text/text:table-of-content/text:index-body/text:p/text:a">
- <xsl:variable name="hyperStr" select="@xlink:href"/>
- <uof:超级链接 uof:locID="u0032" uof:attrList="标识符 目标 书签 式样引用 已访问式样引用 提示 链源">
- <xsl:if test="contains($hyperStr,'#')">
- <xsl:attribute name="uof:书签"><xsl:value-of select="substring-after($hyperStr,'#')"/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="num">
- <xsl:number from="/office:document/office:body/office:text" level="any" count="text:a | table:table/table:table-row/table:table-cell/text:a"/>
- </xsl:variable>
- <xsl:attribute name="uof:链源"><xsl:value-of select="concat('hlnk',$num)"/></xsl:attribute>
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('hyk_','hlnk',$num)"/></xsl:attribute>
- <xsl:if test="not(contains($hyperStr,'#'))">
- <xsl:attribute name="uof:目标"><xsl:value-of select="$hyperStr"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@office:name">
- <xsl:attribute name="uof:提示"><xsl:value-of select="@office:name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@text:style-name">
- <xsl:attribute name="uof:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@text:visited-style-name">
- <xsl:attribute name="uof:已访问式样引用"><xsl:value-of select="@text:visited-style-name"/></xsl:attribute>
- </xsl:if>
- </uof:超级链接>
- </xsl:for-each>
- </uof:链接集>
- </xsl:if>
- <uof:式样集 uof:locID="u0039">
- <xsl:apply-templates select="office:font-face-decls"/>
- <xsl:call-template name="自动编号集"/>
- <xsl:call-template name="shiyang"/>
- <xsl:apply-templates select="office:automatic-styles/style:style" mode="style"/>
- </uof:式样集>
- <uof:对象集 uof:locID="u0033">
- <xsl:for-each select="/office:document/office:body/office:text/draw:*">
- <xsl:variable name="nodename1">
- <xsl:value-of select="name()"/>
- </xsl:variable>
- <xsl:call-template name="draw">
- <xsl:with-param name="nodename1" select="$nodename1"/>
- </xsl:call-template>
- </xsl:for-each>
- <xsl:apply-templates select="/office:document/office:body/office:text//text:p" mode="styles"/>
- <xsl:apply-templates select="/office:document/office:master-styles/style:master-page/style:header/text:p" mode="styles"/>
- <xsl:apply-templates select="/office:document/office:master-styles/style:master-page/style:footer/text:p" mode="styles"/>
- <xsl:for-each select="(/office:document/office:styles/style:style/style:paragraph-properties/style:background-image) | (/office:document/office:automatic-styles/style:style/style:paragraph-properties/style:background-image) | (/office:document/office:automatic-styles/style:page-layout/style:page-layout-properties/style:background-image) | /office:document/office:automatic-styles/style:style/style:table-cell-properties/style:background-image | /office:document/office:automatic-styles/style:style/style:table-properties/style:background-image | /office:document/office:automatic-styles/style:style/style:graphic-properties/style:background-image">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('background-image_',count(preceding::style:background-image))"/></xsl:attribute>
- <xsl:attribute name="uof:公共类型">png</xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="office:binary-data"/>
- </uof:数据>
- </uof:其他对象>
- </xsl:for-each>
- <xsl:for-each select="(/office:document/office:styles/text:list-style/text:list-level-style-image) | (/office:document/office:automatic-styles/text:list-style/text:list-level-style-image)">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('image_numbering_',count(preceding::text:list-level-style-image))"/></xsl:attribute>
- <xsl:attribute name="uof:公共类型">png</xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="office:binary-data"/>
- </uof:数据>
- </uof:其他对象>
- </xsl:for-each>
- <xsl:for-each select="/office:document/office:styles/draw:fill-image">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="@draw:name"/></xsl:attribute>
- <xsl:attribute name="uof:公共类型">png</xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="office:binary-data"/>
- </uof:数据>
- </uof:其他对象>
- </xsl:for-each>
- <!--xsl:apply-templates select="/office:document/office:automatic-styles/style:style[@style:family = 'graphics']"/>
- <xsl:apply-templates select="office:styles/style:style[@style:family = 'graphics']"/>
- <xsl:apply-templates select="office:styles/style:default-style [@style:family = 'graphics']"/-->
- </uof:对象集>
- <uof:文字处理 uof:locID="u0047">
- <字:公用处理规则 uof:locID="t0000">
- <xsl:apply-templates select="office:settings"/>
- <xsl:call-template name="GetUsers"/>
- <xsl:call-template name="GetTrackChanges"/>
- <xsl:call-template name="GetAnnotations"/>
- </字:公用处理规则>
- <字:主体 uof:locID="t0016">
- <xsl:for-each select="office:automatic-styles/style:page-layout[@style:name='pm1']">
- <xsl:call-template name="style:page-layout"/>
- </xsl:for-each>
- <!--xsl:call-template name="office:automatic-styles/style:page-layout[@style:name='pm1']"/-->
- <!--xsl:apply-templates select="office:automatic-styles/style:page-layout[@style:name='pm1']"/-->
- <xsl:apply-templates select="office:body/office:text"/>
- <xsl:call-template name="logic-chapter"/>
- </字:主体>
- </uof:文字处理>
- </uof:UOF>
- </xsl:template>
- <xsl:template name="logic-chapter">
- <xsl:element name="字:逻辑章节">
- <xsl:attribute name="uof:locID">t0050</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template name="GetAnnotations">
- <xsl:if test="/*/office:body/office:text//office:annotation ">
- <字:批注集 uof:locID="t0014">
- <xsl:for-each select="/*/office:body/office:text//office:annotation">
- <字:批注 uof:locID="t0015" uof:attrList="区域引用 作者 日期 作者缩写">
- <xsl:attribute name="字:作者"><xsl:value-of select="generate-id()"/></xsl:attribute>
- <xsl:attribute name="字:日期"><xsl:value-of select="dc:date"/></xsl:attribute>
- <xsl:attribute name="字:区域引用">cmt<xsl:number from="/office:document/office:body/office:text" level="any" count="office:annotation"/></xsl:attribute>
- <xsl:for-each select="./node()">
- <xsl:choose>
- <xsl:when test="name()='text:p'">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name()='table:table'">
- <xsl:call-template name="exec_table"/>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:for-each>
- </字:批注>
- </xsl:for-each>
- </字:批注集>
- </xsl:if>
- </xsl:template>
- <xsl:template name="GetTrackChanges">
- <xsl:if test="/*/office:body/office:text/text:tracked-changes">
- <字:修订信息集 uof:locID="t0012">
- <xsl:for-each select="/*/office:body/office:text/text:tracked-changes/text:changed-region">
- <字:修订信息 字:标识符="{@text:id}" 字:作者="{generate-id()}" 字:日期="{node()//office:change-info/dc:date}" uof:locID="t0013" uof:attrList="标识符 作者 日期"/>
- </xsl:for-each>
- </字:修订信息集>
- </xsl:if>
- </xsl:template>
- <xsl:template name="GetUsers">
- <xsl:if test="/*/office:body/office:text/text:tracked-changes//office:change-info/dc:creator or //office:annotation/@office:author or //office:annotation/dc:creator">
- <字:用户集 uof:locID="t0010">
- <xsl:for-each select="/*/office:body/office:text/text:tracked-changes/text:changed-region">
- <字:用户 字:标识符="{generate-id()}" 字:姓名="{node()//office:change-info/dc:creator}" uof:locID="t0011" uof:attrList="标识符 姓名"/>
- </xsl:for-each>
- <xsl:for-each select="//office:annotation">
- <字:用户 字:标识符="{generate-id()}" 字:姓名="{dc:creator}" uof:locID="t0011" uof:attrList="标识符 姓名"/>
- </xsl:for-each>
- </字:用户集>
- </xsl:if>
- </xsl:template>
- <xsl:key match="/office:document/office:automatic-styles/style:style | /office:document/office:styles/style:style" name="graphicset" use="@style:name"/>
- <xsl:template match="text:p" mode="styles">
- <xsl:for-each select="child::*">
- <xsl:variable name="nodename1">
- <xsl:value-of select="name()"/>
- </xsl:variable>
- <xsl:if test="(substring-before($nodename1,':') = 'draw')">
- <xsl:call-template name="draw">
- <xsl:with-param name="nodename1" select="$nodename1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="draw">
- <xsl:param name="nodename1"/>
- <xsl:choose>
- <xsl:when test="substring-after($nodename1,':') = 'a'">
- <xsl:for-each select="child::*">
- <xsl:call-template name="draw">
- <xsl:with-param name="nodename">
- <xsl:value-of select="name()"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="substring-after($nodename1,':') = 'g'">
- <xsl:call-template name="draw:g"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="creategraphicstyles"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="draw:g">
- <xsl:variable name="picnumber1">
- <xsl:value-of select="count(preceding::draw:g)"/>
- </xsl:variable>
- <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
- <xsl:attribute name="图:标识符"><xsl:value-of select="concat(@draw:style-name,'_',$picnumber1)"/></xsl:attribute>
- <xsl:attribute name="图:层次"><xsl:choose><xsl:when test="name(parent::node())='draw:g'"><xsl:value-of select="position()"/></xsl:when><xsl:when test="@draw:z-index"><xsl:value-of select="@draw:z-index"/></xsl:when><xsl:otherwise><xsl:value-of select="position()"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:组合列表"><xsl:for-each select="child::*[1]"><xsl:variable name="node1"><xsl:value-of select="@draw:style-name"/></xsl:variable><xsl:variable name="picnumber2"><xsl:value-of select="count(preceding::*[@draw:style-name=$node1])"/></xsl:variable><xsl:call-template name="zuheliebiao"><xsl:with-param name="allnode"><xsl:value-of select="concat($node1,'_',$picnumber2)"/></xsl:with-param><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
- </图:图形>
- <xsl:for-each select="child::*">
- <xsl:choose>
- <xsl:when test="name()='draw:g'">
- <xsl:call-template name="draw:g"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="creategraphicstyles"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="zuheliebiao">
- <xsl:param name="allnode"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="../child::*[$pos]">
- <xsl:for-each select="../child::*[$pos]">
- <xsl:variable name="nodepos">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:variable>
- <xsl:variable name="picnumber1">
- <xsl:value-of select="count(preceding::*[@draw:style-name=$nodepos])"/>
- </xsl:variable>
- <xsl:variable name="pic-name1">
- <xsl:value-of select="concat($nodepos,'_',$picnumber1)"/>
- </xsl:variable>
- <xsl:variable name="allnode1">
- <xsl:value-of select="concat($allnode,',',$pic-name1)"/>
- </xsl:variable>
- <xsl:call-template name="zuheliebiao">
- <xsl:with-param name="allnode" select="$allnode1"/>
- <xsl:with-param name="pos" select="$pos+1"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$allnode"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="creategraphicstyles">
- <xsl:variable name="nodename">
- <xsl:value-of select="name()"/>
- </xsl:variable>
- <xsl:variable name="pic-name">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:variable>
- <xsl:variable name="pic-num">
- <xsl:value-of select="count(/descendant::*[@draw:style-name=$pic-name])"/>
- </xsl:variable>
- <xsl:variable name="picnumber">
- <xsl:value-of select="count(preceding::*[@draw:style-name=$pic-name])"/>
- </xsl:variable>
- <xsl:call-template name="pic-process">
- <xsl:with-param name="pic-name" select="$pic-name"/>
- <xsl:with-param name="nodename" select="$nodename"/>
- <xsl:with-param name="picnumber" select="$picnumber"/>
- </xsl:call-template>
- </xsl:template>
- <!--xsl:key match="/office:document/office:automatic-styles/style:style" name="graphicset" use="@style:name"/>
+ <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
+ <!--xsl:key name="colWidth" match="/office:automatic/style:style/" use="@style:column-width"/-->
+ <xsl:variable name="swValueWithUnit">
+ <xsl:value-of select="/office:document/office:automatic-styles/style:page-layout/style:page-layout-properties/@fo:page-width"/>
+ </xsl:variable>
+ <xsl:variable name="uofUnit">
+ <xsl:choose>
+ <xsl:when test="contains($swValueWithUnit,'in')">inch</xsl:when>
+ <xsl:when test="contains($swValueWithUnit,'cm')">cm</xsl:when>
+ <xsl:when test="contains($swValueWithUnit,'mm')">mm</xsl:when>
+ <xsl:when test="contains($swValueWithUnit,'pt')">pt</xsl:when>
+ <xsl:otherwise>inch</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="ooUnit">
+ <xsl:choose>
+ <xsl:when test="contains($swValueWithUnit,'in')">inch</xsl:when>
+ <xsl:when test="contains($swValueWithUnit,'cm')">cm</xsl:when>
+ <xsl:when test="contains($swValueWithUnit,'mm')">mm</xsl:when>
+ <xsl:when test="contains($swValueWithUnit,'pt')">pt</xsl:when>
+ <xsl:otherwise>inch</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:template match="/">
+ <xsl:apply-templates select="office:document"/>
+ </xsl:template>
+ <xsl:template match="office:document">
+ <uof:UOF xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" uof:language="cn" uof:locID="u0000" uof:version="1.0" uof:mimetype="vnd.uof.text">
+ <xsl:apply-templates select="office:meta"/>
+ <xsl:if test="/office:document/office:body/office:text/text:p/text:bookmark-start|/office:document/office:body/office:text/text:p/text:bookmark">
+ <uof:书签集 uof:locID="u0027">
+ <xsl:for-each select="/office:document/office:body/office:text/text:p/text:bookmark-start|/office:document/office:body/office:text/text:p/text:bookmark">
+ <uof:书签 uof:locID="u0028" uof:attrList="名称">
+ <xsl:attribute name="uof:名称"><xsl:value-of select="@text:name"/></xsl:attribute>
+ <uof:文本位置 uof:locID="u0029" uof:attrList="区域引用">
+ <xsl:attribute name="字:区域引用"><xsl:value-of select="generate-id()"/></xsl:attribute>
+ </uof:文本位置>
+ </uof:书签>
+ </xsl:for-each>
+ </uof:书签集>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/office:text/text:p/text:a | /office:document/office:body/office:text/text:p/draw:a | /office:document/office:body/office:text/table:table/table:table-row/table:table-cell/text:p/text:a | /office:document/office:body/office:text/text:table-of-content/text:index-body/text:p/text:a">
+ <uof:链接集 uof:locID="u0031">
+ <xsl:for-each select="/office:document/office:body/office:text/text:p/text:a | /office:document/office:body/office:text/text:p/draw:a | /office:document/office:body/office:text/table:table/table:table-row/table:table-cell/text:p/text:a | /office:document/office:body/office:text/text:table-of-content/text:index-body/text:p/text:a">
+ <xsl:variable name="hyperStr" select="@xlink:href"/>
+ <uof:超级链接 uof:locID="u0032" uof:attrList="标识符 目标 书签 式样引用 已访问式样引用 提示 链源">
+ <xsl:if test="contains($hyperStr,'#')">
+ <xsl:attribute name="uof:书签"><xsl:value-of select="substring-after($hyperStr,'#')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="num">
+ <xsl:number from="/office:document/office:body/office:text" level="any" count="text:a | table:table/table:table-row/table:table-cell/text:a"/>
+ </xsl:variable>
+ <xsl:attribute name="uof:链源"><xsl:value-of select="concat('hlnk',$num)"/></xsl:attribute>
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('hyk_','hlnk',$num)"/></xsl:attribute>
+ <xsl:if test="not(contains($hyperStr,'#'))">
+ <xsl:attribute name="uof:目标"><xsl:value-of select="$hyperStr"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@office:name">
+ <xsl:attribute name="uof:提示"><xsl:value-of select="@office:name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@text:style-name">
+ <xsl:attribute name="uof:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@text:visited-style-name">
+ <xsl:attribute name="uof:已访问式样引用"><xsl:value-of select="@text:visited-style-name"/></xsl:attribute>
+ </xsl:if>
+ </uof:超级链接>
+ </xsl:for-each>
+ </uof:链接集>
+ </xsl:if>
+ <uof:式样集 uof:locID="u0039">
+ <xsl:apply-templates select="office:font-face-decls"/>
+ <xsl:call-template name="自动编号集"/>
+ <xsl:call-template name="shiyang"/>
+ <xsl:apply-templates select="office:automatic-styles/style:style" mode="style"/>
+ </uof:式样集>
+ <uof:对象集 uof:locID="u0033">
+ <xsl:for-each select="/office:document/office:body/office:text/draw:*">
+ <xsl:variable name="nodename1">
+ <xsl:value-of select="name()"/>
+ </xsl:variable>
+ <xsl:call-template name="draw">
+ <xsl:with-param name="nodename1" select="$nodename1"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ <xsl:apply-templates select="/office:document/office:body/office:text//text:p" mode="styles"/>
+ <xsl:apply-templates select="/office:document/office:master-styles/style:master-page/style:header/text:p" mode="styles"/>
+ <xsl:apply-templates select="/office:document/office:master-styles/style:master-page/style:footer/text:p" mode="styles"/>
+ <xsl:for-each select="(/office:document/office:styles/style:style/style:paragraph-properties/style:background-image) | (/office:document/office:automatic-styles/style:style/style:paragraph-properties/style:background-image) | (/office:document/office:automatic-styles/style:page-layout/style:page-layout-properties/style:background-image) | /office:document/office:automatic-styles/style:style/style:table-cell-properties/style:background-image | /office:document/office:automatic-styles/style:style/style:table-properties/style:background-image | /office:document/office:automatic-styles/style:style/style:graphic-properties/style:background-image">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('background-image_',count(preceding::style:background-image))"/></xsl:attribute>
+ <xsl:attribute name="uof:公共类型">png</xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="office:binary-data"/>
+ </uof:数据>
+ </uof:其他对象>
+ </xsl:for-each>
+ <xsl:for-each select="(/office:document/office:styles/text:list-style/text:list-level-style-image) | (/office:document/office:automatic-styles/text:list-style/text:list-level-style-image)">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat('image_numbering_',count(preceding::text:list-level-style-image))"/></xsl:attribute>
+ <xsl:attribute name="uof:公共类型">png</xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="office:binary-data"/>
+ </uof:数据>
+ </uof:其他对象>
+ </xsl:for-each>
+ <xsl:for-each select="/office:document/office:styles/draw:fill-image">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="@draw:name"/></xsl:attribute>
+ <xsl:attribute name="uof:公共类型">png</xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="office:binary-data"/>
+ </uof:数据>
+ </uof:其他对象>
+ </xsl:for-each>
+ <!--xsl:apply-templates select="/office:document/office:automatic-styles/style:style[@style:family = 'graphics']"/>
+ <xsl:apply-templates select="office:styles/style:style[@style:family = 'graphics']"/>
+ <xsl:apply-templates select="office:styles/style:default-style [@style:family = 'graphics']"/-->
+ </uof:对象集>
+ <uof:文字处理 uof:locID="u0047">
+ <字:公用处理规则 uof:locID="t0000">
+ <xsl:apply-templates select="office:settings"/>
+ <xsl:call-template name="GetUsers"/>
+ <xsl:call-template name="GetTrackChanges"/>
+ <xsl:call-template name="GetAnnotations"/>
+ </字:公用处理规则>
+ <字:主体 uof:locID="t0016">
+ <xsl:for-each select="office:automatic-styles/style:page-layout[@style:name='pm1']">
+ <xsl:call-template name="style:page-layout"/>
+ </xsl:for-each>
+ <!--xsl:call-template name="office:automatic-styles/style:page-layout[@style:name='pm1']"/-->
+ <!--xsl:apply-templates select="office:automatic-styles/style:page-layout[@style:name='pm1']"/-->
+ <xsl:apply-templates select="office:body/office:text"/>
+ <xsl:call-template name="logic-chapter"/>
+ </字:主体>
+ </uof:文字处理>
+ </uof:UOF>
+ </xsl:template>
+ <xsl:template name="logic-chapter">
+ <xsl:element name="字:逻辑章节">
+ <xsl:attribute name="uof:locID">t0050</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="GetAnnotations">
+ <xsl:if test="/*/office:body/office:text//office:annotation ">
+ <字:批注集 uof:locID="t0014">
+ <xsl:for-each select="/*/office:body/office:text//office:annotation">
+ <字:批注 uof:locID="t0015" uof:attrList="区域引用 作者 日期 作者缩写">
+ <xsl:attribute name="字:作者"><xsl:value-of select="generate-id()"/></xsl:attribute>
+ <xsl:attribute name="字:日期"><xsl:value-of select="dc:date"/></xsl:attribute>
+ <xsl:attribute name="字:区域引用">cmt<xsl:number from="/office:document/office:body/office:text" level="any" count="office:annotation"/></xsl:attribute>
+ <xsl:for-each select="./node()">
+ <xsl:choose>
+ <xsl:when test="name()='text:p'">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name()='table:table'">
+ <xsl:call-template name="exec_table"/>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </字:批注>
+ </xsl:for-each>
+ </字:批注集>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="GetTrackChanges">
+ <xsl:if test="/*/office:body/office:text/text:tracked-changes">
+ <字:修订信息集 uof:locID="t0012">
+ <xsl:for-each select="/*/office:body/office:text/text:tracked-changes/text:changed-region">
+ <字:修订信息 字:标识符="{@text:id}" 字:作者="{generate-id()}" 字:日期="{node()//office:change-info/dc:date}" uof:locID="t0013" uof:attrList="标识符 作者 日期"/>
+ </xsl:for-each>
+ </字:修订信息集>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="GetUsers">
+ <xsl:if test="/*/office:body/office:text/text:tracked-changes//office:change-info/dc:creator or //office:annotation/@office:author or //office:annotation/dc:creator">
+ <字:用户集 uof:locID="t0010">
+ <xsl:for-each select="/*/office:body/office:text/text:tracked-changes/text:changed-region">
+ <字:用户 字:标识符="{generate-id()}" 字:姓名="{node()//office:change-info/dc:creator}" uof:locID="t0011" uof:attrList="标识符 姓名"/>
+ </xsl:for-each>
+ <xsl:for-each select="//office:annotation">
+ <字:用户 字:标识符="{generate-id()}" 字:姓名="{dc:creator}" uof:locID="t0011" uof:attrList="标识符 姓名"/>
+ </xsl:for-each>
+ </字:用户集>
+ </xsl:if>
+ </xsl:template>
+ <xsl:key match="/office:document/office:automatic-styles/style:style | /office:document/office:styles/style:style" name="graphicset" use="@style:name"/>
+ <xsl:template match="text:p" mode="styles">
+ <xsl:for-each select="child::*">
+ <xsl:variable name="nodename1">
+ <xsl:value-of select="name()"/>
+ </xsl:variable>
+ <xsl:if test="(substring-before($nodename1,':') = 'draw')">
+ <xsl:call-template name="draw">
+ <xsl:with-param name="nodename1" select="$nodename1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="draw">
+ <xsl:param name="nodename1"/>
+ <xsl:choose>
+ <xsl:when test="substring-after($nodename1,':') = 'a'">
+ <xsl:for-each select="child::*">
+ <xsl:call-template name="draw">
+ <xsl:with-param name="nodename">
+ <xsl:value-of select="name()"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="substring-after($nodename1,':') = 'g'">
+ <xsl:call-template name="draw:g"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="creategraphicstyles"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="draw:g">
+ <xsl:variable name="picnumber1">
+ <xsl:value-of select="count(preceding::draw:g)"/>
+ </xsl:variable>
+ <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
+ <xsl:attribute name="图:标识符"><xsl:value-of select="concat(@draw:style-name,'_',$picnumber1)"/></xsl:attribute>
+ <xsl:attribute name="图:层次"><xsl:choose><xsl:when test="name(parent::node())='draw:g'"><xsl:value-of select="position()"/></xsl:when><xsl:when test="@draw:z-index"><xsl:value-of select="@draw:z-index"/></xsl:when><xsl:otherwise><xsl:value-of select="position()"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:组合列表"><xsl:for-each select="child::*[1]"><xsl:variable name="node1"><xsl:value-of select="@draw:style-name"/></xsl:variable><xsl:variable name="picnumber2"><xsl:value-of select="count(preceding::*[@draw:style-name=$node1])"/></xsl:variable><xsl:call-template name="zuheliebiao"><xsl:with-param name="allnode"><xsl:value-of select="concat($node1,'_',$picnumber2)"/></xsl:with-param><xsl:with-param name="pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
+ </图:图形>
+ <xsl:for-each select="child::*">
+ <xsl:choose>
+ <xsl:when test="name()='draw:g'">
+ <xsl:call-template name="draw:g"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="creategraphicstyles"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="zuheliebiao">
+ <xsl:param name="allnode"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="../child::*[$pos]">
+ <xsl:for-each select="../child::*[$pos]">
+ <xsl:variable name="nodepos">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="picnumber1">
+ <xsl:value-of select="count(preceding::*[@draw:style-name=$nodepos])"/>
+ </xsl:variable>
+ <xsl:variable name="pic-name1">
+ <xsl:value-of select="concat($nodepos,'_',$picnumber1)"/>
+ </xsl:variable>
+ <xsl:variable name="allnode1">
+ <xsl:value-of select="concat($allnode,',',$pic-name1)"/>
+ </xsl:variable>
+ <xsl:call-template name="zuheliebiao">
+ <xsl:with-param name="allnode" select="$allnode1"/>
+ <xsl:with-param name="pos" select="$pos+1"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$allnode"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="creategraphicstyles">
+ <xsl:variable name="nodename">
+ <xsl:value-of select="name()"/>
+ </xsl:variable>
+ <xsl:variable name="pic-name">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:variable>
+ <xsl:variable name="pic-num">
+ <xsl:value-of select="count(/descendant::*[@draw:style-name=$pic-name])"/>
+ </xsl:variable>
+ <xsl:variable name="picnumber">
+ <xsl:value-of select="count(preceding::*[@draw:style-name=$pic-name])"/>
+ </xsl:variable>
+ <xsl:call-template name="pic-process">
+ <xsl:with-param name="pic-name" select="$pic-name"/>
+ <xsl:with-param name="nodename" select="$nodename"/>
+ <xsl:with-param name="picnumber" select="$picnumber"/>
+ </xsl:call-template>
+ </xsl:template>
+ <!--xsl:key match="/office:document/office:automatic-styles/style:style" name="graphicset" use="@style:name"/>
- <xsl:template match="style:style[@style:family = 'graphics']">
- <xsl:variable name="pic-name">
- <xsl:value-of select="@style:name"/>
- </xsl:variable>
- <xsl:variable name="pic-num">
- <xsl:value-of select="count(/descendant::*[@draw:style-name=$pic-name])"/>
- </xsl:variable>
- <xsl:call-template name="pic-process">
- <xsl:with-param name="pic-name" select="$pic-name"/>
- <xsl:with-param name="pic-num" select="$pic-num"/>
- <xsl:with-param name="current-num" select="1"/>
- </xsl:call-template>
- </xsl:template-->
- <xsl:template name="pic-process">
- <xsl:param name="pic-name"/>
- <xsl:param name="nodename"/>
- <xsl:param name="picnumber"/>
- <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
- <xsl:attribute name="图:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
- <xsl:attribute name="图:层次"><xsl:value-of select="@draw:z-index"/></xsl:attribute>
- <xsl:if test=".//office:binary-data">
- <xsl:attribute name="图:其他对象"><xsl:choose><xsl:when test="@draw:name"><xsl:value-of select="@draw:name"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:variable name="arrow-sign">
- <xsl:choose>
- <xsl:when test="key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-start or key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-end">
- <xsl:value-of select="'1'"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$nodename='draw:line' or $nodename='draw:rect' or $nodename='draw:circle' or $nodename='draw:polygon' or $nodename='draw:polyline' or $nodename='draw:ellipse' or $nodename='draw:path'or $nodename='draw:g' or $nodename='draw:text-box' or child::draw:text-box">
- <图:预定义图形 uof:locID="g0005">
- <图:类别 uof:locID="g0006">
- <xsl:choose>
- <xsl:when test="$nodename='draw:line' and $arrow-sign='1'">62</xsl:when>
- <xsl:when test="$nodename='draw:rect'">11</xsl:when>
- <xsl:when test="$nodename='draw:line'">61</xsl:when>
- <xsl:when test="$nodename='draw:circle'">19</xsl:when>
- <xsl:when test="$nodename='draw:polygon'">65</xsl:when>
- <xsl:when test="$nodename='draw:polyline'">66</xsl:when>
- <xsl:when test="$nodename='draw:ellipse'">19</xsl:when>
- <xsl:when test="child::draw:text-box[@fo:min-height]">22</xsl:when>
- <xsl:when test="child::draw:text-box">23</xsl:when>
- </xsl:choose>
- </图:类别>
- <图:名称 uof:locID="g0007">
- <xsl:choose>
- <xsl:when test="$nodename='draw:rect'">Rectangle</xsl:when>
- <xsl:when test="$nodename='draw:line'">Line</xsl:when>
- <xsl:when test="$nodename='draw:circle'">Oval</xsl:when>
- <xsl:when test="$nodename='draw:polygon'">Freeform</xsl:when>
- <xsl:when test="$nodename='draw:polyline'">Scribble</xsl:when>
- <xsl:when test="$nodename='draw:ellipse'">Oval</xsl:when>
- <xsl:when test="$nodename='draw:frame' and child::draw:text-box[@fo:min-height]">排版框</xsl:when>
- <xsl:when test="$nodename='draw:frame' and child::draw:text-box">排版框</xsl:when>
- </xsl:choose>
- </图:名称>
- <图:生成软件 uof:locID="g0008">PNG</图:生成软件>
- <xsl:if test="./@draw:points or ./@svg:d">
- <图:关键点坐标 uof:locID="g0009" uof:attrList="路径">
- <xsl:attribute name="图:路径"><xsl:choose><xsl:when test="@svg:d"><xsl:value-of select="@svg:d"/></xsl:when><xsl:when test="@draw:points"><xsl:call-template name="draw:points"><xsl:with-param name="point" select="@draw:points"/><xsl:with-param name="lujing"/></xsl:call-template></xsl:when></xsl:choose></xsl:attribute>
- </图:关键点坐标>
- </xsl:if>
- <图:属性 uof:locID="g0011">
- <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
- <xsl:if test="style:graphic-properties/@draw:fill-color or style:graphic-properties/@fo:background-color or style:graphic-properties/@draw:fill-image-name or style:graphic-properties/@draw:fill-gradient-name">
- <图:填充 uof:locID="g0012">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:fill='gradient'">
- <xsl:variable name="gradient-name">
- <xsl:value-of select="style:graphic-properties/@draw:fill-gradient-name"/>
- </xsl:variable>
- <xsl:for-each select="/descendant::draw:gradient[@draw:name=$gradient-name]">
- <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
- <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
- <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
- <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
- <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
- <xsl:variable name="angle">
- <xsl:value-of select="@draw:angle div 10"/>
- </xsl:variable>
- <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
- <xsl:if test="@draw:cx">
- <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@draw:cy">
- <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="图:类型">-2</xsl:attribute>
- </图:渐变>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@draw:fill-image-name or style:graphic-properties/style:background-image/office:binary-data">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:fill-image-name">
- <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
- <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:graphic-properties/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:graphic-properties/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:图形引用"><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:attribute>
- <xsl:attribute name="图:类型">png</xsl:attribute>
- <xsl:attribute name="图:名称"><xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/></xsl:attribute>
- </图:图片>
- </xsl:when>
- <xsl:when test="style:graphic-properties/style:background-image/office:binary-data">
- <xsl:for-each select="style:graphic-properties">
- <xsl:call-template name="图:填充"/>
- </xsl:for-each>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@draw:fill='hatch'">
- <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
- <xsl:attribute name="图:类型"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:name"/></xsl:attribute>
- <xsl:attribute name="图:图形引用"/>
- <xsl:attribute name="图:前景色"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:color"/></xsl:attribute>
- <xsl:attribute name="图:背景色"><xsl:choose><xsl:when test="style:graphic-properties/@draw:fill-color"><xsl:value-of select="style:graphic-properties/@draw:fill-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
- </图:图案>
- </xsl:when>
- <xsl:otherwise>
- <图:颜色 uof:locID="g0034">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:fill-color">
- <xsl:value-of select="style:graphic-properties/@draw:fill-color"/>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@fo:background-color">
- <xsl:value-of select="style:graphic-properties/@fo:background-color"/>
- </xsl:when>
- <xsl:otherwise>#99ccff</xsl:otherwise>
- </xsl:choose>
- </图:颜色>
- </xsl:otherwise>
- </xsl:choose>
- </图:填充>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@svg:stroke-color">
- <图:线颜色 uof:locID="g0013">
- <xsl:value-of select="style:graphic-properties/@svg:stroke-color"/>
- </图:线颜色>
- </xsl:if>
- <图:线型 uof:locID="g0014">
- <xsl:variable name="linetype" select="style:graphic-properties/@draw:stroke-dash"/>
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@fo:border='none'">none</xsl:when>
- <xsl:when test="not(style:graphic-properties/@draw:stroke)">
- <xsl:choose>
- <xsl:when test="not(style:graphic-properties/@svg:stroke-width)">single</xsl:when>
- <xsl:otherwise>thick</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:stroke = 'none'">none</xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$linetype='Fine_20_Dashed' and style:graphic-properties/@svg:stroke-width">dash-long-heavy</xsl:when>
- <xsl:when test="$linetype='Fine_20_Dashed'">dash-long</xsl:when>
- <xsl:when test="$linetype='2 Dots 1 Dash' and style:graphic-properties/@svg:stroke-width">dash-dot-dot-heavy</xsl:when>
- <xsl:when test="$linetype='2 Dots 1 Dash'">dot-dot-dash</xsl:when>
- <xsl:when test="$linetype='Ultrafine Dashed' and style:graphic-properties/@svg:stroke-width">dashed-heavy</xsl:when>
- <xsl:when test="$linetype='Ultrafine Dotted (var)'and style:graphic-properties/@svg:stroke-width">dotted-heavy</xsl:when>
- <xsl:when test="$linetype='Ultrafine Dotted (var)'">dotted</xsl:when>
- <xsl:when test="$linetype='Line with Fine Dots'">double</xsl:when>
- <xsl:when test="$linetype='3 Dashes 3 Dots (var)' and style:graphic-properties/@svg:stroke-width">dash-dot-heavy</xsl:when>
- <xsl:when test="$linetype='3 Dashes 3 Dots (var)'">dot-dash</xsl:when>
- <xsl:when test="$linetype='Ultrafine 2 Dots 3 Dashes'and style:graphic-properties/@svg:stroke-width">wavy-heavy</xsl:when>
- <xsl:when test="$linetype='Ultrafine 2 Dots 3 Dashes'">wave</xsl:when>
- <xsl:when test="$linetype='Fine Dashed (var)'">wavy-double</xsl:when>
- <xsl:otherwise>dash</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </图:线型>
- <xsl:if test="style:graphic-properties/@svg:stroke-width">
- <图:线粗细 uof:locID="g0016">
- <xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-width,$uofUnit)"/>
- </图:线粗细>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:marker-start and string-length(style:graphic-properties/@draw:marker-start)&gt;0">
- <图:前端箭头 uof:locID="g0017">
- <图:式样 uof:locID="g0018">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow'">normal</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Line Arrow'">open</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow concave'">stealth</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Circle'">oval</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-start='Square 45'">diamond</xsl:when>
- <xsl:otherwise>normal</xsl:otherwise>
- </xsl:choose>
- </图:式样>
- <图:大小 uof:locID="g0019">
- <xsl:choose>
- <xsl:when test="not(style:graphic-properties/@draw:marker-start-width)">4</xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="graphsize">
- <xsl:with-param name="width" select="substring-before(style:graphic-properties/@draw:marker-start-width,$uofUnit)"/>
- <xsl:with-param name="Unitofsize" select="$uofUnit"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </图:大小>
- </图:前端箭头>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:marker-end">
- <图:后端箭头 uof:locID="g0017">
- <图:式样 uof:locID="g0018">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow'">normal</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Line Arrow'">open</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow concave'">stealth</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Circle'">oval</xsl:when>
- <xsl:when test="style:graphic-properties/@draw:marker-end='Square 45'">diamond</xsl:when>
- <xsl:otherwise>normal</xsl:otherwise>
- </xsl:choose>
- </图:式样>
- <图:大小 uof:locID="g0022">
- <xsl:choose>
- <xsl:when test="not(style:properties/@draw:marker-start-width)">4</xsl:when>
- <xsl:otherwise>
- <xsl:variable name="width">
- <xsl:value-of select="substring-before(style:graphic-properties/@draw:marker-end-width,$uofUnit)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="(not($width&gt;0.05) and 0&lt;$width) or $width=0.05">1</xsl:when>
- <xsl:when test="(not($width&gt;0.10) and 0.05&lt;$width) or $width=0.10">2</xsl:when>
- <xsl:when test="(not($width&gt;0.15) and 0.10&lt;$width) or $width=0.15">3</xsl:when>
- <xsl:when test="(not($width&gt;0.20) and 0.15&lt;$width) or $width=0.20">4</xsl:when>
- <xsl:when test="(not($width&gt;0.25) and 0.20&lt;$width) or $width=0.25">5</xsl:when>
- <xsl:when test="(not($width&gt;0.30) and 0.25&lt;$width) or $width=0.30">6</xsl:when>
- <xsl:when test="(not($width&gt;0.35) and 0.30&lt;$width) or $width=0.35">7</xsl:when>
- <xsl:when test="(not($width&gt;0.40) and 0.35&lt;$width) or $width=0.40">8</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </图:大小>
- </图:后端箭头>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:opacity or style:graphic-properties/@draw:transparency">
- <图:透明度 uof:locID="g0038">
- <xsl:choose>
- <xsl:when test="style:graphic-properties/@draw:transparency">
- <xsl:value-of select="substring-before(style:graphic-properties/@draw:transparency,'%')"/>
- </xsl:when>
- <xsl:when test="style:graphic-properties/@draw:opacity">
- <xsl:value-of select="100 - substring-before(style:graphic-properties/@draw:opacity,'%')"/>
- </xsl:when>
- </xsl:choose>
- </图:透明度>
- </xsl:if>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="@svg:x1">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- <xsl:when test="@svg:x">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- <xsl:when test="child::draw:text-box/@fo:min-height">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(child::draw:text-box/@fo:min-height,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- <xsl:when test="@svg:width">
- <图:宽度 uof:locID="g0023">
- <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
- </图:宽度>
- <图:高度 uof:locID="g0024">
- <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
- </图:高度>
- </xsl:when>
- </xsl:choose>
- <图:旋转角度 uof:locID="g0025">
- <xsl:choose>
- <xsl:when test="@draw:transform">
- <xsl:variable name="rotate-angle">
- <xsl:value-of select="@draw:transform"/>
- </xsl:variable>
- <xsl:variable name="rotate-temp">
- <xsl:value-of select="substring-before(substring-after($rotate-angle,'rotate ('),')')"/>
- </xsl:variable>
- <xsl:value-of select="($rotate-temp * 360) div (2 * 3.14159265)"/>
- </xsl:when>
- <xsl:otherwise>0.0</xsl:otherwise>
- </xsl:choose>
- </图:旋转角度>
- <图:X-缩放比例 uof:locID="g0026">1</图:X-缩放比例>
- <图:Y-缩放比例 uof:locID="g0027">1</图:Y-缩放比例>
- <图:锁定纵横比 uof:locID="g0028">0</图:锁定纵横比>
- <图:相对原始比例 uof:locID="g0029">1</图:相对原始比例>
- <图:打印对象 uof:locID="g0032">true</图:打印对象>
- <图:Web文字 uof:locID="g0033"/>
- </图:属性>
- </图:预定义图形>
- </xsl:when>
- <xsl:when test="name()='draw:path'">
- <图:svg图形对象 图:version="1.1" 图:xmlns_xlink="http://www.w3.org/1999/xlink">
- <xsl:attribute name="图:x"><xsl:value-of select="@svg:x"/></xsl:attribute>
- <xsl:attribute name="图:y"><xsl:value-of select="@svg:y"/></xsl:attribute>
- <xsl:attribute name="图:width"><xsl:value-of select="@svg:width"/></xsl:attribute>
- <xsl:attribute name="图:height"><xsl:value-of select="@svg:height"/></xsl:attribute>
- <xsl:attribute name="图:viewBox"><xsl:value-of select="@svg:viewBox"/></xsl:attribute>
- <图:path>
- <xsl:attribute name="图:d"><xsl:value-of select="@svg:d"/></xsl:attribute>
- </图:path>
- </图:svg图形对象>
- </xsl:when>
- </xsl:choose>
- <图:文本内容 uof:locID="g0002" uof:attrList="文本框 左边距 右边距 上边距 下边距 水平对齐 垂直对齐 文字排列方向 自动换行 大小适应文字 前一链接 后一链接">
- <xsl:if test="./draw:text-box">
- <xsl:attribute name="图:文本框">true</xsl:attribute>
- <xsl:if test="./@draw:name = /office:document/office:body/office:text//draw:text-box/@draw:chain-next-name">
- <xsl:attribute name="图:前一链接"><xsl:variable name="drawname"><xsl:value-of select="./@draw:name"/></xsl:variable><xsl:variable name="befor-link-name"><xsl:value-of select="/office:document/office:body/office:text//draw:text-box[@draw:name=$drawname]/@draw:style-name"/></xsl:variable><xsl:value-of select="concat($befor-link-name,'_',$picnumber)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="./@draw:chain-next-name">
- <xsl:attribute name="图:后一链接"><xsl:variable name="next-link"><xsl:value-of select="./@draw:chain-next-name"/></xsl:variable><xsl:variable name="link-name"><xsl:value-of select="/office:document/office:body/office:text//draw:text-box[@draw:name=$next-link]/@draw:style-name"/></xsl:variable><xsl:value-of select="concat($link-name,'_',$picnumber)"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
- <xsl:if test="style:text-properties/@fo:padding-left">
- <xsl:attribute name="图:左边距"><xsl:value-of select="style:text-properties/@fo:padding-left"/></xsl:attribute>
- <xsl:attribute name="图:右边距"><xsl:value-of select="style:text-properties/@fo:padding-right"/></xsl:attribute>
- <xsl:attribute name="图:上边距"><xsl:value-of select="style:text-properties/@fo:padding-top"/></xsl:attribute>
- <xsl:attribute name="图:下边距"><xsl:value-of select="style:text-properties/@fo:padding-bottom"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="图:文字排列方向"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-lr'">vert-l2r</xsl:when><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when></xsl:choose></xsl:when><xsl:when test="style:graphic-properties/@style:writing-mode='tb-lr'">vert-l2r</xsl:when><xsl:when test="style:graphic-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when><xsl:when test="style:paragraph-properties/@draw:textarea-horizontal-align='right'">hori-r2l</xsl:when><xsl:otherwise>hori-l2r</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="style:text-properties/@fo:wrap-option">
- <xsl:attribute name="图:自动换行">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:textarea-horizontal-align">
- <xsl:attribute name="图:水平对齐"><xsl:value-of select="style:graphic-properties/@draw:textarea-horizontal-align"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:textarea-vertical-align">
- <xsl:attribute name="图:垂直对齐"><xsl:value-of select="style:graphic-properties/@draw:textarea-vertical-align"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:graphic-properties/@draw:auto-grow-width='true' and style:graphic-properties/@draw:auto-grow-height='true'">
- <xsl:attribute name="图:大小适应文字"><xsl:choose><xsl:when test="style:graphic-properties/@draw:auto-grow-width='true' and style:graphic-properties/@draw:auto-grow-height='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="text:p">
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <xsl:if test="style:paragraph-properties">
- <字:段落属性 uof:locID="t0052" uof:attrList="式样引用">
- <xsl:apply-templates select="style:paragraph-properties"/>
- </字:段落属性>
- </xsl:if>
- <xsl:call-template name="textp"/>
- </字:段落>
- </xsl:for-each>
- <xsl:for-each select="draw:text-box/text:p">
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <xsl:if test="style:paragraph-properties">
- <字:段落属性 uof:locID="t0052" uof:attrList="式样引用">
- <xsl:apply-templates select="style:paragraph-properties"/>
- </字:段落属性>
- </xsl:if>
- <xsl:call-template name="textp"/>
- </字:段落>
- </xsl:for-each>
- </图:文本内容>
- <xsl:if test="@svg:x and @svg:y">
- <图:控制点 uof:locID="g0003" uof:attrList="x坐标 y坐标">
- <xsl:attribute name="图:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="图:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
- </图:控制点>
- </xsl:if>
- </图:图形>
- <xsl:if test="name()='draw:frame' and ./draw:image">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <xsl:variable name="pic">
- <xsl:choose>
- <xsl:when test="contains(./draw:image/@xlink:href,'.png')">png</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.jpg')">jpg</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.gif')">gif</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.bmp')">bmp</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.pbm')">pbm</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.ras')">ras</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.txt')">text</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.xml')">xml</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.htm')">html</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.html')">html</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.wav')">wav</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.mid')">midi</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.ra')">ra</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.au')">au</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.mp3')">mp3</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.snd')">snd</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.svg')">svg</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.avi')">avi</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.mpeg')">mpeg4</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.qt')">qt</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.rm')">rm</xsl:when>
- <xsl:when test="contains(./draw:image/@xlink:href,'.asf')">asf</xsl:when>
- <xsl:otherwise>图片</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$pic!='图片'">
- <xsl:attribute name="uof:公共类型"><xsl:value-of select="$pic"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="uof:私有类型">图片</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="./draw:image/office:binary-data">
- <uof:数据 uof:locID="u0037">
- <xsl:value-of select="./draw:image/office:binary-data"/>
- </uof:数据>
- </xsl:if>
- <xsl:if test="./draw:image/@xlink:href">
- <uof:路径 uof:locID="u0038">
- <xsl:value-of select="./draw:image/@xlink:href"/>
- </uof:路径>
- </xsl:if>
- </uof:其他对象>
- </xsl:if>
- <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
- <xsl:if test="style:text-properties/@draw:fill-image-name">
- <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
- <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'-b1')"/></xsl:attribute>
- <xsl:attribute name="uof:公共类型">png</xsl:attribute>
- <xsl:attribute name="uof:内嵌">true</xsl:attribute>
- <xsl:variable name="fill-name">
- <xsl:value-of select="style:text-properties/@draw:fill-image-name"/>
- </xsl:variable>
- <uof:数据 uof:locID="u0037">
- <xsl:for-each select="/office:document/office:styles/draw:fill-image[@draw:name=$fill-name]">
- <xsl:value-of select="office:binary-data"/>
- </xsl:for-each>
- </uof:数据>
- <uof:路径 uof:locID="u0038">
- <xsl:value-of select="@xlink:href"/>
- </uof:路径>
- </uof:其他对象>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="draw:points">
- <xsl:param name="point"/>
- <xsl:param name="lujing"/>
- <xsl:choose>
- <xsl:when test="contains($point,' ' )">
- <xsl:variable name="first-point" select="substring-before($point,' ')"/>
- <xsl:variable name="other-point" select="substring-after($point,' ')"/>
- <xsl:variable name="xzuobiao">
- <xsl:value-of select="substring-before($first-point,',') div 1000"/>
- </xsl:variable>
- <xsl:variable name="yzuobiao">
- <xsl:value-of select="substring-after($first-point,',') div 1000"/>
- </xsl:variable>
- <xsl:call-template name="draw:points">
- <xsl:with-param name="point" select="$other-point"/>
- <xsl:with-param name="lujing" select="concat($lujing,$xzuobiao,' ',$yzuobiao,'lineto')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="xzuobiao">
- <xsl:value-of select="substring-before($point,',') div 1000"/>
- </xsl:variable>
- <xsl:variable name="yzuobiao">
- <xsl:value-of select="substring-after($point,',') div 1000"/>
- </xsl:variable>
- <xsl:value-of select="concat($lujing,$xzuobiao,' ',$yzuobiao)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="office:meta">
- <uof:元数据 uof:locID="u0001">
- <uof:标题 uof:locID="u0002">
- <xsl:value-of select="dc:title"/>
- </uof:标题>
- <uof:创建应用程序 uof:locID="u0011">
- <xsl:value-of select="meta:generator"/>
- </uof:创建应用程序>
- <uof:摘要 uof:locID="u0007">
- <xsl:value-of select="dc:description"/>
- </uof:摘要>
- <uof:主题 uof:locID="u0003">
- <xsl:value-of select="dc:subject"/>
- </uof:主题>
- <uof:创建者 uof:locID="u0004">
- <xsl:value-of select="meta:initial-creator"/>
- </uof:创建者>
- <!--uof:作者 uof:locID="u0005">
- <xsl:value-of select="meta:initial-creator"/>
- </uof:作者-->
- <uof:创建日期 uof:locID="u0008">
- <xsl:value-of select="meta:creation-date"/>
- </uof:创建日期>
- <uof:最后作者 uof:locID="u0006">
- <xsl:value-of select="dc:creator"/>
- </uof:最后作者>
- <uof:关键字集 uof:locID="u0014">
- <xsl:for-each select=".">
- <uof:关键字 uof:locID="u0015">
- <xsl:value-of select="meta:keywords/@meta:keyword"/>
- </uof:关键字>
- </xsl:for-each>
- </uof:关键字集>
- <uof:编辑次数 uof:locID="u0009">
- <xsl:value-of select="meta:editing-cycles"/>
- </uof:编辑次数>
- <xsl:if test="meta:editing-duration">
- <uof:编辑时间 uof:locID="u0010">
- <xsl:value-of select="meta:editing-duration"/>
- </uof:编辑时间>
- </xsl:if>
- <xsl:if test="meta:template/@xlink:href">
- <uof:文档模板 uof:locID="u0013">
- <xsl:value-of select="meta:template/@xlink:href"/>
- </uof:文档模板>
- </xsl:if>
- <xsl:if test="meta:user-defined/@meta:name">
- <uof:用户自定义元数据集 uof:locID="u0016">
- <xsl:for-each select="meta:user-defined">
- <uof:用户自定义元数据 uof:locID="u0017" uof:attrList="名称 类型">
- <xsl:attribute name="uof:名称"><xsl:value-of select="@meta:name"/></xsl:attribute>
- <xsl:attribute name="uof:类型"><xsl:value-of select="'string'"/></xsl:attribute>
- </uof:用户自定义元数据>
- </xsl:for-each>
- </uof:用户自定义元数据集>
- </xsl:if>
- <!--xsl:if test="meta:document-statistic/@meta:page-count"-->
- <uof:页数 uof:locID="u0020">
- <xsl:value-of select="meta:document-statistic/@meta:page-count"/>
- </uof:页数>
- <!--/xsl:if-->
- <!--xsl:if test="meta:document-statistic/@meta:paragraph-count"-->
- <uof:段落数 uof:locID="u0025">
- <xsl:value-of select="meta:document-statistic/@meta:paragraph-count"/>
- </uof:段落数>
- <!--/xsl:if-->
- <!--xsl:if test="meta:document-statistic/@meta:object-count"-->
- <uof:对象数 uof:locID="u0026">
- <xsl:value-of select="meta:document-statistic/@meta:object-count"/>
- </uof:对象数>
- <!--/xsl:if-->
- <!--xsl:if test="meta:document-statistic/@meta:character-count"-->
- <uof:字数 uof:locID="u0021">
- <xsl:value-of select="meta:document-statistic/@meta:character-count"/>
- </uof:字数>
- <!--/xsl:if-->
- <!--xsl:if test="meta:document-statistic/@meta:word-count"-->
- <uof:中文字符数 uof:locID="u0023">
- <xsl:value-of select="meta:document-statistic/@meta:word-count"/>
- </uof:中文字符数>
- <!--/xsl:if-->
- <uof:英文字符数 uof:locID="u0022">
- <xsl:value-of select="meta:document-statistic/@meta:character-count - meta:document-statistic/@meta:word-count"/>
- </uof:英文字符数>
- <uof:行数 uof:locID="u0024">
- <xsl:variable name="quzhi">
- <xsl:value-of select="(meta:document-statistic/@meta:character-count div 39) + 0.9"/>
- </xsl:variable>
- <xsl:value-of select="substring-before($quzhi,'.')"/>
- </uof:行数>
- <uof:分类 uof:locID="u0012">
- <xsl:value-of select="meta:user-defined[@meta:name='Category']"/>
- </uof:分类>
- <uof:经理名称 uof:locID="u0019">
- <xsl:value-of select="meta:user-defined[meta:name='Manager']"/>
- </uof:经理名称>
- <uof:公司名称 uof:locID="u0018">
- <xsl:value-of select="meta:user-defined[meta:name='Company']"/>
- </uof:公司名称>
- </uof:元数据>
- </xsl:template>
- <xsl:template match="office:font-face-decls">
- <uof:字体集 uof:locID="u0040">
- <xsl:for-each select="style:font-face">
- <xsl:element name="uof:字体声明">
- <xsl:attribute name="uof:attrList">标识符 名称 字体族</xsl:attribute>
- <xsl:attribute name="uof:locID">u0041</xsl:attribute>
- <xsl:attribute name="uof:名称"><xsl:value-of select="@svg:font-family"/></xsl:attribute>
- <xsl:attribute name="uof:标识符"><xsl:value-of select="translate(@style:name,' ','_')"/></xsl:attribute>
- <xsl:if test="@style:font-charset= '02'">
- <xsl:attribute name="uof:字符集">x-symbol</xsl:attribute>
- </xsl:if>
- <xsl:if test="@style:font-family-generic">
- <xsl:choose>
- <xsl:when test="@style:font-family-generic = 'swiss'">
- <xsl:attribute name="uof:字体族">Swiss</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='modern'">
- <xsl:attribute name="uof:字体族">Modern</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic='roman'">
- <xsl:attribute name="uof:字体族">Roman</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='script'">
- <xsl:attribute name="uof:字体族">Script</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='decorative'">
- <xsl:attribute name="uof:字体族">Decorative</xsl:attribute>
- </xsl:when>
- <xsl:when test="@style:font-family-generic ='system'">
- <xsl:attribute name="uof:字体族">System</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="uof:字体族">System</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- <xsl:apply-templates select="style:font-decl"/>
- </uof:字体集>
- </xsl:template>
- <xsl:template name="自动编号集">
- <xsl:element name="uof:自动编号集">
- <xsl:attribute name="uof:locID">u0042</xsl:attribute>
- <xsl:for-each select="/office:document//text:list-style">
- <xsl:element name="字:自动编号">
- <xsl:attribute name="uof:locID">t0169</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 父编号引用 多级编号</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:if test=".//@text:style-name">
- <xsl:attribute name="字:名称"><xsl:value-of select=".//@text:style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="字:多级编号">true</xsl:attribute>
- <xsl:for-each select="./* ">
- <xsl:if test="not(number(@text:level)=10)">
- <xsl:element name="字:级别">
- <xsl:attribute name="uof:locID">t0159</xsl:attribute>
- <xsl:attribute name="uof:attrList">级别值 编号对齐方式 尾随字符</xsl:attribute>
- <xsl:attribute name="字:级别值"><xsl:value-of select="number(@text:level) - 1"/></xsl:attribute>
- <xsl:if test="@style:num-suffix">
- <xsl:attribute name="字:尾随字符"><xsl:choose><xsl:when test="@style:num-suffix=' '">space</xsl:when><xsl:when test="@style:num-suffix=' '">tab</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:list-level-properties/@fo:text-align">
- <xsl:attribute name="字:编号对齐方式"><xsl:variable name="vv"><xsl:value-of select="style:list-level-properties/@fo:text-align"/></xsl:variable><xsl:choose><xsl:when test="$vv='center' ">center</xsl:when><xsl:when test="$vv='end' ">right</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="@text:bullet-char">
- <xsl:element name="字:项目符号">
- <xsl:attribute name="uof:locID">t0171</xsl:attribute>
- <xsl:value-of select="@text:bullet-char"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="@text:style-name">
- <xsl:element name="字:符号字体">
- <xsl:attribute name="uof:locID">t0160</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="@style:num-format">
- <xsl:choose>
- <xsl:when test="string(@style:num-format)='a'">
- <xsl:element name="字:编号格式">
- <xsl:attribute name="uof:locID">t0162</xsl:attribute>lower-letter</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='A'">
- <xsl:element name="字:编号格式">
- <xsl:attribute name="uof:locID">t0162</xsl:attribute>upper-letter</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='i'">
- <xsl:element name="字:编号格式">
- <xsl:attribute name="uof:locID">t0162</xsl:attribute>lower-roman</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='I'">
- <xsl:element name="字:编号格式">
- <xsl:attribute name="uof:locID">t0162</xsl:attribute>upper-roman</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='①, ②, ③, ...'">
- <xsl:element name="字:编号格式">
- <xsl:attribute name="uof:locID">t0162</xsl:attribute>decimal-enclosed-circle</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='甲, 乙, 丙, ...'">
- <xsl:element name="字:编号格式">
- <xsl:attribute name="uof:locID">t0162</xsl:attribute>ideograph-traditional</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='子, 丑, 寅, ...'">
- <xsl:element name="字:编号格式">
- <xsl:attribute name="uof:locID">t0162</xsl:attribute>ideograph-zodiac</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='一, 二, 三, ...'">
- <xsl:element name="字:编号格式">
- <xsl:attribute name="uof:locID">t0162</xsl:attribute>chinese-counting</xsl:element>
- </xsl:when>
- <xsl:when test="string(@style:num-format)='壹, 贰, 叁, ...'">
- <xsl:element name="字:编号格式">
- <xsl:attribute name="uof:locID">t0162</xsl:attribute>chinese-legal-simplified</xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="字:编号格式">
- <xsl:attribute name="uof:locID">t0162</xsl:attribute>decimal</xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:variable name="jibie">
- <xsl:value-of select="position()"/>
- </xsl:variable>
- <xsl:variable name="xianshijibie">
- <xsl:choose>
- <xsl:when test="@text:display-levels">
- <xsl:value-of select="@text:display-levels"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="字:编号格式表示">
- <xsl:attribute name="uof:locID">t0163</xsl:attribute>
- <xsl:call-template name="字:编号格式表示">
- <xsl:with-param name="bubianjibie" select="$jibie"/>
- <xsl:with-param name="jibie" select="$jibie"/>
- <xsl:with-param name="xianshijibie" select="$xianshijibie"/>
- <xsl:with-param name="biaoshi" select="concat(string(@style:num-prefix),'%',$jibie,string(@style:num-suffix))"/>
- </xsl:call-template>
- </xsl:element>
- <xsl:if test="office:binary-data">
- <xsl:element name="字:图片符号引用">
- <xsl:attribute name="uof:locID">t0164</xsl:attribute>
- <xsl:attribute name="uof:attrList">宽度 高度</xsl:attribute>
- <xsl:if test="style:list-level-properties/@fo:width">
- <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(style:list-level-properties/@fo:width,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:list-level-properties/@fo:height">
- <xsl:attribute name="字:高度"><xsl:value-of select="substring-before(style:list-level-properties/@fo:height,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:value-of select="concat('image_numbering_',count(preceding::text:list-level-style-image))"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@fo:margin-left or style:paragraph-properties/@fo:margin-right or style:paragraph-properties/@fo:text-indent">
- <xsl:element name="字:缩进">
- <xsl:attribute name="uof:locID">t0165</xsl:attribute>
- <xsl:for-each select="style:paragraph-properties">
- <xsl:call-template name="字:缩进类型"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:list-level-properties/@text:min-label-width">
- <xsl:element name="字:制表符位置">
- <xsl:attribute name="uof:locID">t0166</xsl:attribute>
- <xsl:value-of select="substring-before(style:list-level-properties/@text:min-label-width,$uofUnit)"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="@text:start-value">
- <xsl:element name="字:起始编号">
- <xsl:attribute name="uof:locID">t0167</xsl:attribute>
- <xsl:value-of select="@text:start-value"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="@text:num-regular-exp">
- <xsl:element name="字:正规格式">
- <xsl:attribute name="uof:locID">t0168</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="@text:num-regular-exp"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template name="shiyang">
- <xsl:for-each select="office:styles/style:style">
- <xsl:choose>
- <xsl:when test="@style:family='text'">
- <xsl:element name="uof:句式样">
- <xsl:attribute name="uof:locID">u0043</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:类型">auto</xsl:attribute>
- <xsl:choose>
- <xsl:when test="@style:parent-style-name">
- <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:name"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="字:句属性"/>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- <xsl:for-each select="office:automatic-styles/style:style">
- <xsl:choose>
- <xsl:when test="@style:family='text'">
- <xsl:element name="uof:句式样">
- <xsl:attribute name="uof:locID">u0043</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:类型">custom</xsl:attribute>
- <xsl:choose>
- <xsl:when test="@style:parent-style-name">
- <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@style:parent-style-name and not(@style:parent-style-name='Standard')">
- <xsl:variable name="stylename" select="@style:parent-style-name"/>
- <xsl:for-each select="/office:document/office:styles/style:style[@style:name=$stylename]">
- <xsl:call-template name="字:句属性"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="字:句属性"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- <xsl:for-each select="office:styles/style:style">
- <xsl:choose>
- <xsl:when test="@style:family='paragraph'">
- <xsl:element name="uof:段落式样">
- <xsl:attribute name="uof:locID">u0044</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:类型">auto</xsl:attribute>
- <xsl:if test="@style:parent-style-name">
- <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:if test="@style:display-name">
- <xsl:attribute name="字:别名"><xsl:value-of select="@style:display-name"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:call-template name="字:句属性"/>
- </xsl:element>
- <xsl:call-template name="ParaAttribute"/>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- <xsl:for-each select="office:automatic-styles/style:style">
- <xsl:choose>
- <xsl:when test="@style:family='paragraph'">
- <xsl:element name="uof:段落式样">
- <xsl:attribute name="uof:locID">u0044</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:类型">custom</xsl:attribute>
- <xsl:if test="@style:parent-style-name">
- <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:call-template name="字:句属性"/>
- </xsl:element>
- <xsl:call-template name="ParaAttribute"/>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="字:编号格式表示">
- <xsl:param name="bubianjibie"/>
- <xsl:param name="jibie"/>
- <xsl:param name="xianshijibie"/>
- <xsl:param name="biaoshi"/>
- <xsl:choose>
- <xsl:when test="number($xianshijibie)= 1">
- <xsl:value-of select="$biaoshi"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="num-prefix">
- <xsl:value-of select="preceding-sibling::*[number($bubianjibie -$jibie +1)]/@style:num-prefix"/>
- </xsl:variable>
- <xsl:variable name="num-suffix">
- <xsl:value-of select="preceding-sibling::*[number($bubianjibie -$jibie +1)]/@style:num-suffix"/>
- </xsl:variable>
- <xsl:call-template name="字:编号格式表示">
- <xsl:with-param name="bubianjibie" select="$bubianjibie"/>
- <xsl:with-param name="jibie" select="$jibie -1"/>
- <xsl:with-param name="xianshijibie" select="$xianshijibie -1"/>
- <xsl:with-param name="biaoshi" select="concat($num-prefix,'%',number($jibie -1),$num-suffix,'.',$biaoshi)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="style:style[ancestor::office:automatic-styles]" mode="style">
- <xsl:for-each select=".">
- <xsl:choose>
- <xsl:when test="@style:family='table' ">
- <xsl:element name="uof:文字表式样">
- <xsl:attribute name="uof:locID">u0045</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:别名"><xsl:value-of select="@style:name"/></xsl:attribute>
- <xsl:attribute name="字:类型">auto</xsl:attribute>
- <xsl:if test="style:table-properties">
- <xsl:element name="字:宽度">
- <xsl:attribute name="字:绝对宽度"><xsl:value-of select="substring-before(style:table-properties/@style:width,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0130</xsl:attribute>
- <xsl:attribute name="uof:attrList">绝对宽度 相对宽度</xsl:attribute>
- </xsl:element>
- <字:对齐 uof:locID="t0133">
- <xsl:choose>
- <xsl:when test="style:table-properties/@table:align='right'">right</xsl:when>
- <xsl:when test="style:table-properties/@table:align='center'">center</xsl:when>
- <xsl:otherwise>left</xsl:otherwise>
- </xsl:choose>
- </字:对齐>
- </xsl:if>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="office:settings">
- <字:文档设置 uof:locID="t0001">
- <字:度量单位 uof:locID="t0006">
- <xsl:value-of select="$ooUnit"/>
- </字:度量单位>
- <字:默认制表位位置 uof:locID="t0004">
- <xsl:variable name="aa" select="substring-before(/office:document/office:styles/style:default-style[@style:family='paragraph']/style:paragraph-properties/@style:tab-stop-distance,$ooUnit)"/>
- <xsl:variable name="bb" select="$aa - 0.74"/>
- <xsl:value-of select="substring($bb,1,4)"/>
- </字:默认制表位位置>
- <字:当前视图 uof:locID="t0002">
- <xsl:choose>
- <xsl:when test="config:config-item-set[@config:name='ooo:view-settings']/config:config-item[@config:name='InBrowseMode']='false'">page</xsl:when>
- <xsl:when test="config:config-item-set[@config:name='ooo:view-settings']/config:config-item[@config:name='InBrowseMode']='true'">web</xsl:when>
- <xsl:otherwise>page</xsl:otherwise>
- </xsl:choose>
- </字:当前视图>
- <xsl:if test="config:config-item-set[@config:name='ooo:view-settings']/config:config-item-map-indexed[@config:name='Views']/config:config-item-map-entry/config:config-item[@config:name='ZoomFactor']">
- <字:缩放 uof:locID="t0003">
- <xsl:value-of select="config:config-item-set[@config:name='ooo:view-settings']/config:config-item-map-indexed[@config:name='Views']/config:config-item-map-entry/config:config-item[@config:name='ZoomFactor']"/>
- </字:缩放>
- </xsl:if>
- <字:修订 uof:locID="t0005">
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="/office:document/office:body/office:text/text:tracked-changes">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </字:修订>
- <xsl:if test="config:config-item-set[@config:name='configuration-settings']/config:config-item-map-indexed[@config:name='ForbiddenCharacters']/config:config-item-map-entry[config:config-item='CN']">
- <字:标点禁则 uof:locID="t0007">
- <字:行首字符 uof:locID="t0008">
- <xsl:value-of select="config:config-item-set[@config:name='configuration-settings']/config:config-item-map-indexed[@config:name='ForbiddenCharacters']/config:config-item-map-entry[config:config-item='CN']/config:config-item[@config:name='BeginLine']"/>
- </字:行首字符>
- <字:行尾字符 uof:locID="t0009">
- <xsl:value-of select="config:config-item-set[@config:name='configuration-settings']/config:config-item-map-indexed[@config:name='ForbiddenCharacters']/config:config-item-map-entry[config:config-item='CN']/config:config-item[@config:name='EndLine']"/>
- </字:行尾字符>
- </字:标点禁则>
- <xsl:if test="/office:document/office:styles/text:notes-configuration[@text:note-class='endnote']">
- <字:尾注位置 uof:locID="t0210" uof:attrList="位置">
- <xsl:attribute name="字:位置">doc-end</xsl:attribute>
- </字:尾注位置>
- </xsl:if>
- </xsl:if>
- </字:文档设置>
- </xsl:template>
- <xsl:template name="style:page-layout">
- <字:分节 uof:locID="t0017" uof:attrList="名称">
- <xsl:attribute name="字:名称"><xsl:variable name="stylename"><xsl:value-of select="@style:name"/></xsl:variable><xsl:value-of select="/office:document/office:master-styles/style:master-page[@style:page-layout-name=$stylename]/@style:name"/></xsl:attribute>
- <字:节属性 uof:locID="t0018">
- <字:节类型 uof:locID="t0020">new-page</字:节类型>
- <xsl:element name="字:页边距">
- <xsl:attribute name="uof:locID">t0021</xsl:attribute>
- <xsl:attribute name="uof:attrList">左 上 右 下</xsl:attribute>
- <xsl:attribute name="uof:上"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:左"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-left,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:下"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:右"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-right,$ooUnit)"/></xsl:attribute>
- </xsl:element>
- <xsl:element name="字:纸张">
- <xsl:attribute name="uof:locID">t0022</xsl:attribute>
- <xsl:attribute name="uof:attrList">纸型 宽度 高度</xsl:attribute>
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:page-width,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:高度"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:page-height,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="uof:纸型"><xsl:variable name="height"><xsl:value-of select="style:page-layout-properties/@fo:page-height"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="style:page-layout-properties/@fo:page-width"/></xsl:variable><xsl:choose><xsl:when test="$width='29.702cm' and $height='42cm'">A3</xsl:when><xsl:when test="$width='21.001cm' and $height='29.7cm'">A4</xsl:when><xsl:when test="$width='14.799cm' and $height='20.999cm'">A5</xsl:when><xsl:when test="$width='25cm' and $height='35.3cm'">B4</xsl:when><xsl:when test="$width='17.598cm' and $height='25cm'">B5</xsl:when><xsl:when test="$width='12.5cm' and $height='17.6cm'">B6</xsl:when><xsl:otherwise>使用者</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:if test="/office:document/office:master-styles/style:master-page/style:header-left">
- <xsl:element name="字:奇偶页页眉页脚不同">
- <xsl:attribute name="uof:locID">t0023</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:首页页眉页脚不同">
- <xsl:attribute name="uof:locID">t0024</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">false</xsl:attribute>
- </xsl:element>
- <xsl:if test="style:header-style/style:header-footer-properties">
- <xsl:element name="字:页眉位置">
- <xsl:attribute name="uof:locID">t0025</xsl:attribute>
- <xsl:attribute name="uof:attrList">距边界 距版芯</xsl:attribute>
- <xsl:attribute name="字:距边界"><xsl:value-of select="substring-before(style:header-style/style:header-footer-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
- <xsl:variable name="long1" select="substring-before(style:header-style/style:header-footer-properties/@fo:margin-bottom,$ooUnit)"/>
- <xsl:variable name="long2" select="substring-before(style:header-style/style:header-footer-properties/@svg:height,$ooUnit)"/>
- <xsl:attribute name="字:距版芯"><xsl:value-of select="$long2 - $long1"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:footer-style/style:header-footer-properties">
- <xsl:element name="字:页脚位置">
- <xsl:attribute name="uof:locID">t0026</xsl:attribute>
- <xsl:attribute name="uof:attrList">距边界 距版芯</xsl:attribute>
- <xsl:attribute name="字:距边界"><xsl:value-of select="substring-before(style:footer-style/style:header-footer-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
- <xsl:variable name="long1" select="substring-before(style:footer-style/style:header-footer-properties/@fo:margin-top,$ooUnit)"/>
- <xsl:variable name="long2" select="substring-before(style:footer-style/style:header-footer-properties/@svg:height,$ooUnit)"/>
- <xsl:attribute name="字:距版芯"><xsl:value-of select="$long2 - $long1"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:variable name="masterPages" select="'Standard'"/>
- <xsl:variable name="mp">
- <xsl:value-of select="@style:name"/>
- </xsl:variable>
- <xsl:for-each select="/office:document/office:master-styles/style:master-page[@style:page-layout-name=$mp and @style:name=$masterPages]">
- <xsl:if test="style:header-left or style:header">
- <字:页眉 uof:locID="t0027">
- <xsl:choose>
- <xsl:when test="style:header-left">
- <xsl:for-each select="style:header">
- <字:首页页眉 uof:locID="t0030">
- <xsl:if test="text:p">
- <xsl:for-each select="text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="table:table">
- <xsl:for-each select="table:table">
- <xsl:call-template name="exec_table"/>
- </xsl:for-each>
- </xsl:if>
- </字:首页页眉>
- </xsl:for-each>
- <xsl:for-each select="style:header-left">
- <字:偶数页页眉 uof:locID="t0029">
- <xsl:if test="text:p">
- <xsl:for-each select="text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="table:table">
- <xsl:for-each select="table:table">
- <xsl:call-template name="exec_table"/>
- </xsl:for-each>
- </xsl:if>
- </字:偶数页页眉>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="style:header">
- <字:奇数页页眉 uof:locID="t0028">
- <xsl:if test="text:p">
- <xsl:for-each select="text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="table:table">
- <xsl:for-each select="table:table">
- <xsl:call-template name="exec_table"/>
- </xsl:for-each>
- </xsl:if>
- </字:奇数页页眉>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </字:页眉>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="/office:document/office:master-styles/style:master-page[@style:page-layout-name=$mp and @style:name=$masterPages]">
- <xsl:if test="style:footer-left or style:footer">
- <字:页脚 uof:locID="t0031">
- <xsl:choose>
- <xsl:when test="style:footer-left">
- <xsl:for-each select="style:footer">
- <字:首页页脚 uof:locID="t0034">
- <xsl:if test="text:p">
- <xsl:for-each select="text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="table:table">
- <xsl:for-each select="table:table">
- <xsl:call-template name="exec_table"/>
- </xsl:for-each>
- </xsl:if>
- </字:首页页脚>
- </xsl:for-each>
- <xsl:for-each select="style:footer-left">
- <字:偶数页页脚 uof:locID="t0033">
- <xsl:if test="text:p">
- <xsl:for-each select="text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="table:table">
- <xsl:for-each select="table:table">
- <xsl:call-template name="exec_table"/>
- </xsl:for-each>
- </xsl:if>
- </字:偶数页页脚>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="style:footer">
- <字:奇数页页脚 uof:locID="t0032">
- <xsl:if test="text:p">
- <xsl:for-each select="text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="table:table">
- <xsl:for-each select="table:table">
- <xsl:call-template name="exec_table"/>
- </xsl:for-each>
- </xsl:if>
- </字:奇数页页脚>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </字:页脚>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="@style:page-usage">
- <字:对称页边距 uof:locID="t0036" uof:attrList="值">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:page-usage='mirrored'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </字:对称页边距>
- </xsl:if>
- <xsl:if test="@style:page-usage='mirrored'">
- <xsl:element name="字:拼页">
- <xsl:attribute name="uof:locID">t0037</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">1</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:纸张方向">
- <xsl:attribute name="uof:locID">t0038</xsl:attribute>
- <xsl:value-of select="style:page-layout-properties/@style:print-orientation"/>
- </xsl:element>
- <xsl:if test="style:page-layout-properties/@style:paper-tray-name">
- <字:纸张来源 uof:locID="t0039" uof:attrList="首页 其他页" 字:首页="false" 字:其他页="style:page-layout-properties/@style:paper-tray-name"/>
- </xsl:if>
- <xsl:if test="style:page-layout-properties/@style:num-format">
- <xsl:element name="字:页码设置">
- <xsl:attribute name="uof:locID">t0042</xsl:attribute>
- <xsl:attribute name="uof:attrList">首页显示 格式 包含章节号 章节起始样式引用 分隔符 起始编号</xsl:attribute>
- <xsl:attribute name="字:首页显示">1</xsl:attribute>
- <xsl:attribute name="字:格式"><xsl:variable name="format"><xsl:value-of select="style:page-layout-properties/@style:num-format"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
- <xsl:if test="style:text-properties/@style:first-page-number">
- <xsl:attribute name="字:起始编号"><xsl:value-of select="style:text-properties/@style:first-page-number"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="字:包含章节号">false</xsl:attribute>
- <!--xsl:attribute name="字:章节起始样式引用">false</xsl:attribute-->
- <xsl:attribute name="字:分隔符">hyphen</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="/office:document/office:styles/text:notes-configuration[@text:note-class='footnote']">
- <xsl:element name="字:脚注设置">
- <xsl:attribute name="uof:locID">t0040</xsl:attribute>
- <xsl:attribute name="uof:attrList">位置 格式 起始编号 编号方式</xsl:attribute>
- <xsl:for-each select="/office:document/office:styles/text:notes-configuration[@text:note-class='footnote']">
- <xsl:attribute name="字:位置"><xsl:choose><xsl:when test="@text:footnotes-position='page'">page-bottom</xsl:when><xsl:when test="@text:footnotes-position='document'">below-text</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="字:编号方式"><xsl:choose><xsl:when test="@text:start-numbering-at='document'">continuous</xsl:when><xsl:when test="@text:start-numbering-at='chapter'">section</xsl:when><xsl:when test="@text:start-numbering-at='page'">page</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="字:起始编号"><xsl:value-of select="@text:start-value + 1"/></xsl:attribute>
- <xsl:attribute name="字:格式"><xsl:variable name="format"><xsl:value-of select="@style:num-format"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:if test="/office:document/office:styles/text:notes-configuration[@text:note-class='endnote']">
- <字:尾注设置 uof:locID="t0041" uof:attrList="格式 起始编号 编号方式">
- <xsl:for-each select="/office:document/office:styles/text:notes-configuration[@text:note-class='endnote']">
- <xsl:attribute name="字:格式"><xsl:variable name="format"><xsl:value-of select="@style:num-format"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
- <xsl:attribute name="字:起始编号"><xsl:value-of select="@text:start-value + 1"/></xsl:attribute>
- </xsl:for-each>
- </字:尾注设置>
- </xsl:if>
- <xsl:if test="/office:document/office:styles/text:linenumbering-configuration">
- <字:行号设置 uof:locID="t0043" uof:attrList="使用行号 编号方式 起始编号 距边界 行号间隔">
- <xsl:for-each select="/office:document/office:styles/text:linenumbering-configuration">
- <xsl:choose>
- <xsl:when test="@text:number-lines='false'">
- <xsl:attribute name="字:使用行号">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:使用行号">true</xsl:attribute>
- <xsl:attribute name="字:编号方式"><xsl:choose><xsl:when test="@text:count-in-floating-frames='true'">section</xsl:when><xsl:when test="@text:restart-on-page='true'">page</xsl:when><xsl:when test="@text:count-empty-lines='false'"/><xsl:otherwise>continuous</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="@style:num-format">
- <xsl:attribute name="字:起始编号"><xsl:value-of select="@style:num-format"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@text:offset">
- <xsl:attribute name="字:距边界"><xsl:value-of select="substring-before(@text:offset,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@text:increment">
- <xsl:attribute name="字:行号间隔"><xsl:value-of select="@text:increment"/></xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- </字:行号设置>
- </xsl:if>
- <xsl:variable name="aa">
- <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-ruby-height,$ooUnit)"/>
- </xsl:variable>
- <xsl:if test="style:page-layout-properties/@style:layout-grid-display and $aa='0' ">
- <字:网格设置 uof:locID="t0044" uof:attrList="网格类型 宽度 高度 显示网格 打印网格">
- <xsl:if test="style:page-layout-properties/@style:layout-grid-mode">
- <xsl:attribute name="字:网格类型"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='both-nosnap'">line-char</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='both'">char</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='line'">line</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='none'">none</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:page-layout-properties/@style:layout-grid-base-width">
- <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-width,$ooUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:page-layout-properties/@style:layout-grid-base-height">
- <xsl:attribute name="字:高度"><xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-height,$ooUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:page-layout-properties/@style:layout-grid-display">
- <xsl:attribute name="字:显示网格"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-display='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:page-layout-properties/@style:layout-grid-print">
- <xsl:attribute name="字:打印网格"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-print='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </字:网格设置>
- </xsl:if>
- <xsl:if test="style:page-layout-properties/@style:layout-grid-display and not($aa = '0')">
- <字:稿纸设置 uof:locID="t0211" uof:attrList="类型 格式 线型 颜色 方向">
- <xsl:variable name="mode">
- <xsl:value-of select="style:page-layout-properties/@style:layout-grid-mode"/>
- </xsl:variable>
- <xsl:variable name="ruby">
- <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-ruby-height,$ooUnit)"/>
- </xsl:variable>
- <xsl:variable name="width">
- <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-width,$ooUnit)"/>
- </xsl:variable>
- <xsl:variable name="height">
- <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-height,$ooUnit)"/>
- </xsl:variable>
- <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='line'">letter-paper</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='both'">draft-paper</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="style:page-layout-properties/@style:layout-grid-mode">
- <xsl:attribute name="字:格式"><xsl:choose><xsl:when test="$mode='both' and $width='0.728' and $height='0.728' and $ruby='0.496' ">fourth-gear</xsl:when><xsl:when test="$mode='both' and $width='0.584' and $height='0.584' and $ruby='0.64' ">third-gear</xsl:when><xsl:when test="$mode='both' and $width='0.728' and $height='0.728' and $ruby='0.905' ">second-gear</xsl:when><xsl:when test="$mode='both' and $width='0.728' and $height='0.728' and $ruby='1.633' ">first-gear</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:page-layout-properties/@style:layout-grid-color">
- <xsl:attribute name="字:颜色"><xsl:value-of select="style:page-layout-properties/@style:layout-grid-color"/></xsl:attribute>
- </xsl:if>
- </字:稿纸设置>
- </xsl:if>
- <xsl:if test="/office:document/office:automatic-styles/style:page-layout/style:page-layout-properties/@style:writing-mode='lr-tb' or style:text-properties/@style:writing-mode='rl-tb'">
- <字:垂直对齐方式 uof:locID="t0045">
- <xsl:variable name="path" select="/office:document/office:automatic-styles/style:style/style:paragraph-properties"/>
- <xsl:choose>
- <xsl:when test="$path/@fo:text-align='start'">top</xsl:when>
- <xsl:when test="$path/@fo:text-align='end'">bottom</xsl:when>
- <xsl:when test="$path/@fo:text-align='center'">center</xsl:when>
- <xsl:otherwise>justified</xsl:otherwise>
- </xsl:choose>
- </字:垂直对齐方式>
- </xsl:if>
- <字:文字排列方向 uof:locID="t0046">
- <xsl:variable name="writing_mode">
- <xsl:value-of select="style:page-layout-properties/@style:writing-mode"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$writing_mode='lr-tb' or $writing_mode='lr'">hori-l2r</xsl:when>
- <xsl:when test="$writing_mode='rl-tb' or $writing_mode='rl'">hori-r2l</xsl:when>
- <xsl:when test="$writing_mode='tb-rl'">vert-r2l</xsl:when>
- <xsl:when test="$writing_mode='tb-lr'">vert-l2r</xsl:when>
- <xsl:otherwise>hori-l2r</xsl:otherwise>
- </xsl:choose>
- </字:文字排列方向>
- <xsl:if test="style:page-layout-properties/@fo:border or style:page-layout-properties/@fo:border-top or style:page-layout-properties/@fo:border-bottom or style:page-layout-properties/@fo:border-left or style:page-layout-properties/@fo:border-right or style:page-layout-properties/@style:shadow[.!='none']">
- <xsl:element name="字:边框">
- <xsl:attribute name="uof:locID">t0047</xsl:attribute>
- <xsl:for-each select="style:page-layout-properties">
- <xsl:call-template name="uof:边框"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:page-layout-properties/@fo:background-color">
- <xsl:element name="字:填充">
- <xsl:attribute name="uof:locID">t0048</xsl:attribute>
- <xsl:for-each select="style:page-layout-properties">
- <xsl:call-template name="图:填充"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:page-layout-properties/style:columns">
- <xsl:element name="字:分栏">
- <xsl:attribute name="uof:locID">t0049</xsl:attribute>
- <xsl:attribute name="uof:attrList">栏数 等宽 分隔线 分隔线宽度 分隔线颜色</xsl:attribute>
- <xsl:if test="//@fo:column-count">
- <xsl:attribute name="字:栏数"><xsl:choose><xsl:when test="//@fo:column-count='0'">1</xsl:when><xsl:otherwise><xsl:value-of select="//@fo:column-count"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:variable name="第一宽度">
- <xsl:value-of select="style:page-layout-properties/style:columns/style:column/@style:rel-width"/>
- </xsl:variable>
- <xsl:variable name="dkm">
- <xsl:for-each select="style:page-layout-properties/style:columns/style:column">
- <xsl:if test="$第一宽度 != @style:rel-width">
- <xsl:value-of select="boolean($第一宽度 = @style:rel-width)"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="style:page-layout-properties/style:columns/@fo:column-gap">
- <xsl:attribute name="字:等宽">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:等宽">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="style:page-layout-properties/style:columns/style:column-sep">
- <xsl:attribute name="字:分隔线宽度"><xsl:value-of select="substring-before(style:page-layout-properties/style:columns/style:column-sep/@style:width,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="字:分隔线颜色"><xsl:value-of select="style:page-layout-properties/style:columns/style:column-sep/@style:color"/></xsl:attribute>
- <xsl:attribute name="字:分隔线">single</xsl:attribute>
- </xsl:if>
- <xsl:for-each select="style:page-layout-properties/style:columns/style:column">
- <xsl:element name="字:栏">
- <xsl:variable name="left">
- <xsl:value-of select="substring-before(@fo:start-indent,$uofUnit)"/>
- </xsl:variable>
- <xsl:variable name="right">
- <xsl:value-of select="substring-before(@fo:end-indent,$uofUnit)"/>
- </xsl:variable>
- <xsl:if test="@style:rel-width">
- <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(@style:rel-width,'*')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@fo:start-indent or @fo:end-indent">
- <xsl:choose>
- <xsl:when test="parent::style:columns/@fo:column-gap">
- <xsl:attribute name="字:间距"><xsl:choose><xsl:when test="$left - $right &gt;0 "><xsl:value-of select="$left - $right"/></xsl:when><xsl:when test="$right - $left &gt; 0 "><xsl:value-of select="$right - $left"/></xsl:when><xsl:otherwise><xsl:value-of select="$right"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:间距"><xsl:value-of select="$right"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:attribute name="uof:locID">t0050</xsl:attribute>
- <xsl:attribute name="uof:attrList">宽度 间距</xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- </字:节属性>
- </字:分节>
- </xsl:template>
- <xsl:template match="office:text">
- <xsl:for-each select="node( )">
- <xsl:choose>
- <xsl:when test="name()='text:list'or name()='text:ordered-list'">
- <xsl:call-template name="unordered-ordered-list">
- <xsl:with-param name="currlistlvl" select="number('1')"/>
- <xsl:with-param name="liststylename" select="@text:style-name"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name()='text:p'or name()='text:h'">
- <xsl:variable name="bs" select="./@text:style-name"/>
- <xsl:if test="/office:document/office:automatic-styles/style:style[@style:name=$bs]/@style:master-page-name">
- <xsl:variable name="bs1" select="/office:document/office:automatic-styles/style:style[@style:name=$bs]/@style:master-page-name"/>
- <xsl:if test="/office:document/office:master-styles/style:master-page[@style:name=$bs1]/@style:page-layout-name">
- <xsl:variable name="bs2" select="/office:document/office:master-styles/style:master-page[@style:name=$bs1]/@style:page-layout-name"/>
- <xsl:for-each select="/office:document/office:automatic-styles/style:page-layout[@style:name=$bs2]">
- <xsl:call-template name="style:page-layout"/>
- </xsl:for-each>
- </xsl:if>
- </xsl:if>
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name()='table:table'">
- <xsl:variable name="tbs" select="./@table:style-name"/>
- <xsl:if test="/office:document/office:automatic-styles/style:style[@style:name=$tbs]/@style:master-page-name">
- <xsl:variable name="tbs1" select="/office:document/office:automatic-styles/style:style[@style:name=$tbs]/@style:master-page-name"/>
- <xsl:if test="/office:document/office:master-styles/style:master-page[@style:name=$tbs1]/@style:page-layout-name">
- <xsl:variable name="tbs2" select="/office:document/office:master-styles/style:master-page[@style:name=$tbs1]/@style:page-layout-name"/>
- <xsl:for-each select="/office:document/office:automatic-styles/style:page-layout[@style:name=$tbs2]">
- <xsl:call-template name="style:page-layout"/>
- </xsl:for-each>
- </xsl:if>
- </xsl:if>
- <xsl:call-template name="exec_table"/>
- </xsl:when>
- <xsl:when test="name()='text:table-of-content'">
- <xsl:call-template name="text:table-of-content"/>
- </xsl:when>
- <xsl:when test="name()='text:alphabetical-index'">
- <xsl:call-template name="text:alphabetical-index"/>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="jiaozhu">
- <字:脚注 uof:locID="t0107" uof:attrList="引文体">
- <xsl:for-each select="text:note-citation">
- <xsl:attribute name="字:引文体"><xsl:value-of select="."/></xsl:attribute>
- </xsl:for-each>
- <xsl:for-each select="text:note-body/text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:for-each>
- </字:脚注>
- </xsl:template>
- <xsl:template name="weizhu">
- <字:尾注 uof:locID="t0108" uof:attrList="引文体">
- <xsl:for-each select="text:note-citation">
- <xsl:attribute name="字:引文体"><xsl:value-of select="."/></xsl:attribute>
- </xsl:for-each>
- <xsl:for-each select="text:note-body/text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:for-each>
- </字:尾注>
- </xsl:template>
- <xsl:template name="unordered-ordered-list">
- <xsl:param name="currlistlvl"/>
- <xsl:param name="liststylename"/>
- <xsl:for-each select="text:list-item">
- <xsl:if test="text:p">
- <xsl:for-each select="text:p">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="$currlistlvl"/>
- <xsl:with-param name="liststylename" select="$liststylename"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:for-each select="node( )">
- <xsl:if test="name()='text:list'">
- <xsl:call-template name="unordered-ordered-list">
- <xsl:with-param name="currlistlvl" select="$currlistlvl +1"/>
- <xsl:with-param name="liststylename" select="$liststylename"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="execParagraph">
- <xsl:param name="currlistlvl"/>
- <xsl:param name="liststylename"/>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <xsl:element name="字:段落属性">
- <xsl:attribute name="uof:locID">t0052</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:if test="@text:style-name">
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="not(number($currlistlvl) =number('0'))">
- <xsl:variable name="parent-position">
- <xsl:number from="/office:document/office:body/office:text/text:list" level="any" count="text:list-item/text:p" format="1"/>
- </xsl:variable>
- <xsl:element name="字:自动编号信息">
- <xsl:attribute name="uof:locID">t0059</xsl:attribute>
- <xsl:attribute name="uof:attrList">编号引用 编号级别 重新编号 起始编号</xsl:attribute>
- <xsl:attribute name="字:编号引用"><xsl:value-of select="$liststylename"/></xsl:attribute>
- <xsl:attribute name="字:编号级别"><xsl:value-of select="$currlistlvl - 1"/></xsl:attribute>
- <xsl:attribute name="字:重新编号"><xsl:choose><xsl:when test="number($parent-position)=number('1')">1</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="字:起始编号"><xsl:for-each select="/office:document//text:list-style[$liststylename=@style:name]/*[number($currlistlvl)=number(@text:level)]"><xsl:choose><xsl:when test="@text:start-value"><xsl:value-of select="@text:start-value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:for-each></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:variable name="stylename">
- <xsl:value-of select="@text:style-name"/>
- </xsl:variable>
- <xsl:for-each select="/office:document//style:style">
- <xsl:if test="@style:name=$stylename">
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="$stylename"/></xsl:attribute>
- <xsl:call-template name="字:句属性"/>
- </xsl:element>
- <xsl:call-template name="ParaAttribute">
- <xsl:with-param name="text-style-name" select="@style:name"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- <xsl:call-template name="textp"/>
- <xsl:if test="parent::office:text and not(preceding-sibling::text:p) and preceding-sibling::*[substring-before(name(),':')='draw']">
- <xsl:for-each select="preceding-sibling::*[substring-before(name(),':')='draw']">
- <字:句 uof:locID="t0085">
- <xsl:call-template name="字:锚点"/>
- </字:句>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="draw:frame/draw:text-box/text:p">
- <xsl:for-each select="draw:frame/draw:text-box/text:p">
- <xsl:for-each select="child::*[substring-before(name(),':')='draw']">
- <字:句 uof:locID="t0085">
- <xsl:call-template name="字:锚点"/>
- </字:句>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:if>
- <xsl:variable name="aa">
- <xsl:value-of select="@text:style-name"/>
- </xsl:variable>
- <xsl:if test="//office:document/office:automatic-styles/style:style[@style:name=$aa]/style:paragraph-properties/@fo:break-before='column'">
- <字:句 uof:locID="t0085">
- <xsl:element name="字:分栏符">
- <xsl:attribute name="uof:locID">t0125</xsl:attribute>
- </xsl:element>
- </字:句>
- </xsl:if>
- <xsl:if test="//office:document/office:automatic-styles/style:style[@style:name=$aa]/style:paragraph-properties/@fo:break-before='page'">
- <字:句 uof:locID="t0085">
- <xsl:element name="字:分页符">
- <xsl:attribute name="uof:locID">t0127</xsl:attribute>
- </xsl:element>
- </字:句>
- </xsl:if>
- <xsl:if test="/office:document/office:body/office:text/text:p/text:initial-creator">
- <xsl:apply-templates select="text:initial-creator"/>
- </xsl:if>
- <xsl:if test="/office:document/office:body/office:text/text:p/text:title">
- <xsl:apply-templates select="text:title"/>
- </xsl:if>
- <xsl:if test="/office:document/office:body/office:text/text:p/text:subject">
- <xsl:apply-templates select="text:subject"/>
- </xsl:if>
- <xsl:if test="/office:document/office:body/office:text/text:p/text:file-name">
- <xsl:apply-templates select="text:file-name"/>
- </xsl:if>
- <xsl:if test="/office:document/office:body/office:text/text:p/text:author-name">
- <xsl:apply-templates select="text:author-name"/>
- </xsl:if>
- <xsl:if test="/office:document/office:body/office:text/text:p/text:author-initials">
- <xsl:apply-templates select="text:author-initials"/>
- </xsl:if>
- <xsl:if test="/office:document/office:body/office:text/text:p/text:span/text:date">
- <xsl:apply-templates select="text:date"/>
- </xsl:if>
- </字:段落>
- </xsl:template>
- <xsl:template name="ParaAttribute">
- <xsl:param name="text-style-name"/>
- <xsl:if test="substring-after(@style:display-name,'Heading')">
- <xsl:element name="字:大纲级别">
- <xsl:attribute name="uof:locID">t0054</xsl:attribute>
- <xsl:value-of select="substring-after(@style:display-name,'Heading ')"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@fo:text-align or style:paragraph-properties/@style:vertical-align">
- <xsl:element name="字:对齐">
- <xsl:attribute name="uof:locID">t0055</xsl:attribute>
- <xsl:attribute name="uof:attrList">水平对齐 文字对齐</xsl:attribute>
- <xsl:attribute name="字:水平对齐"><xsl:choose><xsl:when test="style:paragraph-properties/@fo:text-align='end'">right</xsl:when><xsl:when test="style:paragraph-properties/@fo:text-align='center'">center</xsl:when><xsl:when test="style:paragraph-properties/@fo:text-align='justify' and not(style:paragraph-properties/@fo:text-align-last='justify')">justified</xsl:when><xsl:when test="style:paragraph-properties/@fo:text-align='justify' and style:paragraph-properties/@fo:text-align-last='justify'">distributed</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="字:文字对齐"><xsl:choose><xsl:when test="style:paragraph-properties/@style:vertical-align='baseline'">base</xsl:when><xsl:when test="style:paragraph-properties/@style:vertical-align='top'">top</xsl:when><xsl:when test="style:paragraph-properties/@style:vertical-align='middle'">center</xsl:when><xsl:when test="style:paragraph-properties/@style:vertical-align='bottom'">bottom</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@fo:margin-left or style:paragraph-properties/@fo:margin-right or style:paragraph-properties/@fo:text-indent">
- <xsl:element name="字:缩进">
- <xsl:attribute name="uof:locID">t0056</xsl:attribute>
- <xsl:for-each select="style:paragraph-properties">
- <xsl:call-template name="字:缩进类型"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:行距">
- <xsl:attribute name="uof:locID">t0057</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 值</xsl:attribute>
- <xsl:choose>
- <xsl:when test="contains(style:paragraph-properties/@fo:line-height,$ooUnit)">
- <xsl:attribute name="字:类型">fixed</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:line-height,$ooUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="contains(style:paragraph-properties/@fo:line-height,'%')">
- <xsl:attribute name="字:类型">multi-lines</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:line-height,'%') div 100"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="style:paragraph-properties/@style:line-height-at-least">
- <xsl:attribute name="字:类型">at-least</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@style:line-height-at-least,$ooUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="style:paragraph-properties/@style:line-spacing">
- <xsl:attribute name="字:类型">line-space</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@style:line-spacing,$ooUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:类型">multi-lines</xsl:attribute>
- <xsl:attribute name="字:值">1.0</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="style:paragraph-properties/@fo:widows">
- <xsl:element name="字:孤行控制">
- <xsl:attribute name="uof:locID">t0060</xsl:attribute>
- <xsl:value-of select="style:paragraph-properties/@fo:widows"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@fo:orphans">
- <xsl:element name="字:寡行控制">
- <xsl:attribute name="uof:locID">t0061</xsl:attribute>
- <xsl:value-of select="style:paragraph-properties/@fo:orphans"/>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:段中不分页">
- <xsl:attribute name="uof:locID">t0062</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@fo:keep-together='always'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:if test="style:paragraph-properties/@fo:keep-with-next">
- <xsl:element name="字:与下段同页">
- <xsl:attribute name="uof:locID">t0063</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@fo:break-before">
- <xsl:element name="字:段前分页">
- <xsl:attribute name="uof:locID">t0064</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@style:snap-to-layout-grid">
- <xsl:element name="字:对齐网格">
- <xsl:attribute name="uof:locID">t0069</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:snap-to-layout-grid='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/style:drop-cap/@style:lines">
- <xsl:element name="字:首字下沉">
- <xsl:attribute name="uof:locID">t0070</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 字体引用 字符数 行数 间距</xsl:attribute>
- <xsl:attribute name="字:类型">dropped</xsl:attribute>
- <xsl:if test="style:paragraph-properties/style:drop-cap/@style:style-name">
- <xsl:attribute name="字:字体引用"><xsl:value-of select="translate(style:paragraph-properties/style:drop-cap/@style:style-name,' ','_')"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="字:间距"><xsl:choose><xsl:when test="style:paragraph-properties/style:drop-cap/@style:distance"><xsl:value-of select="substring-before(style:paragraph-properties/style:drop-cap/@style:distance,$ooUnit)"/></xsl:when><xsl:otherwise>0.00</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="style:paragraph-properties/style:drop-cap/@style:length">
- <xsl:attribute name="字:字符数"><xsl:value-of select="style:paragraph-properties/style:drop-cap/@style:length"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/style:drop-cap/@style:lines">
- <xsl:attribute name="字:行数"><xsl:value-of select="style:paragraph-properties/style:drop-cap/@style:lines"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:取消断字">
- <xsl:attribute name="uof:locID">t0071</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@fo:hyphenate"><xsl:value-of select="style:paragraph-properties/@fo:hyphenate"/></xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:element name="字:取消行号">
- <xsl:attribute name="uof:locID">t0072</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:variable name="aa">
- <xsl:value-of select="style:paragraph-properties/@text:number-lines"/>
- </xsl:variable>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="$aa='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- <xsl:element name="字:允许单词断字">
- <xsl:attribute name="字:值">true</xsl:attribute>
- <xsl:attribute name="uof:locID">t0073</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- <xsl:if test="style:paragraph-properties/@style:punctuation-wrap">
- <xsl:element name="字:行首尾标点控制">
- <xsl:attribute name="uof:locID">t0074</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:punctuation-wrap='hanging'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:是否行首标点压缩">
- <xsl:attribute name="uof:locID">t0075</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">false</xsl:attribute>
- </xsl:element>
- <xsl:if test="style:paragraph-properties/@style:line-break ">
- <xsl:element name="字:中文习惯首尾字符">
- <xsl:attribute name="uof:locID">t0076</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:line-break='strict'">true</xsl:when><xsl:when test="style:paragraph-properties/@style:line-break='normal'">false</xsl:when></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@style:text-autospace">
- <xsl:element name="字:自动调整中英文字符间距">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:text-autospace='ideograph-alpha'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:locID">t0077</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@style:text-autospace">
- <xsl:element name="字:自动调整中文与数字间距">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:text-autospace='ideograph-alpha'">true </xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:locID">t0078</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:有网格自动调整右缩进">
- <xsl:attribute name="字:值">false</xsl:attribute>
- <xsl:attribute name="uof:locID">t0195</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- <xsl:if test="style:paragraph-properties/@fo:border or style:paragraph-properties/@fo:border-top or style:paragraph-properties/@fo:border-bottom or style:paragraph-properties/@fo:border-left or style:paragraph-properties/@fo:border-right or style:paragraph-properties/@style:shadow[.!='none']">
- <xsl:element name="字:边框">
- <xsl:attribute name="uof:locID">t0065</xsl:attribute>
- <xsl:for-each select="style:paragraph-properties">
- <xsl:call-template name="uof:边框"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@fo:background-color">
- <xsl:element name="字:填充">
- <xsl:attribute name="uof:locID">t0066</xsl:attribute>
- <xsl:for-each select="style:paragraph-properties">
- <xsl:call-template name="图:填充"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@fo:margin-top or style:paragraph-properties/@fo:margin-bottom">
- <字:段间距 uof:locID="t0058">
- <xsl:if test="style:paragraph-properties/@fo:margin-top">
- <字:段前距 uof:locID="t0196">
- <字:绝对值 uof:locID="t0199" uof:attrList="值">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
- </字:绝对值>
- </字:段前距>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/@fo:margin-bottom">
- <字:段后距 uof:locID="t0197">
- <字:绝对值 uof:locID="t0202" uof:attrList="值">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
- </字:绝对值>
- </字:段后距>
- </xsl:if>
- </字:段间距>
- </xsl:if>
- <xsl:if test="style:paragraph-properties/style:tab-stops">
- <xsl:element name="字:制表位设置">
- <xsl:attribute name="uof:locID">t0067</xsl:attribute>
- <xsl:for-each select="style:paragraph-properties/style:tab-stops/style:tab-stop">
- <xsl:element name="字:制表位">
- <xsl:attribute name="uof:locID">t0068</xsl:attribute>
- <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
- <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(@style:position,$ooUnit)"/></xsl:attribute>
- <xsl:variable name="aa">
- <xsl:value-of select="@style:type"/>
- </xsl:variable>
- <xsl:variable name="zbflx">
- <xsl:choose>
- <xsl:when test="$aa='right'">right</xsl:when>
- <xsl:when test="$aa='center'">center</xsl:when>
- <xsl:when test="$aa='char'and @style:char!=''">decimal</xsl:when>
- <xsl:otherwise>left</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="字:类型"><xsl:value-of select="$zbflx"/></xsl:attribute>
- <xsl:attribute name="字:制表位字符"><xsl:value-of select="@style:leader-text"/></xsl:attribute>
- <xsl:if test="@style:leader-style">
- <xsl:attribute name="字:前导符"><xsl:value-of select="@style:leader-style"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template match="text:s">
- <xsl:param name="bText"/>
- <xsl:choose>
- <xsl:when test="$bText='0'">
- <xsl:variable name="count">
- <xsl:choose>
- <xsl:when test="not(@text:c)">1</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@text:c"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <字:句 uof:locID="t0085">
- <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{$count}"/>
- </字:句>
- </xsl:when>
- <xsl:otherwise>
- <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{@text:c}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="textp" match="text:p">
- <xsl:variable name="parentstyle">
- <xsl:value-of select="@text:style-name"/>
- </xsl:variable>
- <xsl:for-each select="node( )">
- <xsl:choose>
- <xsl:when test="self::node()[name(.)='text:span']">
- <xsl:call-template name="textspan"/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:sequence']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()/draw:text-box/text:p/text:sequence">
- <xsl:for-each select="draw:text-box/text:p/node()">
- <xsl:choose>
- <xsl:when test="self::node()[name(.)='text:sequence']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="not(self::node()[substring-before(name(.),':')='draw'])">
- <xsl:call-template name="字:句">
- <xsl:with-param name="parentstyle" select="$parentstyle"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:date']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:time']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:s']">
- <xsl:apply-templates select=".">
- <xsl:with-param name="bText" select="0"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:file-name']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:chapter']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:editing-duration']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:creation-time']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:creation-date']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:character-count']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:page-count']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:page-number']">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="substring-before(name(.),':')='draw' and not(name(.)='draw:a')">
- <字:句 uof:locID="t0085">
- <xsl:call-template name="字:锚点"/>
- </字:句>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:note']/@text:note-class='footnote'">
- <字:句 uof:locID="t0085">
- <xsl:call-template name="jiaozhu"/>
- </字:句>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:note']/@text:note-class='endnote'">
- <字:句 uof:locID="t0085">
- <xsl:call-template name="weizhu"/>
- </字:句>
- </xsl:when>
- <xsl:when test="name(.)='text:alphabetical-index-mark-start'">
- <xsl:element name="字:句">
- <xsl:element name="字:区域开始">
- <xsl:attribute name="uof:locId">t0121</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
- <xsl:attribute name="字:类型">user-data</xsl:attribute>
- <xsl:attribute name="字:名称"><xsl:value-of select="@text:string-value-phonetic"/></xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:when test="name(.)='text:alphabetical-index-mark-end'">
- <xsl:element name="字:句">
- <xsl:element name="字:区域结束" uof:locID="t0122" uof:attrList="标识符引用">
- <xsl:attribute name="字:标识符引用"><xsl:value-of select="@text:id"/></xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:when test="name(.)='text:bookmark' ">
- <字:句 uof:locID="t0085">
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- </xsl:element>
- <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型" 字:名称="{@text:name}" 字:类型="bookmark" 字:标识符="{generate-id()}"/>
- <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用" 字:标识符引用="{generate-id()}"/>
- </字:句>
- </xsl:when>
- <xsl:when test="name(.)='text:a'">
- <字:句 uof:locID="t0085">
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:区域开始">
- <xsl:attribute name="字:标识符">hlnk<xsl:number from="/office:document/office:body/office:text" level="any" count="text:a"/></xsl:attribute>
- <xsl:attribute name="字:名称">Hyperlink</xsl:attribute>
- <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
- <xsl:attribute name="uof:locID">t0121</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:文本串">
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="."/>
- </xsl:element>
- <xsl:element name="字:区域结束">
- <xsl:attribute name="字:标识符引用">hlnk<xsl:number from="/office:document/office:body/office:text" level="any" count="text:a"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0122</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
- </xsl:element>
- </字:句>
- </xsl:when>
- <xsl:when test="name(.)='office:annotation'">
- <字:句 uof:locID="t0085">
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:区域开始">
- <xsl:attribute name="字:标识符">cmt<xsl:number from="/office:document/office:body/office:text" level="any" count="office:annotation"/></xsl:attribute>
- <xsl:attribute name="字:名称">Comment</xsl:attribute>
- <xsl:attribute name="字:类型">annotation</xsl:attribute>
- <xsl:attribute name="uof:locID">t0121</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:区域结束">
- <xsl:attribute name="字:标识符引用">cmt<xsl:number from="/office:document/office:body/office:text" level="any" count="office:annotation"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0122</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
- </xsl:element>
- </字:句>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:change-start'] or self::node()[name(.)='text:change'] or self::node()[name(.)='text:change-end']">
- <xsl:call-template name="xiuding"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="字:句">
- <xsl:with-param name="parentstyle" select="$parentstyle"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="xiuding">
- <xsl:choose>
- <xsl:when test="self::node()[name(.)='text:change-start']or self::node()[name(.)='text:change']">
- <xsl:variable name="changeID">
- <xsl:value-of select="@text:change-id"/>
- </xsl:variable>
- <xsl:for-each select="/office:document/office:body/office:text/text:tracked-changes/text:changed-region">
- <xsl:if test="$changeID=@text:id">
- <xsl:choose>
- <xsl:when test="text:insertion">
- <xsl:element name="字:修订开始">
- <xsl:attribute name="uof:locID">t0206</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
- <xsl:attribute name="字:类型">insert</xsl:attribute>
- <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@text:id"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:when test="text:format-change">
- <xsl:element name="字:修订开始">
- <xsl:attribute name="uof:locID">t0206</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
- <xsl:attribute name="字:类型">format</xsl:attribute>
- <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@text:id"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:when test="text:deletion">
- <xsl:element name="字:修订开始">
- <xsl:attribute name="uof:locID">t0206</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
- <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
- <xsl:attribute name="字:类型">delete</xsl:attribute>
- <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@text:id"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="self::node()[name(.)='text:change-end']">
- <xsl:variable name="changeendID">
- <xsl:value-of select="@text:change-id"/>
- </xsl:variable>
- <xsl:for-each select="/office:document/office:body/office:text/text:tracked-changes/text:changed-region">
- <xsl:if test="$changeendID=@text:id">
- <xsl:choose>
- <xsl:when test="text:insertion">
- <xsl:element name="字:修订结束">
- <xsl:attribute name="uof:locID">t0207</xsl:attribute>
- <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
- <xsl:attribute name="字:开始标识引用"><xsl:value-of select="@text:id"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:when test="text:deletion">
- <xsl:element name="字:修订结束">
- <xsl:attribute name="uof:locID">t0207</xsl:attribute>
- <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
- <xsl:attribute name="字:开始标识引用"><xsl:value-of select="@text:id"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:when test="text:format-change">
- <xsl:element name="字:修订结束">
- <xsl:attribute name="uof:locID">t0207</xsl:attribute>
- <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
- <xsl:attribute name="字:开始标识引用"><xsl:value-of select="@text:id"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="字:句">
- <xsl:param name="parentstyle"/>
- <xsl:if test="not(name(.)='text:bookmark-start' or name(.)='text:bookmark-end' or name(.)='draw:image' or name(.)='office:binary-data' or name(.)='text:page-number' or name(.)='text:page-count' or name(.)='text:initial-creator' or name(.)='text:author-name' or name(.)='text:author-initials' or name(.)='text:creation-time' or name(.)='text:creation-date' or name(.)='text:title' or name(.)='text:subject' or name(.)='text:file-name' or name(.)='text:editing-duration' or name(.)='text:character-count' or name(.)='text:chapter')">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
- <xsl:choose>
- <xsl:when test="@text:style-name">
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="parent::text:h/@text:outline-level">
- <xsl:attribute name="字:式样引用"><xsl:value-of select="concat('Heading_20_',parent::text:h/@text:outline-level)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="parent::node()/@text:style-name">
- <xsl:attribute name="字:式样引用"><xsl:value-of select="parent::node( )/@text:style-name"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </字:句属性>
- <xsl:if test="ancestor::text:note-body">
- <字:引文符号>
- <xsl:value-of select="ancestor::text:note/text:note-citation"/>
- </字:引文符号>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="(preceding-sibling::text:bookmark-start) and (following-sibling::text:bookmark-end)">
- <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
- <xsl:attribute name="字:标识符"><xsl:value-of select="preceding-sibling::text:bookmark-start/@text:name"/></xsl:attribute>
- <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
- <xsl:attribute name="字:类型">bookmark</xsl:attribute>
- </字:区域开始>
- <xsl:element name="字:文本串">
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="string(.)"/>
- </xsl:element>
- <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
- <xsl:attribute name="字:标识符引用"><xsl:value-of select="following-sibling::text:bookmark-end/@text:name"/></xsl:attribute>
- </字:区域结束>
- </xsl:when>
- <xsl:when test="name(.)='draw:a'">
- <xsl:variable name="link-name">
- <xsl:value-of select="substring-after(@xlink:href,'#')"/>
- </xsl:variable>
- <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
- <xsl:attribute name="字:标识符"><xsl:value-of select="$link-name"/></xsl:attribute>
- <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
- <xsl:attribute name="字:类型">bookmark</xsl:attribute>
- </字:区域开始>
- <xsl:call-template name="字:锚点"/>
- <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
- <xsl:attribute name="字:标识符引用"><xsl:value-of select="$link-name"/></xsl:attribute>
- </字:区域结束>
- </xsl:when>
- <xsl:when test="self::node( )[name(.)='text:tab']">
- <xsl:element name="字:制表符">
- <xsl:attribute name="uof:locID">t0123</xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:when test="self::node( )[name(.)='text:line-break']">
- <xsl:element name="字:换行符">
- <xsl:attribute name="uof:locID">t0124</xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:when test="name(.)='text:bookmark-start' or name(.)='text:bookmark-end' or name(.)='draw:image' or name(.)='office:binary-data'">
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="字:文本串">
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="string(.)"/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </字:句>
- </xsl:if>
- </xsl:template>
- <xsl:template match="draw:text-box">
- <xsl:apply-templates/>
- </xsl:template>
- <xsl:template name="text">
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="parent::node( )/@text:style-name"/></xsl:attribute>
- </xsl:element>
- <xsl:element name="字:文本串">
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="string(.)"/>
- </xsl:element>
- </xsl:template>
- <xsl:template name="textspan">
- <字:句 uof:locID="t0085">
- <xsl:choose>
- <xsl:when test="./text:note/@text:note-class='footnote'">
- <xsl:for-each select="text:note">
- <xsl:call-template name="jiaozhu"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="./text:note/@text:note-class='endnote'">
- <xsl:for-each select="text:note">
- <xsl:call-template name="weizhu"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="字:句属性">
- <xsl:attribute name="uof:locID">t0086</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:variable name="textstyle">
- <xsl:value-of select="@text:style-name"/>
- </xsl:variable>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- <xsl:for-each select="/office:document/office:automatic-styles//style:style[@style:family='text']">
- <xsl:if test="@style:name=$textstyle and not(@style:parent-style-name='Standard')">
- <xsl:if test="@style:parent-style-name=/office:document/office:styles/style:style/@style:name">
- <xsl:call-template name="SentenceXD">
- <xsl:with-param name="Sentencestyle" select="@style:parent-style-name"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="/office:document/office:automatic-styles//style:style[@style:family='text']">
- <xsl:if test="@style:name=$textstyle">
- <xsl:call-template name="SentenceXD">
- <xsl:with-param name="Sentencestyle" select="@style:name"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- <xsl:element name="字:文本串">
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="string(.)"/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </字:句>
- </xsl:template>
- <xsl:template name="SentenceXD">
- <xsl:param name="Sentencestyle"/>
- </xsl:template>
- <xsl:template name="字:锚点">
- <xsl:if test="not(name(.)='draw:glue-point')">
- <xsl:variable name="name">
- <xsl:value-of select="name(.)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="name='draw:a'">
- <xsl:for-each select="child::node( )">
- <xsl:call-template name="字:锚点"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$name = 'draw:g'">
- <xsl:for-each select="child::*">
- <xsl:call-template name="字:锚点"/>
- </xsl:for-each>
- </xsl:if>
- <字:锚点 uof:locID="t0110" uof:attrList="标识符 类型">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='as-char'">
- <xsl:attribute name="字:类型">inline</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:类型">normal</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <字:锚点属性 uof:locID="t0111">
- <字:宽度 uof:locID="t0112">
- <xsl:choose>
- <xsl:when test="@svg:width">
- <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
- </xsl:when>
- <xsl:when test="@svg:x1">
- <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
- </xsl:when>
- </xsl:choose>
- </字:宽度>
- <字:高度 uof:locID="t0113">
- <xsl:choose>
- <xsl:when test="@svg:height">
- <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
- </xsl:when>
- <xsl:when test="@svg:x1">
- <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
- </xsl:when>
- <xsl:when test="child::draw:text-box/@fo:min-height">
- <xsl:value-of select="substring-before(child::draw:text-box/@fo:min-height,$uofUnit)"/>
- </xsl:when>
- </xsl:choose>
- </字:高度>
- <xsl:if test="not(@text:anchor-type='as-char')">
- <字:位置 uof:locID="t0114">
- <字:水平 uof:locID="t0176" uof:attrList="相对于">
- <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
- <xsl:attribute name="字:相对于"><xsl:choose><xsl:when test="@style:horizontal-rel='page'">page</xsl:when><xsl:when test="@style:horizontal-rel='paragraph'">margin</xsl:when><xsl:when test="@style:horizontal-rel='page-content'">margin</xsl:when><xsl:when test="@style:horizontal-rel='paragraph-content'">margin</xsl:when><xsl:when test="@style:horizontal-rel='char'">char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="@svg:x or @svg:x1">
- <字:绝对 uof:locID="t0177" uof:attrList="值">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@svg:x"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x1,$uofUnit)"/></xsl:when></xsl:choose></xsl:attribute>
- </字:绝对>
- </xsl:when>
- <xsl:otherwise>
- <字:相对 uof:locID="t0178" uof:attrList="参考点 值">
- <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:horizontal-pos='left'">left</xsl:when><xsl:when test="@style:horizontal-pos='right'">right</xsl:when><xsl:when test="@style:horizontal-pos='center'">center</xsl:when></xsl:choose></xsl:attribute>
- </xsl:for-each>
- </字:相对>
- </xsl:otherwise>
- </xsl:choose>
- </字:水平>
- <字:垂直 uof:locID="t0179" uof:attrList="相对于">
- <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
- <xsl:attribute name="字:相对于"><xsl:choose><xsl:when test="@style:vertical-rel='page'">page</xsl:when><xsl:when test="@style:vertical-rel='paragraph'">paragraph</xsl:when><xsl:when test="@style:vertical-rel='page-content'">margin</xsl:when><xsl:when test="@style:vertical-rel='paragraph-content'">margin</xsl:when><xsl:when test="@style:vertical-rel='line'">line</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="@svg:y or @svg:y1">
- <字:绝对 uof:locID="t0180" uof:attrList="值">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@svg:y"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:when><xsl:when test="@svg:y1"><xsl:value-of select="substring-before(@svg:y1,$uofUnit)"/></xsl:when></xsl:choose></xsl:attribute>
- </字:绝对>
- </xsl:when>
- <xsl:otherwise>
- <字:相对 uof:locID="t0181" uof:attrList="参考点 值">
- <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:vertical-pos='bottom'">bottom</xsl:when><xsl:when test="@style:vertical-pos='top'">top</xsl:when><xsl:when test="@style:vertical-pos='middle'">center</xsl:when><xsl:when test="@style:vertical-pos='below'">inside</xsl:when></xsl:choose></xsl:attribute>
- </xsl:for-each>
- </字:相对>
- </xsl:otherwise>
- </xsl:choose>
- </字:垂直>
- </字:位置>
- </xsl:if>
- <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
- <字:绕排 uof:locID="t0115" uof:attrList="绕排方式 环绕文字 绕排顶点">
- <xsl:variable name="wrap_type1">
- <xsl:value-of select="@style:wrap"/>
- </xsl:variable>
- <xsl:variable name="wrap_type2">
- <xsl:value-of select="@style:run-through"/>
- </xsl:variable>
- <xsl:variable name="a">
- <xsl:value-of select="@style:number-wrapped-paragraphs"/>
- </xsl:variable>
- <xsl:if test="$wrap_type1">
- <xsl:attribute name="字:绕排方式"><xsl:choose><xsl:when test="$wrap_type1='run-through' and $wrap_type2='background' ">behindtext</xsl:when><xsl:when test="$wrap_type1='run-through' and $a='1'">infrontoftext</xsl:when><xsl:when test="$wrap_type1='run-through'">through</xsl:when><xsl:when test="$wrap_type1='dynamic' ">top-bottom</xsl:when><xsl:when test="$wrap_type1='parallel' ">square</xsl:when><xsl:when test="$wrap_type1='left' or $wrap_type1='right'">tight</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="$wrap_type1='left' or $wrap_type1='right'">
- <xsl:attribute name="字:环绕文字"><xsl:choose><xsl:when test="$wrap_type1='left'">left</xsl:when><xsl:when test="$wrap_type1='right'">right</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- </字:绕排>
- <字:边距 uof:locID="t0116" uof:attrList="上 左 右 下">
- <xsl:choose>
- <xsl:when test="@fo:margin-top">
- <xsl:attribute name="字:上"><xsl:value-of select="substring-before(@fo:margin-top,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="字:下"><xsl:value-of select="substring-before(@fo:margin-bottom,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:上">0.0</xsl:attribute>
- <xsl:attribute name="字:下">0.0</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@fo:margin-right">
- <xsl:attribute name="字:右"><xsl:value-of select="substring-before(@fo:margin-right,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="字:左"><xsl:value-of select="substring-before(@fo:margin-left,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:右">0.0</xsl:attribute>
- <xsl:attribute name="字:左">0.0</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </字:边距>
- <字:锁定 uof:attrList="值" uof:locID="t0117">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@draw:move-protect='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- </字:锁定>
- <字:保护 uof:locID="t0118" uof:attrList="值">
- <xsl:choose>
- <xsl:when test="$name='draw:image' or $name='draw:text-box'">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:protect = 'content size position' or @style:protect = 'content' or @style:protect = 'content size' or @style:protect = 'size position' or @style:protect = 'size' or @style:protect = 'position' or @style:protect = 'content position' and @draw:size-protect= 'true'and @draw:move-protect= 'true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:protect = 'position size'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </字:保护>
- </xsl:for-each>
- <字:允许重叠 uof:locID="t0119" uof:attrList="值" 字:值="true"/>
- </字:锚点属性>
- <字:图形 uof:locID="t0120" uof:attrList="图形引用">
- <xsl:variable name="refpicname">
- <xsl:if test="@draw:style-name">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="picnumber">
- <xsl:if test="@draw:style-name">
- <xsl:value-of select="count(preceding::*[@draw:style-name=$refpicname])"/>
- </xsl:if>
- </xsl:variable>
- <xsl:attribute name="字:图形引用"><xsl:value-of select="concat($refpicname,'_',$picnumber)"/></xsl:attribute>
- </字:图形>
- </字:锚点>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template name="liekuan">
- <xsl:param name="count"/>
- <xsl:param name="width"/>
- <xsl:if test="$count &gt; 0">
- <字:列宽 uof:locID="t0132">
- <xsl:value-of select="$width"/>
- </字:列宽>
- <xsl:call-template name="liekuan">
- <xsl:with-param name="count" select="$count -1"/>
- <xsl:with-param name="width" select="$width"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="exec_table" match="table:table">
- <xsl:param name="tabletype"/>
- <字:文字表 uof:locID="t0128" uof:attrList="类型">
- <xsl:choose>
- <xsl:when test="@table:is-sub-table='true'">
- <xsl:attribute name="字:类型">sub-table</xsl:attribute>
- <xsl:element name="字:文字表属性">
- <xsl:attribute name="uof:locID">t0129</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:element name="字:列宽集">
- <xsl:attribute name="uof:locID">t0131</xsl:attribute>
- <xsl:for-each select="table:table-column">
- <xsl:variable name="tableColName" select="@table:style-name"/>
- <xsl:variable name="colWidth" select="substring-before(//style:style[@style:name=$tableColName and @style:family='table-column']/style:table-column-properties/@style:column-width,$ooUnit)"/>
- <xsl:choose>
- <xsl:when test="@table:number-columns-repeated">
- <xsl:call-template name="liekuan">
- <xsl:with-param name="count" select="@table:number-columns-repeated"/>
- <xsl:with-param name="width" select="$colWidth"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <字:列宽 uof:locID="t0132">
- <xsl:value-of select="$colWidth"/>
- </字:列宽>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:类型">table</xsl:attribute>
- <xsl:element name="字:文字表属性">
- <xsl:attribute name="uof:locID">t0129</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@table:style-name"/></xsl:attribute>
- <xsl:variable name="tableName" select="@table:style-name"/>
- <xsl:element name="字:列宽集">
- <xsl:attribute name="uof:locID">t0131</xsl:attribute>
- <xsl:for-each select="table:table-column">
- <xsl:variable name="tableColName" select="@table:style-name"/>
- <xsl:variable name="colWidth" select="substring-before(//style:style[@style:name=$tableColName and @style:family='table-column']/style:table-column-properties/@style:column-width,$ooUnit)"/>
- <xsl:choose>
- <xsl:when test="@table:number-columns-repeated">
- <xsl:call-template name="liekuan">
- <xsl:with-param name="count" select="@table:number-columns-repeated"/>
- <xsl:with-param name="width" select="$colWidth"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <字:列宽 uof:locID="t0132">
- <xsl:value-of select="$colWidth"/>
- </字:列宽>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:element>
- <xsl:for-each select="key('set_styleStyle',$tableName)">
- <xsl:element name="字:宽度">
- <xsl:attribute name="uof:locID">t0130</xsl:attribute>
- <xsl:attribute name="uof:attrList">绝对宽度 相对宽度</xsl:attribute>
- <xsl:attribute name="字:绝对宽度"><xsl:value-of select="substring-before(style:table-properties/@style:width,$ooUnit)"/></xsl:attribute>
- <xsl:if test="style:table-properties/@style:rel-width">
- <xsl:attribute name="字:相对宽度"><xsl:value-of select="substring-before(style:table-properties/@style:rel-width,'%') div 100"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:element name="字:对齐">
- <xsl:attribute name="uof:locID">t0133</xsl:attribute>
- <xsl:choose>
- <xsl:when test="style:table-properties/@table:align='right'">right</xsl:when>
- <xsl:when test="style:table-properties/@table:align='center'">center</xsl:when>
- <xsl:otherwise>left</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="style:table-properties/@fo:margin-left">
- <xsl:element name="字:左缩进">
- <xsl:attribute name="uof:locID">t0134</xsl:attribute>
- <xsl:value-of select="substring-before(style:table-properties/@fo:margin-left,$ooUnit)"/>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:绕排">
- <xsl:attribute name="uof:locID">t0135</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">around</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:边框">
- <xsl:attribute name="uof:locID">t0137</xsl:attribute>
- <xsl:for-each select="style:table-properties">
- <xsl:call-template name="uof:边框"/>
- </xsl:for-each>
- </xsl:element>
- <xsl:if test="style:table-properties/style:background-image/office:binary-data or style:table-properties/@fo:background-color or style:page-layout-properties/@fo:background-color">
- <字:填充 uof:locID="t0138">
- <xsl:for-each select="style:table-properties">
- <xsl:call-template name="图:填充">
- <xsl:with-param name="style-name" select="$tableName"/>
- </xsl:call-template>
- </xsl:for-each>
- </字:填充>
- </xsl:if>
- <xsl:element name="字:绕排边距">
- <xsl:attribute name="uof:locID">t0139</xsl:attribute>
- <xsl:attribute name="uof:attrList">上 左 右 下</xsl:attribute>
- <xsl:if test="style:table-properties/@fo:margin-top">
- <xsl:attribute name="字:上"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:table-properties/@fo:margin-left">
- <xsl:attribute name="字:左"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-left,$ooUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:table-properties/@fo:margin-right">
- <xsl:attribute name="字:右"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-right,$ooUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:table-properties/@fo:margin-bottom">
- <xsl:attribute name="字:下"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:element name="字:自动调整大小">
- <xsl:attribute name="字:值">true</xsl:attribute>
- <xsl:attribute name="uof:locID">t0140</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:默认单元格边距">
- <xsl:attribute name="uof:locID">t0141</xsl:attribute>
- <xsl:attribute name="uof:attrList">上 左 右 下</xsl:attribute>
- <xsl:attribute name="字:上">0.10</xsl:attribute>
- <xsl:attribute name="字:左">0.10</xsl:attribute>
- <xsl:attribute name="字:右">0.10</xsl:attribute>
- <xsl:attribute name="字:下">0.10</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:默认单元格间距">
- <xsl:attribute name="uof:locID">t0142</xsl:attribute>
- <xsl:value-of select="'0.00'"/>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="table:table-header-rows/table:table-row"/>
- <xsl:apply-templates select="table:table-row"/>
- </字:文字表>
- </xsl:template>
- <xsl:key name="set_colWidth" match="//office:automatic-styles/style:style[@style:family='table-column']" use="@style:name"/>
- <xsl:key name="set_styleStyle" match="//office:automatic-styles/style:style" use="@style:name"/>
- <xsl:template match="table:table-row">
- <xsl:element name="字:行">
- <xsl:attribute name="uof:locID">t0143</xsl:attribute>
- <xsl:variable name="rowStyleName" select="@table:style-name|table:table-row/@table:style-name"/>
- <xsl:element name="字:表行属性">
- <xsl:attribute name="uof:locID">t0144</xsl:attribute>
- <xsl:for-each select="key('set_styleStyle',$rowStyleName)/style:table-row-properties[@style:row-height or @style:min-row-height]">
- <xsl:element name="字:高度">
- <xsl:if test="@style:row-height">
- <xsl:attribute name="字:固定值"><xsl:value-of select="substring-before(@style:row-height,$ooUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@style:min-row-height">
- <xsl:attribute name="字:最小值"><xsl:value-of select="substring-before(@style:min-row-height,$ooUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="uof:locID">t0145</xsl:attribute>
- <xsl:attribute name="uof:attrList">固定值 最小值</xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- <xsl:if test="key('set_styleStyle',$rowStyleName)/style:table-row-properties[@style:keep-together]">
- <xsl:element name="字:跨页">
- <xsl:attribute name="uof:locID">t0146</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:for-each select="key('set_styleStyle',$rowStyleName)/style:table-row-properties[@style:keep-together]">
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:keep-together='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:if test="name(..)='table:table-header-rows'">
- <xsl:element name="字:表头行">
- <xsl:attribute name="uof:locID">t0147</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- <xsl:for-each select="node()">
- <xsl:choose>
- <xsl:when test="name()='table:table-cell'">
- <xsl:element name="字:单元格">
- <xsl:attribute name="uof:locID">t0148</xsl:attribute>
- <xsl:call-template name="execTableCellAttribute"/>
- <xsl:for-each select="node( )">
- <xsl:choose>
- <xsl:when test="name()='text:p'">
- <xsl:call-template name="execParagraph">
- <xsl:with-param name="currlistlvl" select="number('0')"/>
- <xsl:with-param name="liststylename" select="string('00000')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name()='table:table' or name()='table:sub-table' or self::node()/@table:is-sub-table='true'">
- <xsl:call-template name="exec_table">
- <xsl:with-param name="tabletype" select="name()"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:for-each>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template name="execTableCellAttribute">
- <xsl:element name="字:单元格属性">
- <xsl:attribute name="uof:locID">t0149</xsl:attribute>
- <xsl:variable name="StyleName" select="@table:style-name"/>
- <xsl:element name="字:宽度">
- <xsl:attribute name="uof:locID">t0150</xsl:attribute>
- <xsl:attribute name="uof:attrList">绝对值 相对值</xsl:attribute>
- <xsl:variable name="sn">
- <xsl:number from="/office:document/office:body/office:text" level="single" count="table:table-cell" format="1"/>
- </xsl:variable>
- <xsl:variable name="sn1">
- <xsl:choose>
- <xsl:when test="../../table:table-column[number($sn)]/@table:style-name">
- <xsl:value-of select="$sn"/>
- </xsl:when>
- <xsl:when test=" name(../..)='table:table-header-rows' and ../../../table:table-column[number($sn)]/@table:style-name">
- <xsl:value-of select="$sn"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'1'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="KuanDu">
- <xsl:choose>
- <xsl:when test=" name(../..)='table:table-header-rows' and ../../../table:table-column[number($sn)]/@table:style-name">
- <xsl:value-of select="../../../table:table-column[number($sn1)]/@table:style-name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="../../table:table-column[number($sn1)]/@table:style-name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="字:绝对值"><xsl:value-of select="substring-before(key('set_colWidth',$KuanDu)/style:table-column-properties/@style:column-width,$ooUnit)"/></xsl:attribute>
- <xsl:if test="key('set_colWidth',$KuanDu)/style:table-column-properties/@style:rel-column-width">
- <xsl:attribute name="字:相对值"><xsl:value-of select="substring-before(key('set_colWidth',$KuanDu)/style:table-column-properties/@style:rel-column-width,'*')"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:if test="@table:number-columns-spanned">
- <xsl:element name="字:跨列">
- <xsl:attribute name="uof:locID">t0156</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="@table:number-columns-spanned"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:for-each select="key('set_styleStyle',$StyleName)">
- <xsl:element name="字:单元格边距">
- <xsl:attribute name="uof:locID">t0151</xsl:attribute>
- <xsl:attribute name="uof:attrList">上 左 右 下</xsl:attribute>
- <xsl:choose>
- <xsl:when test="style:table-cell-properties/@fo:padding">
- <xsl:attribute name="字:上"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="字:左"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="字:右"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="字:下"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:上"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-top,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="字:左"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-left,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="字:右"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-right,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="字:下"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-bottom,$uofUnit)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="style:table-cell-properties/@fo:border or style:table-cell-properties/@fo:border-top or style:table-cell-properties/@fo:border-bottom or style:table-cell-properties/@fo:border-left or style:table-cell-properties/@fo:border-right or style:table-cell-properties/@style:shadow">
- <xsl:element name="字:边框">
- <xsl:attribute name="uof:locID">t0152</xsl:attribute>
- <xsl:for-each select="style:table-cell-properties">
- <xsl:call-template name="uof:边框"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:table-cell-properties/style:background-image/office:binary-data or style:table-cell-properties/@fo:background-color">
- <字:填充 uof:locID="t0153">
- <xsl:for-each select="style:table-cell-properties">
- <xsl:call-template name="图:填充"/>
- </xsl:for-each>
- </字:填充>
- </xsl:if>
- <字:垂直对齐方式 uof:locID="t0154">
- <xsl:choose>
- <xsl:when test="style:table-cell-properties/@style:vertical-align='middle'">center</xsl:when>
- <xsl:when test="style:table-cell-properties/@style:vertical-align='bottom'">bottom</xsl:when>
- <xsl:otherwise>top</xsl:otherwise>
- </xsl:choose>
- </字:垂直对齐方式>
- <xsl:element name="字:自动换行">
- <xsl:attribute name="字:值">true</xsl:attribute>
- <xsl:attribute name="uof:locID">t0157</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:适应文字">
- <xsl:attribute name="字:值">true</xsl:attribute>
- <xsl:attribute name="uof:locID">t0158</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:key name="bpath" match="//office:document/office:body/office:text/text:p/text:span" use="@text:style-name"/>
- <xsl:template name="字:句属性">
- <xsl:element name="字:字体">
- <xsl:attribute name="uof:locID">t0088</xsl:attribute>
- <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
- <xsl:if test="contains(@style:parent-style-name,'Header') or contains(@style:parent-style-name,'Foot') or contains(@style:parent-style-name,'Endnote')">
- <xsl:attribute name="字:字号">9</xsl:attribute>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:font-size or style:text-properties/@style:font-size-asian or style:text-properties/@style:font-size-complex">
- <xsl:choose>
- <xsl:when test="contains(style:text-properties/@fo:font-size,'%') or contains(style:text-properties/@style:font-size-asian,'%')">
- <xsl:attribute name="字:相对字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'%')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'%')"/></xsl:when></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-complex"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-complex,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:font-name">
- <xsl:variable name="xiwen" select="style:text-properties/@style:font-name"/>
- <xsl:attribute name="字:西文字体引用"><xsl:value-of select="translate($xiwen,' ','_')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:font-name-asian">
- <xsl:attribute name="字:中文字体引用"><xsl:value-of select="style:text-properties/@style:font-name-asian"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:color">
- <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:if test="style:text-properties/@fo:background-color and not(style:text-properties/@style:text-background-color='transparent')">
- <xsl:element name="字:填充">
- <xsl:attribute name="uof:locID">t0093</xsl:attribute>
- <xsl:element name="图:图案">
- <xsl:attribute name="uof:locID">g0036</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 图形引用 前景色 背景色</xsl:attribute>
- <xsl:if test="style:text-properties/@fo:background-color">
- <xsl:attribute name="图:前景色"><xsl:choose><xsl:when test="style:text-properties/@fo:background-color='transparent'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@fo:background-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:font-weight or style:text-properties/@style:font-weight-asian">
- <xsl:element name="字:粗体">
- <xsl:attribute name="uof:locID">t0089</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@style:font-weight-asian='bold' or style:text-properties/@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:font-style or style:text-properties/@style:font-style-asian">
- <xsl:element name="字:斜体">
- <xsl:attribute name="uof:locID">t0090</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:font-style='italic' or style:text-properties/@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:background-color|style:text-properties/@style:text-background-color">
- <xsl:element name="字:突出显示">
- <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="style:text-properties/@fo:background-color='transparent' or style:text-properties/@style:text-background-color='transparent'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@fo:background-color|style:text-properties/@style:text-background-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="uof:locID">t0091</xsl:attribute>
- <xsl:attribute name="uof:attrList">颜色</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-line-through-style">
- <xsl:element name="字:删除线">
- <xsl:attribute name="uof:locID">t0094</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:删除线类型"><xsl:with-param name="lineType" select="style:text-properties/@style:text-line-through-style"/></xsl:call-template></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-underline-style">
- <xsl:element name="字:下划线">
- <xsl:attribute name="uof:locID">t0095</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 颜色 字下划线</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"/></xsl:attribute>
- <xsl:if test="style:text-properties/@style:text-underline-color">
- <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="style:text-properties/@style:text-underline-color='font-color'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@style:text-underline-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:text-shadow">
- <xsl:element name="字:阴影">
- <xsl:attribute name="uof:locID">t0100</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-emphasize">
- <xsl:element name="字:着重号">
- <xsl:attribute name="uof:locID">t0096</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 颜色 字着重号</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:call-template name="uof:着重号类型"><xsl:with-param name="te" select="style:text-properties/@style:text-emphasize"/></xsl:call-template></xsl:attribute>
- <xsl:if test="style:text-properties/@fo:color">
- <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@text:display">
- <xsl:element name="字:隐藏文字">
- <xsl:attribute name="uof:locID">t0097</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-outline">
- <xsl:element name="字:空心">
- <xsl:attribute name="uof:locID">t0098</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值"><xsl:value-of select="style:text-properties/@style:text-outline"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:font-relief">
- <xsl:element name="字:浮雕">
- <xsl:attribute name="uof:locID">t0099</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@style:font-relief='embossed'">emboss</xsl:when><xsl:when test="style:text-properties/@style:font-relief='engraved'">engrave</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:text-transform or style:text-properties/@fo:font-variant">
- <xsl:element name="字:醒目字体">
- <xsl:attribute name="uof:locID">t0101</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型</xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@fo:text-transform='uppercase'">uppercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='lowercase'">lowercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='capitalize'">capital</xsl:when><xsl:when test="style:text-properties/@fo:font-variant='small-caps'">small-caps</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-position">
- <xsl:element name="字:位置">
- <xsl:attribute name="uof:locID">t0102</xsl:attribute>
- <xsl:variable name="aa">
- <xsl:value-of select="style:text-properties/@style:text-position"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($aa,'sub')">
- <xsl:value-of select="substring-before($aa,' ')"/>
- </xsl:when>
- <xsl:when test="contains($aa,'super')">
- <xsl:value-of select="substring-before($aa,' ')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate($aa,'%','')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:text-scale">
- <xsl:element name="字:缩放">
- <xsl:attribute name="uof:locID">t0103</xsl:attribute>
- <xsl:variable name="scale" select="style:text-properties/@style:text-scale"/>
- <xsl:choose>
- <xsl:when test="contains($scale,'%')">
- <xsl:value-of select="substring-before($scale,'%')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="style:text-properties/@style:text-scale"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@fo:letter-spacing">
- <xsl:element name="字:字符间距">
- <xsl:attribute name="uof:locID">t0104</xsl:attribute>
- <xsl:value-of select="substring-before(style:text-properties/@fo:letter-spacing,$uofUnit)"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="style:text-properties/@style:letter-kerning">
- <xsl:element name="字:调整字间距">
- <xsl:variable name="tt" select="style:text-properties/@style:letter-kerning"/>
- <xsl:attribute name="uof:locID">t0105</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$tt='true'">1</xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:element name="字:字符对齐网格">
- <xsl:attribute name="字:值">false</xsl:attribute>
- <xsl:attribute name="uof:locID">t0106</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template name="uof:线型类型">
- <xsl:variable name="spath" select="style:text-properties/@style:text-underline-style"/>
- <xsl:variable name="wpath" select="style:text-properties/@style:text-underline-width"/>
- <xsl:variable name="tpath" select="style:text-properties/@style:text-underline-type"/>
- <xsl:choose>
- <xsl:when test="$spath='solid' and not($tpath='double' ) and $wpath='auto' ">single</xsl:when>
- <xsl:when test="$spath='solid' and $tpath='double' and $wpath='auto' ">double</xsl:when>
- <xsl:when test="$spath='solid' and not($tpath='double' )and $wpath='bold' ">thick</xsl:when>
- <xsl:when test="$spath='dotted' and not($tpath='double' )and $wpath='auto' ">dotted</xsl:when>
- <xsl:when test="$spath='dotted' and not($tpath='double' )and $wpath='bold' ">dotted-heavy</xsl:when>
- <xsl:when test="$spath='dash' and not($tpath='double' )and $wpath='auto' ">dash</xsl:when>
- <xsl:when test="$spath='dash' and not($tpath='double' )and $wpath='bold' ">dashed-heavy</xsl:when>
- <xsl:when test="$spath='long-dash' and not($tpath='double' )and $wpath='auto' ">dash-long</xsl:when>
- <xsl:when test="$spath='long-dash' and not($tpath='double' )and $wpath='bold' ">dash-long-heavy</xsl:when>
- <xsl:when test="$spath='dot-dash' and not($tpath='double' )and $wpath='auto' ">dot-dash</xsl:when>
- <xsl:when test="$spath='dot-dash' and not($tpath='double' )and $wpath='bold' ">dash-dot-heavy</xsl:when>
- <xsl:when test="$spath='dot-dot-dash' and not($tpath='double' )and $wpath='auto' ">dot-dot-dash</xsl:when>
- <xsl:when test="$spath='dot-dot-dash' and not($tpath='double' )and $wpath='bold' ">dash-dot-dot-heavy</xsl:when>
- <xsl:when test="$spath='wave' and not($tpath='double' )and $wpath='auto' ">wave</xsl:when>
- <xsl:when test="$spath='wave' and not($tpath='double' )and $wpath='bold' ">wavy-heavy</xsl:when>
- <xsl:when test="$spath='wave' and $tpath='double' and $wpath='auto' ">wavy-double</xsl:when>
- <xsl:otherwise>none</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="uof:删除线类型">
- <xsl:param name="lineType"/>
- <xsl:variable name="tw" select="style:text-properties/@style:text-line-through-width"/>
- <xsl:variable name="tt" select="style:text-properties/@style:text-line-through-text"/>
- <xsl:variable name="ttp" select="style:text-properties/@style:text-line-through-type"/>
- <xsl:choose>
- <xsl:when test="$lineType='solid'and $ttp='double'">double</xsl:when>
- <xsl:when test="$lineType='solid'and $tw='bold'">bold</xsl:when>
- <xsl:when test="$lineType='solid'and $tt='X'">xl</xsl:when>
- <xsl:when test="$lineType='solid'and $tt='/'">/l</xsl:when>
- <xsl:otherwise>
- <xsl:if test="not($lineType='none') ">single</xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="uof:着重号类型">
- <xsl:param name="te"/>
- <xsl:choose>
- <xsl:when test="$te='disc above' ">disc above</xsl:when>
- <xsl:when test="$te='circle above' ">circle above</xsl:when>
- <xsl:when test="$te='dot above' ">dot above</xsl:when>
- <xsl:when test="$te='accent above' ">accent above</xsl:when>
- <xsl:when test="$te='dot below' ">dot</xsl:when>
- <xsl:when test="$te='circle below' ">circle below</xsl:when>
- <xsl:when test="$te='disc below' ">disc below</xsl:when>
- <xsl:when test="$te='accent below' ">accent below</xsl:when>
- <xsl:otherwise>none</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="uof:边框">
- <xsl:choose>
- <xsl:when test="@fo:border">
- <xsl:call-template name="uof:左边框">
- <xsl:with-param name="border" select="@fo:border"/>
- </xsl:call-template>
- <xsl:call-template name="uof:上边框">
- <xsl:with-param name="border" select="@fo:border"/>
- </xsl:call-template>
- <xsl:call-template name="uof:右边框">
- <xsl:with-param name="border" select="@fo:border"/>
- </xsl:call-template>
- <xsl:call-template name="uof:下边框">
- <xsl:with-param name="border" select="@fo:border"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="@fo:border-left or contains(substring-before(substring-after(@style:shadow,' '),' '),'-')">
- <xsl:call-template name="uof:左边框">
- <xsl:with-param name="border" select="@fo:border-left"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="@fo:border-top or contains(substring-after(substring-after(@style:shadow,' '),' '),'-')">
- <xsl:call-template name="uof:上边框">
- <xsl:with-param name="border" select="@fo:border-top"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="@fo:border-right or substring-before(substring-before(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-before(substring-after(@style:shadow,' '),' '),'+')">
- <xsl:call-template name="uof:右边框">
- <xsl:with-param name="border" select="@fo:border-right"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="@fo:border-bottom or substring-before(substring-after(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-after(substring-after(@style:shadow,' '),' '),'+')">
- <xsl:call-template name="uof:下边框">
- <xsl:with-param name="border" select="@fo:border-bottom"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="uof:左边框">
- <xsl:param name="border"/>
- <xsl:element name="uof:左">
- <xsl:attribute name="uof:locID">u0057</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:template match="style:style[@style:family = 'graphics']">
+ <xsl:variable name="pic-name">
+ <xsl:value-of select="@style:name"/>
+ </xsl:variable>
+ <xsl:variable name="pic-num">
+ <xsl:value-of select="count(/descendant::*[@draw:style-name=$pic-name])"/>
+ </xsl:variable>
+ <xsl:call-template name="pic-process">
+ <xsl:with-param name="pic-name" select="$pic-name"/>
+ <xsl:with-param name="pic-num" select="$pic-num"/>
+ <xsl:with-param name="current-num" select="1"/>
+ </xsl:call-template>
+ </xsl:template-->
+ <xsl:template name="pic-process">
+ <xsl:param name="pic-name"/>
+ <xsl:param name="nodename"/>
+ <xsl:param name="picnumber"/>
+ <图:图形 uof:locID="g0000" uof:attrList="层次 标识符 组合列表 其他对象">
+ <xsl:attribute name="图:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
+ <xsl:attribute name="图:层次"><xsl:value-of select="@draw:z-index"/></xsl:attribute>
+ <xsl:if test=".//office:binary-data">
+ <xsl:attribute name="图:其他对象"><xsl:choose><xsl:when test="@draw:name"><xsl:value-of select="@draw:name"/></xsl:when><xsl:otherwise><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="arrow-sign">
+ <xsl:choose>
+ <xsl:when test="key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-start or key('graphicset',$pic-name)/style:graphic-properties/@draw:marker-end">
+ <xsl:value-of select="'1'"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$nodename='draw:line' or $nodename='draw:rect' or $nodename='draw:circle' or $nodename='draw:polygon' or $nodename='draw:polyline' or $nodename='draw:ellipse' or $nodename='draw:path'or $nodename='draw:g' or $nodename='draw:text-box' or child::draw:text-box">
+ <图:预定义图形 uof:locID="g0005">
+ <图:类别 uof:locID="g0006">
+ <xsl:choose>
+ <xsl:when test="$nodename='draw:line' and $arrow-sign='1'">62</xsl:when>
+ <xsl:when test="$nodename='draw:rect'">11</xsl:when>
+ <xsl:when test="$nodename='draw:line'">61</xsl:when>
+ <xsl:when test="$nodename='draw:circle'">19</xsl:when>
+ <xsl:when test="$nodename='draw:polygon'">65</xsl:when>
+ <xsl:when test="$nodename='draw:polyline'">66</xsl:when>
+ <xsl:when test="$nodename='draw:ellipse'">19</xsl:when>
+ <xsl:when test="child::draw:text-box[@fo:min-height]">22</xsl:when>
+ <xsl:when test="child::draw:text-box">23</xsl:when>
+ </xsl:choose>
+ </图:类别>
+ <图:名称 uof:locID="g0007">
+ <xsl:choose>
+ <xsl:when test="$nodename='draw:rect'">Rectangle</xsl:when>
+ <xsl:when test="$nodename='draw:line'">Line</xsl:when>
+ <xsl:when test="$nodename='draw:circle'">Oval</xsl:when>
+ <xsl:when test="$nodename='draw:polygon'">Freeform</xsl:when>
+ <xsl:when test="$nodename='draw:polyline'">Scribble</xsl:when>
+ <xsl:when test="$nodename='draw:ellipse'">Oval</xsl:when>
+ <xsl:when test="$nodename='draw:frame' and child::draw:text-box[@fo:min-height]">排版框</xsl:when>
+ <xsl:when test="$nodename='draw:frame' and child::draw:text-box">排版框</xsl:when>
+ </xsl:choose>
+ </图:名称>
+ <图:生成软件 uof:locID="g0008">PNG</图:生成软件>
+ <xsl:if test="./@draw:points or ./@svg:d">
+ <图:关键点坐标 uof:locID="g0009" uof:attrList="路径">
+ <xsl:attribute name="图:路径"><xsl:choose><xsl:when test="@svg:d"><xsl:value-of select="@svg:d"/></xsl:when><xsl:when test="@draw:points"><xsl:call-template name="draw:points"><xsl:with-param name="point" select="@draw:points"/><xsl:with-param name="lujing"/></xsl:call-template></xsl:when></xsl:choose></xsl:attribute>
+ </图:关键点坐标>
+ </xsl:if>
+ <图:属性 uof:locID="g0011">
+ <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
+ <xsl:if test="style:graphic-properties/@draw:fill-color or style:graphic-properties/@fo:background-color or style:graphic-properties/@draw:fill-image-name or style:graphic-properties/@draw:fill-gradient-name">
+ <图:填充 uof:locID="g0012">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:fill='gradient'">
+ <xsl:variable name="gradient-name">
+ <xsl:value-of select="style:graphic-properties/@draw:fill-gradient-name"/>
+ </xsl:variable>
+ <xsl:for-each select="/descendant::draw:gradient[@draw:name=$gradient-name]">
+ <图:渐变 uof:locID="g0037" uof:attrList="起始色 终止色 种子类型 起始浓度 终止浓度 渐变方向 边界 种子X位置 种子Y位置 类型">
+ <xsl:attribute name="图:起始色"><xsl:value-of select="@draw:start-color"/></xsl:attribute>
+ <xsl:attribute name="图:终止色"><xsl:value-of select="@draw:end-color"/></xsl:attribute>
+ <xsl:attribute name="图:种子类型"><xsl:choose><xsl:when test="@draw:style='linear' or @draw:style='axial'">linear</xsl:when><xsl:when test="@draw:style='radial'">radar</xsl:when><xsl:when test="@draw:style='ellipsoid'">oval</xsl:when><xsl:when test="@draw:style='square'">square</xsl:when><xsl:when test="@draw:style='rectangular'">rectangle</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:起始浓度"><xsl:value-of select="substring-before(@draw:start-intensity,'%')"/></xsl:attribute>
+ <xsl:attribute name="图:终止浓度"><xsl:value-of select="substring-before(@draw:end-intensity,'%')"/></xsl:attribute>
+ <xsl:variable name="angle">
+ <xsl:value-of select="@draw:angle div 10"/>
+ </xsl:variable>
+ <xsl:attribute name="图:渐变方向"><xsl:choose><xsl:when test="0&lt;$angle and $angle&lt;25">0</xsl:when><xsl:when test="25&lt;$angle and $angle&lt;70">45</xsl:when><xsl:when test="70&lt;$angle and $angle&lt;115">90</xsl:when><xsl:when test="115&lt;$angle and $angle&lt;160">135</xsl:when><xsl:when test="160&lt;$angle and $angle&lt;205">180</xsl:when><xsl:when test="205&lt;$angle and $angle&lt;250">225</xsl:when><xsl:when test="250&lt;$angle and $angle&lt;295">270</xsl:when><xsl:when test="295&lt;$angle and $angle&lt;340">315</xsl:when><xsl:when test="340&lt;$angle and $angle&lt;360">360</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:边界"><xsl:value-of select="substring-before(@draw:border,'%')"/></xsl:attribute>
+ <xsl:if test="@draw:cx">
+ <xsl:attribute name="图:种子X位置"><xsl:value-of select="substring-before(@draw:cx,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@draw:cy">
+ <xsl:attribute name="图:种子Y位置"><xsl:value-of select="substring-before(@draw:cy,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="图:类型">-2</xsl:attribute>
+ </图:渐变>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:fill-image-name or style:graphic-properties/style:background-image/office:binary-data">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:fill-image-name">
+ <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
+ <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:graphic-properties/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:graphic-properties/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:graphic-properties/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:图形引用"><xsl:value-of select="concat($pic-name,'_b1')"/></xsl:attribute>
+ <xsl:attribute name="图:类型">png</xsl:attribute>
+ <xsl:attribute name="图:名称"><xsl:value-of select="style:graphic-properties/@draw:fill-image-name"/></xsl:attribute>
+ </图:图片>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/style:background-image/office:binary-data">
+ <xsl:for-each select="style:graphic-properties">
+ <xsl:call-template name="图:填充"/>
+ </xsl:for-each>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:fill='hatch'">
+ <图:图案 uof:locID="g0036" uof:attrList="类型 图形引用 前景色 背景色">
+ <xsl:attribute name="图:类型"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:name"/></xsl:attribute>
+ <xsl:attribute name="图:图形引用"/>
+ <xsl:attribute name="图:前景色"><xsl:value-of select="/office:document/office:styles/draw:hatch/@draw:color"/></xsl:attribute>
+ <xsl:attribute name="图:背景色"><xsl:choose><xsl:when test="style:graphic-properties/@draw:fill-color"><xsl:value-of select="style:graphic-properties/@draw:fill-color"/></xsl:when><xsl:otherwise>#ffffff</xsl:otherwise></xsl:choose></xsl:attribute>
+ </图:图案>
+ </xsl:when>
+ <xsl:otherwise>
+ <图:颜色 uof:locID="g0034">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:fill-color">
+ <xsl:value-of select="style:graphic-properties/@draw:fill-color"/>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@fo:background-color">
+ <xsl:value-of select="style:graphic-properties/@fo:background-color"/>
+ </xsl:when>
+ <xsl:otherwise>#99ccff</xsl:otherwise>
+ </xsl:choose>
+ </图:颜色>
+ </xsl:otherwise>
+ </xsl:choose>
+ </图:填充>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@svg:stroke-color">
+ <图:线颜色 uof:locID="g0013">
+ <xsl:value-of select="style:graphic-properties/@svg:stroke-color"/>
+ </图:线颜色>
+ </xsl:if>
+ <图:线型 uof:locID="g0014">
+ <xsl:variable name="linetype" select="style:graphic-properties/@draw:stroke-dash"/>
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@fo:border='none'">none</xsl:when>
+ <xsl:when test="not(style:graphic-properties/@draw:stroke)">
+ <xsl:choose>
+ <xsl:when test="not(style:graphic-properties/@svg:stroke-width)">single</xsl:when>
+ <xsl:otherwise>thick</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:stroke = 'none'">none</xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$linetype='Fine_20_Dashed' and style:graphic-properties/@svg:stroke-width">dash-long-heavy</xsl:when>
+ <xsl:when test="$linetype='Fine_20_Dashed'">dash-long</xsl:when>
+ <xsl:when test="$linetype='2 Dots 1 Dash' and style:graphic-properties/@svg:stroke-width">dash-dot-dot-heavy</xsl:when>
+ <xsl:when test="$linetype='2 Dots 1 Dash'">dot-dot-dash</xsl:when>
+ <xsl:when test="$linetype='Ultrafine Dashed' and style:graphic-properties/@svg:stroke-width">dashed-heavy</xsl:when>
+ <xsl:when test="$linetype='Ultrafine Dotted (var)'and style:graphic-properties/@svg:stroke-width">dotted-heavy</xsl:when>
+ <xsl:when test="$linetype='Ultrafine Dotted (var)'">dotted</xsl:when>
+ <xsl:when test="$linetype='Line with Fine Dots'">double</xsl:when>
+ <xsl:when test="$linetype='3 Dashes 3 Dots (var)' and style:graphic-properties/@svg:stroke-width">dash-dot-heavy</xsl:when>
+ <xsl:when test="$linetype='3 Dashes 3 Dots (var)'">dot-dash</xsl:when>
+ <xsl:when test="$linetype='Ultrafine 2 Dots 3 Dashes'and style:graphic-properties/@svg:stroke-width">wavy-heavy</xsl:when>
+ <xsl:when test="$linetype='Ultrafine 2 Dots 3 Dashes'">wave</xsl:when>
+ <xsl:when test="$linetype='Fine Dashed (var)'">wavy-double</xsl:when>
+ <xsl:otherwise>dash</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </图:线型>
+ <xsl:if test="style:graphic-properties/@svg:stroke-width">
+ <图:线粗细 uof:locID="g0016">
+ <xsl:value-of select="substring-before(style:graphic-properties/@svg:stroke-width,$uofUnit)"/>
+ </图:线粗细>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:marker-start and string-length(style:graphic-properties/@draw:marker-start)&gt;0">
+ <图:前端箭头 uof:locID="g0017">
+ <图:式样 uof:locID="g0018">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow'">normal</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Line Arrow'">open</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Arrow concave'">stealth</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Circle'">oval</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-start='Square 45'">diamond</xsl:when>
+ <xsl:otherwise>normal</xsl:otherwise>
+ </xsl:choose>
+ </图:式样>
+ <图:大小 uof:locID="g0019">
+ <xsl:choose>
+ <xsl:when test="not(style:graphic-properties/@draw:marker-start-width)">4</xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="graphsize">
+ <xsl:with-param name="width" select="substring-before(style:graphic-properties/@draw:marker-start-width,$uofUnit)"/>
+ <xsl:with-param name="Unitofsize" select="$uofUnit"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </图:大小>
+ </图:前端箭头>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:marker-end">
+ <图:后端箭头 uof:locID="g0017">
+ <图:式样 uof:locID="g0018">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow'">normal</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Line Arrow'">open</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Arrow concave'">stealth</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Circle'">oval</xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:marker-end='Square 45'">diamond</xsl:when>
+ <xsl:otherwise>normal</xsl:otherwise>
+ </xsl:choose>
+ </图:式样>
+ <图:大小 uof:locID="g0022">
+ <xsl:choose>
+ <xsl:when test="not(style:properties/@draw:marker-start-width)">4</xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="width">
+ <xsl:value-of select="substring-before(style:graphic-properties/@draw:marker-end-width,$uofUnit)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="(not($width&gt;0.05) and 0&lt;$width) or $width=0.05">1</xsl:when>
+ <xsl:when test="(not($width&gt;0.10) and 0.05&lt;$width) or $width=0.10">2</xsl:when>
+ <xsl:when test="(not($width&gt;0.15) and 0.10&lt;$width) or $width=0.15">3</xsl:when>
+ <xsl:when test="(not($width&gt;0.20) and 0.15&lt;$width) or $width=0.20">4</xsl:when>
+ <xsl:when test="(not($width&gt;0.25) and 0.20&lt;$width) or $width=0.25">5</xsl:when>
+ <xsl:when test="(not($width&gt;0.30) and 0.25&lt;$width) or $width=0.30">6</xsl:when>
+ <xsl:when test="(not($width&gt;0.35) and 0.30&lt;$width) or $width=0.35">7</xsl:when>
+ <xsl:when test="(not($width&gt;0.40) and 0.35&lt;$width) or $width=0.40">8</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </图:大小>
+ </图:后端箭头>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:opacity or style:graphic-properties/@draw:transparency">
+ <图:透明度 uof:locID="g0038">
+ <xsl:choose>
+ <xsl:when test="style:graphic-properties/@draw:transparency">
+ <xsl:value-of select="substring-before(style:graphic-properties/@draw:transparency,'%')"/>
+ </xsl:when>
+ <xsl:when test="style:graphic-properties/@draw:opacity">
+ <xsl:value-of select="100 - substring-before(style:graphic-properties/@draw:opacity,'%')"/>
+ </xsl:when>
+ </xsl:choose>
+ </图:透明度>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="@svg:x1">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ <xsl:when test="@svg:x">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ <xsl:when test="child::draw:text-box/@fo:min-height">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(child::draw:text-box/@fo:min-height,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ <xsl:when test="@svg:width">
+ <图:宽度 uof:locID="g0023">
+ <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
+ </图:宽度>
+ <图:高度 uof:locID="g0024">
+ <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
+ </图:高度>
+ </xsl:when>
+ </xsl:choose>
+ <图:旋转角度 uof:locID="g0025">
+ <xsl:choose>
+ <xsl:when test="@draw:transform">
+ <xsl:variable name="rotate-angle">
+ <xsl:value-of select="@draw:transform"/>
+ </xsl:variable>
+ <xsl:variable name="rotate-temp">
+ <xsl:value-of select="substring-before(substring-after($rotate-angle,'rotate ('),')')"/>
+ </xsl:variable>
+ <xsl:value-of select="($rotate-temp * 360) div (2 * 3.14159265)"/>
+ </xsl:when>
+ <xsl:otherwise>0.0</xsl:otherwise>
+ </xsl:choose>
+ </图:旋转角度>
+ <图:X-缩放比例 uof:locID="g0026">1</图:X-缩放比例>
+ <图:Y-缩放比例 uof:locID="g0027">1</图:Y-缩放比例>
+ <图:锁定纵横比 uof:locID="g0028">0</图:锁定纵横比>
+ <图:相对原始比例 uof:locID="g0029">1</图:相对原始比例>
+ <图:打印对象 uof:locID="g0032">true</图:打印对象>
+ <图:Web文字 uof:locID="g0033"/>
+ </图:属性>
+ </图:预定义图形>
+ </xsl:when>
+ <xsl:when test="name()='draw:path'">
+ <图:svg图形对象 图:version="1.1" 图:xmlns_xlink="http://www.w3.org/1999/xlink">
+ <xsl:attribute name="图:x"><xsl:value-of select="@svg:x"/></xsl:attribute>
+ <xsl:attribute name="图:y"><xsl:value-of select="@svg:y"/></xsl:attribute>
+ <xsl:attribute name="图:width"><xsl:value-of select="@svg:width"/></xsl:attribute>
+ <xsl:attribute name="图:height"><xsl:value-of select="@svg:height"/></xsl:attribute>
+ <xsl:attribute name="图:viewBox"><xsl:value-of select="@svg:viewBox"/></xsl:attribute>
+ <图:path>
+ <xsl:attribute name="图:d"><xsl:value-of select="@svg:d"/></xsl:attribute>
+ </图:path>
+ </图:svg图形对象>
+ </xsl:when>
+ </xsl:choose>
+ <图:文本内容 uof:locID="g0002" uof:attrList="文本框 左边距 右边距 上边距 下边距 水平对齐 垂直对齐 文字排列方向 自动换行 大小适应文字 前一链接 后一链接">
+ <xsl:if test="./draw:text-box">
+ <xsl:attribute name="图:文本框">true</xsl:attribute>
+ <xsl:if test="./@draw:name = /office:document/office:body/office:text//draw:text-box/@draw:chain-next-name">
+ <xsl:attribute name="图:前一链接"><xsl:variable name="drawname"><xsl:value-of select="./@draw:name"/></xsl:variable><xsl:variable name="befor-link-name"><xsl:value-of select="/office:document/office:body/office:text//draw:text-box[@draw:name=$drawname]/@draw:style-name"/></xsl:variable><xsl:value-of select="concat($befor-link-name,'_',$picnumber)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="./@draw:chain-next-name">
+ <xsl:attribute name="图:后一链接"><xsl:variable name="next-link"><xsl:value-of select="./@draw:chain-next-name"/></xsl:variable><xsl:variable name="link-name"><xsl:value-of select="/office:document/office:body/office:text//draw:text-box[@draw:name=$next-link]/@draw:style-name"/></xsl:variable><xsl:value-of select="concat($link-name,'_',$picnumber)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
+ <xsl:if test="style:text-properties/@fo:padding-left">
+ <xsl:attribute name="图:左边距"><xsl:value-of select="style:text-properties/@fo:padding-left"/></xsl:attribute>
+ <xsl:attribute name="图:右边距"><xsl:value-of select="style:text-properties/@fo:padding-right"/></xsl:attribute>
+ <xsl:attribute name="图:上边距"><xsl:value-of select="style:text-properties/@fo:padding-top"/></xsl:attribute>
+ <xsl:attribute name="图:下边距"><xsl:value-of select="style:text-properties/@fo:padding-bottom"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="图:文字排列方向"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode"><xsl:choose><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-lr'">vert-l2r</xsl:when><xsl:when test="style:paragraph-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when></xsl:choose></xsl:when><xsl:when test="style:graphic-properties/@style:writing-mode='tb-lr'">vert-l2r</xsl:when><xsl:when test="style:graphic-properties/@style:writing-mode='tb-rl'">vert-r2l</xsl:when><xsl:when test="style:paragraph-properties/@draw:textarea-horizontal-align='right'">hori-r2l</xsl:when><xsl:otherwise>hori-l2r</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="style:text-properties/@fo:wrap-option">
+ <xsl:attribute name="图:自动换行">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:textarea-horizontal-align">
+ <xsl:attribute name="图:水平对齐"><xsl:value-of select="style:graphic-properties/@draw:textarea-horizontal-align"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:textarea-vertical-align">
+ <xsl:attribute name="图:垂直对齐"><xsl:value-of select="style:graphic-properties/@draw:textarea-vertical-align"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:graphic-properties/@draw:auto-grow-width='true' and style:graphic-properties/@draw:auto-grow-height='true'">
+ <xsl:attribute name="图:大小适应文字"><xsl:choose><xsl:when test="style:graphic-properties/@draw:auto-grow-width='true' and style:graphic-properties/@draw:auto-grow-height='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="text:p">
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <xsl:if test="style:paragraph-properties">
+ <字:段落属性 uof:locID="t0052" uof:attrList="式样引用">
+ <xsl:apply-templates select="style:paragraph-properties"/>
+ </字:段落属性>
+ </xsl:if>
+ <xsl:call-template name="textp"/>
+ </字:段落>
+ </xsl:for-each>
+ <xsl:for-each select="draw:text-box/text:p">
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <xsl:if test="style:paragraph-properties">
+ <字:段落属性 uof:locID="t0052" uof:attrList="式样引用">
+ <xsl:apply-templates select="style:paragraph-properties"/>
+ </字:段落属性>
+ </xsl:if>
+ <xsl:call-template name="textp"/>
+ </字:段落>
+ </xsl:for-each>
+ </图:文本内容>
+ <xsl:if test="@svg:x and @svg:y">
+ <图:控制点 uof:locID="g0003" uof:attrList="x坐标 y坐标">
+ <xsl:attribute name="图:x坐标"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="图:y坐标"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:attribute>
+ </图:控制点>
+ </xsl:if>
+ </图:图形>
+ <xsl:if test="name()='draw:frame' and ./draw:image">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'_',$picnumber)"/></xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <xsl:variable name="pic">
+ <xsl:choose>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.png')">png</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.jpg')">jpg</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.gif')">gif</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.bmp')">bmp</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.pbm')">pbm</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.ras')">ras</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.txt')">text</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.xml')">xml</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.htm')">html</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.html')">html</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.wav')">wav</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.mid')">midi</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.ra')">ra</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.au')">au</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.mp3')">mp3</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.snd')">snd</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.svg')">svg</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.avi')">avi</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.mpeg')">mpeg4</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.qt')">qt</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.rm')">rm</xsl:when>
+ <xsl:when test="contains(./draw:image/@xlink:href,'.asf')">asf</xsl:when>
+ <xsl:otherwise>图片</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$pic!='图片'">
+ <xsl:attribute name="uof:公共类型"><xsl:value-of select="$pic"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="uof:私有类型">图片</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="./draw:image/office:binary-data">
+ <uof:数据 uof:locID="u0037">
+ <xsl:value-of select="./draw:image/office:binary-data"/>
+ </uof:数据>
+ </xsl:if>
+ <xsl:if test="./draw:image/@xlink:href">
+ <uof:路径 uof:locID="u0038">
+ <xsl:value-of select="./draw:image/@xlink:href"/>
+ </uof:路径>
+ </xsl:if>
+ </uof:其他对象>
+ </xsl:if>
+ <xsl:for-each select="(/office:document/office:styles/descendant::*[@style:name=$pic-name]) | (/office:document/office:automatic-styles/descendant::*[@style:name=$pic-name]) ">
+ <xsl:if test="style:text-properties/@draw:fill-image-name">
+ <uof:其他对象 uof:locID="u0036" uof:attrList="标识符 内嵌 公共类型 私有类型">
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="concat($pic-name,'-b1')"/></xsl:attribute>
+ <xsl:attribute name="uof:公共类型">png</xsl:attribute>
+ <xsl:attribute name="uof:内嵌">true</xsl:attribute>
+ <xsl:variable name="fill-name">
+ <xsl:value-of select="style:text-properties/@draw:fill-image-name"/>
+ </xsl:variable>
+ <uof:数据 uof:locID="u0037">
+ <xsl:for-each select="/office:document/office:styles/draw:fill-image[@draw:name=$fill-name]">
+ <xsl:value-of select="office:binary-data"/>
+ </xsl:for-each>
+ </uof:数据>
+ <uof:路径 uof:locID="u0038">
+ <xsl:value-of select="@xlink:href"/>
+ </uof:路径>
+ </uof:其他对象>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="draw:points">
+ <xsl:param name="point"/>
+ <xsl:param name="lujing"/>
+ <xsl:choose>
+ <xsl:when test="contains($point,' ' )">
+ <xsl:variable name="first-point" select="substring-before($point,' ')"/>
+ <xsl:variable name="other-point" select="substring-after($point,' ')"/>
+ <xsl:variable name="xzuobiao">
+ <xsl:value-of select="substring-before($first-point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:variable name="yzuobiao">
+ <xsl:value-of select="substring-after($first-point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:call-template name="draw:points">
+ <xsl:with-param name="point" select="$other-point"/>
+ <xsl:with-param name="lujing" select="concat($lujing,$xzuobiao,' ',$yzuobiao,'lineto')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="xzuobiao">
+ <xsl:value-of select="substring-before($point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:variable name="yzuobiao">
+ <xsl:value-of select="substring-after($point,',') div 1000"/>
+ </xsl:variable>
+ <xsl:value-of select="concat($lujing,$xzuobiao,' ',$yzuobiao)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="office:meta">
+ <uof:元数据 uof:locID="u0001">
+ <uof:标题 uof:locID="u0002">
+ <xsl:value-of select="dc:title"/>
+ </uof:标题>
+ <uof:创建应用程序 uof:locID="u0011">
+ <xsl:value-of select="meta:generator"/>
+ </uof:创建应用程序>
+ <uof:摘要 uof:locID="u0007">
+ <xsl:value-of select="dc:description"/>
+ </uof:摘要>
+ <uof:主题 uof:locID="u0003">
+ <xsl:value-of select="dc:subject"/>
+ </uof:主题>
+ <uof:创建者 uof:locID="u0004">
+ <xsl:value-of select="meta:initial-creator"/>
+ </uof:创建者>
+ <!--uof:作者 uof:locID="u0005">
+ <xsl:value-of select="meta:initial-creator"/>
+ </uof:作者-->
+ <uof:创建日期 uof:locID="u0008">
+ <xsl:value-of select="meta:creation-date"/>
+ </uof:创建日期>
+ <uof:最后作者 uof:locID="u0006">
+ <xsl:value-of select="dc:creator"/>
+ </uof:最后作者>
+ <uof:关键字集 uof:locID="u0014">
+ <xsl:for-each select=".">
+ <uof:关键字 uof:locID="u0015">
+ <xsl:value-of select="meta:keywords/@meta:keyword"/>
+ </uof:关键字>
+ </xsl:for-each>
+ </uof:关键字集>
+ <uof:编辑次数 uof:locID="u0009">
+ <xsl:value-of select="meta:editing-cycles"/>
+ </uof:编辑次数>
+ <xsl:if test="meta:editing-duration">
+ <uof:编辑时间 uof:locID="u0010">
+ <xsl:value-of select="meta:editing-duration"/>
+ </uof:编辑时间>
+ </xsl:if>
+ <xsl:if test="meta:template/@xlink:href">
+ <uof:文档模板 uof:locID="u0013">
+ <xsl:value-of select="meta:template/@xlink:href"/>
+ </uof:文档模板>
+ </xsl:if>
+ <xsl:if test="meta:user-defined/@meta:name">
+ <uof:用户自定义元数据集 uof:locID="u0016">
+ <xsl:for-each select="meta:user-defined">
+ <uof:用户自定义元数据 uof:locID="u0017" uof:attrList="名称 类型">
+ <xsl:attribute name="uof:名称"><xsl:value-of select="@meta:name"/></xsl:attribute>
+ <xsl:attribute name="uof:类型"><xsl:value-of select="'string'"/></xsl:attribute>
+ </uof:用户自定义元数据>
+ </xsl:for-each>
+ </uof:用户自定义元数据集>
+ </xsl:if>
+ <!--xsl:if test="meta:document-statistic/@meta:page-count"-->
+ <uof:页数 uof:locID="u0020">
+ <xsl:value-of select="meta:document-statistic/@meta:page-count"/>
+ </uof:页数>
+ <!--/xsl:if-->
+ <!--xsl:if test="meta:document-statistic/@meta:paragraph-count"-->
+ <uof:段落数 uof:locID="u0025">
+ <xsl:value-of select="meta:document-statistic/@meta:paragraph-count"/>
+ </uof:段落数>
+ <!--/xsl:if-->
+ <!--xsl:if test="meta:document-statistic/@meta:object-count"-->
+ <uof:对象数 uof:locID="u0026">
+ <xsl:value-of select="meta:document-statistic/@meta:object-count"/>
+ </uof:对象数>
+ <!--/xsl:if-->
+ <!--xsl:if test="meta:document-statistic/@meta:character-count"-->
+ <uof:字数 uof:locID="u0021">
+ <xsl:value-of select="meta:document-statistic/@meta:character-count"/>
+ </uof:字数>
+ <!--/xsl:if-->
+ <!--xsl:if test="meta:document-statistic/@meta:word-count"-->
+ <uof:中文字符数 uof:locID="u0023">
+ <xsl:value-of select="meta:document-statistic/@meta:word-count"/>
+ </uof:中文字符数>
+ <!--/xsl:if-->
+ <uof:英文字符数 uof:locID="u0022">
+ <xsl:value-of select="meta:document-statistic/@meta:character-count - meta:document-statistic/@meta:word-count"/>
+ </uof:英文字符数>
+ <uof:行数 uof:locID="u0024">
+ <xsl:variable name="quzhi">
+ <xsl:value-of select="(meta:document-statistic/@meta:character-count div 39) + 0.9"/>
+ </xsl:variable>
+ <xsl:value-of select="substring-before($quzhi,'.')"/>
+ </uof:行数>
+ <uof:分类 uof:locID="u0012">
+ <xsl:value-of select="meta:user-defined[@meta:name='Category']"/>
+ </uof:分类>
+ <uof:经理名称 uof:locID="u0019">
+ <xsl:value-of select="meta:user-defined[meta:name='Manager']"/>
+ </uof:经理名称>
+ <uof:公司名称 uof:locID="u0018">
+ <xsl:value-of select="meta:user-defined[meta:name='Company']"/>
+ </uof:公司名称>
+ </uof:元数据>
+ </xsl:template>
+ <xsl:template match="office:font-face-decls">
+ <uof:字体集 uof:locID="u0040">
+ <xsl:for-each select="style:font-face">
+ <xsl:element name="uof:字体声明">
+ <xsl:attribute name="uof:attrList">标识符 名称 字体族</xsl:attribute>
+ <xsl:attribute name="uof:locID">u0041</xsl:attribute>
+ <xsl:attribute name="uof:名称"><xsl:value-of select="@svg:font-family"/></xsl:attribute>
+ <xsl:attribute name="uof:标识符"><xsl:value-of select="translate(@style:name,' ','_')"/></xsl:attribute>
+ <xsl:if test="@style:font-charset= '02'">
+ <xsl:attribute name="uof:字符集">x-symbol</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@style:font-family-generic">
+ <xsl:choose>
+ <xsl:when test="@style:font-family-generic = 'swiss'">
+ <xsl:attribute name="uof:字体族">Swiss</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='modern'">
+ <xsl:attribute name="uof:字体族">Modern</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic='roman'">
+ <xsl:attribute name="uof:字体族">Roman</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='script'">
+ <xsl:attribute name="uof:字体族">Script</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='decorative'">
+ <xsl:attribute name="uof:字体族">Decorative</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@style:font-family-generic ='system'">
+ <xsl:attribute name="uof:字体族">System</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="uof:字体族">System</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="style:font-decl"/>
+ </uof:字体集>
+ </xsl:template>
+ <xsl:template name="自动编号集">
+ <xsl:element name="uof:自动编号集">
+ <xsl:attribute name="uof:locID">u0042</xsl:attribute>
+ <xsl:for-each select="/office:document//text:list-style">
+ <xsl:element name="字:自动编号">
+ <xsl:attribute name="uof:locID">t0169</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 父编号引用 多级编号</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:if test=".//@text:style-name">
+ <xsl:attribute name="字:名称"><xsl:value-of select=".//@text:style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="字:多级编号">true</xsl:attribute>
+ <xsl:for-each select="./* ">
+ <xsl:if test="not(number(@text:level)=10)">
+ <xsl:element name="字:级别">
+ <xsl:attribute name="uof:locID">t0159</xsl:attribute>
+ <xsl:attribute name="uof:attrList">级别值 编号对齐方式 尾随字符</xsl:attribute>
+ <xsl:attribute name="字:级别值"><xsl:value-of select="number(@text:level) - 1"/></xsl:attribute>
+ <xsl:if test="@style:num-suffix">
+ <xsl:attribute name="字:尾随字符"><xsl:choose><xsl:when test="@style:num-suffix=' '">space</xsl:when><xsl:when test="@style:num-suffix=' '">tab</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:list-level-properties/@fo:text-align">
+ <xsl:attribute name="字:编号对齐方式"><xsl:variable name="vv"><xsl:value-of select="style:list-level-properties/@fo:text-align"/></xsl:variable><xsl:choose><xsl:when test="$vv='center' ">center</xsl:when><xsl:when test="$vv='end' ">right</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@text:bullet-char">
+ <xsl:element name="字:项目符号">
+ <xsl:attribute name="uof:locID">t0171</xsl:attribute>
+ <xsl:value-of select="@text:bullet-char"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="@text:style-name">
+ <xsl:element name="字:符号字体">
+ <xsl:attribute name="uof:locID">t0160</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="@style:num-format">
+ <xsl:choose>
+ <xsl:when test="string(@style:num-format)='a'">
+ <xsl:element name="字:编号格式">
+ <xsl:attribute name="uof:locID">t0162</xsl:attribute>lower-letter</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='A'">
+ <xsl:element name="字:编号格式">
+ <xsl:attribute name="uof:locID">t0162</xsl:attribute>upper-letter</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='i'">
+ <xsl:element name="字:编号格式">
+ <xsl:attribute name="uof:locID">t0162</xsl:attribute>lower-roman</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='I'">
+ <xsl:element name="字:编号格式">
+ <xsl:attribute name="uof:locID">t0162</xsl:attribute>upper-roman</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='①, ②, ③, ...'">
+ <xsl:element name="字:编号格式">
+ <xsl:attribute name="uof:locID">t0162</xsl:attribute>decimal-enclosed-circle</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='甲, 乙, 丙, ...'">
+ <xsl:element name="字:编号格式">
+ <xsl:attribute name="uof:locID">t0162</xsl:attribute>ideograph-traditional</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='子, 丑, 寅, ...'">
+ <xsl:element name="字:编号格式">
+ <xsl:attribute name="uof:locID">t0162</xsl:attribute>ideograph-zodiac</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='一, 二, 三, ...'">
+ <xsl:element name="字:编号格式">
+ <xsl:attribute name="uof:locID">t0162</xsl:attribute>chinese-counting</xsl:element>
+ </xsl:when>
+ <xsl:when test="string(@style:num-format)='壹, 贰, 叁, ...'">
+ <xsl:element name="字:编号格式">
+ <xsl:attribute name="uof:locID">t0162</xsl:attribute>chinese-legal-simplified</xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="字:编号格式">
+ <xsl:attribute name="uof:locID">t0162</xsl:attribute>decimal</xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:variable name="jibie">
+ <xsl:value-of select="position()"/>
+ </xsl:variable>
+ <xsl:variable name="xianshijibie">
+ <xsl:choose>
+ <xsl:when test="@text:display-levels">
+ <xsl:value-of select="@text:display-levels"/>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="字:编号格式表示">
+ <xsl:attribute name="uof:locID">t0163</xsl:attribute>
+ <xsl:call-template name="字:编号格式表示">
+ <xsl:with-param name="bubianjibie" select="$jibie"/>
+ <xsl:with-param name="jibie" select="$jibie"/>
+ <xsl:with-param name="xianshijibie" select="$xianshijibie"/>
+ <xsl:with-param name="biaoshi" select="concat(string(@style:num-prefix),'%',$jibie,string(@style:num-suffix))"/>
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:if test="office:binary-data">
+ <xsl:element name="字:图片符号引用">
+ <xsl:attribute name="uof:locID">t0164</xsl:attribute>
+ <xsl:attribute name="uof:attrList">宽度 高度</xsl:attribute>
+ <xsl:if test="style:list-level-properties/@fo:width">
+ <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(style:list-level-properties/@fo:width,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:list-level-properties/@fo:height">
+ <xsl:attribute name="字:高度"><xsl:value-of select="substring-before(style:list-level-properties/@fo:height,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:value-of select="concat('image_numbering_',count(preceding::text:list-level-style-image))"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@fo:margin-left or style:paragraph-properties/@fo:margin-right or style:paragraph-properties/@fo:text-indent">
+ <xsl:element name="字:缩进">
+ <xsl:attribute name="uof:locID">t0165</xsl:attribute>
+ <xsl:for-each select="style:paragraph-properties">
+ <xsl:call-template name="字:缩进类型"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:list-level-properties/@text:min-label-width">
+ <xsl:element name="字:制表符位置">
+ <xsl:attribute name="uof:locID">t0166</xsl:attribute>
+ <xsl:value-of select="substring-before(style:list-level-properties/@text:min-label-width,$uofUnit)"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="@text:start-value">
+ <xsl:element name="字:起始编号">
+ <xsl:attribute name="uof:locID">t0167</xsl:attribute>
+ <xsl:value-of select="@text:start-value"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="@text:num-regular-exp">
+ <xsl:element name="字:正规格式">
+ <xsl:attribute name="uof:locID">t0168</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="@text:num-regular-exp"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="shiyang">
+ <xsl:for-each select="office:styles/style:style">
+ <xsl:choose>
+ <xsl:when test="@style:family='text'">
+ <xsl:element name="uof:句式样">
+ <xsl:attribute name="uof:locID">u0043</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:类型">auto</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@style:parent-style-name">
+ <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:name"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="字:句属性"/>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ <xsl:for-each select="office:automatic-styles/style:style">
+ <xsl:choose>
+ <xsl:when test="@style:family='text'">
+ <xsl:element name="uof:句式样">
+ <xsl:attribute name="uof:locID">u0043</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:类型">custom</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@style:parent-style-name">
+ <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@style:parent-style-name and not(@style:parent-style-name='Standard')">
+ <xsl:variable name="stylename" select="@style:parent-style-name"/>
+ <xsl:for-each select="/office:document/office:styles/style:style[@style:name=$stylename]">
+ <xsl:call-template name="字:句属性"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="字:句属性"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ <xsl:for-each select="office:styles/style:style">
+ <xsl:choose>
+ <xsl:when test="@style:family='paragraph'">
+ <xsl:element name="uof:段落式样">
+ <xsl:attribute name="uof:locID">u0044</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:类型">auto</xsl:attribute>
+ <xsl:if test="@style:parent-style-name">
+ <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:if test="@style:display-name">
+ <xsl:attribute name="字:别名"><xsl:value-of select="@style:display-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:call-template name="字:句属性"/>
+ </xsl:element>
+ <xsl:call-template name="ParaAttribute"/>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ <xsl:for-each select="office:automatic-styles/style:style">
+ <xsl:choose>
+ <xsl:when test="@style:family='paragraph'">
+ <xsl:element name="uof:段落式样">
+ <xsl:attribute name="uof:locID">u0044</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:类型">custom</xsl:attribute>
+ <xsl:if test="@style:parent-style-name">
+ <xsl:attribute name="字:基式样引用"><xsl:value-of select="@style:parent-style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:call-template name="字:句属性"/>
+ </xsl:element>
+ <xsl:call-template name="ParaAttribute"/>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="字:编号格式表示">
+ <xsl:param name="bubianjibie"/>
+ <xsl:param name="jibie"/>
+ <xsl:param name="xianshijibie"/>
+ <xsl:param name="biaoshi"/>
+ <xsl:choose>
+ <xsl:when test="number($xianshijibie)= 1">
+ <xsl:value-of select="$biaoshi"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="num-prefix">
+ <xsl:value-of select="preceding-sibling::*[number($bubianjibie -$jibie +1)]/@style:num-prefix"/>
+ </xsl:variable>
+ <xsl:variable name="num-suffix">
+ <xsl:value-of select="preceding-sibling::*[number($bubianjibie -$jibie +1)]/@style:num-suffix"/>
+ </xsl:variable>
+ <xsl:call-template name="字:编号格式表示">
+ <xsl:with-param name="bubianjibie" select="$bubianjibie"/>
+ <xsl:with-param name="jibie" select="$jibie -1"/>
+ <xsl:with-param name="xianshijibie" select="$xianshijibie -1"/>
+ <xsl:with-param name="biaoshi" select="concat($num-prefix,'%',number($jibie -1),$num-suffix,'.',$biaoshi)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="style:style[ancestor::office:automatic-styles]" mode="style">
+ <xsl:for-each select=".">
+ <xsl:choose>
+ <xsl:when test="@style:family='table' ">
+ <xsl:element name="uof:文字表式样">
+ <xsl:attribute name="uof:locID">u0045</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型 别名 基式样引用 后继式样引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:别名"><xsl:value-of select="@style:name"/></xsl:attribute>
+ <xsl:attribute name="字:类型">auto</xsl:attribute>
+ <xsl:if test="style:table-properties">
+ <xsl:element name="字:宽度">
+ <xsl:attribute name="字:绝对宽度"><xsl:value-of select="substring-before(style:table-properties/@style:width,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0130</xsl:attribute>
+ <xsl:attribute name="uof:attrList">绝对宽度 相对宽度</xsl:attribute>
+ </xsl:element>
+ <字:对齐 uof:locID="t0133">
+ <xsl:choose>
+ <xsl:when test="style:table-properties/@table:align='right'">right</xsl:when>
+ <xsl:when test="style:table-properties/@table:align='center'">center</xsl:when>
+ <xsl:otherwise>left</xsl:otherwise>
+ </xsl:choose>
+ </字:对齐>
+ </xsl:if>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="office:settings">
+ <字:文档设置 uof:locID="t0001">
+ <字:度量单位 uof:locID="t0006">
+ <xsl:value-of select="$ooUnit"/>
+ </字:度量单位>
+ <字:默认制表位位置 uof:locID="t0004">
+ <xsl:variable name="aa" select="substring-before(/office:document/office:styles/style:default-style[@style:family='paragraph']/style:paragraph-properties/@style:tab-stop-distance,$ooUnit)"/>
+ <xsl:variable name="bb" select="$aa - 0.74"/>
+ <xsl:value-of select="substring($bb,1,4)"/>
+ </字:默认制表位位置>
+ <字:当前视图 uof:locID="t0002">
+ <xsl:choose>
+ <xsl:when test="config:config-item-set[@config:name='ooo:view-settings']/config:config-item[@config:name='InBrowseMode']='false'">page</xsl:when>
+ <xsl:when test="config:config-item-set[@config:name='ooo:view-settings']/config:config-item[@config:name='InBrowseMode']='true'">web</xsl:when>
+ <xsl:otherwise>page</xsl:otherwise>
+ </xsl:choose>
+ </字:当前视图>
+ <xsl:if test="config:config-item-set[@config:name='ooo:view-settings']/config:config-item-map-indexed[@config:name='Views']/config:config-item-map-entry/config:config-item[@config:name='ZoomFactor']">
+ <字:缩放 uof:locID="t0003">
+ <xsl:value-of select="config:config-item-set[@config:name='ooo:view-settings']/config:config-item-map-indexed[@config:name='Views']/config:config-item-map-entry/config:config-item[@config:name='ZoomFactor']"/>
+ </字:缩放>
+ </xsl:if>
+ <字:修订 uof:locID="t0005">
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="/office:document/office:body/office:text/text:tracked-changes">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </字:修订>
+ <xsl:if test="config:config-item-set[@config:name='configuration-settings']/config:config-item-map-indexed[@config:name='ForbiddenCharacters']/config:config-item-map-entry[config:config-item='CN']">
+ <字:标点禁则 uof:locID="t0007">
+ <字:行首字符 uof:locID="t0008">
+ <xsl:value-of select="config:config-item-set[@config:name='configuration-settings']/config:config-item-map-indexed[@config:name='ForbiddenCharacters']/config:config-item-map-entry[config:config-item='CN']/config:config-item[@config:name='BeginLine']"/>
+ </字:行首字符>
+ <字:行尾字符 uof:locID="t0009">
+ <xsl:value-of select="config:config-item-set[@config:name='configuration-settings']/config:config-item-map-indexed[@config:name='ForbiddenCharacters']/config:config-item-map-entry[config:config-item='CN']/config:config-item[@config:name='EndLine']"/>
+ </字:行尾字符>
+ </字:标点禁则>
+ <xsl:if test="/office:document/office:styles/text:notes-configuration[@text:note-class='endnote']">
+ <字:尾注位置 uof:locID="t0210" uof:attrList="位置">
+ <xsl:attribute name="字:位置">doc-end</xsl:attribute>
+ </字:尾注位置>
+ </xsl:if>
+ </xsl:if>
+ </字:文档设置>
+ </xsl:template>
+ <xsl:template name="style:page-layout">
+ <字:分节 uof:locID="t0017" uof:attrList="名称">
+ <xsl:attribute name="字:名称"><xsl:variable name="stylename"><xsl:value-of select="@style:name"/></xsl:variable><xsl:value-of select="/office:document/office:master-styles/style:master-page[@style:page-layout-name=$stylename]/@style:name"/></xsl:attribute>
+ <字:节属性 uof:locID="t0018">
+ <字:节类型 uof:locID="t0020">new-page</字:节类型>
+ <xsl:element name="字:页边距">
+ <xsl:attribute name="uof:locID">t0021</xsl:attribute>
+ <xsl:attribute name="uof:attrList">左 上 右 下</xsl:attribute>
+ <xsl:attribute name="uof:上"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:左"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-left,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:下"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:右"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:margin-right,$ooUnit)"/></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:纸张">
+ <xsl:attribute name="uof:locID">t0022</xsl:attribute>
+ <xsl:attribute name="uof:attrList">纸型 宽度 高度</xsl:attribute>
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:page-width,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:高度"><xsl:value-of select="substring-before(style:page-layout-properties/@fo:page-height,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="uof:纸型"><xsl:variable name="height"><xsl:value-of select="style:page-layout-properties/@fo:page-height"/></xsl:variable><xsl:variable name="width"><xsl:value-of select="style:page-layout-properties/@fo:page-width"/></xsl:variable><xsl:choose><xsl:when test="$width='29.702cm' and $height='42cm'">A3</xsl:when><xsl:when test="$width='21.001cm' and $height='29.7cm'">A4</xsl:when><xsl:when test="$width='14.799cm' and $height='20.999cm'">A5</xsl:when><xsl:when test="$width='25cm' and $height='35.3cm'">B4</xsl:when><xsl:when test="$width='17.598cm' and $height='25cm'">B5</xsl:when><xsl:when test="$width='12.5cm' and $height='17.6cm'">B6</xsl:when><xsl:otherwise>使用者</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:if test="/office:document/office:master-styles/style:master-page/style:header-left">
+ <xsl:element name="字:奇偶页页眉页脚不同">
+ <xsl:attribute name="uof:locID">t0023</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:首页页眉页脚不同">
+ <xsl:attribute name="uof:locID">t0024</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">false</xsl:attribute>
+ </xsl:element>
+ <xsl:if test="style:header-style/style:header-footer-properties">
+ <xsl:element name="字:页眉位置">
+ <xsl:attribute name="uof:locID">t0025</xsl:attribute>
+ <xsl:attribute name="uof:attrList">距边界 距版芯</xsl:attribute>
+ <xsl:attribute name="字:距边界"><xsl:value-of select="substring-before(style:header-style/style:header-footer-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
+ <xsl:variable name="long1" select="substring-before(style:header-style/style:header-footer-properties/@fo:margin-bottom,$ooUnit)"/>
+ <xsl:variable name="long2" select="substring-before(style:header-style/style:header-footer-properties/@svg:height,$ooUnit)"/>
+ <xsl:attribute name="字:距版芯"><xsl:value-of select="$long2 - $long1"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:footer-style/style:header-footer-properties">
+ <xsl:element name="字:页脚位置">
+ <xsl:attribute name="uof:locID">t0026</xsl:attribute>
+ <xsl:attribute name="uof:attrList">距边界 距版芯</xsl:attribute>
+ <xsl:attribute name="字:距边界"><xsl:value-of select="substring-before(style:footer-style/style:header-footer-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
+ <xsl:variable name="long1" select="substring-before(style:footer-style/style:header-footer-properties/@fo:margin-top,$ooUnit)"/>
+ <xsl:variable name="long2" select="substring-before(style:footer-style/style:header-footer-properties/@svg:height,$ooUnit)"/>
+ <xsl:attribute name="字:距版芯"><xsl:value-of select="$long2 - $long1"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:variable name="masterPages" select="'Standard'"/>
+ <xsl:variable name="mp">
+ <xsl:value-of select="@style:name"/>
+ </xsl:variable>
+ <xsl:for-each select="/office:document/office:master-styles/style:master-page[@style:page-layout-name=$mp and @style:name=$masterPages]">
+ <xsl:if test="style:header-left or style:header">
+ <字:页眉 uof:locID="t0027">
+ <xsl:choose>
+ <xsl:when test="style:header-left">
+ <xsl:for-each select="style:header">
+ <字:首页页眉 uof:locID="t0030">
+ <xsl:if test="text:p">
+ <xsl:for-each select="text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="table:table">
+ <xsl:for-each select="table:table">
+ <xsl:call-template name="exec_table"/>
+ </xsl:for-each>
+ </xsl:if>
+ </字:首页页眉>
+ </xsl:for-each>
+ <xsl:for-each select="style:header-left">
+ <字:偶数页页眉 uof:locID="t0029">
+ <xsl:if test="text:p">
+ <xsl:for-each select="text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="table:table">
+ <xsl:for-each select="table:table">
+ <xsl:call-template name="exec_table"/>
+ </xsl:for-each>
+ </xsl:if>
+ </字:偶数页页眉>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="style:header">
+ <字:奇数页页眉 uof:locID="t0028">
+ <xsl:if test="text:p">
+ <xsl:for-each select="text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="table:table">
+ <xsl:for-each select="table:table">
+ <xsl:call-template name="exec_table"/>
+ </xsl:for-each>
+ </xsl:if>
+ </字:奇数页页眉>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:页眉>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="/office:document/office:master-styles/style:master-page[@style:page-layout-name=$mp and @style:name=$masterPages]">
+ <xsl:if test="style:footer-left or style:footer">
+ <字:页脚 uof:locID="t0031">
+ <xsl:choose>
+ <xsl:when test="style:footer-left">
+ <xsl:for-each select="style:footer">
+ <字:首页页脚 uof:locID="t0034">
+ <xsl:if test="text:p">
+ <xsl:for-each select="text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="table:table">
+ <xsl:for-each select="table:table">
+ <xsl:call-template name="exec_table"/>
+ </xsl:for-each>
+ </xsl:if>
+ </字:首页页脚>
+ </xsl:for-each>
+ <xsl:for-each select="style:footer-left">
+ <字:偶数页页脚 uof:locID="t0033">
+ <xsl:if test="text:p">
+ <xsl:for-each select="text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="table:table">
+ <xsl:for-each select="table:table">
+ <xsl:call-template name="exec_table"/>
+ </xsl:for-each>
+ </xsl:if>
+ </字:偶数页页脚>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="style:footer">
+ <字:奇数页页脚 uof:locID="t0032">
+ <xsl:if test="text:p">
+ <xsl:for-each select="text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="table:table">
+ <xsl:for-each select="table:table">
+ <xsl:call-template name="exec_table"/>
+ </xsl:for-each>
+ </xsl:if>
+ </字:奇数页页脚>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:页脚>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="@style:page-usage">
+ <字:对称页边距 uof:locID="t0036" uof:attrList="值">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:page-usage='mirrored'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </字:对称页边距>
+ </xsl:if>
+ <xsl:if test="@style:page-usage='mirrored'">
+ <xsl:element name="字:拼页">
+ <xsl:attribute name="uof:locID">t0037</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">1</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:纸张方向">
+ <xsl:attribute name="uof:locID">t0038</xsl:attribute>
+ <xsl:value-of select="style:page-layout-properties/@style:print-orientation"/>
+ </xsl:element>
+ <xsl:if test="style:page-layout-properties/@style:paper-tray-name">
+ <字:纸张来源 uof:locID="t0039" uof:attrList="首页 其他页" 字:首页="false" 字:其他页="style:page-layout-properties/@style:paper-tray-name"/>
+ </xsl:if>
+ <xsl:if test="style:page-layout-properties/@style:num-format">
+ <xsl:element name="字:页码设置">
+ <xsl:attribute name="uof:locID">t0042</xsl:attribute>
+ <xsl:attribute name="uof:attrList">首页显示 格式 包含章节号 章节起始样式引用 分隔符 起始编号</xsl:attribute>
+ <xsl:attribute name="字:首页显示">1</xsl:attribute>
+ <xsl:attribute name="字:格式"><xsl:variable name="format"><xsl:value-of select="style:page-layout-properties/@style:num-format"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
+ <xsl:if test="style:text-properties/@style:first-page-number">
+ <xsl:attribute name="字:起始编号"><xsl:value-of select="style:text-properties/@style:first-page-number"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="字:包含章节号">false</xsl:attribute>
+ <!--xsl:attribute name="字:章节起始样式引用">false</xsl:attribute-->
+ <xsl:attribute name="字:分隔符">hyphen</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="/office:document/office:styles/text:notes-configuration[@text:note-class='footnote']">
+ <xsl:element name="字:脚注设置">
+ <xsl:attribute name="uof:locID">t0040</xsl:attribute>
+ <xsl:attribute name="uof:attrList">位置 格式 起始编号 编号方式</xsl:attribute>
+ <xsl:for-each select="/office:document/office:styles/text:notes-configuration[@text:note-class='footnote']">
+ <xsl:attribute name="字:位置"><xsl:choose><xsl:when test="@text:footnotes-position='page'">page-bottom</xsl:when><xsl:when test="@text:footnotes-position='document'">below-text</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="字:编号方式"><xsl:choose><xsl:when test="@text:start-numbering-at='document'">continuous</xsl:when><xsl:when test="@text:start-numbering-at='chapter'">section</xsl:when><xsl:when test="@text:start-numbering-at='page'">page</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="字:起始编号"><xsl:value-of select="@text:start-value + 1"/></xsl:attribute>
+ <xsl:attribute name="字:格式"><xsl:variable name="format"><xsl:value-of select="@style:num-format"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="/office:document/office:styles/text:notes-configuration[@text:note-class='endnote']">
+ <字:尾注设置 uof:locID="t0041" uof:attrList="格式 起始编号 编号方式">
+ <xsl:for-each select="/office:document/office:styles/text:notes-configuration[@text:note-class='endnote']">
+ <xsl:attribute name="字:格式"><xsl:variable name="format"><xsl:value-of select="@style:num-format"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="字:起始编号"><xsl:value-of select="@text:start-value + 1"/></xsl:attribute>
+ </xsl:for-each>
+ </字:尾注设置>
+ </xsl:if>
+ <xsl:if test="/office:document/office:styles/text:linenumbering-configuration">
+ <字:行号设置 uof:locID="t0043" uof:attrList="使用行号 编号方式 起始编号 距边界 行号间隔">
+ <xsl:for-each select="/office:document/office:styles/text:linenumbering-configuration">
+ <xsl:choose>
+ <xsl:when test="@text:number-lines='false'">
+ <xsl:attribute name="字:使用行号">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:使用行号">true</xsl:attribute>
+ <xsl:attribute name="字:编号方式"><xsl:choose><xsl:when test="@text:count-in-floating-frames='true'">section</xsl:when><xsl:when test="@text:restart-on-page='true'">page</xsl:when><xsl:when test="@text:count-empty-lines='false'"/><xsl:otherwise>continuous</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@style:num-format">
+ <xsl:attribute name="字:起始编号"><xsl:value-of select="@style:num-format"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@text:offset">
+ <xsl:attribute name="字:距边界"><xsl:value-of select="substring-before(@text:offset,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@text:increment">
+ <xsl:attribute name="字:行号间隔"><xsl:value-of select="@text:increment"/></xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ </字:行号设置>
+ </xsl:if>
+ <xsl:variable name="aa">
+ <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-ruby-height,$ooUnit)"/>
+ </xsl:variable>
+ <xsl:if test="style:page-layout-properties/@style:layout-grid-display and $aa='0' ">
+ <字:网格设置 uof:locID="t0044" uof:attrList="网格类型 宽度 高度 显示网格 打印网格">
+ <xsl:if test="style:page-layout-properties/@style:layout-grid-mode">
+ <xsl:attribute name="字:网格类型"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='both-nosnap'">line-char</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='both'">char</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='line'">line</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='none'">none</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:page-layout-properties/@style:layout-grid-base-width">
+ <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-width,$ooUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:page-layout-properties/@style:layout-grid-base-height">
+ <xsl:attribute name="字:高度"><xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-height,$ooUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:page-layout-properties/@style:layout-grid-display">
+ <xsl:attribute name="字:显示网格"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-display='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:page-layout-properties/@style:layout-grid-print">
+ <xsl:attribute name="字:打印网格"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-print='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </字:网格设置>
+ </xsl:if>
+ <xsl:if test="style:page-layout-properties/@style:layout-grid-display and not($aa = '0')">
+ <字:稿纸设置 uof:locID="t0211" uof:attrList="类型 格式 线型 颜色 方向">
+ <xsl:variable name="mode">
+ <xsl:value-of select="style:page-layout-properties/@style:layout-grid-mode"/>
+ </xsl:variable>
+ <xsl:variable name="ruby">
+ <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-ruby-height,$ooUnit)"/>
+ </xsl:variable>
+ <xsl:variable name="width">
+ <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-width,$ooUnit)"/>
+ </xsl:variable>
+ <xsl:variable name="height">
+ <xsl:value-of select="substring-before(style:page-layout-properties/@style:layout-grid-base-height,$ooUnit)"/>
+ </xsl:variable>
+ <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='line'">letter-paper</xsl:when><xsl:when test="style:page-layout-properties/@style:layout-grid-mode='both'">draft-paper</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="style:page-layout-properties/@style:layout-grid-mode">
+ <xsl:attribute name="字:格式"><xsl:choose><xsl:when test="$mode='both' and $width='0.728' and $height='0.728' and $ruby='0.496' ">fourth-gear</xsl:when><xsl:when test="$mode='both' and $width='0.584' and $height='0.584' and $ruby='0.64' ">third-gear</xsl:when><xsl:when test="$mode='both' and $width='0.728' and $height='0.728' and $ruby='0.905' ">second-gear</xsl:when><xsl:when test="$mode='both' and $width='0.728' and $height='0.728' and $ruby='1.633' ">first-gear</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:page-layout-properties/@style:layout-grid-color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select="style:page-layout-properties/@style:layout-grid-color"/></xsl:attribute>
+ </xsl:if>
+ </字:稿纸设置>
+ </xsl:if>
+ <xsl:if test="/office:document/office:automatic-styles/style:page-layout/style:page-layout-properties/@style:writing-mode='lr-tb' or style:text-properties/@style:writing-mode='rl-tb'">
+ <字:垂直对齐方式 uof:locID="t0045">
+ <xsl:variable name="path" select="/office:document/office:automatic-styles/style:style/style:paragraph-properties"/>
+ <xsl:choose>
+ <xsl:when test="$path/@fo:text-align='start'">top</xsl:when>
+ <xsl:when test="$path/@fo:text-align='end'">bottom</xsl:when>
+ <xsl:when test="$path/@fo:text-align='center'">center</xsl:when>
+ <xsl:otherwise>justified</xsl:otherwise>
+ </xsl:choose>
+ </字:垂直对齐方式>
+ </xsl:if>
+ <字:文字排列方向 uof:locID="t0046">
+ <xsl:variable name="writing_mode">
+ <xsl:value-of select="style:page-layout-properties/@style:writing-mode"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$writing_mode='lr-tb' or $writing_mode='lr'">hori-l2r</xsl:when>
+ <xsl:when test="$writing_mode='rl-tb' or $writing_mode='rl'">hori-r2l</xsl:when>
+ <xsl:when test="$writing_mode='tb-rl'">vert-r2l</xsl:when>
+ <xsl:when test="$writing_mode='tb-lr'">vert-l2r</xsl:when>
+ <xsl:otherwise>hori-l2r</xsl:otherwise>
+ </xsl:choose>
+ </字:文字排列方向>
+ <xsl:if test="style:page-layout-properties/@fo:border or style:page-layout-properties/@fo:border-top or style:page-layout-properties/@fo:border-bottom or style:page-layout-properties/@fo:border-left or style:page-layout-properties/@fo:border-right or style:page-layout-properties/@style:shadow[.!='none']">
+ <xsl:element name="字:边框">
+ <xsl:attribute name="uof:locID">t0047</xsl:attribute>
+ <xsl:for-each select="style:page-layout-properties">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:page-layout-properties/@fo:background-color">
+ <xsl:element name="字:填充">
+ <xsl:attribute name="uof:locID">t0048</xsl:attribute>
+ <xsl:for-each select="style:page-layout-properties">
+ <xsl:call-template name="图:填充"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:page-layout-properties/style:columns">
+ <xsl:element name="字:分栏">
+ <xsl:attribute name="uof:locID">t0049</xsl:attribute>
+ <xsl:attribute name="uof:attrList">栏数 等宽 分隔线 分隔线宽度 分隔线颜色</xsl:attribute>
+ <xsl:if test="//@fo:column-count">
+ <xsl:attribute name="字:栏数"><xsl:choose><xsl:when test="//@fo:column-count='0'">1</xsl:when><xsl:otherwise><xsl:value-of select="//@fo:column-count"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="第一宽度">
+ <xsl:value-of select="style:page-layout-properties/style:columns/style:column/@style:rel-width"/>
+ </xsl:variable>
+ <xsl:variable name="dkm">
+ <xsl:for-each select="style:page-layout-properties/style:columns/style:column">
+ <xsl:if test="$第一宽度 != @style:rel-width">
+ <xsl:value-of select="boolean($第一宽度 = @style:rel-width)"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="style:page-layout-properties/style:columns/@fo:column-gap">
+ <xsl:attribute name="字:等宽">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:等宽">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="style:page-layout-properties/style:columns/style:column-sep">
+ <xsl:attribute name="字:分隔线宽度"><xsl:value-of select="substring-before(style:page-layout-properties/style:columns/style:column-sep/@style:width,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:分隔线颜色"><xsl:value-of select="style:page-layout-properties/style:columns/style:column-sep/@style:color"/></xsl:attribute>
+ <xsl:attribute name="字:分隔线">single</xsl:attribute>
+ </xsl:if>
+ <xsl:for-each select="style:page-layout-properties/style:columns/style:column">
+ <xsl:element name="字:栏">
+ <xsl:variable name="left">
+ <xsl:value-of select="substring-before(@fo:start-indent,$uofUnit)"/>
+ </xsl:variable>
+ <xsl:variable name="right">
+ <xsl:value-of select="substring-before(@fo:end-indent,$uofUnit)"/>
+ </xsl:variable>
+ <xsl:if test="@style:rel-width">
+ <xsl:attribute name="字:宽度"><xsl:value-of select="substring-before(@style:rel-width,'*')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@fo:start-indent or @fo:end-indent">
+ <xsl:choose>
+ <xsl:when test="parent::style:columns/@fo:column-gap">
+ <xsl:attribute name="字:间距"><xsl:choose><xsl:when test="$left - $right &gt;0 "><xsl:value-of select="$left - $right"/></xsl:when><xsl:when test="$right - $left &gt; 0 "><xsl:value-of select="$right - $left"/></xsl:when><xsl:otherwise><xsl:value-of select="$right"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:间距"><xsl:value-of select="$right"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:attribute name="uof:locID">t0050</xsl:attribute>
+ <xsl:attribute name="uof:attrList">宽度 间距</xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ </字:节属性>
+ </字:分节>
+ </xsl:template>
+ <xsl:template match="office:text">
+ <xsl:for-each select="node( )">
+ <xsl:choose>
+ <xsl:when test="name()='text:list'or name()='text:ordered-list'">
+ <xsl:call-template name="unordered-ordered-list">
+ <xsl:with-param name="currlistlvl" select="number('1')"/>
+ <xsl:with-param name="liststylename" select="@text:style-name"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name()='text:p'or name()='text:h'">
+ <xsl:variable name="bs" select="./@text:style-name"/>
+ <xsl:if test="/office:document/office:automatic-styles/style:style[@style:name=$bs]/@style:master-page-name">
+ <xsl:variable name="bs1" select="/office:document/office:automatic-styles/style:style[@style:name=$bs]/@style:master-page-name"/>
+ <xsl:if test="/office:document/office:master-styles/style:master-page[@style:name=$bs1]/@style:page-layout-name">
+ <xsl:variable name="bs2" select="/office:document/office:master-styles/style:master-page[@style:name=$bs1]/@style:page-layout-name"/>
+ <xsl:for-each select="/office:document/office:automatic-styles/style:page-layout[@style:name=$bs2]">
+ <xsl:call-template name="style:page-layout"/>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:if>
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name()='table:table'">
+ <xsl:variable name="tbs" select="./@table:style-name"/>
+ <xsl:if test="/office:document/office:automatic-styles/style:style[@style:name=$tbs]/@style:master-page-name">
+ <xsl:variable name="tbs1" select="/office:document/office:automatic-styles/style:style[@style:name=$tbs]/@style:master-page-name"/>
+ <xsl:if test="/office:document/office:master-styles/style:master-page[@style:name=$tbs1]/@style:page-layout-name">
+ <xsl:variable name="tbs2" select="/office:document/office:master-styles/style:master-page[@style:name=$tbs1]/@style:page-layout-name"/>
+ <xsl:for-each select="/office:document/office:automatic-styles/style:page-layout[@style:name=$tbs2]">
+ <xsl:call-template name="style:page-layout"/>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:if>
+ <xsl:call-template name="exec_table"/>
+ </xsl:when>
+ <xsl:when test="name()='text:table-of-content'">
+ <xsl:call-template name="text:table-of-content"/>
+ </xsl:when>
+ <xsl:when test="name()='text:alphabetical-index'">
+ <xsl:call-template name="text:alphabetical-index"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="jiaozhu">
+ <字:脚注 uof:locID="t0107" uof:attrList="引文体">
+ <xsl:for-each select="text:note-citation">
+ <xsl:attribute name="字:引文体"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:for-each>
+ <xsl:for-each select="text:note-body/text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </字:脚注>
+ </xsl:template>
+ <xsl:template name="weizhu">
+ <字:尾注 uof:locID="t0108" uof:attrList="引文体">
+ <xsl:for-each select="text:note-citation">
+ <xsl:attribute name="字:引文体"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:for-each>
+ <xsl:for-each select="text:note-body/text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </字:尾注>
+ </xsl:template>
+ <xsl:template name="unordered-ordered-list">
+ <xsl:param name="currlistlvl"/>
+ <xsl:param name="liststylename"/>
+ <xsl:for-each select="text:list-item">
+ <xsl:if test="text:p">
+ <xsl:for-each select="text:p">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="$currlistlvl"/>
+ <xsl:with-param name="liststylename" select="$liststylename"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:for-each select="node( )">
+ <xsl:if test="name()='text:list'">
+ <xsl:call-template name="unordered-ordered-list">
+ <xsl:with-param name="currlistlvl" select="$currlistlvl +1"/>
+ <xsl:with-param name="liststylename" select="$liststylename"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="execParagraph">
+ <xsl:param name="currlistlvl"/>
+ <xsl:param name="liststylename"/>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <xsl:element name="字:段落属性">
+ <xsl:attribute name="uof:locID">t0052</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:if test="@text:style-name">
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(number($currlistlvl) =number('0'))">
+ <xsl:variable name="parent-position">
+ <xsl:number from="/office:document/office:body/office:text/text:list" level="any" count="text:list-item/text:p" format="1"/>
+ </xsl:variable>
+ <xsl:element name="字:自动编号信息">
+ <xsl:attribute name="uof:locID">t0059</xsl:attribute>
+ <xsl:attribute name="uof:attrList">编号引用 编号级别 重新编号 起始编号</xsl:attribute>
+ <xsl:attribute name="字:编号引用"><xsl:value-of select="$liststylename"/></xsl:attribute>
+ <xsl:attribute name="字:编号级别"><xsl:value-of select="$currlistlvl - 1"/></xsl:attribute>
+ <xsl:attribute name="字:重新编号"><xsl:choose><xsl:when test="number($parent-position)=number('1')">1</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="字:起始编号"><xsl:for-each select="/office:document//text:list-style[$liststylename=@style:name]/*[number($currlistlvl)=number(@text:level)]"><xsl:choose><xsl:when test="@text:start-value"><xsl:value-of select="@text:start-value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:for-each></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:variable name="stylename">
+ <xsl:value-of select="@text:style-name"/>
+ </xsl:variable>
+ <xsl:for-each select="/office:document//style:style">
+ <xsl:if test="@style:name=$stylename">
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="$stylename"/></xsl:attribute>
+ <xsl:call-template name="字:句属性"/>
+ </xsl:element>
+ <xsl:call-template name="ParaAttribute">
+ <xsl:with-param name="text-style-name" select="@style:name"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ <xsl:call-template name="textp"/>
+ <xsl:if test="parent::office:text and not(preceding-sibling::text:p) and preceding-sibling::*[substring-before(name(),':')='draw']">
+ <xsl:for-each select="preceding-sibling::*[substring-before(name(),':')='draw']">
+ <字:句 uof:locID="t0085">
+ <xsl:call-template name="字:锚点"/>
+ </字:句>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="draw:frame/draw:text-box/text:p">
+ <xsl:for-each select="draw:frame/draw:text-box/text:p">
+ <xsl:for-each select="child::*[substring-before(name(),':')='draw']">
+ <字:句 uof:locID="t0085">
+ <xsl:call-template name="字:锚点"/>
+ </字:句>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:variable name="aa">
+ <xsl:value-of select="@text:style-name"/>
+ </xsl:variable>
+ <xsl:if test="//office:document/office:automatic-styles/style:style[@style:name=$aa]/style:paragraph-properties/@fo:break-before='column'">
+ <字:句 uof:locID="t0085">
+ <xsl:element name="字:分栏符">
+ <xsl:attribute name="uof:locID">t0125</xsl:attribute>
+ </xsl:element>
+ </字:句>
+ </xsl:if>
+ <xsl:if test="//office:document/office:automatic-styles/style:style[@style:name=$aa]/style:paragraph-properties/@fo:break-before='page'">
+ <字:句 uof:locID="t0085">
+ <xsl:element name="字:分页符">
+ <xsl:attribute name="uof:locID">t0127</xsl:attribute>
+ </xsl:element>
+ </字:句>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/office:text/text:p/text:initial-creator">
+ <xsl:apply-templates select="text:initial-creator"/>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/office:text/text:p/text:title">
+ <xsl:apply-templates select="text:title"/>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/office:text/text:p/text:subject">
+ <xsl:apply-templates select="text:subject"/>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/office:text/text:p/text:file-name">
+ <xsl:apply-templates select="text:file-name"/>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/office:text/text:p/text:author-name">
+ <xsl:apply-templates select="text:author-name"/>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/office:text/text:p/text:author-initials">
+ <xsl:apply-templates select="text:author-initials"/>
+ </xsl:if>
+ <xsl:if test="/office:document/office:body/office:text/text:p/text:span/text:date">
+ <xsl:apply-templates select="text:date"/>
+ </xsl:if>
+ </字:段落>
+ </xsl:template>
+ <xsl:template name="ParaAttribute">
+ <xsl:param name="text-style-name"/>
+ <xsl:if test="substring-after(@style:display-name,'Heading')">
+ <xsl:element name="字:大纲级别">
+ <xsl:attribute name="uof:locID">t0054</xsl:attribute>
+ <xsl:value-of select="substring-after(@style:display-name,'Heading ')"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@fo:text-align or style:paragraph-properties/@style:vertical-align">
+ <xsl:element name="字:对齐">
+ <xsl:attribute name="uof:locID">t0055</xsl:attribute>
+ <xsl:attribute name="uof:attrList">水平对齐 文字对齐</xsl:attribute>
+ <xsl:attribute name="字:水平对齐"><xsl:choose><xsl:when test="style:paragraph-properties/@fo:text-align='end'">right</xsl:when><xsl:when test="style:paragraph-properties/@fo:text-align='center'">center</xsl:when><xsl:when test="style:paragraph-properties/@fo:text-align='justify' and not(style:paragraph-properties/@fo:text-align-last='justify')">justified</xsl:when><xsl:when test="style:paragraph-properties/@fo:text-align='justify' and style:paragraph-properties/@fo:text-align-last='justify'">distributed</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="字:文字对齐"><xsl:choose><xsl:when test="style:paragraph-properties/@style:vertical-align='baseline'">base</xsl:when><xsl:when test="style:paragraph-properties/@style:vertical-align='top'">top</xsl:when><xsl:when test="style:paragraph-properties/@style:vertical-align='middle'">center</xsl:when><xsl:when test="style:paragraph-properties/@style:vertical-align='bottom'">bottom</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@fo:margin-left or style:paragraph-properties/@fo:margin-right or style:paragraph-properties/@fo:text-indent">
+ <xsl:element name="字:缩进">
+ <xsl:attribute name="uof:locID">t0056</xsl:attribute>
+ <xsl:for-each select="style:paragraph-properties">
+ <xsl:call-template name="字:缩进类型"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:行距">
+ <xsl:attribute name="uof:locID">t0057</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 值</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="contains(style:paragraph-properties/@fo:line-height,$ooUnit)">
+ <xsl:attribute name="字:类型">fixed</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:line-height,$ooUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains(style:paragraph-properties/@fo:line-height,'%')">
+ <xsl:attribute name="字:类型">multi-lines</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:line-height,'%') div 100"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="style:paragraph-properties/@style:line-height-at-least">
+ <xsl:attribute name="字:类型">at-least</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@style:line-height-at-least,$ooUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="style:paragraph-properties/@style:line-spacing">
+ <xsl:attribute name="字:类型">line-space</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@style:line-spacing,$ooUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:类型">multi-lines</xsl:attribute>
+ <xsl:attribute name="字:值">1.0</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="style:paragraph-properties/@fo:widows">
+ <xsl:element name="字:孤行控制">
+ <xsl:attribute name="uof:locID">t0060</xsl:attribute>
+ <xsl:value-of select="style:paragraph-properties/@fo:widows"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@fo:orphans">
+ <xsl:element name="字:寡行控制">
+ <xsl:attribute name="uof:locID">t0061</xsl:attribute>
+ <xsl:value-of select="style:paragraph-properties/@fo:orphans"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:段中不分页">
+ <xsl:attribute name="uof:locID">t0062</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@fo:keep-together='always'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:if test="style:paragraph-properties/@fo:keep-with-next">
+ <xsl:element name="字:与下段同页">
+ <xsl:attribute name="uof:locID">t0063</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@fo:break-before">
+ <xsl:element name="字:段前分页">
+ <xsl:attribute name="uof:locID">t0064</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@style:snap-to-layout-grid">
+ <xsl:element name="字:对齐网格">
+ <xsl:attribute name="uof:locID">t0069</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:snap-to-layout-grid='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/style:drop-cap/@style:lines">
+ <xsl:element name="字:首字下沉">
+ <xsl:attribute name="uof:locID">t0070</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 字体引用 字符数 行数 间距</xsl:attribute>
+ <xsl:attribute name="字:类型">dropped</xsl:attribute>
+ <xsl:if test="style:paragraph-properties/style:drop-cap/@style:style-name">
+ <xsl:attribute name="字:字体引用"><xsl:value-of select="translate(style:paragraph-properties/style:drop-cap/@style:style-name,' ','_')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="字:间距"><xsl:choose><xsl:when test="style:paragraph-properties/style:drop-cap/@style:distance"><xsl:value-of select="substring-before(style:paragraph-properties/style:drop-cap/@style:distance,$ooUnit)"/></xsl:when><xsl:otherwise>0.00</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="style:paragraph-properties/style:drop-cap/@style:length">
+ <xsl:attribute name="字:字符数"><xsl:value-of select="style:paragraph-properties/style:drop-cap/@style:length"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/style:drop-cap/@style:lines">
+ <xsl:attribute name="字:行数"><xsl:value-of select="style:paragraph-properties/style:drop-cap/@style:lines"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:取消断字">
+ <xsl:attribute name="uof:locID">t0071</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@fo:hyphenate"><xsl:value-of select="style:paragraph-properties/@fo:hyphenate"/></xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:取消行号">
+ <xsl:attribute name="uof:locID">t0072</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:variable name="aa">
+ <xsl:value-of select="style:paragraph-properties/@text:number-lines"/>
+ </xsl:variable>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="$aa='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:允许单词断字">
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0073</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ <xsl:if test="style:paragraph-properties/@style:punctuation-wrap">
+ <xsl:element name="字:行首尾标点控制">
+ <xsl:attribute name="uof:locID">t0074</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:punctuation-wrap='hanging'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:是否行首标点压缩">
+ <xsl:attribute name="uof:locID">t0075</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">false</xsl:attribute>
+ </xsl:element>
+ <xsl:if test="style:paragraph-properties/@style:line-break ">
+ <xsl:element name="字:中文习惯首尾字符">
+ <xsl:attribute name="uof:locID">t0076</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:line-break='strict'">true</xsl:when><xsl:when test="style:paragraph-properties/@style:line-break='normal'">false</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@style:text-autospace">
+ <xsl:element name="字:自动调整中英文字符间距">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:text-autospace='ideograph-alpha'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0077</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@style:text-autospace">
+ <xsl:element name="字:自动调整中文与数字间距">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:paragraph-properties/@style:text-autospace='ideograph-alpha'">true </xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0078</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:有网格自动调整右缩进">
+ <xsl:attribute name="字:值">false</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0195</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ <xsl:if test="style:paragraph-properties/@fo:border or style:paragraph-properties/@fo:border-top or style:paragraph-properties/@fo:border-bottom or style:paragraph-properties/@fo:border-left or style:paragraph-properties/@fo:border-right or style:paragraph-properties/@style:shadow[.!='none']">
+ <xsl:element name="字:边框">
+ <xsl:attribute name="uof:locID">t0065</xsl:attribute>
+ <xsl:for-each select="style:paragraph-properties">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@fo:background-color">
+ <xsl:element name="字:填充">
+ <xsl:attribute name="uof:locID">t0066</xsl:attribute>
+ <xsl:for-each select="style:paragraph-properties">
+ <xsl:call-template name="图:填充"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@fo:margin-top or style:paragraph-properties/@fo:margin-bottom">
+ <字:段间距 uof:locID="t0058">
+ <xsl:if test="style:paragraph-properties/@fo:margin-top">
+ <字:段前距 uof:locID="t0196">
+ <字:绝对值 uof:locID="t0199" uof:attrList="值">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
+ </字:绝对值>
+ </字:段前距>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/@fo:margin-bottom">
+ <字:段后距 uof:locID="t0197">
+ <字:绝对值 uof:locID="t0202" uof:attrList="值">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(style:paragraph-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
+ </字:绝对值>
+ </字:段后距>
+ </xsl:if>
+ </字:段间距>
+ </xsl:if>
+ <xsl:if test="style:paragraph-properties/style:tab-stops">
+ <xsl:element name="字:制表位设置">
+ <xsl:attribute name="uof:locID">t0067</xsl:attribute>
+ <xsl:for-each select="style:paragraph-properties/style:tab-stops/style:tab-stop">
+ <xsl:element name="字:制表位">
+ <xsl:attribute name="uof:locID">t0068</xsl:attribute>
+ <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
+ <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(@style:position,$ooUnit)"/></xsl:attribute>
+ <xsl:variable name="aa">
+ <xsl:value-of select="@style:type"/>
+ </xsl:variable>
+ <xsl:variable name="zbflx">
+ <xsl:choose>
+ <xsl:when test="$aa='right'">right</xsl:when>
+ <xsl:when test="$aa='center'">center</xsl:when>
+ <xsl:when test="$aa='char'and @style:char!=''">decimal</xsl:when>
+ <xsl:otherwise>left</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="字:类型"><xsl:value-of select="$zbflx"/></xsl:attribute>
+ <xsl:attribute name="字:制表位字符"><xsl:value-of select="@style:leader-text"/></xsl:attribute>
+ <xsl:if test="@style:leader-style">
+ <xsl:attribute name="字:前导符"><xsl:value-of select="@style:leader-style"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="text:s">
+ <xsl:param name="bText"/>
+ <xsl:choose>
+ <xsl:when test="$bText='0'">
+ <xsl:variable name="count">
+ <xsl:choose>
+ <xsl:when test="not(@text:c)">1</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@text:c"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <字:句 uof:locID="t0085">
+ <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{$count}"/>
+ </字:句>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:空格符 uof:locID="t0126" uof:attrList="个数" 字:个数="{@text:c}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="textp" match="text:p">
+ <xsl:variable name="parentstyle">
+ <xsl:value-of select="@text:style-name"/>
+ </xsl:variable>
+ <xsl:for-each select="node( )">
+ <xsl:choose>
+ <xsl:when test="self::node()[name(.)='text:span']">
+ <xsl:call-template name="textspan"/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:sequence']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()/draw:text-box/text:p/text:sequence">
+ <xsl:for-each select="draw:text-box/text:p/node()">
+ <xsl:choose>
+ <xsl:when test="self::node()[name(.)='text:sequence']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="not(self::node()[substring-before(name(.),':')='draw'])">
+ <xsl:call-template name="字:句">
+ <xsl:with-param name="parentstyle" select="$parentstyle"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:date']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:time']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:s']">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="bText" select="0"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:file-name']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:chapter']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:editing-duration']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:creation-time']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:creation-date']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:character-count']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:page-count']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:page-number']">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="substring-before(name(.),':')='draw' and not(name(.)='draw:a')">
+ <字:句 uof:locID="t0085">
+ <xsl:call-template name="字:锚点"/>
+ </字:句>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:note']/@text:note-class='footnote'">
+ <字:句 uof:locID="t0085">
+ <xsl:call-template name="jiaozhu"/>
+ </字:句>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:note']/@text:note-class='endnote'">
+ <字:句 uof:locID="t0085">
+ <xsl:call-template name="weizhu"/>
+ </字:句>
+ </xsl:when>
+ <xsl:when test="name(.)='text:alphabetical-index-mark-start'">
+ <xsl:element name="字:句">
+ <xsl:element name="字:区域开始">
+ <xsl:attribute name="uof:locId">t0121</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
+ <xsl:attribute name="字:类型">user-data</xsl:attribute>
+ <xsl:attribute name="字:名称"><xsl:value-of select="@text:string-value-phonetic"/></xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="name(.)='text:alphabetical-index-mark-end'">
+ <xsl:element name="字:句">
+ <xsl:element name="字:区域结束" uof:locID="t0122" uof:attrList="标识符引用">
+ <xsl:attribute name="字:标识符引用"><xsl:value-of select="@text:id"/></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="name(.)='text:bookmark' ">
+ <字:句 uof:locID="t0085">
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ </xsl:element>
+ <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型" 字:名称="{@text:name}" 字:类型="bookmark" 字:标识符="{generate-id()}"/>
+ <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用" 字:标识符引用="{generate-id()}"/>
+ </字:句>
+ </xsl:when>
+ <xsl:when test="name(.)='text:a'">
+ <字:句 uof:locID="t0085">
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:区域开始">
+ <xsl:attribute name="字:标识符">hlnk<xsl:number from="/office:document/office:body/office:text" level="any" count="text:a"/></xsl:attribute>
+ <xsl:attribute name="字:名称">Hyperlink</xsl:attribute>
+ <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0121</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="."/>
+ </xsl:element>
+ <xsl:element name="字:区域结束">
+ <xsl:attribute name="字:标识符引用">hlnk<xsl:number from="/office:document/office:body/office:text" level="any" count="text:a"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0122</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
+ </xsl:element>
+ </字:句>
+ </xsl:when>
+ <xsl:when test="name(.)='office:annotation'">
+ <字:句 uof:locID="t0085">
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:区域开始">
+ <xsl:attribute name="字:标识符">cmt<xsl:number from="/office:document/office:body/office:text" level="any" count="office:annotation"/></xsl:attribute>
+ <xsl:attribute name="字:名称">Comment</xsl:attribute>
+ <xsl:attribute name="字:类型">annotation</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0121</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:区域结束">
+ <xsl:attribute name="字:标识符引用">cmt<xsl:number from="/office:document/office:body/office:text" level="any" count="office:annotation"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0122</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
+ </xsl:element>
+ </字:句>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:change-start'] or self::node()[name(.)='text:change'] or self::node()[name(.)='text:change-end']">
+ <xsl:call-template name="xiuding"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="字:句">
+ <xsl:with-param name="parentstyle" select="$parentstyle"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="xiuding">
+ <xsl:choose>
+ <xsl:when test="self::node()[name(.)='text:change-start']or self::node()[name(.)='text:change']">
+ <xsl:variable name="changeID">
+ <xsl:value-of select="@text:change-id"/>
+ </xsl:variable>
+ <xsl:for-each select="/office:document/office:body/office:text/text:tracked-changes/text:changed-region">
+ <xsl:if test="$changeID=@text:id">
+ <xsl:choose>
+ <xsl:when test="text:insertion">
+ <xsl:element name="字:修订开始">
+ <xsl:attribute name="uof:locID">t0206</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
+ <xsl:attribute name="字:类型">insert</xsl:attribute>
+ <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@text:id"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="text:format-change">
+ <xsl:element name="字:修订开始">
+ <xsl:attribute name="uof:locID">t0206</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
+ <xsl:attribute name="字:类型">format</xsl:attribute>
+ <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@text:id"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="text:deletion">
+ <xsl:element name="字:修订开始">
+ <xsl:attribute name="uof:locID">t0206</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 类型 修订信息引用</xsl:attribute>
+ <xsl:attribute name="字:标识符"><xsl:value-of select="@text:id"/></xsl:attribute>
+ <xsl:attribute name="字:类型">delete</xsl:attribute>
+ <xsl:attribute name="字:修订信息引用"><xsl:value-of select="@text:id"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="self::node()[name(.)='text:change-end']">
+ <xsl:variable name="changeendID">
+ <xsl:value-of select="@text:change-id"/>
+ </xsl:variable>
+ <xsl:for-each select="/office:document/office:body/office:text/text:tracked-changes/text:changed-region">
+ <xsl:if test="$changeendID=@text:id">
+ <xsl:choose>
+ <xsl:when test="text:insertion">
+ <xsl:element name="字:修订结束">
+ <xsl:attribute name="uof:locID">t0207</xsl:attribute>
+ <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
+ <xsl:attribute name="字:开始标识引用"><xsl:value-of select="@text:id"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="text:deletion">
+ <xsl:element name="字:修订结束">
+ <xsl:attribute name="uof:locID">t0207</xsl:attribute>
+ <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
+ <xsl:attribute name="字:开始标识引用"><xsl:value-of select="@text:id"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="text:format-change">
+ <xsl:element name="字:修订结束">
+ <xsl:attribute name="uof:locID">t0207</xsl:attribute>
+ <xsl:attribute name="uof:attrList">开始标识引用</xsl:attribute>
+ <xsl:attribute name="字:开始标识引用"><xsl:value-of select="@text:id"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="字:句">
+ <xsl:param name="parentstyle"/>
+ <xsl:if test="not(name(.)='text:bookmark-start' or name(.)='text:bookmark-end' or name(.)='draw:image' or name(.)='office:binary-data' or name(.)='text:page-number' or name(.)='text:page-count' or name(.)='text:initial-creator' or name(.)='text:author-name' or name(.)='text:author-initials' or name(.)='text:creation-time' or name(.)='text:creation-date' or name(.)='text:title' or name(.)='text:subject' or name(.)='text:file-name' or name(.)='text:editing-duration' or name(.)='text:character-count' or name(.)='text:chapter')">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
+ <xsl:choose>
+ <xsl:when test="@text:style-name">
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="parent::text:h/@text:outline-level">
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="concat('Heading_20_',parent::text:h/@text:outline-level)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="parent::node()/@text:style-name">
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="parent::node( )/@text:style-name"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </字:句属性>
+ <xsl:if test="ancestor::text:note-body">
+ <字:引文符号>
+ <xsl:value-of select="ancestor::text:note/text:note-citation"/>
+ </字:引文符号>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="(preceding-sibling::text:bookmark-start) and (following-sibling::text:bookmark-end)">
+ <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
+ <xsl:attribute name="字:标识符"><xsl:value-of select="preceding-sibling::text:bookmark-start/@text:name"/></xsl:attribute>
+ <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
+ <xsl:attribute name="字:类型">bookmark</xsl:attribute>
+ </字:区域开始>
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="string(.)"/>
+ </xsl:element>
+ <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
+ <xsl:attribute name="字:标识符引用"><xsl:value-of select="following-sibling::text:bookmark-end/@text:name"/></xsl:attribute>
+ </字:区域结束>
+ </xsl:when>
+ <xsl:when test="name(.)='draw:a'">
+ <xsl:variable name="link-name">
+ <xsl:value-of select="substring-after(@xlink:href,'#')"/>
+ </xsl:variable>
+ <字:区域开始 uof:locID="t0121" uof:attrList="标识符 名称 类型">
+ <xsl:attribute name="字:标识符"><xsl:value-of select="$link-name"/></xsl:attribute>
+ <xsl:attribute name="字:名称">Bookmark</xsl:attribute>
+ <xsl:attribute name="字:类型">bookmark</xsl:attribute>
+ </字:区域开始>
+ <xsl:call-template name="字:锚点"/>
+ <字:区域结束 uof:locID="t0122" uof:attrList="标识符引用">
+ <xsl:attribute name="字:标识符引用"><xsl:value-of select="$link-name"/></xsl:attribute>
+ </字:区域结束>
+ </xsl:when>
+ <xsl:when test="self::node( )[name(.)='text:tab']">
+ <xsl:element name="字:制表符">
+ <xsl:attribute name="uof:locID">t0123</xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="self::node( )[name(.)='text:line-break']">
+ <xsl:element name="字:换行符">
+ <xsl:attribute name="uof:locID">t0124</xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="name(.)='text:bookmark-start' or name(.)='text:bookmark-end' or name(.)='draw:image' or name(.)='office:binary-data'">
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="string(.)"/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:句>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="draw:text-box">
+ <xsl:apply-templates/>
+ </xsl:template>
+ <xsl:template name="text">
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="parent::node( )/@text:style-name"/></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="string(.)"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="textspan">
+ <字:句 uof:locID="t0085">
+ <xsl:choose>
+ <xsl:when test="./text:note/@text:note-class='footnote'">
+ <xsl:for-each select="text:note">
+ <xsl:call-template name="jiaozhu"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="./text:note/@text:note-class='endnote'">
+ <xsl:for-each select="text:note">
+ <xsl:call-template name="weizhu"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="字:句属性">
+ <xsl:attribute name="uof:locID">t0086</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:variable name="textstyle">
+ <xsl:value-of select="@text:style-name"/>
+ </xsl:variable>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ <xsl:for-each select="/office:document/office:automatic-styles//style:style[@style:family='text']">
+ <xsl:if test="@style:name=$textstyle and not(@style:parent-style-name='Standard')">
+ <xsl:if test="@style:parent-style-name=/office:document/office:styles/style:style/@style:name">
+ <xsl:call-template name="SentenceXD">
+ <xsl:with-param name="Sentencestyle" select="@style:parent-style-name"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="/office:document/office:automatic-styles//style:style[@style:family='text']">
+ <xsl:if test="@style:name=$textstyle">
+ <xsl:call-template name="SentenceXD">
+ <xsl:with-param name="Sentencestyle" select="@style:name"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="string(.)"/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:句>
+ </xsl:template>
+ <xsl:template name="SentenceXD">
+ <xsl:param name="Sentencestyle"/>
+ </xsl:template>
+ <xsl:template name="字:锚点">
+ <xsl:if test="not(name(.)='draw:glue-point')">
+ <xsl:variable name="name">
+ <xsl:value-of select="name(.)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="name='draw:a'">
+ <xsl:for-each select="child::node( )">
+ <xsl:call-template name="字:锚点"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$name = 'draw:g'">
+ <xsl:for-each select="child::*">
+ <xsl:call-template name="字:锚点"/>
+ </xsl:for-each>
+ </xsl:if>
+ <字:锚点 uof:locID="t0110" uof:attrList="标识符 类型">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='as-char'">
+ <xsl:attribute name="字:类型">inline</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:类型">normal</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <字:锚点属性 uof:locID="t0111">
+ <字:宽度 uof:locID="t0112">
+ <xsl:choose>
+ <xsl:when test="@svg:width">
+ <xsl:value-of select="substring-before(@svg:width,$uofUnit)"/>
+ </xsl:when>
+ <xsl:when test="@svg:x1">
+ <xsl:value-of select="substring-before(@svg:x2,$uofUnit) - substring-before(@svg:x1,$uofUnit)"/>
+ </xsl:when>
+ </xsl:choose>
+ </字:宽度>
+ <字:高度 uof:locID="t0113">
+ <xsl:choose>
+ <xsl:when test="@svg:height">
+ <xsl:value-of select="substring-before(@svg:height,$uofUnit)"/>
+ </xsl:when>
+ <xsl:when test="@svg:x1">
+ <xsl:value-of select="substring-before(@svg:y2,$uofUnit) - substring-before(@svg:y1,$uofUnit)"/>
+ </xsl:when>
+ <xsl:when test="child::draw:text-box/@fo:min-height">
+ <xsl:value-of select="substring-before(child::draw:text-box/@fo:min-height,$uofUnit)"/>
+ </xsl:when>
+ </xsl:choose>
+ </字:高度>
+ <xsl:if test="not(@text:anchor-type='as-char')">
+ <字:位置 uof:locID="t0114">
+ <字:水平 uof:locID="t0176" uof:attrList="相对于">
+ <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
+ <xsl:attribute name="字:相对于"><xsl:choose><xsl:when test="@style:horizontal-rel='page'">page</xsl:when><xsl:when test="@style:horizontal-rel='paragraph'">margin</xsl:when><xsl:when test="@style:horizontal-rel='page-content'">margin</xsl:when><xsl:when test="@style:horizontal-rel='paragraph-content'">margin</xsl:when><xsl:when test="@style:horizontal-rel='char'">char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="@svg:x or @svg:x1">
+ <字:绝对 uof:locID="t0177" uof:attrList="值">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@svg:x"><xsl:value-of select="substring-before(@svg:x,$uofUnit)"/></xsl:when><xsl:when test="@svg:x1"><xsl:value-of select="substring-before(@svg:x1,$uofUnit)"/></xsl:when></xsl:choose></xsl:attribute>
+ </字:绝对>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:相对 uof:locID="t0178" uof:attrList="参考点 值">
+ <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:horizontal-pos='left'">left</xsl:when><xsl:when test="@style:horizontal-pos='right'">right</xsl:when><xsl:when test="@style:horizontal-pos='center'">center</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:for-each>
+ </字:相对>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:水平>
+ <字:垂直 uof:locID="t0179" uof:attrList="相对于">
+ <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
+ <xsl:attribute name="字:相对于"><xsl:choose><xsl:when test="@style:vertical-rel='page'">page</xsl:when><xsl:when test="@style:vertical-rel='paragraph'">paragraph</xsl:when><xsl:when test="@style:vertical-rel='page-content'">margin</xsl:when><xsl:when test="@style:vertical-rel='paragraph-content'">margin</xsl:when><xsl:when test="@style:vertical-rel='line'">line</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="@svg:y or @svg:y1">
+ <字:绝对 uof:locID="t0180" uof:attrList="值">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@svg:y"><xsl:value-of select="substring-before(@svg:y,$uofUnit)"/></xsl:when><xsl:when test="@svg:y1"><xsl:value-of select="substring-before(@svg:y1,$uofUnit)"/></xsl:when></xsl:choose></xsl:attribute>
+ </字:绝对>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:相对 uof:locID="t0181" uof:attrList="参考点 值">
+ <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:vertical-pos='bottom'">bottom</xsl:when><xsl:when test="@style:vertical-pos='top'">top</xsl:when><xsl:when test="@style:vertical-pos='middle'">center</xsl:when><xsl:when test="@style:vertical-pos='below'">inside</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:for-each>
+ </字:相对>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:垂直>
+ </字:位置>
+ </xsl:if>
+ <xsl:for-each select="key('graphicset',@draw:style-name)/style:graphic-properties">
+ <字:绕排 uof:locID="t0115" uof:attrList="绕排方式 环绕文字 绕排顶点">
+ <xsl:variable name="wrap_type1">
+ <xsl:value-of select="@style:wrap"/>
+ </xsl:variable>
+ <xsl:variable name="wrap_type2">
+ <xsl:value-of select="@style:run-through"/>
+ </xsl:variable>
+ <xsl:variable name="a">
+ <xsl:value-of select="@style:number-wrapped-paragraphs"/>
+ </xsl:variable>
+ <xsl:if test="$wrap_type1">
+ <xsl:attribute name="字:绕排方式"><xsl:choose><xsl:when test="$wrap_type1='run-through' and $wrap_type2='background' ">behindtext</xsl:when><xsl:when test="$wrap_type1='run-through' and $a='1'">infrontoftext</xsl:when><xsl:when test="$wrap_type1='run-through'">through</xsl:when><xsl:when test="$wrap_type1='dynamic' ">top-bottom</xsl:when><xsl:when test="$wrap_type1='parallel' ">square</xsl:when><xsl:when test="$wrap_type1='left' or $wrap_type1='right'">tight</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$wrap_type1='left' or $wrap_type1='right'">
+ <xsl:attribute name="字:环绕文字"><xsl:choose><xsl:when test="$wrap_type1='left'">left</xsl:when><xsl:when test="$wrap_type1='right'">right</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </字:绕排>
+ <字:边距 uof:locID="t0116" uof:attrList="上 左 右 下">
+ <xsl:choose>
+ <xsl:when test="@fo:margin-top">
+ <xsl:attribute name="字:上"><xsl:value-of select="substring-before(@fo:margin-top,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:下"><xsl:value-of select="substring-before(@fo:margin-bottom,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:上">0.0</xsl:attribute>
+ <xsl:attribute name="字:下">0.0</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@fo:margin-right">
+ <xsl:attribute name="字:右"><xsl:value-of select="substring-before(@fo:margin-right,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:左"><xsl:value-of select="substring-before(@fo:margin-left,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:右">0.0</xsl:attribute>
+ <xsl:attribute name="字:左">0.0</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:边距>
+ <字:锁定 uof:attrList="值" uof:locID="t0117">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@draw:move-protect='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ </字:锁定>
+ <字:保护 uof:locID="t0118" uof:attrList="值">
+ <xsl:choose>
+ <xsl:when test="$name='draw:image' or $name='draw:text-box'">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:protect = 'content size position' or @style:protect = 'content' or @style:protect = 'content size' or @style:protect = 'size position' or @style:protect = 'size' or @style:protect = 'position' or @style:protect = 'content position' and @draw:size-protect= 'true'and @draw:move-protect= 'true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:protect = 'position size'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:保护>
+ </xsl:for-each>
+ <字:允许重叠 uof:locID="t0119" uof:attrList="值" 字:值="true"/>
+ </字:锚点属性>
+ <字:图形 uof:locID="t0120" uof:attrList="图形引用">
+ <xsl:variable name="refpicname">
+ <xsl:if test="@draw:style-name">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="picnumber">
+ <xsl:if test="@draw:style-name">
+ <xsl:value-of select="count(preceding::*[@draw:style-name=$refpicname])"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:attribute name="字:图形引用"><xsl:value-of select="concat($refpicname,'_',$picnumber)"/></xsl:attribute>
+ </字:图形>
+ </字:锚点>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="liekuan">
+ <xsl:param name="count"/>
+ <xsl:param name="width"/>
+ <xsl:if test="$count &gt; 0">
+ <字:列宽 uof:locID="t0132">
+ <xsl:value-of select="$width"/>
+ </字:列宽>
+ <xsl:call-template name="liekuan">
+ <xsl:with-param name="count" select="$count -1"/>
+ <xsl:with-param name="width" select="$width"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="exec_table" match="table:table">
+ <xsl:param name="tabletype"/>
+ <字:文字表 uof:locID="t0128" uof:attrList="类型">
+ <xsl:choose>
+ <xsl:when test="@table:is-sub-table='true'">
+ <xsl:attribute name="字:类型">sub-table</xsl:attribute>
+ <xsl:element name="字:文字表属性">
+ <xsl:attribute name="uof:locID">t0129</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:element name="字:列宽集">
+ <xsl:attribute name="uof:locID">t0131</xsl:attribute>
+ <xsl:for-each select="table:table-column">
+ <xsl:variable name="tableColName" select="@table:style-name"/>
+ <xsl:variable name="colWidth" select="substring-before(//style:style[@style:name=$tableColName and @style:family='table-column']/style:table-column-properties/@style:column-width,$ooUnit)"/>
+ <xsl:choose>
+ <xsl:when test="@table:number-columns-repeated">
+ <xsl:call-template name="liekuan">
+ <xsl:with-param name="count" select="@table:number-columns-repeated"/>
+ <xsl:with-param name="width" select="$colWidth"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:列宽 uof:locID="t0132">
+ <xsl:value-of select="$colWidth"/>
+ </字:列宽>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:类型">table</xsl:attribute>
+ <xsl:element name="字:文字表属性">
+ <xsl:attribute name="uof:locID">t0129</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@table:style-name"/></xsl:attribute>
+ <xsl:variable name="tableName" select="@table:style-name"/>
+ <xsl:element name="字:列宽集">
+ <xsl:attribute name="uof:locID">t0131</xsl:attribute>
+ <xsl:for-each select="table:table-column">
+ <xsl:variable name="tableColName" select="@table:style-name"/>
+ <xsl:variable name="colWidth" select="substring-before(//style:style[@style:name=$tableColName and @style:family='table-column']/style:table-column-properties/@style:column-width,$ooUnit)"/>
+ <xsl:choose>
+ <xsl:when test="@table:number-columns-repeated">
+ <xsl:call-template name="liekuan">
+ <xsl:with-param name="count" select="@table:number-columns-repeated"/>
+ <xsl:with-param name="width" select="$colWidth"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <字:列宽 uof:locID="t0132">
+ <xsl:value-of select="$colWidth"/>
+ </字:列宽>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:element>
+ <xsl:for-each select="key('set_styleStyle',$tableName)">
+ <xsl:element name="字:宽度">
+ <xsl:attribute name="uof:locID">t0130</xsl:attribute>
+ <xsl:attribute name="uof:attrList">绝对宽度 相对宽度</xsl:attribute>
+ <xsl:attribute name="字:绝对宽度"><xsl:value-of select="substring-before(style:table-properties/@style:width,$ooUnit)"/></xsl:attribute>
+ <xsl:if test="style:table-properties/@style:rel-width">
+ <xsl:attribute name="字:相对宽度"><xsl:value-of select="substring-before(style:table-properties/@style:rel-width,'%') div 100"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:element name="字:对齐">
+ <xsl:attribute name="uof:locID">t0133</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="style:table-properties/@table:align='right'">right</xsl:when>
+ <xsl:when test="style:table-properties/@table:align='center'">center</xsl:when>
+ <xsl:otherwise>left</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="style:table-properties/@fo:margin-left">
+ <xsl:element name="字:左缩进">
+ <xsl:attribute name="uof:locID">t0134</xsl:attribute>
+ <xsl:value-of select="substring-before(style:table-properties/@fo:margin-left,$ooUnit)"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:绕排">
+ <xsl:attribute name="uof:locID">t0135</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">around</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:边框">
+ <xsl:attribute name="uof:locID">t0137</xsl:attribute>
+ <xsl:for-each select="style:table-properties">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:for-each>
+ </xsl:element>
+ <xsl:if test="style:table-properties/style:background-image/office:binary-data or style:table-properties/@fo:background-color or style:page-layout-properties/@fo:background-color">
+ <字:填充 uof:locID="t0138">
+ <xsl:for-each select="style:table-properties">
+ <xsl:call-template name="图:填充">
+ <xsl:with-param name="style-name" select="$tableName"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </字:填充>
+ </xsl:if>
+ <xsl:element name="字:绕排边距">
+ <xsl:attribute name="uof:locID">t0139</xsl:attribute>
+ <xsl:attribute name="uof:attrList">上 左 右 下</xsl:attribute>
+ <xsl:if test="style:table-properties/@fo:margin-top">
+ <xsl:attribute name="字:上"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-top,$ooUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:table-properties/@fo:margin-left">
+ <xsl:attribute name="字:左"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-left,$ooUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:table-properties/@fo:margin-right">
+ <xsl:attribute name="字:右"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-right,$ooUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:table-properties/@fo:margin-bottom">
+ <xsl:attribute name="字:下"><xsl:value-of select="substring-before(style:table-properties/@fo:margin-bottom,$ooUnit)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:element name="字:自动调整大小">
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0140</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:默认单元格边距">
+ <xsl:attribute name="uof:locID">t0141</xsl:attribute>
+ <xsl:attribute name="uof:attrList">上 左 右 下</xsl:attribute>
+ <xsl:attribute name="字:上">0.10</xsl:attribute>
+ <xsl:attribute name="字:左">0.10</xsl:attribute>
+ <xsl:attribute name="字:右">0.10</xsl:attribute>
+ <xsl:attribute name="字:下">0.10</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:默认单元格间距">
+ <xsl:attribute name="uof:locID">t0142</xsl:attribute>
+ <xsl:value-of select="'0.00'"/>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates select="table:table-header-rows/table:table-row"/>
+ <xsl:apply-templates select="table:table-row"/>
+ </字:文字表>
+ </xsl:template>
+ <xsl:key name="set_colWidth" match="//office:automatic-styles/style:style[@style:family='table-column']" use="@style:name"/>
+ <xsl:key name="set_styleStyle" match="//office:automatic-styles/style:style" use="@style:name"/>
+ <xsl:template match="table:table-row">
+ <xsl:element name="字:行">
+ <xsl:attribute name="uof:locID">t0143</xsl:attribute>
+ <xsl:variable name="rowStyleName" select="@table:style-name|table:table-row/@table:style-name"/>
+ <xsl:element name="字:表行属性">
+ <xsl:attribute name="uof:locID">t0144</xsl:attribute>
+ <xsl:for-each select="key('set_styleStyle',$rowStyleName)/style:table-row-properties[@style:row-height or @style:min-row-height]">
+ <xsl:element name="字:高度">
+ <xsl:if test="@style:row-height">
+ <xsl:attribute name="字:固定值"><xsl:value-of select="substring-before(@style:row-height,$ooUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@style:min-row-height">
+ <xsl:attribute name="字:最小值"><xsl:value-of select="substring-before(@style:min-row-height,$ooUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="uof:locID">t0145</xsl:attribute>
+ <xsl:attribute name="uof:attrList">固定值 最小值</xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:if test="key('set_styleStyle',$rowStyleName)/style:table-row-properties[@style:keep-together]">
+ <xsl:element name="字:跨页">
+ <xsl:attribute name="uof:locID">t0146</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:for-each select="key('set_styleStyle',$rowStyleName)/style:table-row-properties[@style:keep-together]">
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="@style:keep-together='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="name(..)='table:table-header-rows'">
+ <xsl:element name="字:表头行">
+ <xsl:attribute name="uof:locID">t0147</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="name()='table:table-cell'">
+ <xsl:element name="字:单元格">
+ <xsl:attribute name="uof:locID">t0148</xsl:attribute>
+ <xsl:call-template name="execTableCellAttribute"/>
+ <xsl:for-each select="node( )">
+ <xsl:choose>
+ <xsl:when test="name()='text:p'">
+ <xsl:call-template name="execParagraph">
+ <xsl:with-param name="currlistlvl" select="number('0')"/>
+ <xsl:with-param name="liststylename" select="string('00000')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name()='table:table' or name()='table:sub-table' or self::node()/@table:is-sub-table='true'">
+ <xsl:call-template name="exec_table">
+ <xsl:with-param name="tabletype" select="name()"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="execTableCellAttribute">
+ <xsl:element name="字:单元格属性">
+ <xsl:attribute name="uof:locID">t0149</xsl:attribute>
+ <xsl:variable name="StyleName" select="@table:style-name"/>
+ <xsl:element name="字:宽度">
+ <xsl:attribute name="uof:locID">t0150</xsl:attribute>
+ <xsl:attribute name="uof:attrList">绝对值 相对值</xsl:attribute>
+ <xsl:variable name="sn">
+ <xsl:number from="/office:document/office:body/office:text" level="single" count="table:table-cell" format="1"/>
+ </xsl:variable>
+ <xsl:variable name="sn1">
+ <xsl:choose>
+ <xsl:when test="../../table:table-column[number($sn)]/@table:style-name">
+ <xsl:value-of select="$sn"/>
+ </xsl:when>
+ <xsl:when test=" name(../..)='table:table-header-rows' and ../../../table:table-column[number($sn)]/@table:style-name">
+ <xsl:value-of select="$sn"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'1'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="KuanDu">
+ <xsl:choose>
+ <xsl:when test=" name(../..)='table:table-header-rows' and ../../../table:table-column[number($sn)]/@table:style-name">
+ <xsl:value-of select="../../../table:table-column[number($sn1)]/@table:style-name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="../../table:table-column[number($sn1)]/@table:style-name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="字:绝对值"><xsl:value-of select="substring-before(key('set_colWidth',$KuanDu)/style:table-column-properties/@style:column-width,$ooUnit)"/></xsl:attribute>
+ <xsl:if test="key('set_colWidth',$KuanDu)/style:table-column-properties/@style:rel-column-width">
+ <xsl:attribute name="字:相对值"><xsl:value-of select="substring-before(key('set_colWidth',$KuanDu)/style:table-column-properties/@style:rel-column-width,'*')"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test="@table:number-columns-spanned">
+ <xsl:element name="字:跨列">
+ <xsl:attribute name="uof:locID">t0156</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="@table:number-columns-spanned"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:for-each select="key('set_styleStyle',$StyleName)">
+ <xsl:element name="字:单元格边距">
+ <xsl:attribute name="uof:locID">t0151</xsl:attribute>
+ <xsl:attribute name="uof:attrList">上 左 右 下</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="style:table-cell-properties/@fo:padding">
+ <xsl:attribute name="字:上"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:左"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:右"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:下"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:上"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-top,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:左"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-left,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:右"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-right,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:下"><xsl:value-of select="substring-before(style:table-cell-properties/@fo:padding-bottom,$uofUnit)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="style:table-cell-properties/@fo:border or style:table-cell-properties/@fo:border-top or style:table-cell-properties/@fo:border-bottom or style:table-cell-properties/@fo:border-left or style:table-cell-properties/@fo:border-right or style:table-cell-properties/@style:shadow">
+ <xsl:element name="字:边框">
+ <xsl:attribute name="uof:locID">t0152</xsl:attribute>
+ <xsl:for-each select="style:table-cell-properties">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:table-cell-properties/style:background-image/office:binary-data or style:table-cell-properties/@fo:background-color">
+ <字:填充 uof:locID="t0153">
+ <xsl:for-each select="style:table-cell-properties">
+ <xsl:call-template name="图:填充"/>
+ </xsl:for-each>
+ </字:填充>
+ </xsl:if>
+ <字:垂直对齐方式 uof:locID="t0154">
+ <xsl:choose>
+ <xsl:when test="style:table-cell-properties/@style:vertical-align='middle'">center</xsl:when>
+ <xsl:when test="style:table-cell-properties/@style:vertical-align='bottom'">bottom</xsl:when>
+ <xsl:otherwise>top</xsl:otherwise>
+ </xsl:choose>
+ </字:垂直对齐方式>
+ <xsl:element name="字:自动换行">
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0157</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:适应文字">
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0158</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:key name="bpath" match="//office:document/office:body/office:text/text:p/text:span" use="@text:style-name"/>
+ <xsl:template name="字:句属性">
+ <xsl:element name="字:字体">
+ <xsl:attribute name="uof:locID">t0088</xsl:attribute>
+ <xsl:attribute name="uof:attrList">西文字体引用 中文字体引用 特殊字体引用 西文绘制 字号 相对字号 颜色</xsl:attribute>
+ <xsl:if test="contains(@style:parent-style-name,'Header') or contains(@style:parent-style-name,'Foot') or contains(@style:parent-style-name,'Endnote')">
+ <xsl:attribute name="字:字号">9</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:font-size or style:text-properties/@style:font-size-asian or style:text-properties/@style:font-size-complex">
+ <xsl:choose>
+ <xsl:when test="contains(style:text-properties/@fo:font-size,'%') or contains(style:text-properties/@style:font-size-asian,'%')">
+ <xsl:attribute name="字:相对字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'%')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'%')"/></xsl:when></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:字号"><xsl:choose><xsl:when test="style:text-properties/@fo:font-size"><xsl:value-of select="substring-before(style:text-properties/@fo:font-size,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-asian"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-asian,'pt')"/></xsl:when><xsl:when test="style:text-properties/@style:font-size-complex"><xsl:value-of select="substring-before(style:text-properties/@style:font-size-complex,'pt')"/></xsl:when></xsl:choose></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:font-name">
+ <xsl:variable name="xiwen" select="style:text-properties/@style:font-name"/>
+ <xsl:attribute name="字:西文字体引用"><xsl:value-of select="translate($xiwen,' ','_')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:font-name-asian">
+ <xsl:attribute name="字:中文字体引用"><xsl:value-of select="style:text-properties/@style:font-name-asian"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test="style:text-properties/@fo:background-color and not(style:text-properties/@style:text-background-color='transparent')">
+ <xsl:element name="字:填充">
+ <xsl:attribute name="uof:locID">t0093</xsl:attribute>
+ <xsl:element name="图:图案">
+ <xsl:attribute name="uof:locID">g0036</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 图形引用 前景色 背景色</xsl:attribute>
+ <xsl:if test="style:text-properties/@fo:background-color">
+ <xsl:attribute name="图:前景色"><xsl:choose><xsl:when test="style:text-properties/@fo:background-color='transparent'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@fo:background-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:font-weight or style:text-properties/@style:font-weight-asian">
+ <xsl:element name="字:粗体">
+ <xsl:attribute name="uof:locID">t0089</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@style:font-weight-asian='bold' or style:text-properties/@fo:font-weight='bold'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:font-style or style:text-properties/@style:font-style-asian">
+ <xsl:element name="字:斜体">
+ <xsl:attribute name="uof:locID">t0090</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:font-style='italic' or style:text-properties/@style:font-style-asian='italic'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:background-color|style:text-properties/@style:text-background-color">
+ <xsl:element name="字:突出显示">
+ <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="style:text-properties/@fo:background-color='transparent' or style:text-properties/@style:text-background-color='transparent'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@fo:background-color|style:text-properties/@style:text-background-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0091</xsl:attribute>
+ <xsl:attribute name="uof:attrList">颜色</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-line-through-style">
+ <xsl:element name="字:删除线">
+ <xsl:attribute name="uof:locID">t0094</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:删除线类型"><xsl:with-param name="lineType" select="style:text-properties/@style:text-line-through-style"/></xsl:call-template></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-underline-style">
+ <xsl:element name="字:下划线">
+ <xsl:attribute name="uof:locID">t0095</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 颜色 字下划线</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:线型类型"/></xsl:attribute>
+ <xsl:if test="style:text-properties/@style:text-underline-color">
+ <xsl:attribute name="字:颜色"><xsl:choose><xsl:when test="style:text-properties/@style:text-underline-color='font-color'">auto</xsl:when><xsl:otherwise><xsl:value-of select="style:text-properties/@style:text-underline-color"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:text-shadow">
+ <xsl:element name="字:阴影">
+ <xsl:attribute name="uof:locID">t0100</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:choose><xsl:when test="style:text-properties/@fo:text-shadow='none'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-emphasize">
+ <xsl:element name="字:着重号">
+ <xsl:attribute name="uof:locID">t0096</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 颜色 字着重号</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:call-template name="uof:着重号类型"><xsl:with-param name="te" select="style:text-properties/@style:text-emphasize"/></xsl:call-template></xsl:attribute>
+ <xsl:if test="style:text-properties/@fo:color">
+ <xsl:attribute name="字:颜色"><xsl:value-of select="style:text-properties/@fo:color"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@text:display">
+ <xsl:element name="字:隐藏文字">
+ <xsl:attribute name="uof:locID">t0097</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-outline">
+ <xsl:element name="字:空心">
+ <xsl:attribute name="uof:locID">t0098</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值"><xsl:value-of select="style:text-properties/@style:text-outline"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:font-relief">
+ <xsl:element name="字:浮雕">
+ <xsl:attribute name="uof:locID">t0099</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@style:font-relief='embossed'">emboss</xsl:when><xsl:when test="style:text-properties/@style:font-relief='engraved'">engrave</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:text-transform or style:text-properties/@fo:font-variant">
+ <xsl:element name="字:醒目字体">
+ <xsl:attribute name="uof:locID">t0101</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型</xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:choose><xsl:when test="style:text-properties/@fo:text-transform='uppercase'">uppercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='lowercase'">lowercase</xsl:when><xsl:when test="style:text-properties/@fo:text-transform='capitalize'">capital</xsl:when><xsl:when test="style:text-properties/@fo:font-variant='small-caps'">small-caps</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-position">
+ <xsl:element name="字:位置">
+ <xsl:attribute name="uof:locID">t0102</xsl:attribute>
+ <xsl:variable name="aa">
+ <xsl:value-of select="style:text-properties/@style:text-position"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($aa,'sub')">
+ <xsl:value-of select="substring-before($aa,' ')"/>
+ </xsl:when>
+ <xsl:when test="contains($aa,'super')">
+ <xsl:value-of select="substring-before($aa,' ')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate($aa,'%','')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:text-scale">
+ <xsl:element name="字:缩放">
+ <xsl:attribute name="uof:locID">t0103</xsl:attribute>
+ <xsl:variable name="scale" select="style:text-properties/@style:text-scale"/>
+ <xsl:choose>
+ <xsl:when test="contains($scale,'%')">
+ <xsl:value-of select="substring-before($scale,'%')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="style:text-properties/@style:text-scale"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@fo:letter-spacing">
+ <xsl:element name="字:字符间距">
+ <xsl:attribute name="uof:locID">t0104</xsl:attribute>
+ <xsl:value-of select="substring-before(style:text-properties/@fo:letter-spacing,$uofUnit)"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="style:text-properties/@style:letter-kerning">
+ <xsl:element name="字:调整字间距">
+ <xsl:variable name="tt" select="style:text-properties/@style:letter-kerning"/>
+ <xsl:attribute name="uof:locID">t0105</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$tt='true'">1</xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="字:字符对齐网格">
+ <xsl:attribute name="字:值">false</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0106</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="uof:线型类型">
+ <xsl:variable name="spath" select="style:text-properties/@style:text-underline-style"/>
+ <xsl:variable name="wpath" select="style:text-properties/@style:text-underline-width"/>
+ <xsl:variable name="tpath" select="style:text-properties/@style:text-underline-type"/>
+ <xsl:choose>
+ <xsl:when test="$spath='solid' and not($tpath='double' ) and $wpath='auto' ">single</xsl:when>
+ <xsl:when test="$spath='solid' and $tpath='double' and $wpath='auto' ">double</xsl:when>
+ <xsl:when test="$spath='solid' and not($tpath='double' )and $wpath='bold' ">thick</xsl:when>
+ <xsl:when test="$spath='dotted' and not($tpath='double' )and $wpath='auto' ">dotted</xsl:when>
+ <xsl:when test="$spath='dotted' and not($tpath='double' )and $wpath='bold' ">dotted-heavy</xsl:when>
+ <xsl:when test="$spath='dash' and not($tpath='double' )and $wpath='auto' ">dash</xsl:when>
+ <xsl:when test="$spath='dash' and not($tpath='double' )and $wpath='bold' ">dashed-heavy</xsl:when>
+ <xsl:when test="$spath='long-dash' and not($tpath='double' )and $wpath='auto' ">dash-long</xsl:when>
+ <xsl:when test="$spath='long-dash' and not($tpath='double' )and $wpath='bold' ">dash-long-heavy</xsl:when>
+ <xsl:when test="$spath='dot-dash' and not($tpath='double' )and $wpath='auto' ">dot-dash</xsl:when>
+ <xsl:when test="$spath='dot-dash' and not($tpath='double' )and $wpath='bold' ">dash-dot-heavy</xsl:when>
+ <xsl:when test="$spath='dot-dot-dash' and not($tpath='double' )and $wpath='auto' ">dot-dot-dash</xsl:when>
+ <xsl:when test="$spath='dot-dot-dash' and not($tpath='double' )and $wpath='bold' ">dash-dot-dot-heavy</xsl:when>
+ <xsl:when test="$spath='wave' and not($tpath='double' )and $wpath='auto' ">wave</xsl:when>
+ <xsl:when test="$spath='wave' and not($tpath='double' )and $wpath='bold' ">wavy-heavy</xsl:when>
+ <xsl:when test="$spath='wave' and $tpath='double' and $wpath='auto' ">wavy-double</xsl:when>
+ <xsl:otherwise>none</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="uof:删除线类型">
+ <xsl:param name="lineType"/>
+ <xsl:variable name="tw" select="style:text-properties/@style:text-line-through-width"/>
+ <xsl:variable name="tt" select="style:text-properties/@style:text-line-through-text"/>
+ <xsl:variable name="ttp" select="style:text-properties/@style:text-line-through-type"/>
+ <xsl:choose>
+ <xsl:when test="$lineType='solid'and $ttp='double'">double</xsl:when>
+ <xsl:when test="$lineType='solid'and $tw='bold'">bold</xsl:when>
+ <xsl:when test="$lineType='solid'and $tt='X'">xl</xsl:when>
+ <xsl:when test="$lineType='solid'and $tt='/'">/l</xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="not($lineType='none') ">single</xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="uof:着重号类型">
+ <xsl:param name="te"/>
+ <xsl:choose>
+ <xsl:when test="$te='disc above' ">disc above</xsl:when>
+ <xsl:when test="$te='circle above' ">circle above</xsl:when>
+ <xsl:when test="$te='dot above' ">dot above</xsl:when>
+ <xsl:when test="$te='accent above' ">accent above</xsl:when>
+ <xsl:when test="$te='dot below' ">dot</xsl:when>
+ <xsl:when test="$te='circle below' ">circle below</xsl:when>
+ <xsl:when test="$te='disc below' ">disc below</xsl:when>
+ <xsl:when test="$te='accent below' ">accent below</xsl:when>
+ <xsl:otherwise>none</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="uof:边框">
+ <xsl:choose>
+ <xsl:when test="@fo:border">
+ <xsl:call-template name="uof:左边框">
+ <xsl:with-param name="border" select="@fo:border"/>
+ </xsl:call-template>
+ <xsl:call-template name="uof:上边框">
+ <xsl:with-param name="border" select="@fo:border"/>
+ </xsl:call-template>
+ <xsl:call-template name="uof:右边框">
+ <xsl:with-param name="border" select="@fo:border"/>
+ </xsl:call-template>
+ <xsl:call-template name="uof:下边框">
+ <xsl:with-param name="border" select="@fo:border"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="@fo:border-left or contains(substring-before(substring-after(@style:shadow,' '),' '),'-')">
+ <xsl:call-template name="uof:左边框">
+ <xsl:with-param name="border" select="@fo:border-left"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="@fo:border-top or contains(substring-after(substring-after(@style:shadow,' '),' '),'-')">
+ <xsl:call-template name="uof:上边框">
+ <xsl:with-param name="border" select="@fo:border-top"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="@fo:border-right or substring-before(substring-before(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-before(substring-after(@style:shadow,' '),' '),'+')">
+ <xsl:call-template name="uof:右边框">
+ <xsl:with-param name="border" select="@fo:border-right"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="@fo:border-bottom or substring-before(substring-after(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-after(substring-after(@style:shadow,' '),' '),'+')">
+ <xsl:call-template name="uof:下边框">
+ <xsl:with-param name="border" select="@fo:border-bottom"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="uof:左边框">
+ <xsl:param name="border"/>
+ <xsl:element name="uof:左">
+ <xsl:attribute name="uof:locID">u0057</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$border!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
- <xsl:if test="@fo:padding or @fo:padding-left">
- <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-left"><xsl:value-of select="substring-before(@fo:padding-left,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="contains(substring-before(substring-after(@style:shadow,' '),' '),'-')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="uof:上边框">
- <xsl:param name="border"/>
- <xsl:element name="uof:上">
- <xsl:attribute name="uof:locID">u0058</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:if test="$border!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
+ <xsl:if test="@fo:padding or @fo:padding-left">
+ <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-left"><xsl:value-of select="substring-before(@fo:padding-left,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="contains(substring-before(substring-after(@style:shadow,' '),' '),'-')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="uof:上边框">
+ <xsl:param name="border"/>
+ <xsl:element name="uof:上">
+ <xsl:attribute name="uof:locID">u0058</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$border!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
- <xsl:if test="@fo:padding or @fo:padding-top">
- <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-top"><xsl:value-of select="substring-before(@fo:padding-top,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="contains(substring-after(substring-after(@style:shadow,' '),' '),'-')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="uof:右边框">
- <xsl:param name="border"/>
- <xsl:element name="uof:右">
- <xsl:attribute name="uof:locID">u0059</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:if test="$border!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
+ <xsl:if test="@fo:padding or @fo:padding-top">
+ <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-top"><xsl:value-of select="substring-before(@fo:padding-top,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="contains(substring-after(substring-after(@style:shadow,' '),' '),'-')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="uof:右边框">
+ <xsl:param name="border"/>
+ <xsl:element name="uof:右">
+ <xsl:attribute name="uof:locID">u0059</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$border!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
- <xsl:if test="@fo:padding or @fo:padding-right">
- <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-right"><xsl:value-of select="substring-before(@fo:padding-right,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="substring-before(substring-before(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-before(substring-after(@style:shadow,' '),' '),'+')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="uof:下边框">
- <xsl:param name="border"/>
- <xsl:element name="uof:下">
- <xsl:attribute name="uof:locID">u0060</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
+ <xsl:if test="$border!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
+ <xsl:if test="@fo:padding or @fo:padding-right">
+ <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-right"><xsl:value-of select="substring-before(@fo:padding-right,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="substring-before(substring-before(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-before(substring-after(@style:shadow,' '),' '),'+')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="uof:下边框">
+ <xsl:param name="border"/>
+ <xsl:element name="uof:下">
+ <xsl:attribute name="uof:locID">u0060</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 宽度 边距 颜色 阴影</xsl:attribute>
<xsl:attribute name="uof:类型"><xsl:choose><xsl:when test="$border!='none'"><xsl:choose><xsl:when test="substring-before(substring-after($border,' '),' ')='solid'">single</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='double'">double</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dashed'">dash</xsl:when><xsl:when test="substring-before(substring-after($border,' '),' ')='dotted'">dotted</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$border!='none'">
- <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
- <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
- <xsl:if test="@fo:padding or @fo:padding-bottom">
- <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-bottom"><xsl:value-of select="substring-before(@fo:padding-bottom,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="substring-before(substring-after(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-after(substring-after(@style:shadow,' '),' '),'+')">
- <xsl:attribute name="uof:阴影">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:key name="geshi" match="//office:document/office:automatic-styles/number:date-style | //office:document/office:automatic-styles/number:time-style" use="@style:name"/>
- <xsl:template name="inline-text">
- <xsl:param name="pStyleName"/>
- <xsl:param name="bText"/>
- <xsl:apply-templates select="text()|textspan|jiaozhu|weizhu|office:annotation|text:sequence|text:date|text:time|text:page-number|text:page-count|text:subject|text:title|text:initial-creator|text:author-name|text:author-initials|text:file-name|text:change-start|text:change-end|text:change">
- <xsl:with-param name="pStyleName" select="$pStyleName"/>
- <xsl:with-param name="bText" select="$bText"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="text:sequence">
- <xsl:param name="tStyle"/>
- <xsl:if test="@text:name='Illustration' or @text:name='Text' or @text:name='Drawing' or @text:name='Table'">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'seq'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <xsl:if test="$tStyle!=''">
- <字:句属性 字:式样引用="{$tStyle}" uof:locID="t0086" uof:attrList="式样引用"/>
- </xsl:if>
- <xsl:variable name="fmt">
- <xsl:call-template name="oo数字格式域开关">
- <xsl:with-param name="oo_format" select="@style:num-format"/>
- </xsl:call-template>
- </xsl:variable>
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="concat('SEQ ',@text:name,' \* ',$fmt,' \f ',@text:formula)"/>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="string(.)"/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template match="text:time">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'time'"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <xsl:variable name="timefmt">
- <xsl:variable name="aa" select="@style:data-style-name"/>
- <xsl:for-each select="key('geshi',$aa)/number:hours | key('geshi',$aa)/number:minutes | key('geshi',$aa)/number:am-pm | key('geshi',$aa)/number:seconds | key('geshi',$aa)/number:text">
- <xsl:choose>
- <xsl:when test="@number:style='long' ">
- <xsl:if test="self::node( )[name(.)='number:hours']">HH</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:minutes']">MM</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:seconds']">SS</xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="self::node( )[name(.)='number:text']">
- <xsl:value-of select="."/>
- </xsl:if>
- <xsl:if test="self::node( )[name(.)='number:hours']">H</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:minutes']">M</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:seconds']">S</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:am-pm']">am/pm</xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="quote">"</xsl:variable>
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="concat('TIME \@ ',$quote,$timefmt,$quote)"/>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="string(.)"/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="text:date">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'date'"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <xsl:variable name="datefmt">
- <xsl:variable name="bb" select="@style:data-style-name"/>
- <xsl:for-each select="key('geshi',$bb)/number:year | key('geshi',$bb)/number:month | key('geshi',$bb)/number:day | key('geshi',$bb)/number:hours | key('geshi',$bb)/number:minutes | key('geshi',$bb)/number:seconds | key('geshi',$bb)/number:quarter | key('geshi',$bb)/number:day-of-week | key('geshi',$bb)/number:week-of-year | key('geshi',$bb)/number:text | key('geshi',$bb)/number:am-pm">
- <xsl:choose>
- <xsl:when test="@number:style='long' ">
- <xsl:if test="self::node( )[name(.)='number:year']">yyyy</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:month']">MM</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:day']">dd</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:hours']">hh</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:minutes']">mm</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:seconds']">ss</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:quarter']">第QQ季度</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:day-of-week']">星期N</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:week-of-year']">WW</xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="self::node( )[name(.)='number:text']">
- <xsl:value-of select="."/>
- </xsl:if>
- <xsl:if test="self::node( )[name(.)='number:year']">yy</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:month']">M</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:day']">d</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:hours']">h</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:minutes']">m</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:seconds']">s</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:quarter']">Q季</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:day-of-week']">星期N</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:week-of-year']">WW</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:am-pm']">am/pm</xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="quote">"</xsl:variable>
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="concat('CREATEDATE \@ ',$quote,$datefmt,$quote)"/>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="string(.)"/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template name="oo数字格式域开关">
- <xsl:param name="oo_format"/>
- <xsl:choose>
- <xsl:when test="$oo_format='1'">Arabic</xsl:when>
- <xsl:when test="$oo_format='I'">ROMAN</xsl:when>
- <xsl:when test="$oo_format='i'">roman</xsl:when>
- <xsl:when test="$oo_format='A'">ALPHABETIC</xsl:when>
- <xsl:when test="$oo_format='a'">alphabetic</xsl:when>
- <xsl:when test="$oo_format='1, 2, 3, ...'">GB1</xsl:when>
- <xsl:when test="$oo_format='①, ②, ③, ...'">GB3</xsl:when>
- <xsl:when test="$oo_format='一, 二, 三, ...'">CHINESENUM3</xsl:when>
- <xsl:when test="$oo_format='壹, 贰, 叁, ...'">CHINESENUM2</xsl:when>
- <xsl:when test="$oo_format='甲, 乙, 丙, ...'">ZODIAC1</xsl:when>
- <xsl:when test="$oo_format='子, 丑, 寅, ...'">ZODIAC2</xsl:when>
- <xsl:otherwise>Arabic</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="text:page-number">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'page'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <xsl:variable name="fmt">
- <xsl:call-template name="oo数字格式域开关">
- <xsl:with-param name="oo_format" select="@style:num-format"/>
- </xsl:call-template>
- </xsl:variable>
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:choose>
- <xsl:when test="@style:num-format">
- <xsl:value-of select="concat('PAGE \* ',$fmt)"/>
- </xsl:when>
- <xsl:otherwise>PAGE</xsl:otherwise>
- </xsl:choose>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="string(.)"/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="text:page-count">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'numpages'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'or text:fixed='true'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <xsl:variable name="fmt">
- <xsl:call-template name="oo数字格式域开关">
- <xsl:with-param name="oo_format" select="@style:num-format"/>
- </xsl:call-template>
- </xsl:variable>
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:choose>
- <xsl:when test="@style:num-format">
- <xsl:value-of select="concat('NumPages \* ',$fmt,' \* Upper')"/>
- </xsl:when>
- <xsl:otherwise>NumPages</xsl:otherwise>
- </xsl:choose>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="string(.)"/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="text:initial-creator">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'author'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'or text:fixed='true'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <!--xsl:value-of select="concat('AUTHOR \* ','Caps',' \* MERGEFORMAT')"/-->
- <xsl:value-of select="'AUTHOR'"/>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="string(.)"/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="text:author-name">
- <xsl:param name="tStyle"/>
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'username'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'or text:fixed='true'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <xsl:if test="$tStyle!=''">
- <字:句属性 字:式样引用="{$tStyle}" uof:locID="t0086" uof:attrList="式样引用"/>
- </xsl:if>
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">AUTHOR</字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">
- <xsl:value-of select="."/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="text:author-initials">
- <xsl:param name="tStyle"/>
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'userinitials'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'or text:fixed='true'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <xsl:if test="$tStyle!=''">
- <字:句属性 字:式样引用="{$tStyle}" uof:locID="t0086" uof:attrList="式样引用"/>
- </xsl:if>
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">AUTHOR</字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">
- <xsl:value-of select="."/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="text:title">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'title'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'or text:fixed='true'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <xsl:variable name="titlename" select="/office:document/office:meta/dc:title"/>
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">
- <xsl:value-of select="concat('TITLE',' \* Upper')"/>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">
- <xsl:value-of select="."/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="text:subject">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'subject'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'or text:fixed='true'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">
- <xsl:value-of select="concat('SUBJECT \* ','Caps',' \* MERGEFORMAT')"/>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">
- <xsl:value-of select="."/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="text:file-name">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'filename'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'or text:fixed='true'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">
- <!--xsl:value-of select="concat('FILENAME \* ','Caps',' \* MERGEFORMAT')"/-->
- <xsl:value-of select="concat('FILENAME',' \p')"/>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">
- <xsl:value-of select="."/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="text:editing-duration">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'edittime'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'or text:fixed='true'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <xsl:variable name="timefmt">
- <xsl:variable name="aa" select="@style:data-style-name"/>
- <xsl:for-each select="key('geshi',$aa)/number:hours | key('geshi',$aa)/number:minutes | key('geshi',$aa)/number:am-pm | key('geshi',$aa)/number:seconds | key('geshi',$aa)/number:text">
- <xsl:choose>
- <xsl:when test="@number:style='long' ">
- <xsl:if test="self::node( )[name(.)='number:hours']">HH</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:minutes']">MM</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:seconds']">SS</xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="self::node( )[name(.)='number:text']">
- <xsl:value-of select="."/>
- </xsl:if>
- <xsl:if test="self::node( )[name(.)='number:hours']">H</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:minutes']">M</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:seconds']">S</xsl:if>
- <xsl:if test="self::node( )[name(.)='number:am-pm']">am/pm</xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="quote">"</xsl:variable>
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="concat('EDITTIME \@ ',$quote,$timefmt,$quote,' \* MERGEFORMAT ')"/>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="."/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:key name="path" match="//office:document/office:automatic-styles/style:style" use="@style:name"/>
- <xsl:template name="text:table-of-content">
- <xsl:element name="字:段落">
- <xsl:attribute name="uof:locID">t0051</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:element name="字:段落属性">
- <xsl:attribute name="uof:locID">t0052</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="text:index-body/text:p/@text:style-name"/></xsl:attribute>
- <xsl:element name="字:制表位设置">
- <xsl:attribute name="uof:locID">t0067</xsl:attribute>
- <xsl:element name="字:制表位">
- <xsl:attribute name="uof:locID">t0068</xsl:attribute>
- <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
- <xsl:variable name="aa" select="text:index-body/text:p/@text:style-name"/>
- <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
- <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
- <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
- <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- <xsl:element name="字:是否行首标点压缩">
- <xsl:attribute name="uof:locID">t0075</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:中文习惯首尾字符">
- <xsl:attribute name="字:值">true</xsl:attribute>
- <xsl:attribute name="uof:locID">t0076</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:element>
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'REF'"/></xsl:attribute>
- <xsl:if test="@text:protected">
- <xsl:attribute name="字:锁定"><xsl:value-of select="@text:protected"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="'TOC \o 1-10 \h \z'"/>
- </字:文本串>
- </字:句>
- </字:段落>
- <xsl:for-each select="text:index-body/text:index-title/text:p">
- <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
- <xsl:element name="字:段落属性">
- <xsl:attribute name="uof:locID">t0052</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </xsl:element>
- <xsl:element name="字:句">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </字:句属性>
- <xsl:element name="字:文本串">
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="self::node()"/>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- <xsl:for-each select="text:index-body/text:p">
- <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
- <xsl:element name="字:段落属性">
- <xsl:attribute name="uof:locID">t0052</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- <xsl:element name="字:制表位设置">
- <xsl:attribute name="uof:locID">t0067</xsl:attribute>
- <xsl:element name="字:制表位">
- <xsl:attribute name="uof:locID">t0068</xsl:attribute>
- <xsl:attribute name="uof:attrList">位置 类型 前导符</xsl:attribute>
- <xsl:variable name="aa" select="@text:style-name"/>
- <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
- <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
- <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
- <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- <xsl:element name="字:是否行首标点压缩">
- <xsl:attribute name="uof:locID">t0075</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- <xsl:attribute name="字:值">true</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:中文习惯首尾字符">
- <xsl:attribute name="字:值">true</xsl:attribute>
- <xsl:attribute name="uof:locID">t0076</xsl:attribute>
- <xsl:attribute name="uof:attrList">值</xsl:attribute>
- </xsl:element>
- </xsl:element>
- <xsl:if test="self::node()/text:a">
- <字:句 uof:locID="t0085">
- <xsl:variable name="num">
- <xsl:number from="/office:document/office:body/office:text" level="any" count="text:a"/>
- </xsl:variable>
- <xsl:element name="字:区域开始">
- <xsl:attribute name="字:标识符"><xsl:value-of select="concat('hlnk',$num + 1)"/></xsl:attribute>
- <xsl:attribute name="字:名称">Hyperlink</xsl:attribute>
- <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
- <xsl:attribute name="uof:locID">t0121</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
- </xsl:element>
- <xsl:for-each select="text:a/node()">
- <xsl:choose>
- <xsl:when test="name(.)='text:tab-stop' or name(.)='text:tab'">
- <xsl:element name="字:制表符" uof:locID="t0123"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="字:文本串">
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:element name="字:区域结束">
- <xsl:attribute name="字:标识符引用"><xsl:value-of select="concat('hlnk',$num + 1)"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0122</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
- </xsl:element>
- <xsl:variable name="stt">
- <xsl:value-of select="./text:a"/>
- </xsl:variable>
- <xsl:variable name="end">
- <xsl:value-of select="."/>
- </xsl:variable>
- <xsl:variable name="bijiao">
- <xsl:value-of select="substring-after($end,$stt)"/>
- </xsl:variable>
- <xsl:if test="not($bijiao='')">
- <xsl:element name="字:文本串">
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="$bijiao"/>
- </xsl:element>
- </xsl:if>
- </字:句>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="text:alphabetical-index">
- <xsl:element name="字:段落">
- <xsl:attribute name="uof:locID">t0051</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:element name="字:段落属性">
- <xsl:attribute name="uof:locID">t0052</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="text:index-body/text:p/@text:style-name"/></xsl:attribute>
- <xsl:element name="字:制表位设置">
- <xsl:attribute name="uof:locID">t0067</xsl:attribute>
- <xsl:element name="字:制表位">
- <xsl:attribute name="uof:locID">t0068</xsl:attribute>
- <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
- <xsl:variable name="aa" select="text:index-body/text:p/@text:style-name"/>
- <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
- <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
- <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
- <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'INDEX'"/></xsl:attribute>
- <xsl:if test="@text:protected">
- <xsl:attribute name="字:锁定"><xsl:value-of select="@text:protected"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:文本串>
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="'TOC \o 1-10 \h \z'"/>
- </字:文本串>
- </字:句>
- </字:段落>
- <xsl:for-each select="text:index-body/text:index-title/text:p">
- <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
- <xsl:element name="字:段落属性">
- <xsl:attribute name="uof:locID">t0052</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </xsl:element>
- <xsl:element name="字:句">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- </字:句属性>
- <xsl:element name="字:文本串">
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="self::node()"/>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- <xsl:for-each select="text:index-body/text:p">
- <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
- <xsl:element name="字:段落属性">
- <xsl:attribute name="uof:locID">t0052</xsl:attribute>
- <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
- <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
- <xsl:element name="字:制表位设置">
- <xsl:attribute name="uof:locID">t0067</xsl:attribute>
- <xsl:element name="字:制表位">
- <xsl:attribute name="uof:locID">t0068</xsl:attribute>
- <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
- <xsl:variable name="aa" select="@text:style-name"/>
- <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
- <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
- <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
- <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
- <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- <xsl:for-each select="node()">
- <字:句 uof:locID="t0085">
- <xsl:choose>
- <xsl:when test="name(.)='text:tab-stop' or name(.)='text:tab'">
- <xsl:element name="字:制表符" uof:locID="t0123"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="字:文本串">
- <xsl:attribute name="uof:locID">t0109</xsl:attribute>
- <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </字:句>
- </xsl:for-each>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="oo数字格式">
- <xsl:param name="oo_format"/>
- <xsl:choose>
- <xsl:when test="$oo_format='1'">decimal</xsl:when>
- <xsl:when test="$oo_format='I'">upper-roman</xsl:when>
- <xsl:when test="$oo_format='i'">lower-roman</xsl:when>
- <xsl:when test="$oo_format='A'">upper-letter</xsl:when>
- <xsl:when test="$oo_format='a'">lower-letter</xsl:when>
- <xsl:when test="$oo_format='1, 2, 3, ...'">decimal-full-width</xsl:when>
- <xsl:when test="$oo_format='①, ②, ③, ...'">decimal-enclosed-circle</xsl:when>
- <xsl:when test="$oo_format='一, 二, 三, ...'">chinese-counting</xsl:when>
- <xsl:when test="$oo_format='壹, 贰, 叁, ...'">chinese-legal-simplified</xsl:when>
- <xsl:when test="$oo_format='甲, 乙, 丙, ...'">ideograph-traditional</xsl:when>
- <xsl:when test="$oo_format='子, 丑, 寅, ...'">ideograph-zodiac</xsl:when>
- <xsl:otherwise>decimal</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="图:填充">
- <xsl:param name="style-name"/>
- <xsl:choose>
- <xsl:when test="style:background-image/office:binary-data">
- <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
- <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:background-image/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:background-image/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:background-image/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:background-image/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="图:图形引用"><xsl:value-of select="concat('background-image_',count(preceding::style:background-image))"/></xsl:attribute>
- <xsl:attribute name="图:类型">png</xsl:attribute>
- <xsl:attribute name="图:名称">background-image</xsl:attribute>
- </图:图片>
- </xsl:when>
- <xsl:when test="@fo:background-color">
- <图:颜色 uof:locID="g0034">
- <xsl:choose>
- <xsl:when test="@fo:background-color='transparent' ">auto</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@fo:background-color"/>
- </xsl:otherwise>
- </xsl:choose>
- </图:颜色>
- </xsl:when>
- <xsl:when test="@draw:fill='gradient'">
- </xsl:when>
- <xsl:when test="@draw:fill='hatch'">
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="字:缩进类型">
- <xsl:if test="@text:space-before or @fo:margin-left">
- <字:左 uof:locID="t0182">
- <字:绝对 uof:locID="t0185" uof:attrList="值">
- <xsl:if test="@text:space-before">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@text:space-before,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@fo:margin-left">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@fo:margin-left,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- </字:绝对>
- </字:左>
- </xsl:if>
- <xsl:if test="@text:min-label-width or @fo:margin-right">
- <字:右 uof:locID="t0183">
- <字:绝对 uof:locID="t0187" uof:attrList="值">
- <xsl:if test="@text:min-label-width">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@text:min-label-width,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@fo:margin-right">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@fo:margin-right,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- </字:绝对>
- </字:右>
- </xsl:if>
- <xsl:if test="@text:min-label-distance or @fo:text-indent">
- <字:首行 uof:locID="t0184">
- <字:绝对 uof:locID="t0189" uof:attrList="值">
- <xsl:if test="@text:min-label-distance">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@text:min-label-distance,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@fo:text-indent">
- <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@fo:text-indent,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- </字:绝对>
- </字:首行>
- </xsl:if>
- </xsl:template>
- <xsl:template name="graphsize">
- <xsl:param name="width"/>
- <xsl:param name="Unitofsize"/>
- <xsl:if test="$Unitofsize='pt'">
- <xsl:choose>
- <xsl:when test="(not($width&gt;1.42) and 0&lt;$width)">1</xsl:when>
- <xsl:when test="(not($width&gt;2.84) and 1.42&lt;$width)">2</xsl:when>
- <xsl:when test="(not($width&gt;4.26) and 2.84&lt;$width)">3</xsl:when>
- <xsl:when test="(not($width&gt;5.68) and 4.26&lt;$width)">4</xsl:when>
- <xsl:when test="(not($width&gt;7.10) and 5.68&lt;$width)">5</xsl:when>
- <xsl:when test="(not($width&gt;8.52) and 7.10&lt;$width)">6</xsl:when>
- <xsl:when test="(not($width&gt;9.94) and 8.52&lt;$width)">7</xsl:when>
- <xsl:when test="(not($width&gt;11.36) and 9.94&lt;$width)">8</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="$uofUnit='in'">
- <xsl:choose>
- <xsl:when test="(not($width&gt;0.02) and 0&lt;$width)">1</xsl:when>
- <xsl:when test="(not($width&gt;0.04) and 0.02&lt;$width)">2</xsl:when>
- <xsl:when test="(not($width&gt;0.06) and 0.04&lt;$width)">3</xsl:when>
- <xsl:when test="(not($width&gt;0.08) and 0.06&lt;$width)">4</xsl:when>
- <xsl:when test="(not($width&gt;0.10) and 0.08&lt;$width)">5</xsl:when>
- <xsl:when test="(not($width&gt;0.12) and 0.10&lt;$width)">6</xsl:when>
- <xsl:when test="(not($width&gt;0.14) and 0.12&lt;$width)">7</xsl:when>
- <xsl:when test="(not($width&gt;0.16) and 0.14&lt;$width)">8</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="$uofUnit='mm'">
- <xsl:choose>
- <xsl:when test="(not($width&gt;0.5) and 0&lt;$width) or $width=0.5">1</xsl:when>
- <xsl:when test="(not($width&gt;1.0) and 0.5&lt;$width) or $width=1.0">2</xsl:when>
- <xsl:when test="(not($width&gt;1.5) and 0.10&lt;$width) or $width=1.5">3</xsl:when>
- <xsl:when test="(not($width&gt;2.0) and 1.5&lt;$width) or $width=2.0">4</xsl:when>
- <xsl:when test="(not($width&gt;2.5) and 2.0&lt;$width) or $width=2.5">5</xsl:when>
- <xsl:when test="(not($width&gt;3.0) and 2.5&lt;$width) or $width=3.0">6</xsl:when>
- <xsl:when test="(not($width&gt;3.5) and 3.0&lt;$width) or $width=3.5">7</xsl:when>
- <xsl:when test="(not($width&gt;4.0) and 3.5&lt;$width) or $width=4.0">8</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="$uofUnit='cm'">
- <xsl:choose>
- <xsl:when test="(not($width&gt;0.05) and 0&lt;$width) or $width=0.05">1</xsl:when>
- <xsl:when test="(not($width&gt;0.10) and 0.05&lt;$width) or $width=0.10">2</xsl:when>
- <xsl:when test="(not($width&gt;0.15) and 0.10&lt;$width) or $width=0.15">3</xsl:when>
- <xsl:when test="(not($width&gt;0.20) and 0.15&lt;$width) or $width=0.20">4</xsl:when>
- <xsl:when test="(not($width&gt;0.25) and 0.20&lt;$width) or $width=0.25">5</xsl:when>
- <xsl:when test="(not($width&gt;0.30) and 0.25&lt;$width) or $width=0.30">6</xsl:when>
- <xsl:when test="(not($width&gt;0.35) and 0.30&lt;$width) or $width=0.35">7</xsl:when>
- <xsl:when test="(not($width&gt;0.40) and 0.35&lt;$width) or $width=0.40">8</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template match="text:character-count">
- <xsl:element name="字:域开始">
- <xsl:attribute name="字:类型"><xsl:value-of select="'numchars'"/></xsl:attribute>
- <xsl:attribute name="uof:locID">t0079</xsl:attribute>
- <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
- <xsl:choose>
- <xsl:when test="text:fixed='1'or text:fixed='true'">
- <xsl:attribute name="字:锁定">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="字:锁定">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="字:域代码">
- <xsl:attribute name="uof:locID">t0080</xsl:attribute>
- <字:段落 uof:locID="t0051" uof:attrList="标识符">
- <字:句 uof:locID="t0085">
- <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
- <xsl:variable name="quote" select="'&quot;'"/>
- <xsl:variable name="fmt">
- <xsl:call-template name="oo数字格式域开关">
- <xsl:with-param name="oo_format" select="@style:num-format"/>
- </xsl:call-template>
- </xsl:variable>
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">
- <xsl:value-of select="concat('NUMCHARS \* ',$fmt,' \# ',$quote,0,$quote)"/>
- </字:文本串>
- </字:句>
- </字:段落>
- </xsl:element>
- <字:句 uof:locID="t0085">
- <字:文本串 uof:locID="t0109" uof:attrList="标识符">
- <xsl:value-of select="."/>
- </字:文本串>
- </字:句>
- <xsl:element name="字:域结束">
- <xsl:attribute name="uof:locID">t0081</xsl:attribute>
- </xsl:element>
- </xsl:template>
- <!-- measure_conversion.xsl Begin-->
- <!--xsl:param name="dpi" select="111"/>
- <xsl:param name="centimeter-in-mm" select="10"/>
- <xsl:param name="inch-in-mm" select="25.4"/>
- <xsl:param name="didot-point-in-mm" select="0.376065"/>
- <xsl:param name="pica-in-mm" select="4.2333333"/>
- <xsl:param name="point-in-mm" select="0.3527778"/>
- <xsl:param name="twip-in-mm" select="0.017636684"/>
- <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/-->
- <!-- ***** MEASUREMENT CONVERSIONS *****
- PARAM 'value'
- The measure to be converted.
- The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
- directly added to the number.
+ <xsl:if test="$border!='none'">
+ <xsl:attribute name="uof:宽度"><xsl:value-of select="substring-before(substring-before($border,' '),substring($ooUnit,1,2))"/></xsl:attribute>
+ <xsl:attribute name="uof:颜色"><xsl:value-of select="substring-after(substring-after($border,' '),' ')"/></xsl:attribute>
+ <xsl:if test="@fo:padding or @fo:padding-bottom">
+ <xsl:attribute name="uof:边距"><xsl:choose><xsl:when test="@fo:padding-bottom"><xsl:value-of select="substring-before(@fo:padding-bottom,$ooUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-before(@fo:padding,$ooUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="substring-before(substring-after(substring-after(@style:shadow,' '),' '),$ooUnit) &gt;0 or contains(substring-after(substring-after(@style:shadow,' '),' '),'+')">
+ <xsl:attribute name="uof:阴影">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:key name="geshi" match="//office:document/office:automatic-styles/number:date-style | //office:document/office:automatic-styles/number:time-style" use="@style:name"/>
+ <xsl:template name="inline-text">
+ <xsl:param name="pStyleName"/>
+ <xsl:param name="bText"/>
+ <xsl:apply-templates select="text()|textspan|jiaozhu|weizhu|office:annotation|text:sequence|text:date|text:time|text:page-number|text:page-count|text:subject|text:title|text:initial-creator|text:author-name|text:author-initials|text:file-name|text:change-start|text:change-end|text:change">
+ <xsl:with-param name="pStyleName" select="$pStyleName"/>
+ <xsl:with-param name="bText" select="$bText"/>
+ </xsl:apply-templates>
+ </xsl:template>
+ <xsl:template match="text:sequence">
+ <xsl:param name="tStyle"/>
+ <xsl:if test="@text:name='Illustration' or @text:name='Text' or @text:name='Drawing' or @text:name='Table'">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'seq'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <xsl:if test="$tStyle!=''">
+ <字:句属性 字:式样引用="{$tStyle}" uof:locID="t0086" uof:attrList="式样引用"/>
+ </xsl:if>
+ <xsl:variable name="fmt">
+ <xsl:call-template name="oo数字格式域开关">
+ <xsl:with-param name="oo_format" select="@style:num-format"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="concat('SEQ ',@text:name,' \* ',$fmt,' \f ',@text:formula)"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="string(.)"/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="text:time">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'time'"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <xsl:variable name="timefmt">
+ <xsl:variable name="aa" select="@style:data-style-name"/>
+ <xsl:for-each select="key('geshi',$aa)/number:hours | key('geshi',$aa)/number:minutes | key('geshi',$aa)/number:am-pm | key('geshi',$aa)/number:seconds | key('geshi',$aa)/number:text">
+ <xsl:choose>
+ <xsl:when test="@number:style='long' ">
+ <xsl:if test="self::node( )[name(.)='number:hours']">HH</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:minutes']">MM</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:seconds']">SS</xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="self::node( )[name(.)='number:text']">
+ <xsl:value-of select="."/>
+ </xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:hours']">H</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:minutes']">M</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:seconds']">S</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:am-pm']">am/pm</xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="quote">"</xsl:variable>
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="concat('TIME \@ ',$quote,$timefmt,$quote)"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="string(.)"/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="text:date">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'date'"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <xsl:variable name="datefmt">
+ <xsl:variable name="bb" select="@style:data-style-name"/>
+ <xsl:for-each select="key('geshi',$bb)/number:year | key('geshi',$bb)/number:month | key('geshi',$bb)/number:day | key('geshi',$bb)/number:hours | key('geshi',$bb)/number:minutes | key('geshi',$bb)/number:seconds | key('geshi',$bb)/number:quarter | key('geshi',$bb)/number:day-of-week | key('geshi',$bb)/number:week-of-year | key('geshi',$bb)/number:text | key('geshi',$bb)/number:am-pm">
+ <xsl:choose>
+ <xsl:when test="@number:style='long' ">
+ <xsl:if test="self::node( )[name(.)='number:year']">yyyy</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:month']">MM</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:day']">dd</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:hours']">hh</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:minutes']">mm</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:seconds']">ss</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:quarter']">第QQ季度</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:day-of-week']">星期N</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:week-of-year']">WW</xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="self::node( )[name(.)='number:text']">
+ <xsl:value-of select="."/>
+ </xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:year']">yy</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:month']">M</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:day']">d</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:hours']">h</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:minutes']">m</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:seconds']">s</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:quarter']">Q季</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:day-of-week']">星期N</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:week-of-year']">WW</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:am-pm']">am/pm</xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="quote">"</xsl:variable>
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="concat('CREATEDATE \@ ',$quote,$datefmt,$quote)"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="string(.)"/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="oo数字格式域开关">
+ <xsl:param name="oo_format"/>
+ <xsl:choose>
+ <xsl:when test="$oo_format='1'">Arabic</xsl:when>
+ <xsl:when test="$oo_format='I'">ROMAN</xsl:when>
+ <xsl:when test="$oo_format='i'">roman</xsl:when>
+ <xsl:when test="$oo_format='A'">ALPHABETIC</xsl:when>
+ <xsl:when test="$oo_format='a'">alphabetic</xsl:when>
+ <xsl:when test="$oo_format='1, 2, 3, ...'">GB1</xsl:when>
+ <xsl:when test="$oo_format='①, ②, ③, ...'">GB3</xsl:when>
+ <xsl:when test="$oo_format='一, 二, 三, ...'">CHINESENUM3</xsl:when>
+ <xsl:when test="$oo_format='壹, 贰, 叁, ...'">CHINESENUM2</xsl:when>
+ <xsl:when test="$oo_format='甲, 乙, 丙, ...'">ZODIAC1</xsl:when>
+ <xsl:when test="$oo_format='子, 丑, 寅, ...'">ZODIAC2</xsl:when>
+ <xsl:otherwise>Arabic</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="text:page-number">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'page'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <xsl:variable name="fmt">
+ <xsl:call-template name="oo数字格式域开关">
+ <xsl:with-param name="oo_format" select="@style:num-format"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@style:num-format">
+ <xsl:value-of select="concat('PAGE \* ',$fmt)"/>
+ </xsl:when>
+ <xsl:otherwise>PAGE</xsl:otherwise>
+ </xsl:choose>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="string(.)"/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="text:page-count">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'numpages'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'or text:fixed='true'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <xsl:variable name="fmt">
+ <xsl:call-template name="oo数字格式域开关">
+ <xsl:with-param name="oo_format" select="@style:num-format"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@style:num-format">
+ <xsl:value-of select="concat('NumPages \* ',$fmt,' \* Upper')"/>
+ </xsl:when>
+ <xsl:otherwise>NumPages</xsl:otherwise>
+ </xsl:choose>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="string(.)"/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="text:initial-creator">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'author'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'or text:fixed='true'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <!--xsl:value-of select="concat('AUTHOR \* ','Caps',' \* MERGEFORMAT')"/-->
+ <xsl:value-of select="'AUTHOR'"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="string(.)"/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="text:author-name">
+ <xsl:param name="tStyle"/>
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'username'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'or text:fixed='true'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <xsl:if test="$tStyle!=''">
+ <字:句属性 字:式样引用="{$tStyle}" uof:locID="t0086" uof:attrList="式样引用"/>
+ </xsl:if>
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">AUTHOR</字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">
+ <xsl:value-of select="."/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="text:author-initials">
+ <xsl:param name="tStyle"/>
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'userinitials'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'or text:fixed='true'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <xsl:if test="$tStyle!=''">
+ <字:句属性 字:式样引用="{$tStyle}" uof:locID="t0086" uof:attrList="式样引用"/>
+ </xsl:if>
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">AUTHOR</字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">
+ <xsl:value-of select="."/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="text:title">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'title'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'or text:fixed='true'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <xsl:variable name="titlename" select="/office:document/office:meta/dc:title"/>
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">
+ <xsl:value-of select="concat('TITLE',' \* Upper')"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">
+ <xsl:value-of select="."/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="text:subject">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'subject'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'or text:fixed='true'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">
+ <xsl:value-of select="concat('SUBJECT \* ','Caps',' \* MERGEFORMAT')"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">
+ <xsl:value-of select="."/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="text:file-name">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'filename'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'or text:fixed='true'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">
+ <!--xsl:value-of select="concat('FILENAME \* ','Caps',' \* MERGEFORMAT')"/-->
+ <xsl:value-of select="concat('FILENAME',' \p')"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">
+ <xsl:value-of select="."/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="text:editing-duration">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'edittime'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'or text:fixed='true'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <xsl:variable name="timefmt">
+ <xsl:variable name="aa" select="@style:data-style-name"/>
+ <xsl:for-each select="key('geshi',$aa)/number:hours | key('geshi',$aa)/number:minutes | key('geshi',$aa)/number:am-pm | key('geshi',$aa)/number:seconds | key('geshi',$aa)/number:text">
+ <xsl:choose>
+ <xsl:when test="@number:style='long' ">
+ <xsl:if test="self::node( )[name(.)='number:hours']">HH</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:minutes']">MM</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:seconds']">SS</xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="self::node( )[name(.)='number:text']">
+ <xsl:value-of select="."/>
+ </xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:hours']">H</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:minutes']">M</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:seconds']">S</xsl:if>
+ <xsl:if test="self::node( )[name(.)='number:am-pm']">am/pm</xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="quote">"</xsl:variable>
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="concat('EDITTIME \@ ',$quote,$timefmt,$quote,' \* MERGEFORMAT ')"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="."/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:key name="path" match="//office:document/office:automatic-styles/style:style" use="@style:name"/>
+ <xsl:template name="text:table-of-content">
+ <xsl:element name="字:段落">
+ <xsl:attribute name="uof:locID">t0051</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:element name="字:段落属性">
+ <xsl:attribute name="uof:locID">t0052</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="text:index-body/text:p/@text:style-name"/></xsl:attribute>
+ <xsl:element name="字:制表位设置">
+ <xsl:attribute name="uof:locID">t0067</xsl:attribute>
+ <xsl:element name="字:制表位">
+ <xsl:attribute name="uof:locID">t0068</xsl:attribute>
+ <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
+ <xsl:variable name="aa" select="text:index-body/text:p/@text:style-name"/>
+ <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
+ <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
+ <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
+ <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="字:是否行首标点压缩">
+ <xsl:attribute name="uof:locID">t0075</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:中文习惯首尾字符">
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0076</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'REF'"/></xsl:attribute>
+ <xsl:if test="@text:protected">
+ <xsl:attribute name="字:锁定"><xsl:value-of select="@text:protected"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="'TOC \o 1-10 \h \z'"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ <xsl:for-each select="text:index-body/text:index-title/text:p">
+ <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
+ <xsl:element name="字:段落属性">
+ <xsl:attribute name="uof:locID">t0052</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:句">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </字:句属性>
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="self::node()"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="text:index-body/text:p">
+ <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
+ <xsl:element name="字:段落属性">
+ <xsl:attribute name="uof:locID">t0052</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ <xsl:element name="字:制表位设置">
+ <xsl:attribute name="uof:locID">t0067</xsl:attribute>
+ <xsl:element name="字:制表位">
+ <xsl:attribute name="uof:locID">t0068</xsl:attribute>
+ <xsl:attribute name="uof:attrList">位置 类型 前导符</xsl:attribute>
+ <xsl:variable name="aa" select="@text:style-name"/>
+ <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
+ <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
+ <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
+ <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="字:是否行首标点压缩">
+ <xsl:attribute name="uof:locID">t0075</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:中文习惯首尾字符">
+ <xsl:attribute name="字:值">true</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0076</xsl:attribute>
+ <xsl:attribute name="uof:attrList">值</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ <xsl:if test="self::node()/text:a">
+ <字:句 uof:locID="t0085">
+ <xsl:variable name="num">
+ <xsl:number from="/office:document/office:body/office:text" level="any" count="text:a"/>
+ </xsl:variable>
+ <xsl:element name="字:区域开始">
+ <xsl:attribute name="字:标识符"><xsl:value-of select="concat('hlnk',$num + 1)"/></xsl:attribute>
+ <xsl:attribute name="字:名称">Hyperlink</xsl:attribute>
+ <xsl:attribute name="字:类型">hyperlink</xsl:attribute>
+ <xsl:attribute name="uof:locID">t0121</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符 名称 类型</xsl:attribute>
+ </xsl:element>
+ <xsl:for-each select="text:a/node()">
+ <xsl:choose>
+ <xsl:when test="name(.)='text:tab-stop' or name(.)='text:tab'">
+ <xsl:element name="字:制表符" uof:locID="t0123"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ <xsl:element name="字:区域结束">
+ <xsl:attribute name="字:标识符引用"><xsl:value-of select="concat('hlnk',$num + 1)"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0122</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符引用</xsl:attribute>
+ </xsl:element>
+ <xsl:variable name="stt">
+ <xsl:value-of select="./text:a"/>
+ </xsl:variable>
+ <xsl:variable name="end">
+ <xsl:value-of select="."/>
+ </xsl:variable>
+ <xsl:variable name="bijiao">
+ <xsl:value-of select="substring-after($end,$stt)"/>
+ </xsl:variable>
+ <xsl:if test="not($bijiao='')">
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="$bijiao"/>
+ </xsl:element>
+ </xsl:if>
+ </字:句>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="text:alphabetical-index">
+ <xsl:element name="字:段落">
+ <xsl:attribute name="uof:locID">t0051</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:element name="字:段落属性">
+ <xsl:attribute name="uof:locID">t0052</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="text:index-body/text:p/@text:style-name"/></xsl:attribute>
+ <xsl:element name="字:制表位设置">
+ <xsl:attribute name="uof:locID">t0067</xsl:attribute>
+ <xsl:element name="字:制表位">
+ <xsl:attribute name="uof:locID">t0068</xsl:attribute>
+ <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
+ <xsl:variable name="aa" select="text:index-body/text:p/@text:style-name"/>
+ <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
+ <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
+ <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
+ <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'INDEX'"/></xsl:attribute>
+ <xsl:if test="@text:protected">
+ <xsl:attribute name="字:锁定"><xsl:value-of select="@text:protected"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:文本串>
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="'TOC \o 1-10 \h \z'"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ <xsl:for-each select="text:index-body/text:index-title/text:p">
+ <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
+ <xsl:element name="字:段落属性">
+ <xsl:attribute name="uof:locID">t0052</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="字:句">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用">
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ </字:句属性>
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="self::node()"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="text:index-body/text:p">
+ <xsl:element name="字:段落" uof:locID="t0051" uof:attrList="标识符">
+ <xsl:element name="字:段落属性">
+ <xsl:attribute name="uof:locID">t0052</xsl:attribute>
+ <xsl:attribute name="uof:attrList">式样引用</xsl:attribute>
+ <xsl:attribute name="字:式样引用"><xsl:value-of select="@text:style-name"/></xsl:attribute>
+ <xsl:element name="字:制表位设置">
+ <xsl:attribute name="uof:locID">t0067</xsl:attribute>
+ <xsl:element name="字:制表位">
+ <xsl:attribute name="uof:locID">t0068</xsl:attribute>
+ <xsl:attribute name="uof:attrList">位置 类型 前导符 制表位字符</xsl:attribute>
+ <xsl:variable name="aa" select="@text:style-name"/>
+ <xsl:attribute name="字:位置"><xsl:value-of select="substring-before(key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:position,$ooUnit)"/></xsl:attribute>
+ <xsl:attribute name="字:类型"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:type"/></xsl:attribute>
+ <xsl:attribute name="字:制表位字符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-text"/></xsl:attribute>
+ <xsl:if test="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style">
+ <xsl:attribute name="字:前导符"><xsl:value-of select="key('path',$aa)/style:paragraph-properties/style:tab-stops/style:tab-stop/@style:leader-style"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ <xsl:for-each select="node()">
+ <字:句 uof:locID="t0085">
+ <xsl:choose>
+ <xsl:when test="name(.)='text:tab-stop' or name(.)='text:tab'">
+ <xsl:element name="字:制表符" uof:locID="t0123"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="字:文本串">
+ <xsl:attribute name="uof:locID">t0109</xsl:attribute>
+ <xsl:attribute name="uof:attrList">标识符</xsl:attribute>
+ <xsl:value-of select="."/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </字:句>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="oo数字格式">
+ <xsl:param name="oo_format"/>
+ <xsl:choose>
+ <xsl:when test="$oo_format='1'">decimal</xsl:when>
+ <xsl:when test="$oo_format='I'">upper-roman</xsl:when>
+ <xsl:when test="$oo_format='i'">lower-roman</xsl:when>
+ <xsl:when test="$oo_format='A'">upper-letter</xsl:when>
+ <xsl:when test="$oo_format='a'">lower-letter</xsl:when>
+ <xsl:when test="$oo_format='1, 2, 3, ...'">decimal-full-width</xsl:when>
+ <xsl:when test="$oo_format='①, ②, ③, ...'">decimal-enclosed-circle</xsl:when>
+ <xsl:when test="$oo_format='一, 二, 三, ...'">chinese-counting</xsl:when>
+ <xsl:when test="$oo_format='壹, 贰, 叁, ...'">chinese-legal-simplified</xsl:when>
+ <xsl:when test="$oo_format='甲, 乙, 丙, ...'">ideograph-traditional</xsl:when>
+ <xsl:when test="$oo_format='子, 丑, 寅, ...'">ideograph-zodiac</xsl:when>
+ <xsl:otherwise>decimal</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="图:填充">
+ <xsl:param name="style-name"/>
+ <xsl:choose>
+ <xsl:when test="style:background-image/office:binary-data">
+ <图:图片 uof:locID="g0035" uof:attrList="位置 图形引用 类型 名称">
+ <xsl:attribute name="图:位置"><xsl:choose><xsl:when test="not(style:background-image/@style:repeat)">tile</xsl:when><xsl:otherwise><xsl:choose><xsl:when test="style:background-image/@style:repeat = 'stretch'">stretch</xsl:when><xsl:when test="style:background-image/@style:repeat = 'repeat'">tile</xsl:when><xsl:when test="style:background-image/@style:repeat = 'no-repeat'">center</xsl:when></xsl:choose></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="图:图形引用"><xsl:value-of select="concat('background-image_',count(preceding::style:background-image))"/></xsl:attribute>
+ <xsl:attribute name="图:类型">png</xsl:attribute>
+ <xsl:attribute name="图:名称">background-image</xsl:attribute>
+ </图:图片>
+ </xsl:when>
+ <xsl:when test="@fo:background-color">
+ <图:颜色 uof:locID="g0034">
+ <xsl:choose>
+ <xsl:when test="@fo:background-color='transparent' ">auto</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@fo:background-color"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </图:颜色>
+ </xsl:when>
+ <xsl:when test="@draw:fill='gradient'">
+ </xsl:when>
+ <xsl:when test="@draw:fill='hatch'">
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="字:缩进类型">
+ <xsl:if test="@text:space-before or @fo:margin-left">
+ <字:左 uof:locID="t0182">
+ <字:绝对 uof:locID="t0185" uof:attrList="值">
+ <xsl:if test="@text:space-before">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@text:space-before,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@fo:margin-left">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@fo:margin-left,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ </字:绝对>
+ </字:左>
+ </xsl:if>
+ <xsl:if test="@text:min-label-width or @fo:margin-right">
+ <字:右 uof:locID="t0183">
+ <字:绝对 uof:locID="t0187" uof:attrList="值">
+ <xsl:if test="@text:min-label-width">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@text:min-label-width,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@fo:margin-right">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@fo:margin-right,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ </字:绝对>
+ </字:右>
+ </xsl:if>
+ <xsl:if test="@text:min-label-distance or @fo:text-indent">
+ <字:首行 uof:locID="t0184">
+ <字:绝对 uof:locID="t0189" uof:attrList="值">
+ <xsl:if test="@text:min-label-distance">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@text:min-label-distance,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@fo:text-indent">
+ <xsl:attribute name="字:值"><xsl:value-of select="substring-before(@fo:text-indent,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ </字:绝对>
+ </字:首行>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="graphsize">
+ <xsl:param name="width"/>
+ <xsl:param name="Unitofsize"/>
+ <xsl:if test="$Unitofsize='pt'">
+ <xsl:choose>
+ <xsl:when test="(not($width&gt;1.42) and 0&lt;$width)">1</xsl:when>
+ <xsl:when test="(not($width&gt;2.84) and 1.42&lt;$width)">2</xsl:when>
+ <xsl:when test="(not($width&gt;4.26) and 2.84&lt;$width)">3</xsl:when>
+ <xsl:when test="(not($width&gt;5.68) and 4.26&lt;$width)">4</xsl:when>
+ <xsl:when test="(not($width&gt;7.10) and 5.68&lt;$width)">5</xsl:when>
+ <xsl:when test="(not($width&gt;8.52) and 7.10&lt;$width)">6</xsl:when>
+ <xsl:when test="(not($width&gt;9.94) and 8.52&lt;$width)">7</xsl:when>
+ <xsl:when test="(not($width&gt;11.36) and 9.94&lt;$width)">8</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="$uofUnit='in'">
+ <xsl:choose>
+ <xsl:when test="(not($width&gt;0.02) and 0&lt;$width)">1</xsl:when>
+ <xsl:when test="(not($width&gt;0.04) and 0.02&lt;$width)">2</xsl:when>
+ <xsl:when test="(not($width&gt;0.06) and 0.04&lt;$width)">3</xsl:when>
+ <xsl:when test="(not($width&gt;0.08) and 0.06&lt;$width)">4</xsl:when>
+ <xsl:when test="(not($width&gt;0.10) and 0.08&lt;$width)">5</xsl:when>
+ <xsl:when test="(not($width&gt;0.12) and 0.10&lt;$width)">6</xsl:when>
+ <xsl:when test="(not($width&gt;0.14) and 0.12&lt;$width)">7</xsl:when>
+ <xsl:when test="(not($width&gt;0.16) and 0.14&lt;$width)">8</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="$uofUnit='mm'">
+ <xsl:choose>
+ <xsl:when test="(not($width&gt;0.5) and 0&lt;$width) or $width=0.5">1</xsl:when>
+ <xsl:when test="(not($width&gt;1.0) and 0.5&lt;$width) or $width=1.0">2</xsl:when>
+ <xsl:when test="(not($width&gt;1.5) and 0.10&lt;$width) or $width=1.5">3</xsl:when>
+ <xsl:when test="(not($width&gt;2.0) and 1.5&lt;$width) or $width=2.0">4</xsl:when>
+ <xsl:when test="(not($width&gt;2.5) and 2.0&lt;$width) or $width=2.5">5</xsl:when>
+ <xsl:when test="(not($width&gt;3.0) and 2.5&lt;$width) or $width=3.0">6</xsl:when>
+ <xsl:when test="(not($width&gt;3.5) and 3.0&lt;$width) or $width=3.5">7</xsl:when>
+ <xsl:when test="(not($width&gt;4.0) and 3.5&lt;$width) or $width=4.0">8</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="$uofUnit='cm'">
+ <xsl:choose>
+ <xsl:when test="(not($width&gt;0.05) and 0&lt;$width) or $width=0.05">1</xsl:when>
+ <xsl:when test="(not($width&gt;0.10) and 0.05&lt;$width) or $width=0.10">2</xsl:when>
+ <xsl:when test="(not($width&gt;0.15) and 0.10&lt;$width) or $width=0.15">3</xsl:when>
+ <xsl:when test="(not($width&gt;0.20) and 0.15&lt;$width) or $width=0.20">4</xsl:when>
+ <xsl:when test="(not($width&gt;0.25) and 0.20&lt;$width) or $width=0.25">5</xsl:when>
+ <xsl:when test="(not($width&gt;0.30) and 0.25&lt;$width) or $width=0.30">6</xsl:when>
+ <xsl:when test="(not($width&gt;0.35) and 0.30&lt;$width) or $width=0.35">7</xsl:when>
+ <xsl:when test="(not($width&gt;0.40) and 0.35&lt;$width) or $width=0.40">8</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="text:character-count">
+ <xsl:element name="字:域开始">
+ <xsl:attribute name="字:类型"><xsl:value-of select="'numchars'"/></xsl:attribute>
+ <xsl:attribute name="uof:locID">t0079</xsl:attribute>
+ <xsl:attribute name="uof:attrList">类型 锁定</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="text:fixed='1'or text:fixed='true'">
+ <xsl:attribute name="字:锁定">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="字:锁定">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="字:域代码">
+ <xsl:attribute name="uof:locID">t0080</xsl:attribute>
+ <字:段落 uof:locID="t0051" uof:attrList="标识符">
+ <字:句 uof:locID="t0085">
+ <字:句属性 uof:locID="t0086" uof:attrList="式样引用"/>
+ <xsl:variable name="quote" select="'&quot;'"/>
+ <xsl:variable name="fmt">
+ <xsl:call-template name="oo数字格式域开关">
+ <xsl:with-param name="oo_format" select="@style:num-format"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">
+ <xsl:value-of select="concat('NUMCHARS \* ',$fmt,' \# ',$quote,0,$quote)"/>
+ </字:文本串>
+ </字:句>
+ </字:段落>
+ </xsl:element>
+ <字:句 uof:locID="t0085">
+ <字:文本串 uof:locID="t0109" uof:attrList="标识符">
+ <xsl:value-of select="."/>
+ </字:文本串>
+ </字:句>
+ <xsl:element name="字:域结束">
+ <xsl:attribute name="uof:locID">t0081</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <!-- measure_conversion.xsl Begin-->
+ <!--xsl:param name="dpi" select="111"/>
+ <xsl:param name="centimeter-in-mm" select="10"/>
+ <xsl:param name="inch-in-mm" select="25.4"/>
+ <xsl:param name="didot-point-in-mm" select="0.376065"/>
+ <xsl:param name="pica-in-mm" select="4.2333333"/>
+ <xsl:param name="point-in-mm" select="0.3527778"/>
+ <xsl:param name="twip-in-mm" select="0.017636684"/>
+ <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/-->
+ <!-- ***** MEASUREMENT CONVERSIONS *****
+ PARAM 'value'
+ The measure to be converted.
+ The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
+ directly added to the number.
- PARAM 'rounding-factor'
- Is used for the rounding of decimal places.
- The parameter number is the product of 1 and some '10', where
- every zero represents a decimal place.
+ PARAM 'rounding-factor'
+ Is used for the rounding of decimal places.
+ The parameter number is the product of 1 and some '10', where
+ every zero represents a decimal place.
- For example, providing as parameter:
- <xsl:param name="rounding-factor" select="10000" />
- Gives by default four decimal places.
+ For example, providing as parameter:
+ <xsl:param name="rounding-factor" select="10000" />
+ Gives by default four decimal places.
- To round two decimal places, basically the following is done:
- <xsl:value-of select="round(100 * value) div 100"/>
+ To round two decimal places, basically the following is done:
+ <xsl:value-of select="round(100 * value) div 100"/>
- RETURN The converted number, by default rounded to four decimal places.
- In case the input measure could not be matched the same value is
- returned and a warning message is written out.
+ RETURN The converted number, by default rounded to four decimal places.
+ In case the input measure could not be matched the same value is
+ returned and a warning message is written out.
- MEASURE LIST:
- * 1 milimeter (mm), the basic measure
+ MEASURE LIST:
+ * 1 milimeter (mm), the basic measure
- * 1 centimeter (cm) = 10 mm
+ * 1 centimeter (cm) = 10 mm
- * 1 inch (in) = 25.4 mm
- While the English have already seen the light (read: the metric system), the US
- remains loyal to this medieval system.
+ * 1 inch (in) = 25.4 mm
+ While the English have already seen the light (read: the metric system), the US
+ remains loyal to this medieval system.
- * 1 point (pt) = 0.35277777.. mm
- Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
- There are exactly 72 PostScript points in 1 inch.
+ * 1 point (pt) = 0.35277777.. mm
+ Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
+ There are exactly 72 PostScript points in 1 inch.
- * 1 twip = twentieth of a (PostScript) point
- A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
+ * 1 twip = twentieth of a (PostScript) point
+ A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
- * 1 didot point (dpt) = 0.376065 mm
- Didot point after the French typographer Firmin Didot (1764-1836).
+ * 1 didot point (dpt) = 0.376065 mm
+ Didot point after the French typographer Firmin Didot (1764-1836).
- More details under
- http://www.unc.edu/~rowlett/units/dictP.html:
- "A unit of length used by typographers and printers. When printing was done
- from hand-set metal type, one point represented the smallest element of type
- that could be handled, roughly 1/64 inch. Eventually, the point was standardized
- in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
- about 0.35 mm (351.46 micrometers). In continental Europe, typographers
- traditionally used a slightly larger point of 0.014 83 inch (about
- 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
- after the French typographer Firmin Didot (1764-1836). In the U.S.,
- Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
- or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
- of 0.351 459 8035 mm. The German standards agency DIN has proposed that
- all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
+ More details under
+ http://www.unc.edu/~rowlett/units/dictP.html:
+ "A unit of length used by typographers and printers. When printing was done
+ from hand-set metal type, one point represented the smallest element of type
+ that could be handled, roughly 1/64 inch. Eventually, the point was standardized
+ in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
+ about 0.35 mm (351.46 micrometers). In continental Europe, typographers
+ traditionally used a slightly larger point of 0.014 83 inch (about
+ 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
+ after the French typographer Firmin Didot (1764-1836). In the U.S.,
+ Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
+ or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
+ of 0.351 459 8035 mm. The German standards agency DIN has proposed that
+ all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
- * 1 pica = 4.233333 mm
- 1/6 inch or 12 points
+ * 1 pica = 4.233333 mm
+ 1/6 inch or 12 points
- * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
- Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
+ * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
+ Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
- -->
- <!-- changing measure to mm -->
- <!--xsl:template name="convert2cm">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, $uofUnit)">
- <xsl:value-of select="substring-before($value, $uofUnit)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template-->
+ -->
+ <!-- changing measure to mm -->
+ <!--xsl:template name="convert2cm">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, $uofUnit)">
+ <xsl:value-of select="substring-before($value, $uofUnit)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template-->
</xsl:stylesheet>
diff --git a/filter/source/xslt/export/wordml/ooo2wordml_border.xsl b/filter/source/xslt/export/wordml/ooo2wordml_border.xsl
index ac3bde0e703f..affd1f7aebbb 100644
--- a/filter/source/xslt/export/wordml/ooo2wordml_border.xsl
+++ b/filter/source/xslt/export/wordml/ooo2wordml_border.xsl
@@ -39,24 +39,24 @@
</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 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'">
diff --git a/filter/source/xslt/export/wordml/ooo2wordml_draw.xsl b/filter/source/xslt/export/wordml/ooo2wordml_draw.xsl
index 8404669b3f11..18495dcf2c2f 100644
--- a/filter/source/xslt/export/wordml/ooo2wordml_draw.xsl
+++ b/filter/source/xslt/export/wordml/ooo2wordml_draw.xsl
@@ -17,1744 +17,1744 @@
* 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" xmlns:ole="http://libreoffice.org/2011/xslt/ole" exclude-result-prefixes="office table style text draw svg dc config xlink meta oooc dom ooo chart math dr3d form script ooow ole">
- <xsl:include href="ooo2wordml_custom_draw.xsl"/>
-
- <xsl:key name="stroke-dash-style" match="draw:stroke-dash" use="@draw:name"/>
- <xsl:key name="fill-image" match="draw:fill-image" use="@draw:name"/>
- <xsl:key name="draw-gradient" match="draw:gradient " use="@draw:name"/>
- <xsl:template name="PageLevelGraphic">
- <xsl:for-each select="//draw:*[@text:anchor-type='page']">
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="draw:*">
- <xsl:param name="TargetMeasure" select="'pt'"/>
- <xsl:param name="x-adjust" select="0"/>
- <xsl:param name="y-adjust" select="0"/>
- <xsl:param name="force-draw" select="'false'"/>
- <xsl:variable name="MeasureMark">
- <xsl:choose>
- <xsl:when test="$TargetMeasure = 'twip'"/>
- <xsl:otherwise>
- <xsl:value-of select="$TargetMeasure"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <!--
- deal with captions and frames first. draw:text-box is a powerful element in OOo, its GUI name is frame. And OOo use it to contain Captions
- Since there is not a corresponding object in word, so we draw the text-box itself and its children separately. If it look like a Caption only frame
- we'll adjust the text-box position to make it look pretty
- -->
- <!-- skip all not force draw children , must be first case -->
- <xsl:when test="ancestor::draw:text-box and $force-draw='false' "/>
- <xsl:when test="name() = 'draw:text-box'">
- <!-- draw the text-box itself -->
- <w:r>
- <w:pict>
- <xsl:variable name="text-y-adjust">
- <xsl:choose>
- <xsl:when test="count(text:p/draw:*) = 1 and (string-length(text:p/draw:*[position()=1]/@svg:x) =0 or number(concat('0',translate(text:p/draw:*[position()=1]/@svg:x,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','') ))=0) and (string-length(text:p/draw:*[position()=1]/@svg:y)=0 or number(concat('0',translate(text:p/draw:*[position()=1]/@svg:x,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','') ))=0 ) ">
- <xsl:variable name="pic-height">
- <xsl:choose>
- <xsl:when test="name(text:p/draw:*[position()=1]) = 'draw:g' or name(text:p/draw:*[position()=1]) = 'draw:a'">
- <xsl:variable name="BigestWindow">
- <xsl:call-template name="GetWindowSize">
- <xsl:with-param name="nodeSet" select="text:p/draw:*[position()=1]/draw:*"/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="number(substring-after($BigestWindow,'y2:')) - number(substring-after(substring-before($BigestWindow,';x2'), 'y1:')) + number(concat('0',translate($y-adjust,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','')))"/>
- </xsl:when>
- <xsl:when test="text:p/draw:*[position()=1]/@svg:height">
- <xsl:call-template name="Add-With-Measure">
- <xsl:with-param name="value1" select="text:p/draw:*[position()=1]/@svg:height"/>
- <xsl:with-param name="value2" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="text:p/draw:*[position()=1]/@fo:min-height">
- <xsl:call-template name="Add-With-Measure">
- <xsl:with-param name="value1" select="text:p/draw:*[position()=1]/@fo:min-height"/>
- <xsl:with-param name="value2" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="ancestor::draw:frame">
- <xsl:call-template name="Add-With-Measure">
- <xsl:with-param name="value1" select="ancestor::draw:frame/@svg:height"/>
- <xsl:with-param name="value2" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="min-height">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="'in'"/>
- <xsl:with-param name="value" select="@fo:min-height"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$min-height - $pic-height &lt; 0.001">
- <!-- If control goes here, it much like that this text-box is used for contain graphic caption only -->
- <xsl:value-of select="$pic-height - 0.1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$y-adjust"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$y-adjust"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="shape-type">
- <xsl:choose>
- <xsl:when test="$text-y-adjust = $y-adjust">
- <xsl:value-of select="'#_x0000_t202'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="DrawElements">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$text-y-adjust"/>
- <xsl:with-param name="force-draw" select="'true'"/>
- <xsl:with-param name="shape-type" select="$shape-type"/>
- </xsl:call-template>
- </w:pict>
- </w:r>
- <!-- draw the real object first -->
- <xsl:if test="./text:p/draw:*">
- <xsl:apply-templates select="./text:p/draw:*">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="x-adjust">
- <xsl:call-template name="Add-With-Measure">
- <xsl:with-param name="value1" select="@svg:x"/>
- <xsl:with-param name="value2" select="$x-adjust"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="y-adjust">
- <xsl:call-template name="Add-With-Measure">
- <xsl:with-param name="value1" select="@svg:y"/>
- <xsl:with-param name="value2" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="force-draw" select="'true'"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:when>
- <!-- end deal with captions and frames -->
- <xsl:when test=" name() = 'draw:frame' ">
- <xsl:variable name="BigestWindow">
- <xsl:call-template name="GetWindowSize">
- <xsl:with-param name="nodeSet" select="."/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:apply-templates select="draw:* ">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="x-adjust" select="concat(substring-after(substring-before($BigestWindow,';y1'), 'x1:'), 'in')"/>
- <xsl:with-param name="y-adjust" select="concat(substring-after(substring-before($BigestWindow,';x2'), 'y1:') , 'in')"/>
- <xsl:with-param name="force-draw" select="$force-draw"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="name() = 'draw:g'">
- <w:r>
- <w:pict>
- <xsl:element name="v:group">
- <xsl:variable name="BigestWindow">
- <xsl:choose>
- <xsl:when test="name() = 'draw:g'">
- <xsl:call-template name="GetWindowSize">
- <xsl:with-param name="nodeSet" select="draw:*"/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name() = 'draw:frame'">
- <xsl:call-template name="GetWindowSize">
- <xsl:with-param name="nodeSet" select="."/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="x">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="concat(substring-after(substring-before($BigestWindow,';y1'), 'x1:'), 'in')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="y">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="concat(substring-after(substring-before($BigestWindow,';x2'), 'y1:') , 'in')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="width">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="concat(number(substring-after(substring-before($BigestWindow,';y2'), 'x2:')) - number(substring-after(substring-before($BigestWindow,';y1'), 'x1:')) , 'in')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="height">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="concat(number(substring-after($BigestWindow,'y2:')) - number(substring-after(substring-before($BigestWindow,';x2'), 'y1:')), 'in')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="id">
- <xsl:value-of select="generate-id()"/>
- </xsl:attribute>
- <xsl:variable name="absolute">
- <xsl:choose>
- <xsl:when test="ancestor::draw:a"/>
- <xsl:when test="@text:anchor-type = 'as-char' or @text:anchor-type = 'to-char'"/>
- <xsl:otherwise>position:absolute</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$TargetMeasure= 'pt'">
- <xsl:attribute name="style">
- <xsl:if test="string-length($absolute) &gt; 0">
- <xsl:value-of select="concat($absolute, ';')"/>
- </xsl:if>
- <xsl:value-of select="concat('margin-left:',$x ,$MeasureMark,';margin-top:', $y,$MeasureMark ,';width:', $width ,$MeasureMark , ';height:', $height,$MeasureMark)"/>
- </xsl:attribute>
- <xsl:attribute name="coordorigin">
- <xsl:choose>
- <!-- if we are in a text-box then oo will use comparative positions on us-->
- <xsl:when test="name() = 'draw:frame' ">
- <xsl:value-of select=" '0 0' "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat(round($x * 20), ',' , round($y * 20))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="coordsize">
- <xsl:value-of select="concat(round($width * 20),',', round($height * 20) )"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$TargetMeasure= 'twip' ">
- <xsl:attribute name="style">
- <xsl:if test="string-length($absolute) &gt; 0">
- <xsl:value-of select="concat($absolute, ';')"/>
- </xsl:if>
- <xsl:value-of select="concat('left:',$x ,$MeasureMark,';top:', $y,$MeasureMark ,';width:', $width ,$MeasureMark , ';height:', $height,$MeasureMark)"/>
- </xsl:attribute>
- <xsl:attribute name="coordorigin">
- <xsl:choose>
- <!-- if we are in a text-box then oo will use comparative positions on us-->
- <xsl:when test="name() = 'draw:frame' ">
- <xsl:value-of select=" '0 0' "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($x , ',' , $y)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="coordsize">
- <xsl:value-of select="concat($width,',', $height )"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <!-- if we are in a text-box then oo will use comparative positions on us-->
- <xsl:when test="ancestor::draw:text-box">
- <xsl:apply-templates select="draw:*">
- <xsl:with-param name="TargetMeasure" select="'twip'"/>
- <xsl:with-param name="x-adjust" select="concat(substring-after(substring-before($BigestWindow,';y1'), 'x1:'), 'in')"/>
- <xsl:with-param name="y-adjust" select="concat(substring-after(substring-before($BigestWindow,';x2'), 'y1:') , 'in')"/>
- <xsl:with-param name="force-draw" select="$force-draw"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="draw:*">
- <xsl:with-param name="TargetMeasure" select="'twip'"/>
- <xsl:with-param name="force-draw" select="$force-draw"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </w:pict>
- </w:r>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="name() = 'draw:a'">
- <xsl:call-template name="export_hyoerlink">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$y-adjust"/>
- <xsl:with-param name="force-draw" select="$force-draw"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <w:r>
- <w:pict>
- <xsl:call-template name="DrawElements">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$y-adjust"/>
- <xsl:with-param name="force-draw" select="$force-draw"/>
- </xsl:call-template>
- </w:pict>
- </w:r>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="GetWindowSize">
- <xsl:param name="CurrPos" select="1"/>
- <xsl:param name="nodeSet"/>
- <xsl:param name="x-adjust" select="0"/>
- <xsl:param name="y-adjust" select="0"/>
- <xsl:variable name="CurrNodeWindow">
- <xsl:call-template name="GetNodeWindow">
- <xsl:with-param name="CurrNode" select=" $nodeSet[ $CurrPos ]"/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <!-- if we got to the last node, return it directly, or return the max window of current one and following ones -->
- <xsl:when test="$CurrPos = count($nodeSet)">
- <xsl:value-of select="$CurrNodeWindow"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="CurrentWindow">
- <xsl:variable name="FollowingWindow">
- <xsl:call-template name="GetWindowSize">
- <xsl:with-param name="nodeSet" select="$nodeSet"/>
- <xsl:with-param name="CurrPos" select="$CurrPos + 1"/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="GetBigestWindows">
- <xsl:with-param name="Window1" select="$CurrNodeWindow"/>
- <xsl:with-param name="Window2" select="$FollowingWindow"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$CurrentWindow"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="GetNodeWindow">
- <xsl:param name="CurrNode"/>
- <xsl:param name="x-adjust" select="0"/>
- <xsl:param name="y-adjust" select="0"/>
- <xsl:choose>
- <xsl:when test="name($CurrNode)='draw:g'">
- <xsl:call-template name="GetWindowSize">
- <xsl:with-param name="nodeSet" select="$CurrNode/draw:*"/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="x">
- <xsl:call-template name="Add-With-Measure">
- <xsl:with-param name="value1" select="$CurrNode/@svg:x"/>
- <xsl:with-param name="value2" select="$x-adjust"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="y">
- <xsl:call-template name="Add-With-Measure">
- <xsl:with-param name="value1" select="$CurrNode/@svg:y"/>
- <xsl:with-param name="value2" select="$y-adjust"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="width">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="value" select="$CurrNode/@svg:width"/>
- <xsl:with-param name="TargetMeasure" select="'in'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="height">
- <xsl:choose>
- <xsl:when test="$CurrNode/@svg:height">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="value" select="$CurrNode/@svg:height"/>
- <xsl:with-param name="TargetMeasure" select="'in'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$CurrNode/@fo:min-height">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="value" select="$CurrNode/@fo:min-height"/>
- <xsl:with-param name="TargetMeasure" select="'in'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="concat('x1:' , $x, ';y1:' , $y, ';x2:' , string($x + $width), ';y2:', string($y + $height) ) "/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="GetBigestWindows">
- <xsl:param name="Window1"/>
- <xsl:param name="Window2"/>
- <xsl:variable name="w1x1" select="substring-after( substring-before($Window1,';y1'),'x1:') "/>
- <xsl:variable name="w2x1" select="substring-after( substring-before($Window2,';y1'),'x1:') "/>
- <xsl:variable name="w1y1" select="substring-after( substring-before($Window1,';x2'),'y1:') "/>
- <xsl:variable name="w2y1" select="substring-after( substring-before($Window2,';x2'),'y1:') "/>
- <xsl:variable name="w1x2" select="substring-after( substring-before($Window1,';y2'),'x2:') "/>
- <xsl:variable name="w2x2" select="substring-after( substring-before($Window2,';y2'),'x2:') "/>
- <xsl:variable name="w1y2" select="substring-after( $Window1,';y2:') "/>
- <xsl:variable name="w2y2" select="substring-after( $Window2,';y2:') "/>
- <xsl:variable name="x1">
- <xsl:choose>
- <xsl:when test="$w1x1 &gt; $w2x1">
- <xsl:value-of select="$w2x1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$w1x1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="y1">
- <xsl:choose>
- <xsl:when test="$w1y1 &gt; $w2y1">
- <xsl:value-of select="$w2y1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$w1y1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="x2">
- <xsl:choose>
- <xsl:when test="$w1x2 &gt; $w2x2">
- <xsl:value-of select="$w1x2"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$w2x2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="y2">
- <xsl:choose>
- <xsl:when test="$w1y2 &gt; $w2y2">
- <xsl:value-of select="$w1y2"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$w2y2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="concat('x1:' , $x1 , ';y1:' , $y1 , ';x2:' , $x2, ';y2:' , $y2)"/>
- </xsl:template>
- <!-- convert percent value to x% numeric x/100 -->
- <xsl:template name="ValueOfPercent">
- <xsl:param name="value"/>
- <xsl:choose>
- <xsl:when test="contains($value, '%')">
- <xsl:value-of select="substring-before($value, '%') div 100"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="points2points">
- <xsl:param name="input_points"/>
- <xsl:param name="input_x"/>
- <xsl:param name="input_y"/>
- <xsl:param name="input_width"/>
- <xsl:param name="input_height"/>
- <xsl:param name="input_boxwidth"/>
- <xsl:param name="input_boxheight"/>
- <xsl:variable name="onepoint" select="substring($input_points,1,string-length($input_points) - string-length(substring-after($input_points,' ')) )"/>
- <xsl:if test="substring-before($input_points,' ')">
- <xsl:value-of select="round($input_x + (($input_boxwidth - number(substring-before($onepoint,','))) ) * $input_width div $input_boxwidth)"/>
- <xsl:value-of select="'pt,'"/>
- <xsl:value-of select="round($input_y + ((number(substring-after($onepoint,',')) ) ) * $input_height div $input_boxheight)"/>
- <xsl:value-of select="'pt'"/>
- </xsl:if>
- <xsl:if test="string-length(substring($input_points,string-length($onepoint) + 1)) &gt; 0">
- <xsl:value-of select="','"/>
- <xsl:call-template name="points2points">
- <xsl:with-param name="input_points" select="substring($input_points,string-length($onepoint) + 1)"/>
- <xsl:with-param name="input_x" select="$input_x"/>
- <xsl:with-param name="input_y" select="$input_y"/>
- <xsl:with-param name="input_width" select="$input_width"/>
- <xsl:with-param name="input_height" select="$input_height"/>
- <xsl:with-param name="input_boxwidth" select="$input_boxwidth"/>
- <xsl:with-param name="input_boxheight" select="$input_boxheight"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="path2path">
- <xsl:param name="input_points"/>
- <xsl:param name="x_or_y" select="'x'"/>
- <xsl:param name="input_x"/>
- <xsl:param name="input_y"/>
- <xsl:param name="input_width"/>
- <xsl:param name="input_height"/>
- <xsl:param name="input_boxwidth"/>
- <xsl:param name="input_boxheight"/>
- <xsl:variable name="space-pos" select="string-length($input_points) - string-length(substring-after($input_points,' '))"/>
- <xsl:variable name="minus-pos" select="string-length($input_points) - string-length(substring-after($input_points,'-'))"/>
- <xsl:variable name="m-pos" select="string-length($input_points) - string-length(substring-after($input_points,'m'))"/>
- <xsl:variable name="c-pos" select="string-length($input_points) - string-length(substring-after($input_points,'c'))"/>
- <xsl:variable name="e-pos" select="string-length($input_points) - string-length(substring-after($input_points,'e'))"/>
- <xsl:variable name="min1">
- <xsl:choose>
- <xsl:when test="$space-pos &lt; $minus-pos">
- <xsl:value-of select="$space-pos"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$minus-pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="min2">
- <xsl:choose>
- <xsl:when test="$m-pos &lt; $min1">
- <xsl:value-of select="$m-pos"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$min1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="min3">
- <xsl:choose>
- <xsl:when test="$c-pos &lt; $min2">
- <xsl:value-of select="$c-pos"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$min2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="min4">
- <xsl:choose>
- <xsl:when test="$e-pos &lt; $min3">
- <xsl:value-of select="$e-pos"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$min3"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="min-special-char-pos" select="$min4"/>
- <xsl:variable name="special-char" select="substring($input_points,$min-special-char-pos,1)"/>
- <xsl:variable name="one-value" select="substring($input_points,1,$min-special-char-pos - 1)"/>
- <xsl:variable name="left-points" select="substring($input_points,$min-special-char-pos + 1)"/>
- <xsl:if test="not($special-char = 'm')">
- <xsl:if test="$x_or_y = 'x'">
- <xsl:value-of select="round($input_x + $one-value * $input_width div $input_boxwidth)"/>
- </xsl:if>
- <xsl:if test="$x_or_y = 'y'">
- <xsl:value-of select="round($input_y + $one-value * $input_height div $input_boxheight)"/>
- </xsl:if>
- </xsl:if>
- <!-- output the separator-->
- <xsl:choose>
- <xsl:when test="$special-char = '-' or $special-char = ' ' ">
- <xsl:value-of select="','"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$special-char"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="next-xy">
- <xsl:if test="$x_or_y = 'x'">
- <xsl:value-of select="'y'"/>
- </xsl:if>
- <xsl:if test="$x_or_y = 'y'">
- <xsl:value-of select="'x'"/>
- </xsl:if>
- </xsl:variable>
- <xsl:if test="string-length($left-points) &gt; 0">
- <xsl:call-template name="path2path">
- <xsl:with-param name="input_points" select="$left-points"/>
- <xsl:with-param name="x_or_y" select="$next-xy"/>
- <xsl:with-param name="input_x" select="$input_x"/>
- <xsl:with-param name="input_y" select="$input_y"/>
- <xsl:with-param name="input_width" select="$input_width"/>
- <xsl:with-param name="input_height" select="$input_height"/>
- <xsl:with-param name="input_boxwidth" select="$input_boxwidth"/>
- <xsl:with-param name="input_boxheight" select="$input_boxheight"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="get_dashstyle">
- <xsl:param name="stroke-width" select="0.1"/>
- <xsl:param name="style-name" select="@draw:style-name"/>
- <xsl:variable name="graph-style" select="key('graphics-style', $style-name)/style:graphic-properties"/>
- <xsl:variable name="dash-style" select="key('stroke-dash-style', $graph-style/@draw:stroke-dash)"/>
- <xsl:variable name="stroke">
- <xsl:choose>
- <xsl:when test="$graph-style/@draw:stroke">
- <xsl:value-of select="$graph-style/@draw:stroke"/>
- </xsl:when>
- <xsl:when test="$dash-style/@draw:stroke">
- <xsl:value-of select="$dash-style/@draw:stroke"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$stroke = 'solid' ">
- <xsl:value-of select="$stroke"/>
- </xsl:when>
- <xsl:when test="$stroke = 'dash'">
- <xsl:variable name="dots1">
- <xsl:choose>
- <xsl:when test="$graph-style/@draw:dots1">
- <xsl:value-of select="$graph-style/@draw:dots1"/>
- </xsl:when>
- <xsl:when test="$dash-style/@draw:dots1">
- <xsl:value-of select="$dash-style/@draw:dots1"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="dots2">
- <xsl:choose>
- <xsl:when test="$graph-style/@draw:dots1">
- <xsl:value-of select="$graph-style/@draw:dots2"/>
- </xsl:when>
- <xsl:when test="$dash-style/@draw:dots1">
- <xsl:value-of select="$dash-style/@draw:dots2"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="dots1-length">
- <xsl:choose>
- <xsl:when test="$graph-style/@draw:dots1-length">
- <xsl:value-of select="$graph-style/@draw:dots1-length"/>
- </xsl:when>
- <xsl:when test="$dash-style/@draw:dots1-length">
- <xsl:value-of select="$dash-style/@draw:dots1-length"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="dots2-length">
- <xsl:choose>
- <xsl:when test="$graph-style/@draw:dots2-length">
- <xsl:value-of select="$graph-style/@draw:dots2-length"/>
- </xsl:when>
- <xsl:when test="$dash-style/@draw:dots2-length">
- <xsl:value-of select="$dash-style/@draw:dots2-length"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="distance">
- <xsl:choose>
- <xsl:when test="$graph-style/@draw:distance">
- <xsl:value-of select="$graph-style/@draw:distance"/>
- </xsl:when>
- <xsl:when test="$dash-style/@draw:distance">
- <xsl:value-of select="$dash-style/@draw:distance"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="dot1-step">
- <xsl:choose>
- <xsl:when test="contains($dots1-length,'%')">
- <xsl:variable name="dots-percent">
- <xsl:call-template name="ValueOfPercent">
- <xsl:with-param name="value" select="$dots1-length"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="round($dots-percent)"/>
- </xsl:when>
- <xsl:when test="contains($dots1-length , 'in' ) and $stroke-width &gt; 0">
- <xsl:value-of select="round( number(substring-before($dots1-length,'in' )) div $stroke-width )"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="dot2-step">
- <xsl:choose>
- <xsl:when test="contains($dots2-length,'%')">
- <xsl:variable name="dots-percent">
- <xsl:call-template name="ValueOfPercent">
- <xsl:with-param name="value" select="$dots2-length"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="round($dots-percent)"/>
- </xsl:when>
- <xsl:when test="contains($dots2-length,'in') and $stroke-width &gt; 0">
- <xsl:value-of select="round(number(substring-before($dots2-length,'in')) div $stroke-width)"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="distance-step">
- <xsl:choose>
- <xsl:when test="contains($distance,'%')">
- <xsl:variable name="dots-percent">
- <xsl:call-template name="ValueOfPercent">
- <xsl:with-param name="value" select="$distance"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="round($dots-percent)"/>
- </xsl:when>
- <xsl:when test="contains($distance,'in') and $stroke-width &gt; 0">
- <xsl:value-of select="round(number(substring-before($distance,'in')) div $stroke-width)"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="dashstyle">
- <xsl:choose>
- <xsl:when test="$dots1 = 1 and $dots2 = 1 and $dot1-step = 0 and $dot2-step = 0 and $distance-step = 0">
- <xsl:value-of select="'ShortDot'"/>
- </xsl:when>
- <xsl:when test="$dots2 = 0 and $dot1-step = 0 and $dot2-step = 0 and $distance-step &gt; 0">
- <xsl:value-of select="concat('0 ', $distance-step)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="create_dashstyle">
- <xsl:with-param name="dot-count" select="$dots1"/>
- <xsl:with-param name="dot-step" select="$dot1-step"/>
- <xsl:with-param name="distance-step" select="$distance-step"/>
- </xsl:call-template>
- <xsl:value-of select="' '"/>
- <xsl:call-template name="create_dashstyle">
- <xsl:with-param name="dot-count" select="$dots2"/>
- <xsl:with-param name="dot-step" select="$dot2-step"/>
- <xsl:with-param name="distance-step" select="$distance-step"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$dashstyle"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="create_dashstyle">
- <xsl:param name="dot-count"/>
- <xsl:param name="dot-step"/>
- <xsl:param name="distance-step"/>
- <xsl:if test="$dot-count &gt; 0">
- <xsl:value-of select="concat($dot-step, ' ' , $distance-step )"/>
- <xsl:if test="$dot-count - 1 &gt; 0">
- <xsl:value-of select="' '"/>
- <xsl:call-template name="create_dashstyle">
- <xsl:with-param name="dot-count" select="$dot-count - 1"/>
- <xsl:with-param name="dot-step" select="$dot-step"/>
- <xsl:with-param name="distance-step" select="$distance-step"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:template>
- <xsl:template name="get_borderstyle">
- <xsl:param name="border"/>
- <xsl:param name="border-line-width"/>
- <xsl:choose>
- <xsl:when test="contains($border,'solid')">
- <xsl:variable name="strokeweight">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="value" select="substring-before($border, ' ')"/>
- <xsl:with-param name="TargetMeasure" select="'pt'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat ( 'strokeweight:', $strokeweight)"/>
- </xsl:when>
- <xsl:when test="contains($border,'double')">
- <xsl:variable name="outside">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="value" select="substring-after(substring-after($border-line-width, ' ') , ' ')"/>
- <xsl:with-param name="TargetMeasure" select="'pt'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="inside">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="value" select="substring-before($border-line-width, ' ')"/>
- <xsl:with-param name="TargetMeasure" select="'pt'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="space">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="value" select="substring-before(substring-after($border-line-width, ' ') , ' ')"/>
- <xsl:with-param name="TargetMeasure" select="'pt'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="linestyle">
- <xsl:choose>
- <xsl:when test="$outside = $inside">
- <xsl:value-of select="'thinThin'"/>
- </xsl:when>
- <xsl:when test="$outside &gt; $inside">
- <xsl:value-of select="'thickThin'"/>
- </xsl:when>
- <xsl:when test="$outside &lt; $inside">
- <xsl:value-of select="'thinThick'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="strokeweight" select="$inside + $outside + $space"/>
- <xsl:value-of select="concat( 'linestyle:' , $linestyle , ';' , 'strokeweight:' , $strokeweight )"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="DrawElements">
- <xsl:param name="TargetMeasure" select="pt"/>
- <xsl:param name="x-adjust" select="0"/>
- <xsl:param name="y-adjust" select="0"/>
- <xsl:param name="force-draw" select="'false'"/>
- <xsl:param name="shape-type"/>
- <xsl:variable name="MeasureMark">
- <xsl:choose>
- <xsl:when test="$TargetMeasure = 'twip'"/>
- <xsl:otherwise>
- <xsl:value-of select="$TargetMeasure"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="drawtextstyle" select="@draw:text-style-name"/>
- <xsl:variable name="org-z-index">
- <xsl:choose>
- <xsl:when test="@draw:z-index">
- <xsl:value-of select="number(concat('0',@draw:z-index))"/>
- </xsl:when>
- <xsl:when test="parent::draw:frame/@draw:z-index">
- <xsl:value-of select="number(concat('0',parent::draw:frame/@draw:z-index))"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="run-though" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@style:run-through"/>
- <xsl:variable name="org-wrap" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@style:wrap"/>
- <xsl:variable name="draw-name">
- <xsl:choose>
- <xsl:when test="string-length(@draw:name) = 0">
- <xsl:value-of select="translate(ancestor::draw:frame[1]/@draw:name, ':/', '__')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate(@draw:name, ':/', '__')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="style_name2key">
- <xsl:choose>
- <xsl:when test="@draw:style-name">
- <xsl:value-of select="@draw:style-name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="ancestor::draw:frame/@draw:style-name">
- <xsl:value-of select="ancestor::draw:frame/@draw:style-name"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="draw-fill-type" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill"/>
- <xsl:variable name="draw-gradient-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill-gradient-name"/>
- <xsl:variable name="horizontal-pos" select="key('graphics-style', $style_name2key)/style:graphic-properties/@style:horizontal-pos"/>
- <!--horizontal-pos attribute is for the placement of all the drawing elements-->
- <xsl:variable name="fill-image-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill-image-name"/>
- <xsl:if test="$draw-fill-type = 'bitmap' ">
- <xsl:element name="w:binData">
- <xsl:attribute name="w:name">
- <xsl:value-of select="concat( 'wordml://', $fill-image-name)"/>
- </xsl:attribute>
- <xsl:value-of select="translate(key('fill-image',$fill-image-name)/office:binary-data/text(),'&#9;&#10;&#13;&#32;','' ) "/>
- <!-- xsl:value-of select="office:binary-data/text()"/ -->
- </xsl:element>
- </xsl:if>
- <xsl:variable name="z-index">
- <xsl:choose>
- <xsl:when test="$run-though='foreground'">
- <!-- make sure z-index >=0 -->
- <xsl:choose>
- <xsl:when test="$org-z-index &lt; 0">0</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$org-z-index"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$run-though='background'">
- <!-- make sure z-index < 0 -->
- <xsl:choose>
- <xsl:when test="$org-z-index &lt; 0">
- <xsl:value-of select="$org-z-index"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$org-z-index - 10"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="wrap">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='as-char' ">none</xsl:when>
- <xsl:when test="$org-wrap='dynamic'">tight</xsl:when>
- <xsl:when test="$org-wrap='parallel'">square</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="ooshapename" select="substring-after(name(),':')"/>
- <xsl:variable name="element-name">
- <xsl:choose>
- <xsl:when test="$ooshapename='rect'">v:rect</xsl:when>
- <xsl:when test="$ooshapename='ellipse' and not(string-length(@draw:kind) &gt; 0)">v:oval</xsl:when>
- <xsl:when test="$ooshapename='ellipse' and string-length(@draw:kind) &gt; 0">v:arc</xsl:when>
- <xsl:when test="$ooshapename='circle' and string-length(@draw:kind) &gt; 0">v:arc</xsl:when>
- <xsl:when test="$ooshapename='line'">v:line</xsl:when>
- <xsl:when test="$ooshapename='polyline'">v:polyline</xsl:when>
- <xsl:when test="$ooshapename='polygon'">v:polyline</xsl:when>
- <xsl:when test="$ooshapename='text-box'">v:shape</xsl:when>
- <xsl:when test="$ooshapename='image'">v:shape</xsl:when>
- <xsl:when test="$ooshapename='frame'">v:shape</xsl:when>
- <xsl:when test="$ooshapename='path'">v:shape</xsl:when>
- <!-- This caption is not the "Caption", it's GUI name is Callouts-->
- <xsl:when test="$ooshapename='caption'">v:shape</xsl:when>
- <xsl:when test="$ooshapename='custom-shape' and draw:enhanced-geometry[1]/@draw:predefined-type = 'non-primitive' ">v:shape</xsl:when>
- <xsl:when test="$ooshapename='custom-shape' and draw:enhanced-geometry[1]/@draw:predefined-type = 'round-rectangle' ">v:roundrect</xsl:when>
- <xsl:when test="$ooshapename='custom-shape' and draw:enhanced-geometry[1]/@draw:predefined-type = 'rectangle' ">v:rect</xsl:when>
- <xsl:when test="$ooshapename='custom-shape' and draw:enhanced-geometry[1]/@draw:predefined-type = 'ellipse' ">v:oval</xsl:when>
- <xsl:when test="$ooshapename='custom-shape'">v:shape</xsl:when>
- <!-- some wild guess -->
- <xsl:otherwise>v:shape</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="ms-shape-type">
- <xsl:choose>
- <xsl:when test="string-length($shape-type) &gt; 0">
- <xsl:value-of select="$shape-type"/>
- </xsl:when>
- <xsl:when test="$ooshapename='custom-shape' ">
- <xsl:call-template name="ooo_custom_draw2ms_word_draw_map">
- <xsl:with-param name="ooo_predefined_type" select="draw:enhanced-geometry[1]/@draw:predefined-type"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="real-x-adjust">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="concat($x-adjust,'in')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="real-y-adjust">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="concat($y-adjust,'in')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="org-x">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="@svg:x"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="org-y">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="@svg:y"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="pagemaster" select="key('master-page','Standard')/@style:page-layout-name"/>
- <xsl:variable name="leftmargin-pt">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="key('page-layout',$pagemaster)/style:page-layout-properties/@fo:margin-left"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="topmargin-pt">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="key('page-layout',$pagemaster)/style:page-layout-properties/@fo:margin-top"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- addjust the x and y values of the page archored objects-->
- <xsl:variable name="x">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
- <xsl:value-of select="$org-x + $real-x-adjust - $leftmargin-pt"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$org-x + $real-x-adjust"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="y">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
- <xsl:value-of select="$org-y + $real-y-adjust - $topmargin-pt"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$org-y + $real-y-adjust"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="width">
- <xsl:variable name="width-tmp">
- <xsl:choose>
- <xsl:when test="@svg:width">
- <xsl:value-of select="@svg:width"/>
- </xsl:when>
- <xsl:when test="not(string-length(parent::draw:frame/@svg:width) = 0)">
- <xsl:value-of select="parent::draw:frame/@svg:width"/>
- </xsl:when>
- <xsl:when test="string-length(@svg:width) = 0 and ancestor::draw:frame">
- <xsl:value-of select="ancestor::draw:frame/@svg:width"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@svg:width"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="$width-tmp"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="height">
- <xsl:choose>
- <xsl:when test="@svg:height">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="@svg:height"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="not(string-length(parent::draw:frame/@svg:height) = 0)">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="parent::draw:frame/@svg:height"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="@fo:min-height and string-length(text:p/text()) = 0 and not(text:p/draw:*)">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="@fo:min-height"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="borderstyle">
- <xsl:call-template name="get_borderstyle">
- <xsl:with-param name="border" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@fo:border"/>
- <xsl:with-param name="border-line-width" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@style:border-line-width"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="stroke-weight-in-inch" select="number(concat('0',translate(key('graphics-style', @draw:style-name)/style:graphic-properties/@svg:stroke-width ,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','') ))"/>
- <xsl:variable name="stroke-weight">
- <xsl:choose>
- <xsl:when test="contains($borderstyle , 'strokeweight')">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="concat( substring-after($borderstyle, 'strokeweight:') , 'pt')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@svg:stroke-width"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="linestyle">
- <xsl:if test="contains($borderstyle , 'strokeweight')">
- <xsl:value-of select="substring-before( substring-after($borderstyle, 'linestyle:') , ';strokeweight')"/>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="stroked">
- <xsl:if test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:stroke = 'none'">
- <xsl:value-of select="'f'"/>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="dashstyle">
- <xsl:call-template name="get_dashstyle">
- <xsl:with-param name="stroke-width" select="$stroke-weight-in-inch"/>
- <xsl:with-param name="style-name" select="@draw:style-name"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="start-arrow">
- <xsl:choose>
- <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end">
- <xsl:call-template name="MapArrowStyle">
- <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="end-arrow">
- <xsl:choose>
- <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start">
- <xsl:call-template name="MapArrowStyle">
- <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="start-arrow-length">
- <xsl:choose>
- <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end">
- <xsl:call-template name="GetArrowLength">
- <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end"/>
- <xsl:with-param name="arrow-width" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end-width"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="start-arrow-width">
- <xsl:choose>
- <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end">
- <xsl:call-template name="GetArrowWidth">
- <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end"/>
- <xsl:with-param name="arrow-width" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end-width"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="end-arrow-length">
- <xsl:choose>
- <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start">
- <xsl:call-template name="GetArrowLength">
- <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start"/>
- <xsl:with-param name="arrow-width" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start-width"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="end-arrow-width">
- <xsl:choose>
- <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start">
- <xsl:call-template name="GetArrowWidth">
- <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start"/>
- <xsl:with-param name="arrow-width" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start-width"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="stroke-color">
- <xsl:choose>
- <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@svg:stroke-color">
- <xsl:value-of select="key('graphics-style', @draw:style-name)/style:graphic-properties/@svg:stroke-color"/>
- </xsl:when>
- <xsl:when test="contains(key('graphics-style', @draw:style-name)/style:graphic-properties/@fo:border, '#')">
- <xsl:value-of select="concat('#', substring-after(key('graphics-style', @draw:style-name)/style:graphic-properties/@fo:border, '#') )"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="stroke-opacity">
- <xsl:call-template name="ValueOfPercent">
- <xsl:with-param name="value" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@svg:stroke-opacity"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="fill-color">
- <xsl:choose>
- <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill-color">
- <xsl:value-of select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill-color"/>
- </xsl:when>
- <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-style">black</xsl:when>
- <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill = 'none'"/>
- <xsl:when test="$draw-fill-type = 'gradient' ">
- <xsl:value-of select="key('draw-gradient',$draw-gradient-name)/@draw:end-color "/>
- </xsl:when>
- <!-- for these need fill, set the default color we used in oo-->
- <xsl:when test="name()='draw:polygon' or name()='draw:custom-shape' or name() = 'draw:rect' or (name() = 'draw:ellipse' and not( @draw:kind='arc') )">#00B8FF</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="position">
- <xsl:value-of select="concat('left:', $x ,$MeasureMark , ';top:' , $y ,$MeasureMark , ';width:', $width ,$MeasureMark )"/>
- <xsl:if test="not($height = 0)">
- <xsl:value-of select="concat(';height:', $height ,$MeasureMark )"/>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="flip">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='as-char' and $ooshapename='line'"/>
- <xsl:when test="$ooshapename='image'"/>
- <xsl:when test="$ooshapename='path'"/>
- <xsl:when test="$ooshapename='caption'"/>
- <xsl:when test="@draw:kind = 'arc' or @draw:kind = 'cut' or @draw:kind = 'section'"/>
- <xsl:when test="$ooshapename='custom-shape'"/>
- <xsl:otherwise>flip:x</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="absolute">
- <xsl:choose>
- <xsl:when test="ancestor::draw:a"/>
- <xsl:when test="@text:anchor-type = 'as-char' or @text:anchor-type = 'to-char'"/>
- <xsl:when test="parent::draw:frame/@text:anchor-type = 'as-char' or parent::draw:frame/@text:anchor-type = 'to-char'"/>
- <xsl:otherwise>position:absolute</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="anchorlock">
- <xsl:choose>
- <xsl:when test="@text:anchor-type = 'as-char' or @text:anchor-type = 'to-char'">has</xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:variable>
- <!-- start line special -->
- <xsl:variable name="org-x1">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="@svg:x1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="org-y1">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="@svg:y1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="org-x2">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="@svg:x2"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="org-y2">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="value" select="@svg:y2"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="x1">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
- <xsl:value-of select="$org-x1 + $real-x-adjust - $leftmargin-pt"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$org-x1 + $real-x-adjust"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="y1">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
- <xsl:value-of select="$org-y1 + $real-y-adjust - $topmargin-pt"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$org-y1 + $real-y-adjust"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="x2">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
- <xsl:value-of select="$org-x2 + $real-x-adjust - $leftmargin-pt"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$org-x2 + $real-x-adjust"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="y2">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
- <xsl:value-of select="$org-y2 + $real-y-adjust - $topmargin-pt"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$org-y2 + $real-y-adjust"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- end line special -->
- <xsl:variable name="relative">
- <xsl:choose>
- <xsl:when test="@text:anchor-type = 'as-char' or @text:anchor-type = 'to-char'">mso-position-horizontal-relative:char;mso-position-vertical-relative:line</xsl:when>
- <xsl:when test="parent::draw:frame/@text:anchor-type = 'as-char' or parent::draw:frame/@text:anchor-type = 'to-char'">mso-position-horizontal-relative:char;mso-position-vertical-relative:line</xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="style">
- <xsl:choose>
- <xsl:when test="$wrap='none'"/>
- <xsl:otherwise>
- <xsl:if test="string-length($absolute) &gt; 0">
- <xsl:value-of select="concat($absolute, ';')"/>
- </xsl:if>
- <xsl:value-of select="concat('z-index:', $z-index, ';')"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="string-length($flip) &gt; 0">
- <xsl:value-of select="concat($flip,';')"/>
- </xsl:if>
- <xsl:if test="not($ooshapename = 'line')">
- <xsl:value-of select="concat($position,';')"/>
- </xsl:if>
- <xsl:if test="ancestor::draw:frame and name()='draw:text-box'">
- <xsl:if test="string-length($horizontal-pos) &gt; 0">
- <xsl:value-of select="concat('mso-position-horizontal:',$horizontal-pos,';')"/>
- </xsl:if>
- </xsl:if>
- <xsl:if test="string-length($relative) &gt; 0">
- <xsl:value-of select="concat($relative,';')"/>
- </xsl:if>
- </xsl:variable>
- <!-- image special: convert oo base64 binary data (77char/line) to word base64 binary data(73char/line) , a workthrough is removing all line breaks -->
- <xsl:if test="$ooshapename = 'image'">
- <xsl:element name="w:binData">
- <xsl:attribute name="w:name">
- <xsl:value-of select="concat( 'wordml://', $draw-name )"/>
- </xsl:attribute>
- <xsl:value-of select="translate(office:binary-data/text(),'&#9;&#10;&#13;&#32;','' ) "/>
- <!-- xsl:value-of select="office:binary-data/text()"/ -->
- </xsl:element>
- </xsl:if>
- <!-- all element goes here -->
- <xsl:variable name="id">
- <xsl:choose>
- <xsl:when test="$ooshapename='line'">
- <xsl:value-of select="concat('_x',$x1 , '_' ,$y1, '_' , $x2, '_' ,$y2 )"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('_x',$x , '_' ,$y, '_' , $width, '_' ,$height )"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="{$element-name}">
- <xsl:attribute name="id">
- <xsl:value-of select="$id"/>
- </xsl:attribute>
- <xsl:if test="string-length($ms-shape-type) &gt; 0">
- <xsl:attribute name="type">
- <xsl:value-of select="$ms-shape-type"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style">
- <xsl:value-of select="$style"/>
- </xsl:attribute>
- <xsl:if test="$stroke-weight &gt; 0">
- <xsl:attribute name="strokeweight">
- <xsl:value-of select="concat($stroke-weight,$MeasureMark)"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($stroked) &gt; 0">
- <xsl:attribute name="stroked">
- <xsl:value-of select="$stroked"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($stroke-color) &gt; 0">
- <xsl:attribute name="strokecolor">
- <xsl:value-of select="$stroke-color"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($fill-color) &gt; 0">
- <xsl:attribute name="fillcolor">
- <xsl:value-of select="$fill-color"/>
- </xsl:attribute>
- <xsl:attribute name="filled">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="parent::draw:frame/draw:object-ole[1]">
- <xsl:attribute name="filled">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($stroke-opacity) &gt; 0">
- <xsl:attribute name="opacity">
- <xsl:value-of select="$stroke-opacity"/>
- </xsl:attribute>
- </xsl:if>
- <!-- arc special attribute -->
- <xsl:if test="@draw:kind = 'arc' or @draw:kind = 'cut' or @draw:kind = 'section'">
- <xsl:choose>
- <xsl:when test="@draw:start-angle &gt; @draw:end-angle">
- <xsl:attribute name="startangle">
- <xsl:value-of select="round( 450 - (@draw:end-angle + 360) )"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="startangle">
- <xsl:value-of select="round( 450 - @draw:end-angle )"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="endangle">
- <xsl:value-of select="round(450 - @draw:start-angle)"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="@draw:kind = 'cut'">
- <xsl:attribute name="fill">
- <xsl:value-of select="'true'"/>
- </xsl:attribute>
- </xsl:if>
- <!-- end arc special attribute -->
- <!-- line special attribute-->
- <xsl:if test="$ooshapename='line'">
- <xsl:attribute name="from">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='as-char'">0,0</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($x1,$MeasureMark, ',',$y2,$MeasureMark )"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="to">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='as-char'">
- <xsl:value-of select="concat($x2,$MeasureMark ,',',$y2,$MeasureMark )"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($x2,$MeasureMark ,',' ,$y1,$MeasureMark)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:if>
- <!-- end line special attribute-->
- <!-- polyline and polygon special attribute-->
- <xsl:if test="$ooshapename='polyline' or $ooshapename='polygon' ">
- <!-- translate ' ' to in ' tranclate ',' to 'in,' -->
- <xsl:variable name="points">
- <xsl:call-template name="points2points">
- <xsl:with-param name="input_x" select="$x"/>
- <xsl:with-param name="input_y" select="$y"/>
- <xsl:with-param name="input_width" select="$width"/>
- <xsl:with-param name="input_height" select="$height"/>
- <xsl:with-param name="input_boxwidth" select="substring-before(substring-after(@svg:viewBox,'0 0 '),' ')"/>
- <xsl:with-param name="input_boxheight" select="substring-after(substring-after(@svg:viewBox,'0 0 '),' ')"/>
- <xsl:with-param name="input_points" select="concat(@draw:points,' ')"/>
- <!-- add a space to the end of input_points -->
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="points">
- <xsl:value-of select="$points"/>
- </xsl:attribute>
- </xsl:if>
- <!-- end polyline and polygon special attribute-->
- <!-- callouts special attribute-->
- <xsl:if test="$ooshapename='caption'">
- <xsl:variable name="caption-point-x">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="'twip'"/>
- <xsl:with-param name="value" select="@draw:caption-point-x"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="caption-point-y">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="'twip'"/>
- <xsl:with-param name="value" select="@draw:caption-point-y"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="type">
- <!-- map to word line label 3-->
- <xsl:value-of select="'#_x0000_t48'"/>
- </xsl:attribute>
- <xsl:attribute name="adj">
- <xsl:value-of select=" concat($caption-point-x * 20 , ',' , $caption-point-y * 20 , ',' , $caption-point-x * 10 , ',,,,' , $caption-point-x * 20, ',' , $caption-point-y * 20) "/>
- </xsl:attribute>
- </xsl:if>
- <!-- end callouts special attribute-->
- <!-- path special attribute-->
- <xsl:if test="$ooshapename='path' or string-length(@svg:d) &gt; 0 or ( $ooshapename='custom-shape' and draw:enhanced-geometry[1]/@draw:predefined-type = 'non-primitive') ">
- <xsl:variable name="path">
- <xsl:choose>
- <xsl:when test="$ooshapename='path' or string-length(@svg:d) &gt; 0 ">
- <xsl:call-template name="svgpath2vmlpath">
- <xsl:with-param name="svg-path" select="@svg:d"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="svgpath2vmlpath">
- <xsl:with-param name="svg-path" select="draw:enhanced-geometry[1]/@draw:enhanced-path"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="coordorigin">
- <xsl:value-of select=" '0 0' "/>
- </xsl:attribute>
- <xsl:attribute name="coordsize">
- <xsl:choose>
- <xsl:when test="string-length(@svg:viewBox) &gt; 0 ">
- <xsl:value-of select="substring-after(@svg:viewBox,'0 0 ')"/>
- </xsl:when>
- <xsl:when test="string-length(draw:enhanced-geometry[1]/@svg:viewBox) &gt; 0 ">
- <xsl:value-of select="substring-after(draw:enhanced-geometry[1]/@svg:viewBox,'0 0 ')"/>
- </xsl:when>
- <!-- for custom shape use a default viewbox. right? -->
- <xsl:otherwise>
- <xsl:value-of select=" '21600 21600' "/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="path">
- <xsl:value-of select="$path"/>
- </xsl:attribute>
- </xsl:if>
- <!-- end path special attribute-->
- <!-- image special element -->
- <xsl:if test="$ooshapename='image'">
- <xsl:element name="v:imagedata">
- <xsl:attribute name="src">
- <xsl:value-of select="concat('wordml://', $draw-name)"/>
- </xsl:attribute>
- <xsl:attribute name="o:title">
- <xsl:value-of select="$draw-name"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:if>
- <!-- end image special element -->
- <!-- start dash style , line style and arrow style-->
- <xsl:if test="string-length($dashstyle) &gt; 0 or string-length($linestyle) &gt; 0 or string-length($start-arrow) &gt; 0 or string-length($end-arrow) &gt; 0 ">
- <xsl:element name="v:stroke">
- <xsl:if test="string-length($dashstyle) &gt; 0">
- <xsl:attribute name="dashstyle">
- <xsl:value-of select="$dashstyle"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($linestyle) &gt; 0">
- <xsl:attribute name="linestyle">
- <xsl:value-of select="$linestyle"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($start-arrow) &gt; 0 ">
- <xsl:attribute name="startarrow">
- <xsl:value-of select="$start-arrow"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($end-arrow) &gt; 0 ">
- <xsl:attribute name="endarrow">
- <xsl:value-of select="$end-arrow"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($start-arrow-length) &gt; 0 ">
- <xsl:attribute name="startarrowlength">
- <xsl:value-of select="$start-arrow-length"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($start-arrow-width) &gt; 0 ">
- <xsl:attribute name="startarrowwidth">
- <xsl:value-of select="$start-arrow-width"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($end-arrow-length) &gt; 0 ">
- <xsl:attribute name="endarrowlength">
- <xsl:value-of select="$end-arrow-length"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="string-length($end-arrow-width) &gt; 0 ">
- <xsl:attribute name="endarrowwidth">
- <xsl:value-of select="$end-arrow-width"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <!-- end dash style , line style and arrow style -->
- <!-- start wrap type -->
- <xsl:if test="string-length($wrap) &gt; 0">
- <xsl:element name="w10:wrap">
- <xsl:attribute name="type">
- <xsl:value-of select="$wrap"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:if>
- <!-- end wrap type -->
- <!-- start anchor to char specific element -->
- <xsl:if test="string-length($anchorlock) &gt; 0">
- <xsl:element name="w10:anchorlock"/>
- </xsl:if>
- <!-- end wrap type -->
- <!-- start fill image -->
- <xsl:if test="string-length($draw-fill-type ) &gt; 0">
- <xsl:element name="v:fill">
- <xsl:choose>
- <xsl:when test="$draw-fill-type = 'bitmap'">
- <xsl:attribute name="src">
- <xsl:value-of select="concat( 'wordml://', $fill-image-name)"/>
- </xsl:attribute>
- <xsl:attribute name="o:titile">
- <xsl:value-of select="$fill-image-name"/>
- </xsl:attribute>
- <xsl:attribute name="recolor">
- <xsl:value-of select=" 'true' "/>
- </xsl:attribute>
- <xsl:attribute name="rotate">
- <xsl:value-of select=" 'true' "/>
- </xsl:attribute>
- <xsl:attribute name="type">
- <xsl:value-of select=" 'frame' "/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="$draw-fill-type = 'gradient'">
- <xsl:attribute name="type">
- <xsl:value-of select=" 'gradient' "/>
- </xsl:attribute>
- <xsl:attribute name="color2">
- <xsl:value-of select="key('draw-gradient',$draw-gradient-name)/@draw:start-color "/>
- </xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <!-- end fill image -->
- <xsl:if test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-style">
- <xsl:call-template name="FontWork"/>
- </xsl:if>
- <xsl:if test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:shadow = 'visible'">
- <xsl:call-template name="Shadow"/>
- </xsl:if>
- <!-- only draw:g can have child graphic -->
- <xsl:choose>
- <xsl:when test="name() = 'draw:g'">
- <xsl:apply-templates select="draw:*">
- <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
- <xsl:with-param name="x-adjust" select="$x-adjust"/>
- <xsl:with-param name="y-adjust" select="$y-adjust"/>
- <xsl:with-param name="force-draw" select="$force-draw"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="text:*/* | text:*/text()">
- <xsl:element name="v:textbox">
- <xsl:if test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:writing-mode = 'tb-rl'">
- <xsl:attribute name="style">
- <xsl:value-of select="'layout-flow:vertical'"/>
- </xsl:attribute>
- </xsl:if>
- <w:txbxContent>
- <xsl:apply-templates select="text() | text:*"/>
- </w:txbxContent>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:apply-templates select="parent::draw:frame/draw:object-ole" mode="output">
- <xsl:with-param name="ShapeID" select="$id"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template name="Shadow">
- <xsl:element name="v:shadow">
- <xsl:variable name="key-node" select="key('graphics-style', @draw:style-name)/style:graphic-properties"/>
- <xsl:attribute name="on">true</xsl:attribute>
- <xsl:attribute name="offset">
- <xsl:value-of select="concat($key-node/@draw:shadow-offset-x,',' , $key-node/@draw:shadow-offset-y)"/>
- </xsl:attribute>
- <xsl:attribute name="color">
- <xsl:value-of select="$key-node/@draw:shadow-color"/>
- </xsl:attribute>
- <xsl:attribute name="opacity">
- <xsl:value-of select="$key-node/@draw:shadow-opacity"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template name="FontWork">
- <xsl:element name="v:path">
- <xsl:attribute name="textpathok">true</xsl:attribute>
- </xsl:element>
- <xsl:if test="not(key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-shadow) or not(key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-shadow = 'normal')">
- <xsl:element name="v:shadow">
- <xsl:attribute name="on">true</xsl:attribute>
- <xsl:attribute name="type">perspective</xsl:attribute>
- <xsl:attribute name="color">
- <xsl:value-of select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-shadow-color"/>
- </xsl:attribute>
- <xsl:variable name="offset-x">
- <xsl:call-template name="ConvertMeasure">
- <xsl:with-param name="TargetMeasure" select="'twip'"/>
- <xsl:with-param name="value" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-shadow-offset-x"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="offset-y" select="substring-before(key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-shadow-offset-y, 'in')"/>
- <xsl:attribute name="matrix">
- <xsl:value-of select="concat(',,,' , round($offset-y div 0.000693) div 100, ',,')"/>
- </xsl:attribute>
- <xsl:attribute name="origin">-30%, -30%</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="v:textpath">
- <xsl:attribute name="on">true</xsl:attribute>
- <xsl:attribute name="fitpath">true</xsl:attribute>
- <xsl:attribute name="fitshape">true</xsl:attribute>
- <xsl:attribute name="style">
- <xsl:choose>
- <xsl:when test="key('paragraph-style', text:p[1]/@text:style-name )/style:graphic-properties/@svg:font-family">
- <xsl:value-of select="concat('font-family:&quot;' , key('paragraph-style', text:p[1]/@text:style-name )/style:graphic-properties/@svg:font-family , '&quot;') "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="default-graphics-properties" select="/office:document/office:styles/style:default-style[@style:family = 'graphics']/style:graphic-properties"/>
- <xsl:value-of select="concat('font-family:&quot;' , $default-graphics-properties/@style:font-name , '&quot;') "/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="string">
- <xsl:value-of select="text:p"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template name="MapArrowStyle">
- <xsl:param name="arrow-name"/>
- <xsl:choose>
- <xsl:when test="$arrow-name = 'Arrow' ">Block</xsl:when>
- <xsl:when test="$arrow-name = 'Square' ">Diamond</xsl:when>
- <xsl:when test="$arrow-name = 'Small arrow' ">Block</xsl:when>
- <xsl:when test="$arrow-name = 'Dimension lines' ">Diamond</xsl:when>
- <xsl:when test="$arrow-name = 'Double Arrow' ">Block</xsl:when>
- <xsl:when test="$arrow-name = 'Rounded short arrow' ">Block</xsl:when>
- <xsl:when test="$arrow-name = 'Symmetric arrow' ">Block</xsl:when>
- <xsl:when test="$arrow-name = 'Line Arrow' ">Open</xsl:when>
- <xsl:when test="$arrow-name = 'Rounded large arrow' ">Block</xsl:when>
- <xsl:when test="$arrow-name = 'Circle' ">Oval</xsl:when>
- <xsl:when test="$arrow-name = 'Square 45' ">Diamond</xsl:when>
- <xsl:when test="$arrow-name = 'Arrow concave' ">Classic</xsl:when>
- <xsl:otherwise>Block</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="GetArrowLength">
- <xsl:param name="arrow-name"/>
- <xsl:param name="arrow-width"/>
- <xsl:variable name="arrow-size">
- <xsl:choose>
- <xsl:when test="$arrow-width">
- <xsl:value-of select="round(number(substring-before($arrow-width, 'in')) div 0.02) "/>
- </xsl:when>
- <xsl:otherwise>3</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$arrow-size &gt; 2">Long</xsl:when>
- <xsl:when test="$arrow-size &gt; 1">Medium</xsl:when>
- <xsl:when test="$arrow-size &gt; 0">Short</xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="GetArrowWidth">
- <xsl:param name="arrow-name"/>
- <xsl:param name="arrow-width"/>
- <xsl:variable name="arrow-size">
- <xsl:choose>
- <xsl:when test="$arrow-width">
- <xsl:value-of select="round(number(substring-before($arrow-width, 'in')) div 0.02) "/>
- </xsl:when>
- <xsl:otherwise>3</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$arrow-size &gt; 2">Wide</xsl:when>
- <xsl:when test="$arrow-size &gt; 1">Medium</xsl:when>
- <xsl:when test="$arrow-size &gt; 0">Narrow</xsl:when>
- </xsl:choose>
- </xsl:template>
+ <xsl:include href="ooo2wordml_custom_draw.xsl"/>
- <xsl:template name="export-oledata">
- <xsl:if test="//draw:object-ole[1]">
- <xsl:apply-templates select="//draw:object-ole" mode="oledata.mso"/>
- <w:docOleData>
- <w:binData w:name="oledata.mso">
- <xsl:if test="function-available('ole:getByName')">
- <xsl:value-of select="translate(ole:getByName('oledata.mso'),'&#10;&#13;&#32;','')"/>
- </xsl:if>
- </w:binData>
- </w:docOleData>
- </xsl:if>
- </xsl:template>
- <xsl:template match="draw:object-ole" mode="oledata.mso">
- <xsl:variable name="stream-name">
- <xsl:apply-templates select="." mode="get-number"/>
- </xsl:variable>
- <xsl:variable name="tmp" select="ole:insertByName($stream-name, translate(office:binary-data/text(),'&#10;&#13;&#32;','' ) )"/>
- </xsl:template>
- <xsl:template match="draw:object-ole" mode="output">
- <xsl:param name="ShapeID"/>
- <xsl:variable name="stream-name">
- <xsl:apply-templates select="." mode="get-number"/>
- </xsl:variable>
- <o:OLEObject Type="Embed" DrawAspect="Content" ObjectID="{$stream-name}" ShapeID="{$ShapeID}" ProgID=""/>
- </xsl:template>
- <xsl:template match="draw:object-ole" mode="get-number">
- <xsl:number from="/office:document" level="any" count="draw:object-ole" format="1"/>
- </xsl:template>
- <xsl:template match="draw:object-ole"/>
+ <xsl:key name="stroke-dash-style" match="draw:stroke-dash" use="@draw:name"/>
+ <xsl:key name="fill-image" match="draw:fill-image" use="@draw:name"/>
+ <xsl:key name="draw-gradient" match="draw:gradient " use="@draw:name"/>
+ <xsl:template name="PageLevelGraphic">
+ <xsl:for-each select="//draw:*[@text:anchor-type='page']">
+ <xsl:apply-templates select="."/>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="draw:*">
+ <xsl:param name="TargetMeasure" select="'pt'"/>
+ <xsl:param name="x-adjust" select="0"/>
+ <xsl:param name="y-adjust" select="0"/>
+ <xsl:param name="force-draw" select="'false'"/>
+ <xsl:variable name="MeasureMark">
+ <xsl:choose>
+ <xsl:when test="$TargetMeasure = 'twip'"/>
+ <xsl:otherwise>
+ <xsl:value-of select="$TargetMeasure"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <!--
+ deal with captions and frames first. draw:text-box is a powerful element in OOo, its GUI name is frame. And OOo use it to contain Captions
+ Since there is not a corresponding object in word, so we draw the text-box itself and its children separately. If it look like a Caption only frame
+ we'll adjust the text-box position to make it look pretty
+ -->
+ <!-- skip all not force draw children , must be first case -->
+ <xsl:when test="ancestor::draw:text-box and $force-draw='false' "/>
+ <xsl:when test="name() = 'draw:text-box'">
+ <!-- draw the text-box itself -->
+ <w:r>
+ <w:pict>
+ <xsl:variable name="text-y-adjust">
+ <xsl:choose>
+ <xsl:when test="count(text:p/draw:*) = 1 and (string-length(text:p/draw:*[position()=1]/@svg:x) =0 or number(concat('0',translate(text:p/draw:*[position()=1]/@svg:x,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','') ))=0) and (string-length(text:p/draw:*[position()=1]/@svg:y)=0 or number(concat('0',translate(text:p/draw:*[position()=1]/@svg:x,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','') ))=0 ) ">
+ <xsl:variable name="pic-height">
+ <xsl:choose>
+ <xsl:when test="name(text:p/draw:*[position()=1]) = 'draw:g' or name(text:p/draw:*[position()=1]) = 'draw:a'">
+ <xsl:variable name="BigestWindow">
+ <xsl:call-template name="GetWindowSize">
+ <xsl:with-param name="nodeSet" select="text:p/draw:*[position()=1]/draw:*"/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="number(substring-after($BigestWindow,'y2:')) - number(substring-after(substring-before($BigestWindow,';x2'), 'y1:')) + number(concat('0',translate($y-adjust,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','')))"/>
+ </xsl:when>
+ <xsl:when test="text:p/draw:*[position()=1]/@svg:height">
+ <xsl:call-template name="Add-With-Measure">
+ <xsl:with-param name="value1" select="text:p/draw:*[position()=1]/@svg:height"/>
+ <xsl:with-param name="value2" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="text:p/draw:*[position()=1]/@fo:min-height">
+ <xsl:call-template name="Add-With-Measure">
+ <xsl:with-param name="value1" select="text:p/draw:*[position()=1]/@fo:min-height"/>
+ <xsl:with-param name="value2" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="ancestor::draw:frame">
+ <xsl:call-template name="Add-With-Measure">
+ <xsl:with-param name="value1" select="ancestor::draw:frame/@svg:height"/>
+ <xsl:with-param name="value2" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="min-height">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="'in'"/>
+ <xsl:with-param name="value" select="@fo:min-height"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$min-height - $pic-height &lt; 0.001">
+ <!-- If control goes here, it much like that this text-box is used for contain graphic caption only -->
+ <xsl:value-of select="$pic-height - 0.1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$y-adjust"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$y-adjust"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="shape-type">
+ <xsl:choose>
+ <xsl:when test="$text-y-adjust = $y-adjust">
+ <xsl:value-of select="'#_x0000_t202'"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="DrawElements">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$text-y-adjust"/>
+ <xsl:with-param name="force-draw" select="'true'"/>
+ <xsl:with-param name="shape-type" select="$shape-type"/>
+ </xsl:call-template>
+ </w:pict>
+ </w:r>
+ <!-- draw the real object first -->
+ <xsl:if test="./text:p/draw:*">
+ <xsl:apply-templates select="./text:p/draw:*">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="x-adjust">
+ <xsl:call-template name="Add-With-Measure">
+ <xsl:with-param name="value1" select="@svg:x"/>
+ <xsl:with-param name="value2" select="$x-adjust"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="y-adjust">
+ <xsl:call-template name="Add-With-Measure">
+ <xsl:with-param name="value1" select="@svg:y"/>
+ <xsl:with-param name="value2" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="force-draw" select="'true'"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:when>
+ <!-- end deal with captions and frames -->
+ <xsl:when test=" name() = 'draw:frame' ">
+ <xsl:variable name="BigestWindow">
+ <xsl:call-template name="GetWindowSize">
+ <xsl:with-param name="nodeSet" select="."/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:apply-templates select="draw:* ">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="x-adjust" select="concat(substring-after(substring-before($BigestWindow,';y1'), 'x1:'), 'in')"/>
+ <xsl:with-param name="y-adjust" select="concat(substring-after(substring-before($BigestWindow,';x2'), 'y1:') , 'in')"/>
+ <xsl:with-param name="force-draw" select="$force-draw"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="name() = 'draw:g'">
+ <w:r>
+ <w:pict>
+ <xsl:element name="v:group">
+ <xsl:variable name="BigestWindow">
+ <xsl:choose>
+ <xsl:when test="name() = 'draw:g'">
+ <xsl:call-template name="GetWindowSize">
+ <xsl:with-param name="nodeSet" select="draw:*"/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name() = 'draw:frame'">
+ <xsl:call-template name="GetWindowSize">
+ <xsl:with-param name="nodeSet" select="."/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="x">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="concat(substring-after(substring-before($BigestWindow,';y1'), 'x1:'), 'in')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="y">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="concat(substring-after(substring-before($BigestWindow,';x2'), 'y1:') , 'in')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="width">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="concat(number(substring-after(substring-before($BigestWindow,';y2'), 'x2:')) - number(substring-after(substring-before($BigestWindow,';y1'), 'x1:')) , 'in')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="height">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="concat(number(substring-after($BigestWindow,'y2:')) - number(substring-after(substring-before($BigestWindow,';x2'), 'y1:')), 'in')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="id">
+ <xsl:value-of select="generate-id()"/>
+ </xsl:attribute>
+ <xsl:variable name="absolute">
+ <xsl:choose>
+ <xsl:when test="ancestor::draw:a"/>
+ <xsl:when test="@text:anchor-type = 'as-char' or @text:anchor-type = 'to-char'"/>
+ <xsl:otherwise>position:absolute</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$TargetMeasure= 'pt'">
+ <xsl:attribute name="style">
+ <xsl:if test="string-length($absolute) &gt; 0">
+ <xsl:value-of select="concat($absolute, ';')"/>
+ </xsl:if>
+ <xsl:value-of select="concat('margin-left:',$x ,$MeasureMark,';margin-top:', $y,$MeasureMark ,';width:', $width ,$MeasureMark , ';height:', $height,$MeasureMark)"/>
+ </xsl:attribute>
+ <xsl:attribute name="coordorigin">
+ <xsl:choose>
+ <!-- if we are in a text-box then oo will use comparative positions on us-->
+ <xsl:when test="name() = 'draw:frame' ">
+ <xsl:value-of select=" '0 0' "/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(round($x * 20), ',' , round($y * 20))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="coordsize">
+ <xsl:value-of select="concat(round($width * 20),',', round($height * 20) )"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$TargetMeasure= 'twip' ">
+ <xsl:attribute name="style">
+ <xsl:if test="string-length($absolute) &gt; 0">
+ <xsl:value-of select="concat($absolute, ';')"/>
+ </xsl:if>
+ <xsl:value-of select="concat('left:',$x ,$MeasureMark,';top:', $y,$MeasureMark ,';width:', $width ,$MeasureMark , ';height:', $height,$MeasureMark)"/>
+ </xsl:attribute>
+ <xsl:attribute name="coordorigin">
+ <xsl:choose>
+ <!-- if we are in a text-box then oo will use comparative positions on us-->
+ <xsl:when test="name() = 'draw:frame' ">
+ <xsl:value-of select=" '0 0' "/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($x , ',' , $y)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="coordsize">
+ <xsl:value-of select="concat($width,',', $height )"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <!-- if we are in a text-box then oo will use comparative positions on us-->
+ <xsl:when test="ancestor::draw:text-box">
+ <xsl:apply-templates select="draw:*">
+ <xsl:with-param name="TargetMeasure" select="'twip'"/>
+ <xsl:with-param name="x-adjust" select="concat(substring-after(substring-before($BigestWindow,';y1'), 'x1:'), 'in')"/>
+ <xsl:with-param name="y-adjust" select="concat(substring-after(substring-before($BigestWindow,';x2'), 'y1:') , 'in')"/>
+ <xsl:with-param name="force-draw" select="$force-draw"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="draw:*">
+ <xsl:with-param name="TargetMeasure" select="'twip'"/>
+ <xsl:with-param name="force-draw" select="$force-draw"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </w:pict>
+ </w:r>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="name() = 'draw:a'">
+ <xsl:call-template name="export_hyoerlink">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$y-adjust"/>
+ <xsl:with-param name="force-draw" select="$force-draw"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <w:r>
+ <w:pict>
+ <xsl:call-template name="DrawElements">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$y-adjust"/>
+ <xsl:with-param name="force-draw" select="$force-draw"/>
+ </xsl:call-template>
+ </w:pict>
+ </w:r>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="GetWindowSize">
+ <xsl:param name="CurrPos" select="1"/>
+ <xsl:param name="nodeSet"/>
+ <xsl:param name="x-adjust" select="0"/>
+ <xsl:param name="y-adjust" select="0"/>
+ <xsl:variable name="CurrNodeWindow">
+ <xsl:call-template name="GetNodeWindow">
+ <xsl:with-param name="CurrNode" select=" $nodeSet[ $CurrPos ]"/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <!-- if we got to the last node, return it directly, or return the max window of current one and following ones -->
+ <xsl:when test="$CurrPos = count($nodeSet)">
+ <xsl:value-of select="$CurrNodeWindow"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="CurrentWindow">
+ <xsl:variable name="FollowingWindow">
+ <xsl:call-template name="GetWindowSize">
+ <xsl:with-param name="nodeSet" select="$nodeSet"/>
+ <xsl:with-param name="CurrPos" select="$CurrPos + 1"/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="GetBigestWindows">
+ <xsl:with-param name="Window1" select="$CurrNodeWindow"/>
+ <xsl:with-param name="Window2" select="$FollowingWindow"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$CurrentWindow"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="GetNodeWindow">
+ <xsl:param name="CurrNode"/>
+ <xsl:param name="x-adjust" select="0"/>
+ <xsl:param name="y-adjust" select="0"/>
+ <xsl:choose>
+ <xsl:when test="name($CurrNode)='draw:g'">
+ <xsl:call-template name="GetWindowSize">
+ <xsl:with-param name="nodeSet" select="$CurrNode/draw:*"/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="x">
+ <xsl:call-template name="Add-With-Measure">
+ <xsl:with-param name="value1" select="$CurrNode/@svg:x"/>
+ <xsl:with-param name="value2" select="$x-adjust"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="y">
+ <xsl:call-template name="Add-With-Measure">
+ <xsl:with-param name="value1" select="$CurrNode/@svg:y"/>
+ <xsl:with-param name="value2" select="$y-adjust"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="width">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="value" select="$CurrNode/@svg:width"/>
+ <xsl:with-param name="TargetMeasure" select="'in'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="height">
+ <xsl:choose>
+ <xsl:when test="$CurrNode/@svg:height">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="value" select="$CurrNode/@svg:height"/>
+ <xsl:with-param name="TargetMeasure" select="'in'"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$CurrNode/@fo:min-height">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="value" select="$CurrNode/@fo:min-height"/>
+ <xsl:with-param name="TargetMeasure" select="'in'"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="concat('x1:' , $x, ';y1:' , $y, ';x2:' , string($x + $width), ';y2:', string($y + $height) ) "/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="GetBigestWindows">
+ <xsl:param name="Window1"/>
+ <xsl:param name="Window2"/>
+ <xsl:variable name="w1x1" select="substring-after( substring-before($Window1,';y1'),'x1:') "/>
+ <xsl:variable name="w2x1" select="substring-after( substring-before($Window2,';y1'),'x1:') "/>
+ <xsl:variable name="w1y1" select="substring-after( substring-before($Window1,';x2'),'y1:') "/>
+ <xsl:variable name="w2y1" select="substring-after( substring-before($Window2,';x2'),'y1:') "/>
+ <xsl:variable name="w1x2" select="substring-after( substring-before($Window1,';y2'),'x2:') "/>
+ <xsl:variable name="w2x2" select="substring-after( substring-before($Window2,';y2'),'x2:') "/>
+ <xsl:variable name="w1y2" select="substring-after( $Window1,';y2:') "/>
+ <xsl:variable name="w2y2" select="substring-after( $Window2,';y2:') "/>
+ <xsl:variable name="x1">
+ <xsl:choose>
+ <xsl:when test="$w1x1 &gt; $w2x1">
+ <xsl:value-of select="$w2x1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$w1x1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="y1">
+ <xsl:choose>
+ <xsl:when test="$w1y1 &gt; $w2y1">
+ <xsl:value-of select="$w2y1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$w1y1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="x2">
+ <xsl:choose>
+ <xsl:when test="$w1x2 &gt; $w2x2">
+ <xsl:value-of select="$w1x2"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$w2x2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="y2">
+ <xsl:choose>
+ <xsl:when test="$w1y2 &gt; $w2y2">
+ <xsl:value-of select="$w1y2"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$w2y2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="concat('x1:' , $x1 , ';y1:' , $y1 , ';x2:' , $x2, ';y2:' , $y2)"/>
+ </xsl:template>
+ <!-- convert percent value to x% numeric x/100 -->
+ <xsl:template name="ValueOfPercent">
+ <xsl:param name="value"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, '%')">
+ <xsl:value-of select="substring-before($value, '%') div 100"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="points2points">
+ <xsl:param name="input_points"/>
+ <xsl:param name="input_x"/>
+ <xsl:param name="input_y"/>
+ <xsl:param name="input_width"/>
+ <xsl:param name="input_height"/>
+ <xsl:param name="input_boxwidth"/>
+ <xsl:param name="input_boxheight"/>
+ <xsl:variable name="onepoint" select="substring($input_points,1,string-length($input_points) - string-length(substring-after($input_points,' ')) )"/>
+ <xsl:if test="substring-before($input_points,' ')">
+ <xsl:value-of select="round($input_x + (($input_boxwidth - number(substring-before($onepoint,','))) ) * $input_width div $input_boxwidth)"/>
+ <xsl:value-of select="'pt,'"/>
+ <xsl:value-of select="round($input_y + ((number(substring-after($onepoint,',')) ) ) * $input_height div $input_boxheight)"/>
+ <xsl:value-of select="'pt'"/>
+ </xsl:if>
+ <xsl:if test="string-length(substring($input_points,string-length($onepoint) + 1)) &gt; 0">
+ <xsl:value-of select="','"/>
+ <xsl:call-template name="points2points">
+ <xsl:with-param name="input_points" select="substring($input_points,string-length($onepoint) + 1)"/>
+ <xsl:with-param name="input_x" select="$input_x"/>
+ <xsl:with-param name="input_y" select="$input_y"/>
+ <xsl:with-param name="input_width" select="$input_width"/>
+ <xsl:with-param name="input_height" select="$input_height"/>
+ <xsl:with-param name="input_boxwidth" select="$input_boxwidth"/>
+ <xsl:with-param name="input_boxheight" select="$input_boxheight"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="path2path">
+ <xsl:param name="input_points"/>
+ <xsl:param name="x_or_y" select="'x'"/>
+ <xsl:param name="input_x"/>
+ <xsl:param name="input_y"/>
+ <xsl:param name="input_width"/>
+ <xsl:param name="input_height"/>
+ <xsl:param name="input_boxwidth"/>
+ <xsl:param name="input_boxheight"/>
+ <xsl:variable name="space-pos" select="string-length($input_points) - string-length(substring-after($input_points,' '))"/>
+ <xsl:variable name="minus-pos" select="string-length($input_points) - string-length(substring-after($input_points,'-'))"/>
+ <xsl:variable name="m-pos" select="string-length($input_points) - string-length(substring-after($input_points,'m'))"/>
+ <xsl:variable name="c-pos" select="string-length($input_points) - string-length(substring-after($input_points,'c'))"/>
+ <xsl:variable name="e-pos" select="string-length($input_points) - string-length(substring-after($input_points,'e'))"/>
+ <xsl:variable name="min1">
+ <xsl:choose>
+ <xsl:when test="$space-pos &lt; $minus-pos">
+ <xsl:value-of select="$space-pos"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$minus-pos"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="min2">
+ <xsl:choose>
+ <xsl:when test="$m-pos &lt; $min1">
+ <xsl:value-of select="$m-pos"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$min1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="min3">
+ <xsl:choose>
+ <xsl:when test="$c-pos &lt; $min2">
+ <xsl:value-of select="$c-pos"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$min2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="min4">
+ <xsl:choose>
+ <xsl:when test="$e-pos &lt; $min3">
+ <xsl:value-of select="$e-pos"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$min3"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="min-special-char-pos" select="$min4"/>
+ <xsl:variable name="special-char" select="substring($input_points,$min-special-char-pos,1)"/>
+ <xsl:variable name="one-value" select="substring($input_points,1,$min-special-char-pos - 1)"/>
+ <xsl:variable name="left-points" select="substring($input_points,$min-special-char-pos + 1)"/>
+ <xsl:if test="not($special-char = 'm')">
+ <xsl:if test="$x_or_y = 'x'">
+ <xsl:value-of select="round($input_x + $one-value * $input_width div $input_boxwidth)"/>
+ </xsl:if>
+ <xsl:if test="$x_or_y = 'y'">
+ <xsl:value-of select="round($input_y + $one-value * $input_height div $input_boxheight)"/>
+ </xsl:if>
+ </xsl:if>
+ <!-- output the separator-->
+ <xsl:choose>
+ <xsl:when test="$special-char = '-' or $special-char = ' ' ">
+ <xsl:value-of select="','"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$special-char"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:variable name="next-xy">
+ <xsl:if test="$x_or_y = 'x'">
+ <xsl:value-of select="'y'"/>
+ </xsl:if>
+ <xsl:if test="$x_or_y = 'y'">
+ <xsl:value-of select="'x'"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:if test="string-length($left-points) &gt; 0">
+ <xsl:call-template name="path2path">
+ <xsl:with-param name="input_points" select="$left-points"/>
+ <xsl:with-param name="x_or_y" select="$next-xy"/>
+ <xsl:with-param name="input_x" select="$input_x"/>
+ <xsl:with-param name="input_y" select="$input_y"/>
+ <xsl:with-param name="input_width" select="$input_width"/>
+ <xsl:with-param name="input_height" select="$input_height"/>
+ <xsl:with-param name="input_boxwidth" select="$input_boxwidth"/>
+ <xsl:with-param name="input_boxheight" select="$input_boxheight"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="get_dashstyle">
+ <xsl:param name="stroke-width" select="0.1"/>
+ <xsl:param name="style-name" select="@draw:style-name"/>
+ <xsl:variable name="graph-style" select="key('graphics-style', $style-name)/style:graphic-properties"/>
+ <xsl:variable name="dash-style" select="key('stroke-dash-style', $graph-style/@draw:stroke-dash)"/>
+ <xsl:variable name="stroke">
+ <xsl:choose>
+ <xsl:when test="$graph-style/@draw:stroke">
+ <xsl:value-of select="$graph-style/@draw:stroke"/>
+ </xsl:when>
+ <xsl:when test="$dash-style/@draw:stroke">
+ <xsl:value-of select="$dash-style/@draw:stroke"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$stroke = 'solid' ">
+ <xsl:value-of select="$stroke"/>
+ </xsl:when>
+ <xsl:when test="$stroke = 'dash'">
+ <xsl:variable name="dots1">
+ <xsl:choose>
+ <xsl:when test="$graph-style/@draw:dots1">
+ <xsl:value-of select="$graph-style/@draw:dots1"/>
+ </xsl:when>
+ <xsl:when test="$dash-style/@draw:dots1">
+ <xsl:value-of select="$dash-style/@draw:dots1"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="dots2">
+ <xsl:choose>
+ <xsl:when test="$graph-style/@draw:dots1">
+ <xsl:value-of select="$graph-style/@draw:dots2"/>
+ </xsl:when>
+ <xsl:when test="$dash-style/@draw:dots1">
+ <xsl:value-of select="$dash-style/@draw:dots2"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="dots1-length">
+ <xsl:choose>
+ <xsl:when test="$graph-style/@draw:dots1-length">
+ <xsl:value-of select="$graph-style/@draw:dots1-length"/>
+ </xsl:when>
+ <xsl:when test="$dash-style/@draw:dots1-length">
+ <xsl:value-of select="$dash-style/@draw:dots1-length"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="dots2-length">
+ <xsl:choose>
+ <xsl:when test="$graph-style/@draw:dots2-length">
+ <xsl:value-of select="$graph-style/@draw:dots2-length"/>
+ </xsl:when>
+ <xsl:when test="$dash-style/@draw:dots2-length">
+ <xsl:value-of select="$dash-style/@draw:dots2-length"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="distance">
+ <xsl:choose>
+ <xsl:when test="$graph-style/@draw:distance">
+ <xsl:value-of select="$graph-style/@draw:distance"/>
+ </xsl:when>
+ <xsl:when test="$dash-style/@draw:distance">
+ <xsl:value-of select="$dash-style/@draw:distance"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="dot1-step">
+ <xsl:choose>
+ <xsl:when test="contains($dots1-length,'%')">
+ <xsl:variable name="dots-percent">
+ <xsl:call-template name="ValueOfPercent">
+ <xsl:with-param name="value" select="$dots1-length"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="round($dots-percent)"/>
+ </xsl:when>
+ <xsl:when test="contains($dots1-length , 'in' ) and $stroke-width &gt; 0">
+ <xsl:value-of select="round( number(substring-before($dots1-length,'in' )) div $stroke-width )"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="dot2-step">
+ <xsl:choose>
+ <xsl:when test="contains($dots2-length,'%')">
+ <xsl:variable name="dots-percent">
+ <xsl:call-template name="ValueOfPercent">
+ <xsl:with-param name="value" select="$dots2-length"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="round($dots-percent)"/>
+ </xsl:when>
+ <xsl:when test="contains($dots2-length,'in') and $stroke-width &gt; 0">
+ <xsl:value-of select="round(number(substring-before($dots2-length,'in')) div $stroke-width)"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="distance-step">
+ <xsl:choose>
+ <xsl:when test="contains($distance,'%')">
+ <xsl:variable name="dots-percent">
+ <xsl:call-template name="ValueOfPercent">
+ <xsl:with-param name="value" select="$distance"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="round($dots-percent)"/>
+ </xsl:when>
+ <xsl:when test="contains($distance,'in') and $stroke-width &gt; 0">
+ <xsl:value-of select="round(number(substring-before($distance,'in')) div $stroke-width)"/>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="dashstyle">
+ <xsl:choose>
+ <xsl:when test="$dots1 = 1 and $dots2 = 1 and $dot1-step = 0 and $dot2-step = 0 and $distance-step = 0">
+ <xsl:value-of select="'ShortDot'"/>
+ </xsl:when>
+ <xsl:when test="$dots2 = 0 and $dot1-step = 0 and $dot2-step = 0 and $distance-step &gt; 0">
+ <xsl:value-of select="concat('0 ', $distance-step)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="create_dashstyle">
+ <xsl:with-param name="dot-count" select="$dots1"/>
+ <xsl:with-param name="dot-step" select="$dot1-step"/>
+ <xsl:with-param name="distance-step" select="$distance-step"/>
+ </xsl:call-template>
+ <xsl:value-of select="' '"/>
+ <xsl:call-template name="create_dashstyle">
+ <xsl:with-param name="dot-count" select="$dots2"/>
+ <xsl:with-param name="dot-step" select="$dot2-step"/>
+ <xsl:with-param name="distance-step" select="$distance-step"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="$dashstyle"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="create_dashstyle">
+ <xsl:param name="dot-count"/>
+ <xsl:param name="dot-step"/>
+ <xsl:param name="distance-step"/>
+ <xsl:if test="$dot-count &gt; 0">
+ <xsl:value-of select="concat($dot-step, ' ' , $distance-step )"/>
+ <xsl:if test="$dot-count - 1 &gt; 0">
+ <xsl:value-of select="' '"/>
+ <xsl:call-template name="create_dashstyle">
+ <xsl:with-param name="dot-count" select="$dot-count - 1"/>
+ <xsl:with-param name="dot-step" select="$dot-step"/>
+ <xsl:with-param name="distance-step" select="$distance-step"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="get_borderstyle">
+ <xsl:param name="border"/>
+ <xsl:param name="border-line-width"/>
+ <xsl:choose>
+ <xsl:when test="contains($border,'solid')">
+ <xsl:variable name="strokeweight">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="value" select="substring-before($border, ' ')"/>
+ <xsl:with-param name="TargetMeasure" select="'pt'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat ( 'strokeweight:', $strokeweight)"/>
+ </xsl:when>
+ <xsl:when test="contains($border,'double')">
+ <xsl:variable name="outside">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="value" select="substring-after(substring-after($border-line-width, ' ') , ' ')"/>
+ <xsl:with-param name="TargetMeasure" select="'pt'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="inside">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="value" select="substring-before($border-line-width, ' ')"/>
+ <xsl:with-param name="TargetMeasure" select="'pt'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="space">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="value" select="substring-before(substring-after($border-line-width, ' ') , ' ')"/>
+ <xsl:with-param name="TargetMeasure" select="'pt'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="linestyle">
+ <xsl:choose>
+ <xsl:when test="$outside = $inside">
+ <xsl:value-of select="'thinThin'"/>
+ </xsl:when>
+ <xsl:when test="$outside &gt; $inside">
+ <xsl:value-of select="'thickThin'"/>
+ </xsl:when>
+ <xsl:when test="$outside &lt; $inside">
+ <xsl:value-of select="'thinThick'"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="strokeweight" select="$inside + $outside + $space"/>
+ <xsl:value-of select="concat( 'linestyle:' , $linestyle , ';' , 'strokeweight:' , $strokeweight )"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="DrawElements">
+ <xsl:param name="TargetMeasure" select="pt"/>
+ <xsl:param name="x-adjust" select="0"/>
+ <xsl:param name="y-adjust" select="0"/>
+ <xsl:param name="force-draw" select="'false'"/>
+ <xsl:param name="shape-type"/>
+ <xsl:variable name="MeasureMark">
+ <xsl:choose>
+ <xsl:when test="$TargetMeasure = 'twip'"/>
+ <xsl:otherwise>
+ <xsl:value-of select="$TargetMeasure"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="drawtextstyle" select="@draw:text-style-name"/>
+ <xsl:variable name="org-z-index">
+ <xsl:choose>
+ <xsl:when test="@draw:z-index">
+ <xsl:value-of select="number(concat('0',@draw:z-index))"/>
+ </xsl:when>
+ <xsl:when test="parent::draw:frame/@draw:z-index">
+ <xsl:value-of select="number(concat('0',parent::draw:frame/@draw:z-index))"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="run-though" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@style:run-through"/>
+ <xsl:variable name="org-wrap" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@style:wrap"/>
+ <xsl:variable name="draw-name">
+ <xsl:choose>
+ <xsl:when test="string-length(@draw:name) = 0">
+ <xsl:value-of select="translate(ancestor::draw:frame[1]/@draw:name, ':/', '__')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate(@draw:name, ':/', '__')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="style_name2key">
+ <xsl:choose>
+ <xsl:when test="@draw:style-name">
+ <xsl:value-of select="@draw:style-name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="ancestor::draw:frame/@draw:style-name">
+ <xsl:value-of select="ancestor::draw:frame/@draw:style-name"/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="draw-fill-type" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill"/>
+ <xsl:variable name="draw-gradient-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill-gradient-name"/>
+ <xsl:variable name="horizontal-pos" select="key('graphics-style', $style_name2key)/style:graphic-properties/@style:horizontal-pos"/>
+ <!--horizontal-pos attribute is for the placement of all the drawing elements-->
+ <xsl:variable name="fill-image-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill-image-name"/>
+ <xsl:if test="$draw-fill-type = 'bitmap' ">
+ <xsl:element name="w:binData">
+ <xsl:attribute name="w:name">
+ <xsl:value-of select="concat( 'wordml://', $fill-image-name)"/>
+ </xsl:attribute>
+ <xsl:value-of select="translate(key('fill-image',$fill-image-name)/office:binary-data/text(),'&#9;&#10;&#13;&#32;','' ) "/>
+ <!-- xsl:value-of select="office:binary-data/text()"/ -->
+ </xsl:element>
+ </xsl:if>
+ <xsl:variable name="z-index">
+ <xsl:choose>
+ <xsl:when test="$run-though='foreground'">
+ <!-- make sure z-index >=0 -->
+ <xsl:choose>
+ <xsl:when test="$org-z-index &lt; 0">0</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$org-z-index"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$run-though='background'">
+ <!-- make sure z-index < 0 -->
+ <xsl:choose>
+ <xsl:when test="$org-z-index &lt; 0">
+ <xsl:value-of select="$org-z-index"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$org-z-index - 10"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="wrap">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='as-char' ">none</xsl:when>
+ <xsl:when test="$org-wrap='dynamic'">tight</xsl:when>
+ <xsl:when test="$org-wrap='parallel'">square</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="ooshapename" select="substring-after(name(),':')"/>
+ <xsl:variable name="element-name">
+ <xsl:choose>
+ <xsl:when test="$ooshapename='rect'">v:rect</xsl:when>
+ <xsl:when test="$ooshapename='ellipse' and not(string-length(@draw:kind) &gt; 0)">v:oval</xsl:when>
+ <xsl:when test="$ooshapename='ellipse' and string-length(@draw:kind) &gt; 0">v:arc</xsl:when>
+ <xsl:when test="$ooshapename='circle' and string-length(@draw:kind) &gt; 0">v:arc</xsl:when>
+ <xsl:when test="$ooshapename='line'">v:line</xsl:when>
+ <xsl:when test="$ooshapename='polyline'">v:polyline</xsl:when>
+ <xsl:when test="$ooshapename='polygon'">v:polyline</xsl:when>
+ <xsl:when test="$ooshapename='text-box'">v:shape</xsl:when>
+ <xsl:when test="$ooshapename='image'">v:shape</xsl:when>
+ <xsl:when test="$ooshapename='frame'">v:shape</xsl:when>
+ <xsl:when test="$ooshapename='path'">v:shape</xsl:when>
+ <!-- This caption is not the "Caption", it's GUI name is Callouts-->
+ <xsl:when test="$ooshapename='caption'">v:shape</xsl:when>
+ <xsl:when test="$ooshapename='custom-shape' and draw:enhanced-geometry[1]/@draw:predefined-type = 'non-primitive' ">v:shape</xsl:when>
+ <xsl:when test="$ooshapename='custom-shape' and draw:enhanced-geometry[1]/@draw:predefined-type = 'round-rectangle' ">v:roundrect</xsl:when>
+ <xsl:when test="$ooshapename='custom-shape' and draw:enhanced-geometry[1]/@draw:predefined-type = 'rectangle' ">v:rect</xsl:when>
+ <xsl:when test="$ooshapename='custom-shape' and draw:enhanced-geometry[1]/@draw:predefined-type = 'ellipse' ">v:oval</xsl:when>
+ <xsl:when test="$ooshapename='custom-shape'">v:shape</xsl:when>
+ <!-- some wild guess -->
+ <xsl:otherwise>v:shape</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="ms-shape-type">
+ <xsl:choose>
+ <xsl:when test="string-length($shape-type) &gt; 0">
+ <xsl:value-of select="$shape-type"/>
+ </xsl:when>
+ <xsl:when test="$ooshapename='custom-shape' ">
+ <xsl:call-template name="ooo_custom_draw2ms_word_draw_map">
+ <xsl:with-param name="ooo_predefined_type" select="draw:enhanced-geometry[1]/@draw:predefined-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="real-x-adjust">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="concat($x-adjust,'in')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="real-y-adjust">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="concat($y-adjust,'in')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="org-x">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="@svg:x"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="org-y">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="@svg:y"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="pagemaster" select="key('master-page','Standard')/@style:page-layout-name"/>
+ <xsl:variable name="leftmargin-pt">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="key('page-layout',$pagemaster)/style:page-layout-properties/@fo:margin-left"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="topmargin-pt">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="key('page-layout',$pagemaster)/style:page-layout-properties/@fo:margin-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- addjust the x and y values of the page archored objects-->
+ <xsl:variable name="x">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
+ <xsl:value-of select="$org-x + $real-x-adjust - $leftmargin-pt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$org-x + $real-x-adjust"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="y">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
+ <xsl:value-of select="$org-y + $real-y-adjust - $topmargin-pt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$org-y + $real-y-adjust"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="width">
+ <xsl:variable name="width-tmp">
+ <xsl:choose>
+ <xsl:when test="@svg:width">
+ <xsl:value-of select="@svg:width"/>
+ </xsl:when>
+ <xsl:when test="not(string-length(parent::draw:frame/@svg:width) = 0)">
+ <xsl:value-of select="parent::draw:frame/@svg:width"/>
+ </xsl:when>
+ <xsl:when test="string-length(@svg:width) = 0 and ancestor::draw:frame">
+ <xsl:value-of select="ancestor::draw:frame/@svg:width"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@svg:width"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="$width-tmp"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="height">
+ <xsl:choose>
+ <xsl:when test="@svg:height">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="@svg:height"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="not(string-length(parent::draw:frame/@svg:height) = 0)">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="parent::draw:frame/@svg:height"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="@fo:min-height and string-length(text:p/text()) = 0 and not(text:p/draw:*)">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="@fo:min-height"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="borderstyle">
+ <xsl:call-template name="get_borderstyle">
+ <xsl:with-param name="border" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@fo:border"/>
+ <xsl:with-param name="border-line-width" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@style:border-line-width"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="stroke-weight-in-inch" select="number(concat('0',translate(key('graphics-style', @draw:style-name)/style:graphic-properties/@svg:stroke-width ,'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ','') ))"/>
+ <xsl:variable name="stroke-weight">
+ <xsl:choose>
+ <xsl:when test="contains($borderstyle , 'strokeweight')">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="concat( substring-after($borderstyle, 'strokeweight:') , 'pt')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@svg:stroke-width"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="linestyle">
+ <xsl:if test="contains($borderstyle , 'strokeweight')">
+ <xsl:value-of select="substring-before( substring-after($borderstyle, 'linestyle:') , ';strokeweight')"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="stroked">
+ <xsl:if test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:stroke = 'none'">
+ <xsl:value-of select="'f'"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="dashstyle">
+ <xsl:call-template name="get_dashstyle">
+ <xsl:with-param name="stroke-width" select="$stroke-weight-in-inch"/>
+ <xsl:with-param name="style-name" select="@draw:style-name"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="start-arrow">
+ <xsl:choose>
+ <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end">
+ <xsl:call-template name="MapArrowStyle">
+ <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="end-arrow">
+ <xsl:choose>
+ <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start">
+ <xsl:call-template name="MapArrowStyle">
+ <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="start-arrow-length">
+ <xsl:choose>
+ <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end">
+ <xsl:call-template name="GetArrowLength">
+ <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end"/>
+ <xsl:with-param name="arrow-width" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end-width"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="start-arrow-width">
+ <xsl:choose>
+ <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end">
+ <xsl:call-template name="GetArrowWidth">
+ <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end"/>
+ <xsl:with-param name="arrow-width" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-end-width"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="end-arrow-length">
+ <xsl:choose>
+ <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start">
+ <xsl:call-template name="GetArrowLength">
+ <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start"/>
+ <xsl:with-param name="arrow-width" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start-width"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="end-arrow-width">
+ <xsl:choose>
+ <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start">
+ <xsl:call-template name="GetArrowWidth">
+ <xsl:with-param name="arrow-name" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start"/>
+ <xsl:with-param name="arrow-width" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:marker-start-width"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="stroke-color">
+ <xsl:choose>
+ <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@svg:stroke-color">
+ <xsl:value-of select="key('graphics-style', @draw:style-name)/style:graphic-properties/@svg:stroke-color"/>
+ </xsl:when>
+ <xsl:when test="contains(key('graphics-style', @draw:style-name)/style:graphic-properties/@fo:border, '#')">
+ <xsl:value-of select="concat('#', substring-after(key('graphics-style', @draw:style-name)/style:graphic-properties/@fo:border, '#') )"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="stroke-opacity">
+ <xsl:call-template name="ValueOfPercent">
+ <xsl:with-param name="value" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@svg:stroke-opacity"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="fill-color">
+ <xsl:choose>
+ <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill-color">
+ <xsl:value-of select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill-color"/>
+ </xsl:when>
+ <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-style">black</xsl:when>
+ <xsl:when test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fill = 'none'"/>
+ <xsl:when test="$draw-fill-type = 'gradient' ">
+ <xsl:value-of select="key('draw-gradient',$draw-gradient-name)/@draw:end-color "/>
+ </xsl:when>
+ <!-- for these need fill, set the default color we used in oo-->
+ <xsl:when test="name()='draw:polygon' or name()='draw:custom-shape' or name() = 'draw:rect' or (name() = 'draw:ellipse' and not( @draw:kind='arc') )">#00B8FF</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="position">
+ <xsl:value-of select="concat('left:', $x ,$MeasureMark , ';top:' , $y ,$MeasureMark , ';width:', $width ,$MeasureMark )"/>
+ <xsl:if test="not($height = 0)">
+ <xsl:value-of select="concat(';height:', $height ,$MeasureMark )"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="flip">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='as-char' and $ooshapename='line'"/>
+ <xsl:when test="$ooshapename='image'"/>
+ <xsl:when test="$ooshapename='path'"/>
+ <xsl:when test="$ooshapename='caption'"/>
+ <xsl:when test="@draw:kind = 'arc' or @draw:kind = 'cut' or @draw:kind = 'section'"/>
+ <xsl:when test="$ooshapename='custom-shape'"/>
+ <xsl:otherwise>flip:x</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="absolute">
+ <xsl:choose>
+ <xsl:when test="ancestor::draw:a"/>
+ <xsl:when test="@text:anchor-type = 'as-char' or @text:anchor-type = 'to-char'"/>
+ <xsl:when test="parent::draw:frame/@text:anchor-type = 'as-char' or parent::draw:frame/@text:anchor-type = 'to-char'"/>
+ <xsl:otherwise>position:absolute</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="anchorlock">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type = 'as-char' or @text:anchor-type = 'to-char'">has</xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- start line special -->
+ <xsl:variable name="org-x1">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="@svg:x1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="org-y1">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="@svg:y1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="org-x2">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="@svg:x2"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="org-y2">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="value" select="@svg:y2"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="x1">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
+ <xsl:value-of select="$org-x1 + $real-x-adjust - $leftmargin-pt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$org-x1 + $real-x-adjust"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="y1">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
+ <xsl:value-of select="$org-y1 + $real-y-adjust - $topmargin-pt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$org-y1 + $real-y-adjust"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="x2">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
+ <xsl:value-of select="$org-x2 + $real-x-adjust - $leftmargin-pt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$org-x2 + $real-x-adjust"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="y2">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='page' or ancestor::draw:*/@text:anchor-type='page'">
+ <xsl:value-of select="$org-y2 + $real-y-adjust - $topmargin-pt"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$org-y2 + $real-y-adjust"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- end line special -->
+ <xsl:variable name="relative">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type = 'as-char' or @text:anchor-type = 'to-char'">mso-position-horizontal-relative:char;mso-position-vertical-relative:line</xsl:when>
+ <xsl:when test="parent::draw:frame/@text:anchor-type = 'as-char' or parent::draw:frame/@text:anchor-type = 'to-char'">mso-position-horizontal-relative:char;mso-position-vertical-relative:line</xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="style">
+ <xsl:choose>
+ <xsl:when test="$wrap='none'"/>
+ <xsl:otherwise>
+ <xsl:if test="string-length($absolute) &gt; 0">
+ <xsl:value-of select="concat($absolute, ';')"/>
+ </xsl:if>
+ <xsl:value-of select="concat('z-index:', $z-index, ';')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="string-length($flip) &gt; 0">
+ <xsl:value-of select="concat($flip,';')"/>
+ </xsl:if>
+ <xsl:if test="not($ooshapename = 'line')">
+ <xsl:value-of select="concat($position,';')"/>
+ </xsl:if>
+ <xsl:if test="ancestor::draw:frame and name()='draw:text-box'">
+ <xsl:if test="string-length($horizontal-pos) &gt; 0">
+ <xsl:value-of select="concat('mso-position-horizontal:',$horizontal-pos,';')"/>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="string-length($relative) &gt; 0">
+ <xsl:value-of select="concat($relative,';')"/>
+ </xsl:if>
+ </xsl:variable>
+ <!-- image special: convert oo base64 binary data (77char/line) to word base64 binary data(73char/line) , a workthrough is removing all line breaks -->
+ <xsl:if test="$ooshapename = 'image'">
+ <xsl:element name="w:binData">
+ <xsl:attribute name="w:name">
+ <xsl:value-of select="concat( 'wordml://', $draw-name )"/>
+ </xsl:attribute>
+ <xsl:value-of select="translate(office:binary-data/text(),'&#9;&#10;&#13;&#32;','' ) "/>
+ <!-- xsl:value-of select="office:binary-data/text()"/ -->
+ </xsl:element>
+ </xsl:if>
+ <!-- all element goes here -->
+ <xsl:variable name="id">
+ <xsl:choose>
+ <xsl:when test="$ooshapename='line'">
+ <xsl:value-of select="concat('_x',$x1 , '_' ,$y1, '_' , $x2, '_' ,$y2 )"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('_x',$x , '_' ,$y, '_' , $width, '_' ,$height )"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="{$element-name}">
+ <xsl:attribute name="id">
+ <xsl:value-of select="$id"/>
+ </xsl:attribute>
+ <xsl:if test="string-length($ms-shape-type) &gt; 0">
+ <xsl:attribute name="type">
+ <xsl:value-of select="$ms-shape-type"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style">
+ <xsl:value-of select="$style"/>
+ </xsl:attribute>
+ <xsl:if test="$stroke-weight &gt; 0">
+ <xsl:attribute name="strokeweight">
+ <xsl:value-of select="concat($stroke-weight,$MeasureMark)"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($stroked) &gt; 0">
+ <xsl:attribute name="stroked">
+ <xsl:value-of select="$stroked"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($stroke-color) &gt; 0">
+ <xsl:attribute name="strokecolor">
+ <xsl:value-of select="$stroke-color"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($fill-color) &gt; 0">
+ <xsl:attribute name="fillcolor">
+ <xsl:value-of select="$fill-color"/>
+ </xsl:attribute>
+ <xsl:attribute name="filled">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="parent::draw:frame/draw:object-ole[1]">
+ <xsl:attribute name="filled">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($stroke-opacity) &gt; 0">
+ <xsl:attribute name="opacity">
+ <xsl:value-of select="$stroke-opacity"/>
+ </xsl:attribute>
+ </xsl:if>
+ <!-- arc special attribute -->
+ <xsl:if test="@draw:kind = 'arc' or @draw:kind = 'cut' or @draw:kind = 'section'">
+ <xsl:choose>
+ <xsl:when test="@draw:start-angle &gt; @draw:end-angle">
+ <xsl:attribute name="startangle">
+ <xsl:value-of select="round( 450 - (@draw:end-angle + 360) )"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="startangle">
+ <xsl:value-of select="round( 450 - @draw:end-angle )"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="endangle">
+ <xsl:value-of select="round(450 - @draw:start-angle)"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@draw:kind = 'cut'">
+ <xsl:attribute name="fill">
+ <xsl:value-of select="'true'"/>
+ </xsl:attribute>
+ </xsl:if>
+ <!-- end arc special attribute -->
+ <!-- line special attribute-->
+ <xsl:if test="$ooshapename='line'">
+ <xsl:attribute name="from">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='as-char'">0,0</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($x1,$MeasureMark, ',',$y2,$MeasureMark )"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="to">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='as-char'">
+ <xsl:value-of select="concat($x2,$MeasureMark ,',',$y2,$MeasureMark )"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($x2,$MeasureMark ,',' ,$y1,$MeasureMark)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:if>
+ <!-- end line special attribute-->
+ <!-- polyline and polygon special attribute-->
+ <xsl:if test="$ooshapename='polyline' or $ooshapename='polygon' ">
+ <!-- translate ' ' to in ' tranclate ',' to 'in,' -->
+ <xsl:variable name="points">
+ <xsl:call-template name="points2points">
+ <xsl:with-param name="input_x" select="$x"/>
+ <xsl:with-param name="input_y" select="$y"/>
+ <xsl:with-param name="input_width" select="$width"/>
+ <xsl:with-param name="input_height" select="$height"/>
+ <xsl:with-param name="input_boxwidth" select="substring-before(substring-after(@svg:viewBox,'0 0 '),' ')"/>
+ <xsl:with-param name="input_boxheight" select="substring-after(substring-after(@svg:viewBox,'0 0 '),' ')"/>
+ <xsl:with-param name="input_points" select="concat(@draw:points,' ')"/>
+ <!-- add a space to the end of input_points -->
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="points">
+ <xsl:value-of select="$points"/>
+ </xsl:attribute>
+ </xsl:if>
+ <!-- end polyline and polygon special attribute-->
+ <!-- callouts special attribute-->
+ <xsl:if test="$ooshapename='caption'">
+ <xsl:variable name="caption-point-x">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="'twip'"/>
+ <xsl:with-param name="value" select="@draw:caption-point-x"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="caption-point-y">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="'twip'"/>
+ <xsl:with-param name="value" select="@draw:caption-point-y"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="type">
+ <!-- map to word line label 3-->
+ <xsl:value-of select="'#_x0000_t48'"/>
+ </xsl:attribute>
+ <xsl:attribute name="adj">
+ <xsl:value-of select=" concat($caption-point-x * 20 , ',' , $caption-point-y * 20 , ',' , $caption-point-x * 10 , ',,,,' , $caption-point-x * 20, ',' , $caption-point-y * 20) "/>
+ </xsl:attribute>
+ </xsl:if>
+ <!-- end callouts special attribute-->
+ <!-- path special attribute-->
+ <xsl:if test="$ooshapename='path' or string-length(@svg:d) &gt; 0 or ( $ooshapename='custom-shape' and draw:enhanced-geometry[1]/@draw:predefined-type = 'non-primitive') ">
+ <xsl:variable name="path">
+ <xsl:choose>
+ <xsl:when test="$ooshapename='path' or string-length(@svg:d) &gt; 0 ">
+ <xsl:call-template name="svgpath2vmlpath">
+ <xsl:with-param name="svg-path" select="@svg:d"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="svgpath2vmlpath">
+ <xsl:with-param name="svg-path" select="draw:enhanced-geometry[1]/@draw:enhanced-path"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="coordorigin">
+ <xsl:value-of select=" '0 0' "/>
+ </xsl:attribute>
+ <xsl:attribute name="coordsize">
+ <xsl:choose>
+ <xsl:when test="string-length(@svg:viewBox) &gt; 0 ">
+ <xsl:value-of select="substring-after(@svg:viewBox,'0 0 ')"/>
+ </xsl:when>
+ <xsl:when test="string-length(draw:enhanced-geometry[1]/@svg:viewBox) &gt; 0 ">
+ <xsl:value-of select="substring-after(draw:enhanced-geometry[1]/@svg:viewBox,'0 0 ')"/>
+ </xsl:when>
+ <!-- for custom shape use a default viewbox. right? -->
+ <xsl:otherwise>
+ <xsl:value-of select=" '21600 21600' "/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="path">
+ <xsl:value-of select="$path"/>
+ </xsl:attribute>
+ </xsl:if>
+ <!-- end path special attribute-->
+ <!-- image special element -->
+ <xsl:if test="$ooshapename='image'">
+ <xsl:element name="v:imagedata">
+ <xsl:attribute name="src">
+ <xsl:value-of select="concat('wordml://', $draw-name)"/>
+ </xsl:attribute>
+ <xsl:attribute name="o:title">
+ <xsl:value-of select="$draw-name"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <!-- end image special element -->
+ <!-- start dash style , line style and arrow style-->
+ <xsl:if test="string-length($dashstyle) &gt; 0 or string-length($linestyle) &gt; 0 or string-length($start-arrow) &gt; 0 or string-length($end-arrow) &gt; 0 ">
+ <xsl:element name="v:stroke">
+ <xsl:if test="string-length($dashstyle) &gt; 0">
+ <xsl:attribute name="dashstyle">
+ <xsl:value-of select="$dashstyle"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($linestyle) &gt; 0">
+ <xsl:attribute name="linestyle">
+ <xsl:value-of select="$linestyle"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($start-arrow) &gt; 0 ">
+ <xsl:attribute name="startarrow">
+ <xsl:value-of select="$start-arrow"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($end-arrow) &gt; 0 ">
+ <xsl:attribute name="endarrow">
+ <xsl:value-of select="$end-arrow"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($start-arrow-length) &gt; 0 ">
+ <xsl:attribute name="startarrowlength">
+ <xsl:value-of select="$start-arrow-length"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($start-arrow-width) &gt; 0 ">
+ <xsl:attribute name="startarrowwidth">
+ <xsl:value-of select="$start-arrow-width"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($end-arrow-length) &gt; 0 ">
+ <xsl:attribute name="endarrowlength">
+ <xsl:value-of select="$end-arrow-length"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="string-length($end-arrow-width) &gt; 0 ">
+ <xsl:attribute name="endarrowwidth">
+ <xsl:value-of select="$end-arrow-width"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <!-- end dash style , line style and arrow style -->
+ <!-- start wrap type -->
+ <xsl:if test="string-length($wrap) &gt; 0">
+ <xsl:element name="w10:wrap">
+ <xsl:attribute name="type">
+ <xsl:value-of select="$wrap"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <!-- end wrap type -->
+ <!-- start anchor to char specific element -->
+ <xsl:if test="string-length($anchorlock) &gt; 0">
+ <xsl:element name="w10:anchorlock"/>
+ </xsl:if>
+ <!-- end wrap type -->
+ <!-- start fill image -->
+ <xsl:if test="string-length($draw-fill-type ) &gt; 0">
+ <xsl:element name="v:fill">
+ <xsl:choose>
+ <xsl:when test="$draw-fill-type = 'bitmap'">
+ <xsl:attribute name="src">
+ <xsl:value-of select="concat( 'wordml://', $fill-image-name)"/>
+ </xsl:attribute>
+ <xsl:attribute name="o:titile">
+ <xsl:value-of select="$fill-image-name"/>
+ </xsl:attribute>
+ <xsl:attribute name="recolor">
+ <xsl:value-of select=" 'true' "/>
+ </xsl:attribute>
+ <xsl:attribute name="rotate">
+ <xsl:value-of select=" 'true' "/>
+ </xsl:attribute>
+ <xsl:attribute name="type">
+ <xsl:value-of select=" 'frame' "/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$draw-fill-type = 'gradient'">
+ <xsl:attribute name="type">
+ <xsl:value-of select=" 'gradient' "/>
+ </xsl:attribute>
+ <xsl:attribute name="color2">
+ <xsl:value-of select="key('draw-gradient',$draw-gradient-name)/@draw:start-color "/>
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <!-- end fill image -->
+ <xsl:if test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-style">
+ <xsl:call-template name="FontWork"/>
+ </xsl:if>
+ <xsl:if test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:shadow = 'visible'">
+ <xsl:call-template name="Shadow"/>
+ </xsl:if>
+ <!-- only draw:g can have child graphic -->
+ <xsl:choose>
+ <xsl:when test="name() = 'draw:g'">
+ <xsl:apply-templates select="draw:*">
+ <xsl:with-param name="TargetMeasure" select="$TargetMeasure"/>
+ <xsl:with-param name="x-adjust" select="$x-adjust"/>
+ <xsl:with-param name="y-adjust" select="$y-adjust"/>
+ <xsl:with-param name="force-draw" select="$force-draw"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="text:*/* | text:*/text()">
+ <xsl:element name="v:textbox">
+ <xsl:if test="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:writing-mode = 'tb-rl'">
+ <xsl:attribute name="style">
+ <xsl:value-of select="'layout-flow:vertical'"/>
+ </xsl:attribute>
+ </xsl:if>
+ <w:txbxContent>
+ <xsl:apply-templates select="text() | text:*"/>
+ </w:txbxContent>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:apply-templates select="parent::draw:frame/draw:object-ole" mode="output">
+ <xsl:with-param name="ShapeID" select="$id"/>
+ </xsl:apply-templates>
+ </xsl:template>
+ <xsl:template name="Shadow">
+ <xsl:element name="v:shadow">
+ <xsl:variable name="key-node" select="key('graphics-style', @draw:style-name)/style:graphic-properties"/>
+ <xsl:attribute name="on">true</xsl:attribute>
+ <xsl:attribute name="offset">
+ <xsl:value-of select="concat($key-node/@draw:shadow-offset-x,',' , $key-node/@draw:shadow-offset-y)"/>
+ </xsl:attribute>
+ <xsl:attribute name="color">
+ <xsl:value-of select="$key-node/@draw:shadow-color"/>
+ </xsl:attribute>
+ <xsl:attribute name="opacity">
+ <xsl:value-of select="$key-node/@draw:shadow-opacity"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="FontWork">
+ <xsl:element name="v:path">
+ <xsl:attribute name="textpathok">true</xsl:attribute>
+ </xsl:element>
+ <xsl:if test="not(key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-shadow) or not(key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-shadow = 'normal')">
+ <xsl:element name="v:shadow">
+ <xsl:attribute name="on">true</xsl:attribute>
+ <xsl:attribute name="type">perspective</xsl:attribute>
+ <xsl:attribute name="color">
+ <xsl:value-of select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-shadow-color"/>
+ </xsl:attribute>
+ <xsl:variable name="offset-x">
+ <xsl:call-template name="ConvertMeasure">
+ <xsl:with-param name="TargetMeasure" select="'twip'"/>
+ <xsl:with-param name="value" select="key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-shadow-offset-x"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="offset-y" select="substring-before(key('graphics-style', @draw:style-name)/style:graphic-properties/@draw:fontwork-shadow-offset-y, 'in')"/>
+ <xsl:attribute name="matrix">
+ <xsl:value-of select="concat(',,,' , round($offset-y div 0.000693) div 100, ',,')"/>
+ </xsl:attribute>
+ <xsl:attribute name="origin">-30%, -30%</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="v:textpath">
+ <xsl:attribute name="on">true</xsl:attribute>
+ <xsl:attribute name="fitpath">true</xsl:attribute>
+ <xsl:attribute name="fitshape">true</xsl:attribute>
+ <xsl:attribute name="style">
+ <xsl:choose>
+ <xsl:when test="key('paragraph-style', text:p[1]/@text:style-name )/style:graphic-properties/@svg:font-family">
+ <xsl:value-of select="concat('font-family:&quot;' , key('paragraph-style', text:p[1]/@text:style-name )/style:graphic-properties/@svg:font-family , '&quot;') "/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="default-graphics-properties" select="/office:document/office:styles/style:default-style[@style:family = 'graphics']/style:graphic-properties"/>
+ <xsl:value-of select="concat('font-family:&quot;' , $default-graphics-properties/@style:font-name , '&quot;') "/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="string">
+ <xsl:value-of select="text:p"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="MapArrowStyle">
+ <xsl:param name="arrow-name"/>
+ <xsl:choose>
+ <xsl:when test="$arrow-name = 'Arrow' ">Block</xsl:when>
+ <xsl:when test="$arrow-name = 'Square' ">Diamond</xsl:when>
+ <xsl:when test="$arrow-name = 'Small arrow' ">Block</xsl:when>
+ <xsl:when test="$arrow-name = 'Dimension lines' ">Diamond</xsl:when>
+ <xsl:when test="$arrow-name = 'Double Arrow' ">Block</xsl:when>
+ <xsl:when test="$arrow-name = 'Rounded short arrow' ">Block</xsl:when>
+ <xsl:when test="$arrow-name = 'Symmetric arrow' ">Block</xsl:when>
+ <xsl:when test="$arrow-name = 'Line Arrow' ">Open</xsl:when>
+ <xsl:when test="$arrow-name = 'Rounded large arrow' ">Block</xsl:when>
+ <xsl:when test="$arrow-name = 'Circle' ">Oval</xsl:when>
+ <xsl:when test="$arrow-name = 'Square 45' ">Diamond</xsl:when>
+ <xsl:when test="$arrow-name = 'Arrow concave' ">Classic</xsl:when>
+ <xsl:otherwise>Block</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="GetArrowLength">
+ <xsl:param name="arrow-name"/>
+ <xsl:param name="arrow-width"/>
+ <xsl:variable name="arrow-size">
+ <xsl:choose>
+ <xsl:when test="$arrow-width">
+ <xsl:value-of select="round(number(substring-before($arrow-width, 'in')) div 0.02) "/>
+ </xsl:when>
+ <xsl:otherwise>3</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$arrow-size &gt; 2">Long</xsl:when>
+ <xsl:when test="$arrow-size &gt; 1">Medium</xsl:when>
+ <xsl:when test="$arrow-size &gt; 0">Short</xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="GetArrowWidth">
+ <xsl:param name="arrow-name"/>
+ <xsl:param name="arrow-width"/>
+ <xsl:variable name="arrow-size">
+ <xsl:choose>
+ <xsl:when test="$arrow-width">
+ <xsl:value-of select="round(number(substring-before($arrow-width, 'in')) div 0.02) "/>
+ </xsl:when>
+ <xsl:otherwise>3</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$arrow-size &gt; 2">Wide</xsl:when>
+ <xsl:when test="$arrow-size &gt; 1">Medium</xsl:when>
+ <xsl:when test="$arrow-size &gt; 0">Narrow</xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="export-oledata">
+ <xsl:if test="//draw:object-ole[1]">
+ <xsl:apply-templates select="//draw:object-ole" mode="oledata.mso"/>
+ <w:docOleData>
+ <w:binData w:name="oledata.mso">
+ <xsl:if test="function-available('ole:getByName')">
+ <xsl:value-of select="translate(ole:getByName('oledata.mso'),'&#10;&#13;&#32;','')"/>
+ </xsl:if>
+ </w:binData>
+ </w:docOleData>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="draw:object-ole" mode="oledata.mso">
+ <xsl:variable name="stream-name">
+ <xsl:apply-templates select="." mode="get-number"/>
+ </xsl:variable>
+ <xsl:variable name="tmp" select="ole:insertByName($stream-name, translate(office:binary-data/text(),'&#10;&#13;&#32;','' ) )"/>
+ </xsl:template>
+ <xsl:template match="draw:object-ole" mode="output">
+ <xsl:param name="ShapeID"/>
+ <xsl:variable name="stream-name">
+ <xsl:apply-templates select="." mode="get-number"/>
+ </xsl:variable>
+ <o:OLEObject Type="Embed" DrawAspect="Content" ObjectID="{$stream-name}" ShapeID="{$ShapeID}" ProgID=""/>
+ </xsl:template>
+ <xsl:template match="draw:object-ole" mode="get-number">
+ <xsl:number from="/office:document" level="any" count="draw:object-ole" format="1"/>
+ </xsl:template>
+ <xsl:template match="draw:object-ole"/>
</xsl:stylesheet>
diff --git a/filter/source/xslt/export/wordml/ooo2wordml_field.xsl b/filter/source/xslt/export/wordml/ooo2wordml_field.xsl
index c4157f09bbd9..3d488b923944 100644
--- a/filter/source/xslt/export/wordml/ooo2wordml_field.xsl
+++ b/filter/source/xslt/export/wordml/ooo2wordml_field.xsl
@@ -195,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>
@@ -212,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 = '①, ②, ③, ...' ">
@@ -227,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 = '壱, 弐, 参, ...' ">
@@ -267,7 +266,7 @@ $field_number_format_style ='壹, 贰, 叁, ...' ">
<xsl:when test="$field_number_format_style = 'א, י, ק, ...' ">
<xsl:text> \* hebrew1 </xsl:text>
</xsl:when>
- <xsl:when test="$field_number_format_style = 'א, ב, ג, ...' ">
+ <xsl:when test="$field_number_format_style = 'א, ב, ג, ...' ">
<xsl:text> \* hebrew2 </xsl:text>
</xsl:when>
<xsl:when test="$field_number_format_style = 'أ, ب, ت, ...' ">
diff --git a/filter/source/xslt/export/wordml/ooo2wordml_list.xsl b/filter/source/xslt/export/wordml/ooo2wordml_list.xsl
index 5c1d68ae34aa..8c090d92ca30 100644
--- a/filter/source/xslt/export/wordml/ooo2wordml_list.xsl
+++ b/filter/source/xslt/export/wordml/ooo2wordml_list.xsl
@@ -281,19 +281,19 @@
<w:nfc w:val="24"/>
</xsl:when>
<xsl:when test="$number-format ='أ, ب, ت, ...'">
- <!-- 46. arabic-alpha-->
+ <!-- 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='א, י, ק, ...'">
+ </xsl:when>
+ <xsl:when test="$number-format='א, י, ק, ...'">
<!--45. hebrew-1-->
<w:nfc w:val="45"/>
</xsl:when>
<xsl:when test="$number-format='א, ב, ג, ...'">
- <!--47. hebrew-2-->
+ <!--47. hebrew-2-->
<w:nfc w:val="47"/>
</xsl:when>
<xsl:when test="string-length($number-format)=0">
diff --git a/filter/source/xslt/export/wordml/ooo2wordml_settings.xsl b/filter/source/xslt/export/wordml/ooo2wordml_settings.xsl
index 0e2da166d36d..83a822c6d61a 100644
--- a/filter/source/xslt/export/wordml/ooo2wordml_settings.xsl
+++ b/filter/source/xslt/export/wordml/ooo2wordml_settings.xsl
@@ -264,7 +264,7 @@
<xsl:when test="$number-format = 'א, י, ק, ...'">
<w:numFmt w:val="hebrew-1"/>
</xsl:when>
- <xsl:when test="$number-format = 'א, ב, ג, ...'">
+ <xsl:when test="$number-format = 'א, ב, ג, ...'">
<w:numFmt w:val="hebrew-2"/>
</xsl:when>
<xsl:when test="$number-format = 'Native Numbering'">
diff --git a/filter/source/xslt/export/wordml/ooo2wordml_table.xsl b/filter/source/xslt/export/wordml/ooo2wordml_table.xsl
index 5d3bfcf4da28..3b84a87018e9 100644
--- a/filter/source/xslt/export/wordml/ooo2wordml_table.xsl
+++ b/filter/source/xslt/export/wordml/ooo2wordml_table.xsl
@@ -184,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"/>
diff --git a/filter/source/xslt/export/wordml/ooo2wordml_text.xsl b/filter/source/xslt/export/wordml/ooo2wordml_text.xsl
index e1c2810f832e..4280aaf57b93 100644
--- a/filter/source/xslt/export/wordml/ooo2wordml_text.xsl
+++ b/filter/source/xslt/export/wordml/ooo2wordml_text.xsl
@@ -787,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])">
diff --git a/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl b/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
index f731db749e43..6a1b01078eeb 100644
--- a/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
+++ b/filter/source/xslt/import/spreadsheetml/spreadsheetml2ooo.xsl
@@ -17,361 +17,361 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" 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:SL="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" 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:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation: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:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible: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:exsl="http://exslt.org/common" xmlns:set="http://exslt.org/sets" extension-element-prefixes="set exsl" exclude-result-prefixes="aml dt html o ss SL v w10 w wx x set exsl">
- <!--+++++ 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"/>
- <xsl:output indent="no" version="1.0" encoding="UTF-8" method="xml"/>
- <xsl:template match="/">
- <office:document office:mimetype="application/vnd.oasis.opendocument.spreadsheet" office:version="1.0">
- <xsl:apply-templates select="ss:Workbook/o:DocumentProperties"/>
- <xsl:apply-templates select="ss:Workbook/x:ExcelWorkbook"/>
- <xsl:call-template name="font-declaration"/>
- <xsl:apply-templates select="ss:Workbook/ss:Worksheet[1]" mode="styles"/>
- <xsl:element name="office:body">
- <xsl:element name="office:spreadsheet">
- <xsl:call-template name="set-calculation"/>
- <!-- for DataValidation -->
- <xsl:if test="ss:Workbook/ss:Worksheet/x:DataValidation">
- <xsl:element name="table:content-validations">
- <xsl:apply-templates select="ss:Workbook/ss:Worksheet/x:DataValidation"/>
- </xsl:element>
- </xsl:if>
- <xsl:apply-templates select="ss:Workbook/ss:Worksheet"/>
- <xsl:call-template name="Names"/>
- <xsl:element name="table:database-ranges">
- <!-- these descriptions located in every Worksheet in Excel, but at the same path in Calc -->
- <xsl:for-each select="ss:Workbook/ss:Worksheet">
- <xsl:apply-templates select="./x:Sorting"/>
- <xsl:apply-templates select="./x:AutoFilter"/>
- <!-- for Advanced Filter.the position is same as AutoFilter -->
- <xsl:if test="./ss:Names/ss:NamedRange and ./ss:Names/ss:NamedRange/@ss:Name='_FilterDatabase'">
- <xsl:call-template name="transform-advanced-filter">
- <xsl:with-param name="target-value" select="substring-after(./ss:Names/ss:NamedRange[@ss:Name='_FilterDatabase']/@ss:RefersTo, '=')"/>
- <xsl:with-param name="condition-pos" select="substring-after(./ss:Names/ss:NamedRange[@ss:Name='Criteria']/@ss:RefersTo, '=')"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </office:document>
- </xsl:template>
- <xsl:template match="o:DocumentProperties">
- <office:meta>
- <meta:generator>Microsoft Excel 2003</meta:generator>
- <xsl:if test="o:Title">
- <dc:title>
- <xsl:value-of select="o:Title"/>
- </dc:title>
- </xsl:if>
- <xsl:if test="o:Description">
- <dc:description>
- <xsl:value-of select="o:Description"/>
- </dc:description>
- </xsl:if>
- <xsl:if test="o:Subject">
- <dc:subject>
- <xsl:value-of select="o:Subject"/>
- </dc:subject>
- </xsl:if>
- <xsl:if test="o:Author">
- <meta:initial-creator>
- <xsl:value-of select="o:Author"/>
- </meta:initial-creator>
- </xsl:if>
- <xsl:if test="o:Created">
- <meta:creation-date>
- <xsl:value-of select="substring-before( o:Created, 'Z')"/>
- </meta:creation-date>
- </xsl:if>
- <xsl:if test="o:LastAuthor">
- <dc:creator>
- <xsl:value-of select="o:LastAuthor"/>
- </dc:creator>
- </xsl:if>
- <xsl:if test="o:LastSaved">
- <dc:date>
- <xsl:value-of select="substring-before( o:LastSaved, 'Z')"/>
- </dc:date>
- </xsl:if>
- <!--
- <meta:printed-by/>
- <meta:print-date/>
- <!~~ removed in OASIS Open Office XML
- <meta:keywords>
- <meta:keyword>
- <xsl:value-of select="o:Keywords" />
- </meta:keyword>
- </meta:keywords>
- ~~>
- <dc:language/>
- -->
- <xsl:if test="o:Revision">
- <meta:editing-cycles>
- <xsl:value-of select="o:Revision"/>
- </meta:editing-cycles>
- </xsl:if>
- <xsl:if test="o:TotalTime">
- <meta:editing-duration>
- <xsl:value-of select="concat('PT', floor(o:TotalTime div 60), 'H', o:TotalTime mod 60, 'M0S')"/>
- </meta:editing-duration>
- </xsl:if>
- <xsl:if test="o:Category">
- <meta:user-defined meta:name="Category">
- <xsl:value-of select="o:Category"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:if test="o:Manager">
- <meta:user-defined meta:name="Manager">
- <xsl:value-of select="o:Manager"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:if test="o:Company">
- <meta:user-defined meta:name="Company">
- <xsl:value-of select="o:Company"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:if test="o:Version">
- <meta:user-defined meta:name="Version">
- <xsl:value-of select="o:Version"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:if test="o:HyperlinkBase">
- <meta:user-defined meta:name="HyperlinkBase">
- <xsl:value-of select="o:HyperlinkBase"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:apply-templates select="../o:CustomDocumentProperties"/>
- <!--Note: <meta:document-statistic/>-->
- </office:meta>
- </xsl:template>
- <xsl:template match="o:CustomDocumentProperties">
- <xsl:for-each select="node()[@dt:dt]">
- <meta:user-defined meta:name="{name()}">
- <xsl:value-of select="."/>
- </meta:user-defined>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="x:ExcelWorkbook">
- <!-- Configuration in 'ooo:view-settings' and 'ooo:configuration-settings'
- "GridColor"
- "HasColumnRowHeaders"
- "HasSheetTabs"
- "IsOutlineSymbolsSet"
- "IsRasterAxisSynchronized"
- "IsSnapToRaster"
- "RasterIsVisible"
- "RasterResolutionX"
- "RasterResolutionY"
- "RasterSubdivisionX"
- "RasterSubdivisionY"
- "ShowGrid"
- "ShowNotes"
- "ShowPageBreaks"
- "ShowZeroValues"
- -->
- <xsl:variable name="sharedConfiguration">
- <xsl:if test="../ss:Worksheet/x:WorksheetOptions/x:GridlineColor">
- <config:config-item config:name="GridColor" config:type="long">
- <xsl:variable name="temp-code" select="substring-after(normalize-space(../ss:Worksheet/x:WorksheetOptions/x:GridlineColor), '#')"/>
- <xsl:variable name="temp-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="$temp-code"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="string-length($temp-code)"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$temp-value"/>
- </config:config-item>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="../ss:Worksheet/x:WorksheetOptions/x:DoNotDisplayHeadings">
- <config:config-item config:name="HasColumnRowHeaders" config:type="boolean">false</config:config-item>
- </xsl:when>
- <xsl:otherwise>
- <config:config-item config:name="HasColumnRowHeaders" config:type="boolean">true</config:config-item>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="x:HideWorkbookTabs">
- <config:config-item config:name="HasSheetTabs" config:type="boolean">false</config:config-item>
- </xsl:when>
- <xsl:otherwise>
- <config:config-item config:name="HasSheetTabs" config:type="boolean">true</config:config-item>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="../ss:Worksheet/x:WorksheetOptions/x:DoNotDisplayOutline">
- <config:config-item config:name="IsOutlineSymbolsSet" config:type="boolean">false</config:config-item>
- </xsl:when>
- <xsl:otherwise>
- <config:config-item config:name="IsOutlineSymbolsSet" config:type="boolean">true</config:config-item>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="../ss:Worksheet/x:WorksheetOptions/x:DoNotDisplayGridlines">
- <config:config-item config:name="ShowGrid" config:type="boolean">false</config:config-item>
- </xsl:when>
- <xsl:otherwise>
- <config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="../ss:Worksheet/x:WorksheetOptions/x:DoNotDisplayZeros">
- <config:config-item config:name="ShowZeroValues" config:type="boolean">false</config:config-item>
- </xsl:when>
- <xsl:otherwise>
- <config:config-item config:name="ShowZeroValues" config:type="boolean">true</config:config-item>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <office:settings>
- <config:config-item-set config:name="ooo:view-settings">
- <config:config-item config:type="int" config:name="VisibleAreaTop">
- <xsl:value-of select="x:WindowTopY"/>
- </config:config-item>
- <config:config-item config:name="VisibleAreaLeft" config:type="int">
- <xsl:value-of select="x:WindowTopX"/>
- </config:config-item>
- <config:config-item config:name="VisibleAreaWidth" config:type="int">
- <xsl:value-of select="x:WindowWidth"/>
- </config:config-item>
- <config:config-item config:name="VisibleAreaHeight" config:type="int">
- <xsl:value-of select="x:WindowHeight"/>
- </config:config-item>
- <xsl:variable name="ratio" select="15"/>
- <config:config-item-map-indexed config:name="Views">
- <config:config-item-map-entry>
- <config:config-item config:name="ViewId" config:type="string">View1</config:config-item>
- <config:config-item-map-named config:name="Tables">
- <!-- The panes of a table is like 3 | 1 or 3 | 1, or 3 , while 3 is the default one. glu
- - - - - - - -
- 2 | 0 2 -->
- <xsl:for-each select="../ss:Worksheet">
- <config:config-item-map-entry config:name="{@ss:Name}">
- <xsl:variable name="active-pane">
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:ActivePane">
- <xsl:value-of select="x:WorksheetOptions/x:ActivePane"/>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="not( $active-pane = '' ) and ( x:WorksheetOptions/x:SplitVertical or x:WorksheetOptions/x:SplitHorizontal )">
- <config:config-item config:name="ActiveSplitRange" config:type="short">
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:SplitVertical and not(x:WorksheetOptions/x:SplitHorizontal)">
- <xsl:value-of select="'3'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$active-pane"/>
- </xsl:otherwise>
- </xsl:choose>
- </config:config-item>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="not( $active-pane = '')">
- <config:config-item config:name="CursorPositionX" config:type="int">
- <xsl:value-of select="x:WorksheetOptions/x:Panes/x:Pane[x:Number = $active-pane ]/x:ActiveCol"/>
- </config:config-item>
- <config:config-item config:name="CursorPositionY" config:type="int">
- <xsl:value-of select="x:WorksheetOptions/x:Panes/x:Pane[x:Number = $active-pane ]/x:ActiveRow"/>
- </config:config-item>
- </xsl:when>
- <xsl:otherwise>
- <config:config-item config:name="CursorPositionX" config:type="int">
- <xsl:value-of select="x:WorksheetOptions/x:Panes/x:Pane/x:ActiveCol"/>
- </config:config-item>
- <config:config-item config:name="CursorPositionY" config:type="int">
- <xsl:value-of select="x:WorksheetOptions/x:Panes/x:Pane/x:ActiveRow"/>
- </config:config-item>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="position-left">
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:LeftColumnVisible">
- <xsl:value-of select="x:WorksheetOptions/x:LeftColumnVisible"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <config:config-item config:name="PositionLeft" config:type="int">
- <xsl:value-of select="$position-left"/>
- </config:config-item>
- <xsl:variable name="position-top">
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:TopRowVisible">
- <xsl:value-of select="x:WorksheetOptions/x:TopRowVisible"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:SplitVertical and not(x:WorksheetOptions/x:SplitHorizontal)">
- <config:config-item config:name="PositionBottom" config:type="int">
- <xsl:value-of select="$position-top"/>
- </config:config-item>
- </xsl:when>
- <xsl:otherwise>
- <config:config-item config:name="PositionTop" config:type="int">
- <xsl:value-of select="$position-top"/>
- </config:config-item>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:SplitVertical">
- <config:config-item config:name="HorizontalSplitMode" config:type="short">
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:FreezePanes">2</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </config:config-item>
- <config:config-item config:name="HorizontalSplitPosition" config:type="int">
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:FreezePanes">
- <xsl:value-of select="x:WorksheetOptions/x:SplitVertical + $position-left"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="floor( x:WorksheetOptions/x:SplitVertical div $ratio )"/>
- </xsl:otherwise>
- </xsl:choose>
- </config:config-item>
- <config:config-item config:name="PositionRight" config:type="int">
- <xsl:value-of select="x:WorksheetOptions/x:LeftColumnRightPane"/>
- </config:config-item>
- </xsl:when>
- <xsl:otherwise>
- <config:config-item config:name="HorizontalSplitMode" config:type="short">0</config:config-item>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:SplitHorizontal">
- <config:config-item config:name="VerticalSplitMode" config:type="short">
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:FreezePanes">2</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </config:config-item>
- <config:config-item config:name="VerticalSplitPosition" config:type="int">
- <xsl:choose>
- <xsl:when test="x:WorksheetOptions/x:FreezePanes">
- <xsl:value-of select="x:WorksheetOptions/x:SplitHorizontal + $position-top"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="floor( x:WorksheetOptions/x:SplitHorizontal div $ratio )"/>
- </xsl:otherwise>
- </xsl:choose>
- </config:config-item>
- <config:config-item config:name="PositionBottom" config:type="int">
- <xsl:value-of select="x:WorksheetOptions/x:TopRowBottomPane"/>
- </config:config-item>
- </xsl:when>
- <xsl:otherwise>
- <config:config-item config:name="VerticalSplitMode" config:type="short">0</config:config-item>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:copy-of select="$sharedConfiguration"/>
+ <!--+++++ 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"/>
+ <xsl:output indent="no" version="1.0" encoding="UTF-8" method="xml"/>
+ <xsl:template match="/">
+ <office:document office:mimetype="application/vnd.oasis.opendocument.spreadsheet" office:version="1.0">
+ <xsl:apply-templates select="ss:Workbook/o:DocumentProperties"/>
+ <xsl:apply-templates select="ss:Workbook/x:ExcelWorkbook"/>
+ <xsl:call-template name="font-declaration"/>
+ <xsl:apply-templates select="ss:Workbook/ss:Worksheet[1]" mode="styles"/>
+ <xsl:element name="office:body">
+ <xsl:element name="office:spreadsheet">
+ <xsl:call-template name="set-calculation"/>
+ <!-- for DataValidation -->
+ <xsl:if test="ss:Workbook/ss:Worksheet/x:DataValidation">
+ <xsl:element name="table:content-validations">
+ <xsl:apply-templates select="ss:Workbook/ss:Worksheet/x:DataValidation"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:apply-templates select="ss:Workbook/ss:Worksheet"/>
+ <xsl:call-template name="Names"/>
+ <xsl:element name="table:database-ranges">
+ <!-- these descriptions located in every Worksheet in Excel, but at the same path in Calc -->
+ <xsl:for-each select="ss:Workbook/ss:Worksheet">
+ <xsl:apply-templates select="./x:Sorting"/>
+ <xsl:apply-templates select="./x:AutoFilter"/>
+ <!-- for Advanced Filter.the position is same as AutoFilter -->
+ <xsl:if test="./ss:Names/ss:NamedRange and ./ss:Names/ss:NamedRange/@ss:Name='_FilterDatabase'">
+ <xsl:call-template name="transform-advanced-filter">
+ <xsl:with-param name="target-value" select="substring-after(./ss:Names/ss:NamedRange[@ss:Name='_FilterDatabase']/@ss:RefersTo, '=')"/>
+ <xsl:with-param name="condition-pos" select="substring-after(./ss:Names/ss:NamedRange[@ss:Name='Criteria']/@ss:RefersTo, '=')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </office:document>
+ </xsl:template>
+ <xsl:template match="o:DocumentProperties">
+ <office:meta>
+ <meta:generator>Microsoft Excel 2003</meta:generator>
+ <xsl:if test="o:Title">
+ <dc:title>
+ <xsl:value-of select="o:Title"/>
+ </dc:title>
+ </xsl:if>
+ <xsl:if test="o:Description">
+ <dc:description>
+ <xsl:value-of select="o:Description"/>
+ </dc:description>
+ </xsl:if>
+ <xsl:if test="o:Subject">
+ <dc:subject>
+ <xsl:value-of select="o:Subject"/>
+ </dc:subject>
+ </xsl:if>
+ <xsl:if test="o:Author">
+ <meta:initial-creator>
+ <xsl:value-of select="o:Author"/>
+ </meta:initial-creator>
+ </xsl:if>
+ <xsl:if test="o:Created">
+ <meta:creation-date>
+ <xsl:value-of select="substring-before( o:Created, 'Z')"/>
+ </meta:creation-date>
+ </xsl:if>
+ <xsl:if test="o:LastAuthor">
+ <dc:creator>
+ <xsl:value-of select="o:LastAuthor"/>
+ </dc:creator>
+ </xsl:if>
+ <xsl:if test="o:LastSaved">
+ <dc:date>
+ <xsl:value-of select="substring-before( o:LastSaved, 'Z')"/>
+ </dc:date>
+ </xsl:if>
+ <!--
+ <meta:printed-by/>
+ <meta:print-date/>
+ <!~~ removed in OASIS Open Office XML
+ <meta:keywords>
+ <meta:keyword>
+ <xsl:value-of select="o:Keywords" />
+ </meta:keyword>
+ </meta:keywords>
+ ~~>
+ <dc:language/>
+ -->
+ <xsl:if test="o:Revision">
+ <meta:editing-cycles>
+ <xsl:value-of select="o:Revision"/>
+ </meta:editing-cycles>
+ </xsl:if>
+ <xsl:if test="o:TotalTime">
+ <meta:editing-duration>
+ <xsl:value-of select="concat('PT', floor(o:TotalTime div 60), 'H', o:TotalTime mod 60, 'M0S')"/>
+ </meta:editing-duration>
+ </xsl:if>
+ <xsl:if test="o:Category">
+ <meta:user-defined meta:name="Category">
+ <xsl:value-of select="o:Category"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:if test="o:Manager">
+ <meta:user-defined meta:name="Manager">
+ <xsl:value-of select="o:Manager"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:if test="o:Company">
+ <meta:user-defined meta:name="Company">
+ <xsl:value-of select="o:Company"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:if test="o:Version">
+ <meta:user-defined meta:name="Version">
+ <xsl:value-of select="o:Version"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:if test="o:HyperlinkBase">
+ <meta:user-defined meta:name="HyperlinkBase">
+ <xsl:value-of select="o:HyperlinkBase"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:apply-templates select="../o:CustomDocumentProperties"/>
+ <!--Note: <meta:document-statistic/>-->
+ </office:meta>
+ </xsl:template>
+ <xsl:template match="o:CustomDocumentProperties">
+ <xsl:for-each select="node()[@dt:dt]">
+ <meta:user-defined meta:name="{name()}">
+ <xsl:value-of select="."/>
+ </meta:user-defined>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="x:ExcelWorkbook">
+ <!-- Configuration in 'ooo:view-settings' and 'ooo:configuration-settings'
+ "GridColor"
+ "HasColumnRowHeaders"
+ "HasSheetTabs"
+ "IsOutlineSymbolsSet"
+ "IsRasterAxisSynchronized"
+ "IsSnapToRaster"
+ "RasterIsVisible"
+ "RasterResolutionX"
+ "RasterResolutionY"
+ "RasterSubdivisionX"
+ "RasterSubdivisionY"
+ "ShowGrid"
+ "ShowNotes"
+ "ShowPageBreaks"
+ "ShowZeroValues"
+ -->
+ <xsl:variable name="sharedConfiguration">
+ <xsl:if test="../ss:Worksheet/x:WorksheetOptions/x:GridlineColor">
+ <config:config-item config:name="GridColor" config:type="long">
+ <xsl:variable name="temp-code" select="substring-after(normalize-space(../ss:Worksheet/x:WorksheetOptions/x:GridlineColor), '#')"/>
+ <xsl:variable name="temp-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="$temp-code"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="string-length($temp-code)"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$temp-value"/>
+ </config:config-item>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="../ss:Worksheet/x:WorksheetOptions/x:DoNotDisplayHeadings">
+ <config:config-item config:name="HasColumnRowHeaders" config:type="boolean">false</config:config-item>
+ </xsl:when>
+ <xsl:otherwise>
+ <config:config-item config:name="HasColumnRowHeaders" config:type="boolean">true</config:config-item>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="x:HideWorkbookTabs">
+ <config:config-item config:name="HasSheetTabs" config:type="boolean">false</config:config-item>
+ </xsl:when>
+ <xsl:otherwise>
+ <config:config-item config:name="HasSheetTabs" config:type="boolean">true</config:config-item>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="../ss:Worksheet/x:WorksheetOptions/x:DoNotDisplayOutline">
+ <config:config-item config:name="IsOutlineSymbolsSet" config:type="boolean">false</config:config-item>
+ </xsl:when>
+ <xsl:otherwise>
+ <config:config-item config:name="IsOutlineSymbolsSet" config:type="boolean">true</config:config-item>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="../ss:Worksheet/x:WorksheetOptions/x:DoNotDisplayGridlines">
+ <config:config-item config:name="ShowGrid" config:type="boolean">false</config:config-item>
+ </xsl:when>
+ <xsl:otherwise>
+ <config:config-item config:name="ShowGrid" config:type="boolean">true</config:config-item>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="../ss:Worksheet/x:WorksheetOptions/x:DoNotDisplayZeros">
+ <config:config-item config:name="ShowZeroValues" config:type="boolean">false</config:config-item>
+ </xsl:when>
+ <xsl:otherwise>
+ <config:config-item config:name="ShowZeroValues" config:type="boolean">true</config:config-item>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <office:settings>
+ <config:config-item-set config:name="ooo:view-settings">
+ <config:config-item config:type="int" config:name="VisibleAreaTop">
+ <xsl:value-of select="x:WindowTopY"/>
+ </config:config-item>
+ <config:config-item config:name="VisibleAreaLeft" config:type="int">
+ <xsl:value-of select="x:WindowTopX"/>
+ </config:config-item>
+ <config:config-item config:name="VisibleAreaWidth" config:type="int">
+ <xsl:value-of select="x:WindowWidth"/>
+ </config:config-item>
+ <config:config-item config:name="VisibleAreaHeight" config:type="int">
+ <xsl:value-of select="x:WindowHeight"/>
+ </config:config-item>
+ <xsl:variable name="ratio" select="15"/>
+ <config:config-item-map-indexed config:name="Views">
+ <config:config-item-map-entry>
+ <config:config-item config:name="ViewId" config:type="string">View1</config:config-item>
+ <config:config-item-map-named config:name="Tables">
+ <!-- The panes of a table is like 3 | 1 or 3 | 1, or 3 , while 3 is the default one. glu
+ - - - - - - -
+ 2 | 0 2 -->
+ <xsl:for-each select="../ss:Worksheet">
+ <config:config-item-map-entry config:name="{@ss:Name}">
+ <xsl:variable name="active-pane">
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:ActivePane">
+ <xsl:value-of select="x:WorksheetOptions/x:ActivePane"/>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="not( $active-pane = '' ) and ( x:WorksheetOptions/x:SplitVertical or x:WorksheetOptions/x:SplitHorizontal )">
+ <config:config-item config:name="ActiveSplitRange" config:type="short">
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:SplitVertical and not(x:WorksheetOptions/x:SplitHorizontal)">
+ <xsl:value-of select="'3'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$active-pane"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </config:config-item>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="not( $active-pane = '')">
+ <config:config-item config:name="CursorPositionX" config:type="int">
+ <xsl:value-of select="x:WorksheetOptions/x:Panes/x:Pane[x:Number = $active-pane ]/x:ActiveCol"/>
+ </config:config-item>
+ <config:config-item config:name="CursorPositionY" config:type="int">
+ <xsl:value-of select="x:WorksheetOptions/x:Panes/x:Pane[x:Number = $active-pane ]/x:ActiveRow"/>
+ </config:config-item>
+ </xsl:when>
+ <xsl:otherwise>
+ <config:config-item config:name="CursorPositionX" config:type="int">
+ <xsl:value-of select="x:WorksheetOptions/x:Panes/x:Pane/x:ActiveCol"/>
+ </config:config-item>
+ <config:config-item config:name="CursorPositionY" config:type="int">
+ <xsl:value-of select="x:WorksheetOptions/x:Panes/x:Pane/x:ActiveRow"/>
+ </config:config-item>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:variable name="position-left">
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:LeftColumnVisible">
+ <xsl:value-of select="x:WorksheetOptions/x:LeftColumnVisible"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <config:config-item config:name="PositionLeft" config:type="int">
+ <xsl:value-of select="$position-left"/>
+ </config:config-item>
+ <xsl:variable name="position-top">
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:TopRowVisible">
+ <xsl:value-of select="x:WorksheetOptions/x:TopRowVisible"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:SplitVertical and not(x:WorksheetOptions/x:SplitHorizontal)">
+ <config:config-item config:name="PositionBottom" config:type="int">
+ <xsl:value-of select="$position-top"/>
+ </config:config-item>
+ </xsl:when>
+ <xsl:otherwise>
+ <config:config-item config:name="PositionTop" config:type="int">
+ <xsl:value-of select="$position-top"/>
+ </config:config-item>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:SplitVertical">
+ <config:config-item config:name="HorizontalSplitMode" config:type="short">
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:FreezePanes">2</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </config:config-item>
+ <config:config-item config:name="HorizontalSplitPosition" config:type="int">
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:FreezePanes">
+ <xsl:value-of select="x:WorksheetOptions/x:SplitVertical + $position-left"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="floor( x:WorksheetOptions/x:SplitVertical div $ratio )"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </config:config-item>
+ <config:config-item config:name="PositionRight" config:type="int">
+ <xsl:value-of select="x:WorksheetOptions/x:LeftColumnRightPane"/>
+ </config:config-item>
+ </xsl:when>
+ <xsl:otherwise>
+ <config:config-item config:name="HorizontalSplitMode" config:type="short">0</config:config-item>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:SplitHorizontal">
+ <config:config-item config:name="VerticalSplitMode" config:type="short">
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:FreezePanes">2</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </config:config-item>
+ <config:config-item config:name="VerticalSplitPosition" config:type="int">
+ <xsl:choose>
+ <xsl:when test="x:WorksheetOptions/x:FreezePanes">
+ <xsl:value-of select="x:WorksheetOptions/x:SplitHorizontal + $position-top"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="floor( x:WorksheetOptions/x:SplitHorizontal div $ratio )"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </config:config-item>
+ <config:config-item config:name="PositionBottom" config:type="int">
+ <xsl:value-of select="x:WorksheetOptions/x:TopRowBottomPane"/>
+ </config:config-item>
+ </xsl:when>
+ <xsl:otherwise>
+ <config:config-item config:name="VerticalSplitMode" config:type="short">0</config:config-item>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:copy-of select="$sharedConfiguration"/>
<xsl:if test="x:WorksheetOptions/x:TabColorIndex">
<config:config-item config:name="TabColor" config:type="int">
<xsl:variable name="temp-value">
@@ -382,4246 +382,4246 @@
<xsl:value-of select="$temp-value"/>
</config:config-item>
</xsl:if>
- </config:config-item-map-entry>
- </xsl:for-each>
- </config:config-item-map-named>
- <xsl:if test="x:ActiveSheet">
- <config:config-item config:name="ActiveTable" config:type="string">
- <xsl:value-of select="../ss:Worksheet[/ss:Workbook/x:ExcelWorkbook/x:ActiveSheet+1]/@ss:Name"/>
- </config:config-item>
- </xsl:if>
- <config:config-item config:name="HorizontalScrollbarWidth" config:type="int">555</config:config-item>
- <!-- following are some table setting from Excel, but transformed to global setting, due to limit of Calc -->
- <xsl:if test="../ss:Worksheet/x:WorksheetOptions/x:ShowPageBreakZoom">
- <config:config-item config:name="ShowPageBreakPreview" config:type="boolean">true</config:config-item>
- </xsl:if>
- <xsl:if test="../ss:Worksheet/x:WorksheetOptions/x:PageBreakZoom">
- <config:config-item config:name="PageViewZoomValue" config:type="int">
- <xsl:value-of select="../ss:Worksheet/x:WorksheetOptions/x:PageBreakZoom"/>
- </config:config-item>
- </xsl:if>
- <xsl:if test="../ss:Worksheet/x:WorksheetOptions/x:Zoom">
- <config:config-item config:name="ZoomValue" config:type="int">
- <xsl:value-of select="../ss:Worksheet/x:WorksheetOptions/x:Zoom"/>
- </config:config-item>
- </xsl:if>
- <!-- several properties are not saved in Calc XML but setting, whereas vice versa. :( So just to be expanded, glu -->
- </config:config-item-map-entry>
- </config:config-item-map-indexed>
- </config:config-item-set>
- <config:config-item-set config:name="ooo:configuration-settings">
- <xsl:copy-of select="$sharedConfiguration"/>
- </config:config-item-set>
- <!-- printer setting, not finished yet. glu
- <config:config-item-set config:name="configuration-settings" />
- -->
- </office:settings>
- </xsl:template>
+ </config:config-item-map-entry>
+ </xsl:for-each>
+ </config:config-item-map-named>
+ <xsl:if test="x:ActiveSheet">
+ <config:config-item config:name="ActiveTable" config:type="string">
+ <xsl:value-of select="../ss:Worksheet[/ss:Workbook/x:ExcelWorkbook/x:ActiveSheet+1]/@ss:Name"/>
+ </config:config-item>
+ </xsl:if>
+ <config:config-item config:name="HorizontalScrollbarWidth" config:type="int">555</config:config-item>
+ <!-- following are some table setting from Excel, but transformed to global setting, due to limit of Calc -->
+ <xsl:if test="../ss:Worksheet/x:WorksheetOptions/x:ShowPageBreakZoom">
+ <config:config-item config:name="ShowPageBreakPreview" config:type="boolean">true</config:config-item>
+ </xsl:if>
+ <xsl:if test="../ss:Worksheet/x:WorksheetOptions/x:PageBreakZoom">
+ <config:config-item config:name="PageViewZoomValue" config:type="int">
+ <xsl:value-of select="../ss:Worksheet/x:WorksheetOptions/x:PageBreakZoom"/>
+ </config:config-item>
+ </xsl:if>
+ <xsl:if test="../ss:Worksheet/x:WorksheetOptions/x:Zoom">
+ <config:config-item config:name="ZoomValue" config:type="int">
+ <xsl:value-of select="../ss:Worksheet/x:WorksheetOptions/x:Zoom"/>
+ </config:config-item>
+ </xsl:if>
+ <!-- several properties are not saved in Calc XML but setting, whereas vice versa. :( So just to be expanded, glu -->
+ </config:config-item-map-entry>
+ </config:config-item-map-indexed>
+ </config:config-item-set>
+ <config:config-item-set config:name="ooo:configuration-settings">
+ <xsl:copy-of select="$sharedConfiguration"/>
+ </config:config-item-set>
+ <!-- printer setting, not finished yet. glu
+ <config:config-item-set config:name="configuration-settings" />
+ -->
+ </office:settings>
+ </xsl:template>
+
+ <xsl:variable name="allFontDefs"><xsl:for-each select="/ss:Workbook/ss:Styles/ss:Style/ss:Font[@ss:FontName or @x:Family]|/ss:Workbook/ss:Worksheet/ss:Table/ss:Row/ss:Cell/descendant::html:Font[@html:Face or @x:Family]"><f><xsl:copy-of select="@ss:FontName |@html:Face | @x:Family"/><xsl:value-of select="concat(@ss:FontName, @html:Face, '&#9;', @x:Family)"/></f></xsl:for-each></xsl:variable>
+
+ <xsl:template name="font-declaration">
+ <xsl:variable name="distinctFontDefs">
+ <xsl:choose>
+ <!-- saxon dropped support for exslt:sets#distinct() in version 8.2, but is capable of executing XPath 2.0 functions -->
+ <xsl:when test="function-available('set:distinct')"><xsl:copy-of select="set:distinct(exsl:node-set($allFontDefs)/*)"/></xsl:when>
+ <xsl:otherwise><xsl:call-template name="set:distinct"><xsl:with-param name="nodes" select="$allFontDefs"></xsl:with-param></xsl:call-template></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <office:font-face-decls>
+ <xsl:if test="count(exsl:node-set($distinctFontDefs))">
+ <xsl:for-each select="exsl:node-set($distinctFontDefs)/*">
+ <style:font-face>
+ <xsl:if test="@ss:FontName or @html:Face">
+ <xsl:attribute name="style:name">
+ <xsl:value-of select="@ss:FontName | @html:Face"/>
+ </xsl:attribute>
+ <xsl:attribute name="svg:font-family">
+ <xsl:value-of select="@ss:FontName | @html:Face "/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@x:Family">
+ <xsl:attribute name="style:font-family-generic">
+ <xsl:call-template name="translate-font-family-generic">
+ <xsl:with-param name="family" select="@x:Family"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:if>
+ </style:font-face>
+ </xsl:for-each>
+ </xsl:if>
+ </office:font-face-decls>
+ </xsl:template>
+ <xsl:template name="translate-font-family-generic">
+ <xsl:param name="family"/>
+ <xsl:choose>
+ <xsl:when test="$family='Swiss'">swiss</xsl:when>
+ <xsl:when test="$family='Modern'">modern</xsl:when>
+ <xsl:when test="$family='Roman'">roman</xsl:when>
+ <xsl:when test="$family='Script'">script</xsl:when>
+ <xsl:when test="$family='Decorative'">decorative</xsl:when>
+ <!-- change 'System' to 'Automatic' for Excel -->
+ <xsl:when test="$family='Automatic'">system</xsl:when>
+ <xsl:otherwise>system</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="ss:Workbook/ss:Worksheet" mode="styles">
+ <office:styles>
+ <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style[@ss:Name]"/>
+ <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style/ss:NumberFormat[@ss:Format]"/>
+ <!-- if ConditionalFormatting exists,it should generate some styles for style:style -->
+ <xsl:if test="/ss:Workbook/ss:Worksheet/x:ConditionalFormatting">
+ <xsl:call-template name="CondFormat_office_style"/>
+ </xsl:if>
+ </office:styles>
+ <office:automatic-styles>
+ <xsl:apply-templates select="/ss:Workbook/ss:Worksheet/ss:Table"/>
+ <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style[not(@ss:Name)]"/>
+ <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style/ss:Font[@ss:VerticalAlign]"/>
+ <!-- applying to ss:Data (but *, as also ss:Data nested in ss:Comments -->
+ <xsl:apply-templates select="/ss:Workbook/ss:Worksheet/ss:Table/ss:Row/ss:Cell/*[descendant-or-self::*]"/>
+ <xsl:apply-templates select="/ss:Workbook/ss:Worksheet/x:WorksheetOptions/x:PageSetup//@x:Data"/>
+ <!-- if ConditionalFormatting exists,transforing the styles -->
+ <xsl:if test="/ss:Workbook/ss:Worksheet/x:ConditionalFormatting">
+ <xsl:call-template name="CondFormat_automatic_style"/>
+ </xsl:if>
+ <xsl:call-template name="create-page-master">
+ <xsl:with-param name="worksheetoptions" select="/ss:Workbook/ss:Worksheet/x:WorksheetOptions"/>
+ </xsl:call-template>
+ </office:automatic-styles>
+ <office:master-styles>
+ <xsl:call-template name="create-master-styles">
+ <xsl:with-param name="worksheetoptions" select="/ss:Workbook/ss:Worksheet/x:WorksheetOptions"/>
+ </xsl:call-template>
+ </office:master-styles>
+ </xsl:template>
+ <xsl:template name="CondFormat_office_style">
+ <!-- translate the ConditionalFormatting style,including font,size,color,etc -->
+ <xsl:for-each select="/ss:Workbook/ss:Worksheet/x:ConditionalFormatting">
+ <xsl:variable name="table-pos" select="count(../preceding-sibling::ss:Worksheet)+1"/>
+ <xsl:variable name="conditions" select="count(preceding-sibling::x:ConditionalFormatting)+1"/>
+ <!-- Matching multiple styles, but automatic styles are not allowed to inherit from another automatic style
+ <xsl:for-each select="key('tableStyleIDs', key('tableWithConditional', .))
+ [generate-id(.) =
+ generate-id(key('styleId', .)[1])] ">
+ <xsl:sort select="." />
+
+ <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style[@ss:ID = current()/.]"/>
+ </xsl:for-each>
+ -->
+ <xsl:for-each select="x:Condition">
+ <xsl:variable name="condition-number" select="count(preceding-sibling::x:Condition)+1"/>
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">
+ <xsl:call-template name="encode-as-nc-name">
+ <xsl:with-param name="string" select="concat('Excel_CondFormat_',$table-pos,'_',$conditions,'_',$condition-number)"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:attribute name="style:family">table-cell</xsl:attribute>
+ <xsl:apply-templates select="@ss:Name" />
+ <xsl:element name="style:table-cell-properties">
+ <xsl:choose>
+ <xsl:when test="x:Format/@Style">
+ <xsl:variable name="stylevalue" select="./x:Format/@Style"/>
+ <xsl:call-template name="recursion-condformat-style-table-cell">
+ <xsl:with-param name="style-value-t">
+ <xsl:choose>
+ <xsl:when test="substring($stylevalue,string-length($stylevalue),1) != ';'">
+ <xsl:value-of select="concat($stylevalue,';')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$stylevalue"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="style:text-properties">
+ <xsl:choose>
+ <xsl:when test="x:Format/@Style">
+ <xsl:variable name="stylevalue" select="./x:Format/@Style"/>
+ <xsl:call-template name="recursion-condformat-style-text">
+ <xsl:with-param name="style-value-t">
+ <xsl:choose>
+ <xsl:when test="substring($stylevalue,string-length($stylevalue),1) != ';'">
+ <xsl:value-of select="concat($stylevalue,';')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$stylevalue"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:font-style">
+ <xsl:value-of select="'italic'"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:text-underline-type">
+ <xsl:value-of select="'single'"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:text-underline-color">
+ <xsl:value-of select="'font-color'"/>
+ </xsl:attribute>
+ <xsl:attribute name="fo:font-weight">
+ <xsl:value-of select="'bold'"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="@ss:Name">
+ <xsl:attribute name="style:display-name">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+ <xsl:template name="recursion-condformat-style-table-cell">
+ <!-- generates style:style for ConditionalFormatting -->
+ <xsl:param name="style-value-t"/>
+ <xsl:variable name="style-value" select="normalize-space($style-value-t)"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($style-value,'background')">
+ <xsl:choose>
+ <xsl:when test="contains($style-value,'mso-pattern')">
+ <xsl:variable name="color-value">
+ <xsl:call-template name="translate-color-style">
+ <xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="mso-value">
+ <xsl:call-template name="translate-color-style">
+ <xsl:with-param name="source-str" select="normalize-space(substring-after($style-value,'mso-pattern'))"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="mso-color" select="substring-after($mso-value,'#')"/>
+ <xsl:variable name="pattern-color-value" select="substring($mso-color,1,6)"/>
+ <xsl:variable name="pattern" select="concat('0.',normalize-space(substring-before(substring-after($mso-color,'gray-'),';')))"/>
+ <xsl:variable name="pattern-color">
+ <xsl:call-template name="cell-pattern-color">
+ <xsl:with-param name="pattern" select="$pattern"/>
+ <xsl:with-param name="color-value" select="$color-value"/>
+ <xsl:with-param name="pattern-color-value" select="concat('#',$pattern-color-value)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="fo:background-color">
+ <xsl:value-of select="normalize-space($pattern-color)"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:background-color">
+ <xsl:call-template name="translate-color-style">
+ <xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="starts-with($style-value,'border')">
+ <xsl:attribute name="fo:border">
+ <xsl:value-of select="'0.002cm solid #000000'"/>
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="contains($style-value,':')">
+ <xsl:call-template name="recursion-condformat-style-table-cell">
+ <xsl:with-param name="style-value-t" select="substring-after($style-value,';')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="recursion-condformat-style-text">
+ <!-- generates style:style for ConditionalFormatting -->
+ <xsl:param name="style-value-t"/>
+ <xsl:variable name="style-value" select="normalize-space($style-value-t)"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($style-value,'color')">
+ <xsl:attribute name="fo:color">
+ <xsl:call-template name="translate-color-style">
+ <xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="starts-with($style-value,'font-style')">
+ <xsl:attribute name="fo:font-style">
+ <xsl:value-of select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="starts-with($style-value,'font-weight')">
+ <xsl:variable name="font-weight" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
+ <xsl:attribute name="fo:font-weight">
+ <xsl:choose>
+ <xsl:when test="($font-weight &gt; 300) and ($font-weight &lt; 500)">
+ <xsl:value-of select="'normal'"/>
+ </xsl:when>
+ <xsl:when test="($font-weight &gt; 500) or ($font-weight = 500)">
+ <xsl:value-of select="'bold'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'0'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="starts-with($style-value,'text-underline-style')">
+ <xsl:attribute name="style:text-underline-type">
+ <xsl:value-of select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:text-underline-color">
+ <xsl:value-of select="'#000000'"/>
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="contains($style-value,':')">
+ <xsl:call-template name="recursion-condformat-style-text">
+ <xsl:with-param name="style-value-t" select="substring-after($style-value,';')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="translate-color-style">
+ <!-- translate the word of color to hex code of color -->
+ <xsl:param name="source-str"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($source-str,'#')">
+ <xsl:value-of select="$source-str"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="starts-with($source-str,'black')">
+ <xsl:value-of select="'#000000'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'maroon')">
+ <xsl:value-of select="'#800000'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'red')">
+ <xsl:value-of select="'#FF0000'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'fuchsia')">
+ <xsl:value-of select="'#FF00FF'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'olive')">
+ <xsl:value-of select="'#808000'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'yellow')">
+ <xsl:value-of select="'#FFFF00'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'green')">
+ <xsl:value-of select="'#008000'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'lime')">
+ <xsl:value-of select="'#00FF00'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'teal')">
+ <xsl:value-of select="'#008080'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'aqua')">
+ <xsl:value-of select="'#00FFFF'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'navy')">
+ <xsl:value-of select="'#000080'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'blue')">
+ <xsl:value-of select="'#0000FF'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'purple')">
+ <xsl:value-of select="'#800080'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'gray')">
+ <xsl:value-of select="'#808080'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'silver')">
+ <xsl:value-of select="'#C0C0C0'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'white')">
+ <xsl:value-of select="'#FFFFFF'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'#FFFFFF'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <xsl:variable name="allFontDefs"><xsl:for-each select="/ss:Workbook/ss:Styles/ss:Style/ss:Font[@ss:FontName or @x:Family]|/ss:Workbook/ss:Worksheet/ss:Table/ss:Row/ss:Cell/descendant::html:Font[@html:Face or @x:Family]"><f><xsl:copy-of select="@ss:FontName |@html:Face | @x:Family"/><xsl:value-of select="concat(@ss:FontName, @html:Face, '&#9;', @x:Family)"/></f></xsl:for-each></xsl:variable>
-
- <xsl:template name="font-declaration">
- <xsl:variable name="distinctFontDefs">
- <xsl:choose>
- <!-- saxon dropped support for exslt:sets#distinct() in version 8.2, but is capable of executing XPath 2.0 functions -->
- <xsl:when test="function-available('set:distinct')"><xsl:copy-of select="set:distinct(exsl:node-set($allFontDefs)/*)"/></xsl:when>
- <xsl:otherwise><xsl:call-template name="set:distinct"><xsl:with-param name="nodes" select="$allFontDefs"></xsl:with-param></xsl:call-template></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <office:font-face-decls>
- <xsl:if test="count(exsl:node-set($distinctFontDefs))">
- <xsl:for-each select="exsl:node-set($distinctFontDefs)/*">
- <style:font-face>
- <xsl:if test="@ss:FontName or @html:Face">
- <xsl:attribute name="style:name">
- <xsl:value-of select="@ss:FontName | @html:Face"/>
- </xsl:attribute>
- <xsl:attribute name="svg:font-family">
- <xsl:value-of select="@ss:FontName | @html:Face "/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="@x:Family">
- <xsl:attribute name="style:font-family-generic">
- <xsl:call-template name="translate-font-family-generic">
- <xsl:with-param name="family" select="@x:Family"/>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:if>
- </style:font-face>
- </xsl:for-each>
- </xsl:if>
- </office:font-face-decls>
- </xsl:template>
- <xsl:template name="translate-font-family-generic">
- <xsl:param name="family"/>
- <xsl:choose>
- <xsl:when test="$family='Swiss'">swiss</xsl:when>
- <xsl:when test="$family='Modern'">modern</xsl:when>
- <xsl:when test="$family='Roman'">roman</xsl:when>
- <xsl:when test="$family='Script'">script</xsl:when>
- <xsl:when test="$family='Decorative'">decorative</xsl:when>
- <!-- change 'System' to 'Automatic' for Excel -->
- <xsl:when test="$family='Automatic'">system</xsl:when>
- <xsl:otherwise>system</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ss:Workbook/ss:Worksheet" mode="styles">
- <office:styles>
- <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style[@ss:Name]"/>
- <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style/ss:NumberFormat[@ss:Format]"/>
- <!-- if ConditionalFormatting exists,it should generate some styles for style:style -->
- <xsl:if test="/ss:Workbook/ss:Worksheet/x:ConditionalFormatting">
- <xsl:call-template name="CondFormat_office_style"/>
- </xsl:if>
- </office:styles>
- <office:automatic-styles>
- <xsl:apply-templates select="/ss:Workbook/ss:Worksheet/ss:Table"/>
- <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style[not(@ss:Name)]"/>
- <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style/ss:Font[@ss:VerticalAlign]"/>
- <!-- applying to ss:Data (but *, as also ss:Data nested in ss:Comments -->
- <xsl:apply-templates select="/ss:Workbook/ss:Worksheet/ss:Table/ss:Row/ss:Cell/*[descendant-or-self::*]"/>
- <xsl:apply-templates select="/ss:Workbook/ss:Worksheet/x:WorksheetOptions/x:PageSetup//@x:Data"/>
- <!-- if ConditionalFormatting exists,transforing the styles -->
- <xsl:if test="/ss:Workbook/ss:Worksheet/x:ConditionalFormatting">
- <xsl:call-template name="CondFormat_automatic_style"/>
- </xsl:if>
- <xsl:call-template name="create-page-master">
- <xsl:with-param name="worksheetoptions" select="/ss:Workbook/ss:Worksheet/x:WorksheetOptions"/>
- </xsl:call-template>
- </office:automatic-styles>
- <office:master-styles>
- <xsl:call-template name="create-master-styles">
- <xsl:with-param name="worksheetoptions" select="/ss:Workbook/ss:Worksheet/x:WorksheetOptions"/>
- </xsl:call-template>
- </office:master-styles>
- </xsl:template>
- <xsl:template name="CondFormat_office_style">
- <!-- translate the ConditionalFormatting style,including font,size,color,etc -->
- <xsl:for-each select="/ss:Workbook/ss:Worksheet/x:ConditionalFormatting">
- <xsl:variable name="table-pos" select="count(../preceding-sibling::ss:Worksheet)+1"/>
- <xsl:variable name="conditions" select="count(preceding-sibling::x:ConditionalFormatting)+1"/>
- <!-- Matching multiple styles, but automatic styles are not allowed to inherit from another automatic style
- <xsl:for-each select="key('tableStyleIDs', key('tableWithConditional', .))
- [generate-id(.) =
- generate-id(key('styleId', .)[1])] ">
- <xsl:sort select="." />
+ <xsl:key name="definedStyleIds" match="/ss:Workbook/ss:Styles/ss:Style/@ss:ID" use="string(.)"/>
+ <xsl:variable name="defaultStyle" select="/ss:Workbook/ss:Styles/ss:Style[@ss:ID='Default']/@ss:ID"></xsl:variable>
+ <xsl:key name="styleId" match="@ss:StyleID" use="."/>
+ <xsl:template name="CondFormat_automatic_style">
+ <!-- For each conditionalFormatting We inject a new style, which is a child of the current found style -->
+ <xsl:for-each select="/ss:Workbook/ss:Worksheet[x:ConditionalFormatting]">
+ <xsl:variable name="table-pos" select="count(preceding-sibling::ss:Worksheet)+1"/>
+ <xsl:variable name="styleIdsUsedByTable" select="$defaultStyle | key('definedStyleIds', ss:Table/ss:Row/ss:Cell/@ss:StyleID)"/>
+ <xsl:for-each select="x:ConditionalFormatting">
+ <xsl:variable name="conditions" select="position()"/>
+ <xsl:variable name="conditionalFormatting" select="."/>
+ <!-- we want to loop over the distinct styleId attribute values of all cells within the table related to the current conditional formatting. -->
+ <!-- We'd need to add the anonymous style id "Default" to the mix. -->
+ <!-- for all 'ssStyle/@ss:ID's, which are in tables connected within this conditional formatting -->
+ <!-- <xsl:for-each select="key('tableStyleIDs', generate-id(preceding-sibling::ss:Table)) [generate-id(.) = generate-id(key('styleId', .)[1])] "> -->
+ <xsl:for-each select="$styleIdsUsedByTable">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">
+ <xsl:call-template name="encode-as-nc-name">
+ <xsl:with-param name="string" select="concat(.,'-ce',$table-pos,'-',$conditions)"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:attribute name="style:family">table-cell</xsl:attribute>
+ <xsl:variable name="style" select="key('Style', .)" />
+ <xsl:choose>
+ <xsl:when test="$style/@ss:Name">
+ <xsl:attribute name="style:parent-style-name">
+ <xsl:call-template name="encode-as-nc-name">
+ <xsl:with-param name="string" select="."/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:when>
+ <!-- as we create an automatic style, the parent is not allowed to be an automatic style as well
+ if the parent would be a automatic (unnamed) style, the style information have to be embedded to this style -->
+ <xsl:otherwise>
+ <xsl:attribute name="style:parent-style-name">
+ <xsl:call-template name="encode-as-nc-name">
+ <xsl:with-param name="string" select="$style/@ss:Parent"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:if test="$style/ss:NumberFormat/@ss:Format">
+ <xsl:attribute name="style:data-style-name">
+ <xsl:value-of select="concat($style/@ss:ID, 'F')"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="$style" mode="style-style-content"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:for-each select="$conditionalFormatting/x:Condition">
+ <xsl:variable name="condition-number" select="count(preceding-sibling::x:Condition)+1"/>
+ <xsl:variable name="base-address">
+ <xsl:choose>
+ <xsl:when test="contains(../x:Range,',')">
+ <xsl:choose>
+ <xsl:when test="contains(substring-before(../x:Range,','),':')">
+ <xsl:value-of select="substring-before(substring-after(../x:Range,':'),',')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before(../x:Range,',')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="../x:Range"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="columnNumber">
+ <xsl:choose>
+ <xsl:when test="contains($base-address, ':')">
+ <xsl:value-of select="substring-after(substring-after($base-address, ':'),'C')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($base-address,'C')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="rowNumber">
+ <xsl:choose>
+ <xsl:when test="contains($base-address, ':')">
+ <xsl:value-of select="substring-before(substring-after(substring-after($base-address, ':'),'R'),'C')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before(substring-after($base-address,'R'),'C')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="base-cell-address">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="$columnNumber"/>
+ <xsl:with-param name="row-number" select="$rowNumber"/>
+ <xsl:with-param name="column-pos-style" select="'relative'"/>
+ <xsl:with-param name="row-pos-style" select="'relative'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="condition-value">
+ <xsl:call-template name="translate-condition">
+ <xsl:with-param name="cell-column-pos" select="$columnNumber"/>
+ <xsl:with-param name="cell-row-pos" select="$rowNumber"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:element name="style:map">
+ <xsl:attribute name="style:condition">
+ <xsl:value-of select="$condition-value"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:apply-style-name">
+ <xsl:value-of select="concat('Excel_CondFormat_',$table-pos,'_',$conditions,'_',$condition-number)"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:base-cell-address">
+ <xsl:value-of select="concat(../../@ss:Name,'.',$base-cell-address)"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="translate-condition">
+ <xsl:param name="cell-row-pos"/>
+ <xsl:param name="cell-column-pos"/>
+ <!-- translates the condition to generate formula -->
+ <xsl:variable name="address-value">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="x:Value1"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="x:Qualifier">
+ <xsl:variable name="qualifier" select="x:Qualifier"/>
+ <xsl:variable name="first-value" select="x:Value1"/>
+ <xsl:choose>
+ <xsl:when test="$qualifier = 'Between'">
+ <xsl:variable name="second-value">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="x:Value2"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat('cell-content-is-between(',$address-value,',',$second-value,')')"/>
+ </xsl:when>
+ <xsl:when test="$qualifier = 'NotBetween'">
+ <xsl:variable name="second-value">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="x:Value2"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat('cell-content-is-not-between(',$address-value,',',$second-value,')')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="translatedQualifier">
+ <xsl:choose>
+ <xsl:when test="$qualifier = 'Equal'">=</xsl:when>
+ <xsl:when test="$qualifier = 'Less'">&lt;</xsl:when>
+ <xsl:when test="$qualifier = 'Greater'">&gt;</xsl:when>
+ <xsl:when test="$qualifier = 'LessOrEqual'">&lt;=</xsl:when>
+ <xsl:when test="$qualifier = 'GreaterOrEqual'">&gt;=</xsl:when>
+ <xsl:when test="$qualifier = 'NotEqual'">!=</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="concat('cell-content()', $translatedQualifier, $address-value)"/>
+ </xsl:otherwise>
- <xsl:apply-templates select="/ss:Workbook/ss:Styles/ss:Style[@ss:ID = current()/.]"/>
- </xsl:for-each>
- -->
- <xsl:for-each select="x:Condition">
- <xsl:variable name="condition-number" select="count(preceding-sibling::x:Condition)+1"/>
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">
- <xsl:call-template name="encode-as-nc-name">
- <xsl:with-param name="string" select="concat('Excel_CondFormat_',$table-pos,'_',$conditions,'_',$condition-number)"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="style:family">table-cell</xsl:attribute>
- <xsl:apply-templates select="@ss:Name" />
- <xsl:element name="style:table-cell-properties">
- <xsl:choose>
- <xsl:when test="x:Format/@Style">
- <xsl:variable name="stylevalue" select="./x:Format/@Style"/>
- <xsl:call-template name="recursion-condformat-style-table-cell">
- <xsl:with-param name="style-value-t">
- <xsl:choose>
- <xsl:when test="substring($stylevalue,string-length($stylevalue),1) != ';'">
- <xsl:value-of select="concat($stylevalue,';')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$stylevalue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="style:text-properties">
- <xsl:choose>
- <xsl:when test="x:Format/@Style">
- <xsl:variable name="stylevalue" select="./x:Format/@Style"/>
- <xsl:call-template name="recursion-condformat-style-text">
- <xsl:with-param name="style-value-t">
- <xsl:choose>
- <xsl:when test="substring($stylevalue,string-length($stylevalue),1) != ';'">
- <xsl:value-of select="concat($stylevalue,';')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$stylevalue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:font-style">
- <xsl:value-of select="'italic'"/>
- </xsl:attribute>
- <xsl:attribute name="style:text-underline-type">
- <xsl:value-of select="'single'"/>
- </xsl:attribute>
- <xsl:attribute name="style:text-underline-color">
- <xsl:value-of select="'font-color'"/>
- </xsl:attribute>
- <xsl:attribute name="fo:font-weight">
- <xsl:value-of select="'bold'"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="@ss:Name">
- <xsl:attribute name="style:display-name">
- <xsl:value-of select="."/>
- </xsl:attribute>
- </xsl:template>
- <xsl:template name="recursion-condformat-style-table-cell">
- <!-- generates style:style for ConditionalFormatting -->
- <xsl:param name="style-value-t"/>
- <xsl:variable name="style-value" select="normalize-space($style-value-t)"/>
- <xsl:choose>
- <xsl:when test="starts-with($style-value,'background')">
- <xsl:choose>
- <xsl:when test="contains($style-value,'mso-pattern')">
- <xsl:variable name="color-value">
- <xsl:call-template name="translate-color-style">
- <xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="mso-value">
- <xsl:call-template name="translate-color-style">
- <xsl:with-param name="source-str" select="normalize-space(substring-after($style-value,'mso-pattern'))"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="mso-color" select="substring-after($mso-value,'#')"/>
- <xsl:variable name="pattern-color-value" select="substring($mso-color,1,6)"/>
- <xsl:variable name="pattern" select="concat('0.',normalize-space(substring-before(substring-after($mso-color,'gray-'),';')))"/>
- <xsl:variable name="pattern-color">
- <xsl:call-template name="cell-pattern-color">
- <xsl:with-param name="pattern" select="$pattern"/>
- <xsl:with-param name="color-value" select="$color-value"/>
- <xsl:with-param name="pattern-color-value" select="concat('#',$pattern-color-value)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="fo:background-color">
- <xsl:value-of select="normalize-space($pattern-color)"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:background-color">
- <xsl:call-template name="translate-color-style">
- <xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="starts-with($style-value,'border')">
- <xsl:attribute name="fo:border">
- <xsl:value-of select="'0.002cm solid #000000'"/>
- </xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="contains($style-value,':')">
- <xsl:call-template name="recursion-condformat-style-table-cell">
- <xsl:with-param name="style-value-t" select="substring-after($style-value,';')"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="recursion-condformat-style-text">
- <!-- generates style:style for ConditionalFormatting -->
- <xsl:param name="style-value-t"/>
- <xsl:variable name="style-value" select="normalize-space($style-value-t)"/>
- <xsl:choose>
- <xsl:when test="starts-with($style-value,'color')">
- <xsl:attribute name="fo:color">
- <xsl:call-template name="translate-color-style">
- <xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="starts-with($style-value,'font-style')">
- <xsl:attribute name="fo:font-style">
- <xsl:value-of select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="starts-with($style-value,'font-weight')">
- <xsl:variable name="font-weight" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
- <xsl:attribute name="fo:font-weight">
- <xsl:choose>
- <xsl:when test="($font-weight &gt; 300) and ($font-weight &lt; 500)">
- <xsl:value-of select="'normal'"/>
- </xsl:when>
- <xsl:when test="($font-weight &gt; 500) or ($font-weight = 500)">
- <xsl:value-of select="'bold'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'0'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="starts-with($style-value,'text-underline-style')">
- <xsl:attribute name="style:text-underline-type">
- <xsl:value-of select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
- </xsl:attribute>
- <xsl:attribute name="style:text-underline-color">
- <xsl:value-of select="'#000000'"/>
- </xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="contains($style-value,':')">
- <xsl:call-template name="recursion-condformat-style-text">
- <xsl:with-param name="style-value-t" select="substring-after($style-value,';')"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="translate-color-style">
- <!-- translate the word of color to hex code of color -->
- <xsl:param name="source-str"/>
- <xsl:choose>
- <xsl:when test="starts-with($source-str,'#')">
- <xsl:value-of select="$source-str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="starts-with($source-str,'black')">
- <xsl:value-of select="'#000000'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'maroon')">
- <xsl:value-of select="'#800000'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'red')">
- <xsl:value-of select="'#FF0000'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'fuchsia')">
- <xsl:value-of select="'#FF00FF'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'olive')">
- <xsl:value-of select="'#808000'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'yellow')">
- <xsl:value-of select="'#FFFF00'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'green')">
- <xsl:value-of select="'#008000'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'lime')">
- <xsl:value-of select="'#00FF00'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'teal')">
- <xsl:value-of select="'#008080'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'aqua')">
- <xsl:value-of select="'#00FFFF'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'navy')">
- <xsl:value-of select="'#000080'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'blue')">
- <xsl:value-of select="'#0000FF'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'purple')">
- <xsl:value-of select="'#800080'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'gray')">
- <xsl:value-of select="'#808080'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'silver')">
- <xsl:value-of select="'#C0C0C0'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'white')">
- <xsl:value-of select="'#FFFFFF'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'#FFFFFF'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:key name="definedStyleIds" match="/ss:Workbook/ss:Styles/ss:Style/@ss:ID" use="string(.)"/>
- <xsl:variable name="defaultStyle" select="/ss:Workbook/ss:Styles/ss:Style[@ss:ID='Default']/@ss:ID"></xsl:variable>
- <xsl:key name="styleId" match="@ss:StyleID" use="."/>
- <xsl:template name="CondFormat_automatic_style">
- <!-- For each conditionalFormatting We inject a new style, which is a child of the current found style -->
- <xsl:for-each select="/ss:Workbook/ss:Worksheet[x:ConditionalFormatting]">
- <xsl:variable name="table-pos" select="count(preceding-sibling::ss:Worksheet)+1"/>
- <xsl:variable name="styleIdsUsedByTable" select="$defaultStyle | key('definedStyleIds', ss:Table/ss:Row/ss:Cell/@ss:StyleID)"/>
- <xsl:for-each select="x:ConditionalFormatting">
- <xsl:variable name="conditions" select="position()"/>
- <xsl:variable name="conditionalFormatting" select="."/>
- <!-- we want to loop over the distinct styleId attribute values of all cells within the table related to the current conditional formatting. -->
- <!-- We'd need to add the anonymous style id "Default" to the mix. -->
- <!-- for all 'ssStyle/@ss:ID's, which are in tables connected within this conditional formatting -->
- <!-- <xsl:for-each select="key('tableStyleIDs', generate-id(preceding-sibling::ss:Table)) [generate-id(.) = generate-id(key('styleId', .)[1])] "> -->
- <xsl:for-each select="$styleIdsUsedByTable">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">
- <xsl:call-template name="encode-as-nc-name">
- <xsl:with-param name="string" select="concat(.,'-ce',$table-pos,'-',$conditions)"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="style:family">table-cell</xsl:attribute>
- <xsl:variable name="style" select="key('Style', .)" />
- <xsl:choose>
- <xsl:when test="$style/@ss:Name">
- <xsl:attribute name="style:parent-style-name">
- <xsl:call-template name="encode-as-nc-name">
- <xsl:with-param name="string" select="."/>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:when>
- <!-- as we create an automatic style, the parent is not allowed to be an automatic style as well
- if the parent would be a automatic (unnamed) style, the style information have to be embedded to this style -->
- <xsl:otherwise>
- <xsl:attribute name="style:parent-style-name">
- <xsl:call-template name="encode-as-nc-name">
- <xsl:with-param name="string" select="$style/@ss:Parent"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:if test="$style/ss:NumberFormat/@ss:Format">
- <xsl:attribute name="style:data-style-name">
- <xsl:value-of select="concat($style/@ss:ID, 'F')"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="$style" mode="style-style-content"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:for-each select="$conditionalFormatting/x:Condition">
- <xsl:variable name="condition-number" select="count(preceding-sibling::x:Condition)+1"/>
- <xsl:variable name="base-address">
- <xsl:choose>
- <xsl:when test="contains(../x:Range,',')">
- <xsl:choose>
- <xsl:when test="contains(substring-before(../x:Range,','),':')">
- <xsl:value-of select="substring-before(substring-after(../x:Range,':'),',')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before(../x:Range,',')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="../x:Range"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="columnNumber">
- <xsl:choose>
- <xsl:when test="contains($base-address, ':')">
- <xsl:value-of select="substring-after(substring-after($base-address, ':'),'C')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after($base-address,'C')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="rowNumber">
- <xsl:choose>
- <xsl:when test="contains($base-address, ':')">
- <xsl:value-of select="substring-before(substring-after(substring-after($base-address, ':'),'R'),'C')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before(substring-after($base-address,'R'),'C')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="base-cell-address">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="$columnNumber"/>
- <xsl:with-param name="row-number" select="$rowNumber"/>
- <xsl:with-param name="column-pos-style" select="'relative'"/>
- <xsl:with-param name="row-pos-style" select="'relative'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="condition-value">
- <xsl:call-template name="translate-condition">
- <xsl:with-param name="cell-column-pos" select="$columnNumber"/>
- <xsl:with-param name="cell-row-pos" select="$rowNumber"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:element name="style:map">
- <xsl:attribute name="style:condition">
- <xsl:value-of select="$condition-value"/>
- </xsl:attribute>
- <xsl:attribute name="style:apply-style-name">
- <xsl:value-of select="concat('Excel_CondFormat_',$table-pos,'_',$conditions,'_',$condition-number)"/>
- </xsl:attribute>
- <xsl:attribute name="style:base-cell-address">
- <xsl:value-of select="concat(../../@ss:Name,'.',$base-cell-address)"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="translate-condition">
- <xsl:param name="cell-row-pos"/>
- <xsl:param name="cell-column-pos"/>
- <!-- translates the condition to generate formula -->
- <xsl:variable name="address-value">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="x:Value1"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="x:Qualifier">
- <xsl:variable name="qualifier" select="x:Qualifier"/>
- <xsl:variable name="first-value" select="x:Value1"/>
- <xsl:choose>
- <xsl:when test="$qualifier = 'Between'">
- <xsl:variable name="second-value">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="x:Value2"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat('cell-content-is-between(',$address-value,',',$second-value,')')"/>
- </xsl:when>
- <xsl:when test="$qualifier = 'NotBetween'">
- <xsl:variable name="second-value">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="x:Value2"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat('cell-content-is-not-between(',$address-value,',',$second-value,')')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="translatedQualifier">
- <xsl:choose>
- <xsl:when test="$qualifier = 'Equal'">=</xsl:when>
- <xsl:when test="$qualifier = 'Less'">&lt;</xsl:when>
- <xsl:when test="$qualifier = 'Greater'">&gt;</xsl:when>
- <xsl:when test="$qualifier = 'LessOrEqual'">&lt;=</xsl:when>
- <xsl:when test="$qualifier = 'GreaterOrEqual'">&gt;=</xsl:when>
- <xsl:when test="$qualifier = 'NotEqual'">!=</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="concat('cell-content()', $translatedQualifier, $address-value)"/>
- </xsl:otherwise>
-
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('is-true-formula(',$address-value,')')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- Used in case of 'style:map', conditional formatting, where a style references to another -->
- <xsl:key match="/ss:Workbook/ss:Worksheet/ss:Table/ss:Row/ss:Cell" name="cells" use="@ss:StyleID"/>
- <xsl:template match="ss:NumberFormat">
- <xsl:variable name="unit-count" select="string-length(@ss:Format) - string-length(translate(@ss:Format,';','')) + 1"/>
- <xsl:variable name="proto-style-id" select="../@ss:ID"/>
- <xsl:call-template name="process-number-format-unit">
- <xsl:with-param name="number-format-unit" select="@ss:Format"/>
- <xsl:with-param name="style-id" select="concat($proto-style-id,'F')"/>
- <xsl:with-param name="format-type" select="key('cells', $proto-style-id)/ss:Data/@ss:Type"/>
- <xsl:with-param name="total-unit" select="$unit-count"/>
- <xsl:with-param name="current-unit" select="0"/>
- </xsl:call-template>
- </xsl:template>
- <!-- Note: conditions appearing only once at the beginning are mixed with others -->
- <xsl:template name="process-number-format-unit">
- <xsl:param name="number-format-unit"/>
- <xsl:param name="style-id"/>
- <xsl:param name="format-type"/>
- <xsl:param name="total-unit"/>
- <xsl:param name="current-unit"/>
- <xsl:choose>
- <!-- if total-unit > 1 and the last unit is just @, delete it -->
- <xsl:when test="$current-unit = 0 and $total-unit &gt; 1 and substring( $number-format-unit, string-length($number-format-unit) - 1) = ';@'">
- <xsl:call-template name="process-number-format-unit">
- <xsl:with-param name="number-format-unit" select="substring( $number-format-unit, 1, string-length($number-format-unit) - 2)"/>
- <xsl:with-param name="style-id" select="$style-id"/>
- <xsl:with-param name="format-type" select="$format-type"/>
- <xsl:with-param name="total-unit" select="$total-unit - 1"/>
- <xsl:with-param name="current-unit" select="0"/>
- </xsl:call-template>
- </xsl:when>
- <!-- $number-format-unit enum values: General, General Number, General Date, Long Date, Medium Date, Short Date, Long Time,
- Medium Time, Short Time, Currency, Euro Currency, Fixed, Standard, Percent, Scientific, Yes/No, True/False, On/Off -->
- <xsl:when test="$number-format-unit = 'Currency'">
- <number:currency-style style:name="{concat( $style-id, 'P1')}" style:volatile="true">
- <number:text>$</number:text>
- <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
- </number:currency-style>
- <number:currency-style style:name="{$style-id}">
- <style:text-properties fo:color="#ff0000"/>
- <number:text>$-</number:text>
- <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
- <style:map style:condition="value()&gt;=0" style:apply-style-name="{concat( $style-id, 'P1')}"/>
- </number:currency-style>
- </xsl:when>
- <xsl:when test="$number-format-unit = 'Euro Currency'">
- <number:currency-style style:name="{concat( $style-id, 'P1')}" style:volatile="true">
- <number:text>€ </number:text>
- <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
- </number:currency-style>
- <number:currency-style style:name="{$style-id}">
- <style:text-properties fo:color="#ff0000"/>
- <number:text>(€ </number:text>
- <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
- <number:text>)</number:text>
- <style:map style:condition="value()&gt;=0" style:apply-style-name="{concat( $style-id, 'P1')}"/>
- </number:currency-style>
- </xsl:when>
- <xsl:when test="$number-format-unit = 'Yes/No' or $number-format-unit = 'True/False' or $number-format-unit = 'On/Off'">
- <xsl:variable name="left-code" select="substring-before( $number-format-unit, '/')"/>
- <xsl:variable name="right-code" select="substring-after( $number-format-unit, '/')"/>
- <number:number-style style:name="{concat( $style-id, 'P1')}" style:volatile="true">
- <number:text>
- <xsl:value-of select="$left-code"/>
- </number:text>
- </number:number-style>
- <number:number-style style:name="{concat( $style-id, 'P2')}" style:volatile="true">
- <number:text>
- <xsl:value-of select="$left-code"/>
- </number:text>
- </number:number-style>
- <number:number-style style:name="{$style-id}">
- <number:text>
- <xsl:value-of select="$right-code"/>
- </number:text>
- <style:map style:condition="value()&gt;0" style:apply-style-name="{concat( $style-id, 'P1')}"/>
- <style:map style:condition="value()&lt;0" style:apply-style-name="{concat( $style-id, 'P2')}"/>
- </number:number-style>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$total-unit &gt; 1 and $current-unit = 0">
- <!-- still complete number format string of multiple sub-formats, split them out -->
- <xsl:call-template name="process-number-format-unit">
- <xsl:with-param name="number-format-unit" select="substring-before($number-format-unit,';')"/>
- <xsl:with-param name="style-id" select="concat($style-id,'P1')"/>
- <xsl:with-param name="format-type" select="$format-type"/>
- <xsl:with-param name="total-unit" select="$total-unit"/>
- <xsl:with-param name="current-unit" select="1"/>
- </xsl:call-template>
- <xsl:if test="$total-unit &gt; 2">
- <xsl:call-template name="process-number-format-unit">
- <xsl:with-param name="number-format-unit" select="substring-before(substring-after($number-format-unit,';'),';')"/>
- <xsl:with-param name="style-id" select="concat($style-id,'P2')"/>
- <xsl:with-param name="format-type" select="$format-type"/>
- <xsl:with-param name="total-unit" select="$total-unit"/>
- <xsl:with-param name="current-unit" select="2"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$total-unit &gt; 3">
- <!-- four sub number format -->
- <xsl:call-template name="process-number-format-unit">
- <xsl:with-param name="number-format-unit" select="substring-before(substring-after(substring-after($number-format-unit,';'),';'),';')"/>
- <xsl:with-param name="style-id" select="concat($style-id,'P3')"/>
- <xsl:with-param name="format-type" select="$format-type"/>
- <xsl:with-param name="total-unit" select="$total-unit"/>
- <xsl:with-param name="current-unit" select="3"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- <!-- symbol number format converted, below deal with ordinary number formatting -->
- <xsl:variable name="current-number-format-unit">
- <xsl:choose>
- <xsl:when test="$total-unit = 1 and $current-unit = 0">
- <xsl:value-of select="$number-format-unit"/>
- </xsl:when>
- <xsl:when test="$total-unit = 2 and $current-unit = 0">
- <xsl:value-of select="substring-after($number-format-unit,';')"/>
- </xsl:when>
- <xsl:when test="$total-unit = 3 and $current-unit = 0">
- <xsl:value-of select="substring-after(substring-after($number-format-unit,';'),';')"/>
- </xsl:when>
- <xsl:when test="$current-unit = 0">
- <!-- the forth sub number format -->
- <xsl:value-of select="substring-after(substring-after(substring-after($number-format-unit,';'),';'),';')"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- not the default sub number format, glu -->
- <xsl:value-of select="$number-format-unit"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="style-type-name">
- <xsl:choose>
- <xsl:when test="($format-type = 'Number' and contains($current-number-format-unit,'[$') and not(contains($current-number-format-unit,'[$-') ) ) or contains($current-number-format-unit,'Currency') ">number:currency-style</xsl:when>
- <xsl:when test="($format-type = 'Number' and (contains($current-number-format-unit,'%') or contains($current-number-format-unit, 'Percent') ) ) or contains($current-number-format-unit,'Percent') ">number:percentage-style</xsl:when>
- <xsl:when test="($format-type = 'DateTime' or $format-type = 'String') and (contains($current-number-format-unit,'y') or contains($current-number-format-unit,'g') or contains($current-number-format-unit,'d') or contains($current-number-format-unit, 'Date') )">number:date-style</xsl:when>
- <xsl:when test="($format-type = 'DateTime' or $format-type = 'String') and ( contains($current-number-format-unit,'h') or contains($current-number-format-unit,'m') or contains($current-number-format-unit,'s') or contains($current-number-format-unit, 'Time') )">number:time-style</xsl:when>
- <xsl:when test="contains($current-number-format-unit, 'Number') or contains($current-number-format-unit, 'General') or contains($current-number-format-unit, 'Fixed') or contains($current-number-format-unit, 'Standard') or contains($current-number-format-unit, 'Scientific') or ( contains($current-number-format-unit,'#') or contains($current-number-format-unit,'0') or contains($current-number-format-unit,'?') )">number:number-style</xsl:when>
- <xsl:when test="$format-type = 'Boolean'">number:boolean-style</xsl:when>
- <xsl:otherwise>number:text-style</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="{$style-type-name}">
- <xsl:attribute name="style:name">
- <xsl:value-of select="$style-id"/>
- </xsl:attribute>
- <xsl:apply-templates select="@ss:Name" />
- <!-- removed in OASIS XML
- <xsl:attribute name="style:family">data-style</xsl:attribute>-->
- <xsl:if test="$current-unit &gt; 0">
- <xsl:attribute name="style:volatile">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="contains ( $current-number-format-unit, '[h]') or contains ( $current-number-format-unit, '[m]') or contains ( $current-number-format-unit, '[s]')">
- <xsl:attribute name="number:truncate-on-overflow">false</xsl:attribute>
- </xsl:if>
- <xsl:if test="contains($current-number-format-unit,'[$') or contains($current-number-format-unit, '[DBNum')">
- <xsl:call-template name="create-language-country-attribute">
- <xsl:with-param name="attribute-code" select="substring-before(substring-after(substring-after($current-number-format-unit,'[$'),'-'),']')"/>
- <xsl:with-param name="number-code-style" select="substring-before( substring-after($current-number-format-unit,'[DBNum'),']')"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="contains( $current-number-format-unit, '[')">
- <xsl:element name="style:text-properties">
- <xsl:choose>
- <xsl:when test="contains( $current-number-format-unit, '[Red')">
- <xsl:attribute name="fo:color">#ff0000</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains( $current-number-format-unit, '[Black')">
- <xsl:attribute name="fo:color">#000000</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains( $current-number-format-unit, '[Blue')">
- <xsl:attribute name="fo:color">#0000ff</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains( $current-number-format-unit, '[Cyan')">
- <xsl:attribute name="fo:color">#00ffff</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains( $current-number-format-unit, '[Green')">
- <xsl:attribute name="fo:color">#00ff00</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains( $current-number-format-unit, '[Magenta')">
- <xsl:attribute name="fo:color">#ff00ff</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains( $current-number-format-unit, '[White')">
- <xsl:attribute name="fo:color">#ffffff</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains( $current-number-format-unit, '[Yellow')">
- <xsl:attribute name="fo:color">#ffff00</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <!-- the type of condition-pos:1,the former third part of General; 2, the last General. the methods handling different -->
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$current-number-format-unit"/>
- <xsl:with-param name="unit-pos" select="1"/>
- <xsl:with-param name="condition-pos">
- <xsl:choose>
- <xsl:when test="$current-unit = 1 or $current-unit = 2 or $current-unit = 3">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:when test="$current-unit = 0 and not(contains($number-format-unit, ';'))">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- <!-- create style:map for other sub number formats -->
- <xsl:if test="$current-unit = 0 and $total-unit &gt; 1">
- <xsl:variable name="style-condition1">
- <xsl:call-template name="get-number-format-condition">
- <xsl:with-param name="number-format-unit" select="substring-before($number-format-unit,';')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($style-condition1) &gt; 0">
- <style:map style:condition="{concat('value()',$style-condition1)}" style:apply-style-name="{concat($style-id,'P1')}"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$total-unit = 2">
- <style:map style:condition="value()&gt;=0" style:apply-style-name="{concat($style-id,'P1')}"/>
- </xsl:when>
- <xsl:otherwise>
- <style:map style:condition="value()&gt;0" style:apply-style-name="{concat($style-id,'P1')}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="$total-unit &gt; 2">
- <xsl:variable name="style-condition2">
- <xsl:call-template name="get-number-format-condition">
- <xsl:with-param name="number-format-unit" select="substring-before(substring-after($number-format-unit,';'),';')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($style-condition2) &gt; 0">
- <style:map style:condition="{concat('value()',$style-condition2)}" style:apply-style-name="{concat($style-id,'P2')}"/>
- </xsl:when>
- <xsl:otherwise>
- <style:map style:condition="value()&lt;0" style:apply-style-name="{concat($style-id,'P2')}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="$total-unit &gt; 3">
- <!-- four sub number formats, glu -->
- <xsl:variable name="style-condition3">
- <xsl:call-template name="get-number-format-condition">
- <xsl:with-param name="number-format-unit" select="substring-before(substring-after(substring-after($number-format-unit,';'),';'),';')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($style-condition3) &gt; 0">
- <style:map style:condition="{concat('value()',$style-condition3)}" style:apply-style-name="{concat($style-id,'P3')}"/>
- </xsl:when>
- <xsl:otherwise>
- <style:map style:condition="value()=0" style:apply-style-name="{concat($style-id,'P3')}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:if>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="create-language-country-attribute">
- <xsl:param name="attribute-code"/>
- <xsl:param name="number-code-style"/>
- <!-- convert Microsoft List of Locale ID (LCID) to language and country codes according to ISO-639 and ISO-3166.
- Reference:
- http://www.loc.gov/standards/iso639-2/langcodes.html
- http://etext.lib.virginia.edu/tei/iso639.html
- http://nl.ijs.si/gnusl/cee/std/ISO_3166.html
- http://xml.coverpages.org/ripe3166.txt
- http://www.worldlanguage.com/
- http://www.ethnologue.com/
- glu -->
- <!-- the variables of language-country-code and number-shape-code transformed to decimal format -->
- <xsl:variable name="language-country-code">
- <xsl:variable name="temp-code">
- <xsl:choose>
- <xsl:when test="string-length($attribute-code) &lt;= 4">
- <xsl:value-of select="$attribute-code"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($attribute-code,string-length($attribute-code) - 3)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="$temp-code"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="string-length($temp-code)"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="string-length($attribute-code) &gt; 4 or string-length($number-code-style) &gt; 0">
- <xsl:variable name="number-shape-code">
- <xsl:variable name="temp-code">
- <xsl:choose>
- <xsl:when test="string-length($attribute-code) &gt; 4">
- <xsl:value-of select="substring($attribute-code, 1, string-length($attribute-code) - 6)"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="$temp-code"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="string-length($temp-code)"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
- <xsl:choose>
- <!-- Western, #01 -->
- <xsl:when test="$number-shape-code = 1"/>
- <!-- Arabic Indic, #02 -->
- <xsl:when test="$number-shape-code = 2"/>
- <!-- Extended Arabic Indic, #03 -->
- <xsl:when test="$number-shape-code = 3"/>
- <!-- Devanagari (Sanskrit - India), #04-->
- <xsl:when test="$number-shape-code = 4">
- <xsl:attribute name="number:transliteration-language">sa</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
- </xsl:when>
- <!-- Bengali (India), #05 -->
- <xsl:when test="$number-shape-code = 5">
- <xsl:attribute name="number:transliteration-language">bn</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
- </xsl:when>
- <!-- Gurmukhi (Punjabi - India), #06 -->
- <xsl:when test="$number-shape-code = 6">
- <xsl:attribute name="number:transliteration-language">pa</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
- </xsl:when>
- <!-- Gujarati (India), #07 -->
- <xsl:when test="$number-shape-code = 7">
- <xsl:attribute name="number:transliteration-language">gu</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
- </xsl:when>
- <!-- Odia (India), #08 -->
- <xsl:when test="$number-shape-code = 8">
- <xsl:attribute name="number:transliteration-language">or</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
- </xsl:when>
- <!-- Tamil (India), #09 -->
- <xsl:when test="$number-shape-code = 9">
- <xsl:attribute name="number:transliteration-language">ta</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
- </xsl:when>
- <!-- Telugu (India), #0a -->
- <xsl:when test="$number-shape-code = 10">
- <xsl:attribute name="number:transliteration-language">te</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
- </xsl:when>
- <!-- Kannada (India), #0b -->
- <xsl:when test="$number-shape-code = 11">
- <xsl:attribute name="number:transliteration-language">kn</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
- </xsl:when>
- <!-- Malayalam (India), #0c -->
- <xsl:when test="$number-shape-code = 12">
- <xsl:attribute name="number:transliteration-language">ml</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
- </xsl:when>
- <!-- Thai, #0d -->
- <xsl:when test="$number-shape-code = 13">
- <xsl:attribute name="number:transliteration-language">th</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">TH</xsl:attribute>
- </xsl:when>
- <!-- Lao, #0e -->
- <xsl:when test="$number-shape-code = 14">
- <xsl:attribute name="number:transliteration-language">lo</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">LA</xsl:attribute>
- </xsl:when>
- <!-- Tibetan (China), #0f -->
- <xsl:when test="$number-shape-code = 15">
- <xsl:attribute name="number:transliteration-language">bo</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
- </xsl:when>
- <!-- Myanmar (Burma), #10 -->
- <xsl:when test="$number-shape-code = 16">
- <xsl:attribute name="number:transliteration-language">my</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">MM</xsl:attribute>
- </xsl:when>
- <!-- Ethiopic (Geez), #11 -->
- <xsl:when test="$number-shape-code = 17">
- <xsl:attribute name="number:transliteration-language">gez</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">ET</xsl:attribute>
- </xsl:when>
- <!-- Khmer (Cambodian), #12-->
- <xsl:when test="$number-shape-code = 18">
- <xsl:attribute name="number:transliteration-language">km</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">KH</xsl:attribute>
- </xsl:when>
- <!-- Mongolian, #13 -->
- <xsl:when test="$number-shape-code = 19">
- <xsl:attribute name="number:transliteration-language">mn</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
- </xsl:when>
- <!-- Japanese 1 ([DBNum1]) , #1b, #0411 -->
- <xsl:when test="$number-shape-code = 27 or ($number-code-style = '1' and $language-country-code = 1041)">
- <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">ja</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">JP</xsl:attribute>
- </xsl:when>
- <!-- Japanese 2 ([DBNum2]) ,#1c, #0411 -->
- <xsl:when test="$number-shape-code = 28 or ($number-code-style = '2' and $language-country-code = 1041 )">
- <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">ja</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">JP</xsl:attribute>
- </xsl:when>
- <!-- Japanese 3 ([DBNum3]), #1d, #0411 -->
- <xsl:when test="$number-shape-code = 29 or ($number-code-style = '3' and $language-country-code = 1041 )">
- <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">ja</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">JP</xsl:attribute>
- </xsl:when>
- <!-- Simplified Chinese 1 ([DBNum1]), #1e, #0804 -->
- <xsl:when test="$number-shape-code = 30 or ($number-code-style = '1' and $language-country-code = 2052 )">
- <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
- </xsl:when>
- <!-- Simplified Chinese 2 ([DBNum2]),#1f,#0804 -->
- <xsl:when test="$number-shape-code = 31 or ($number-code-style = '2' and $language-country-code = 2052 )">
- <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
- </xsl:when>
- <!-- Simplified Chinese 3 ([DBNum3]), #20,#0804 -->
- <xsl:when test="$number-shape-code = 32 or ($number-code-style = '3' and $language-country-code = 2052 )">
- <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
- </xsl:when>
- <!-- Traditional Chinese 1 ([DBNum1]), #21, #0404 -->
- <xsl:when test="$number-shape-code = 33 or ($number-code-style = '1' and $language-country-code = 1028 )">
- <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">TW</xsl:attribute>
- </xsl:when>
- <!-- Traditional Chinese 2 ([DBNum2]), #22, #0404 -->
- <xsl:when test="$number-shape-code = 34 or ($number-code-style = '2' and $language-country-code = 1028 )">
- <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">TW</xsl:attribute>
- </xsl:when>
- <!-- Traditional Chinese 3 ([DBNum3]),#23, #0404 -->
- <xsl:when test="$number-shape-code = 35 or ($number-code-style = '3' and $language-country-code = 1028 )">
- <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">TW</xsl:attribute>
- </xsl:when>
- <!-- Korean 1 ([DBNum1]), #24, #0412 -->
- <xsl:when test="$number-shape-code = 36 or ($number-code-style = '1' and $language-country-code = 1042 )">
- <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">ko</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">KR</xsl:attribute>
- </xsl:when>
- <!-- Korean 2 ([DBNum2]), #25, #0412 -->
- <xsl:when test="$number-shape-code = 37 or ($number-code-style = '2' and $language-country-code = 1042 )">
- <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">ko</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">KR</xsl:attribute>
- </xsl:when>
- <!-- Korean 3 ([DBNum3]), #26, #0412 -->
- <xsl:when test="$number-shape-code = 38 or ($number-code-style = '3' and $language-country-code = 1042 )">
- <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">ko</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">KR</xsl:attribute>
- </xsl:when>
- <!-- Korean 4 ([DBNum4]), #27, #0412 -->
- <xsl:when test="$number-shape-code = 39 or ($number-code-style = '4' and $language-country-code = 1042 )">
- <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
- <xsl:attribute name="number:transliteration-language">ko</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">KR</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <!-- components of a format code: two digits for number shape codes, two for calendar types, four for LCID -->
- <xsl:choose>
- <!-- totally 223 language-country LCID codes, manually created, among which MS Office 2003 supports 134, OOo supports 91 -->
- <xsl:when test="$language-country-code = 1078">
- <!-- Afrikaans - South Africa, #0436 -->
- <xsl:attribute name="number:language">af</xsl:attribute>
- <xsl:attribute name="number:country">ZA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1052">
- <!-- Albanian - Albania, #041c -->
- <xsl:attribute name="number:language">sq</xsl:attribute>
- <xsl:attribute name="number:country">AL</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1118">
- <!-- Amharic - Ethiopia, #045e -->
- <xsl:attribute name="number:language">am</xsl:attribute>
- <xsl:attribute name="number:country">ET</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1025">
- <!-- Arabic - Saudi Arabia, #0401 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">SA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 5121">
- <!-- Arabic - Algeria, #1401 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">DZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 15361">
- <!-- Arabic - Bahrain, #3c01 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">BH</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 3073">
- <!-- Arabic - Egypt, #0c01 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">EG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2049">
- <!-- Arabic - Iraq, #0801 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">IQ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 11265">
- <!-- Arabic - Jordan, #2c01 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">JO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 13313">
- <!-- Arabic - Kuwait, #3401 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">KW</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 12289">
- <!-- Arabic - Lebanon, #3001 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">LB</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 4097">
- <!-- Arabic - Libya, #1001 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">LY</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 6145">
- <!-- Arabic - Morocco, #1801 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">MA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 8193">
- <!-- Arabic - Oman, #2001 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">OM</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 16385">
- <!-- Arabic - Qatar, #4001 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">QA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 10241">
- <!-- Arabic - Syria, #2801 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">SY</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 7169">
- <!-- Arabic - Tunisia, #1c01 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">TN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 14337">
- <!-- Arabic - U.A.E., #3801 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">AE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 9217">
- <!-- Arabic - Yemen, #2401 -->
- <xsl:attribute name="number:language">ar</xsl:attribute>
- <xsl:attribute name="number:country">YE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1067">
- <!-- Armenian - Armenia, #042b -->
- <xsl:attribute name="number:language">hy</xsl:attribute>
- <xsl:attribute name="number:country">AM</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1101">
- <!-- Assamese, #044d -->
- <xsl:attribute name="number:language">as</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2092">
- <!-- Azeri - Cyrillic, #082c -->
- <xsl:attribute name="number:language">az</xsl:attribute>
- <xsl:attribute name="number:country">AZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1068">
- <!-- Azeri - Latin, #042c -->
- <xsl:attribute name="number:language">az</xsl:attribute>
- <xsl:attribute name="number:country">AZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1069">
- <!-- Basque - France/Spain, #042d -->
- <xsl:attribute name="number:language">eu</xsl:attribute>
- <xsl:attribute name="number:country">ES</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1059">
- <!-- Belarusian - Belarus, #0423 -->
- <xsl:attribute name="number:language">be</xsl:attribute>
- <xsl:attribute name="number:country">BY</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1093">
- <!-- Bengali (India), #0445 -->
- <xsl:attribute name="number:language">bn</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2117">
- <!-- Bengali (Bangladesh), #0845 -->
- <xsl:attribute name="number:language">bn</xsl:attribute>
- <xsl:attribute name="number:country">BD</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 5146">
- <!-- Bosnian (Bosnia/Herzegovina), #141a -->
- <xsl:attribute name="number:language">bs</xsl:attribute>
- <xsl:attribute name="number:country">BA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1026">
- <!-- Bulgarian, #0402 -->
- <xsl:attribute name="number:language">bg</xsl:attribute>
- <xsl:attribute name="number:country">BG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1109">
- <!-- Burmese (Burma/Myanmar), #0455 -->
- <xsl:attribute name="number:language">my</xsl:attribute>
- <xsl:attribute name="number:country">MM</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1027">
- <!-- Catalan - Spain, #0403 -->
- <xsl:attribute name="number:language">ca</xsl:attribute>
- <xsl:attribute name="number:country">ES</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1116">
- <!-- Cherokee - United States, #045c -->
- <xsl:attribute name="number:language">chr</xsl:attribute>
- <xsl:attribute name="number:country">US</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2052">
- <!-- Chinese - People's Republic of China, #0804 -->
- <xsl:attribute name="number:language">zh</xsl:attribute>
- <xsl:attribute name="number:country">CN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 4100">
- <!-- Chinese - Singapore, #1004 -->
- <xsl:attribute name="number:language">zh</xsl:attribute>
- <xsl:attribute name="number:country">SG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1028">
- <!-- Chinese - Taiwan, #0404 -->
- <xsl:attribute name="number:language">zh</xsl:attribute>
- <xsl:attribute name="number:country">TW</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 3076">
- <!-- Chinese - Hong Kong SAR, #0c04 -->
- <xsl:attribute name="number:language">zh</xsl:attribute>
- <xsl:attribute name="number:country">HK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 5124">
- <!-- Chinese - Macao SAR, #1404 -->
- <xsl:attribute name="number:language">zh</xsl:attribute>
- <xsl:attribute name="number:country">MO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1050">
- <!-- Croatian (Croatia), #041a -->
- <xsl:attribute name="number:language">hr</xsl:attribute>
- <xsl:attribute name="number:country">HR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 4122">
- <!-- Croatian (Bosnia/Herzegovina), #101a -->
- <xsl:attribute name="number:language">hr</xsl:attribute>
- <xsl:attribute name="number:country">BA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1029">
- <!-- Czech, #0405 -->
- <xsl:attribute name="number:language">cs</xsl:attribute>
- <xsl:attribute name="number:country">CZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1030">
- <!-- Danish, #0406 -->
- <xsl:attribute name="number:language">da</xsl:attribute>
- <xsl:attribute name="number:country">DK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1125">
- <!-- Divehi, #0465 -->
- <xsl:attribute name="number:language">dv</xsl:attribute>
- <xsl:attribute name="number:country">MV</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1043">
- <!-- Dutch - Netherlands, #0413 -->
- <xsl:attribute name="number:language">nl</xsl:attribute>
- <xsl:attribute name="number:country">NL</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2067">
- <!-- Dutch - Belgium, #0813 -->
- <xsl:attribute name="number:language">nl</xsl:attribute>
- <xsl:attribute name="number:country">BE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1126">
- <!-- Edo (Bini - Nigeria), #0466 -->
- <xsl:attribute name="number:language">bin</xsl:attribute>
- <xsl:attribute name="number:country">NG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1033">
- <!-- English - United States, #0409 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">US</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2057">
- <!-- English - United Kingdom, #0809 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">GB</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 3081">
- <!-- English - Australia, #0c09 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">AU</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 10249">
- <!-- English - Belize, #2809 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">BZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 4105">
- <!-- English - Canada, #1009 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">CA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 9225">
- <!-- English - Caribbean (Cuba), #2409 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">CU</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 15369">
- <!-- English - Hong Kong SAR, #3c09 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">HK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 16393">
- <!-- English - India, #4009 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 14345">
- <!-- English - Indonesia, #3809 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">ID</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 6153">
- <!-- English - Ireland, #1809 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">IE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 8201">
- <!-- English - Jamaica, #2009 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">JM</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 17417">
- <!-- English - Malaysia, #4409 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">MY</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 5129">
- <!-- English - New Zealand, #1409 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">NZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 13321">
- <!-- English - Philippines, #3409 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">PH</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 18441">
- <!-- English - Singapore, #4809 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">SG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 7177">
- <!-- English - South Africa, #1c09 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">ZA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 11273">
- <!-- English - Trinidad, #2c09 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">TT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 12297">
- <!-- English - Zimbabwe, #3009 -->
- <xsl:attribute name="number:language">en</xsl:attribute>
- <xsl:attribute name="number:country">ZW</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1061">
- <!-- Estonian (Estonia), #0425 -->
- <xsl:attribute name="number:language">et</xsl:attribute>
- <xsl:attribute name="number:country">EE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1080">
- <!-- Faroese (Faroe Islands), #0438 -->
- <xsl:attribute name="number:language">fo</xsl:attribute>
- <xsl:attribute name="number:country">FO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1065">
- <!-- Farsi (Persian/Iran), #0429 -->
- <xsl:attribute name="number:language">fa</xsl:attribute>
- <xsl:attribute name="number:country">IR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1124">
- <!-- Filipino (Philippine), #0464 -->
- <xsl:attribute name="number:language">phi</xsl:attribute>
- <xsl:attribute name="number:country">PH</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1035">
- <!-- Finnish, #040b -->
- <xsl:attribute name="number:language">fi</xsl:attribute>
- <xsl:attribute name="number:country">FI</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1036">
- <!-- French - France, #040c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">FR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2060">
- <!-- French - Belgium, #080c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">BE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 11276">
- <!-- French - Cameroon, #2c0c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">CM</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 3084">
- <!-- French - Canada, #0c0c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">CA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 9228">
- <!-- French - Congo, #240c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">CG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 12300">
- <!-- French - Cote d'Ivoire, #300c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">CI</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 15372">
- <!-- French - Haiti, #3c0c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">HT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 5132">
- <!-- French - Luxembourg, #140c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">LU</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 13324">
- <!-- French - Mali, #340c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">ML</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 6156">
- <!-- French - Monaco, #180c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">MC</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 14348">
- <!-- French - Morocco, #380c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">MA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 58380">
- <!-- French - North Africa (Algeria), #e40c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">DZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 8204">
- <!-- French - Reunion, #200c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">RE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 10252">
- <!-- French - Senegal, #280c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">SN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 4108">
- <!-- French - Switzerland, #100c -->
- <xsl:attribute name="number:language">fr</xsl:attribute>
- <xsl:attribute name="number:country">CH</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1122">
- <!-- Frisian - Netherlands, #0462 -->
- <xsl:attribute name="number:language">fy</xsl:attribute>
- <xsl:attribute name="number:country">NL</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1127">
- <!-- Fulfude (Fulah) - Nigeria, #0467 -->
- <xsl:attribute name="number:language">ff</xsl:attribute>
- <xsl:attribute name="number:country">NG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1071">
- <!-- FYRO Macedonian, #042f -->
- <xsl:attribute name="number:language">mk</xsl:attribute>
- <xsl:attribute name="number:country">MK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2108">
- <!-- Gaelic (Ireland), #083c -->
- <xsl:attribute name="number:language">gd</xsl:attribute>
- <xsl:attribute name="number:country">IE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1084">
- <!-- Gaelic (Scotland), #043c -->
- <xsl:attribute name="number:language">gd</xsl:attribute>
- <xsl:attribute name="number:country">GB</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1110">
- <!-- Galician (Gallegan) - Spain, #0456 -->
- <xsl:attribute name="number:language">gl</xsl:attribute>
- <xsl:attribute name="number:country">ES</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1079">
- <!-- Georgian - Georgia, #0437 -->
- <xsl:attribute name="number:language">ka</xsl:attribute>
- <xsl:attribute name="number:country">GE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1031">
- <!-- German - Germany, #0407 -->
- <xsl:attribute name="number:language">de</xsl:attribute>
- <xsl:attribute name="number:country">DE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 3079">
- <!-- German - Austria, #0c07 -->
- <xsl:attribute name="number:language">de</xsl:attribute>
- <xsl:attribute name="number:country">AT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 5127">
- <!-- German - Liechtenstein, #1407 -->
- <xsl:attribute name="number:language">de</xsl:attribute>
- <xsl:attribute name="number:country">LI</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 4103">
- <!-- German - Luxembourg, #1007 -->
- <xsl:attribute name="number:language">de</xsl:attribute>
- <xsl:attribute name="number:country">LU</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2055">
- <!-- German - Switzerland, #0807 -->
- <xsl:attribute name="number:language">de</xsl:attribute>
- <xsl:attribute name="number:country">CH</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1032">
- <!-- Greek, #0408 -->
- <xsl:attribute name="number:language">el</xsl:attribute>
- <xsl:attribute name="number:country">GR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1140">
- <!-- Guarani - Paraguay, #0474 -->
- <xsl:attribute name="number:language">gn</xsl:attribute>
- <xsl:attribute name="number:country">PY</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1095">
- <!-- Gujarati - India, #0447 -->
- <xsl:attribute name="number:language">gu</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1128">
- <!-- Hausa - Nigeria, #0468 -->
- <xsl:attribute name="number:language">ha</xsl:attribute>
- <xsl:attribute name="number:country">NG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1141">
- <!-- Hawaiian - US, #0475 -->
- <xsl:attribute name="number:language">haw</xsl:attribute>
- <xsl:attribute name="number:country">US</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1037">
- <!-- Hebrew, #040d -->
- <xsl:attribute name="number:language">he</xsl:attribute>
- <xsl:attribute name="number:country">IL</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1081">
- <!-- Hindi (India), #0439 -->
- <xsl:attribute name="number:language">hi</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1038">
- <!-- Hungarian - Hungary, #040e -->
- <xsl:attribute name="number:language">hu</xsl:attribute>
- <xsl:attribute name="number:country">HU</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1129">
- <!-- Ibibio (Niger-Kordofanian) - Nigeria, #0469 -->
- <xsl:attribute name="number:language">nic</xsl:attribute>
- <xsl:attribute name="number:country">NG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1039">
- <!-- Icelandic, #040f -->
- <xsl:attribute name="number:language">is</xsl:attribute>
- <xsl:attribute name="number:country">IS</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1136">
- <!-- Igbo - Nigeria, #0470 -->
- <xsl:attribute name="number:language">ig</xsl:attribute>
- <xsl:attribute name="number:country">NG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1057">
- <!-- Indonesian, #0421 -->
- <xsl:attribute name="number:language">id</xsl:attribute>
- <xsl:attribute name="number:country">ID</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1117">
- <!-- Inuktitut - US, #045d -->
- <xsl:attribute name="number:language">iu</xsl:attribute>
- <xsl:attribute name="number:country">US</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1040">
- <!-- Italian - Italy, #0410 -->
- <xsl:attribute name="number:language">it</xsl:attribute>
- <xsl:attribute name="number:country">IT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2064">
- <!-- Italian - Switzerland, #0810 -->
- <xsl:attribute name="number:language">it</xsl:attribute>
- <xsl:attribute name="number:country">CH</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1041">
- <!-- Japanese, #0411 -->
- <xsl:attribute name="number:language">ja</xsl:attribute>
- <xsl:attribute name="number:country">JP</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1099">
- <!-- Kannada (India), #044b -->
- <xsl:attribute name="number:language">kn</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1137">
- <!-- Kanuri - Nigeria, #0471 -->
- <xsl:attribute name="number:language">kr</xsl:attribute>
- <xsl:attribute name="number:country">NG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2144">
- <!-- Kashmiri (India), #0860 -->
- <xsl:attribute name="number:language">ks</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1120">
- <!-- Kashmiri (Arabic), #0460 -->
- <xsl:attribute name="number:language">ks</xsl:attribute>
- <xsl:attribute name="number:country">PK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1087">
- <!-- Kazakh, #043f -->
- <xsl:attribute name="number:language">kk</xsl:attribute>
- <xsl:attribute name="number:country">KZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1107">
- <!-- Khmer (Cambodian), #0453 -->
- <xsl:attribute name="number:language">km</xsl:attribute>
- <xsl:attribute name="number:country">KH</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1111">
- <!-- Konkani (India), #0457 -->
- <xsl:attribute name="number:language">kok</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1042">
- <!-- Korean, #0412 -->
- <xsl:attribute name="number:language">ko</xsl:attribute>
- <xsl:attribute name="number:country">KR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1088">
- <!-- Kyrgyz ( Kirgiz / Cyrillic), #0440 -->
- <xsl:attribute name="number:language">ky</xsl:attribute>
- <xsl:attribute name="number:country">KG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1108">
- <!-- Lao, #0454 -->
- <xsl:attribute name="number:language">lo</xsl:attribute>
- <xsl:attribute name="number:country">LA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1142">
- <!-- Latin, #0476 -->
- <xsl:attribute name="number:language">la</xsl:attribute>
- <xsl:attribute name="number:country">IT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1062">
- <!-- Latvian, #0426 -->
- <xsl:attribute name="number:language">lv</xsl:attribute>
- <xsl:attribute name="number:country">LV</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1063">
- <!-- Lithuanian, #0427 -->
- <xsl:attribute name="number:language">lt</xsl:attribute>
- <xsl:attribute name="number:country">LT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1086">
- <!-- Malay - Malaysia, #043e -->
- <xsl:attribute name="number:language">ms</xsl:attribute>
- <xsl:attribute name="number:country">MY</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2110">
- <!-- Malay - Brunei Darussalam, #083e -->
- <xsl:attribute name="number:language">ms</xsl:attribute>
- <xsl:attribute name="number:country">BN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1071">
- <!-- Macedonian (FYROM), #042f -->
- <xsl:attribute name="number:language">mk</xsl:attribute>
- <xsl:attribute name="number:country">MK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1100">
- <!-- Malayalam (India), #044c -->
- <xsl:attribute name="number:language">ml</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1082">
- <!-- Maltese, #043a -->
- <xsl:attribute name="number:language">mt</xsl:attribute>
- <xsl:attribute name="number:country">MT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1112">
- <!-- Manipuri (India), #0458 -->
- <xsl:attribute name="number:language">mni</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1153">
- <!-- Maori - New Zealand, #0481 -->
- <xsl:attribute name="number:language">mi</xsl:attribute>
- <xsl:attribute name="number:country">NZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1102">
- <!-- Marathi (India), #044e -->
- <xsl:attribute name="number:language">mr</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1104">
- <!-- Mongolian (Cyrillic), #0450 -->
- <xsl:attribute name="number:language">mn</xsl:attribute>
- <xsl:attribute name="number:country">MN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2128">
- <!-- Mongolian (Mongolian), #0850 -->
- <xsl:attribute name="number:language">mn</xsl:attribute>
- <xsl:attribute name="number:country">CN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1121">
- <!-- Nepali, #0461 -->
- <xsl:attribute name="number:language">ne</xsl:attribute>
- <xsl:attribute name="number:country">NP</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2145">
- <!-- Nepali (India), #0861 -->
- <xsl:attribute name="number:language">ne</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1044">
- <!-- Norwegian (Bokmal), #0414 -->
- <xsl:attribute name="number:language">nb</xsl:attribute>
- <xsl:attribute name="number:country">NO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2068">
- <!-- Norwegian (Nynorsk), #0814 -->
- <xsl:attribute name="number:language">nn</xsl:attribute>
- <xsl:attribute name="number:country">NO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1096">
- <!-- Odia (India), #0448 -->
- <xsl:attribute name="number:language">or</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1138">
- <!-- Oromo (Ethiopia), #0472 -->
- <xsl:attribute name="number:language">om</xsl:attribute>
- <xsl:attribute name="number:country">ET</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1145">
- <!-- Papiamentu (Netherlands Antilles), #0479 -->
- <xsl:attribute name="number:language">pap</xsl:attribute>
- <xsl:attribute name="number:country">AN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1123">
- <!-- Pashto (Afghanistan), #0463 -->
- <xsl:attribute name="number:language">ps</xsl:attribute>
- <xsl:attribute name="number:country">AF</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1045">
- <!-- Polish, #0415 -->
- <xsl:attribute name="number:language">pl</xsl:attribute>
- <xsl:attribute name="number:country">PL</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1046">
- <!-- Portuguese - Brazil, #0416 -->
- <xsl:attribute name="number:language">pt</xsl:attribute>
- <xsl:attribute name="number:country">BR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2070">
- <!-- Portuguese - Portugal, #0816 -->
- <xsl:attribute name="number:language">pt</xsl:attribute>
- <xsl:attribute name="number:country">PT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1094">
- <!-- Punjabi, #0446 -->
- <xsl:attribute name="number:language">pa</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2118">
- <!-- Punjabi (Pakistan), #0846 -->
- <xsl:attribute name="number:language">pa</xsl:attribute>
- <xsl:attribute name="number:country">PK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1131">
- <!-- Quecha - Blivia, #046b -->
- <xsl:attribute name="number:language">qu</xsl:attribute>
- <xsl:attribute name="number:country">BO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2155">
- <!-- Quecha - Ecuador, #086b -->
- <xsl:attribute name="number:language">qu</xsl:attribute>
- <xsl:attribute name="number:country">EC</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 3179">
- <!-- Quecha - peru, #0c6b -->
- <xsl:attribute name="number:language">qu</xsl:attribute>
- <xsl:attribute name="number:country">PE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1047">
- <!-- Rhaeto-Romanic (Italy), #0417 -->
- <xsl:attribute name="number:language">rm</xsl:attribute>
- <xsl:attribute name="number:country">IT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1048">
- <!-- Romanian, #0418 -->
- <xsl:attribute name="number:language">ro</xsl:attribute>
- <xsl:attribute name="number:country">RO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2072">
- <!-- Romanian - Moldova, #0818 -->
- <xsl:attribute name="number:language">ro</xsl:attribute>
- <xsl:attribute name="number:country">MD</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1049">
- <!-- Russian, #0419 -->
- <xsl:attribute name="number:language">ru</xsl:attribute>
- <xsl:attribute name="number:country">RU</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2073">
- <!-- Russian - Moldova, #0819 -->
- <xsl:attribute name="number:language">ru</xsl:attribute>
- <xsl:attribute name="number:country">MD</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1083">
- <!-- Sami (Lappish), # (Northern Sami - Sweden), #043b -->
- <xsl:attribute name="number:language">se</xsl:attribute>
- <xsl:attribute name="number:country">SE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1103">
- <!-- Sanskrit (India), #044f -->
- <xsl:attribute name="number:language">sa</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1132">
- <!-- Sepedi (Northern Sotho - South Africa), #046c -->
- <xsl:attribute name="number:language">nso</xsl:attribute>
- <xsl:attribute name="number:country">ZA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 3098">
- <!-- Serbian (Cyrillic - Serbia Yugoslavia), #0c1a -->
- <xsl:attribute name="number:language">sr</xsl:attribute>
- <xsl:attribute name="number:country">YU</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2074">
- <!-- Serbian (Latin - Croatia), #081a -->
- <xsl:attribute name="number:language">sr</xsl:attribute>
- <xsl:attribute name="number:country">HR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1113">
- <!-- Sindhi - India,#0459 -->
- <xsl:attribute name="number:language">sd</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2137">
- <!-- Sindhi - Pakistan, #0859 -->
- <xsl:attribute name="number:language">sd</xsl:attribute>
- <xsl:attribute name="number:country">PK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1115">
- <!-- Sinhalese - Sri Lanka, #045b -->
- <xsl:attribute name="number:language">si</xsl:attribute>
- <xsl:attribute name="number:country">LK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1051">
- <!-- Slovak, #041b -->
- <xsl:attribute name="number:language">sk</xsl:attribute>
- <xsl:attribute name="number:country">SK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1060">
- <!-- Slovenian, #0424 -->
- <xsl:attribute name="number:language">sl</xsl:attribute>
- <xsl:attribute name="number:country">SI</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1143">
- <!-- Somali, #0477 -->
- <xsl:attribute name="number:language">so</xsl:attribute>
- <xsl:attribute name="number:country">SO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1070">
- <!-- Sorbian, #042e -->
- <xsl:attribute name="number:language">wen</xsl:attribute>
- <xsl:attribute name="number:country">DE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 3082">
- <!-- Spanish - Spain (Modern/International Sort), #0c0a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">ES</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1034">
- <!-- Spanish - Spain (Traditional Sort), #040a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">ES</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 11274">
- <!-- Spanish - Argentina, #2c0a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">AR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 16394">
- <!-- Spanish - Bolivia, #400a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">BO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 13322">
- <!-- Spanish - Chile, #340a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">CL</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 9226">
- <!-- Spanish - Colombia, #240a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">CO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 5130">
- <!-- Spanish - Costa Rica, #140a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">CR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 7178">
- <!-- Spanish - Dominican Republic, #1c0a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">DO</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 12298">
- <!-- Spanish - Ecuador, #300a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">EC</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 17418">
- <!-- Spanish - EL Salvador, #440a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">SV</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 4106">
- <!-- Spanish - Guatemala, #100a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">GT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 18442">
- <!-- Spanish - Honduras, #480a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">HN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 58378">
- <!-- Spanish - Latin America (Argentina), #e40a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">AR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2058">
- <!-- Spanish - Mexico, #080a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">MX</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 19466">
- <!-- Spanish - Nicaragua, #4c0a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">NI</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 6154">
- <!-- Spanish - Panama, #180a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">PA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 15370">
- <!-- Spanish - Paraguay, #3c0a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">PY</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 10250">
- <!-- Spanish - Peru, #280a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">PE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 20490">
- <!-- Spanish - Puerto Rico, #500a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">PR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 21514">
- <!-- Spanish - US, #540a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">US</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 14346">
- <!-- Spanish - Uruguay, #380a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">UY</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 8202">
- <!-- Spanish - Venezuela, #200a -->
- <xsl:attribute name="number:language">es</xsl:attribute>
- <xsl:attribute name="number:country">VE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1072">
- <!-- Sutu (Ngoni - Tanzania), #0430 -->
- <xsl:attribute name="number:language">bnt</xsl:attribute>
- <xsl:attribute name="number:country">TZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1089">
- <!-- Swahili (Tanzania), #0441 -->
- <xsl:attribute name="number:language">sw</xsl:attribute>
- <xsl:attribute name="number:country">TZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1053">
- <!-- Swedish (Sweden), #041d -->
- <xsl:attribute name="number:language">sv</xsl:attribute>
- <xsl:attribute name="number:country">SE</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2077">
- <!-- Swedish - Finland, #081d -->
- <xsl:attribute name="number:language">sv</xsl:attribute>
- <xsl:attribute name="number:country">FI</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1114">
- <!-- Syriac (Syria), #045a -->
- <xsl:attribute name="number:language">syr</xsl:attribute>
- <xsl:attribute name="number:country">SY</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1064">
- <!-- Tajik, #0428 -->
- <xsl:attribute name="number:language">tg</xsl:attribute>
- <xsl:attribute name="number:country">TJ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1119">
- <!-- Tamazight (Arabic), #045f -->
- <xsl:attribute name="number:language">ber</xsl:attribute>
- <xsl:attribute name="number:country">ML</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2143">
- <!-- Tamazight (Latin), #085f -->
- <xsl:attribute name="number:language">ber</xsl:attribute>
- <xsl:attribute name="number:country">MA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1097">
- <!-- Tamil (India), #0449 -->
- <xsl:attribute name="number:language">ta</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1092">
- <!-- Tatar (Russia), #0444 -->
- <xsl:attribute name="number:language">tt</xsl:attribute>
- <xsl:attribute name="number:country">RU</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1098">
- <!-- Telugu (India), #044a -->
- <xsl:attribute name="number:language">te</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1054">
- <!-- Thai, #041e -->
- <xsl:attribute name="number:language">th</xsl:attribute>
- <xsl:attribute name="number:country">TH</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2129">
- <!-- Tibetan - Bhutan, #0851 -->
- <xsl:attribute name="number:language">bo</xsl:attribute>
- <xsl:attribute name="number:country">BT</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1105">
- <!-- Tibetan - Peoples' Republic of China, #0451 -->
- <xsl:attribute name="number:language">bo</xsl:attribute>
- <xsl:attribute name="number:country">CN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2163">
- <!-- Tigrigna (Tigrinya) - Eritrea, #0873 -->
- <xsl:attribute name="number:language">ti</xsl:attribute>
- <xsl:attribute name="number:country">ER</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1139">
- <!-- Tigrigna (Tigrinya) - Ethiopia, #0473 -->
- <xsl:attribute name="number:language">ti</xsl:attribute>
- <xsl:attribute name="number:country">ET</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1073">
- <!-- Tsonga (South Africa), #0431 -->
- <xsl:attribute name="number:language">ts</xsl:attribute>
- <xsl:attribute name="number:country">ZA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1074">
- <!-- Tswana (South Africa), #0432 -->
- <xsl:attribute name="number:language">tn</xsl:attribute>
- <xsl:attribute name="number:country">ZA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1055">
- <!-- Turkish, #041f -->
- <xsl:attribute name="number:language">tr</xsl:attribute>
- <xsl:attribute name="number:country">TR</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1090">
- <!-- Turkmen, #0442 -->
- <xsl:attribute name="number:language">tk</xsl:attribute>
- <xsl:attribute name="number:country">TM</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1152">
- <!-- Uighur - China, #0480 -->
- <xsl:attribute name="number:language">ug</xsl:attribute>
- <xsl:attribute name="number:country">CN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1058">
- <!-- Ukrainian, #0422 -->
- <xsl:attribute name="number:language">uk</xsl:attribute>
- <xsl:attribute name="number:country">UA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1056">
- <!-- Urdu (Pakistan), #0420 -->
- <xsl:attribute name="number:language">ur</xsl:attribute>
- <xsl:attribute name="number:country">PK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2080">
- <!-- Urdu - India, #0820 -->
- <xsl:attribute name="number:language">ur</xsl:attribute>
- <xsl:attribute name="number:country">IN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 2115">
- <!-- Uzbek (Cyrillic), #0843 -->
- <xsl:attribute name="number:language">uz</xsl:attribute>
- <xsl:attribute name="number:country">UZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1091">
- <!-- Uzbek (Latin), #0443 -->
- <xsl:attribute name="number:language">uz</xsl:attribute>
- <xsl:attribute name="number:country">UZ</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1075">
- <!-- Venda (South Africa), #0433 -->
- <xsl:attribute name="number:language">ve</xsl:attribute>
- <xsl:attribute name="number:country">ZA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1066">
- <!-- Vietnamese, #042a -->
- <xsl:attribute name="number:language">vi</xsl:attribute>
- <xsl:attribute name="number:country">VN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1106">
- <!-- Welsh (UK), #0452 -->
- <xsl:attribute name="number:language">cy</xsl:attribute>
- <xsl:attribute name="number:country">UK</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1076">
- <!-- Xhosa (South Africa), #0434 -->
- <xsl:attribute name="number:language">xh</xsl:attribute>
- <xsl:attribute name="number:country">ZA</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1144">
- <!-- Yi (Sino-Tibetan - China), #0478 -->
- <xsl:attribute name="number:language">sit</xsl:attribute>
- <xsl:attribute name="number:country">CN</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1085">
- <!-- Yiddish (Jews - Israel), #043d -->
- <xsl:attribute name="number:language">yi</xsl:attribute>
- <xsl:attribute name="number:country">IL</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1130">
- <!-- Yoruba (Nigeria), #046a -->
- <xsl:attribute name="number:language">yo</xsl:attribute>
- <xsl:attribute name="number:country">NG</xsl:attribute>
- </xsl:when>
- <xsl:when test="$language-country-code = 1077">
- <!-- Zulu (South Africa), #0435 -->
- <xsl:attribute name="number:language">zu</xsl:attribute>
- <xsl:attribute name="number:country">ZA</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-number-format-condition">
- <xsl:param name="number-format-unit"/>
- <xsl:choose>
- <xsl:when test="contains($number-format-unit, '[&gt;')">
- <xsl:value-of select="concat('&gt;', substring-before( substring-after($number-format-unit,'[&gt;'), ']'))"/>
- </xsl:when>
- <xsl:when test="contains($number-format-unit, '[&lt;')">
- <xsl:value-of select="concat('&lt;', substring-before( substring-after($number-format-unit,'[&lt;'), ']'))"/>
- </xsl:when>
- <xsl:when test="contains($number-format-unit, '[=')">
- <xsl:value-of select="concat('=', substring-before( substring-after($number-format-unit,'[='), ']'))"/>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="add-number-text-value">
- <xsl:param name="style-type-name"/>
- <xsl:param name="number-format-unit"/>
- <xsl:param name="unit-pos"/>
- <xsl:param name="condition-pos"/>
- <xsl:param name="isNumberTextElementOpened" select="false()"/>
- <xsl:param name="numberTextValue"/>
- <xsl:param name="posed-number-format-unit"/>
- <xsl:param name="finished" select="false()"/>
- <xsl:choose>
- <xsl:when test="not($finished)">
- <xsl:choose>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('is-true-formula(',$address-value,')')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- Used in case of 'style:map', conditional formatting, where a style references to another -->
+ <xsl:key match="/ss:Workbook/ss:Worksheet/ss:Table/ss:Row/ss:Cell" name="cells" use="@ss:StyleID"/>
+ <xsl:template match="ss:NumberFormat">
+ <xsl:variable name="unit-count" select="string-length(@ss:Format) - string-length(translate(@ss:Format,';','')) + 1"/>
+ <xsl:variable name="proto-style-id" select="../@ss:ID"/>
+ <xsl:call-template name="process-number-format-unit">
+ <xsl:with-param name="number-format-unit" select="@ss:Format"/>
+ <xsl:with-param name="style-id" select="concat($proto-style-id,'F')"/>
+ <xsl:with-param name="format-type" select="key('cells', $proto-style-id)/ss:Data/@ss:Type"/>
+ <xsl:with-param name="total-unit" select="$unit-count"/>
+ <xsl:with-param name="current-unit" select="0"/>
+ </xsl:call-template>
+ </xsl:template>
+ <!-- Note: conditions appearing only once at the beginning are mixed with others -->
+ <xsl:template name="process-number-format-unit">
+ <xsl:param name="number-format-unit"/>
+ <xsl:param name="style-id"/>
+ <xsl:param name="format-type"/>
+ <xsl:param name="total-unit"/>
+ <xsl:param name="current-unit"/>
+ <xsl:choose>
+ <!-- if total-unit > 1 and the last unit is just @, delete it -->
+ <xsl:when test="$current-unit = 0 and $total-unit &gt; 1 and substring( $number-format-unit, string-length($number-format-unit) - 1) = ';@'">
+ <xsl:call-template name="process-number-format-unit">
+ <xsl:with-param name="number-format-unit" select="substring( $number-format-unit, 1, string-length($number-format-unit) - 2)"/>
+ <xsl:with-param name="style-id" select="$style-id"/>
+ <xsl:with-param name="format-type" select="$format-type"/>
+ <xsl:with-param name="total-unit" select="$total-unit - 1"/>
+ <xsl:with-param name="current-unit" select="0"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- $number-format-unit enum values: General, General Number, General Date, Long Date, Medium Date, Short Date, Long Time,
+ Medium Time, Short Time, Currency, Euro Currency, Fixed, Standard, Percent, Scientific, Yes/No, True/False, On/Off -->
+ <xsl:when test="$number-format-unit = 'Currency'">
+ <number:currency-style style:name="{concat( $style-id, 'P1')}" style:volatile="true">
+ <number:text>$</number:text>
+ <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
+ </number:currency-style>
+ <number:currency-style style:name="{$style-id}">
+ <style:text-properties fo:color="#ff0000"/>
+ <number:text>$-</number:text>
+ <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
+ <style:map style:condition="value()&gt;=0" style:apply-style-name="{concat( $style-id, 'P1')}"/>
+ </number:currency-style>
+ </xsl:when>
+ <xsl:when test="$number-format-unit = 'Euro Currency'">
+ <number:currency-style style:name="{concat( $style-id, 'P1')}" style:volatile="true">
+ <number:text>€ </number:text>
+ <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
+ </number:currency-style>
+ <number:currency-style style:name="{$style-id}">
+ <style:text-properties fo:color="#ff0000"/>
+ <number:text>(€ </number:text>
+ <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
+ <number:text>)</number:text>
+ <style:map style:condition="value()&gt;=0" style:apply-style-name="{concat( $style-id, 'P1')}"/>
+ </number:currency-style>
+ </xsl:when>
+ <xsl:when test="$number-format-unit = 'Yes/No' or $number-format-unit = 'True/False' or $number-format-unit = 'On/Off'">
+ <xsl:variable name="left-code" select="substring-before( $number-format-unit, '/')"/>
+ <xsl:variable name="right-code" select="substring-after( $number-format-unit, '/')"/>
+ <number:number-style style:name="{concat( $style-id, 'P1')}" style:volatile="true">
+ <number:text>
+ <xsl:value-of select="$left-code"/>
+ </number:text>
+ </number:number-style>
+ <number:number-style style:name="{concat( $style-id, 'P2')}" style:volatile="true">
+ <number:text>
+ <xsl:value-of select="$left-code"/>
+ </number:text>
+ </number:number-style>
+ <number:number-style style:name="{$style-id}">
+ <number:text>
+ <xsl:value-of select="$right-code"/>
+ </number:text>
+ <style:map style:condition="value()&gt;0" style:apply-style-name="{concat( $style-id, 'P1')}"/>
+ <style:map style:condition="value()&lt;0" style:apply-style-name="{concat( $style-id, 'P2')}"/>
+ </number:number-style>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$total-unit &gt; 1 and $current-unit = 0">
+ <!-- still complete number format string of multiple sub-formats, split them out -->
+ <xsl:call-template name="process-number-format-unit">
+ <xsl:with-param name="number-format-unit" select="substring-before($number-format-unit,';')"/>
+ <xsl:with-param name="style-id" select="concat($style-id,'P1')"/>
+ <xsl:with-param name="format-type" select="$format-type"/>
+ <xsl:with-param name="total-unit" select="$total-unit"/>
+ <xsl:with-param name="current-unit" select="1"/>
+ </xsl:call-template>
+ <xsl:if test="$total-unit &gt; 2">
+ <xsl:call-template name="process-number-format-unit">
+ <xsl:with-param name="number-format-unit" select="substring-before(substring-after($number-format-unit,';'),';')"/>
+ <xsl:with-param name="style-id" select="concat($style-id,'P2')"/>
+ <xsl:with-param name="format-type" select="$format-type"/>
+ <xsl:with-param name="total-unit" select="$total-unit"/>
+ <xsl:with-param name="current-unit" select="2"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$total-unit &gt; 3">
+ <!-- four sub number format -->
+ <xsl:call-template name="process-number-format-unit">
+ <xsl:with-param name="number-format-unit" select="substring-before(substring-after(substring-after($number-format-unit,';'),';'),';')"/>
+ <xsl:with-param name="style-id" select="concat($style-id,'P3')"/>
+ <xsl:with-param name="format-type" select="$format-type"/>
+ <xsl:with-param name="total-unit" select="$total-unit"/>
+ <xsl:with-param name="current-unit" select="3"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ <!-- symbol number format converted, below deal with ordinary number formatting -->
+ <xsl:variable name="current-number-format-unit">
+ <xsl:choose>
+ <xsl:when test="$total-unit = 1 and $current-unit = 0">
+ <xsl:value-of select="$number-format-unit"/>
+ </xsl:when>
+ <xsl:when test="$total-unit = 2 and $current-unit = 0">
+ <xsl:value-of select="substring-after($number-format-unit,';')"/>
+ </xsl:when>
+ <xsl:when test="$total-unit = 3 and $current-unit = 0">
+ <xsl:value-of select="substring-after(substring-after($number-format-unit,';'),';')"/>
+ </xsl:when>
+ <xsl:when test="$current-unit = 0">
+ <!-- the forth sub number format -->
+ <xsl:value-of select="substring-after(substring-after(substring-after($number-format-unit,';'),';'),';')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- not the default sub number format, glu -->
+ <xsl:value-of select="$number-format-unit"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="style-type-name">
+ <xsl:choose>
+ <xsl:when test="($format-type = 'Number' and contains($current-number-format-unit,'[$') and not(contains($current-number-format-unit,'[$-') ) ) or contains($current-number-format-unit,'Currency') ">number:currency-style</xsl:when>
+ <xsl:when test="($format-type = 'Number' and (contains($current-number-format-unit,'%') or contains($current-number-format-unit, 'Percent') ) ) or contains($current-number-format-unit,'Percent') ">number:percentage-style</xsl:when>
+ <xsl:when test="($format-type = 'DateTime' or $format-type = 'String') and (contains($current-number-format-unit,'y') or contains($current-number-format-unit,'g') or contains($current-number-format-unit,'d') or contains($current-number-format-unit, 'Date') )">number:date-style</xsl:when>
+ <xsl:when test="($format-type = 'DateTime' or $format-type = 'String') and ( contains($current-number-format-unit,'h') or contains($current-number-format-unit,'m') or contains($current-number-format-unit,'s') or contains($current-number-format-unit, 'Time') )">number:time-style</xsl:when>
+ <xsl:when test="contains($current-number-format-unit, 'Number') or contains($current-number-format-unit, 'General') or contains($current-number-format-unit, 'Fixed') or contains($current-number-format-unit, 'Standard') or contains($current-number-format-unit, 'Scientific') or ( contains($current-number-format-unit,'#') or contains($current-number-format-unit,'0') or contains($current-number-format-unit,'?') )">number:number-style</xsl:when>
+ <xsl:when test="$format-type = 'Boolean'">number:boolean-style</xsl:when>
+ <xsl:otherwise>number:text-style</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="{$style-type-name}">
+ <xsl:attribute name="style:name">
+ <xsl:value-of select="$style-id"/>
+ </xsl:attribute>
+ <xsl:apply-templates select="@ss:Name" />
+ <!-- removed in OASIS XML
+ <xsl:attribute name="style:family">data-style</xsl:attribute>-->
+ <xsl:if test="$current-unit &gt; 0">
+ <xsl:attribute name="style:volatile">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="contains ( $current-number-format-unit, '[h]') or contains ( $current-number-format-unit, '[m]') or contains ( $current-number-format-unit, '[s]')">
+ <xsl:attribute name="number:truncate-on-overflow">false</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="contains($current-number-format-unit,'[$') or contains($current-number-format-unit, '[DBNum')">
+ <xsl:call-template name="create-language-country-attribute">
+ <xsl:with-param name="attribute-code" select="substring-before(substring-after(substring-after($current-number-format-unit,'[$'),'-'),']')"/>
+ <xsl:with-param name="number-code-style" select="substring-before( substring-after($current-number-format-unit,'[DBNum'),']')"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="contains( $current-number-format-unit, '[')">
+ <xsl:element name="style:text-properties">
+ <xsl:choose>
+ <xsl:when test="contains( $current-number-format-unit, '[Red')">
+ <xsl:attribute name="fo:color">#ff0000</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains( $current-number-format-unit, '[Black')">
+ <xsl:attribute name="fo:color">#000000</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains( $current-number-format-unit, '[Blue')">
+ <xsl:attribute name="fo:color">#0000ff</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains( $current-number-format-unit, '[Cyan')">
+ <xsl:attribute name="fo:color">#00ffff</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains( $current-number-format-unit, '[Green')">
+ <xsl:attribute name="fo:color">#00ff00</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains( $current-number-format-unit, '[Magenta')">
+ <xsl:attribute name="fo:color">#ff00ff</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains( $current-number-format-unit, '[White')">
+ <xsl:attribute name="fo:color">#ffffff</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains( $current-number-format-unit, '[Yellow')">
+ <xsl:attribute name="fo:color">#ffff00</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <!-- the type of condition-pos:1,the former third part of General; 2, the last General. the methods handling different -->
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$current-number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="1"/>
+ <xsl:with-param name="condition-pos">
+ <xsl:choose>
+ <xsl:when test="$current-unit = 1 or $current-unit = 2 or $current-unit = 3">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:when test="$current-unit = 0 and not(contains($number-format-unit, ';'))">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ <!-- create style:map for other sub number formats -->
+ <xsl:if test="$current-unit = 0 and $total-unit &gt; 1">
+ <xsl:variable name="style-condition1">
+ <xsl:call-template name="get-number-format-condition">
+ <xsl:with-param name="number-format-unit" select="substring-before($number-format-unit,';')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($style-condition1) &gt; 0">
+ <style:map style:condition="{concat('value()',$style-condition1)}" style:apply-style-name="{concat($style-id,'P1')}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$total-unit = 2">
+ <style:map style:condition="value()&gt;=0" style:apply-style-name="{concat($style-id,'P1')}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <style:map style:condition="value()&gt;0" style:apply-style-name="{concat($style-id,'P1')}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="$total-unit &gt; 2">
+ <xsl:variable name="style-condition2">
+ <xsl:call-template name="get-number-format-condition">
+ <xsl:with-param name="number-format-unit" select="substring-before(substring-after($number-format-unit,';'),';')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($style-condition2) &gt; 0">
+ <style:map style:condition="{concat('value()',$style-condition2)}" style:apply-style-name="{concat($style-id,'P2')}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <style:map style:condition="value()&lt;0" style:apply-style-name="{concat($style-id,'P2')}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="$total-unit &gt; 3">
+ <!-- four sub number formats, glu -->
+ <xsl:variable name="style-condition3">
+ <xsl:call-template name="get-number-format-condition">
+ <xsl:with-param name="number-format-unit" select="substring-before(substring-after(substring-after($number-format-unit,';'),';'),';')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($style-condition3) &gt; 0">
+ <style:map style:condition="{concat('value()',$style-condition3)}" style:apply-style-name="{concat($style-id,'P3')}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <style:map style:condition="value()=0" style:apply-style-name="{concat($style-id,'P3')}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:if>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="create-language-country-attribute">
+ <xsl:param name="attribute-code"/>
+ <xsl:param name="number-code-style"/>
+ <!-- convert Microsoft List of Locale ID (LCID) to language and country codes according to ISO-639 and ISO-3166.
+ Reference:
+ http://www.loc.gov/standards/iso639-2/langcodes.html
+ http://etext.lib.virginia.edu/tei/iso639.html
+ http://nl.ijs.si/gnusl/cee/std/ISO_3166.html
+ http://xml.coverpages.org/ripe3166.txt
+ http://www.worldlanguage.com/
+ http://www.ethnologue.com/
+ glu -->
+ <!-- the variables of language-country-code and number-shape-code transformed to decimal format -->
+ <xsl:variable name="language-country-code">
+ <xsl:variable name="temp-code">
+ <xsl:choose>
+ <xsl:when test="string-length($attribute-code) &lt;= 4">
+ <xsl:value-of select="$attribute-code"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring($attribute-code,string-length($attribute-code) - 3)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="$temp-code"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="string-length($temp-code)"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="string-length($attribute-code) &gt; 4 or string-length($number-code-style) &gt; 0">
+ <xsl:variable name="number-shape-code">
+ <xsl:variable name="temp-code">
+ <xsl:choose>
+ <xsl:when test="string-length($attribute-code) &gt; 4">
+ <xsl:value-of select="substring($attribute-code, 1, string-length($attribute-code) - 6)"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="$temp-code"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="string-length($temp-code)"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
+ <xsl:choose>
+ <!-- Western, #01 -->
+ <xsl:when test="$number-shape-code = 1"/>
+ <!-- Arabic Indic, #02 -->
+ <xsl:when test="$number-shape-code = 2"/>
+ <!-- Extended Arabic Indic, #03 -->
+ <xsl:when test="$number-shape-code = 3"/>
+ <!-- Devanagari (Sanskrit - India), #04-->
+ <xsl:when test="$number-shape-code = 4">
+ <xsl:attribute name="number:transliteration-language">sa</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
+ </xsl:when>
+ <!-- Bengali (India), #05 -->
+ <xsl:when test="$number-shape-code = 5">
+ <xsl:attribute name="number:transliteration-language">bn</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
+ </xsl:when>
+ <!-- Gurmukhi (Punjabi - India), #06 -->
+ <xsl:when test="$number-shape-code = 6">
+ <xsl:attribute name="number:transliteration-language">pa</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
+ </xsl:when>
+ <!-- Gujarati (India), #07 -->
+ <xsl:when test="$number-shape-code = 7">
+ <xsl:attribute name="number:transliteration-language">gu</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
+ </xsl:when>
+ <!-- Odia (India), #08 -->
+ <xsl:when test="$number-shape-code = 8">
+ <xsl:attribute name="number:transliteration-language">or</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
+ </xsl:when>
+ <!-- Tamil (India), #09 -->
+ <xsl:when test="$number-shape-code = 9">
+ <xsl:attribute name="number:transliteration-language">ta</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
+ </xsl:when>
+ <!-- Telugu (India), #0a -->
+ <xsl:when test="$number-shape-code = 10">
+ <xsl:attribute name="number:transliteration-language">te</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
+ </xsl:when>
+ <!-- Kannada (India), #0b -->
+ <xsl:when test="$number-shape-code = 11">
+ <xsl:attribute name="number:transliteration-language">kn</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
+ </xsl:when>
+ <!-- Malayalam (India), #0c -->
+ <xsl:when test="$number-shape-code = 12">
+ <xsl:attribute name="number:transliteration-language">ml</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">IN</xsl:attribute>
+ </xsl:when>
+ <!-- Thai, #0d -->
+ <xsl:when test="$number-shape-code = 13">
+ <xsl:attribute name="number:transliteration-language">th</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">TH</xsl:attribute>
+ </xsl:when>
+ <!-- Lao, #0e -->
+ <xsl:when test="$number-shape-code = 14">
+ <xsl:attribute name="number:transliteration-language">lo</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">LA</xsl:attribute>
+ </xsl:when>
+ <!-- Tibetan (China), #0f -->
+ <xsl:when test="$number-shape-code = 15">
+ <xsl:attribute name="number:transliteration-language">bo</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
+ </xsl:when>
+ <!-- Myanmar (Burma), #10 -->
+ <xsl:when test="$number-shape-code = 16">
+ <xsl:attribute name="number:transliteration-language">my</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">MM</xsl:attribute>
+ </xsl:when>
+ <!-- Ethiopic (Geez), #11 -->
+ <xsl:when test="$number-shape-code = 17">
+ <xsl:attribute name="number:transliteration-language">gez</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">ET</xsl:attribute>
+ </xsl:when>
+ <!-- Khmer (Cambodian), #12-->
+ <xsl:when test="$number-shape-code = 18">
+ <xsl:attribute name="number:transliteration-language">km</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">KH</xsl:attribute>
+ </xsl:when>
+ <!-- Mongolian, #13 -->
+ <xsl:when test="$number-shape-code = 19">
+ <xsl:attribute name="number:transliteration-language">mn</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
+ </xsl:when>
+ <!-- Japanese 1 ([DBNum1]) , #1b, #0411 -->
+ <xsl:when test="$number-shape-code = 27 or ($number-code-style = '1' and $language-country-code = 1041)">
+ <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">ja</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">JP</xsl:attribute>
+ </xsl:when>
+ <!-- Japanese 2 ([DBNum2]) ,#1c, #0411 -->
+ <xsl:when test="$number-shape-code = 28 or ($number-code-style = '2' and $language-country-code = 1041 )">
+ <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">ja</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">JP</xsl:attribute>
+ </xsl:when>
+ <!-- Japanese 3 ([DBNum3]), #1d, #0411 -->
+ <xsl:when test="$number-shape-code = 29 or ($number-code-style = '3' and $language-country-code = 1041 )">
+ <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">ja</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">JP</xsl:attribute>
+ </xsl:when>
+ <!-- Simplified Chinese 1 ([DBNum1]), #1e, #0804 -->
+ <xsl:when test="$number-shape-code = 30 or ($number-code-style = '1' and $language-country-code = 2052 )">
+ <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
+ </xsl:when>
+ <!-- Simplified Chinese 2 ([DBNum2]),#1f,#0804 -->
+ <xsl:when test="$number-shape-code = 31 or ($number-code-style = '2' and $language-country-code = 2052 )">
+ <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
+ </xsl:when>
+ <!-- Simplified Chinese 3 ([DBNum3]), #20,#0804 -->
+ <xsl:when test="$number-shape-code = 32 or ($number-code-style = '3' and $language-country-code = 2052 )">
+ <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
+ </xsl:when>
+ <!-- Traditional Chinese 1 ([DBNum1]), #21, #0404 -->
+ <xsl:when test="$number-shape-code = 33 or ($number-code-style = '1' and $language-country-code = 1028 )">
+ <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">TW</xsl:attribute>
+ </xsl:when>
+ <!-- Traditional Chinese 2 ([DBNum2]), #22, #0404 -->
+ <xsl:when test="$number-shape-code = 34 or ($number-code-style = '2' and $language-country-code = 1028 )">
+ <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">TW</xsl:attribute>
+ </xsl:when>
+ <!-- Traditional Chinese 3 ([DBNum3]),#23, #0404 -->
+ <xsl:when test="$number-shape-code = 35 or ($number-code-style = '3' and $language-country-code = 1028 )">
+ <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">TW</xsl:attribute>
+ </xsl:when>
+ <!-- Korean 1 ([DBNum1]), #24, #0412 -->
+ <xsl:when test="$number-shape-code = 36 or ($number-code-style = '1' and $language-country-code = 1042 )">
+ <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">ko</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">KR</xsl:attribute>
+ </xsl:when>
+ <!-- Korean 2 ([DBNum2]), #25, #0412 -->
+ <xsl:when test="$number-shape-code = 37 or ($number-code-style = '2' and $language-country-code = 1042 )">
+ <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">ko</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">KR</xsl:attribute>
+ </xsl:when>
+ <!-- Korean 3 ([DBNum3]), #26, #0412 -->
+ <xsl:when test="$number-shape-code = 38 or ($number-code-style = '3' and $language-country-code = 1042 )">
+ <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">ko</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">KR</xsl:attribute>
+ </xsl:when>
+ <!-- Korean 4 ([DBNum4]), #27, #0412 -->
+ <xsl:when test="$number-shape-code = 39 or ($number-code-style = '4' and $language-country-code = 1042 )">
+ <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
+ <xsl:attribute name="number:transliteration-language">ko</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">KR</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <!-- components of a format code: two digits for number shape codes, two for calendar types, four for LCID -->
+ <xsl:choose>
+ <!-- totally 223 language-country LCID codes, manually created, among which MS Office 2003 supports 134, OOo supports 91 -->
+ <xsl:when test="$language-country-code = 1078">
+ <!-- Afrikaans - South Africa, #0436 -->
+ <xsl:attribute name="number:language">af</xsl:attribute>
+ <xsl:attribute name="number:country">ZA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1052">
+ <!-- Albanian - Albania, #041c -->
+ <xsl:attribute name="number:language">sq</xsl:attribute>
+ <xsl:attribute name="number:country">AL</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1118">
+ <!-- Amharic - Ethiopia, #045e -->
+ <xsl:attribute name="number:language">am</xsl:attribute>
+ <xsl:attribute name="number:country">ET</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1025">
+ <!-- Arabic - Saudi Arabia, #0401 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">SA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 5121">
+ <!-- Arabic - Algeria, #1401 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">DZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 15361">
+ <!-- Arabic - Bahrain, #3c01 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">BH</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 3073">
+ <!-- Arabic - Egypt, #0c01 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">EG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2049">
+ <!-- Arabic - Iraq, #0801 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">IQ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 11265">
+ <!-- Arabic - Jordan, #2c01 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">JO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 13313">
+ <!-- Arabic - Kuwait, #3401 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">KW</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 12289">
+ <!-- Arabic - Lebanon, #3001 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">LB</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 4097">
+ <!-- Arabic - Libya, #1001 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">LY</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 6145">
+ <!-- Arabic - Morocco, #1801 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">MA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 8193">
+ <!-- Arabic - Oman, #2001 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">OM</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 16385">
+ <!-- Arabic - Qatar, #4001 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">QA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 10241">
+ <!-- Arabic - Syria, #2801 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">SY</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 7169">
+ <!-- Arabic - Tunisia, #1c01 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">TN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 14337">
+ <!-- Arabic - U.A.E., #3801 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">AE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 9217">
+ <!-- Arabic - Yemen, #2401 -->
+ <xsl:attribute name="number:language">ar</xsl:attribute>
+ <xsl:attribute name="number:country">YE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1067">
+ <!-- Armenian - Armenia, #042b -->
+ <xsl:attribute name="number:language">hy</xsl:attribute>
+ <xsl:attribute name="number:country">AM</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1101">
+ <!-- Assamese, #044d -->
+ <xsl:attribute name="number:language">as</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2092">
+ <!-- Azeri - Cyrillic, #082c -->
+ <xsl:attribute name="number:language">az</xsl:attribute>
+ <xsl:attribute name="number:country">AZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1068">
+ <!-- Azeri - Latin, #042c -->
+ <xsl:attribute name="number:language">az</xsl:attribute>
+ <xsl:attribute name="number:country">AZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1069">
+ <!-- Basque - France/Spain, #042d -->
+ <xsl:attribute name="number:language">eu</xsl:attribute>
+ <xsl:attribute name="number:country">ES</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1059">
+ <!-- Belarusian - Belarus, #0423 -->
+ <xsl:attribute name="number:language">be</xsl:attribute>
+ <xsl:attribute name="number:country">BY</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1093">
+ <!-- Bengali (India), #0445 -->
+ <xsl:attribute name="number:language">bn</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2117">
+ <!-- Bengali (Bangladesh), #0845 -->
+ <xsl:attribute name="number:language">bn</xsl:attribute>
+ <xsl:attribute name="number:country">BD</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 5146">
+ <!-- Bosnian (Bosnia/Herzegovina), #141a -->
+ <xsl:attribute name="number:language">bs</xsl:attribute>
+ <xsl:attribute name="number:country">BA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1026">
+ <!-- Bulgarian, #0402 -->
+ <xsl:attribute name="number:language">bg</xsl:attribute>
+ <xsl:attribute name="number:country">BG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1109">
+ <!-- Burmese (Burma/Myanmar), #0455 -->
+ <xsl:attribute name="number:language">my</xsl:attribute>
+ <xsl:attribute name="number:country">MM</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1027">
+ <!-- Catalan - Spain, #0403 -->
+ <xsl:attribute name="number:language">ca</xsl:attribute>
+ <xsl:attribute name="number:country">ES</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1116">
+ <!-- Cherokee - United States, #045c -->
+ <xsl:attribute name="number:language">chr</xsl:attribute>
+ <xsl:attribute name="number:country">US</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2052">
+ <!-- Chinese - People's Republic of China, #0804 -->
+ <xsl:attribute name="number:language">zh</xsl:attribute>
+ <xsl:attribute name="number:country">CN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 4100">
+ <!-- Chinese - Singapore, #1004 -->
+ <xsl:attribute name="number:language">zh</xsl:attribute>
+ <xsl:attribute name="number:country">SG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1028">
+ <!-- Chinese - Taiwan, #0404 -->
+ <xsl:attribute name="number:language">zh</xsl:attribute>
+ <xsl:attribute name="number:country">TW</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 3076">
+ <!-- Chinese - Hong Kong SAR, #0c04 -->
+ <xsl:attribute name="number:language">zh</xsl:attribute>
+ <xsl:attribute name="number:country">HK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 5124">
+ <!-- Chinese - Macao SAR, #1404 -->
+ <xsl:attribute name="number:language">zh</xsl:attribute>
+ <xsl:attribute name="number:country">MO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1050">
+ <!-- Croatian (Croatia), #041a -->
+ <xsl:attribute name="number:language">hr</xsl:attribute>
+ <xsl:attribute name="number:country">HR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 4122">
+ <!-- Croatian (Bosnia/Herzegovina), #101a -->
+ <xsl:attribute name="number:language">hr</xsl:attribute>
+ <xsl:attribute name="number:country">BA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1029">
+ <!-- Czech, #0405 -->
+ <xsl:attribute name="number:language">cs</xsl:attribute>
+ <xsl:attribute name="number:country">CZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1030">
+ <!-- Danish, #0406 -->
+ <xsl:attribute name="number:language">da</xsl:attribute>
+ <xsl:attribute name="number:country">DK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1125">
+ <!-- Divehi, #0465 -->
+ <xsl:attribute name="number:language">dv</xsl:attribute>
+ <xsl:attribute name="number:country">MV</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1043">
+ <!-- Dutch - Netherlands, #0413 -->
+ <xsl:attribute name="number:language">nl</xsl:attribute>
+ <xsl:attribute name="number:country">NL</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2067">
+ <!-- Dutch - Belgium, #0813 -->
+ <xsl:attribute name="number:language">nl</xsl:attribute>
+ <xsl:attribute name="number:country">BE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1126">
+ <!-- Edo (Bini - Nigeria), #0466 -->
+ <xsl:attribute name="number:language">bin</xsl:attribute>
+ <xsl:attribute name="number:country">NG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1033">
+ <!-- English - United States, #0409 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">US</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2057">
+ <!-- English - United Kingdom, #0809 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">GB</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 3081">
+ <!-- English - Australia, #0c09 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">AU</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 10249">
+ <!-- English - Belize, #2809 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">BZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 4105">
+ <!-- English - Canada, #1009 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">CA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 9225">
+ <!-- English - Caribbean (Cuba), #2409 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">CU</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 15369">
+ <!-- English - Hong Kong SAR, #3c09 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">HK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 16393">
+ <!-- English - India, #4009 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 14345">
+ <!-- English - Indonesia, #3809 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">ID</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 6153">
+ <!-- English - Ireland, #1809 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">IE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 8201">
+ <!-- English - Jamaica, #2009 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">JM</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 17417">
+ <!-- English - Malaysia, #4409 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">MY</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 5129">
+ <!-- English - New Zealand, #1409 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">NZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 13321">
+ <!-- English - Philippines, #3409 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">PH</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 18441">
+ <!-- English - Singapore, #4809 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">SG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 7177">
+ <!-- English - South Africa, #1c09 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">ZA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 11273">
+ <!-- English - Trinidad, #2c09 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">TT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 12297">
+ <!-- English - Zimbabwe, #3009 -->
+ <xsl:attribute name="number:language">en</xsl:attribute>
+ <xsl:attribute name="number:country">ZW</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1061">
+ <!-- Estonian (Estonia), #0425 -->
+ <xsl:attribute name="number:language">et</xsl:attribute>
+ <xsl:attribute name="number:country">EE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1080">
+ <!-- Faroese (Faroe Islands), #0438 -->
+ <xsl:attribute name="number:language">fo</xsl:attribute>
+ <xsl:attribute name="number:country">FO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1065">
+ <!-- Farsi (Persian/Iran), #0429 -->
+ <xsl:attribute name="number:language">fa</xsl:attribute>
+ <xsl:attribute name="number:country">IR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1124">
+ <!-- Filipino (Philippine), #0464 -->
+ <xsl:attribute name="number:language">phi</xsl:attribute>
+ <xsl:attribute name="number:country">PH</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1035">
+ <!-- Finnish, #040b -->
+ <xsl:attribute name="number:language">fi</xsl:attribute>
+ <xsl:attribute name="number:country">FI</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1036">
+ <!-- French - France, #040c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">FR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2060">
+ <!-- French - Belgium, #080c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">BE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 11276">
+ <!-- French - Cameroon, #2c0c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">CM</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 3084">
+ <!-- French - Canada, #0c0c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">CA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 9228">
+ <!-- French - Congo, #240c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">CG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 12300">
+ <!-- French - Cote d'Ivoire, #300c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">CI</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 15372">
+ <!-- French - Haiti, #3c0c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">HT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 5132">
+ <!-- French - Luxembourg, #140c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">LU</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 13324">
+ <!-- French - Mali, #340c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">ML</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 6156">
+ <!-- French - Monaco, #180c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">MC</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 14348">
+ <!-- French - Morocco, #380c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">MA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 58380">
+ <!-- French - North Africa (Algeria), #e40c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">DZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 8204">
+ <!-- French - Reunion, #200c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">RE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 10252">
+ <!-- French - Senegal, #280c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">SN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 4108">
+ <!-- French - Switzerland, #100c -->
+ <xsl:attribute name="number:language">fr</xsl:attribute>
+ <xsl:attribute name="number:country">CH</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1122">
+ <!-- Frisian - Netherlands, #0462 -->
+ <xsl:attribute name="number:language">fy</xsl:attribute>
+ <xsl:attribute name="number:country">NL</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1127">
+ <!-- Fulfude (Fulah) - Nigeria, #0467 -->
+ <xsl:attribute name="number:language">ff</xsl:attribute>
+ <xsl:attribute name="number:country">NG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1071">
+ <!-- FYRO Macedonian, #042f -->
+ <xsl:attribute name="number:language">mk</xsl:attribute>
+ <xsl:attribute name="number:country">MK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2108">
+ <!-- Gaelic (Ireland), #083c -->
+ <xsl:attribute name="number:language">gd</xsl:attribute>
+ <xsl:attribute name="number:country">IE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1084">
+ <!-- Gaelic (Scotland), #043c -->
+ <xsl:attribute name="number:language">gd</xsl:attribute>
+ <xsl:attribute name="number:country">GB</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1110">
+ <!-- Galician (Gallegan) - Spain, #0456 -->
+ <xsl:attribute name="number:language">gl</xsl:attribute>
+ <xsl:attribute name="number:country">ES</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1079">
+ <!-- Georgian - Georgia, #0437 -->
+ <xsl:attribute name="number:language">ka</xsl:attribute>
+ <xsl:attribute name="number:country">GE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1031">
+ <!-- German - Germany, #0407 -->
+ <xsl:attribute name="number:language">de</xsl:attribute>
+ <xsl:attribute name="number:country">DE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 3079">
+ <!-- German - Austria, #0c07 -->
+ <xsl:attribute name="number:language">de</xsl:attribute>
+ <xsl:attribute name="number:country">AT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 5127">
+ <!-- German - Liechtenstein, #1407 -->
+ <xsl:attribute name="number:language">de</xsl:attribute>
+ <xsl:attribute name="number:country">LI</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 4103">
+ <!-- German - Luxembourg, #1007 -->
+ <xsl:attribute name="number:language">de</xsl:attribute>
+ <xsl:attribute name="number:country">LU</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2055">
+ <!-- German - Switzerland, #0807 -->
+ <xsl:attribute name="number:language">de</xsl:attribute>
+ <xsl:attribute name="number:country">CH</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1032">
+ <!-- Greek, #0408 -->
+ <xsl:attribute name="number:language">el</xsl:attribute>
+ <xsl:attribute name="number:country">GR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1140">
+ <!-- Guarani - Paraguay, #0474 -->
+ <xsl:attribute name="number:language">gn</xsl:attribute>
+ <xsl:attribute name="number:country">PY</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1095">
+ <!-- Gujarati - India, #0447 -->
+ <xsl:attribute name="number:language">gu</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1128">
+ <!-- Hausa - Nigeria, #0468 -->
+ <xsl:attribute name="number:language">ha</xsl:attribute>
+ <xsl:attribute name="number:country">NG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1141">
+ <!-- Hawaiian - US, #0475 -->
+ <xsl:attribute name="number:language">haw</xsl:attribute>
+ <xsl:attribute name="number:country">US</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1037">
+ <!-- Hebrew, #040d -->
+ <xsl:attribute name="number:language">he</xsl:attribute>
+ <xsl:attribute name="number:country">IL</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1081">
+ <!-- Hindi (India), #0439 -->
+ <xsl:attribute name="number:language">hi</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1038">
+ <!-- Hungarian - Hungary, #040e -->
+ <xsl:attribute name="number:language">hu</xsl:attribute>
+ <xsl:attribute name="number:country">HU</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1129">
+ <!-- Ibibio (Niger-Kordofanian) - Nigeria, #0469 -->
+ <xsl:attribute name="number:language">nic</xsl:attribute>
+ <xsl:attribute name="number:country">NG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1039">
+ <!-- Icelandic, #040f -->
+ <xsl:attribute name="number:language">is</xsl:attribute>
+ <xsl:attribute name="number:country">IS</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1136">
+ <!-- Igbo - Nigeria, #0470 -->
+ <xsl:attribute name="number:language">ig</xsl:attribute>
+ <xsl:attribute name="number:country">NG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1057">
+ <!-- Indonesian, #0421 -->
+ <xsl:attribute name="number:language">id</xsl:attribute>
+ <xsl:attribute name="number:country">ID</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1117">
+ <!-- Inuktitut - US, #045d -->
+ <xsl:attribute name="number:language">iu</xsl:attribute>
+ <xsl:attribute name="number:country">US</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1040">
+ <!-- Italian - Italy, #0410 -->
+ <xsl:attribute name="number:language">it</xsl:attribute>
+ <xsl:attribute name="number:country">IT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2064">
+ <!-- Italian - Switzerland, #0810 -->
+ <xsl:attribute name="number:language">it</xsl:attribute>
+ <xsl:attribute name="number:country">CH</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1041">
+ <!-- Japanese, #0411 -->
+ <xsl:attribute name="number:language">ja</xsl:attribute>
+ <xsl:attribute name="number:country">JP</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1099">
+ <!-- Kannada (India), #044b -->
+ <xsl:attribute name="number:language">kn</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1137">
+ <!-- Kanuri - Nigeria, #0471 -->
+ <xsl:attribute name="number:language">kr</xsl:attribute>
+ <xsl:attribute name="number:country">NG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2144">
+ <!-- Kashmiri (India), #0860 -->
+ <xsl:attribute name="number:language">ks</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1120">
+ <!-- Kashmiri (Arabic), #0460 -->
+ <xsl:attribute name="number:language">ks</xsl:attribute>
+ <xsl:attribute name="number:country">PK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1087">
+ <!-- Kazakh, #043f -->
+ <xsl:attribute name="number:language">kk</xsl:attribute>
+ <xsl:attribute name="number:country">KZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1107">
+ <!-- Khmer (Cambodian), #0453 -->
+ <xsl:attribute name="number:language">km</xsl:attribute>
+ <xsl:attribute name="number:country">KH</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1111">
+ <!-- Konkani (India), #0457 -->
+ <xsl:attribute name="number:language">kok</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1042">
+ <!-- Korean, #0412 -->
+ <xsl:attribute name="number:language">ko</xsl:attribute>
+ <xsl:attribute name="number:country">KR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1088">
+ <!-- Kyrgyz ( Kirgiz / Cyrillic), #0440 -->
+ <xsl:attribute name="number:language">ky</xsl:attribute>
+ <xsl:attribute name="number:country">KG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1108">
+ <!-- Lao, #0454 -->
+ <xsl:attribute name="number:language">lo</xsl:attribute>
+ <xsl:attribute name="number:country">LA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1142">
+ <!-- Latin, #0476 -->
+ <xsl:attribute name="number:language">la</xsl:attribute>
+ <xsl:attribute name="number:country">IT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1062">
+ <!-- Latvian, #0426 -->
+ <xsl:attribute name="number:language">lv</xsl:attribute>
+ <xsl:attribute name="number:country">LV</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1063">
+ <!-- Lithuanian, #0427 -->
+ <xsl:attribute name="number:language">lt</xsl:attribute>
+ <xsl:attribute name="number:country">LT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1086">
+ <!-- Malay - Malaysia, #043e -->
+ <xsl:attribute name="number:language">ms</xsl:attribute>
+ <xsl:attribute name="number:country">MY</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2110">
+ <!-- Malay - Brunei Darussalam, #083e -->
+ <xsl:attribute name="number:language">ms</xsl:attribute>
+ <xsl:attribute name="number:country">BN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1071">
+ <!-- Macedonian (FYROM), #042f -->
+ <xsl:attribute name="number:language">mk</xsl:attribute>
+ <xsl:attribute name="number:country">MK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1100">
+ <!-- Malayalam (India), #044c -->
+ <xsl:attribute name="number:language">ml</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1082">
+ <!-- Maltese, #043a -->
+ <xsl:attribute name="number:language">mt</xsl:attribute>
+ <xsl:attribute name="number:country">MT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1112">
+ <!-- Manipuri (India), #0458 -->
+ <xsl:attribute name="number:language">mni</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1153">
+ <!-- Maori - New Zealand, #0481 -->
+ <xsl:attribute name="number:language">mi</xsl:attribute>
+ <xsl:attribute name="number:country">NZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1102">
+ <!-- Marathi (India), #044e -->
+ <xsl:attribute name="number:language">mr</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1104">
+ <!-- Mongolian (Cyrillic), #0450 -->
+ <xsl:attribute name="number:language">mn</xsl:attribute>
+ <xsl:attribute name="number:country">MN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2128">
+ <!-- Mongolian (Mongolian), #0850 -->
+ <xsl:attribute name="number:language">mn</xsl:attribute>
+ <xsl:attribute name="number:country">CN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1121">
+ <!-- Nepali, #0461 -->
+ <xsl:attribute name="number:language">ne</xsl:attribute>
+ <xsl:attribute name="number:country">NP</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2145">
+ <!-- Nepali (India), #0861 -->
+ <xsl:attribute name="number:language">ne</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1044">
+ <!-- Norwegian (Bokmal), #0414 -->
+ <xsl:attribute name="number:language">nb</xsl:attribute>
+ <xsl:attribute name="number:country">NO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2068">
+ <!-- Norwegian (Nynorsk), #0814 -->
+ <xsl:attribute name="number:language">nn</xsl:attribute>
+ <xsl:attribute name="number:country">NO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1096">
+ <!-- Odia (India), #0448 -->
+ <xsl:attribute name="number:language">or</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1138">
+ <!-- Oromo (Ethiopia), #0472 -->
+ <xsl:attribute name="number:language">om</xsl:attribute>
+ <xsl:attribute name="number:country">ET</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1145">
+ <!-- Papiamentu (Netherlands Antilles), #0479 -->
+ <xsl:attribute name="number:language">pap</xsl:attribute>
+ <xsl:attribute name="number:country">AN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1123">
+ <!-- Pashto (Afghanistan), #0463 -->
+ <xsl:attribute name="number:language">ps</xsl:attribute>
+ <xsl:attribute name="number:country">AF</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1045">
+ <!-- Polish, #0415 -->
+ <xsl:attribute name="number:language">pl</xsl:attribute>
+ <xsl:attribute name="number:country">PL</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1046">
+ <!-- Portuguese - Brazil, #0416 -->
+ <xsl:attribute name="number:language">pt</xsl:attribute>
+ <xsl:attribute name="number:country">BR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2070">
+ <!-- Portuguese - Portugal, #0816 -->
+ <xsl:attribute name="number:language">pt</xsl:attribute>
+ <xsl:attribute name="number:country">PT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1094">
+ <!-- Punjabi, #0446 -->
+ <xsl:attribute name="number:language">pa</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2118">
+ <!-- Punjabi (Pakistan), #0846 -->
+ <xsl:attribute name="number:language">pa</xsl:attribute>
+ <xsl:attribute name="number:country">PK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1131">
+ <!-- Quecha - Blivia, #046b -->
+ <xsl:attribute name="number:language">qu</xsl:attribute>
+ <xsl:attribute name="number:country">BO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2155">
+ <!-- Quecha - Ecuador, #086b -->
+ <xsl:attribute name="number:language">qu</xsl:attribute>
+ <xsl:attribute name="number:country">EC</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 3179">
+ <!-- Quecha - peru, #0c6b -->
+ <xsl:attribute name="number:language">qu</xsl:attribute>
+ <xsl:attribute name="number:country">PE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1047">
+ <!-- Rhaeto-Romanic (Italy), #0417 -->
+ <xsl:attribute name="number:language">rm</xsl:attribute>
+ <xsl:attribute name="number:country">IT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1048">
+ <!-- Romanian, #0418 -->
+ <xsl:attribute name="number:language">ro</xsl:attribute>
+ <xsl:attribute name="number:country">RO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2072">
+ <!-- Romanian - Moldova, #0818 -->
+ <xsl:attribute name="number:language">ro</xsl:attribute>
+ <xsl:attribute name="number:country">MD</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1049">
+ <!-- Russian, #0419 -->
+ <xsl:attribute name="number:language">ru</xsl:attribute>
+ <xsl:attribute name="number:country">RU</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2073">
+ <!-- Russian - Moldova, #0819 -->
+ <xsl:attribute name="number:language">ru</xsl:attribute>
+ <xsl:attribute name="number:country">MD</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1083">
+ <!-- Sami (Lappish), # (Northern Sami - Sweden), #043b -->
+ <xsl:attribute name="number:language">se</xsl:attribute>
+ <xsl:attribute name="number:country">SE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1103">
+ <!-- Sanskrit (India), #044f -->
+ <xsl:attribute name="number:language">sa</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1132">
+ <!-- Sepedi (Northern Sotho - South Africa), #046c -->
+ <xsl:attribute name="number:language">nso</xsl:attribute>
+ <xsl:attribute name="number:country">ZA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 3098">
+ <!-- Serbian (Cyrillic - Serbia Yugoslavia), #0c1a -->
+ <xsl:attribute name="number:language">sr</xsl:attribute>
+ <xsl:attribute name="number:country">YU</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2074">
+ <!-- Serbian (Latin - Croatia), #081a -->
+ <xsl:attribute name="number:language">sr</xsl:attribute>
+ <xsl:attribute name="number:country">HR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1113">
+ <!-- Sindhi - India,#0459 -->
+ <xsl:attribute name="number:language">sd</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2137">
+ <!-- Sindhi - Pakistan, #0859 -->
+ <xsl:attribute name="number:language">sd</xsl:attribute>
+ <xsl:attribute name="number:country">PK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1115">
+ <!-- Sinhalese - Sri Lanka, #045b -->
+ <xsl:attribute name="number:language">si</xsl:attribute>
+ <xsl:attribute name="number:country">LK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1051">
+ <!-- Slovak, #041b -->
+ <xsl:attribute name="number:language">sk</xsl:attribute>
+ <xsl:attribute name="number:country">SK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1060">
+ <!-- Slovenian, #0424 -->
+ <xsl:attribute name="number:language">sl</xsl:attribute>
+ <xsl:attribute name="number:country">SI</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1143">
+ <!-- Somali, #0477 -->
+ <xsl:attribute name="number:language">so</xsl:attribute>
+ <xsl:attribute name="number:country">SO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1070">
+ <!-- Sorbian, #042e -->
+ <xsl:attribute name="number:language">wen</xsl:attribute>
+ <xsl:attribute name="number:country">DE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 3082">
+ <!-- Spanish - Spain (Modern/International Sort), #0c0a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">ES</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1034">
+ <!-- Spanish - Spain (Traditional Sort), #040a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">ES</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 11274">
+ <!-- Spanish - Argentina, #2c0a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">AR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 16394">
+ <!-- Spanish - Bolivia, #400a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">BO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 13322">
+ <!-- Spanish - Chile, #340a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">CL</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 9226">
+ <!-- Spanish - Colombia, #240a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">CO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 5130">
+ <!-- Spanish - Costa Rica, #140a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">CR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 7178">
+ <!-- Spanish - Dominican Republic, #1c0a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">DO</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 12298">
+ <!-- Spanish - Ecuador, #300a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">EC</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 17418">
+ <!-- Spanish - EL Salvador, #440a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">SV</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 4106">
+ <!-- Spanish - Guatemala, #100a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">GT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 18442">
+ <!-- Spanish - Honduras, #480a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">HN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 58378">
+ <!-- Spanish - Latin America (Argentina), #e40a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">AR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2058">
+ <!-- Spanish - Mexico, #080a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">MX</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 19466">
+ <!-- Spanish - Nicaragua, #4c0a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">NI</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 6154">
+ <!-- Spanish - Panama, #180a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">PA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 15370">
+ <!-- Spanish - Paraguay, #3c0a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">PY</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 10250">
+ <!-- Spanish - Peru, #280a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">PE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 20490">
+ <!-- Spanish - Puerto Rico, #500a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">PR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 21514">
+ <!-- Spanish - US, #540a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">US</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 14346">
+ <!-- Spanish - Uruguay, #380a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">UY</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 8202">
+ <!-- Spanish - Venezuela, #200a -->
+ <xsl:attribute name="number:language">es</xsl:attribute>
+ <xsl:attribute name="number:country">VE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1072">
+ <!-- Sutu (Ngoni - Tanzania), #0430 -->
+ <xsl:attribute name="number:language">bnt</xsl:attribute>
+ <xsl:attribute name="number:country">TZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1089">
+ <!-- Swahili (Tanzania), #0441 -->
+ <xsl:attribute name="number:language">sw</xsl:attribute>
+ <xsl:attribute name="number:country">TZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1053">
+ <!-- Swedish (Sweden), #041d -->
+ <xsl:attribute name="number:language">sv</xsl:attribute>
+ <xsl:attribute name="number:country">SE</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2077">
+ <!-- Swedish - Finland, #081d -->
+ <xsl:attribute name="number:language">sv</xsl:attribute>
+ <xsl:attribute name="number:country">FI</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1114">
+ <!-- Syriac (Syria), #045a -->
+ <xsl:attribute name="number:language">syr</xsl:attribute>
+ <xsl:attribute name="number:country">SY</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1064">
+ <!-- Tajik, #0428 -->
+ <xsl:attribute name="number:language">tg</xsl:attribute>
+ <xsl:attribute name="number:country">TJ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1119">
+ <!-- Tamazight (Arabic), #045f -->
+ <xsl:attribute name="number:language">ber</xsl:attribute>
+ <xsl:attribute name="number:country">ML</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2143">
+ <!-- Tamazight (Latin), #085f -->
+ <xsl:attribute name="number:language">ber</xsl:attribute>
+ <xsl:attribute name="number:country">MA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1097">
+ <!-- Tamil (India), #0449 -->
+ <xsl:attribute name="number:language">ta</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1092">
+ <!-- Tatar (Russia), #0444 -->
+ <xsl:attribute name="number:language">tt</xsl:attribute>
+ <xsl:attribute name="number:country">RU</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1098">
+ <!-- Telugu (India), #044a -->
+ <xsl:attribute name="number:language">te</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1054">
+ <!-- Thai, #041e -->
+ <xsl:attribute name="number:language">th</xsl:attribute>
+ <xsl:attribute name="number:country">TH</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2129">
+ <!-- Tibetan - Bhutan, #0851 -->
+ <xsl:attribute name="number:language">bo</xsl:attribute>
+ <xsl:attribute name="number:country">BT</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1105">
+ <!-- Tibetan - Peoples' Republic of China, #0451 -->
+ <xsl:attribute name="number:language">bo</xsl:attribute>
+ <xsl:attribute name="number:country">CN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2163">
+ <!-- Tigrigna (Tigrinya) - Eritrea, #0873 -->
+ <xsl:attribute name="number:language">ti</xsl:attribute>
+ <xsl:attribute name="number:country">ER</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1139">
+ <!-- Tigrigna (Tigrinya) - Ethiopia, #0473 -->
+ <xsl:attribute name="number:language">ti</xsl:attribute>
+ <xsl:attribute name="number:country">ET</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1073">
+ <!-- Tsonga (South Africa), #0431 -->
+ <xsl:attribute name="number:language">ts</xsl:attribute>
+ <xsl:attribute name="number:country">ZA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1074">
+ <!-- Tswana (South Africa), #0432 -->
+ <xsl:attribute name="number:language">tn</xsl:attribute>
+ <xsl:attribute name="number:country">ZA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1055">
+ <!-- Turkish, #041f -->
+ <xsl:attribute name="number:language">tr</xsl:attribute>
+ <xsl:attribute name="number:country">TR</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1090">
+ <!-- Turkmen, #0442 -->
+ <xsl:attribute name="number:language">tk</xsl:attribute>
+ <xsl:attribute name="number:country">TM</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1152">
+ <!-- Uighur - China, #0480 -->
+ <xsl:attribute name="number:language">ug</xsl:attribute>
+ <xsl:attribute name="number:country">CN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1058">
+ <!-- Ukrainian, #0422 -->
+ <xsl:attribute name="number:language">uk</xsl:attribute>
+ <xsl:attribute name="number:country">UA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1056">
+ <!-- Urdu (Pakistan), #0420 -->
+ <xsl:attribute name="number:language">ur</xsl:attribute>
+ <xsl:attribute name="number:country">PK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2080">
+ <!-- Urdu - India, #0820 -->
+ <xsl:attribute name="number:language">ur</xsl:attribute>
+ <xsl:attribute name="number:country">IN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 2115">
+ <!-- Uzbek (Cyrillic), #0843 -->
+ <xsl:attribute name="number:language">uz</xsl:attribute>
+ <xsl:attribute name="number:country">UZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1091">
+ <!-- Uzbek (Latin), #0443 -->
+ <xsl:attribute name="number:language">uz</xsl:attribute>
+ <xsl:attribute name="number:country">UZ</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1075">
+ <!-- Venda (South Africa), #0433 -->
+ <xsl:attribute name="number:language">ve</xsl:attribute>
+ <xsl:attribute name="number:country">ZA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1066">
+ <!-- Vietnamese, #042a -->
+ <xsl:attribute name="number:language">vi</xsl:attribute>
+ <xsl:attribute name="number:country">VN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1106">
+ <!-- Welsh (UK), #0452 -->
+ <xsl:attribute name="number:language">cy</xsl:attribute>
+ <xsl:attribute name="number:country">UK</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1076">
+ <!-- Xhosa (South Africa), #0434 -->
+ <xsl:attribute name="number:language">xh</xsl:attribute>
+ <xsl:attribute name="number:country">ZA</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1144">
+ <!-- Yi (Sino-Tibetan - China), #0478 -->
+ <xsl:attribute name="number:language">sit</xsl:attribute>
+ <xsl:attribute name="number:country">CN</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1085">
+ <!-- Yiddish (Jews - Israel), #043d -->
+ <xsl:attribute name="number:language">yi</xsl:attribute>
+ <xsl:attribute name="number:country">IL</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1130">
+ <!-- Yoruba (Nigeria), #046a -->
+ <xsl:attribute name="number:language">yo</xsl:attribute>
+ <xsl:attribute name="number:country">NG</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$language-country-code = 1077">
+ <!-- Zulu (South Africa), #0435 -->
+ <xsl:attribute name="number:language">zu</xsl:attribute>
+ <xsl:attribute name="number:country">ZA</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-number-format-condition">
+ <xsl:param name="number-format-unit"/>
+ <xsl:choose>
+ <xsl:when test="contains($number-format-unit, '[&gt;')">
+ <xsl:value-of select="concat('&gt;', substring-before( substring-after($number-format-unit,'[&gt;'), ']'))"/>
+ </xsl:when>
+ <xsl:when test="contains($number-format-unit, '[&lt;')">
+ <xsl:value-of select="concat('&lt;', substring-before( substring-after($number-format-unit,'[&lt;'), ']'))"/>
+ </xsl:when>
+ <xsl:when test="contains($number-format-unit, '[=')">
+ <xsl:value-of select="concat('=', substring-before( substring-after($number-format-unit,'[='), ']'))"/>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="add-number-text-value">
+ <xsl:param name="style-type-name"/>
+ <xsl:param name="number-format-unit"/>
+ <xsl:param name="unit-pos"/>
+ <xsl:param name="condition-pos"/>
+ <xsl:param name="isNumberTextElementOpened" select="false()"/>
+ <xsl:param name="numberTextValue"/>
+ <xsl:param name="posed-number-format-unit"/>
+ <xsl:param name="finished" select="false()"/>
+ <xsl:choose>
+ <xsl:when test="not($finished)">
+ <xsl:choose>
<!-- <xsl:when test="$style-type-name='number:text-style' or $style-type-name='number:date-style'"> -->
- <xsl:when test="$style-type-name='number:text-style'">
- <xsl:choose>
- <xsl:when test="$isNumberTextElementOpened">
- <number:text-content/>
- <number:text>
- <xsl:copy-of select="$numberTextValue"/>
- </number:text>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="isNumberTextElementOpened" select="true()"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <number:text>
- <xsl:copy-of select="$numberTextValue"/>
- </number:text>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="isNumberTextElementOpened" select="true()"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- </xsl:call-template>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="finished" select="true()"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$style-type-name='number:number-style'">
- <xsl:choose>
- <xsl:when test="$isNumberTextElementOpened">
- <xsl:copy-of select="$numberTextValue"/>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="isNumberTextElementOpened" select="true()"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <number:text>
- <xsl:copy-of select="$numberTextValue"/>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="isNumberTextElementOpened" select="true()"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- </xsl:call-template>
- </number:text>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="finished" select="true()"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <number:text>
- <xsl:copy-of select="$numberTextValue"/>
- </number:text>
- <xsl:choose>
- <xsl:when test="starts-with($posed-number-format-unit, '\')">
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="finished" select="false()" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="finished" select="true()" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-number-text-content">
- <xsl:param name="style-type-name"/>
- <xsl:param name="number-format-unit"/>
- <xsl:param name="unit-pos"/>
- <xsl:param name="condition-pos"/>
- <xsl:param name="isNumberTextElementOpened" select="false()"/>
- <xsl:param name="finished" select="false()"/>
- <xsl:param name="posed-number-format-unit"/>
- <!-- process number-format-unit by character string parser -->
- <xsl:choose>
- <xsl:when test="starts-with( $posed-number-format-unit, '\') or starts-with( $posed-number-format-unit, '*')">
- <xsl:choose>
- <xsl:when test="not($finished)">
- <xsl:call-template name="add-number-text-value">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="isNumberTextElementOpened" select="$isNumberTextElementOpened"/>
- <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos + 2)"/>
- <!-- place '*' temparily here, because now StarCalc doesn't support variable filling character definition -->
- <xsl:with-param name="numberTextValue" select="substring($posed-number-format-unit,2,1)"/>
- <xsl:with-param name="finished" select="$finished"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos +2)"/>
- <xsl:with-param name="finished" select="true()"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '_')">
- <xsl:choose>
- <xsl:when test="not($finished)">
- <xsl:call-template name="add-number-text-value">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="isNumberTextElementOpened" select="$isNumberTextElementOpened"/>
- <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos + 2)"/>
- <!-- adding an empty string -->
- <xsl:with-param name="numberTextValue" select="' '"/>
- <xsl:with-param name="finished" select="$finished"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos + 2)"/>
- <xsl:with-param name="finished" select="true()"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '&quot;')">
- <xsl:choose>
- <xsl:when test="not($finished)">
- <!-- creating a pre-character string -->
- <xsl:variable name="pre-character-string" select="substring-before(substring($posed-number-format-unit,2), '&quot;')"/>
- <xsl:call-template name="add-number-text-value">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + string-length($pre-character-string) + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos + string-length($pre-character-string) + 2)"/>
- <xsl:with-param name="isNumberTextElementOpened" select="$isNumberTextElementOpened"/>
- <xsl:with-param name="numberTextValue" select="$pre-character-string"/>
- <xsl:with-param name="finished" select="$finished"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- creating a pre-character string -->
- <xsl:variable name="pre-character-string" select="substring-before(substring($posed-number-format-unit,2), '&quot;')"/>
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + string-length($pre-character-string) + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos + string-length($pre-character-string) + 2)"/>
- <xsl:with-param name="finished" select="true()"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$finished">
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="create-number-format-content">
- <xsl:param name="style-type-name"/>
- <xsl:param name="number-format-unit"/>
- <xsl:param name="unit-pos"/>
- <xsl:param name="condition-pos"/>
- <xsl:param name="isNumberTextElementOpened" select="false()"/>
- <xsl:variable name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos)"/>
- <xsl:variable name="calendar-type-name">
- <xsl:if test="contains( $number-format-unit, '[$')">
- <xsl:variable name="format-code" select="substring-before( substring-after( substring-after( $number-format-unit, '[$'), '-'), ']')"/>
- <xsl:if test="string-length( $format-code) &gt; 4">
- <xsl:call-template name="get-calendar-type-name">
- <xsl:with-param name="calendar-type" select="substring( $format-code, string-length($format-code) -5, 2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:variable>
- <!-- process number-format-unit by character string parser -->
- <xsl:choose>
- <xsl:when test="starts-with( $posed-number-format-unit, '[$') and (not(starts-with($posed-number-format-unit, '[$-') ) )">
- <xsl:element name="number:currency-symbol">
- <xsl:call-template name="create-language-country-attribute">
- <xsl:with-param name="attribute-code" select="substring-before(substring-after(substring-after($posed-number-format-unit,'[$'),'-'),']')"/>
- </xsl:call-template>
- <xsl:value-of select="substring-before( substring-after( $posed-number-format-unit, '[$'), '-')"/>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + string-length( substring-before( $posed-number-format-unit, ']') ) + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '\') or starts-with( $posed-number-format-unit, '*') or starts-with( $posed-number-format-unit, '_') or starts-with( $posed-number-format-unit, '&quot;')">
- <xsl:call-template name="get-number-text-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="(starts-with( $posed-number-format-unit, '0') or starts-with( $posed-number-format-unit, '#') or starts-with( $posed-number-format-unit, '?') ) and (not ( contains( $posed-number-format-unit, 's.00') ) )">
- <xsl:variable name="valid-number-format-string">
- <xsl:call-template name="get-valid-number-format-string">
- <xsl:with-param name="number-format-unit" select="$posed-number-format-unit"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains( $valid-number-format-string, '/')">
- <xsl:element name="number:fraction">
- <xsl:attribute name="number:min-integer-digits">
- <xsl:value-of select="string-length( substring-before($valid-number-format-string, '/') ) - string-length(translate( substring-before($valid-number-format-string, '/'), '0', '') )"/>
- </xsl:attribute>
- <xsl:if test="contains( $valid-number-format-string, ',')">
- <xsl:attribute name="number:grouping">true</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="number:min-numerator-digits">
- <xsl:value-of select="string-length( substring-before($valid-number-format-string, '/') ) - string-length(translate( substring-before($valid-number-format-string,'/'), '?', '') )"/>
- </xsl:attribute>
- <xsl:attribute name="number:min-denominator-digits">
- <xsl:value-of select="string-length(substring-after($valid-number-format-string, '/') )"/>
- </xsl:attribute>
- <!-- deal with number:embedded-text (removed, as SCHEMA demands element to be empty)
- <xsl:call-template name="create-number-format-embedded-text">
- <xsl:with-param name="adapted-number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- -->
- </xsl:element>
- </xsl:when>
- <xsl:when test="contains( $valid-number-format-string, '%')">
- <xsl:element name="number:number">
- <xsl:choose>
- <xsl:when test="contains( $valid-number-format-string, '.')">
- <xsl:attribute name="number:decimal-places">
- <xsl:value-of select="string-length( substring-before( substring-after( $valid-number-format-string, '.'), '%') ) - string-length( translate( substring-before( substring-after( $valid-number-format-string, '.'), '%'), '0', '') )"/>
- </xsl:attribute>
- <xsl:attribute name="number:min-integer-digits">
- <xsl:value-of select="string-length( substring-before($valid-number-format-string, '.') ) - string-length(translate( substring-before($valid-number-format-string, '.'), '0', '') )"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="number:decimal-places">0</xsl:attribute>
- <xsl:attribute name="number:min-integer-digits">
- <xsl:value-of select="string-length( substring-before($valid-number-format-string, '%') ) - string-length(translate( substring-before($valid-number-format-string, '%'), '0', '') )"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="contains( $valid-number-format-string, ',') and (substring( $valid-number-format-string,string-length($valid-number-format-string)) = ',')">
- <xsl:variable name="display-factor">
- <xsl:call-template name="get-display-factor">
- <xsl:with-param name="start-number" select="1"/>
- <xsl:with-param name="thousand-count" select="string-length($valid-number-format-string) - string-length( translate($valid-number-format-string, ',', '') )"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="number:display-factor">
- <xsl:value-of select="$display-factor"/>
- </xsl:attribute>
- <xsl:attribute name="number:grouping">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains( $valid-number-format-string, ',')">
- <xsl:attribute name="number:grouping">true</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <!-- deal with number:embedded-text -->
- <xsl:call-template name="create-number-format-embedded-text">
- <xsl:with-param name="adapted-number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:element>
- <number:text>%</number:text>
- </xsl:when>
- <xsl:when test="contains( $valid-number-format-string, 'E') or contains ($valid-number-format-string, 'e')">
- <xsl:element name="number:scientific-number">
- <xsl:choose>
- <xsl:when test="contains( $valid-number-format-string, '.')">
- <xsl:attribute name="number:decimal-places">
- <xsl:value-of select="string-length( substring-before( substring-after( $valid-number-format-string, '.'), 'E') ) - string-length( translate( substring-before( substring-after( $valid-number-format-string, '.'), 'E'), '0', '') )"/>
- </xsl:attribute>
- <xsl:attribute name="number:min-integer-digits">
- <xsl:value-of select="string-length( substring-before($valid-number-format-string, '.') ) - string-length(translate( substring-before($valid-number-format-string, '.'), '0', '') )"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="number:decimal-places">0</xsl:attribute>
- <xsl:attribute name="number:min-integer-digits">
- <xsl:value-of select="string-length( substring-before($valid-number-format-string, 'E') ) - string-length(translate( substring-before($valid-number-format-string, 'E'), '0', '') )"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="number:min-exponent-digits">
- <xsl:value-of select="string-length( substring-after( $valid-number-format-string, 'E') ) - string-length( translate( substring-after( $valid-number-format-string, 'E'), '0', '') )"/>
- </xsl:attribute>
- <!-- deal with number:embedded-text -->
- <xsl:call-template name="create-number-format-embedded-text">
- <xsl:with-param name="adapted-number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <!-- -normal number format, currency, and accounting, e.g -->
- <xsl:element name="number:number">
- <xsl:choose>
- <xsl:when test="contains( $valid-number-format-string, '.')">
- <xsl:attribute name="number:decimal-places">
- <xsl:value-of select="string-length( substring-after( $valid-number-format-string, '.') ) - string-length( translate( substring-after( $valid-number-format-string, '.'), '0', '') )"/>
- </xsl:attribute>
- <xsl:attribute name="number:min-integer-digits">
- <xsl:value-of select="string-length( substring-before($valid-number-format-string, '.') ) - string-length(translate( substring-before($valid-number-format-string, '.'), '0', '') )"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="number:decimal-places">0</xsl:attribute>
- <xsl:attribute name="number:min-integer-digits">
- <xsl:value-of select="string-length( $valid-number-format-string ) - string-length(translate( $valid-number-format-string, '0', '') )"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="contains( $valid-number-format-string, ',') and (substring( $valid-number-format-string,string-length($valid-number-format-string)) = ',')">
- <xsl:variable name="display-factor">
- <xsl:call-template name="get-display-factor">
- <xsl:with-param name="start-number" select="1"/>
- <xsl:with-param name="thousand-count">
- <xsl:call-template name="thousand-count-temp">
- <xsl:with-param name="format-unit" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="number:display-factor">
- <xsl:value-of select="$display-factor"/>
- </xsl:attribute>
- <xsl:attribute name="number:grouping">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains( $valid-number-format-string, ',')">
- <xsl:attribute name="number:grouping">true</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <!-- deal with number:embedded-text -->
- <xsl:call-template name="create-number-format-embedded-text">
- <xsl:with-param name="adapted-number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- <!-- deal with post number:text -->
- <xsl:variable name="post-number-format-text">
- <xsl:call-template name="get-post-number-format-text">
- <xsl:with-param name="adapted-number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$post-number-format-text"/>
- <xsl:with-param name="unit-pos" select="1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'ggg')">
- <xsl:element name="number:era">
- <xsl:attribute name="number:style">long</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'gg')">
- <xsl:element name="number:era">
- <xsl:attribute name="number:style">long</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'g')">
- <xsl:element name="number:era">
- <xsl:attribute name="number:style">short</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'ee')">
- <xsl:element name="number:year">
- <xsl:attribute name="number:style">long</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'r')">
- <xsl:element name="number:year">
- <xsl:attribute name="number:style">long</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'yyyy')">
- <xsl:element name="number:year">
- <xsl:attribute name="number:style">long</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'yy')">
- <xsl:element name="number:year">
- <xsl:attribute name="number:style">short</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'e') or starts-with( $posed-number-format-unit, 'y')">
- <xsl:element name="number:year">
- <xsl:attribute name="number:style">short</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'mmmmm')">
- <xsl:element name="number:month">
- <xsl:attribute name="number:style">short</xsl:attribute>
- <xsl:attribute name="number:textual">true</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 5"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'mmmm')">
- <xsl:element name="number:month">
- <xsl:attribute name="number:style">long</xsl:attribute>
- <xsl:attribute name="number:textual">true</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'mmm')">
- <xsl:element name="number:month">
- <xsl:attribute name="number:style">short</xsl:attribute>
- <xsl:attribute name="number:textual">true</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '[mm]')">
- <xsl:element name="number:minutes">
- <xsl:attribute name="number:style">long</xsl:attribute>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '[m]')">
- <xsl:element name="number:minutes">
- <xsl:attribute name="number:style">short</xsl:attribute>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'mm') and ( contains( $number-format-unit, 'h') or contains( $posed-number-format-unit, 's') )">
- <xsl:element name="number:minutes">
- <xsl:attribute name="number:style">long</xsl:attribute>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'mm')">
- <xsl:element name="number:month">
- <xsl:attribute name="number:style">long</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'm') and ( contains( $number-format-unit, 'h') or contains( $posed-number-format-unit, 's') )">
- <xsl:element name="number:minutes">
- <xsl:attribute name="number:style">short</xsl:attribute>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'm')">
- <xsl:element name="number:month">
- <xsl:attribute name="number:style">short</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'dddd') or starts-with( $posed-number-format-unit, 'aaaa')">
- <xsl:element name="number:day-of-week">
- <xsl:attribute name="number:style">long</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'ddd') or starts-with( $posed-number-format-unit, 'aaa')">
- <xsl:element name="number:day-of-week">
- <xsl:attribute name="number:style">short</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'dd')">
- <xsl:element name="number:day">
- <xsl:attribute name="number:style">long</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'd')">
- <xsl:element name="number:day">
- <xsl:attribute name="number:style">short</xsl:attribute>
- <xsl:if test="string-length($calendar-type-name) &gt; 0">
- <xsl:attribute name="number:calendar">
- <xsl:value-of select="$calendar-type-name"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'hh')">
- <xsl:element name="number:hours">
- <xsl:attribute name="number:style">long</xsl:attribute>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '[hh]')">
- <xsl:element name="number:hours">
- <xsl:attribute name="number:style">long</xsl:attribute>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'h')">
- <xsl:element name="number:hours">
- <xsl:attribute name="number:style">short</xsl:attribute>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '[h]')">
- <xsl:element name="number:hours">
- <xsl:attribute name="number:style">short</xsl:attribute>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'AM/PM') or starts-with( $posed-number-format-unit, 'am/pm')">
- <number:am-pm/>
- <!-- long: am-pm doesn't support long style yet -->
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 5"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'a/p'or starts-with( $posed-number-format-unit, 'A/P'))">
- <number:am-pm/>
- <!-- short: am-pm doesn't support short style yet -->
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 'ss')">
- <xsl:variable name="decimal-places">
- <xsl:choose>
- <xsl:when test="starts-with( $posed-number-format-unit, 'ss.0')">
- <xsl:value-of select="string-length( $posed-number-format-unit) - string-length( translate( $posed-number-format-unit, '0', '') )"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="number:seconds">
- <xsl:attribute name="number:style">long</xsl:attribute>
- <xsl:if test="$decimal-places &gt; 0">
- <xsl:attribute name="number:decimal-places">
- <xsl:value-of select="$decimal-places"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:variable name="second-length">
- <xsl:choose>
- <xsl:when test="$decimal-places &gt; 0">
- <xsl:value-of select="$decimal-places + 3"/>
- </xsl:when>
- <xsl:otherwise>2</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + $second-length"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '[ss]')">
- <xsl:element name="number:seconds">
- <xsl:attribute name="number:style">long</xsl:attribute>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, 's')">
- <xsl:variable name="decimal-places">
- <xsl:choose>
- <xsl:when test="starts-with( $posed-number-format-unit, 's.0')">
- <xsl:value-of select="string-length( $posed-number-format-unit) - string-length( translate( $posed-number-format-unit, '0', '') )"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="number:seconds">
- <xsl:attribute name="number:style">short</xsl:attribute>
- <xsl:if test="$decimal-places &gt; 0">
- <xsl:attribute name="number:decimal-places">
- <xsl:value-of select="$decimal-places"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:variable name="second-length">
- <xsl:choose>
- <xsl:when test="$decimal-places &gt; 0">
- <xsl:value-of select="$decimal-places + 2"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + $second-length"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '[s]')">
- <xsl:element name="number:seconds">
- <xsl:attribute name="number:style">short</xsl:attribute>
- </xsl:element>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '@')">
- <number:text-content/>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'General Number'">
- <number:number number:decimal-places="0" number:min-integer-digits="1"/>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'General Date'">
- <number:year number:style="long"/>
- <number:text>-</number:text>
- <number:month number:style="short"/>
- <number:text>-</number:text>
- <number:day number:style="short"/>
- <number:text>
- <xsl:text> </xsl:text>
- </number:text>
- <number:hours number:style="short"/>
- <number:text>:</number:text>
- <number:minutes number:style="long"/>
- </xsl:when>
- <!-- special for General number:text-content output -->
- <xsl:when test="starts-with($posed-number-format-unit , 'General')">
- <xsl:choose>
- <xsl:when test="$posed-number-format-unit = 'General' and $condition-pos = 1">
- <number:number number:decimal-places="0" number:min-integer-digits="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="unit-pos" select="8"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'Fixed'">
- <number:number number:decimal-places="2" number:min-integer-digits="1"/>
- <number:text/>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'Standard'">
- <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'Long Date'">
- <number:year number:style="long"/>
- <number:text>-</number:text>
- <number:month number:style="long"/>
- <number:text>-</number:text>
- <number:day number:style="long"/>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'Medium Date'">
- <number:day number:style="short"/>
- <number:text>-</number:text>
- <number:month number:textual="true"/>
- <number:text>-</number:text>
- <number:year number:style="short"/>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'Short Date'">
- <number:day number:style="short"/>
- <number:text>-</number:text>
- <number:month number:style="short"/>
- <number:text>-</number:text>
- <number:year number:style="short"/>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'Long Time'">
- <number:hours number:style="long"/>
- <number:text>:</number:text>
- <number:minutes number:style="long"/>
- <number:text>:</number:text>
- <number:seconds number:style="long"/>
- <number:text>
- <xsl:text> </xsl:text>
- </number:text>
- <number:am-pm/>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'Medium Time'">
- <number:hours number:style="short"/>
- <number:text>:</number:text>
- <number:minutes number:style="long"/>
- <number:text>
- <xsl:text> </xsl:text>
- </number:text>
- <number:am-pm/>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'Short Time'">
- <number:hours number:style="short"/>
- <number:text>:</number:text>
- <number:minutes number:style="long"/>
- <number:text>
- <xsl:text> </xsl:text>
- </number:text>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'Percent'">
- <number:number number:decimal-places="2" number:min-integer-digits="1"/>
- <number:text>%</number:text>
- </xsl:when>
- <xsl:when test="$posed-number-format-unit = 'Scientific'">
- <number:scientific-number number:decimal-places="2" number:min-integer-digits="1" number:min-exponent-digits="2"/>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '[')">
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + string-length( substring-before( $posed-number-format-unit, ']') ) + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="isNumberTextElementOpened" select="$isNumberTextElementOpened"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, '/')">
- <number:text>/</number:text>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( $posed-number-format-unit, ':')">
- <number:text>:</number:text>
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="string-length( $posed-number-format-unit ) &gt; 0">
- <xsl:call-template name="create-number-format-content">
- <xsl:with-param name="style-type-name" select="$style-type-name"/>
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
- <xsl:with-param name="condition-pos" select="$condition-pos"/>
- <xsl:with-param name="isNumberTextElementOpened" select="$isNumberTextElementOpened"/>
- <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
- <xsl:with-param name="numberTextValue" select="substring( $posed-number-format-unit, 1, 1)"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="thousand-count-temp">
- <!-- thousand count for char ',' at the latter of format-unit by recursion -->
- <xsl:param name="format-unit"/>
- <xsl:choose>
- <xsl:when test="contains($format-unit, ',#')">
- <xsl:call-template name="thousand-count-temp">
- <xsl:with-param name="format-unit" select="substring-after($format-unit, ',#')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains($format-unit, ',0')">
- <xsl:call-template name="thousand-count-temp">
- <xsl:with-param name="format-unit" select="substring-after($format-unit, ',0')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string-length($format-unit) - string-length( translate($format-unit, ',', ''))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-calendar-type-name">
- <xsl:param name="calendar-type"/>
- <xsl:variable name="temp-type">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="$calendar-type"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="string-length($calendar-type)"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <!-- Japanese (Emperor era), #03 -->
- <xsl:when test="$temp-type = 3">gengou</xsl:when>
- <!-- Taiwanese, #04 -->
- <xsl:when test="$temp-type = 4">ROC</xsl:when>
- <!-- Korean (Tangun era) hanja_yoil is ok too. #05 -->
- <xsl:when test="$temp-type = 5">hanja</xsl:when>
- <!-- Hijri (Arabic lunar), #06 -->
- <xsl:when test="$temp-type = 6">hijri</xsl:when>
- <!-- Thai, #07 -->
- <xsl:when test="$temp-type = 7">buddhist</xsl:when>
- <!-- 01: Gregorian (Localized), 02: Gregorian (United States), 09: Gregorian (Middle East French), 0A: Gregorian (Arabic), 0B: Gregorian (Transliterated English) -->
- <xsl:otherwise>gregorian</xsl:otherwise>
- <!-- not found jewish yet -->
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-valid-number-format-string">
- <xsl:param name="number-format-unit"/>
- <xsl:choose>
- <xsl:when test="contains( $number-format-unit, '\')">
- <xsl:call-template name="get-valid-number-format-string">
- <xsl:with-param name="number-format-unit" select="concat( substring-before( $number-format-unit, '\'), substring( substring-after( $number-format-unit, '\'), 2) )"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains( $number-format-unit, '*')">
- <xsl:call-template name="get-valid-number-format-string">
- <xsl:with-param name="number-format-unit" select="concat( substring-before( $number-format-unit, '*'), substring( substring-after( $number-format-unit, '*'), 2) )"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains( $number-format-unit, '_')">
- <xsl:call-template name="get-valid-number-format-string">
- <xsl:with-param name="number-format-unit" select="concat( substring-before( $number-format-unit, '_'), substring( substring-after( $number-format-unit, '_'), 2) )"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains( $number-format-unit, '&quot;')">
- <xsl:call-template name="get-valid-number-format-string">
- <xsl:with-param name="number-format-unit" select="concat( substring-before( $number-format-unit, '&quot;'), substring-after( substring-after( $number-format-unit, '&quot;'), '&quot;') )"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$number-format-unit"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-display-factor">
- <xsl:param name="start-number"/>
- <xsl:param name="thousand-count"/>
- <xsl:choose>
- <xsl:when test="$thousand-count = 0">
- <xsl:value-of select="$start-number"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="get-display-factor">
- <xsl:with-param name="start-number" select="$start-number * 1000"/>
- <xsl:with-param name="thousand-count" select="$thousand-count -1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-post-number-format-text">
- <xsl:param name="adapted-number-format-unit"/>
- <xsl:param name="valid-number-format-string"/>
- <xsl:variable name="first-embedded-character-pos">
- <xsl:choose>
- <xsl:when test="contains( $adapted-number-format-unit, '\')">
- <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '\') ) + 1"/>
- </xsl:when>
- <xsl:when test="contains( $adapted-number-format-unit, '_')">
- <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '_') ) + 1"/>
- </xsl:when>
- <xsl:when test="contains( $adapted-number-format-unit, '*')">
- <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '*') ) + 1"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="first-embedded-string-pos">
- <xsl:choose>
- <xsl:when test="contains( $adapted-number-format-unit, '&quot;')">
- <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '&quot;') ) + 1"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="first-embedded-text-pos">
- <xsl:choose>
- <xsl:when test="$first-embedded-character-pos &lt; $first-embedded-string-pos and $first-embedded-character-pos &gt; 0">
- <xsl:value-of select="$first-embedded-character-pos"/>
- </xsl:when>
- <xsl:when test="$first-embedded-character-pos &lt; $first-embedded-string-pos and $first-embedded-character-pos = 0">
- <xsl:value-of select="$first-embedded-string-pos"/>
- </xsl:when>
- <xsl:when test="$first-embedded-character-pos &gt; $first-embedded-string-pos and $first-embedded-string-pos &gt; 0">
- <xsl:value-of select="$first-embedded-string-pos"/>
- </xsl:when>
- <xsl:when test="$first-embedded-character-pos &gt; $first-embedded-string-pos and $first-embedded-string-pos = 0">
- <xsl:value-of select="$first-embedded-character-pos"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-embedded-text-pos &gt; string-length( $valid-number-format-string )">
- <xsl:value-of select="substring( $adapted-number-format-unit, $first-embedded-text-pos)"/>
- </xsl:when>
- <xsl:when test="$first-embedded-text-pos &gt; 0 and $first-embedded-text-pos &lt; string-length( $valid-number-format-string )">
- <xsl:choose>
- <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '\')">
- <xsl:call-template name="get-post-number-format-text">
- <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '\'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '_')">
- <xsl:call-template name="get-post-number-format-text">
- <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '_'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '*')">
- <xsl:call-template name="get-post-number-format-text">
- <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '*'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '&quot;')">
- <xsl:call-template name="get-post-number-format-text">
- <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '&quot;'), substring-after( substring-after( $adapted-number-format-unit, '&quot;'), '&quot;') )"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="create-number-format-embedded-text">
- <xsl:param name="adapted-number-format-unit"/>
- <xsl:param name="valid-number-format-string"/>
- <xsl:variable name="first-embedded-character-pos">
- <xsl:choose>
- <xsl:when test="contains( $adapted-number-format-unit, '\')">
- <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '\') ) + 1"/>
- </xsl:when>
- <xsl:when test="contains( $adapted-number-format-unit, '_')">
- <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '_') ) + 1"/>
- </xsl:when>
- <xsl:when test="contains( $adapted-number-format-unit, '*')">
- <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '*') ) + 1"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="first-embedded-string-pos">
- <xsl:choose>
- <xsl:when test="contains( $adapted-number-format-unit, '&quot;')">
- <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '&quot;') ) + 1"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="first-embedded-text-pos">
- <xsl:choose>
- <xsl:when test="$first-embedded-character-pos &lt; $first-embedded-string-pos and $first-embedded-character-pos &gt; 0">
- <xsl:value-of select="$first-embedded-character-pos"/>
- </xsl:when>
- <xsl:when test="$first-embedded-character-pos &lt; $first-embedded-string-pos and $first-embedded-character-pos = 0">
- <xsl:value-of select="$first-embedded-string-pos"/>
- </xsl:when>
- <xsl:when test="$first-embedded-character-pos &gt; $first-embedded-string-pos and $first-embedded-string-pos &gt; 0">
- <xsl:value-of select="$first-embedded-string-pos"/>
- </xsl:when>
- <xsl:when test="$first-embedded-character-pos &gt; $first-embedded-string-pos and $first-embedded-string-pos = 0">
- <xsl:value-of select="$first-embedded-character-pos"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$first-embedded-text-pos &gt; 0 and $first-embedded-text-pos &lt; string-length( $valid-number-format-string )">
- <xsl:variable name="text-pos">
- <xsl:choose>
- <xsl:when test="contains( $valid-number-format-string, '.')">
- <xsl:variable name="right-text-pos" select="substring( substring-before( $valid-number-format-string, '.'), $first-embedded-text-pos)"/>
- <xsl:value-of select="string-length($right-text-pos) - string-length( translate( $right-text-pos, '0#?', '') )"/>
- </xsl:when>
- <xsl:when test="contains( $valid-number-format-string, '/')">
- <xsl:variable name="right-text-pos" select="substring( substring-before( $valid-number-format-string, '/'), $first-embedded-text-pos)"/>
- <xsl:value-of select="string-length($right-text-pos) - string-length( translate( $right-text-pos, '0#?', '') )"/>
- </xsl:when>
- <xsl:when test="contains( $valid-number-format-string, '%')">
- <xsl:variable name="right-text-pos" select="substring( substring-before( $valid-number-format-string, '%'), $first-embedded-text-pos)"/>
- <xsl:value-of select="string-length($right-text-pos) - string-length( translate( $right-text-pos, '0#?', '') )"/>
- </xsl:when>
- <xsl:when test="contains( $valid-number-format-string, 'E')">
- <xsl:variable name="right-text-pos" select="substring( substring-before( $valid-number-format-string, 'E'), $first-embedded-text-pos)"/>
- <xsl:value-of select="string-length($right-text-pos) - string-length( translate( $right-text-pos, '0#?', '') )"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="right-text-pos" select="substring( $valid-number-format-string, $first-embedded-text-pos)"/>
- <xsl:value-of select="string-length($right-text-pos) - string-length( translate( $right-text-pos, '0#?', '') )"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '\')">
- <number:embedded-text number:position="{$text-pos}">
- <xsl:value-of select="substring( $adapted-number-format-unit, $first-embedded-text-pos + 1, 1)"/>
- </number:embedded-text>
- <xsl:call-template name="create-number-format-embedded-text">
- <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '\'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '_')">
- <number:embedded-text number:position="{$text-pos}">
- <xsl:value-of select="substring( $adapted-number-format-unit, $first-embedded-text-pos + 1, 1)"/>
- </number:embedded-text>
- <xsl:call-template name="create-number-format-embedded-text">
- <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '_'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '*')">
- <number:embedded-text number:position="{$text-pos}">
- <xsl:value-of select="substring( $adapted-number-format-unit, $first-embedded-text-pos + 1, 1)"/>
- </number:embedded-text>
- <xsl:call-template name="create-number-format-embedded-text">
- <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '*'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '&quot;')">
- <number:embedded-text number:position="{$text-pos}">
- <xsl:value-of select="substring-before( substring( $adapted-number-format-unit, $first-embedded-text-pos + 1), '&quot;')"/>
- </number:embedded-text>
- <xsl:call-template name="create-number-format-embedded-text">
- <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '&quot;'), substring-after( substring-after( $adapted-number-format-unit, '&quot;'), '&quot;') )"/>
- <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template name="create-master-styles">
- <xsl:param name="worksheetoptions"/>
- <xsl:for-each select="$worksheetoptions">
- <xsl:element name="style:master-page">
- <xsl:attribute name="style:name">
- <xsl:call-template name="encode-as-nc-name">
- <xsl:with-param name="string" select="concat( 'TAB_', ../@ss:Name)"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="style:display-name">
- <xsl:value-of select="concat( 'PageStyle_', ../@ss:Name)"/>
- </xsl:attribute>
- <xsl:attribute name="style:page-layout-name">
- <xsl:call-template name="encode-as-nc-name">
- <xsl:with-param name="string" select="concat( 'pm_', ../@ss:Name)"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:choose>
- <xsl:when test="x:PageSetup/x:Header/@x:Data">
- <style:header>
- <xsl:call-template name="translate-header-footer">
- <xsl:with-param name="content" select="x:PageSetup/x:Header/@x:Data"/>
- <xsl:with-param name="style-name-header" select="concat(../@ss:Name, substring(name(x:PageSetup/x:Header),1,1))"/>
- </xsl:call-template>
- </style:header>
- </xsl:when>
- <xsl:otherwise>
- <style:header style:display="false"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="x:PageSetup/x:Footer/@x:Data">
- <style:footer>
- <xsl:call-template name="translate-header-footer">
- <xsl:with-param name="content" select="x:PageSetup/x:Footer/@x:Data"/>
- <xsl:with-param name="style-name-header" select="concat(../@ss:Name, substring(name(x:PageSetup/x:Footer),1,1))"/>
- </xsl:call-template>
- </style:footer>
- </xsl:when>
- <xsl:otherwise>
- <style:footer style:display="false"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="translate-header-footer">
- <xsl:param name="content"/>
- <xsl:param name="style-name-header"/>
- <style:region-left>
- <text:p>
- <xsl:variable name="left-content">
- <xsl:call-template name="get-pos-content">
- <xsl:with-param name="content" select="$content"/>
- <xsl:with-param name="pos" select="'left'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="locate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="$left-content"/>
- <xsl:with-param name="style-name-header" select="concat($style-name-header,'L')"/>
- <xsl:with-param name="index" select="0"/>
- <xsl:with-param name="current-pos" select="1"/>
- </xsl:call-template>
- </text:p>
- </style:region-left>
- <style:region-center>
- <text:p>
- <xsl:variable name="center-content">
- <xsl:call-template name="get-pos-content">
- <xsl:with-param name="content" select="$content"/>
- <xsl:with-param name="pos" select="'center'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="locate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="$center-content"/>
- <xsl:with-param name="style-name-header" select="concat($style-name-header,'C')"/>
- <xsl:with-param name="index" select="0"/>
- <xsl:with-param name="current-pos" select="1"/>
- </xsl:call-template>
- </text:p>
- </style:region-center>
- <style:region-right>
- <text:p>
- <xsl:variable name="right-content">
- <xsl:call-template name="get-pos-content">
- <xsl:with-param name="content" select="$content"/>
- <xsl:with-param name="pos" select="'right'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="locate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="$right-content"/>
- <xsl:with-param name="style-name-header" select="concat($style-name-header,'R')"/>
- <xsl:with-param name="index" select="0"/>
- <xsl:with-param name="current-pos" select="1"/>
- </xsl:call-template>
- </text:p>
- </style:region-right>
- </xsl:template>
- <xsl:template name="locate-header-footer-data">
- <xsl:param name="header-footer-data"/>
- <xsl:param name="style-name-header"/>
- <xsl:param name="index"/>
- <xsl:param name="current-pos"/>
- <xsl:variable name="current-style-data">
- <xsl:value-of select="substring($header-footer-data,$current-pos)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="starts-with($current-style-data,'&amp;X') or starts-with($current-style-data,'&amp;Y') or starts-with($current-style-data,'&amp;S') or starts-with($current-style-data,'&amp;U') or starts-with($current-style-data,'&amp;E') or starts-with($current-style-data,'&amp;B')">
- <xsl:call-template name="locate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="$header-footer-data"/>
- <xsl:with-param name="style-name-header" select="$style-name-header"/>
- <xsl:with-param name="index" select="$index"/>
- <xsl:with-param name="current-pos" select="$current-pos+2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;0') or starts-with($current-style-data,'&amp;1') or starts-with($current-style-data,'&amp;2') or starts-with($current-style-data,'&amp;3') or starts-with($current-style-data,'&amp;4') or starts-with($current-style-data,'&amp;5') or starts-with($current-style-data,'&amp;6') or starts-with($current-style-data,'&amp;7') or starts-with($current-style-data,'&amp;8') or starts-with($current-style-data,'&amp;9')">
- <xsl:variable name="font-size-length">
- <xsl:call-template name="get-digit-length">
- <xsl:with-param name="complexive-string" select="substring-after($current-style-data,'&amp;')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="locate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="$header-footer-data"/>
- <xsl:with-param name="style-name-header" select="$style-name-header"/>
- <xsl:with-param name="index" select="$index"/>
- <xsl:with-param name="current-pos" select="$current-pos+1+$font-size-length"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;&quot;')">
- <xsl:call-template name="locate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="$header-footer-data"/>
- <xsl:with-param name="style-name-header" select="$style-name-header"/>
- <xsl:with-param name="index" select="$index"/>
- <xsl:with-param name="current-pos" select="string-length(substring-before(substring($header-footer-data,$current-pos+2),'&quot;'))+$current-pos+3"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="current-content-last-pos">
- <xsl:call-template name="get-current-content-last-pos">
- <xsl:with-param name="style-data" select="$header-footer-data"/>
- <xsl:with-param name="current-pos" select="$current-pos"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$current-pos &gt; 1">
- <text:span text:style-name="{concat($style-name-header,$index)}">
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring($header-footer-data,$current-pos,$current-content-last-pos+1-$current-pos)"/>
- </xsl:call-template>
- </text:span>
- <xsl:if test="$current-content-last-pos &lt; string-length($header-footer-data)">
- <xsl:call-template name="locate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="$header-footer-data"/>
- <xsl:with-param name="style-name-header" select="$style-name-header"/>
- <xsl:with-param name="index" select="$index+1"/>
- <xsl:with-param name="current-pos" select="$current-content-last-pos+1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring($header-footer-data,$current-pos,$current-content-last-pos+1-$current-pos)"/>
- </xsl:call-template>
- <xsl:if test="$current-content-last-pos &lt; string-length($header-footer-data)">
- <xsl:call-template name="locate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="$header-footer-data"/>
- <xsl:with-param name="style-name-header" select="$style-name-header"/>
- <xsl:with-param name="index" select="$index"/>
- <xsl:with-param name="current-pos" select="$current-content-last-pos+1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-current-content-last-pos">
- <xsl:param name="style-data"/>
- <xsl:param name="current-pos"/>
- <xsl:variable name="current-style-data">
- <xsl:value-of select="substring($style-data,$current-pos)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="starts-with($current-style-data,'&amp;&quot;') or starts-with($current-style-data,'&amp;X') or starts-with($current-style-data,'&amp;Y') or starts-with($current-style-data,'&amp;S') or starts-with($current-style-data,'&amp;U') or starts-with($current-style-data,'&amp;E') or starts-with($current-style-data,'&amp;B')or starts-with($current-style-data,'&amp;0') or starts-with($current-style-data,'&amp;1') or starts-with($current-style-data,'&amp;2') or starts-with($current-style-data,'&amp;3') or starts-with($current-style-data,'&amp;4') or starts-with($current-style-data,'&amp;5') or starts-with($current-style-data,'&amp;6') or starts-with($current-style-data,'&amp;7') or starts-with($current-style-data,'&amp;8') or starts-with($current-style-data,'&amp;9')">
- <xsl:value-of select="$current-pos - 1"/>
- </xsl:when>
- <xsl:when test="contains($current-style-data,'&amp;&quot;') or contains($current-style-data,'&amp;X') or contains($current-style-data,'&amp;Y') or contains($current-style-data,'&amp;S') or contains($current-style-data,'&amp;U') or contains($current-style-data,'&amp;E') or contains($current-style-data,'&amp;B')or contains($current-style-data,'&amp;0') or contains($current-style-data,'&amp;1') or contains($current-style-data,'&amp;2') or contains($current-style-data,'&amp;3') or contains($current-style-data,'&amp;4') or contains($current-style-data,'&amp;5') or contains($current-style-data,'&amp;6') or contains($current-style-data,'&amp;7') or contains($current-style-data,'&amp;8') or contains($current-style-data,'&amp;9')">
- <xsl:variable name="temp" select="substring-before(substring($current-style-data,2),'&amp;')"/>
- <xsl:variable name="next-amp-pos">
- <xsl:value-of select="$current-pos+string-length($temp)+1"/>
- </xsl:variable>
- <xsl:call-template name="get-current-content-last-pos">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$next-amp-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string-length($style-data)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="translate-header-footer-data">
- <xsl:param name="header-footer-data"/>
- <xsl:choose>
- <xsl:when test="contains( $header-footer-data, '&amp;D')">
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;D')"/>
- </xsl:call-template>
- <text:date/>
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;D')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains( $header-footer-data, '&amp;T')">
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;T')"/>
- </xsl:call-template>
- <text:time/>
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;T')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains( $header-footer-data, '&amp;P')">
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;P')"/>
- </xsl:call-template>
- <text:page-number/>
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;P')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains( $header-footer-data, '&amp;N')">
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;N')"/>
- </xsl:call-template>
- <text:page-count/>
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;N')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains( $header-footer-data, '&amp;A')">
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;A')"/>
- </xsl:call-template>
- <text:sheet-name/>
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;A')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains( $header-footer-data, '&amp;Z&amp;F')">
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;Z&amp;F')"/>
- </xsl:call-template>
- <text:file-name text:display="full"/>
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;Z&amp;F')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains( $header-footer-data, '&amp;Z')">
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;Z')"/>
- </xsl:call-template>
- <text:file-name text:display="path"/>
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;Z')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains( $header-footer-data, '&amp;F')">
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;F')"/>
- </xsl:call-template>
- <text:file-name text:display="name"/>
- <xsl:call-template name="translate-header-footer-data">
- <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;F')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$header-footer-data"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="create-page-master">
- <xsl:param name="worksheetoptions"/>
- <xsl:for-each select="$worksheetoptions">
- <xsl:element name="style:page-layout">
- <xsl:attribute name="style:name">
- <xsl:call-template name="encode-as-nc-name">
- <xsl:with-param name="string" select="concat( 'pm_', ../@ss:Name)"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:element name="style:page-layout-properties">
- <xsl:choose>
- <xsl:when test="x:PageSetup/x:Layout/@x:Orientation = 'Landscape'">
- <xsl:attribute name="style:print-orientation">landscape</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:print-orientation">portrait</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="x:PageSetup/x:Layout/@x:StartPageNumber">
- <xsl:attribute name="style:first-page-number">
- <xsl:value-of select="x:PageSetup/x:Layout/@x:StartPageNumber"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:first-page-number">continue</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="x:PageSetup/x:PageMargins">
- <xsl:attribute name="fo:margin-top">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(x:PageSetup/x:PageMargins/@x:Top,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="fo:margin-bottom">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(x:PageSetup/x:PageMargins/@x:Bottom,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="fo:margin-left">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(x:PageSetup/x:PageMargins/@x:Left,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- <xsl:attribute name="fo:margin-right">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(x:PageSetup/x:PageMargins/@x:Right,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:if test="x:PageSetup/x:Header">
- <style:header-style>
- <xsl:element name="style:header-footer-properties">
- <xsl:attribute name="fo:min-height">0.75cm</xsl:attribute>
- <xsl:choose>
- <xsl:when test="x:PageSetup/x:Header/@x:Margin">
- <xsl:attribute name="fo:margin-bottom">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(x:PageSetup/x:Header/@x:Margin,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:margin-bottom">0.25cm</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </style:header-style>
- </xsl:if>
- <xsl:if test="x:PageSetup/x:Footer">
- <style:footer-style>
- <xsl:element name="style:header-footer-properties">
- <xsl:attribute name="fo:min-height">0.75cm</xsl:attribute>
- <xsl:choose>
- <xsl:when test="x:PageSetup/x:Footer/@x:Margin">
- <xsl:attribute name="fo:margin-top">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(x:PageSetup/x:Footer/@x:Margin,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:margin-top">0.25cm</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </style:footer-style>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="ss:Style" name="style-style-content" mode="style-style-content">
- <xsl:element name="style:table-cell-properties">
- <xsl:if test="ss:Alignment">
- <xsl:if test="ss:Alignment/@ss:Vertical">
- <xsl:variable name="vertical-align">
- <xsl:choose>
- <xsl:when test="ss:Alignment/@ss:Vertical = 'Top'">top</xsl:when>
- <xsl:when test="ss:Alignment/@ss:Vertical = 'Center'">middle</xsl:when>
- <xsl:when test="ss:Alignment/@ss:Vertical = 'Bottom'">bottom</xsl:when>
- <xsl:when test="ss:Alignment/@ss:Vertical = 'Automatic'">middle</xsl:when>
- <!-- actually for vertical written characters, not supported by StarOffice/OpenOffice now yet -->
- <xsl:otherwise>middle</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="style:vertical-align">
- <xsl:value-of select="$vertical-align"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="ss:Alignment/@ss:WrapText = '1'">
- <xsl:attribute name="fo:wrap-option">wrap</xsl:attribute>
- </xsl:if>
- <xsl:if test="ss:Alignment/@ss:Indent">
- <xsl:attribute name="fo:padding-left"><!-- Indent is ten times of a point -->
- <xsl:variable name="indent" select="ss:Alignment/@ss:Indent * 10"/>
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat($indent,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="ss:Alignment/@ss:Rotate">
- <xsl:attribute name="style:rotation-angle">
- <xsl:choose>
- <xsl:when test="ss:Alignment/@ss:Rotate &lt; 0">
- <xsl:value-of select="360 + ss:Alignment/@ss:Rotate"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="ss:Alignment/@ss:Rotate"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="style:rotation-align">none</xsl:attribute>
- </xsl:if>
- <xsl:if test="ss:Alignment/@ss:VerticalText = '1'">
- <xsl:attribute name="style:direction">ttb</xsl:attribute>
- <!-- The horizontal align default for vertical text in Excel is 'center' -->
- <xsl:if test="not(ss:Alignment/@ss:Horizontal)">
- <!-- OASIS XML removal
- <xsl:attribute name="fo:text-align">center</xsl:attribute>-->
- <xsl:attribute name="style:text-align-source">fix</xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:if>
- <xsl:if test="ss:Borders">
- <xsl:if test="ss:Borders/ss:Border">
- <xsl:apply-templates select="ss:Borders/ss:Border"/>
- </xsl:if>
- </xsl:if>
- <xsl:apply-templates select="ss:Interior" mode="style-style-content"/>
- <xsl:if test="ss:Protection">
- <xsl:choose>
- <xsl:when test="ss:Protection/@ss:Protected = '0'">
- <xsl:choose>
- <xsl:when test="ss:Protection/@ss:HideFormula = '1'">
- <xsl:attribute name="style:cell-protect">hidden-and-protected</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:cell-protect">none</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="ss:Protection/@x:HideFormula = '1'">
- <xsl:attribute name="style:cell-protect">protected formula-hidden</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:cell-protect">none</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <!-- fix means the horizontal alignment is dependent on ss:Horizontal,
- but set on paragaraph properties not cell paragraphs -->
- <xsl:if test="ss:Alignment/@ss:Horizontal">
- <xsl:attribute name="style:text-align-source">fix</xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:choose>
- <xsl:when test="ss:Alignment/@ss:Horizontal">
- <xsl:element name="style:paragraph-properties">
- <xsl:variable name="text-align">
- <xsl:choose>
- <xsl:when test="ss:Alignment/@ss:Horizontal = 'Left'">start</xsl:when>
- <xsl:when test="ss:Alignment/@ss:Horizontal = 'Center'">center</xsl:when>
- <xsl:when test="ss:Alignment/@ss:Horizontal = 'Right'">end</xsl:when>
- <xsl:when test="ss:Alignment/@ss:Horizontal = 'Justify'">justify</xsl:when>
- <!-- many other text-align not supported yet -->
- <xsl:otherwise>start</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="fo:text-align">
- <xsl:value-of select="$text-align"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <!-- The horizontal align default for vertical text in Excel is 'center' -->
- <xsl:element name="style:paragraph-properties">
- <xsl:if test="ss:Alignment/@ss:VerticalText = '1'">
- <xsl:attribute name="fo:text-align">center</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="ss:Font">
- <xsl:element name="style:text-properties">
- <xsl:choose>
- <xsl:when test="ss:Font/@ss:FontName">
- <xsl:attribute name="style:font-name">
- <xsl:value-of select="ss:Font/@ss:FontName"/>
- </xsl:attribute>
- <xsl:attribute name="style:font-name-asian">
- <xsl:value-of select="ss:Font/@ss:FontName"/>
- </xsl:attribute>
- <xsl:attribute name="style:font-name-complex">
- <xsl:value-of select="ss:Font/@ss:FontName"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:font-name">Arial</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <!-- "ss:Font/@x:Family" is useless here, so can't map to "svg:font-family" attribute -->
- <xsl:if test="ss:Font/@ss:Bold = '1'">
- <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="ss:Font/@ss:Color">
- <xsl:attribute name="fo:color">
- <xsl:value-of select="ss:Font/@ss:Color"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:use-window-font-color">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="ss:Font/@ss:Italic = '1'">
- <!-- omit font-style oblique -->
- <xsl:attribute name="fo:font-style">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="ss:Font/@ss:Size">
- <xsl:attribute name="fo:font-size">
- <xsl:value-of select="concat( ss:Font/@ss:Size, 'pt')"/>
- </xsl:attribute>
- <xsl:attribute name="style:font-size-asian">
- <xsl:value-of select="concat( ss:Font/@ss:Size, 'pt')"/>
- </xsl:attribute>
- <xsl:attribute name="style:font-size-complex">
- <xsl:value-of select="concat( ss:Font/@ss:Size, 'pt')"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:font-size">10pt</xsl:attribute>
- <xsl:attribute name="style:font-size-asian">10pt</xsl:attribute>
- <xsl:attribute name="style:font-size-complex">10pt</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="ss:Font/@ss:Outline = '1'">
- <xsl:attribute name="style:text-outline">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="ss:Font/@ss:Shadow = '1'">
- <!-- Not in DTD nor in docu <xsl:attribute name="style:text-shadow">shadow</xsl:attribute> -->
- <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
- </xsl:if>
- <xsl:if test="ss:Font/@ss:StrikeThrough = '1'">
- <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
- </xsl:if>
- <xsl:if test="ss:Font/@ss:Underline">
- <xsl:choose>
- <xsl:when test="ss:Font/@ss:Underline = 'None'">
- <xsl:attribute name="style:text-underline-type">none</xsl:attribute>
- </xsl:when>
- <xsl:when test="ss:Font/@ss:Underline = 'Single'">
- <xsl:attribute name="style:text-underline-type">single</xsl:attribute>
- </xsl:when>
- <xsl:when test="ss:Font/@ss:Underline = 'Double'">
- <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
- </xsl:when>
- <xsl:when test="ss:Font/@ss:Underline = 'SingleAccounting'">
- <xsl:attribute name="style:text-underline-type">single</xsl:attribute>"</xsl:when>
- <xsl:when test="ss:Font/@ss:Underline = 'DoubleAccounting'">
- <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:text-underline-type">none</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="ss:Font/@x:Charset">
- <!-- quite unclear till now, -->
- <xsl:attribute name="style:font-charset">x-symbol</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
+ <xsl:when test="$style-type-name='number:text-style'">
+ <xsl:choose>
+ <xsl:when test="$isNumberTextElementOpened">
+ <number:text-content/>
+ <number:text>
+ <xsl:copy-of select="$numberTextValue"/>
+ </number:text>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="isNumberTextElementOpened" select="true()"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <number:text>
+ <xsl:copy-of select="$numberTextValue"/>
+ </number:text>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="isNumberTextElementOpened" select="true()"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ </xsl:call-template>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="finished" select="true()"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$style-type-name='number:number-style'">
+ <xsl:choose>
+ <xsl:when test="$isNumberTextElementOpened">
+ <xsl:copy-of select="$numberTextValue"/>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="isNumberTextElementOpened" select="true()"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <number:text>
+ <xsl:copy-of select="$numberTextValue"/>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="isNumberTextElementOpened" select="true()"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ </xsl:call-template>
+ </number:text>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="finished" select="true()"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <number:text>
+ <xsl:copy-of select="$numberTextValue"/>
+ </number:text>
+ <xsl:choose>
+ <xsl:when test="starts-with($posed-number-format-unit, '\')">
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="finished" select="false()" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="finished" select="true()" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-number-text-content">
+ <xsl:param name="style-type-name"/>
+ <xsl:param name="number-format-unit"/>
+ <xsl:param name="unit-pos"/>
+ <xsl:param name="condition-pos"/>
+ <xsl:param name="isNumberTextElementOpened" select="false()"/>
+ <xsl:param name="finished" select="false()"/>
+ <xsl:param name="posed-number-format-unit"/>
+ <!-- process number-format-unit by character string parser -->
+ <xsl:choose>
+ <xsl:when test="starts-with( $posed-number-format-unit, '\') or starts-with( $posed-number-format-unit, '*')">
+ <xsl:choose>
+ <xsl:when test="not($finished)">
+ <xsl:call-template name="add-number-text-value">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="isNumberTextElementOpened" select="$isNumberTextElementOpened"/>
+ <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos + 2)"/>
+ <!-- place '*' temparily here, because now StarCalc doesn't support variable filling character definition -->
+ <xsl:with-param name="numberTextValue" select="substring($posed-number-format-unit,2,1)"/>
+ <xsl:with-param name="finished" select="$finished"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos +2)"/>
+ <xsl:with-param name="finished" select="true()"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '_')">
+ <xsl:choose>
+ <xsl:when test="not($finished)">
+ <xsl:call-template name="add-number-text-value">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="isNumberTextElementOpened" select="$isNumberTextElementOpened"/>
+ <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos + 2)"/>
+ <!-- adding an empty string -->
+ <xsl:with-param name="numberTextValue" select="' '"/>
+ <xsl:with-param name="finished" select="$finished"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos + 2)"/>
+ <xsl:with-param name="finished" select="true()"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '&quot;')">
+ <xsl:choose>
+ <xsl:when test="not($finished)">
+ <!-- creating a pre-character string -->
+ <xsl:variable name="pre-character-string" select="substring-before(substring($posed-number-format-unit,2), '&quot;')"/>
+ <xsl:call-template name="add-number-text-value">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + string-length($pre-character-string) + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos + string-length($pre-character-string) + 2)"/>
+ <xsl:with-param name="isNumberTextElementOpened" select="$isNumberTextElementOpened"/>
+ <xsl:with-param name="numberTextValue" select="$pre-character-string"/>
+ <xsl:with-param name="finished" select="$finished"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- creating a pre-character string -->
+ <xsl:variable name="pre-character-string" select="substring-before(substring($posed-number-format-unit,2), '&quot;')"/>
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + string-length($pre-character-string) + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos + string-length($pre-character-string) + 2)"/>
+ <xsl:with-param name="finished" select="true()"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$finished">
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="create-number-format-content">
+ <xsl:param name="style-type-name"/>
+ <xsl:param name="number-format-unit"/>
+ <xsl:param name="unit-pos"/>
+ <xsl:param name="condition-pos"/>
+ <xsl:param name="isNumberTextElementOpened" select="false()"/>
+ <xsl:variable name="posed-number-format-unit" select="substring($number-format-unit,$unit-pos)"/>
+ <xsl:variable name="calendar-type-name">
+ <xsl:if test="contains( $number-format-unit, '[$')">
+ <xsl:variable name="format-code" select="substring-before( substring-after( substring-after( $number-format-unit, '[$'), '-'), ']')"/>
+ <xsl:if test="string-length( $format-code) &gt; 4">
+ <xsl:call-template name="get-calendar-type-name">
+ <xsl:with-param name="calendar-type" select="substring( $format-code, string-length($format-code) -5, 2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:variable>
+ <!-- process number-format-unit by character string parser -->
+ <xsl:choose>
+ <xsl:when test="starts-with( $posed-number-format-unit, '[$') and (not(starts-with($posed-number-format-unit, '[$-') ) )">
+ <xsl:element name="number:currency-symbol">
+ <xsl:call-template name="create-language-country-attribute">
+ <xsl:with-param name="attribute-code" select="substring-before(substring-after(substring-after($posed-number-format-unit,'[$'),'-'),']')"/>
+ </xsl:call-template>
+ <xsl:value-of select="substring-before( substring-after( $posed-number-format-unit, '[$'), '-')"/>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + string-length( substring-before( $posed-number-format-unit, ']') ) + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '\') or starts-with( $posed-number-format-unit, '*') or starts-with( $posed-number-format-unit, '_') or starts-with( $posed-number-format-unit, '&quot;')">
+ <xsl:call-template name="get-number-text-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="(starts-with( $posed-number-format-unit, '0') or starts-with( $posed-number-format-unit, '#') or starts-with( $posed-number-format-unit, '?') ) and (not ( contains( $posed-number-format-unit, 's.00') ) )">
+ <xsl:variable name="valid-number-format-string">
+ <xsl:call-template name="get-valid-number-format-string">
+ <xsl:with-param name="number-format-unit" select="$posed-number-format-unit"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains( $valid-number-format-string, '/')">
+ <xsl:element name="number:fraction">
+ <xsl:attribute name="number:min-integer-digits">
+ <xsl:value-of select="string-length( substring-before($valid-number-format-string, '/') ) - string-length(translate( substring-before($valid-number-format-string, '/'), '0', '') )"/>
+ </xsl:attribute>
+ <xsl:if test="contains( $valid-number-format-string, ',')">
+ <xsl:attribute name="number:grouping">true</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="number:min-numerator-digits">
+ <xsl:value-of select="string-length( substring-before($valid-number-format-string, '/') ) - string-length(translate( substring-before($valid-number-format-string,'/'), '?', '') )"/>
+ </xsl:attribute>
+ <xsl:attribute name="number:min-denominator-digits">
+ <xsl:value-of select="string-length(substring-after($valid-number-format-string, '/') )"/>
+ </xsl:attribute>
+ <!-- deal with number:embedded-text (removed, as SCHEMA demands element to be empty)
+ <xsl:call-template name="create-number-format-embedded-text">
+ <xsl:with-param name="adapted-number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ -->
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="contains( $valid-number-format-string, '%')">
+ <xsl:element name="number:number">
+ <xsl:choose>
+ <xsl:when test="contains( $valid-number-format-string, '.')">
+ <xsl:attribute name="number:decimal-places">
+ <xsl:value-of select="string-length( substring-before( substring-after( $valid-number-format-string, '.'), '%') ) - string-length( translate( substring-before( substring-after( $valid-number-format-string, '.'), '%'), '0', '') )"/>
+ </xsl:attribute>
+ <xsl:attribute name="number:min-integer-digits">
+ <xsl:value-of select="string-length( substring-before($valid-number-format-string, '.') ) - string-length(translate( substring-before($valid-number-format-string, '.'), '0', '') )"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="number:decimal-places">0</xsl:attribute>
+ <xsl:attribute name="number:min-integer-digits">
+ <xsl:value-of select="string-length( substring-before($valid-number-format-string, '%') ) - string-length(translate( substring-before($valid-number-format-string, '%'), '0', '') )"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="contains( $valid-number-format-string, ',') and (substring( $valid-number-format-string,string-length($valid-number-format-string)) = ',')">
+ <xsl:variable name="display-factor">
+ <xsl:call-template name="get-display-factor">
+ <xsl:with-param name="start-number" select="1"/>
+ <xsl:with-param name="thousand-count" select="string-length($valid-number-format-string) - string-length( translate($valid-number-format-string, ',', '') )"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="number:display-factor">
+ <xsl:value-of select="$display-factor"/>
+ </xsl:attribute>
+ <xsl:attribute name="number:grouping">true</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains( $valid-number-format-string, ',')">
+ <xsl:attribute name="number:grouping">true</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <!-- deal with number:embedded-text -->
+ <xsl:call-template name="create-number-format-embedded-text">
+ <xsl:with-param name="adapted-number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:element>
+ <number:text>%</number:text>
+ </xsl:when>
+ <xsl:when test="contains( $valid-number-format-string, 'E') or contains ($valid-number-format-string, 'e')">
+ <xsl:element name="number:scientific-number">
+ <xsl:choose>
+ <xsl:when test="contains( $valid-number-format-string, '.')">
+ <xsl:attribute name="number:decimal-places">
+ <xsl:value-of select="string-length( substring-before( substring-after( $valid-number-format-string, '.'), 'E') ) - string-length( translate( substring-before( substring-after( $valid-number-format-string, '.'), 'E'), '0', '') )"/>
+ </xsl:attribute>
+ <xsl:attribute name="number:min-integer-digits">
+ <xsl:value-of select="string-length( substring-before($valid-number-format-string, '.') ) - string-length(translate( substring-before($valid-number-format-string, '.'), '0', '') )"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="number:decimal-places">0</xsl:attribute>
+ <xsl:attribute name="number:min-integer-digits">
+ <xsl:value-of select="string-length( substring-before($valid-number-format-string, 'E') ) - string-length(translate( substring-before($valid-number-format-string, 'E'), '0', '') )"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="number:min-exponent-digits">
+ <xsl:value-of select="string-length( substring-after( $valid-number-format-string, 'E') ) - string-length( translate( substring-after( $valid-number-format-string, 'E'), '0', '') )"/>
+ </xsl:attribute>
+ <!-- deal with number:embedded-text -->
+ <xsl:call-template name="create-number-format-embedded-text">
+ <xsl:with-param name="adapted-number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- -normal number format, currency, and accounting, e.g -->
+ <xsl:element name="number:number">
+ <xsl:choose>
+ <xsl:when test="contains( $valid-number-format-string, '.')">
+ <xsl:attribute name="number:decimal-places">
+ <xsl:value-of select="string-length( substring-after( $valid-number-format-string, '.') ) - string-length( translate( substring-after( $valid-number-format-string, '.'), '0', '') )"/>
+ </xsl:attribute>
+ <xsl:attribute name="number:min-integer-digits">
+ <xsl:value-of select="string-length( substring-before($valid-number-format-string, '.') ) - string-length(translate( substring-before($valid-number-format-string, '.'), '0', '') )"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="number:decimal-places">0</xsl:attribute>
+ <xsl:attribute name="number:min-integer-digits">
+ <xsl:value-of select="string-length( $valid-number-format-string ) - string-length(translate( $valid-number-format-string, '0', '') )"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="contains( $valid-number-format-string, ',') and (substring( $valid-number-format-string,string-length($valid-number-format-string)) = ',')">
+ <xsl:variable name="display-factor">
+ <xsl:call-template name="get-display-factor">
+ <xsl:with-param name="start-number" select="1"/>
+ <xsl:with-param name="thousand-count">
+ <xsl:call-template name="thousand-count-temp">
+ <xsl:with-param name="format-unit" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="number:display-factor">
+ <xsl:value-of select="$display-factor"/>
+ </xsl:attribute>
+ <xsl:attribute name="number:grouping">true</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains( $valid-number-format-string, ',')">
+ <xsl:attribute name="number:grouping">true</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <!-- deal with number:embedded-text -->
+ <xsl:call-template name="create-number-format-embedded-text">
+ <xsl:with-param name="adapted-number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- deal with post number:text -->
+ <xsl:variable name="post-number-format-text">
+ <xsl:call-template name="get-post-number-format-text">
+ <xsl:with-param name="adapted-number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$post-number-format-text"/>
+ <xsl:with-param name="unit-pos" select="1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'ggg')">
+ <xsl:element name="number:era">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'gg')">
+ <xsl:element name="number:era">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'g')">
+ <xsl:element name="number:era">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'ee')">
+ <xsl:element name="number:year">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'r')">
+ <xsl:element name="number:year">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'yyyy')">
+ <xsl:element name="number:year">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'yy')">
+ <xsl:element name="number:year">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'e') or starts-with( $posed-number-format-unit, 'y')">
+ <xsl:element name="number:year">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'mmmmm')">
+ <xsl:element name="number:month">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ <xsl:attribute name="number:textual">true</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 5"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'mmmm')">
+ <xsl:element name="number:month">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ <xsl:attribute name="number:textual">true</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'mmm')">
+ <xsl:element name="number:month">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ <xsl:attribute name="number:textual">true</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '[mm]')">
+ <xsl:element name="number:minutes">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '[m]')">
+ <xsl:element name="number:minutes">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'mm') and ( contains( $number-format-unit, 'h') or contains( $posed-number-format-unit, 's') )">
+ <xsl:element name="number:minutes">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'mm')">
+ <xsl:element name="number:month">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'm') and ( contains( $number-format-unit, 'h') or contains( $posed-number-format-unit, 's') )">
+ <xsl:element name="number:minutes">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'm')">
+ <xsl:element name="number:month">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'dddd') or starts-with( $posed-number-format-unit, 'aaaa')">
+ <xsl:element name="number:day-of-week">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'ddd') or starts-with( $posed-number-format-unit, 'aaa')">
+ <xsl:element name="number:day-of-week">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'dd')">
+ <xsl:element name="number:day">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'd')">
+ <xsl:element name="number:day">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ <xsl:if test="string-length($calendar-type-name) &gt; 0">
+ <xsl:attribute name="number:calendar">
+ <xsl:value-of select="$calendar-type-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'hh')">
+ <xsl:element name="number:hours">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 2"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '[hh]')">
+ <xsl:element name="number:hours">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'h')">
+ <xsl:element name="number:hours">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '[h]')">
+ <xsl:element name="number:hours">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'AM/PM') or starts-with( $posed-number-format-unit, 'am/pm')">
+ <number:am-pm/>
+ <!-- long: am-pm doesn't support long style yet -->
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 5"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'a/p'or starts-with( $posed-number-format-unit, 'A/P'))">
+ <number:am-pm/>
+ <!-- short: am-pm doesn't support short style yet -->
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'ss')">
+ <xsl:variable name="decimal-places">
+ <xsl:choose>
+ <xsl:when test="starts-with( $posed-number-format-unit, 'ss.0')">
+ <xsl:value-of select="string-length( $posed-number-format-unit) - string-length( translate( $posed-number-format-unit, '0', '') )"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="number:seconds">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ <xsl:if test="$decimal-places &gt; 0">
+ <xsl:attribute name="number:decimal-places">
+ <xsl:value-of select="$decimal-places"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:variable name="second-length">
+ <xsl:choose>
+ <xsl:when test="$decimal-places &gt; 0">
+ <xsl:value-of select="$decimal-places + 3"/>
+ </xsl:when>
+ <xsl:otherwise>2</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + $second-length"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '[ss]')">
+ <xsl:element name="number:seconds">
+ <xsl:attribute name="number:style">long</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 4"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, 's')">
+ <xsl:variable name="decimal-places">
+ <xsl:choose>
+ <xsl:when test="starts-with( $posed-number-format-unit, 's.0')">
+ <xsl:value-of select="string-length( $posed-number-format-unit) - string-length( translate( $posed-number-format-unit, '0', '') )"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="number:seconds">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ <xsl:if test="$decimal-places &gt; 0">
+ <xsl:attribute name="number:decimal-places">
+ <xsl:value-of select="$decimal-places"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:variable name="second-length">
+ <xsl:choose>
+ <xsl:when test="$decimal-places &gt; 0">
+ <xsl:value-of select="$decimal-places + 2"/>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + $second-length"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '[s]')">
+ <xsl:element name="number:seconds">
+ <xsl:attribute name="number:style">short</xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 3"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '@')">
+ <number:text-content/>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'General Number'">
+ <number:number number:decimal-places="0" number:min-integer-digits="1"/>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'General Date'">
+ <number:year number:style="long"/>
+ <number:text>-</number:text>
+ <number:month number:style="short"/>
+ <number:text>-</number:text>
+ <number:day number:style="short"/>
+ <number:text>
+ <xsl:text> </xsl:text>
+ </number:text>
+ <number:hours number:style="short"/>
+ <number:text>:</number:text>
+ <number:minutes number:style="long"/>
+ </xsl:when>
+ <!-- special for General number:text-content output -->
+ <xsl:when test="starts-with($posed-number-format-unit , 'General')">
+ <xsl:choose>
+ <xsl:when test="$posed-number-format-unit = 'General' and $condition-pos = 1">
+ <number:number number:decimal-places="0" number:min-integer-digits="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="8"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'Fixed'">
+ <number:number number:decimal-places="2" number:min-integer-digits="1"/>
+ <number:text/>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'Standard'">
+ <number:number number:decimal-places="2" number:min-integer-digits="1" number:grouping="true"/>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'Long Date'">
+ <number:year number:style="long"/>
+ <number:text>-</number:text>
+ <number:month number:style="long"/>
+ <number:text>-</number:text>
+ <number:day number:style="long"/>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'Medium Date'">
+ <number:day number:style="short"/>
+ <number:text>-</number:text>
+ <number:month number:textual="true"/>
+ <number:text>-</number:text>
+ <number:year number:style="short"/>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'Short Date'">
+ <number:day number:style="short"/>
+ <number:text>-</number:text>
+ <number:month number:style="short"/>
+ <number:text>-</number:text>
+ <number:year number:style="short"/>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'Long Time'">
+ <number:hours number:style="long"/>
+ <number:text>:</number:text>
+ <number:minutes number:style="long"/>
+ <number:text>:</number:text>
+ <number:seconds number:style="long"/>
+ <number:text>
+ <xsl:text> </xsl:text>
+ </number:text>
+ <number:am-pm/>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'Medium Time'">
+ <number:hours number:style="short"/>
+ <number:text>:</number:text>
+ <number:minutes number:style="long"/>
+ <number:text>
+ <xsl:text> </xsl:text>
+ </number:text>
+ <number:am-pm/>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'Short Time'">
+ <number:hours number:style="short"/>
+ <number:text>:</number:text>
+ <number:minutes number:style="long"/>
+ <number:text>
+ <xsl:text> </xsl:text>
+ </number:text>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'Percent'">
+ <number:number number:decimal-places="2" number:min-integer-digits="1"/>
+ <number:text>%</number:text>
+ </xsl:when>
+ <xsl:when test="$posed-number-format-unit = 'Scientific'">
+ <number:scientific-number number:decimal-places="2" number:min-integer-digits="1" number:min-exponent-digits="2"/>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '[')">
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + string-length( substring-before( $posed-number-format-unit, ']') ) + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="isNumberTextElementOpened" select="$isNumberTextElementOpened"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, '/')">
+ <number:text>/</number:text>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( $posed-number-format-unit, ':')">
+ <number:text>:</number:text>
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="string-length( $posed-number-format-unit ) &gt; 0">
+ <xsl:call-template name="create-number-format-content">
+ <xsl:with-param name="style-type-name" select="$style-type-name"/>
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ <xsl:with-param name="unit-pos" select="$unit-pos + 1"/>
+ <xsl:with-param name="condition-pos" select="$condition-pos"/>
+ <xsl:with-param name="isNumberTextElementOpened" select="$isNumberTextElementOpened"/>
+ <xsl:with-param name="posed-number-format-unit" select="$posed-number-format-unit"/>
+ <xsl:with-param name="numberTextValue" select="substring( $posed-number-format-unit, 1, 1)"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="thousand-count-temp">
+ <!-- thousand count for char ',' at the latter of format-unit by recursion -->
+ <xsl:param name="format-unit"/>
+ <xsl:choose>
+ <xsl:when test="contains($format-unit, ',#')">
+ <xsl:call-template name="thousand-count-temp">
+ <xsl:with-param name="format-unit" select="substring-after($format-unit, ',#')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains($format-unit, ',0')">
+ <xsl:call-template name="thousand-count-temp">
+ <xsl:with-param name="format-unit" select="substring-after($format-unit, ',0')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="string-length($format-unit) - string-length( translate($format-unit, ',', ''))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-calendar-type-name">
+ <xsl:param name="calendar-type"/>
+ <xsl:variable name="temp-type">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="$calendar-type"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="string-length($calendar-type)"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <!-- Japanese (Emperor era), #03 -->
+ <xsl:when test="$temp-type = 3">gengou</xsl:when>
+ <!-- Taiwanese, #04 -->
+ <xsl:when test="$temp-type = 4">ROC</xsl:when>
+ <!-- Korean (Tangun era) hanja_yoil is ok too. #05 -->
+ <xsl:when test="$temp-type = 5">hanja</xsl:when>
+ <!-- Hijri (Arabic lunar), #06 -->
+ <xsl:when test="$temp-type = 6">hijri</xsl:when>
+ <!-- Thai, #07 -->
+ <xsl:when test="$temp-type = 7">buddhist</xsl:when>
+ <!-- 01: Gregorian (Localized), 02: Gregorian (United States), 09: Gregorian (Middle East French), 0A: Gregorian (Arabic), 0B: Gregorian (Transliterated English) -->
+ <xsl:otherwise>gregorian</xsl:otherwise>
+ <!-- not found jewish yet -->
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-valid-number-format-string">
+ <xsl:param name="number-format-unit"/>
+ <xsl:choose>
+ <xsl:when test="contains( $number-format-unit, '\')">
+ <xsl:call-template name="get-valid-number-format-string">
+ <xsl:with-param name="number-format-unit" select="concat( substring-before( $number-format-unit, '\'), substring( substring-after( $number-format-unit, '\'), 2) )"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains( $number-format-unit, '*')">
+ <xsl:call-template name="get-valid-number-format-string">
+ <xsl:with-param name="number-format-unit" select="concat( substring-before( $number-format-unit, '*'), substring( substring-after( $number-format-unit, '*'), 2) )"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains( $number-format-unit, '_')">
+ <xsl:call-template name="get-valid-number-format-string">
+ <xsl:with-param name="number-format-unit" select="concat( substring-before( $number-format-unit, '_'), substring( substring-after( $number-format-unit, '_'), 2) )"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains( $number-format-unit, '&quot;')">
+ <xsl:call-template name="get-valid-number-format-string">
+ <xsl:with-param name="number-format-unit" select="concat( substring-before( $number-format-unit, '&quot;'), substring-after( substring-after( $number-format-unit, '&quot;'), '&quot;') )"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$number-format-unit"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-display-factor">
+ <xsl:param name="start-number"/>
+ <xsl:param name="thousand-count"/>
+ <xsl:choose>
+ <xsl:when test="$thousand-count = 0">
+ <xsl:value-of select="$start-number"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="get-display-factor">
+ <xsl:with-param name="start-number" select="$start-number * 1000"/>
+ <xsl:with-param name="thousand-count" select="$thousand-count -1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-post-number-format-text">
+ <xsl:param name="adapted-number-format-unit"/>
+ <xsl:param name="valid-number-format-string"/>
+ <xsl:variable name="first-embedded-character-pos">
+ <xsl:choose>
+ <xsl:when test="contains( $adapted-number-format-unit, '\')">
+ <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '\') ) + 1"/>
+ </xsl:when>
+ <xsl:when test="contains( $adapted-number-format-unit, '_')">
+ <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '_') ) + 1"/>
+ </xsl:when>
+ <xsl:when test="contains( $adapted-number-format-unit, '*')">
+ <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '*') ) + 1"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="first-embedded-string-pos">
+ <xsl:choose>
+ <xsl:when test="contains( $adapted-number-format-unit, '&quot;')">
+ <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '&quot;') ) + 1"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="first-embedded-text-pos">
+ <xsl:choose>
+ <xsl:when test="$first-embedded-character-pos &lt; $first-embedded-string-pos and $first-embedded-character-pos &gt; 0">
+ <xsl:value-of select="$first-embedded-character-pos"/>
+ </xsl:when>
+ <xsl:when test="$first-embedded-character-pos &lt; $first-embedded-string-pos and $first-embedded-character-pos = 0">
+ <xsl:value-of select="$first-embedded-string-pos"/>
+ </xsl:when>
+ <xsl:when test="$first-embedded-character-pos &gt; $first-embedded-string-pos and $first-embedded-string-pos &gt; 0">
+ <xsl:value-of select="$first-embedded-string-pos"/>
+ </xsl:when>
+ <xsl:when test="$first-embedded-character-pos &gt; $first-embedded-string-pos and $first-embedded-string-pos = 0">
+ <xsl:value-of select="$first-embedded-character-pos"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-embedded-text-pos &gt; string-length( $valid-number-format-string )">
+ <xsl:value-of select="substring( $adapted-number-format-unit, $first-embedded-text-pos)"/>
+ </xsl:when>
+ <xsl:when test="$first-embedded-text-pos &gt; 0 and $first-embedded-text-pos &lt; string-length( $valid-number-format-string )">
+ <xsl:choose>
+ <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '\')">
+ <xsl:call-template name="get-post-number-format-text">
+ <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '\'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '_')">
+ <xsl:call-template name="get-post-number-format-text">
+ <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '_'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '*')">
+ <xsl:call-template name="get-post-number-format-text">
+ <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '*'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '&quot;')">
+ <xsl:call-template name="get-post-number-format-text">
+ <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '&quot;'), substring-after( substring-after( $adapted-number-format-unit, '&quot;'), '&quot;') )"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="create-number-format-embedded-text">
+ <xsl:param name="adapted-number-format-unit"/>
+ <xsl:param name="valid-number-format-string"/>
+ <xsl:variable name="first-embedded-character-pos">
+ <xsl:choose>
+ <xsl:when test="contains( $adapted-number-format-unit, '\')">
+ <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '\') ) + 1"/>
+ </xsl:when>
+ <xsl:when test="contains( $adapted-number-format-unit, '_')">
+ <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '_') ) + 1"/>
+ </xsl:when>
+ <xsl:when test="contains( $adapted-number-format-unit, '*')">
+ <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '*') ) + 1"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="first-embedded-string-pos">
+ <xsl:choose>
+ <xsl:when test="contains( $adapted-number-format-unit, '&quot;')">
+ <xsl:value-of select="string-length( substring-before($adapted-number-format-unit, '&quot;') ) + 1"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="first-embedded-text-pos">
+ <xsl:choose>
+ <xsl:when test="$first-embedded-character-pos &lt; $first-embedded-string-pos and $first-embedded-character-pos &gt; 0">
+ <xsl:value-of select="$first-embedded-character-pos"/>
+ </xsl:when>
+ <xsl:when test="$first-embedded-character-pos &lt; $first-embedded-string-pos and $first-embedded-character-pos = 0">
+ <xsl:value-of select="$first-embedded-string-pos"/>
+ </xsl:when>
+ <xsl:when test="$first-embedded-character-pos &gt; $first-embedded-string-pos and $first-embedded-string-pos &gt; 0">
+ <xsl:value-of select="$first-embedded-string-pos"/>
+ </xsl:when>
+ <xsl:when test="$first-embedded-character-pos &gt; $first-embedded-string-pos and $first-embedded-string-pos = 0">
+ <xsl:value-of select="$first-embedded-character-pos"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$first-embedded-text-pos &gt; 0 and $first-embedded-text-pos &lt; string-length( $valid-number-format-string )">
+ <xsl:variable name="text-pos">
+ <xsl:choose>
+ <xsl:when test="contains( $valid-number-format-string, '.')">
+ <xsl:variable name="right-text-pos" select="substring( substring-before( $valid-number-format-string, '.'), $first-embedded-text-pos)"/>
+ <xsl:value-of select="string-length($right-text-pos) - string-length( translate( $right-text-pos, '0#?', '') )"/>
+ </xsl:when>
+ <xsl:when test="contains( $valid-number-format-string, '/')">
+ <xsl:variable name="right-text-pos" select="substring( substring-before( $valid-number-format-string, '/'), $first-embedded-text-pos)"/>
+ <xsl:value-of select="string-length($right-text-pos) - string-length( translate( $right-text-pos, '0#?', '') )"/>
+ </xsl:when>
+ <xsl:when test="contains( $valid-number-format-string, '%')">
+ <xsl:variable name="right-text-pos" select="substring( substring-before( $valid-number-format-string, '%'), $first-embedded-text-pos)"/>
+ <xsl:value-of select="string-length($right-text-pos) - string-length( translate( $right-text-pos, '0#?', '') )"/>
+ </xsl:when>
+ <xsl:when test="contains( $valid-number-format-string, 'E')">
+ <xsl:variable name="right-text-pos" select="substring( substring-before( $valid-number-format-string, 'E'), $first-embedded-text-pos)"/>
+ <xsl:value-of select="string-length($right-text-pos) - string-length( translate( $right-text-pos, '0#?', '') )"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="right-text-pos" select="substring( $valid-number-format-string, $first-embedded-text-pos)"/>
+ <xsl:value-of select="string-length($right-text-pos) - string-length( translate( $right-text-pos, '0#?', '') )"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '\')">
+ <number:embedded-text number:position="{$text-pos}">
+ <xsl:value-of select="substring( $adapted-number-format-unit, $first-embedded-text-pos + 1, 1)"/>
+ </number:embedded-text>
+ <xsl:call-template name="create-number-format-embedded-text">
+ <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '\'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '_')">
+ <number:embedded-text number:position="{$text-pos}">
+ <xsl:value-of select="substring( $adapted-number-format-unit, $first-embedded-text-pos + 1, 1)"/>
+ </number:embedded-text>
+ <xsl:call-template name="create-number-format-embedded-text">
+ <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '_'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '*')">
+ <number:embedded-text number:position="{$text-pos}">
+ <xsl:value-of select="substring( $adapted-number-format-unit, $first-embedded-text-pos + 1, 1)"/>
+ </number:embedded-text>
+ <xsl:call-template name="create-number-format-embedded-text">
+ <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '*'), substring( $adapted-number-format-unit, $first-embedded-text-pos + 2) )"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with( substring( $adapted-number-format-unit, $first-embedded-text-pos, 1), '&quot;')">
+ <number:embedded-text number:position="{$text-pos}">
+ <xsl:value-of select="substring-before( substring( $adapted-number-format-unit, $first-embedded-text-pos + 1), '&quot;')"/>
+ </number:embedded-text>
+ <xsl:call-template name="create-number-format-embedded-text">
+ <xsl:with-param name="adapted-number-format-unit" select="concat( substring-before( $adapted-number-format-unit, '&quot;'), substring-after( substring-after( $adapted-number-format-unit, '&quot;'), '&quot;') )"/>
+ <xsl:with-param name="valid-number-format-string" select="$valid-number-format-string"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="create-master-styles">
+ <xsl:param name="worksheetoptions"/>
+ <xsl:for-each select="$worksheetoptions">
+ <xsl:element name="style:master-page">
+ <xsl:attribute name="style:name">
+ <xsl:call-template name="encode-as-nc-name">
+ <xsl:with-param name="string" select="concat( 'TAB_', ../@ss:Name)"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:attribute name="style:display-name">
+ <xsl:value-of select="concat( 'PageStyle_', ../@ss:Name)"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:page-layout-name">
+ <xsl:call-template name="encode-as-nc-name">
+ <xsl:with-param name="string" select="concat( 'pm_', ../@ss:Name)"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="x:PageSetup/x:Header/@x:Data">
+ <style:header>
+ <xsl:call-template name="translate-header-footer">
+ <xsl:with-param name="content" select="x:PageSetup/x:Header/@x:Data"/>
+ <xsl:with-param name="style-name-header" select="concat(../@ss:Name, substring(name(x:PageSetup/x:Header),1,1))"/>
+ </xsl:call-template>
+ </style:header>
+ </xsl:when>
+ <xsl:otherwise>
+ <style:header style:display="false"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="x:PageSetup/x:Footer/@x:Data">
+ <style:footer>
+ <xsl:call-template name="translate-header-footer">
+ <xsl:with-param name="content" select="x:PageSetup/x:Footer/@x:Data"/>
+ <xsl:with-param name="style-name-header" select="concat(../@ss:Name, substring(name(x:PageSetup/x:Footer),1,1))"/>
+ </xsl:call-template>
+ </style:footer>
+ </xsl:when>
+ <xsl:otherwise>
+ <style:footer style:display="false"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="translate-header-footer">
+ <xsl:param name="content"/>
+ <xsl:param name="style-name-header"/>
+ <style:region-left>
+ <text:p>
+ <xsl:variable name="left-content">
+ <xsl:call-template name="get-pos-content">
+ <xsl:with-param name="content" select="$content"/>
+ <xsl:with-param name="pos" select="'left'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="locate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="$left-content"/>
+ <xsl:with-param name="style-name-header" select="concat($style-name-header,'L')"/>
+ <xsl:with-param name="index" select="0"/>
+ <xsl:with-param name="current-pos" select="1"/>
+ </xsl:call-template>
+ </text:p>
+ </style:region-left>
+ <style:region-center>
+ <text:p>
+ <xsl:variable name="center-content">
+ <xsl:call-template name="get-pos-content">
+ <xsl:with-param name="content" select="$content"/>
+ <xsl:with-param name="pos" select="'center'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="locate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="$center-content"/>
+ <xsl:with-param name="style-name-header" select="concat($style-name-header,'C')"/>
+ <xsl:with-param name="index" select="0"/>
+ <xsl:with-param name="current-pos" select="1"/>
+ </xsl:call-template>
+ </text:p>
+ </style:region-center>
+ <style:region-right>
+ <text:p>
+ <xsl:variable name="right-content">
+ <xsl:call-template name="get-pos-content">
+ <xsl:with-param name="content" select="$content"/>
+ <xsl:with-param name="pos" select="'right'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="locate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="$right-content"/>
+ <xsl:with-param name="style-name-header" select="concat($style-name-header,'R')"/>
+ <xsl:with-param name="index" select="0"/>
+ <xsl:with-param name="current-pos" select="1"/>
+ </xsl:call-template>
+ </text:p>
+ </style:region-right>
+ </xsl:template>
+ <xsl:template name="locate-header-footer-data">
+ <xsl:param name="header-footer-data"/>
+ <xsl:param name="style-name-header"/>
+ <xsl:param name="index"/>
+ <xsl:param name="current-pos"/>
+ <xsl:variable name="current-style-data">
+ <xsl:value-of select="substring($header-footer-data,$current-pos)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with($current-style-data,'&amp;X') or starts-with($current-style-data,'&amp;Y') or starts-with($current-style-data,'&amp;S') or starts-with($current-style-data,'&amp;U') or starts-with($current-style-data,'&amp;E') or starts-with($current-style-data,'&amp;B')">
+ <xsl:call-template name="locate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="$header-footer-data"/>
+ <xsl:with-param name="style-name-header" select="$style-name-header"/>
+ <xsl:with-param name="index" select="$index"/>
+ <xsl:with-param name="current-pos" select="$current-pos+2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;0') or starts-with($current-style-data,'&amp;1') or starts-with($current-style-data,'&amp;2') or starts-with($current-style-data,'&amp;3') or starts-with($current-style-data,'&amp;4') or starts-with($current-style-data,'&amp;5') or starts-with($current-style-data,'&amp;6') or starts-with($current-style-data,'&amp;7') or starts-with($current-style-data,'&amp;8') or starts-with($current-style-data,'&amp;9')">
+ <xsl:variable name="font-size-length">
+ <xsl:call-template name="get-digit-length">
+ <xsl:with-param name="complexive-string" select="substring-after($current-style-data,'&amp;')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="locate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="$header-footer-data"/>
+ <xsl:with-param name="style-name-header" select="$style-name-header"/>
+ <xsl:with-param name="index" select="$index"/>
+ <xsl:with-param name="current-pos" select="$current-pos+1+$font-size-length"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;&quot;')">
+ <xsl:call-template name="locate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="$header-footer-data"/>
+ <xsl:with-param name="style-name-header" select="$style-name-header"/>
+ <xsl:with-param name="index" select="$index"/>
+ <xsl:with-param name="current-pos" select="string-length(substring-before(substring($header-footer-data,$current-pos+2),'&quot;'))+$current-pos+3"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="current-content-last-pos">
+ <xsl:call-template name="get-current-content-last-pos">
+ <xsl:with-param name="style-data" select="$header-footer-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$current-pos &gt; 1">
+ <text:span text:style-name="{concat($style-name-header,$index)}">
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring($header-footer-data,$current-pos,$current-content-last-pos+1-$current-pos)"/>
+ </xsl:call-template>
+ </text:span>
+ <xsl:if test="$current-content-last-pos &lt; string-length($header-footer-data)">
+ <xsl:call-template name="locate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="$header-footer-data"/>
+ <xsl:with-param name="style-name-header" select="$style-name-header"/>
+ <xsl:with-param name="index" select="$index+1"/>
+ <xsl:with-param name="current-pos" select="$current-content-last-pos+1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring($header-footer-data,$current-pos,$current-content-last-pos+1-$current-pos)"/>
+ </xsl:call-template>
+ <xsl:if test="$current-content-last-pos &lt; string-length($header-footer-data)">
+ <xsl:call-template name="locate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="$header-footer-data"/>
+ <xsl:with-param name="style-name-header" select="$style-name-header"/>
+ <xsl:with-param name="index" select="$index"/>
+ <xsl:with-param name="current-pos" select="$current-content-last-pos+1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-current-content-last-pos">
+ <xsl:param name="style-data"/>
+ <xsl:param name="current-pos"/>
+ <xsl:variable name="current-style-data">
+ <xsl:value-of select="substring($style-data,$current-pos)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with($current-style-data,'&amp;&quot;') or starts-with($current-style-data,'&amp;X') or starts-with($current-style-data,'&amp;Y') or starts-with($current-style-data,'&amp;S') or starts-with($current-style-data,'&amp;U') or starts-with($current-style-data,'&amp;E') or starts-with($current-style-data,'&amp;B')or starts-with($current-style-data,'&amp;0') or starts-with($current-style-data,'&amp;1') or starts-with($current-style-data,'&amp;2') or starts-with($current-style-data,'&amp;3') or starts-with($current-style-data,'&amp;4') or starts-with($current-style-data,'&amp;5') or starts-with($current-style-data,'&amp;6') or starts-with($current-style-data,'&amp;7') or starts-with($current-style-data,'&amp;8') or starts-with($current-style-data,'&amp;9')">
+ <xsl:value-of select="$current-pos - 1"/>
+ </xsl:when>
+ <xsl:when test="contains($current-style-data,'&amp;&quot;') or contains($current-style-data,'&amp;X') or contains($current-style-data,'&amp;Y') or contains($current-style-data,'&amp;S') or contains($current-style-data,'&amp;U') or contains($current-style-data,'&amp;E') or contains($current-style-data,'&amp;B')or contains($current-style-data,'&amp;0') or contains($current-style-data,'&amp;1') or contains($current-style-data,'&amp;2') or contains($current-style-data,'&amp;3') or contains($current-style-data,'&amp;4') or contains($current-style-data,'&amp;5') or contains($current-style-data,'&amp;6') or contains($current-style-data,'&amp;7') or contains($current-style-data,'&amp;8') or contains($current-style-data,'&amp;9')">
+ <xsl:variable name="temp" select="substring-before(substring($current-style-data,2),'&amp;')"/>
+ <xsl:variable name="next-amp-pos">
+ <xsl:value-of select="$current-pos+string-length($temp)+1"/>
+ </xsl:variable>
+ <xsl:call-template name="get-current-content-last-pos">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$next-amp-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="string-length($style-data)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="translate-header-footer-data">
+ <xsl:param name="header-footer-data"/>
+ <xsl:choose>
+ <xsl:when test="contains( $header-footer-data, '&amp;D')">
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;D')"/>
+ </xsl:call-template>
+ <text:date/>
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;D')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains( $header-footer-data, '&amp;T')">
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;T')"/>
+ </xsl:call-template>
+ <text:time/>
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;T')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains( $header-footer-data, '&amp;P')">
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;P')"/>
+ </xsl:call-template>
+ <text:page-number/>
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;P')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains( $header-footer-data, '&amp;N')">
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;N')"/>
+ </xsl:call-template>
+ <text:page-count/>
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;N')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains( $header-footer-data, '&amp;A')">
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;A')"/>
+ </xsl:call-template>
+ <text:sheet-name/>
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;A')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains( $header-footer-data, '&amp;Z&amp;F')">
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;Z&amp;F')"/>
+ </xsl:call-template>
+ <text:file-name text:display="full"/>
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;Z&amp;F')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains( $header-footer-data, '&amp;Z')">
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;Z')"/>
+ </xsl:call-template>
+ <text:file-name text:display="path"/>
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;Z')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains( $header-footer-data, '&amp;F')">
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-before( $header-footer-data, '&amp;F')"/>
+ </xsl:call-template>
+ <text:file-name text:display="name"/>
+ <xsl:call-template name="translate-header-footer-data">
+ <xsl:with-param name="header-footer-data" select="substring-after( $header-footer-data, '&amp;F')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$header-footer-data"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="create-page-master">
+ <xsl:param name="worksheetoptions"/>
+ <xsl:for-each select="$worksheetoptions">
+ <xsl:element name="style:page-layout">
+ <xsl:attribute name="style:name">
+ <xsl:call-template name="encode-as-nc-name">
+ <xsl:with-param name="string" select="concat( 'pm_', ../@ss:Name)"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:element name="style:page-layout-properties">
+ <xsl:choose>
+ <xsl:when test="x:PageSetup/x:Layout/@x:Orientation = 'Landscape'">
+ <xsl:attribute name="style:print-orientation">landscape</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:print-orientation">portrait</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="x:PageSetup/x:Layout/@x:StartPageNumber">
+ <xsl:attribute name="style:first-page-number">
+ <xsl:value-of select="x:PageSetup/x:Layout/@x:StartPageNumber"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:first-page-number">continue</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="x:PageSetup/x:PageMargins">
+ <xsl:attribute name="fo:margin-top">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(x:PageSetup/x:PageMargins/@x:Top,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="fo:margin-bottom">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(x:PageSetup/x:PageMargins/@x:Bottom,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="fo:margin-left">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(x:PageSetup/x:PageMargins/@x:Left,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ <xsl:attribute name="fo:margin-right">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(x:PageSetup/x:PageMargins/@x:Right,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test="x:PageSetup/x:Header">
+ <style:header-style>
+ <xsl:element name="style:header-footer-properties">
+ <xsl:attribute name="fo:min-height">0.75cm</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="x:PageSetup/x:Header/@x:Margin">
+ <xsl:attribute name="fo:margin-bottom">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(x:PageSetup/x:Header/@x:Margin,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:margin-bottom">0.25cm</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </style:header-style>
+ </xsl:if>
+ <xsl:if test="x:PageSetup/x:Footer">
+ <style:footer-style>
+ <xsl:element name="style:header-footer-properties">
+ <xsl:attribute name="fo:min-height">0.75cm</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="x:PageSetup/x:Footer/@x:Margin">
+ <xsl:attribute name="fo:margin-top">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(x:PageSetup/x:Footer/@x:Margin,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:margin-top">0.25cm</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </style:footer-style>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="ss:Style" name="style-style-content" mode="style-style-content">
+ <xsl:element name="style:table-cell-properties">
+ <xsl:if test="ss:Alignment">
+ <xsl:if test="ss:Alignment/@ss:Vertical">
+ <xsl:variable name="vertical-align">
+ <xsl:choose>
+ <xsl:when test="ss:Alignment/@ss:Vertical = 'Top'">top</xsl:when>
+ <xsl:when test="ss:Alignment/@ss:Vertical = 'Center'">middle</xsl:when>
+ <xsl:when test="ss:Alignment/@ss:Vertical = 'Bottom'">bottom</xsl:when>
+ <xsl:when test="ss:Alignment/@ss:Vertical = 'Automatic'">middle</xsl:when>
+ <!-- actually for vertical written characters, not supported by StarOffice/OpenOffice now yet -->
+ <xsl:otherwise>middle</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="style:vertical-align">
+ <xsl:value-of select="$vertical-align"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ss:Alignment/@ss:WrapText = '1'">
+ <xsl:attribute name="fo:wrap-option">wrap</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ss:Alignment/@ss:Indent">
+ <xsl:attribute name="fo:padding-left"><!-- Indent is ten times of a point -->
+ <xsl:variable name="indent" select="ss:Alignment/@ss:Indent * 10"/>
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat($indent,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ss:Alignment/@ss:Rotate">
+ <xsl:attribute name="style:rotation-angle">
+ <xsl:choose>
+ <xsl:when test="ss:Alignment/@ss:Rotate &lt; 0">
+ <xsl:value-of select="360 + ss:Alignment/@ss:Rotate"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="ss:Alignment/@ss:Rotate"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="style:rotation-align">none</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ss:Alignment/@ss:VerticalText = '1'">
+ <xsl:attribute name="style:direction">ttb</xsl:attribute>
+ <!-- The horizontal align default for vertical text in Excel is 'center' -->
+ <xsl:if test="not(ss:Alignment/@ss:Horizontal)">
+ <!-- OASIS XML removal
+ <xsl:attribute name="fo:text-align">center</xsl:attribute>-->
+ <xsl:attribute name="style:text-align-source">fix</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="ss:Borders">
+ <xsl:if test="ss:Borders/ss:Border">
+ <xsl:apply-templates select="ss:Borders/ss:Border"/>
+ </xsl:if>
+ </xsl:if>
+ <xsl:apply-templates select="ss:Interior" mode="style-style-content"/>
+ <xsl:if test="ss:Protection">
+ <xsl:choose>
+ <xsl:when test="ss:Protection/@ss:Protected = '0'">
+ <xsl:choose>
+ <xsl:when test="ss:Protection/@ss:HideFormula = '1'">
+ <xsl:attribute name="style:cell-protect">hidden-and-protected</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:cell-protect">none</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="ss:Protection/@x:HideFormula = '1'">
+ <xsl:attribute name="style:cell-protect">protected formula-hidden</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:cell-protect">none</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <!-- fix means the horizontal alignment is dependent on ss:Horizontal,
+ but set on paragaraph properties not cell paragraphs -->
+ <xsl:if test="ss:Alignment/@ss:Horizontal">
+ <xsl:attribute name="style:text-align-source">fix</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:choose>
+ <xsl:when test="ss:Alignment/@ss:Horizontal">
+ <xsl:element name="style:paragraph-properties">
+ <xsl:variable name="text-align">
+ <xsl:choose>
+ <xsl:when test="ss:Alignment/@ss:Horizontal = 'Left'">start</xsl:when>
+ <xsl:when test="ss:Alignment/@ss:Horizontal = 'Center'">center</xsl:when>
+ <xsl:when test="ss:Alignment/@ss:Horizontal = 'Right'">end</xsl:when>
+ <xsl:when test="ss:Alignment/@ss:Horizontal = 'Justify'">justify</xsl:when>
+ <!-- many other text-align not supported yet -->
+ <xsl:otherwise>start</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="fo:text-align">
+ <xsl:value-of select="$text-align"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- The horizontal align default for vertical text in Excel is 'center' -->
+ <xsl:element name="style:paragraph-properties">
+ <xsl:if test="ss:Alignment/@ss:VerticalText = '1'">
+ <xsl:attribute name="fo:text-align">center</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="ss:Font">
+ <xsl:element name="style:text-properties">
+ <xsl:choose>
+ <xsl:when test="ss:Font/@ss:FontName">
+ <xsl:attribute name="style:font-name">
+ <xsl:value-of select="ss:Font/@ss:FontName"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:font-name-asian">
+ <xsl:value-of select="ss:Font/@ss:FontName"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:font-name-complex">
+ <xsl:value-of select="ss:Font/@ss:FontName"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:font-name">Arial</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- "ss:Font/@x:Family" is useless here, so can't map to "svg:font-family" attribute -->
+ <xsl:if test="ss:Font/@ss:Bold = '1'">
+ <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="ss:Font/@ss:Color">
+ <xsl:attribute name="fo:color">
+ <xsl:value-of select="ss:Font/@ss:Color"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:use-window-font-color">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="ss:Font/@ss:Italic = '1'">
+ <!-- omit font-style oblique -->
+ <xsl:attribute name="fo:font-style">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="ss:Font/@ss:Size">
+ <xsl:attribute name="fo:font-size">
+ <xsl:value-of select="concat( ss:Font/@ss:Size, 'pt')"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:font-size-asian">
+ <xsl:value-of select="concat( ss:Font/@ss:Size, 'pt')"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:font-size-complex">
+ <xsl:value-of select="concat( ss:Font/@ss:Size, 'pt')"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:font-size">10pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-asian">10pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-complex">10pt</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="ss:Font/@ss:Outline = '1'">
+ <xsl:attribute name="style:text-outline">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ss:Font/@ss:Shadow = '1'">
+ <!-- Not in DTD nor in docu <xsl:attribute name="style:text-shadow">shadow</xsl:attribute> -->
+ <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ss:Font/@ss:StrikeThrough = '1'">
+ <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ss:Font/@ss:Underline">
+ <xsl:choose>
+ <xsl:when test="ss:Font/@ss:Underline = 'None'">
+ <xsl:attribute name="style:text-underline-type">none</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="ss:Font/@ss:Underline = 'Single'">
+ <xsl:attribute name="style:text-underline-type">single</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="ss:Font/@ss:Underline = 'Double'">
+ <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="ss:Font/@ss:Underline = 'SingleAccounting'">
+ <xsl:attribute name="style:text-underline-type">single</xsl:attribute>"</xsl:when>
+ <xsl:when test="ss:Font/@ss:Underline = 'DoubleAccounting'">
+ <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:text-underline-type">none</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="ss:Font/@x:Charset">
+ <!-- quite unclear till now, -->
+ <xsl:attribute name="style:font-charset">x-symbol</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
- <xsl:template match="ss:Interior" mode="style-style-content">
- <xsl:choose>
- <xsl:when test="@ss:Pattern = 'Solid'">
- <xsl:if test="@ss:Color">
- <xsl:attribute name="fo:background-color">
- <xsl:value-of select="@ss:Color"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="@ss:PatternColor">
- <xsl:variable name="pattern-value">
- <xsl:call-template name="cell-pattern-color">
- <xsl:with-param name="pattern" select="concat('0.',substring-after(@ss:Pattern,'y'))"/>
- <xsl:with-param name="color-value" select="@ss:Color"/>
- <xsl:with-param name="pattern-color-value" select="@ss:PatternColor"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="fo:background-color">
- <xsl:value-of select="$pattern-value"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:template match="ss:Interior" mode="style-style-content">
+ <xsl:choose>
+ <xsl:when test="@ss:Pattern = 'Solid'">
+ <xsl:if test="@ss:Color">
+ <xsl:attribute name="fo:background-color">
+ <xsl:value-of select="@ss:Color"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="@ss:PatternColor">
+ <xsl:variable name="pattern-value">
+ <xsl:call-template name="cell-pattern-color">
+ <xsl:with-param name="pattern" select="concat('0.',substring-after(@ss:Pattern,'y'))"/>
+ <xsl:with-param name="color-value" select="@ss:Color"/>
+ <xsl:with-param name="pattern-color-value" select="@ss:PatternColor"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="fo:background-color">
+ <xsl:value-of select="$pattern-value"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template match="ss:Style">
- <!-- style:default-style is meant for application defaults
- <xsl:when test="@ss:ID = 'Default'">
- <xsl:element name="style:default-style">
- <xsl:call-template name="style-style-content" />
- </xsl:element>
- </xsl:when> -->
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">
- <xsl:value-of select="@ss:ID"/>
- </xsl:attribute>
- <xsl:apply-templates select="@ss:Name" />
- <xsl:choose>
- <xsl:when test="@ss:Parent">
- <xsl:attribute name="style:parent-style-name">
- <xsl:value-of select="@ss:Parent"/>
- </xsl:attribute>
- </xsl:when>
- <!-- no parent, but automatic style are automatically inheriting from a style called 'Default'
- not necessary named style -->
- <xsl:when test="not(key('Style', @ss:ID)/@ss:Name)">
- <xsl:attribute name="style:parent-style-name">
- <xsl:text>Default</xsl:text>
- </xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="ss:NumberFormat/@ss:Format">
- <xsl:attribute name="style:data-style-name">
- <xsl:value-of select="concat( @ss:ID, 'F')"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style:family">table-cell</xsl:attribute>
- <xsl:call-template name="style-style-content"/>
- </xsl:element>
- </xsl:template>
- <xsl:template name="cell-pattern-color">
- <!-- generates a new color from cell-pattern-color -->
- <xsl:param name="pattern"/>
- <xsl:param name="color-value"/>
- <xsl:param name="pattern-color-value"/>
- <xsl:variable name="rev-pattern" select="1 - $pattern"/>
- <xsl:variable name="color-R-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($color-value,2,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="color-G-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($color-value,4,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="color-B-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($color-value,6,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="pattern-R-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($pattern-color-value,2,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="pattern-G-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($pattern-color-value,4,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="pattern-B-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($pattern-color-value,6,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="R-value">
- <xsl:variable name="combined-R-value">
- <xsl:call-template name="decimal2hex">
- <xsl:with-param name="dec-number" select="floor($color-R-value * $rev-pattern + $pattern-R-value * $pattern)"/>
- <xsl:with-param name="last-value" select="'H'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($combined-R-value) = 1">
- <xsl:value-of select="concat('0',$combined-R-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$combined-R-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="G-value">
- <xsl:variable name="combined-G-value">
- <xsl:call-template name="decimal2hex">
- <xsl:with-param name="dec-number" select="floor($color-G-value * $rev-pattern + $pattern-G-value * $pattern)"/>
- <xsl:with-param name="last-value" select="'H'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($combined-G-value) = 1">
- <xsl:value-of select="concat('0',$combined-G-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$combined-G-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="B-value">
- <xsl:variable name="combined-B-value">
- <xsl:call-template name="decimal2hex">
- <xsl:with-param name="dec-number" select="floor($color-B-value * $rev-pattern + $pattern-B-value * $pattern)"/>
- <xsl:with-param name="last-value" select="'H'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($combined-B-value) = 1">
- <xsl:value-of select="concat('0',$combined-B-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$combined-B-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="concat('#',$R-value,$G-value,$B-value)"/>
- </xsl:template>
+ <xsl:template match="ss:Style">
+ <!-- style:default-style is meant for application defaults
+ <xsl:when test="@ss:ID = 'Default'">
+ <xsl:element name="style:default-style">
+ <xsl:call-template name="style-style-content" />
+ </xsl:element>
+ </xsl:when> -->
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">
+ <xsl:value-of select="@ss:ID"/>
+ </xsl:attribute>
+ <xsl:apply-templates select="@ss:Name" />
+ <xsl:choose>
+ <xsl:when test="@ss:Parent">
+ <xsl:attribute name="style:parent-style-name">
+ <xsl:value-of select="@ss:Parent"/>
+ </xsl:attribute>
+ </xsl:when>
+ <!-- no parent, but automatic style are automatically inheriting from a style called 'Default'
+ not necessary named style -->
+ <xsl:when test="not(key('Style', @ss:ID)/@ss:Name)">
+ <xsl:attribute name="style:parent-style-name">
+ <xsl:text>Default</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="ss:NumberFormat/@ss:Format">
+ <xsl:attribute name="style:data-style-name">
+ <xsl:value-of select="concat( @ss:ID, 'F')"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style:family">table-cell</xsl:attribute>
+ <xsl:call-template name="style-style-content"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="cell-pattern-color">
+ <!-- generates a new color from cell-pattern-color -->
+ <xsl:param name="pattern"/>
+ <xsl:param name="color-value"/>
+ <xsl:param name="pattern-color-value"/>
+ <xsl:variable name="rev-pattern" select="1 - $pattern"/>
+ <xsl:variable name="color-R-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($color-value,2,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="color-G-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($color-value,4,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="color-B-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($color-value,6,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="pattern-R-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($pattern-color-value,2,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="pattern-G-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($pattern-color-value,4,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="pattern-B-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($pattern-color-value,6,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="R-value">
+ <xsl:variable name="combined-R-value">
+ <xsl:call-template name="decimal2hex">
+ <xsl:with-param name="dec-number" select="floor($color-R-value * $rev-pattern + $pattern-R-value * $pattern)"/>
+ <xsl:with-param name="last-value" select="'H'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($combined-R-value) = 1">
+ <xsl:value-of select="concat('0',$combined-R-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$combined-R-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="G-value">
+ <xsl:variable name="combined-G-value">
+ <xsl:call-template name="decimal2hex">
+ <xsl:with-param name="dec-number" select="floor($color-G-value * $rev-pattern + $pattern-G-value * $pattern)"/>
+ <xsl:with-param name="last-value" select="'H'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($combined-G-value) = 1">
+ <xsl:value-of select="concat('0',$combined-G-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$combined-G-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="B-value">
+ <xsl:variable name="combined-B-value">
+ <xsl:call-template name="decimal2hex">
+ <xsl:with-param name="dec-number" select="floor($color-B-value * $rev-pattern + $pattern-B-value * $pattern)"/>
+ <xsl:with-param name="last-value" select="'H'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($combined-B-value) = 1">
+ <xsl:value-of select="concat('0',$combined-B-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$combined-B-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="concat('#',$R-value,$G-value,$B-value)"/>
+ </xsl:template>
<xsl:template name="colorindex2decimal">
<xsl:param name="colorindex"/>
<xsl:variable name="colorIndexLookup">
@@ -4827,4326 +4827,4326 @@
</xsl:variable>
<xsl:value-of select="$tempColorDecimal"/>
</xsl:template>
- <xsl:template name="hex2decimal">
- <!-- transforms a hex number to a decimal number.parses the string from left to right -->
- <xsl:param name="hex-number"/>
- <xsl:param name="index"/>
- <xsl:param name="str-length"/>
- <xsl:param name="last-value"/>
- <xsl:variable name="dec-char">
- <xsl:call-template name="hexNumber2dec">
- <xsl:with-param name="hex-value" select="substring($hex-number, $index ,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="current-value" select="$last-value * 16 + $dec-char"/>
- <xsl:if test="$index &lt; $str-length">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="$hex-number"/>
- <xsl:with-param name="index" select="$index + 1"/>
- <xsl:with-param name="str-length" select="$str-length"/>
- <xsl:with-param name="last-value" select="$current-value"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$index = $str-length">
- <xsl:value-of select="$current-value"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="hexNumber2dec">
- <!-- return a decimal number for a hex character -->
- <xsl:param name="hex-value"/>
- <xsl:choose>
- <xsl:when test="$hex-value = 'A' or ($hex-value = 'a')">
- <xsl:value-of select="10"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'B' or ($hex-value = 'b')">
- <xsl:value-of select="11"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'C' or ($hex-value = 'c')">
- <xsl:value-of select="12"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'D' or ($hex-value = 'd')">
- <xsl:value-of select="13"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'E' or ($hex-value = 'e')">
- <xsl:value-of select="14"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'F' or ($hex-value = 'f')">
- <xsl:value-of select="15"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$hex-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="decimal2hex">
- <!-- transforms a decimal number to a hex number,only for two-bit hex(less than 256 in decimal) currently -->
- <xsl:param name="dec-number"/>
- <xsl:param name="last-value"/>
- <xsl:variable name="current-value">
- <xsl:call-template name="decNumber2hex">
- <xsl:with-param name="dec-value">
- <xsl:if test="$dec-number &gt; 15">
- <xsl:value-of select="floor($dec-number div 16)"/>
- </xsl:if>
- <xsl:if test="$dec-number &lt; 16">
- <xsl:value-of select="$dec-number"/>
- </xsl:if>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$dec-number &gt; 15">
- <xsl:call-template name="decimal2hex">
- <xsl:with-param name="dec-number" select="$dec-number mod 16"/>
- <xsl:with-param name="last-value" select="concat($last-value,$current-value)"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$dec-number &lt; 16">
- <xsl:value-of select="substring-after(concat($last-value,$current-value),'H')"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="decNumber2hex">
- <!-- return a hex number for a decimal character -->
- <xsl:param name="dec-value"/>
- <xsl:choose>
- <xsl:when test="$dec-value = 10">
- <xsl:value-of select="'A'"/>
- </xsl:when>
- <xsl:when test="$dec-value = 11">
- <xsl:value-of select="'B'"/>
- </xsl:when>
- <xsl:when test="$dec-value = 12">
- <xsl:value-of select="'C'"/>
- </xsl:when>
- <xsl:when test="$dec-value = 13">
- <xsl:value-of select="'D'"/>
- </xsl:when>
- <xsl:when test="$dec-value = 14">
- <xsl:value-of select="'E'"/>
- </xsl:when>
- <xsl:when test="$dec-value = 15">
- <xsl:value-of select="'F'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$dec-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ss:Border">
- <xsl:variable name="position">
- <xsl:choose>
- <xsl:when test="@ss:Position = 'Top'">fo:border-top</xsl:when>
- <xsl:when test="@ss:Position = 'Bottom'">fo:border-bottom</xsl:when>
- <xsl:when test="@ss:Position = 'Left'">fo:border-left</xsl:when>
- <xsl:when test="@ss:Position = 'Right'">fo:border-right</xsl:when>
- <!-- DiagonalLeft & DiagonalRight are not supported yet, -->
- <xsl:otherwise>fo:border-left</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="width">
- <xsl:choose>
- <!-- 0: Hairline -->
- <xsl:when test="@ss:Weight = '0'">0.002cm</xsl:when>
- <!-- 1: Thin -->
- <xsl:when test="@ss:Weight = '1'">0.035cm</xsl:when>
- <!-- 2: Medium -->
- <xsl:when test="@ss:Weight = '2'">0.088cm</xsl:when>
- <!-- 3: Thick -->
- <xsl:when test="@ss:Weight = '3'">
- <xsl:choose>
- <xsl:when test="@ss:LineStyle = 'Double'">0.105cm</xsl:when>
- <xsl:otherwise>0.141cm</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- invalid value, or parameter not exist at all -->
- <xsl:otherwise>0.002cm</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="linestyle">
- <xsl:choose>
- <xsl:when test="@ss:LineStyle = 'None'">none</xsl:when>
- <xsl:when test="@ss:LineStyle = 'Continuous'">solid</xsl:when>
- <xsl:when test="@ss:LineStyle = 'Double'">double</xsl:when>
- <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
- <xsl:otherwise>solid</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="color">
- <xsl:choose>
- <xsl:when test="@ss:Color">
- <xsl:value-of select="@ss:Color"/>
- </xsl:when>
- <!-- default border color is black -->
- <xsl:otherwise>#000000</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="{$position}">
- <xsl:value-of select="concat( $width, ' ', $linestyle, ' ', $color)"/>
- </xsl:attribute>
- <xsl:if test="@ss:LineStyle = 'Double'">
- <xsl:variable name="widthposition">
- <xsl:choose>
- <xsl:when test="@ss:Position = 'Top'">style:border-line-width-top</xsl:when>
- <xsl:when test="@ss:Position = 'Bottom'">style:border-line-width-bottom</xsl:when>
- <xsl:when test="@ss:Position = 'Left'">style:border-line-width-left</xsl:when>
- <xsl:when test="@ss:Position = 'Right'">style:border-line-width-right</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="{$widthposition}">0.035cm 0.035cm 0.035cm</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="ss:Font">
- <xsl:choose>
- <xsl:when test="@ss:VerticalAlign = 'Superscript'">
- <style:style style:name="{concat(../@ss:ID,'T0')}" style:family="text">
- <style:text-properties style:text-position="33% 58%"/>
- </style:style>
- </xsl:when>
- <xsl:when test="@ss:VerticalAlign = 'Subscript'">
- <style:style style:name="{concat(../@ss:ID,'T0')}" style:family="text">
- <style:text-properties style:text-position="-33% 58%"/>
- </style:style>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ss:Table">
- <xsl:variable name="default-column-width">
- <xsl:choose>
- <xsl:when test="@ss:DefaultColumnWidth">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(@ss:DefaultColumnWidth,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:when>
- <!-- Note: Specify where this value come from.. -->
- <xsl:otherwise>2.096cm</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="table-pos">
- <xsl:value-of select="count(../preceding-sibling::ss:Worksheet)+1"/>
- </xsl:variable>
- <!-- naming convention the default column style is name co<NumberOfSheet> e.g. co1 for the first sheet -->
- <style:style style:family="table-column" style:name="{concat('co', $table-pos)}">
- <style:table-column-properties fo:break-before="auto" style:column-width="{$default-column-width}"/>
- </style:style>
- <xsl:variable name="columnCount" select="count(ss:Column)"/>
- <xsl:for-each select="ss:Column">
- <xsl:apply-templates select="." mode="create-column-style">
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="currentCount" select="position()"/>
- <xsl:with-param name="table-pos" select="$table-pos"/>
- <xsl:with-param name="default-column-width" select="$default-column-width"/>
- </xsl:apply-templates>
- </xsl:for-each>
- <xsl:if test="../x:PageBreaks/x:ColBreaks">
- <style:style style:name="{concat('cob',$table-pos)}" style:family="table-column">
- <xsl:element name="style:table-column-properties">
- <xsl:attribute name="style:column-width">
- <xsl:value-of select="$default-column-width"/>
- </xsl:attribute>
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- </xsl:element>
- </style:style>
- </xsl:if>
- <xsl:variable name="default-row-height">
- <xsl:choose>
- <xsl:when test="@ss:DefaultRowHeight">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(@ss:DefaultRowHeight,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:when>
- <!-- Note: This is the default row hight value in spec it is written 255 point, this seems wrong -->
- <!-- <xsl:otherwise>0.503cm</xsl:otherwise> -->
- <xsl:otherwise>0.45cm</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <style:style style:family="table-row" style:name="{concat('ro', $table-pos)}">
- <style:table-row-properties style:row-height="{$default-row-height}" style:use-optimal-row-height="false"/>
- </style:style>
- <xsl:variable name="rowCount" select="count(ss:Row)"/>
- <xsl:for-each select="ss:Row">
- <xsl:apply-templates select="." mode="create-row-style">
- <xsl:with-param name="rowNodeCount" select="$rowCount"/>
- <xsl:with-param name="rowNodeIndex" select="position()"/>
- <xsl:with-param name="table-pos" select="$table-pos"/>
- <xsl:with-param name="default-row-height" select="$default-row-height"/>
- </xsl:apply-templates>
- </xsl:for-each>
- <xsl:if test="../x:PageBreaks/x:RowBreaks">
- <style:style style:name="{concat('rob',$table-pos)}" style:family="table-row">
- <xsl:element name="style:table-row-properties">
- <xsl:attribute name="style:row-height">
- <xsl:value-of select="$default-row-height"/>
- </xsl:attribute>
- <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- </xsl:element>
- </style:style>
- </xsl:if>
- <!-- create table-style -->
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">
- <xsl:value-of select="concat( 'ta', $table-pos)"/>
- </xsl:attribute>
- <xsl:attribute name="style:family">table</xsl:attribute>
- <!-- ss:Name have to be from type 'NCNameChar' ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender -->
- <xsl:attribute name="style:master-page-name">
- <xsl:call-template name="encode-as-nc-name">
- <xsl:with-param name="string" select="../@ss:Name"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:element name="style:table-properties">
- <xsl:choose>
- <xsl:when test="../x:WorksheetOptions/x:Visible = 'SheetHidden'">
- <xsl:attribute name="table:display">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:display">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template match="ss:Column" mode="create-column-style">
- <!-- generate stylename of colbreak after matching the column number and the colbreak number -->
- <xsl:param name="columnCount"/>
- <xsl:param name="currentCount"/>
- <xsl:param name="table-pos"/>
- <xsl:param name="default-column-width"/>
- <xsl:variable name="span-value" select="@ss:Span + count(@ss:Span)"/>
- <xsl:variable name="finishedColumns">
- <xsl:choose>
- <xsl:when test="@ss:Index">
- <xsl:value-of select="@ss:Index -1 + $span-value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="recent-index"
- select="preceding-sibling::ss:Column[@ss:Index][last()]"/>
- <xsl:choose>
- <xsl:when test="$recent-index">
- <xsl:variable name="nodes-up-to-current"
- select="set:intersection(preceding-sibling::ss:Column, $recent-index/following-sibling::ss:Column)"/>
- <xsl:variable name="allSpans" select="$nodes-up-to-current/@ss:Span"/>
- <xsl:value-of
- select="$recent-index/@ss:Index + count($nodes-up-to-current) + sum($allSpans) + count($allSpans)"
- />
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="allSpans" select="preceding-sibling::ss:Column/@ss:Span"/>
+ <xsl:template name="hex2decimal">
+ <!-- transforms a hex number to a decimal number.parses the string from left to right -->
+ <xsl:param name="hex-number"/>
+ <xsl:param name="index"/>
+ <xsl:param name="str-length"/>
+ <xsl:param name="last-value"/>
+ <xsl:variable name="dec-char">
+ <xsl:call-template name="hexNumber2dec">
+ <xsl:with-param name="hex-value" select="substring($hex-number, $index ,1)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="current-value" select="$last-value * 16 + $dec-char"/>
+ <xsl:if test="$index &lt; $str-length">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="$hex-number"/>
+ <xsl:with-param name="index" select="$index + 1"/>
+ <xsl:with-param name="str-length" select="$str-length"/>
+ <xsl:with-param name="last-value" select="$current-value"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$index = $str-length">
+ <xsl:value-of select="$current-value"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="hexNumber2dec">
+ <!-- return a decimal number for a hex character -->
+ <xsl:param name="hex-value"/>
+ <xsl:choose>
+ <xsl:when test="$hex-value = 'A' or ($hex-value = 'a')">
+ <xsl:value-of select="10"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'B' or ($hex-value = 'b')">
+ <xsl:value-of select="11"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'C' or ($hex-value = 'c')">
+ <xsl:value-of select="12"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'D' or ($hex-value = 'd')">
+ <xsl:value-of select="13"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'E' or ($hex-value = 'e')">
+ <xsl:value-of select="14"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'F' or ($hex-value = 'f')">
+ <xsl:value-of select="15"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$hex-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="decimal2hex">
+ <!-- transforms a decimal number to a hex number,only for two-bit hex(less than 256 in decimal) currently -->
+ <xsl:param name="dec-number"/>
+ <xsl:param name="last-value"/>
+ <xsl:variable name="current-value">
+ <xsl:call-template name="decNumber2hex">
+ <xsl:with-param name="dec-value">
+ <xsl:if test="$dec-number &gt; 15">
+ <xsl:value-of select="floor($dec-number div 16)"/>
+ </xsl:if>
+ <xsl:if test="$dec-number &lt; 16">
+ <xsl:value-of select="$dec-number"/>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$dec-number &gt; 15">
+ <xsl:call-template name="decimal2hex">
+ <xsl:with-param name="dec-number" select="$dec-number mod 16"/>
+ <xsl:with-param name="last-value" select="concat($last-value,$current-value)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$dec-number &lt; 16">
+ <xsl:value-of select="substring-after(concat($last-value,$current-value),'H')"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="decNumber2hex">
+ <!-- return a hex number for a decimal character -->
+ <xsl:param name="dec-value"/>
+ <xsl:choose>
+ <xsl:when test="$dec-value = 10">
+ <xsl:value-of select="'A'"/>
+ </xsl:when>
+ <xsl:when test="$dec-value = 11">
+ <xsl:value-of select="'B'"/>
+ </xsl:when>
+ <xsl:when test="$dec-value = 12">
+ <xsl:value-of select="'C'"/>
+ </xsl:when>
+ <xsl:when test="$dec-value = 13">
+ <xsl:value-of select="'D'"/>
+ </xsl:when>
+ <xsl:when test="$dec-value = 14">
+ <xsl:value-of select="'E'"/>
+ </xsl:when>
+ <xsl:when test="$dec-value = 15">
+ <xsl:value-of select="'F'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$dec-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="ss:Border">
+ <xsl:variable name="position">
+ <xsl:choose>
+ <xsl:when test="@ss:Position = 'Top'">fo:border-top</xsl:when>
+ <xsl:when test="@ss:Position = 'Bottom'">fo:border-bottom</xsl:when>
+ <xsl:when test="@ss:Position = 'Left'">fo:border-left</xsl:when>
+ <xsl:when test="@ss:Position = 'Right'">fo:border-right</xsl:when>
+ <!-- DiagonalLeft & DiagonalRight are not supported yet, -->
+ <xsl:otherwise>fo:border-left</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="width">
+ <xsl:choose>
+ <!-- 0: Hairline -->
+ <xsl:when test="@ss:Weight = '0'">0.002cm</xsl:when>
+ <!-- 1: Thin -->
+ <xsl:when test="@ss:Weight = '1'">0.035cm</xsl:when>
+ <!-- 2: Medium -->
+ <xsl:when test="@ss:Weight = '2'">0.088cm</xsl:when>
+ <!-- 3: Thick -->
+ <xsl:when test="@ss:Weight = '3'">
+ <xsl:choose>
+ <xsl:when test="@ss:LineStyle = 'Double'">0.105cm</xsl:when>
+ <xsl:otherwise>0.141cm</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- invalid value, or parameter not exist at all -->
+ <xsl:otherwise>0.002cm</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="linestyle">
+ <xsl:choose>
+ <xsl:when test="@ss:LineStyle = 'None'">none</xsl:when>
+ <xsl:when test="@ss:LineStyle = 'Continuous'">solid</xsl:when>
+ <xsl:when test="@ss:LineStyle = 'Double'">double</xsl:when>
+ <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
+ <xsl:otherwise>solid</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="color">
+ <xsl:choose>
+ <xsl:when test="@ss:Color">
+ <xsl:value-of select="@ss:Color"/>
+ </xsl:when>
+ <!-- default border color is black -->
+ <xsl:otherwise>#000000</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="{$position}">
+ <xsl:value-of select="concat( $width, ' ', $linestyle, ' ', $color)"/>
+ </xsl:attribute>
+ <xsl:if test="@ss:LineStyle = 'Double'">
+ <xsl:variable name="widthposition">
+ <xsl:choose>
+ <xsl:when test="@ss:Position = 'Top'">style:border-line-width-top</xsl:when>
+ <xsl:when test="@ss:Position = 'Bottom'">style:border-line-width-bottom</xsl:when>
+ <xsl:when test="@ss:Position = 'Left'">style:border-line-width-left</xsl:when>
+ <xsl:when test="@ss:Position = 'Right'">style:border-line-width-right</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="{$widthposition}">0.035cm 0.035cm 0.035cm</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="ss:Font">
+ <xsl:choose>
+ <xsl:when test="@ss:VerticalAlign = 'Superscript'">
+ <style:style style:name="{concat(../@ss:ID,'T0')}" style:family="text">
+ <style:text-properties style:text-position="33% 58%"/>
+ </style:style>
+ </xsl:when>
+ <xsl:when test="@ss:VerticalAlign = 'Subscript'">
+ <style:style style:name="{concat(../@ss:ID,'T0')}" style:family="text">
+ <style:text-properties style:text-position="-33% 58%"/>
+ </style:style>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="ss:Table">
+ <xsl:variable name="default-column-width">
+ <xsl:choose>
+ <xsl:when test="@ss:DefaultColumnWidth">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(@ss:DefaultColumnWidth,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:when>
+ <!-- Note: Specify where this value come from.. -->
+ <xsl:otherwise>2.096cm</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="table-pos">
+ <xsl:value-of select="count(../preceding-sibling::ss:Worksheet)+1"/>
+ </xsl:variable>
+ <!-- naming convention the default column style is name co<NumberOfSheet> e.g. co1 for the first sheet -->
+ <style:style style:family="table-column" style:name="{concat('co', $table-pos)}">
+ <style:table-column-properties fo:break-before="auto" style:column-width="{$default-column-width}"/>
+ </style:style>
+ <xsl:variable name="columnCount" select="count(ss:Column)"/>
+ <xsl:for-each select="ss:Column">
+ <xsl:apply-templates select="." mode="create-column-style">
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="currentCount" select="position()"/>
+ <xsl:with-param name="table-pos" select="$table-pos"/>
+ <xsl:with-param name="default-column-width" select="$default-column-width"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ <xsl:if test="../x:PageBreaks/x:ColBreaks">
+ <style:style style:name="{concat('cob',$table-pos)}" style:family="table-column">
+ <xsl:element name="style:table-column-properties">
+ <xsl:attribute name="style:column-width">
+ <xsl:value-of select="$default-column-width"/>
+ </xsl:attribute>
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ </xsl:element>
+ </style:style>
+ </xsl:if>
+ <xsl:variable name="default-row-height">
+ <xsl:choose>
+ <xsl:when test="@ss:DefaultRowHeight">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(@ss:DefaultRowHeight,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:when>
+ <!-- Note: This is the default row hight value in spec it is written 255 point, this seems wrong -->
+ <!-- <xsl:otherwise>0.503cm</xsl:otherwise> -->
+ <xsl:otherwise>0.45cm</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <style:style style:family="table-row" style:name="{concat('ro', $table-pos)}">
+ <style:table-row-properties style:row-height="{$default-row-height}" style:use-optimal-row-height="false"/>
+ </style:style>
+ <xsl:variable name="rowCount" select="count(ss:Row)"/>
+ <xsl:for-each select="ss:Row">
+ <xsl:apply-templates select="." mode="create-row-style">
+ <xsl:with-param name="rowNodeCount" select="$rowCount"/>
+ <xsl:with-param name="rowNodeIndex" select="position()"/>
+ <xsl:with-param name="table-pos" select="$table-pos"/>
+ <xsl:with-param name="default-row-height" select="$default-row-height"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ <xsl:if test="../x:PageBreaks/x:RowBreaks">
+ <style:style style:name="{concat('rob',$table-pos)}" style:family="table-row">
+ <xsl:element name="style:table-row-properties">
+ <xsl:attribute name="style:row-height">
+ <xsl:value-of select="$default-row-height"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ </xsl:element>
+ </style:style>
+ </xsl:if>
+ <!-- create table-style -->
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">
+ <xsl:value-of select="concat( 'ta', $table-pos)"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:family">table</xsl:attribute>
+ <!-- ss:Name have to be from type 'NCNameChar' ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender -->
+ <xsl:attribute name="style:master-page-name">
+ <xsl:call-template name="encode-as-nc-name">
+ <xsl:with-param name="string" select="../@ss:Name"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:element name="style:table-properties">
+ <xsl:choose>
+ <xsl:when test="../x:WorksheetOptions/x:Visible = 'SheetHidden'">
+ <xsl:attribute name="table:display">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:display">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="ss:Column" mode="create-column-style">
+ <!-- generate stylename of colbreak after matching the column number and the colbreak number -->
+ <xsl:param name="columnCount"/>
+ <xsl:param name="currentCount"/>
+ <xsl:param name="table-pos"/>
+ <xsl:param name="default-column-width"/>
+ <xsl:variable name="span-value" select="@ss:Span + count(@ss:Span)"/>
+ <xsl:variable name="finishedColumns">
+ <xsl:choose>
+ <xsl:when test="@ss:Index">
+ <xsl:value-of select="@ss:Index -1 + $span-value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="recent-index"
+ select="preceding-sibling::ss:Column[@ss:Index][last()]"/>
+ <xsl:choose>
+ <xsl:when test="$recent-index">
+ <xsl:variable name="nodes-up-to-current"
+ select="set:intersection(preceding-sibling::ss:Column, $recent-index/following-sibling::ss:Column)"/>
+ <xsl:variable name="allSpans" select="$nodes-up-to-current/@ss:Span"/>
+ <xsl:value-of
+ select="$recent-index/@ss:Index + count($nodes-up-to-current) + sum($allSpans) + count($allSpans)"
+ />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="allSpans" select="preceding-sibling::ss:Column/@ss:Span"/>
+
+ <xsl:value-of select="$currentCount + sum($allSpans) + count($allSpans)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="current-index">
+ <xsl:choose>
+ <xsl:when test="@ss:Index">
+ <xsl:value-of select="@ss:Index - 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$finishedColumns"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
- <xsl:value-of select="$currentCount + sum($allSpans) + count($allSpans)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="current-index">
- <xsl:choose>
- <xsl:when test="@ss:Index">
- <xsl:value-of select="@ss:Index - 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$finishedColumns"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
+ <xsl:variable name="column-break">
+ <xsl:choose>
+ <xsl:when test="$span-value = 0">
+ <xsl:if test="../x:PageBreaks/x:ColBreaks/x:ColBreak/x:Column = $current-index">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if
+ test="../x:PageBreaks/x:ColBreaks[(x:ColBreak/x:Column &gt; $finishedColumns) and (x:ColBreak/x:Column &lt; ($finishedColumns + $span-value))]">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$column-break = 1">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">
+ <xsl:call-template name="encode-as-nc-name">
+ <xsl:with-param name="string"
+ select="concat('cob', $table-pos, '-',$currentCount)"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:attribute name="style:family">table-column</xsl:attribute>
+ <xsl:element name="style:table-column-properties">
+ <xsl:choose>
+ <xsl:when test="@ss:Width">
+ <xsl:attribute name="style:column-width">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value"
+ select="concat(@ss:Width,'pt')"
+ />
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:column-width">
+ <xsl:value-of select="$default-column-width"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when
+ test="@ss:AutoFitWidth = '0'">
+ <xsl:attribute name="style:use-optimal-column-width"
+ >false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when
+ test="@ss:Width &gt; 0">
+ <xsl:attribute name="style:use-optimal-column-width"
+ >false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:use-optimal-column-width"
+ >true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ <style:style style:name="{concat('co', $table-pos, '-',$currentCount)}"
+ style:family="table-column">
+ <xsl:element name="style:table-column-properties">
+ <xsl:choose>
+ <xsl:when test="@ss:Width">
+ <xsl:attribute name="style:column-width">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value"
+ select="concat(@ss:Width,'pt')"
+ />
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:column-width">
+ <xsl:value-of select="$default-column-width"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:break-before">auto</xsl:attribute>
+ </xsl:element>
+ </style:style>
+ </xsl:template>
- <xsl:variable name="column-break">
- <xsl:choose>
- <xsl:when test="$span-value = 0">
- <xsl:if test="../x:PageBreaks/x:ColBreaks/x:ColBreak/x:Column = $current-index">
- <xsl:value-of select="1"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if
- test="../x:PageBreaks/x:ColBreaks[(x:ColBreak/x:Column &gt; $finishedColumns) and (x:ColBreak/x:Column &lt; ($finishedColumns + $span-value))]">
- <xsl:value-of select="1"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$column-break = 1">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">
- <xsl:call-template name="encode-as-nc-name">
- <xsl:with-param name="string"
- select="concat('cob', $table-pos, '-',$currentCount)"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="style:family">table-column</xsl:attribute>
- <xsl:element name="style:table-column-properties">
- <xsl:choose>
- <xsl:when test="@ss:Width">
- <xsl:attribute name="style:column-width">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value"
- select="concat(@ss:Width,'pt')"
- />
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:column-width">
- <xsl:value-of select="$default-column-width"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when
- test="@ss:AutoFitWidth = '0'">
- <xsl:attribute name="style:use-optimal-column-width"
- >false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when
- test="@ss:Width &gt; 0">
- <xsl:attribute name="style:use-optimal-column-width"
- >false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:use-optimal-column-width"
- >true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- <style:style style:name="{concat('co', $table-pos, '-',$currentCount)}"
- style:family="table-column">
- <xsl:element name="style:table-column-properties">
- <xsl:choose>
- <xsl:when test="@ss:Width">
- <xsl:attribute name="style:column-width">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value"
- select="concat(@ss:Width,'pt')"
- />
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:column-width">
- <xsl:value-of select="$default-column-width"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:break-before">auto</xsl:attribute>
- </xsl:element>
- </style:style>
- </xsl:template>
-
- <xsl:template match="ss:Row" mode="create-row-style">
- <!-- generate stylename of rowbreak after matching the row number and the rowbreak number -->
- <xsl:param name="rowNodeCount"/>
- <xsl:param name="rowNodeIndex" select="position()"/>
- <xsl:param name="table-pos"/>
- <xsl:param name="default-row-height"/>
- <xsl:variable name="simple-span-value" select="@ss:Span + count(@ss:Span)"/>
-
- <xsl:variable name="earlierRowNo">
- <xsl:choose>
- <xsl:when test="@ss:Index"><xsl:value-of select="@ss:Index -1 + $simple-span-value"/></xsl:when>
- <xsl:otherwise>
- <xsl:variable name="recent-index" select="preceding-sibling::ss:Row[@ss:Index][last()]"></xsl:variable>
- <xsl:choose>
- <xsl:when test="$recent-index">
- <xsl:variable name="nodes-up-to-current" select="set:intersection(preceding-sibling::ss:Row, $recent-index/following-sibling::ss:Row)"></xsl:variable>
- <xsl:variable name="allSpans" select="$nodes-up-to-current/@ss:Span"/>
- <xsl:value-of select="$recent-index/@ss:Index + count($nodes-up-to-current) + sum($allSpans) + count($allSpans)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="allSpans" select="preceding-sibling::ss:Row/@ss:Span"/>
- <xsl:value-of select="position() + sum($allSpans) + count($allSpans)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="span-value">
- <xsl:choose>
- <xsl:when test="@ss:Index">
- <xsl:choose>
- <xsl:when test="@ss:Span">
- <xsl:value-of select="@ss:Index - $earlierRowNo + @ss:Span"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="0"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@ss:Span">
- <xsl:value-of select="@ss:Span + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="0"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="current-index">
- <xsl:choose>
- <xsl:when test="@ss:Index">
- <xsl:value-of select="@ss:Index - 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$earlierRowNo"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="row-break">
- <xsl:choose>
- <xsl:when test="$span-value = 0">
- <xsl:if test="../x:PageBreaks/x:RowBreaks/x:RowBreak/x:Row = $current-index">
- <xsl:value-of select="1"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="../x:PageBreaks/x:RowBreaks[(x:RowBreak/x:Row &gt; $earlierRowNo) and (x:RowBreak/x:Row &lt; ($earlierRowNo + $span-value))]">
- <xsl:value-of select="1"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$row-break = 1">
- <xsl:element name="style:style">
- <xsl:choose>
- <xsl:when test="@ss:StyleID">
- <xsl:attribute name="style:name"><xsl:value-of select="concat('ro', $table-pos, '-',$rowNodeIndex,'-',@ss:StyleID)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:name"><xsl:value-of select="concat('ro', $table-pos, '-',$rowNodeIndex)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="style:family">table-row</xsl:attribute>
-
-
- <xsl:element name="style:table-row-properties">
- <xsl:choose>
- <xsl:when test="@ss:Height">
- <xsl:attribute name="style:row-height">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(@ss:Height,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:row-height">
- <xsl:value-of select="$default-row-height"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@ss:AutoFitHeight = '0'">
- <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@ss:Height &gt; 0">
- <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- <xsl:apply-templates select="key('Style', @ss:StyleID)/ss:Interior" mode="style-style-content"/>
- </xsl:element>
- <!--
- <xsl:apply-templates select="key('Style', @ss:StyleID)" mode="style-style-content" />
- -->
- </xsl:element>
- </xsl:if>
- <!--
- <style:style style:name="{concat('ro', $table-pos, '-',$rowNodeIndex)}" style:family="table-row">
- -->
- <xsl:element name="style:style">
- <xsl:choose>
- <xsl:when test="@ss:StyleID">
- <xsl:attribute name="style:name"><xsl:value-of select="concat('ro', $table-pos, '-',$rowNodeIndex,'-',@ss:StyleID)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:name"><xsl:value-of select="concat('ro', $table-pos, '-',$rowNodeIndex)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="style:family">table-row</xsl:attribute>
-
-
- <xsl:element name="style:table-row-properties">
- <xsl:choose>
- <xsl:when test="@ss:Height">
- <xsl:attribute name="style:row-height">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(@ss:Height,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:row-height">
- <xsl:value-of select="$default-row-height"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@ss:AutoFitHeight">
- <xsl:choose>
- <xsl:when test="@ss:AutoFitHeight = '0'">
- <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@ss:Height &gt; 0">
- <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:break-before">auto</xsl:attribute>
- <!-- apply to background -->
- <xsl:apply-templates select="key('Style', @ss:StyleID)/ss:Interior" mode="style-style-content"/>
- </xsl:element>
- <!--
- <xsl:apply-templates select="key('Style', ss:Row[position() = $rowNodeIndex]/@ss:StyleID)" mode="style-style-content" />
- -->
- </xsl:element>
+ <xsl:template match="ss:Row" mode="create-row-style">
+ <!-- generate stylename of rowbreak after matching the row number and the rowbreak number -->
+ <xsl:param name="rowNodeCount"/>
+ <xsl:param name="rowNodeIndex" select="position()"/>
+ <xsl:param name="table-pos"/>
+ <xsl:param name="default-row-height"/>
+ <xsl:variable name="simple-span-value" select="@ss:Span + count(@ss:Span)"/>
-
- </xsl:template>
+ <xsl:variable name="earlierRowNo">
+ <xsl:choose>
+ <xsl:when test="@ss:Index"><xsl:value-of select="@ss:Index -1 + $simple-span-value"/></xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="recent-index" select="preceding-sibling::ss:Row[@ss:Index][last()]"></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$recent-index">
+ <xsl:variable name="nodes-up-to-current" select="set:intersection(preceding-sibling::ss:Row, $recent-index/following-sibling::ss:Row)"></xsl:variable>
+ <xsl:variable name="allSpans" select="$nodes-up-to-current/@ss:Span"/>
+ <xsl:value-of select="$recent-index/@ss:Index + count($nodes-up-to-current) + sum($allSpans) + count($allSpans)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="allSpans" select="preceding-sibling::ss:Row/@ss:Span"/>
+ <xsl:value-of select="position() + sum($allSpans) + count($allSpans)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="span-value">
+ <xsl:choose>
+ <xsl:when test="@ss:Index">
+ <xsl:choose>
+ <xsl:when test="@ss:Span">
+ <xsl:value-of select="@ss:Index - $earlierRowNo + @ss:Span"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="@ss:Span">
+ <xsl:value-of select="@ss:Span + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
- <xsl:template name="count-spanned-columns">
- <xsl:param name="expandedColumnCount" select="0"/>
- <xsl:param name="columns"/>
- <xsl:param name="columnsCount" select="count($columns)"/>
- <xsl:param name="columnIndex" select="1"/>
- <xsl:choose>
- <xsl:when test="$columnIndex &lt;= $columnsCount">
- <xsl:call-template name="count-spanned-columns">
- <xsl:with-param name="columns" select="$columns"/>
- <xsl:with-param name="columnsCount" select="$columnsCount"/>
- <xsl:with-param name="columnIndex" select="$columnIndex + 1"/>
- <xsl:with-param name="expandedColumnCount" select="$expandedColumnCount + $columns[$columnIndex]/@ss:Span"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$expandedColumnCount"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ss:Worksheet">
- <xsl:element name="table:table">
- <xsl:attribute name="table:name">
- <xsl:value-of select="@ss:Name"/>
- </xsl:attribute>
- <!-- other attributes aren't suitable to apply yet -->
- <xsl:if test="ss:Table">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat( 'ta', count(preceding-sibling::ss:Worksheet)+1)"/>
- </xsl:attribute>
- <xsl:if test="@ss:Protected = '1'">
- <xsl:attribute name="table:protected">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="descendant::ss:NamedRange[@ss:Name = 'Print_Area' and contains( @ss:RefersTo, '!R')]">
- <xsl:variable name="referto">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="descendant::ss:NamedRange/@ss:RefersTo"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="table:print-ranges">
- <xsl:value-of select="translate( $referto, '=', '$')"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:variable name="table-pos">
- <xsl:value-of select="count(../preceding-sibling::ss:Worksheet)+1"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="ss:Table/@ss:ExpandedColumnCount">
- <xsl:choose>
- <xsl:when test="not(ss:Table/ss:Column)">
- <!-- no columns exist -->
- <xsl:call-template name="create-columns-without-input">
- <xsl:with-param name="table-pos" select="$table-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="create-columns">
- <xsl:with-param name="columnCount" select="ss:Table/@ss:ExpandedColumnCount"/>
- <xsl:with-param name="currentColumnNode" select="ss:Table/ss:Column[1]"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="ss:Table/ss:Column/@ss:Span">
- <!-- No absolute column number (ss:ExpandedColumnCount) is add the nodes and spanned columns -->
- <xsl:variable name="spannedColumns">
- <xsl:call-template name="count-spanned-columns">
- <xsl:with-param name="columns" select="ss:Table/ss:Column[@ss:Span]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="create-columns">
- <xsl:with-param name="columnCount" select="count(ss:Table/ss:Column) + number($spannedColumns)"/>
- <xsl:with-param name="currentColumnNode" select="ss:Table/ss:Column[1]"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- No absolute column number (ss:ExpandedColumnCount) is add the nodes -->
- <xsl:call-template name="create-columns">
- <xsl:with-param name="columnCount" select="count(ss:Table/ss:Column)"/>
- <xsl:with-param name="currentColumnNode" select="ss:Table/ss:Column[1]"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <!-- generates the string of row\column position if ConditionalFormatting exists -->
- <xsl:variable name="condition-pos-str1">
- <xsl:if test="./x:ConditionalFormatting">
- <xsl:call-template name="condition-row-column-string">
- <xsl:with-param name="last" select="''"/>
- <xsl:with-param name="total" select="count(./x:ConditionalFormatting)"/>
- <xsl:with-param name="index" select="1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="condition-pos-str2">
- <xsl:if test="./x:DataValidation">
- <xsl:call-template name="validation-row-column-string">
- <xsl:with-param name="last" select="''"/>
- <xsl:with-param name="total" select="count(./x:DataValidation)"/>
- <xsl:with-param name="index" select="1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="condition-pos-str" select="concat($condition-pos-str1, $condition-pos-str2)"/>
- <xsl:choose>
- <xsl:when test="./ss:Table/ss:Row">
- <xsl:variable name="worksheetNo" select="count(preceding-sibling::ss:Worksheet)+1"/>
- <xsl:variable name="rowNodeCount" select="count(ss:Table/ss:Row)"/>
- <xsl:variable name="expandedRowCount">
- <xsl:call-template name="get-expanded-row-count"/>
- </xsl:variable>
- <xsl:variable name="expandedColumnCount">
- <xsl:call-template name="get-expanded-column-count"/>
- </xsl:variable>
- <xsl:for-each select="ss:Table/ss:Row">
- <xsl:apply-templates select="." mode="create-rows">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- <xsl:with-param name="rowNodeCount" select="$rowNodeCount"/>
- <xsl:with-param name="rowNodeIndex" select="position()"/>
- <xsl:with-param name="expandedRowCount" select="$expandedRowCount"/>
- <xsl:with-param name="expandedRowCountIndex" select="1"/>
- <xsl:with-param name="expandedColumnCount" select="$expandedColumnCount"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="./x:PageBreaks/x:RowBreaks">
- <xsl:for-each select="./x:PageBreaks/x:RowBreaks/x:RowBreak">
- <xsl:variable name="number-repeated">
- <xsl:choose>
- <xsl:when test="position() = 1">
- <xsl:value-of select="./x:Row"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select=". - preceding::x:RowBreak[position()=count(.)]/x:Row - 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$number-repeated &gt; 0">
- <xsl:element name="table:table-row">
- <xsl:if test="@ss:Hidden = '1'">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('ro',$table-pos)"/>
- </xsl:attribute>
- <xsl:attribute name="table:number-rows-repeated">
- <xsl:value-of select="$number-repeated"/>
- </xsl:attribute>
- <xsl:choose>
- <xsl:when test="ss:Table/@ss:ExpandedColumnCount">
- <table:table-cell table:number-columns-repeated="{ss:Table/@ss:ExpandedColumnCount}"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- OASIS XML row can not be empty -->
- <table:table-cell table:number-columns-repeated="256"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:element name="table:table-row">
- <xsl:if test="@ss:Hidden = '1'">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('rob',$table-pos)"/>
- </xsl:attribute>
- <xsl:choose>
- <xsl:when test="ss:Table/@ss:ExpandedColumnCount">
- <table:table-cell table:number-columns-repeated="{ss:Table/@ss:ExpandedColumnCount}"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- OASIS XML row can not be empty -->
- <table:table-cell table:number-columns-repeated="256"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <!-- in case no table row exists (empty spreadsheet) -->
- <xsl:element name="table:table-row">
- <xsl:choose>
- <xsl:when test="ss:Table/@ss:StyleID">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="ss:Table/@ss:StyleID"/>
- </xsl:attribute>
- <xsl:element name="table:table-cell">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="ss:Table/@ss:StyleID"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('ro',$table-pos)"/>
- </xsl:attribute>
- <xsl:element name="table:table-cell"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="./x:ConditionalFormatting">
- <xsl:variable name="condition-row-max">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="div-value" select="'R'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="condition-col-max">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="div-value" select="'C'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="break-row-max">
- <xsl:call-template name="break-row-beyond-max">
- <xsl:with-param name="pos" select="1"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="count-value" select="count(./x:PageBreaks/x:RowBreaks/x:RowBreak)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="end-value">
- <xsl:choose>
- <xsl:when test="$condition-row-max &lt; $break-row-max">
- <xsl:value-of select="$break-row-max"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$condition-row-max"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="get-row-beyond-last">
- <xsl:with-param name="index-value" select="1"/>
- <xsl:with-param name="worksheetNo" select="count(preceding-sibling::ss:Worksheet)+1"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="end-pos" select="$end-value"/>
- <xsl:with-param name="total-col" select="$condition-col-max"/>
- </xsl:call-template>
- </xsl:if>
- <!-- if exists attribute of StyleID in tag of ss:Table but no Row/Column -->
- <xsl:if test="./ss:Table/@ss:StyleID">
- <table:table-row table:style-name="{concat('ro',$table-pos)}" table:number-rows-repeated="65564">
- <table:table-cell table:number-columns-repeated="256"/>
- </table:table-row>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <!-- Note: Need to be refactored -->
- <xsl:template name="create-columns-without-input">
- <xsl:param name="table-pos"/>
- <xsl:choose>
- <xsl:when test="./x:PageBreaks/x:ColBreaks">
- <xsl:for-each select="./x:PageBreaks/x:ColBreaks/x:ColBreak">
- <xsl:variable name="number-repeated">
- <xsl:choose>
- <xsl:when test="position() = 1">
- <xsl:value-of select="./x:Column"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select=". - preceding::x:ColBreak[position()=count(.)]/x:Column - 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$number-repeated &gt; 0">
- <xsl:element name="table:table-column">
- <xsl:if test="ancestor::ss:Worksheet/ss:Table/@ss:StyleID">
- <xsl:attribute name="table:default-cell-style-name">
- <xsl:value-of select="ancestor::ss:Worksheet/ss:Table/@ss:StyleID"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="@ss:Hidden = '1'">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('co',$table-pos)"/>
- </xsl:attribute>
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="$number-repeated"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="table:table-column">
- <!-- column style be made out beforehead -->
- <xsl:if test="ancestor::ss:Worksheet/ss:Table/@ss:StyleID">
- <xsl:attribute name="table:default-cell-style-name">
- <xsl:value-of select="ancestor::ss:Worksheet/ss:Table/@ss:StyleID"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="@ss:Hidden = '1'">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('cob',$table-pos)"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="table:table-column">
- <xsl:choose>
- <xsl:when test="ss:Table/@ss:StyleID">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="ss:Table/@ss:StyleID"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name">
- <xsl:text>co1</xsl:text>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="ss:Table/@ss:ExpandedColumnCount and ss:Table/@ss:ExpandedColumnCount > 0">
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="ss:Table/@ss:ExpandedColumnCount"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:default-cell-style-name">
- <xsl:text>Default</xsl:text>
- </xsl:attribute>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--
- Example:
- <ss:Table>
- <ss:Column ss:Index="4" ss:Width="500" ss:Span="3" />
- <ss:Column ss:Width="200" />
- </ss:Table>
+ <xsl:variable name="current-index">
+ <xsl:choose>
+ <xsl:when test="@ss:Index">
+ <xsl:value-of select="@ss:Index - 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$earlierRowNo"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="row-break">
+ <xsl:choose>
+ <xsl:when test="$span-value = 0">
+ <xsl:if test="../x:PageBreaks/x:RowBreaks/x:RowBreak/x:Row = $current-index">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="../x:PageBreaks/x:RowBreaks[(x:RowBreak/x:Row &gt; $earlierRowNo) and (x:RowBreak/x:Row &lt; ($earlierRowNo + $span-value))]">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$row-break = 1">
+ <xsl:element name="style:style">
+ <xsl:choose>
+ <xsl:when test="@ss:StyleID">
+ <xsl:attribute name="style:name"><xsl:value-of select="concat('ro', $table-pos, '-',$rowNodeIndex,'-',@ss:StyleID)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:name"><xsl:value-of select="concat('ro', $table-pos, '-',$rowNodeIndex)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="style:family">table-row</xsl:attribute>
- Prior column (ss:Index - 1) is written
- The given fourth cell (ss:Index="4") is handled as repeated three times (ss:Span="3").
- The eight column got a width of "200"
- ContextNode: ss:Worksheet
- -->
- <xsl:key match="/ss:Workbook/ss:Worksheet/x:PageBreaks/x:ColBreaks/x:ColBreak" name="ColBreak" use="Column"/>
- <xsl:template name="create-columns">
- <xsl:param name="columnCount"/>
- <xsl:param name="currentColumn" select="1"/>
- <xsl:param name="finishedColumns" select="0"/>
- <xsl:param name="worksheetNo" select="count(preceding-sibling::ss:Worksheet)+1"/>
- <xsl:param name="currentColumnNode"/>
- <xsl:choose>
- <xsl:when test="$finishedColumns &lt; $columnCount">
- <xsl:choose>
- <xsl:when test="$currentColumnNode">
- <xsl:choose>
- <xsl:when test="$currentColumnNode/@ss:Index - $finishedColumns &gt; 1">
- <!-- found column with index.
- filling up table with empty columns until Index is reached -->
- <xsl:call-template name="create-default-column">
- <xsl:with-param name="currentColumn" select="$currentColumn"/>
- <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- <xsl:call-template name="create-columns">
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="currentColumn" select="$currentColumn"/>
- <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
- <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="table:table-column">
- <xsl:if test="$currentColumnNode/@ss:Hidden = '1'">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:if test="$currentColumnNode/@ss:Span">
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="$currentColumnNode/@ss:Span + 1"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="key('ColBreak', $currentColumn)">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('cob', $worksheetNo, '-', $currentColumn)"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('co', $worksheetNo, '-', $currentColumn)"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$currentColumnNode/@ss:StyleID">
- <xsl:attribute name="table:default-cell-style-name">
- <xsl:value-of select="$currentColumnNode/@ss:StyleID"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:default-cell-style-name">
- <xsl:text>Default</xsl:text>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:call-template name="create-columns">
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="currentColumn" select="$currentColumn + 1"/>
- <xsl:with-param name="finishedColumns">
- <xsl:choose>
- <xsl:when test="$currentColumnNode/@ss:Span">
- <xsl:value-of select="$finishedColumns + $currentColumnNode/@ss:Span + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$finishedColumns + 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="currentColumnNode" select="ss:Table/ss:Column[$currentColumn + 1]"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- <xsl:if test="not($finishedColumns + 1 = $columnCount)"> -->
- <xsl:call-template name="create-default-column">
- <xsl:with-param name="currentColumn" select="$currentColumn"/>
- <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- <xsl:call-template name="create-columns">
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="currentColumn" select="$currentColumn"/>
- <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$currentColumn = $columnCount">
- <!-- Note: name test document for this case and refactor the template -->
- <xsl:if test="x:PageBreaks/x:ColBreaks/x:ColBreak/x:Column &gt; $finishedColumns">
- <xsl:call-template name="get-column-beyond-last">
- <xsl:with-param name="index-value" select="$finishedColumns"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- </xsl:if>
- <!--Note: Test Scenario for this case: generates some special tags for whole row style
- <xsl:if test="(./ss:Table[@ss:StyleID] or ./ss:Table/ss:Row[@ss:StyleID]) and (256 - $finishedColumns &gt; 0)">
- <xsl:element name="table:table-column">
- <xsl:attribute name="table:default-cell-style-name"><xsl:choose><xsl:when test="./ss:Table[@ss:StyleID]"><xsl:value-of select="./ss:Table/@ss:StyleID" /></xsl:when><xsl:otherwise><xsl:value-of select="'Default'" /></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="table:style-name"><xsl:value-of select="'co1'" /></xsl:attribute>
- <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="256 - $finishedColumns" /></xsl:attribute>
- </xsl:element>
- </xsl:if>
- -->
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="create-default-column">
- <xsl:param name="currentColumn"/>
- <xsl:param name="currentColumnNode"/>
- <xsl:param name="worksheetNo"/>
- <xsl:param name="nextColumnNo"/>
- <xsl:element name="table:table-column">
- <xsl:attribute name="table:default-cell-style-name">
- <xsl:call-template name="get-default-cell-style">
- <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
- </xsl:call-template>
- </xsl:attribute>
- <!-- <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="$nextColumnNo - $currentColumn"/></xsl:attribute> -->
- <xsl:choose>
- <xsl:when test="key('ColBreak', $currentColumn)">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('cob',$worksheetNo)"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('co',$worksheetNo)"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:template>
- <xsl:template name="create-rows">
- <xsl:param name="condition-pos-str"/>
- <xsl:apply-templates select="ss:Table/ss:Row[1]" mode="create-rows">
- <xsl:with-param name="worksheetNo" select="count(preceding-sibling::ss:Worksheet)+1"/>
- <xsl:with-param name="rowNodeCount" select="count(ss:Table/ss:Row)"/>
- <xsl:with-param name="rowNodeIndex" select="1"/>
- <xsl:with-param name="expandedRowCount">
- <xsl:call-template name="get-expanded-row-count"/>
- </xsl:with-param>
- <xsl:with-param name="expandedRowCountIndex" select="1"/>
- <xsl:with-param name="expandedColumnCount">
- <xsl:call-template name="get-expanded-column-count"/>
- </xsl:with-param>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="ss:Row" mode="create-rows">
- <xsl:param name="worksheetNo"/>
- <xsl:param name="rowNodeCount"/>
- <xsl:param name="rowNodeIndex"/>
- <xsl:param name="expandedRowCount"/>
- <xsl:param name="expandedColumnCount"/>
- <xsl:param name="condition-pos-str"/>
- <xsl:variable name="simple-span-value" select="@ss:Span + count(@ss:Span)"/>
- <xsl:variable name="expandedRowCountIndex">
- <xsl:choose>
- <xsl:when test="@ss:Index"><xsl:value-of select="@ss:Index -1 + $simple-span-value"/></xsl:when>
- <xsl:otherwise>
- <xsl:variable name="recent-index" select="preceding-sibling::ss:Row[@ss:Index][last()]"></xsl:variable>
- <xsl:choose>
- <xsl:when test="$recent-index">
- <xsl:variable name="nodes-up-to-current" select="set:intersection(preceding-sibling::ss:Row, $recent-index/following-sibling::ss:Row)"></xsl:variable>
- <xsl:variable name="allSpans" select="$nodes-up-to-current/@ss:Span"/>
- <xsl:value-of select="$recent-index/@ss:Index + count($nodes-up-to-current) + sum($allSpans) + count($allSpans)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="allSpans" select="preceding-sibling::ss:Row/@ss:Span"/>
- <xsl:value-of select="$rowNodeIndex + sum($allSpans) + count($allSpans)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="currentRowNo">
- <xsl:choose>
- <xsl:when test="@ss:Index">
- <xsl:value-of select="@ss:Index"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$expandedRowCountIndex"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="@ss:Index - $expandedRowCountIndex &gt; 0">
- <!-- create the precding missing rows -->
- <xsl:element name="table:table-row">
- <!-- fill the preceding gap with rows without a cell -->
- <xsl:attribute name="table:number-rows-repeated">
- <xsl:value-of select="@ss:Index - $expandedRowCountIndex"/>
- </xsl:attribute>
- <xsl:choose>
- <xsl:when test="$expandedColumnCount != 0">
- <table:table-cell table:number-columns-repeated="{$expandedColumnCount}"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- OASIS XML row can not be empty -->
- <table:table-cell table:number-columns-repeated="256"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:element name="table:table-row">
- <xsl:attribute name="table:style-name">
- <xsl:choose>
- <xsl:when test="@ss:StyleID">
- <xsl:value-of select="concat('ro',$worksheetNo, '-',$rowNodeIndex,'-', @ss:StyleID)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('ro',$worksheetNo,'-',$rowNodeIndex)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:if test="@ss:Hidden = '1'">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:if test="@ss:Span">
- <xsl:attribute name="table:number-rows-repeated">
- <xsl:value-of select="@ss:Span + 1"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <!-- Excel row without content -->
- <xsl:when test="not(*)">
- <!-- OASIS OpenDocument Format does not allow rows without a cell -->
- <xsl:choose>
- <xsl:when test="$expandedColumnCount != 0">
- <table:table-cell table:number-columns-repeated="{$expandedColumnCount}"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- OASIS XML row can not be empty -->
- <table:table-cell table:number-columns-repeated="256"/>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="create-cells">
- <xsl:with-param name="row-pos" select="$currentRowNo"/>
- <xsl:with-param name="expandedColumnCount" select="$expandedColumnCount"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
-
- </xsl:template>
+ <xsl:element name="style:table-row-properties">
+ <xsl:choose>
+ <xsl:when test="@ss:Height">
+ <xsl:attribute name="style:row-height">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(@ss:Height,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:row-height">
+ <xsl:value-of select="$default-row-height"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@ss:AutoFitHeight = '0'">
+ <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="@ss:Height &gt; 0">
+ <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ <xsl:apply-templates select="key('Style', @ss:StyleID)/ss:Interior" mode="style-style-content"/>
+ </xsl:element>
+ <!--
+ <xsl:apply-templates select="key('Style', @ss:StyleID)" mode="style-style-content" />
+ -->
+ </xsl:element>
+ </xsl:if>
+ <!--
+ <style:style style:name="{concat('ro', $table-pos, '-',$rowNodeIndex)}" style:family="table-row">
+ -->
+ <xsl:element name="style:style">
+ <xsl:choose>
+ <xsl:when test="@ss:StyleID">
+ <xsl:attribute name="style:name"><xsl:value-of select="concat('ro', $table-pos, '-',$rowNodeIndex,'-',@ss:StyleID)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:name"><xsl:value-of select="concat('ro', $table-pos, '-',$rowNodeIndex)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="style:family">table-row</xsl:attribute>
- <xsl:template name="get-expanded-column-count">
- <xsl:choose>
- <xsl:when test="ss:Table/@ss:ExpandedColumnCount">
- <xsl:value-of select="ss:Table/@ss:ExpandedColumnCount"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="ss:Table/ss:Column/@ss:Span">
- <!-- No absolute column number (ss:ExpandedColumnCount) is add the nodes and spanned columns -->
- <xsl:variable name="spannedColumns">
- <xsl:call-template name="count-spanned-columns">
- <xsl:with-param name="columns" select="ss:Table/ss:Column[@ss:Span]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="count(ss:Table/ss:Column) + number($spannedColumns)"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- No absolute column number (ss:ExpandedColumnCount) is add the nodes -->
- <xsl:value-of select="count(ss:Table/ss:Column)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-expanded-row-count">
- <xsl:choose>
- <xsl:when test="ss:Table/@ss:ExpandedRowCount">
- <xsl:value-of select="ss:Table/@ss:ExpandedRowCount"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="ss:Table/ss:Row/@ss:Index and not(ss:Table/ss:Row/@ss:Span)">
- <xsl:variable name="lastIndexedRow" select="ss:Table/ss:Row[@ss:Index][last()]"/>
- <xsl:value-of select="number($lastIndexedRow/@ss:Index) + count($lastIndexedRow/following-sibling::ss:Row)"/>
- </xsl:when>
- <xsl:when test="ss:Table/ss:Row/@ss:Index and ss:Table/ss:Row/@ss:Span">
- <xsl:variable name="lastIndexedRow" select="ss:Table/ss:Row[@ss:Index][last()]"/>
- <xsl:variable name="spannedRows">
- <xsl:call-template name="count-spanned-rows">
- <xsl:with-param name="rows" select="$lastIndexedRow/following-sibling::ss:Row[@ss:Span]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="number($lastIndexedRow/@ss:Index) + count($lastIndexedRow/following-sibling::ss:Row) + number($spannedRows)"/>
- </xsl:when>
- <xsl:when test="not(ss:Table/ss:Row/@ss:Index) and ss:Table/ss:Row/@ss:Span">
- <xsl:variable name="spannedRows">
- <xsl:call-template name="count-spanned-rows">
- <xsl:with-param name="rows" select="ss:Table/ss:Rows[@ss:Span]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="count(ss:Table/ss:Row + number($spannedRows))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="count(ss:Table/ss:Row)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="count-spanned-rows">
- <xsl:param name="expandedRowCount" select="0"/>
- <xsl:param name="rows"/>
- <xsl:param name="rowsCount" select="count($rows)"/>
- <xsl:param name="rowIndex" select="1"/>
- <xsl:choose>
- <xsl:when test="$rowIndex &lt;= $rowsCount">
- <xsl:call-template name="count-spanned-rows">
- <xsl:with-param name="rows" select="$rows"/>
- <xsl:with-param name="rowsCount" select="$rowsCount"/>
- <xsl:with-param name="rowIndex" select="$rowIndex + 1"/>
- <xsl:with-param name="expandedRowCount" select="$expandedRowCount + $rows[$rowIndex]/@ss:Span"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$expandedRowCount"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-default-cell-style">
- <xsl:param name="currentColumnNode"/>
- <xsl:choose>
- <xsl:when test="$currentColumnNode">
- <xsl:choose>
- <xsl:when test="$currentColumnNode/@ss:StyleID">
- <xsl:value-of select="$currentColumnNode/@ss:StyleID"/>
- </xsl:when>
- <xsl:otherwise>Default</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="./ss:Table[@ss:StyleID]">
- <xsl:value-of select="./ss:Table/@ss:StyleID"/>
- </xsl:when>
- <xsl:otherwise>Default</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-row-beyond-last">
- <!-- dealing the RowBreak after last row by recursion -->
- <xsl:param name="index-value"/>
- <xsl:param name="worksheetNo"/>
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="end-pos"/>
- <xsl:param name="total-col"/>
- <xsl:variable name="current" select="concat('R',$index-value)"/>
- <xsl:element name="table:table-row">
- <xsl:choose>
- <xsl:when test="./x:PageBreaks/x:RowBreaks/x:RowBreak/x:Row = ($index-value - 1)">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('rob',$worksheetNo)"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('ro',$worksheetNo)"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <!-- Note: 2 be refactored
- <xsl:when test="./ss:Table/ss:Column[@ss:StyleID] or ./ss:Table[@ss:StyleID]">
- <xsl:if test="256 - count(ss:Table/ss:Column) &gt; 0">
- <table:table-cell table:number-columns-repeated="{256 - count(ss:Table/ss:Column)}" />
- </xsl:if>
- </xsl:when>-->
- <xsl:when test="contains($condition-pos-str,$current)">
- <xsl:call-template name="create-spanning-cells">
- <xsl:with-param name="row-pos" select="$index-value"/>
- <xsl:with-param name="c-start" select="1"/>
- <xsl:with-param name="c-end" select="$total-col"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- OASIS XML does not allow rows without a cell -->
- <table:table-cell/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="$index-value &lt; ($end-pos + 1)">
- <xsl:call-template name="get-row-beyond-last">
- <xsl:with-param name="index-value" select="$index-value + 1"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="end-pos" select="$end-pos"/>
- <xsl:with-param name="total-col" select="$total-col"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="break-row-beyond-max">
- <!-- returns the max position of the row from condition-pos-str -->
- <xsl:param name="pos"/>
- <xsl:param name="last-value"/>
- <xsl:param name="count-value"/>
- <xsl:variable name="pre-value" select="./x:PageBreaks/x:RowBreaks/x:RowBreak[position() = $pos]/x:Row"/>
- <xsl:variable name="end-value">
- <xsl:choose>
- <xsl:when test="$last-value &lt; $pre-value">
- <xsl:value-of select="$pre-value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$last-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$pos &lt; $count-value">
- <xsl:call-template name="break-row-beyond-max">
- <xsl:with-param name="pos" select="$pos + 1"/>
- <xsl:with-param name="last-value" select="$end-value"/>
- <xsl:with-param name="count-value" select="$count-value"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$end-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-column-beyond-last">
- <!-- dealing the ColBreak after last column by recursion -->
- <xsl:param name="index-value"/>
- <xsl:param name="worksheetNo"/>
- <xsl:for-each select="./x:PageBreaks/x:ColBreaks/x:ColBreak">
- <xsl:variable name="each-column-value" select="./x:Column"/>
- <xsl:choose>
- <xsl:when test="$each-column-value + 1 &gt; $index-value">
- <xsl:variable name="number-repeated">
- <xsl:choose>
- <xsl:when test="preceding-sibling::x:ColBreak[position()=count(.)]/x:Column + 1 = $index-value">
- <xsl:value-of select="$each-column-value - preceding-sibling::x:ColBreak[position()=count(.)]/x:Column - 1"/>
- </xsl:when>
- <xsl:when test="preceding-sibling::x:ColBreak[position()=count(.)]/x:Column + 1 &gt; $index-value">
- <xsl:value-of select="$each-column-value - preceding-sibling::x:ColBreak[position()=count(.)]/x:Column - 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$each-column-value - $index-value + 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$number-repeated &gt; 0">
- <xsl:element name="table:table-column">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="'co1'"/>
- </xsl:attribute>
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="$number-repeated"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="table:table-column">
- <xsl:if test="./../../../ss:Table[@ss:StyleID]">
- <xsl:attribute name="table:default-cell-style-name">
- <xsl:value-of select="./ss:Table/@ss:StyleID"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('cob',$worksheetNo)"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:when test="$each-column-value + 1 = $index-value">
- <xsl:element name="table:table-column">
- <xsl:if test="./../../../ss:Table[@ss:StyleID]">
- <xsl:attribute name="table:default-cell-style-name">
- <xsl:value-of select="./../../../ss:Table/@ss:StyleID"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="concat('cob',$worksheetNo)"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="create-spanning-cells">
- <!-- judge the position of the Cell in the condition-pos-str -->
- <xsl:param name="row-pos"/>
- <xsl:param name="c-start"/>
- <xsl:param name="c-end"/>
- <xsl:param name="condition-pos-str"/>
- <xsl:variable name="current" select="concat('R',$row-pos,'C',$c-start,',')"/>
- <xsl:variable name="style-name">
- <xsl:choose>
- <xsl:when test="contains($condition-pos-str,$current)">
- <xsl:variable name="temp-str">
- <xsl:call-template name="condition-str">
- <xsl:with-param name="param-str" select="substring-before($condition-pos-str,$current)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="starts-with($temp-str, 'c')">
- <xsl:value-of select="concat('ce', substring-after($temp-str, 'c'))"/>
- </xsl:when>
- <xsl:when test="starts-with($temp-str, 'v')">
- <xsl:value-of select="concat('val', substring-after($temp-str, 'v'))"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- as for the spanned cells no style is taken.. -->
- <xsl:choose>
- <!-- inherit style from parent row style-->
- <xsl:when test="../@ss:StyleID">
- <xsl:value-of select="../@ss:StyleID"/>
- </xsl:when>
- <!-- if no correspondent column style exisit.. -->
- <!-- inherit style from parent table style -->
- <xsl:when test="../../@ss:StyleID">
- <!-- function to give in col-pos and get back column style -->
- <xsl:variable name="relatedColumnStyle">
- <xsl:call-template name="get-related-column-style">
- <!-- the given position of the cell in the table, a column style is searched -->
- <xsl:with-param name="calculatedCellPosition" select="$c-start" />
- <!-- all columns in XML -->
- <xsl:with-param name="columnXMLNodes" select="../../ss:Column"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$relatedColumnStyle = ''">
- <xsl:value-of select="../../@ss:StyleID"/>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="table:table-cell">
- <xsl:if test="not($style-name = '')">
- <xsl:choose>
- <xsl:when test="starts-with($style-name, 'val')">
- <xsl:attribute name="table:content-validation-name">
- <xsl:value-of select="$style-name"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="starts-with($style-name, 'ce')">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="$style-name"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="$style-name"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="$c-start &lt; $c-end">
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="$c-end - $c-start + 1"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="condition-row-col-pos-max">
- <!-- returns the max position of the column or row from condition-pos-str -->
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="last-value"/>
- <xsl:param name="div-value"/>
- <xsl:variable name="pre-value">
- <xsl:choose>
- <xsl:when test="$div-value = 'R'">
- <xsl:value-of select="substring-before(substring-after($condition-pos-str,$div-value),'C')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before(substring-after($condition-pos-str,$div-value),',')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="end-value">
- <xsl:choose>
- <xsl:when test="$last-value &lt; $pre-value">
- <xsl:value-of select="$pre-value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$last-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($condition-pos-str,$div-value)">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="substring-after($condition-pos-str,$div-value)"/>
- <xsl:with-param name="last-value" select="$end-value"/>
- <xsl:with-param name="div-value" select="$div-value"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$end-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="condition-str">
- <!-- returns the string of style name of condition-pos-str -->
- <xsl:param name="param-str"/>
- <xsl:choose>
- <xsl:when test="contains($param-str,'(')">
- <xsl:call-template name="condition-str">
- <xsl:with-param name="param-str" select="substring-after($param-str,'(')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before($param-str,':')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:key name="Style" match="/ss:Workbook/ss:Styles/ss:Style" use="@ss:ID"/>
- <xsl:template name="create-cells">
- <xsl:param name="row-pos"/>
- <xsl:param name="expandedColumnCount"/>
- <xsl:param name="condition-pos-str"/>
- <xsl:choose>
- <xsl:when test="ss:Cell">
- <xsl:apply-templates select="ss:Cell[1]" mode="selected">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$expandedColumnCount"/>
- <!--
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str" />
- <xsl:with-param name="last-value" select="0" />
- <xsl:with-param name="div-value" select="'C'" />
- </xsl:call-template>
- </xsl:with-param> -->
- <xsl:with-param name="col-pos-written" select="0"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="current" select="concat('R',$row-pos,'C')"/>
- <xsl:choose>
- <xsl:when test="contains($condition-pos-str,$current)">
- <xsl:call-template name="create-spanning-cells">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="c-start" select="1"/>
- <xsl:with-param name="c-end">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="div-value" select="'C'"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos" select="1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- OASIS XML does not allow an empty row -->
- <xsl:choose>
- <xsl:when test="$expandedColumnCount != 0">
- <table:table-cell table:number-columns-repeated="{$expandedColumnCount}"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- OASIS XML row can not be empty -->
- <table:table-cell table:number-columns-repeated="256"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ss:Cell" name="ss:Cell" mode="selected">
- <!-- Contains the max position of the column or row from the concatenation from
- x:ConditionalFormatting
- and
- x:DataValidation -->
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="col-pos-max"/>
- <xsl:param name="col-pos-written" select="0"/>
- <xsl:param name="col-pos-current" select="0"/>
- <xsl:param name="row-pos"/>
- <xsl:param name="col-repeated" select="1"/>
+ <xsl:element name="style:table-row-properties">
+ <xsl:choose>
+ <xsl:when test="@ss:Height">
+ <xsl:attribute name="style:row-height">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(@ss:Height,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:row-height">
+ <xsl:value-of select="$default-row-height"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@ss:AutoFitHeight">
+ <xsl:choose>
+ <xsl:when test="@ss:AutoFitHeight = '0'">
+ <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="@ss:Height &gt; 0">
+ <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:break-before">auto</xsl:attribute>
+ <!-- apply to background -->
+ <xsl:apply-templates select="key('Style', @ss:StyleID)/ss:Interior" mode="style-style-content"/>
+ </xsl:element>
+ <!--
+ <xsl:apply-templates select="key('Style', ss:Row[position() = $rowNodeIndex]/@ss:StyleID)" mode="style-style-content" />
+ -->
+ </xsl:element>
- <!-- The column position of the cell (might jumped by ss:Index) -->
- <xsl:variable name="col-pos">
- <xsl:choose>
- <xsl:when test="@ss:Index">
- <xsl:choose>
- <xsl:when test="@ss:MergeAcross">
- <xsl:value-of select="@ss:MergeAcross + @ss:Index"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@ss:Index"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@ss:MergeAcross">
- <xsl:value-of select="1 + @ss:MergeAcross + $col-pos-current"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="1 + $col-pos-current"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="nextCell" select="following-sibling::ss:Cell[1]"/>
- <!-- Multiple empty cells with the same or no style will be moved to one cell with a 'table:number-columns-repeated' attribute -->
- <xsl:variable name="cell-is-repeatable" select="
- not(current()/*)
- and
- not(current()/text())
- and
- (
- not($nextCell)
- and $col-pos &gt; $col-pos-written + 1
- or
- (
- $nextCell
- and
- not($nextCell/*)
- and
- not($nextCell/text())
- and
- (
- (current()/@ss:StyleID = $nextCell/@ss:StyleID)
- or
- (not(current()/@ss:StyleID) and not($nextCell/@ss:StyleID))
- )
- and
- (
- not($nextCell/@ss:Index)
- or
- ($nextCell/@ss:Index = $col-pos + 1)
- )
- )
- ) "/>
- <xsl:choose>
- <!-- Scenario: The missing cells scipped by using the ss:Index attribute will be added -->
- <xsl:when test="@ss:Index and @ss:Index &gt; $col-pos-written + 1">
- <!-- In Open Document nothing comparable to Index exists,
- the missing cells might have to be created, if they had content as only style will be repeated-->
- <xsl:call-template name="create-spanning-cells">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="c-start" select="$col-pos-current + 1"/>
- <xsl:with-param name="c-end" select="@ss:Index - 1"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- <xsl:call-template name="ss:Cell">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-written" select="@ss:Index - 1"/>
- <xsl:with-param name="col-pos-current" select="$col-pos"/>
- <xsl:with-param name="col-repeated" select="$col-repeated"/>
- </xsl:call-template>
- </xsl:when>
- <!-- Scenario: A sequence of cells can be put together as one cell -->
- <xsl:when test="$cell-is-repeatable">
- <xsl:apply-templates select="$nextCell" mode="selected">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-written" select="$col-pos-written"/>
- <xsl:with-param name="col-pos-current" select="$col-pos"/>
- <xsl:with-param name="col-repeated" select="$col-repeated"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <!-- if the cell wasn't repeated yet, created first -->
- <xsl:if test="$col-repeated = 1">
- <xsl:element name="table:table-cell">
- <!-- in case the cell has an Index and is repeatable (s.above) and therefore has not been repeated earlier -->
- <xsl:choose>
- <xsl:when test="@ss:MergeAcross">
- <xsl:if test="$col-pos - @ss:MergeAcross &gt; $col-pos-written + 1">
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="$col-pos - $col-pos-written"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$col-pos &gt; $col-pos-written + 1">
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="$col-pos - $col-pos-written"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="create-table-cell-attributes">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos" select="$col-pos"/>
- <xsl:with-param name="row-pos" select="$row-pos"/>
- </xsl:call-template>
- <xsl:call-template name="create-table-cell-content">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos" select="$col-pos"/>
- <xsl:with-param name="row-pos" select="$row-pos"/>
- </xsl:call-template>
- </xsl:element>
- <!-- ss:MergeAcross (column spanned) indicates a covered table-cell in Open Document XML-->
- <xsl:if test="@ss:MergeAcross">
- <xsl:element name="table:covered-table-cell">
- <xsl:if test="@ss:MergeAcross &gt; 1">
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="@ss:MergeAcross"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:if>
- <xsl:choose>
- <!-- the following block is not used, if the cell had been repeated earlier -->
- <xsl:when test="$nextCell and not($cell-is-repeatable and $col-repeated = 1)">
- <xsl:choose>
- <!-- After cells can no longer be repeated write out the attribute -->
- <xsl:when test="not($cell-is-repeatable) and $col-repeated > 1">
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="$col-repeated"/>
- </xsl:attribute>
- </xsl:when>
- <!-- At the end of the row -->
- <xsl:when test="not($nextCell)">
- <xsl:if test="../../../x:ConditionalFormatting">
- <!-- at the last position of the Cell tag,inspecting the following cell before condition-row-col-pos-max -->
- <xsl:call-template name="create-spanning-cells">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="c-start" select="$col-pos"/>
- <xsl:with-param name="c-end" select="$col-pos-max"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <!-- If the cells can not be repeated (default) -->
- <xsl:when test="not($cell-is-repeatable)">
- <!-- Traverse the following Cell -->
- <xsl:apply-templates select="$nextCell" mode="selected">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-written" select="$col-pos"/>
- <xsl:with-param name="col-pos-current" select="$col-pos"/>
- </xsl:apply-templates>
- </xsl:when>
- <!-- Go on with started repetition -->
- <xsl:otherwise>
- <xsl:apply-templates select="$nextCell" mode="selected">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-written" select="$col-pos"/>
- <xsl:with-param name="col-pos-current" select="$col-pos"/>
- <xsl:with-param name="col-repeated" select="$col-repeated + 1"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="not($nextCell)">
- <xsl:choose>
- <xsl:when test="$col-repeated = 1 and ($col-pos &lt; $col-pos-max)">
- <table:table-cell table:number-columns-repeated="{$col-pos-max - $col-pos}"/>
- </xsl:when>
- <xsl:when test="$col-repeated &gt; 1">
- <xsl:attribute name="table:number-columns-repeated">
- <xsl:value-of select="$col-repeated"/>
- </xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$nextCell" mode="skip">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-written" select="$col-pos"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ss:Cell" mode="skip">
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="col-pos-max"/>
- <xsl:param name="col-pos-written"/>
- <xsl:param name="row-pos"/>
- <xsl:variable name="nextCell" select="following-sibling::ss:Cell[1]"/>
- <!-- Multiple empty cells with the same style will be moved to one cell with a 'table:number-columns-repeated' attribute -->
- <xsl:variable name="cell-is-repeatable" select="not($nextCell/*) and not($nextCell/text()) and ((current()/@ss:StyleID = $nextCell/@ss:StyleID) or (not(current()/@ss:StyleID) and not($nextCell/@ss:StyleID))) and not($nextCell/@ss:Index)"/>
- <xsl:choose>
- <xsl:when test="$cell-is-repeatable">
- <xsl:apply-templates select="$nextCell" mode="skip">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-written" select="$col-pos-written + 1"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$nextCell" mode="selected">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-written" select="$col-pos-written + 1"/>
- <xsl:with-param name="col-pos-current" select="$col-pos-written + 1"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="create-table-cell-attributes">
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="col-pos-max"/>
- <xsl:param name="col-pos"/>
- <xsl:param name="row-pos"/>
+ </xsl:template>
- <xsl:choose>
- <xsl:when test="$condition-pos-str">
- <xsl:call-template name="get-condition-dependent-cell-attributes">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="current-pos-str" select="concat('R',$row-pos,'C',$col-pos,',')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@ss:StyleID">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="@ss:StyleID"/>
- </xsl:attribute>
- </xsl:when>
- <!-- inherit style from parent row style-->
- <xsl:when test="../@ss:StyleID">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="../@ss:StyleID"/>
- </xsl:attribute>
- </xsl:when>
- <!-- if no correspondent column style exisit.. -->
- <!-- inherit style from parent table style -->
- <xsl:when test="../../@ss:StyleID">
- <!-- function to give in col-pos and get back column style -->
- <xsl:variable name="relatedColumnStyle">
- <xsl:call-template name="get-related-column-style">
- <!-- the given position of the cell in the table, a column style is searched -->
- <xsl:with-param name="calculatedCellPosition" select="$col-pos" />
- <!-- all columns in XML -->
- <xsl:with-param name="columnXMLNodes" select="../../ss:Column"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$relatedColumnStyle = ''">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="../../@ss:StyleID"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="@ss:MergeAcross or @ss:MergeDown">
- <xsl:choose>
- <xsl:when test="@ss:MergeAcross">
- <xsl:attribute name="table:number-columns-spanned">
- <xsl:value-of select="@ss:MergeAcross + 1"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:number-columns-spanned">1</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@ss:MergeDown">
- <xsl:attribute name="table:number-rows-spanned">
- <xsl:value-of select="@ss:MergeDown+1"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:number-rows-spanned">1</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@ss:Formula">
- <!-- formula translation from Excel to Calc -->
- <xsl:variable name="calc-formula">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$col-pos"/>
- <xsl:with-param name="expression" select="@ss:Formula"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="table:formula">
- <xsl:value-of select="$calc-formula"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="ss:Data">
- <xsl:variable name="data-format">
- <xsl:value-of select="key('Style', @ss:StyleID)/ss:NumberFormat/@ss:Format"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="ss:Data/@ss:Type = 'Number'">
- <xsl:choose>
- <xsl:when test="$data-format = 'Percent' or contains( $data-format, '%')">
- <xsl:attribute name="office:value-type">percentage</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains(key('Style', @ss:StyleID)/ss:NumberFormat/@ss:Format, 'Currency')">
- <xsl:attribute name="office:value-type">currency</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="office:value-type">float</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="office:value">
- <xsl:value-of select="ss:Data"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="ss:Data/@ss:Type = 'DateTime'">
- <xsl:choose>
- <xsl:when test="(contains( $data-format, 'Date') or contains($data-format,'y') or contains($data-format,'g') or contains($data-format,'d') or contains($data-format,'e') or starts-with( substring( ss:Data, 11), 'T00:00:00.000' ) ) and (not (contains( $data-format, 'Time') ) )">
- <xsl:attribute name="office:value-type">date</xsl:attribute>
- <xsl:attribute name="office:date-value">
- <xsl:value-of select="substring-before(ss:Data, 'T')"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="office:value-type">time</xsl:attribute>
- <xsl:attribute name="office:time-value">
- <xsl:value-of select="concat('P',substring(ss:Data, 11, 3), 'H', substring(ss:Data, 15, 2), 'M', substring(ss:Data, 18,2), 'S')"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="ss:Data/@ss:Type = 'Boolean'">
- <xsl:attribute name="office:value-type">boolean</xsl:attribute>
- <xsl:attribute name="office:boolean-value">
- <xsl:choose>
- <xsl:when test="ss:Data = '1'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="ss:Data/@ss:Type = 'String'">
- <xsl:attribute name="office:value-type">string</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template name="get-related-column-style">
- <!-- the given position of the cell in the table, a column style is searched -->
- <xsl:param name="calculatedCellPosition" />
- <!-- the current position of the column as XML node -->
- <xsl:param name="columnXMLPosition" select="1" />
- <!-- all columns in XML -->
- <xsl:param name="columnXMLNodes" />
- <!-- the ending column position of the earlier column style in the table -->
- <xsl:param name="earlierCalculatedColumnEnd" select="0" />
+ <xsl:template name="count-spanned-columns">
+ <xsl:param name="expandedColumnCount" select="0"/>
+ <xsl:param name="columns"/>
+ <xsl:param name="columnsCount" select="count($columns)"/>
+ <xsl:param name="columnIndex" select="1"/>
+ <xsl:choose>
+ <xsl:when test="$columnIndex &lt;= $columnsCount">
+ <xsl:call-template name="count-spanned-columns">
+ <xsl:with-param name="columns" select="$columns"/>
+ <xsl:with-param name="columnsCount" select="$columnsCount"/>
+ <xsl:with-param name="columnIndex" select="$columnIndex + 1"/>
+ <xsl:with-param name="expandedColumnCount" select="$expandedColumnCount + $columns[$columnIndex]/@ss:Span"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$expandedColumnCount"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="ss:Worksheet">
+ <xsl:element name="table:table">
+ <xsl:attribute name="table:name">
+ <xsl:value-of select="@ss:Name"/>
+ </xsl:attribute>
+ <!-- other attributes aren't suitable to apply yet -->
+ <xsl:if test="ss:Table">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat( 'ta', count(preceding-sibling::ss:Worksheet)+1)"/>
+ </xsl:attribute>
+ <xsl:if test="@ss:Protected = '1'">
+ <xsl:attribute name="table:protected">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="descendant::ss:NamedRange[@ss:Name = 'Print_Area' and contains( @ss:RefersTo, '!R')]">
+ <xsl:variable name="referto">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="descendant::ss:NamedRange/@ss:RefersTo"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="table:print-ranges">
+ <xsl:value-of select="translate( $referto, '=', '$')"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="table-pos">
+ <xsl:value-of select="count(../preceding-sibling::ss:Worksheet)+1"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="ss:Table/@ss:ExpandedColumnCount">
+ <xsl:choose>
+ <xsl:when test="not(ss:Table/ss:Column)">
+ <!-- no columns exist -->
+ <xsl:call-template name="create-columns-without-input">
+ <xsl:with-param name="table-pos" select="$table-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="create-columns">
+ <xsl:with-param name="columnCount" select="ss:Table/@ss:ExpandedColumnCount"/>
+ <xsl:with-param name="currentColumnNode" select="ss:Table/ss:Column[1]"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="ss:Table/ss:Column/@ss:Span">
+ <!-- No absolute column number (ss:ExpandedColumnCount) is add the nodes and spanned columns -->
+ <xsl:variable name="spannedColumns">
+ <xsl:call-template name="count-spanned-columns">
+ <xsl:with-param name="columns" select="ss:Table/ss:Column[@ss:Span]"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="create-columns">
+ <xsl:with-param name="columnCount" select="count(ss:Table/ss:Column) + number($spannedColumns)"/>
+ <xsl:with-param name="currentColumnNode" select="ss:Table/ss:Column[1]"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- No absolute column number (ss:ExpandedColumnCount) is add the nodes -->
+ <xsl:call-template name="create-columns">
+ <xsl:with-param name="columnCount" select="count(ss:Table/ss:Column)"/>
+ <xsl:with-param name="currentColumnNode" select="ss:Table/ss:Column[1]"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- generates the string of row\column position if ConditionalFormatting exists -->
+ <xsl:variable name="condition-pos-str1">
+ <xsl:if test="./x:ConditionalFormatting">
+ <xsl:call-template name="condition-row-column-string">
+ <xsl:with-param name="last" select="''"/>
+ <xsl:with-param name="total" select="count(./x:ConditionalFormatting)"/>
+ <xsl:with-param name="index" select="1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="condition-pos-str2">
+ <xsl:if test="./x:DataValidation">
+ <xsl:call-template name="validation-row-column-string">
+ <xsl:with-param name="last" select="''"/>
+ <xsl:with-param name="total" select="count(./x:DataValidation)"/>
+ <xsl:with-param name="index" select="1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="condition-pos-str" select="concat($condition-pos-str1, $condition-pos-str2)"/>
+ <xsl:choose>
+ <xsl:when test="./ss:Table/ss:Row">
+ <xsl:variable name="worksheetNo" select="count(preceding-sibling::ss:Worksheet)+1"/>
+ <xsl:variable name="rowNodeCount" select="count(ss:Table/ss:Row)"/>
+ <xsl:variable name="expandedRowCount">
+ <xsl:call-template name="get-expanded-row-count"/>
+ </xsl:variable>
+ <xsl:variable name="expandedColumnCount">
+ <xsl:call-template name="get-expanded-column-count"/>
+ </xsl:variable>
+ <xsl:for-each select="ss:Table/ss:Row">
+ <xsl:apply-templates select="." mode="create-rows">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ <xsl:with-param name="rowNodeCount" select="$rowNodeCount"/>
+ <xsl:with-param name="rowNodeIndex" select="position()"/>
+ <xsl:with-param name="expandedRowCount" select="$expandedRowCount"/>
+ <xsl:with-param name="expandedRowCountIndex" select="1"/>
+ <xsl:with-param name="expandedColumnCount" select="$expandedColumnCount"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="./x:PageBreaks/x:RowBreaks">
+ <xsl:for-each select="./x:PageBreaks/x:RowBreaks/x:RowBreak">
+ <xsl:variable name="number-repeated">
+ <xsl:choose>
+ <xsl:when test="position() = 1">
+ <xsl:value-of select="./x:Row"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select=". - preceding::x:RowBreak[position()=count(.)]/x:Row - 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$number-repeated &gt; 0">
+ <xsl:element name="table:table-row">
+ <xsl:if test="@ss:Hidden = '1'">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('ro',$table-pos)"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:number-rows-repeated">
+ <xsl:value-of select="$number-repeated"/>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="ss:Table/@ss:ExpandedColumnCount">
+ <table:table-cell table:number-columns-repeated="{ss:Table/@ss:ExpandedColumnCount}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- OASIS XML row can not be empty -->
+ <table:table-cell table:number-columns-repeated="256"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="table:table-row">
+ <xsl:if test="@ss:Hidden = '1'">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('rob',$table-pos)"/>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="ss:Table/@ss:ExpandedColumnCount">
+ <table:table-cell table:number-columns-repeated="{ss:Table/@ss:ExpandedColumnCount}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- OASIS XML row can not be empty -->
+ <table:table-cell table:number-columns-repeated="256"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- in case no table row exists (empty spreadsheet) -->
+ <xsl:element name="table:table-row">
+ <xsl:choose>
+ <xsl:when test="ss:Table/@ss:StyleID">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="ss:Table/@ss:StyleID"/>
+ </xsl:attribute>
+ <xsl:element name="table:table-cell">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="ss:Table/@ss:StyleID"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('ro',$table-pos)"/>
+ </xsl:attribute>
+ <xsl:element name="table:table-cell"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="./x:ConditionalFormatting">
+ <xsl:variable name="condition-row-max">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="div-value" select="'R'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="condition-col-max">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="div-value" select="'C'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="break-row-max">
+ <xsl:call-template name="break-row-beyond-max">
+ <xsl:with-param name="pos" select="1"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="count-value" select="count(./x:PageBreaks/x:RowBreaks/x:RowBreak)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="end-value">
+ <xsl:choose>
+ <xsl:when test="$condition-row-max &lt; $break-row-max">
+ <xsl:value-of select="$break-row-max"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$condition-row-max"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="get-row-beyond-last">
+ <xsl:with-param name="index-value" select="1"/>
+ <xsl:with-param name="worksheetNo" select="count(preceding-sibling::ss:Worksheet)+1"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="end-pos" select="$end-value"/>
+ <xsl:with-param name="total-col" select="$condition-col-max"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!-- if exists attribute of StyleID in tag of ss:Table but no Row/Column -->
+ <xsl:if test="./ss:Table/@ss:StyleID">
+ <table:table-row table:style-name="{concat('ro',$table-pos)}" table:number-rows-repeated="65564">
+ <table:table-cell table:number-columns-repeated="256"/>
+ </table:table-row>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <!-- Note: Need to be refactored -->
+ <xsl:template name="create-columns-without-input">
+ <xsl:param name="table-pos"/>
+ <xsl:choose>
+ <xsl:when test="./x:PageBreaks/x:ColBreaks">
+ <xsl:for-each select="./x:PageBreaks/x:ColBreaks/x:ColBreak">
+ <xsl:variable name="number-repeated">
+ <xsl:choose>
+ <xsl:when test="position() = 1">
+ <xsl:value-of select="./x:Column"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select=". - preceding::x:ColBreak[position()=count(.)]/x:Column - 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$number-repeated &gt; 0">
+ <xsl:element name="table:table-column">
+ <xsl:if test="ancestor::ss:Worksheet/ss:Table/@ss:StyleID">
+ <xsl:attribute name="table:default-cell-style-name">
+ <xsl:value-of select="ancestor::ss:Worksheet/ss:Table/@ss:StyleID"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@ss:Hidden = '1'">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('co',$table-pos)"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="$number-repeated"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="table:table-column">
+ <!-- column style be made out beforehead -->
+ <xsl:if test="ancestor::ss:Worksheet/ss:Table/@ss:StyleID">
+ <xsl:attribute name="table:default-cell-style-name">
+ <xsl:value-of select="ancestor::ss:Worksheet/ss:Table/@ss:StyleID"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@ss:Hidden = '1'">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('cob',$table-pos)"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="table:table-column">
+ <xsl:choose>
+ <xsl:when test="ss:Table/@ss:StyleID">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="ss:Table/@ss:StyleID"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name">
+ <xsl:text>co1</xsl:text>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="ss:Table/@ss:ExpandedColumnCount and ss:Table/@ss:ExpandedColumnCount > 0">
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="ss:Table/@ss:ExpandedColumnCount"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:default-cell-style-name">
+ <xsl:text>Default</xsl:text>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--
+ Example:
+ <ss:Table>
+ <ss:Column ss:Index="4" ss:Width="500" ss:Span="3" />
+ <ss:Column ss:Width="200" />
+ </ss:Table>
- <!-- the current column as XML node -->
- <xsl:variable name="columnXMLNode" select="$columnXMLNodes[1]" />
- <xsl:if test="$columnXMLNodes and count($columnXMLNodes) > 0">
- <!-- the starting column position of the style in the table -->
- <xsl:variable name="calculatedColumnStart">
- <!-- if ss:Index exists, this is the start of the column -->
- <xsl:choose>
- <xsl:when test="$columnXMLNode/@ss:Index">
- <xsl:value-of select="$columnXMLNode/@ss:Index" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$earlierCalculatedColumnEnd + 1" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- the ending column position of the style in the table -->
- <xsl:variable name="calculatedColumnEnd">
- <xsl:choose>
- <xsl:when test="$columnXMLNode/@ss:Span">
- <xsl:value-of select="$calculatedColumnStart + $columnXMLNode/@ss:Span" />
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$calculatedColumnStart" />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$calculatedColumnStart &gt;= $calculatedCellPosition and $calculatedCellPosition &lt;= $calculatedColumnEnd">
- <xsl:value-of select="$columnXMLNode/@ss:StyleID"/>
- </xsl:when>
- <xsl:when test="$calculatedColumnEnd &lt;= $calculatedCellPosition">
- <xsl:call-template name="get-related-column-style">
- <!-- the given position of the cell in the table, a column style is searched -->
- <xsl:with-param name="calculatedCellPosition" select="$calculatedCellPosition" />
- <!-- all columns in XML -->
- <xsl:with-param name="columnXMLNodes" select="$columnXMLNodes[position() != 1]"/>
- <!-- the ending column position of the style in the table -->
- <xsl:with-param name="earlierCalculatedColumnEnd" select="$calculatedColumnEnd" />
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
+ Prior column (ss:Index - 1) is written
+ The given fourth cell (ss:Index="4") is handled as repeated three times (ss:Span="3").
+ The eight column got a width of "200"
- <xsl:template name="create-table-cell-content">
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="col-pos-max"/>
- <xsl:param name="col-pos"/>
- <xsl:param name="row-pos"/>
- <xsl:apply-templates select="ss:Comment" mode="body"/>
- <xsl:if test="ss:Data">
- <text:p>
- <xsl:call-template name="create-data-content">
- <xsl:with-param name="style-id" select="@ss:StyleID"/>
- </xsl:call-template>
- </text:p>
- </xsl:if>
- </xsl:template>
- <xsl:template name="create-data-content">
- <xsl:param name="style-id" select="@ss:StyleID"/>
- <xsl:choose>
- <xsl:when test="ss:Data//text()[string-length(.) != 0] and ss:Data[count(*)>0]">
- <xsl:for-each select="ss:Data//text()[string-length(.) != 0]">
- <xsl:sort select="position( )" order="ascending" data-type="number"/>
- <text:span text:style-name="{concat($style-id, 'T', count(preceding::ss:Data[child::html:*]), '_', position())}">
- <xsl:value-of select="."/>
- </text:span>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="contains(key('Style', $style-id)/ss:Font/@ss:VerticalAlign, 'script')">
- <text:span text:style-name="{concat($style-id, 'T0')}">
- <xsl:choose>
- <xsl:when test="@ss:HRef">
- <text:a xlink:href="{@ss:HRef}">
- <xsl:value-of select="ss:Data"/>
- </text:a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="ss:Data"/>
- </xsl:otherwise>
- </xsl:choose>
- </text:span>
- </xsl:when>
- <xsl:when test="@ss:HRef">
- <text:a xlink:href="{@ss:HRef}">
- <xsl:value-of select="ss:Data"/>
- </text:a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="ss:Data"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-condition-dependent-cell-attributes">
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="current-pos-str"/>
- <xsl:variable name="temp-str">
- <xsl:call-template name="condition-str">
- <xsl:with-param name="param-str" select="substring-before($condition-pos-str,$current-pos-str)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="base-style-name">
- <xsl:choose>
- <xsl:when test="@ss:StyleID">
- <xsl:value-of select="@ss:StyleID"/>
- </xsl:when>
- <xsl:when test="../@ss:StyleID">
- <xsl:value-of select="../@ss:StyleID"/>
- </xsl:when>
- <xsl:when test="../../@ss:StyleID">
- <xsl:value-of select="../../@ss:StyleID"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="style-name">
- <xsl:choose>
- <xsl:when test="contains($condition-pos-str, $current-pos-str) and starts-with($temp-str, 'c')">
- <xsl:choose>
- <xsl:when test="string-length($base-style-name) &gt; 0"><xsl:value-of select="concat($base-style-name, '-ce', substring-after($temp-str, 'c'))"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="concat('Default-ce', substring-after($temp-str, 'c'))"/></xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$base-style-name"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="starts-with($style-name, 'val')">
- <xsl:attribute name="table:content-validation-name">
- <xsl:value-of select="$style-name"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="not($style-name = '')">
- <xsl:attribute name="table:style-name">
- <xsl:value-of select="$style-name"/>
- </xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <!-- maybe multi functions occur at same time in the same Cell, such as ConditionalFormatting and DataValidation -->
- <xsl:if test="contains($condition-pos-str, $current-pos-str)">
- <xsl:choose>
- <xsl:when test="starts-with($temp-str, 'v')">
- <xsl:attribute name="table:content-validation-name">
- <xsl:value-of select="concat('val', substring-after($temp-str, 'v'))"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="after-str" select="substring-after($condition-pos-str, $current-pos-str)"/>
- <xsl:if test="contains( $after-str, $current-pos-str)">
- <xsl:variable name="temp-str-2">
- <xsl:call-template name="condition-str">
- <xsl:with-param name="param-str" select="substring-before( $after-str,$current-pos-str)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="starts-with( $temp-str-2, 'v')">
- <xsl:attribute name="table:content-validation-name">
- <xsl:value-of select="concat('val', substring-after($temp-str-2, 'v'))"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template name="validation-row-column-string">
- <!-- returns a string with structer,including row\column position by extraction from x:DataValidation -->
- <xsl:param name="last"/>
- <xsl:param name="total"/>
- <xsl:param name="index"/>
- <xsl:variable name="table-pos" select="count(preceding-sibling::ss:Worksheet)+1"/>
- <xsl:variable name="current">
- <xsl:call-template name="parse-range">
- <xsl:with-param name="range-value" select="./x:DataValidation[position() = $index]/x:Range"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="current-value" select="concat('(v',$index,':', $current,');')"/>
- <xsl:if test="$index &lt; $total">
- <xsl:call-template name="validation-row-column-string">
- <xsl:with-param name="last" select="concat($last, $current-value)"/>
- <xsl:with-param name="total" select="$total"/>
- <xsl:with-param name="index" select="$index + 1"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$index = $total">
- <xsl:value-of select="concat($last, $current-value)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="condition-row-column-string">
- <!-- returns a string with structer,including row\column position by extraction from x:ConditionalFormatting -->
- <xsl:param name="last"/>
- <xsl:param name="total"/>
- <xsl:param name="index"/>
- <xsl:variable name="table-pos" select="count(preceding-sibling::ss:Worksheet)+1"/>
- <xsl:variable name="current">
- <xsl:call-template name="parse-range">
- <xsl:with-param name="range-value" select="./x:ConditionalFormatting[position() = $index]/x:Range"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="current-value" select="concat('(c',$table-pos,'-',$index,':', $current,');')"/>
- <xsl:if test="$index &lt; $total">
- <xsl:call-template name="condition-row-column-string">
- <xsl:with-param name="last" select="concat($last, $current-value)"/>
- <xsl:with-param name="total" select="$total"/>
- <xsl:with-param name="index" select="$index + 1"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$index = $total">
- <xsl:value-of select="concat($last, $current-value)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="parse-range">
- <!-- returns a string,input param:the value of x:Range -->
- <xsl:param name="range-value"/>
- <xsl:param name="last"/>
- <xsl:variable name="first-pit">
- <xsl:choose>
- <xsl:when test="contains($range-value,',')">
- <xsl:value-of select="substring-before($range-value,',')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$range-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="current">
- <xsl:choose>
- <xsl:when test="contains($first-pit,':')">
- <xsl:variable name="R-start" select="substring-before(substring-after($first-pit,'R'),'C')"/>
- <xsl:variable name="C-start" select="substring-before(substring-after($first-pit,'C'),':')"/>
- <xsl:variable name="second-pit" select="substring-after($first-pit,':')"/>
- <xsl:variable name="R-end" select="substring-before(substring-after($second-pit,'R'),'C')"/>
- <xsl:variable name="C-end" select="substring-after($second-pit,'C')"/>
- <xsl:variable name="the-str">
- <xsl:call-template name="condition-rc-str">
- <xsl:with-param name="r-start" select="$R-start"/>
- <xsl:with-param name="r-end" select="$R-end"/>
- <xsl:with-param name="c-start" select="$C-start"/>
- <xsl:with-param name="c-end" select="$C-end"/>
- <xsl:with-param name="last" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$the-str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($first-pit,',')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($range-value,',')">
- <xsl:call-template name="parse-range">
- <xsl:with-param name="range-value" select="substring-after($range-value,',')"/>
- <xsl:with-param name="last" select="concat($last,$current)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($last,$current)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="condition-rc-str">
- <!-- dealing the range of row\column -->
- <xsl:param name="r-start"/>
- <xsl:param name="r-end"/>
- <xsl:param name="c-start"/>
- <xsl:param name="c-end"/>
- <xsl:param name="last"/>
- <xsl:variable name="current">
- <xsl:call-template name="condition-c-str">
- <xsl:with-param name="rc-str" select="concat('R',$r-start)"/>
- <xsl:with-param name="start" select="$c-start"/>
- <xsl:with-param name="end" select="$c-end"/>
- <xsl:with-param name="last" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$r-start &lt; $r-end">
- <xsl:call-template name="condition-rc-str">
- <xsl:with-param name="r-start" select="$r-start + 1"/>
- <xsl:with-param name="r-end" select="$r-end"/>
- <xsl:with-param name="c-start" select="$c-start"/>
- <xsl:with-param name="c-end" select="$c-end"/>
- <xsl:with-param name="last" select="concat($last,$current)"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$r-start = $r-end">
- <xsl:value-of select="concat($last,$current)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="condition-c-str">
- <!-- return value for the template condition-rc-str -->
- <xsl:param name="rc-str"/>
- <xsl:param name="start"/>
- <xsl:param name="end"/>
- <xsl:param name="last"/>
- <xsl:variable name="current" select="concat($rc-str,'C',$start,',')"/>
- <xsl:if test="$start &lt; $end">
- <xsl:call-template name="condition-c-str">
- <xsl:with-param name="rc-str" select="$rc-str"/>
- <xsl:with-param name="start" select="$start + 1"/>
- <xsl:with-param name="end" select="$end"/>
- <xsl:with-param name="last" select="concat($last,$current)"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$start = $end">
- <xsl:value-of select="concat($last,$current)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template match="ss:Data[count(*)>0]">
- <xsl:for-each select=".//text()[string-length(.) != 0]">
- <style:style style:name="{concat(ancestor::ss:Cell/@ss:StyleID,'T',count(preceding::ss:Data[child::html:*]), '_', position())}" style:family="text">
- <xsl:element name="style:text-properties">
- <xsl:if test="ancestor-or-self::html:Font/@html:Face">
- <xsl:attribute name="style:font-name">
- <xsl:value-of select="ancestor-or-self::html:Font/@html:Face"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::html:Font/@html:Size">
- <xsl:attribute name="fo:font-size">
- <xsl:value-of select="concat(ancestor-or-self::html:Font/@html:Size,'pt')"/>
- </xsl:attribute>
- <xsl:attribute name="style:font-size-asian">
- <xsl:value-of select="concat(ancestor-or-self::html:Font/@html:Size,'pt')"/>
- </xsl:attribute>
- <xsl:attribute name="style:font-size-complex">
- <xsl:value-of select="concat(ancestor-or-self::html:Font/@html:Size,'pt')"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::html:Font/@html:Color">
- <xsl:attribute name="fo:color">
- <xsl:value-of select="ancestor-or-self::html:Font/@html:Color"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::html:B">
- <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::html:I">
- <xsl:attribute name="fo:font-style">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::html:U">
- <xsl:attribute name="style:text-underline-type">single</xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::html:S">
- <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::html:Sup">
- <xsl:attribute name="style:text-position">33% 58%</xsl:attribute>
- </xsl:if>
- <xsl:if test="ancestor-or-self::html:Sub">
- <xsl:attribute name="style:text-position">-33% 58%</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </style:style>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="get-pos-content">
- <xsl:param name="content"/>
- <xsl:param name="pos"/>
- <xsl:choose>
- <xsl:when test="$pos = 'left'">
- <xsl:choose>
- <xsl:when test="contains($content,'&amp;C')">
- <xsl:value-of select="substring-before( substring-after( $content, '&amp;L'), '&amp;C')"/>
- </xsl:when>
- <xsl:when test="contains($content,'&amp;R')">
- <xsl:value-of select="substring-before( substring-after( $content, '&amp;L'), '&amp;R')"/>
- </xsl:when>
- <xsl:when test="contains($content,'&amp;L')">
- <xsl:value-of select="substring-after( $content, '&amp;L')"/>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$pos = 'center'">
- <xsl:choose>
- <xsl:when test="contains($content,'&amp;R')">
- <xsl:value-of select="substring-before( substring-after( $content, '&amp;C'), '&amp;R')"/>
- </xsl:when>
- <xsl:when test="contains($content,'&amp;C')">
- <xsl:value-of select="substring-after( $content, '&amp;C')"/>
- </xsl:when>
- <xsl:when test="contains($content,'&amp;L')"/>
- <xsl:otherwise>
- <xsl:value-of select="$content"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$pos = 'right'">
- <xsl:value-of select="substring-after( $content, '&amp;R')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="@x:Data">
- <xsl:variable name="style-name-header">
- <xsl:value-of select="concat(ancestor::ss:Worksheet/@ss:Name, substring(name(..),1,1))"/>
- </xsl:variable>
- <xsl:variable name="left-style-data">
- <xsl:call-template name="get-pos-content">
- <xsl:with-param name="content" select="."/>
- <xsl:with-param name="pos" select="'left'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="string-length($left-style-data)&gt;0 and contains($left-style-data,'&amp;')">
- <xsl:call-template name="create-header-footer-style">
- <xsl:with-param name="style-name-header" select="concat($style-name-header,'L')"/>
- <xsl:with-param name="style-data" select="$left-style-data"/>
- <xsl:with-param name="index" select="0"/>
- <xsl:with-param name="current-pos" select="1"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:variable name="center-style-data">
- <xsl:call-template name="get-pos-content">
- <xsl:with-param name="content" select="."/>
- <xsl:with-param name="pos" select="'center'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="string-length($center-style-data)&gt;0 and contains($center-style-data,'&amp;')">
- <xsl:call-template name="create-header-footer-style">
- <xsl:with-param name="style-name-header" select="concat($style-name-header,'C')"/>
- <xsl:with-param name="style-data" select="$center-style-data"/>
- <xsl:with-param name="index" select="0"/>
- <xsl:with-param name="current-pos" select="1"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:variable name="right-style-data">
- <xsl:call-template name="get-pos-content">
- <xsl:with-param name="content" select="."/>
- <xsl:with-param name="pos" select="'right'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="string-length($right-style-data)&gt;0 and contains($right-style-data,'&amp;')">
- <xsl:call-template name="create-header-footer-style">
- <xsl:with-param name="style-name-header" select="concat($style-name-header,'R')"/>
- <xsl:with-param name="style-data" select="$right-style-data"/>
- <xsl:with-param name="index" select="0"/>
- <xsl:with-param name="current-pos" select="1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="create-header-footer-style">
- <xsl:param name="style-name-header"/>
- <xsl:param name="style-data"/>
- <xsl:param name="index"/>
- <xsl:param name="current-pos"/>
- <xsl:variable name="current-style-data">
- <xsl:value-of select="substring($style-data,$current-pos)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="starts-with($current-style-data,'&amp;D') or starts-with($current-style-data,'&amp;T') or starts-with($current-style-data,'&amp;P') or starts-with($current-style-data,'&amp;N') or starts-with($current-style-data,'&amp;A') or starts-with($current-style-data,'&amp;F') or starts-with($current-style-data,'&amp;Z')">
- <xsl:call-template name="create-header-footer-style">
- <xsl:with-param name="style-name-header" select="$style-name-header"/>
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="index" select="$index"/>
- <xsl:with-param name="current-pos" select="$current-pos +2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;')">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">
- <xsl:value-of select="concat($style-name-header,$index)"/>
- </xsl:attribute>
- <xsl:attribute name="style:family">text</xsl:attribute>
- <xsl:element name="style:text-properties">
- <xsl:call-template name="process-header-footer-style-properties">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- <xsl:variable name="next-style-header-pos">
- <xsl:call-template name="get-current-content-pos">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="create-header-footer-style">
- <xsl:with-param name="style-name-header" select="$style-name-header"/>
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="index" select="$index+1"/>
- <xsl:with-param name="current-pos" select="$next-style-header-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains($current-style-data,'&amp;')">
- <xsl:variable name="temp" select="substring-before($current-style-data,'&amp;')"/>
- <xsl:call-template name="create-header-footer-style">
- <xsl:with-param name="style-name-header" select="$style-name-header"/>
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="index" select="$index"/>
- <xsl:with-param name="current-pos" select="string-length($temp)+$current-pos"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="process-header-footer-style-properties">
- <xsl:param name="style-data"/>
- <xsl:param name="current-pos"/>
- <xsl:variable name="current-style-data">
- <xsl:value-of select="substring($style-data,$current-pos)"/>
- </xsl:variable>
- <xsl:choose>
- <!-- stack operations necessary -->
- <xsl:when test="starts-with($current-style-data,'&amp;&quot;')">
- <xsl:attribute name="style:font-name">
- <xsl:value-of select="substring-before(substring-after($current-style-data,'&amp;&quot;'),',')"/>
- </xsl:attribute>
- <xsl:if test="contains(substring-before(substring-after($current-style-data,','),'&quot;'),'Bold')">
- <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
- </xsl:if>
- <xsl:if test="contains(substring-before(substring-after($current-style-data,','),'&quot;'),'Italic')">
- <xsl:attribute name="fo:font-style">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
- </xsl:if>
- <xsl:variable name="temp" select="substring-before(substring($style-data,$current-pos+2),'&quot;')"/>
- <xsl:call-template name="process-header-footer-style-properties">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="string-length($temp)+$current-pos+3"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;0') or starts-with($current-style-data,'&amp;1') or starts-with($current-style-data,'&amp;2') or starts-with($current-style-data,'&amp;3') or starts-with($current-style-data,'&amp;4') or starts-with($current-style-data,'&amp;5') or starts-with($current-style-data,'&amp;6') or starts-with($current-style-data,'&amp;7') or starts-with($current-style-data,'&amp;8') or starts-with($current-style-data,'&amp;9')">
- <xsl:variable name="font-size-length">
- <xsl:call-template name="get-digit-length">
- <xsl:with-param name="complexive-string" select="substring-after($current-style-data,'&amp;')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="fo:font-size">
- <xsl:value-of select="concat(substring($current-style-data,2,$font-size-length),'pt')"/>
- </xsl:attribute>
- <xsl:call-template name="process-header-footer-style-properties">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos + 1 + $font-size-length"/>
- </xsl:call-template>
- </xsl:when>
- <!-- don't consider tangled or adjoined '&X' and '&Y', '&U' & '&E', processing-check is necessary, too complex. :( -->
- <xsl:when test="starts-with($current-style-data,'&amp;X')">
- <xsl:variable name="superscript-count-before">
- <xsl:call-template name="get-substyle-count-in-data">
- <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
- <xsl:with-param name="substyle" select="'&amp;X'"/>
- <xsl:with-param name="count" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$superscript-count-before mod 2 = 0">
- <xsl:attribute name="style:text-position">33% 58%</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="process-header-footer-style-properties">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos + 2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;B')">
- <xsl:variable name="subscript-count-before">
- <xsl:call-template name="get-substyle-count-in-data">
- <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
- <xsl:with-param name="substyle" select="'&amp;B'"/>
- <xsl:with-param name="count" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$subscript-count-before mod 2 = 0">
- <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="process-header-footer-style-properties">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos + 2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;Y')">
- <xsl:variable name="subscript-count-before">
- <xsl:call-template name="get-substyle-count-in-data">
- <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
- <xsl:with-param name="substyle" select="'&amp;Y'"/>
- <xsl:with-param name="count" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$subscript-count-before mod 2 = 0">
- <xsl:attribute name="style:text-position">-33% 58%</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="process-header-footer-style-properties">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos + 2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;S')">
- <xsl:variable name="strikethrough-count-before">
- <xsl:call-template name="get-substyle-count-in-data">
- <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
- <xsl:with-param name="substyle" select="'&amp;S'"/>
- <xsl:with-param name="count" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$strikethrough-count-before mod 2 = 0">
- <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="process-header-footer-style-properties">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos + 2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;U')">
- <xsl:variable name="single-underline-count-before">
- <xsl:call-template name="get-substyle-count-in-data">
- <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
- <xsl:with-param name="substyle" select="'&amp;U'"/>
- <xsl:with-param name="count" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$single-underline-count-before mod 2 = 0">
- <xsl:attribute name="style:text-underline-type">single</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="process-header-footer-style-properties">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos + 2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;E')">
- <xsl:variable name="double-underline-count-before">
- <xsl:call-template name="get-substyle-count-in-data">
- <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
- <xsl:with-param name="substyle" select="'&amp;E'"/>
- <xsl:with-param name="count" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$double-underline-count-before mod 2 = 0">
- <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="process-header-footer-style-properties">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos + 2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-substyle-count-in-data">
- <xsl:param name="style-data"/>
- <xsl:param name="substyle"/>
- <xsl:param name="count"/>
- <xsl:choose>
- <xsl:when test="contains($style-data,$substyle)">
- <xsl:call-template name="get-substyle-count-in-data">
- <xsl:with-param name="style-data" select="substring-after($style-data,$substyle)"/>
- <xsl:with-param name="substyle" select="$substyle"/>
- <xsl:with-param name="count" select="$count+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$count"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-current-content-pos">
- <xsl:param name="style-data"/>
- <xsl:param name="current-pos"/>
- <xsl:variable name="current-style-data">
- <xsl:value-of select="substring($style-data,$current-pos)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="starts-with($current-style-data,'&amp;X') or starts-with($current-style-data,'&amp;Y') or starts-with($current-style-data,'&amp;S') or starts-with($current-style-data,'&amp;U') or starts-with($current-style-data,'&amp;E') or starts-with($current-style-data,'&amp;B')">
- <xsl:call-template name="get-current-content-pos">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos+2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;0') or starts-with($current-style-data,'&amp;1') or starts-with($current-style-data,'&amp;2') or starts-with($current-style-data,'&amp;3') or starts-with($current-style-data,'&amp;4') or starts-with($current-style-data,'&amp;5') or starts-with($current-style-data,'&amp;6') or starts-with($current-style-data,'&amp;7') or starts-with($current-style-data,'&amp;8') or starts-with($current-style-data,'&amp;9')">
- <xsl:variable name="font-size-length">
- <xsl:call-template name="get-digit-length">
- <xsl:with-param name="complexive-string" select="substring-after($current-style-data,'&amp;')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="get-current-content-pos">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="$current-pos+1+$font-size-length"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data,'&amp;&quot;')">
- <xsl:variable name="temp" select="substring-before(substring($style-data,$current-pos+2),'&quot;')"/>
- <xsl:call-template name="get-current-content-pos">
- <xsl:with-param name="style-data" select="$style-data"/>
- <xsl:with-param name="current-pos" select="string-length($temp)+$current-pos+3"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="starts-with($current-style-data, '&amp;')">
- <xsl:value-of select="$current-pos + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$current-pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- OASIS OpenDocument Format change:
- Excel "=RC4*6"
- OOoXML "=$D22*6"
- OASIS XML "oooc:=[.$D22]*6" -->
- <xsl:template name="translate-expression">
- <!-- return position or range for formula or other -->
- <xsl:param name="cell-row-pos"/>
- <!-- the position in row (vertical) of cell -->
- <xsl:param name="cell-column-pos"/>
- <!-- the position in column (horizontal of cell -->
- <xsl:param name="expression"/>
- <!-- recomposed expression containing cell positions after every conversion -->
- <xsl:param name="is-range-mode" select="false()"/>
- <!-- as mode changes a '[.' resp. ']' is written out -->
- <xsl:param name="return-value"/>
- <!-- expression of table:cell-range-address is different than formula (e.g. no prefix) -->
- <xsl:param name="isRangeAddress"/>
- <!-- determines if the currently processed expression is relative -->
- <xsl:param name="isRelative" select="false()" />
+ ContextNode: ss:Worksheet
+ -->
+ <xsl:key match="/ss:Workbook/ss:Worksheet/x:PageBreaks/x:ColBreaks/x:ColBreak" name="ColBreak" use="Column"/>
+ <xsl:template name="create-columns">
+ <xsl:param name="columnCount"/>
+ <xsl:param name="currentColumn" select="1"/>
+ <xsl:param name="finishedColumns" select="0"/>
+ <xsl:param name="worksheetNo" select="count(preceding-sibling::ss:Worksheet)+1"/>
+ <xsl:param name="currentColumnNode"/>
+ <xsl:choose>
+ <xsl:when test="$finishedColumns &lt; $columnCount">
+ <xsl:choose>
+ <xsl:when test="$currentColumnNode">
+ <xsl:choose>
+ <xsl:when test="$currentColumnNode/@ss:Index - $finishedColumns &gt; 1">
+ <!-- found column with index.
+ filling up table with empty columns until Index is reached -->
+ <xsl:call-template name="create-default-column">
+ <xsl:with-param name="currentColumn" select="$currentColumn"/>
+ <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ <xsl:call-template name="create-columns">
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="currentColumn" select="$currentColumn"/>
+ <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
+ <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="table:table-column">
+ <xsl:if test="$currentColumnNode/@ss:Hidden = '1'">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$currentColumnNode/@ss:Span">
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="$currentColumnNode/@ss:Span + 1"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="key('ColBreak', $currentColumn)">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('cob', $worksheetNo, '-', $currentColumn)"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('co', $worksheetNo, '-', $currentColumn)"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="$currentColumnNode/@ss:StyleID">
+ <xsl:attribute name="table:default-cell-style-name">
+ <xsl:value-of select="$currentColumnNode/@ss:StyleID"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:default-cell-style-name">
+ <xsl:text>Default</xsl:text>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:call-template name="create-columns">
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="currentColumn" select="$currentColumn + 1"/>
+ <xsl:with-param name="finishedColumns">
+ <xsl:choose>
+ <xsl:when test="$currentColumnNode/@ss:Span">
+ <xsl:value-of select="$finishedColumns + $currentColumnNode/@ss:Span + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$finishedColumns + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="currentColumnNode" select="ss:Table/ss:Column[$currentColumn + 1]"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- <xsl:if test="not($finishedColumns + 1 = $columnCount)"> -->
+ <xsl:call-template name="create-default-column">
+ <xsl:with-param name="currentColumn" select="$currentColumn"/>
+ <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ <xsl:call-template name="create-columns">
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="currentColumn" select="$currentColumn"/>
+ <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$currentColumn = $columnCount">
+ <!-- Note: name test document for this case and refactor the template -->
+ <xsl:if test="x:PageBreaks/x:ColBreaks/x:ColBreak/x:Column &gt; $finishedColumns">
+ <xsl:call-template name="get-column-beyond-last">
+ <xsl:with-param name="index-value" select="$finishedColumns"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!--Note: Test Scenario for this case: generates some special tags for whole row style
+ <xsl:if test="(./ss:Table[@ss:StyleID] or ./ss:Table/ss:Row[@ss:StyleID]) and (256 - $finishedColumns &gt; 0)">
+ <xsl:element name="table:table-column">
+ <xsl:attribute name="table:default-cell-style-name"><xsl:choose><xsl:when test="./ss:Table[@ss:StyleID]"><xsl:value-of select="./ss:Table/@ss:StyleID" /></xsl:when><xsl:otherwise><xsl:value-of select="'Default'" /></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="'co1'" /></xsl:attribute>
+ <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="256 - $finishedColumns" /></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ -->
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="create-default-column">
+ <xsl:param name="currentColumn"/>
+ <xsl:param name="currentColumnNode"/>
+ <xsl:param name="worksheetNo"/>
+ <xsl:param name="nextColumnNo"/>
+ <xsl:element name="table:table-column">
+ <xsl:attribute name="table:default-cell-style-name">
+ <xsl:call-template name="get-default-cell-style">
+ <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <!-- <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="$nextColumnNo - $currentColumn"/></xsl:attribute> -->
+ <xsl:choose>
+ <xsl:when test="key('ColBreak', $currentColumn)">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('cob',$worksheetNo)"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('co',$worksheetNo)"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="create-rows">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:apply-templates select="ss:Table/ss:Row[1]" mode="create-rows">
+ <xsl:with-param name="worksheetNo" select="count(preceding-sibling::ss:Worksheet)+1"/>
+ <xsl:with-param name="rowNodeCount" select="count(ss:Table/ss:Row)"/>
+ <xsl:with-param name="rowNodeIndex" select="1"/>
+ <xsl:with-param name="expandedRowCount">
+ <xsl:call-template name="get-expanded-row-count"/>
+ </xsl:with-param>
+ <xsl:with-param name="expandedRowCountIndex" select="1"/>
+ <xsl:with-param name="expandedColumnCount">
+ <xsl:call-template name="get-expanded-column-count"/>
+ </xsl:with-param>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:apply-templates>
+ </xsl:template>
+ <xsl:template match="ss:Row" mode="create-rows">
+ <xsl:param name="worksheetNo"/>
+ <xsl:param name="rowNodeCount"/>
+ <xsl:param name="rowNodeIndex"/>
+ <xsl:param name="expandedRowCount"/>
+ <xsl:param name="expandedColumnCount"/>
+ <xsl:param name="condition-pos-str"/>
+ <xsl:variable name="simple-span-value" select="@ss:Span + count(@ss:Span)"/>
+ <xsl:variable name="expandedRowCountIndex">
+ <xsl:choose>
+ <xsl:when test="@ss:Index"><xsl:value-of select="@ss:Index -1 + $simple-span-value"/></xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="recent-index" select="preceding-sibling::ss:Row[@ss:Index][last()]"></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$recent-index">
+ <xsl:variable name="nodes-up-to-current" select="set:intersection(preceding-sibling::ss:Row, $recent-index/following-sibling::ss:Row)"></xsl:variable>
+ <xsl:variable name="allSpans" select="$nodes-up-to-current/@ss:Span"/>
+ <xsl:value-of select="$recent-index/@ss:Index + count($nodes-up-to-current) + sum($allSpans) + count($allSpans)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="allSpans" select="preceding-sibling::ss:Row/@ss:Span"/>
+ <xsl:value-of select="$rowNodeIndex + sum($allSpans) + count($allSpans)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="currentRowNo">
+ <xsl:choose>
+ <xsl:when test="@ss:Index">
+ <xsl:value-of select="@ss:Index"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$expandedRowCountIndex"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="@ss:Index - $expandedRowCountIndex &gt; 0">
+ <!-- create the precding missing rows -->
+ <xsl:element name="table:table-row">
+ <!-- fill the preceding gap with rows without a cell -->
+ <xsl:attribute name="table:number-rows-repeated">
+ <xsl:value-of select="@ss:Index - $expandedRowCountIndex"/>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$expandedColumnCount != 0">
+ <table:table-cell table:number-columns-repeated="{$expandedColumnCount}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- OASIS XML row can not be empty -->
+ <table:table-cell table:number-columns-repeated="256"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="table:table-row">
+ <xsl:attribute name="table:style-name">
+ <xsl:choose>
+ <xsl:when test="@ss:StyleID">
+ <xsl:value-of select="concat('ro',$worksheetNo, '-',$rowNodeIndex,'-', @ss:StyleID)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('ro',$worksheetNo,'-',$rowNodeIndex)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:if test="@ss:Hidden = '1'">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@ss:Span">
+ <xsl:attribute name="table:number-rows-repeated">
+ <xsl:value-of select="@ss:Span + 1"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <!-- Excel row without content -->
+ <xsl:when test="not(*)">
+ <!-- OASIS OpenDocument Format does not allow rows without a cell -->
+ <xsl:choose>
+ <xsl:when test="$expandedColumnCount != 0">
+ <table:table-cell table:number-columns-repeated="{$expandedColumnCount}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- OASIS XML row can not be empty -->
+ <table:table-cell table:number-columns-repeated="256"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="create-cells">
+ <xsl:with-param name="row-pos" select="$currentRowNo"/>
+ <xsl:with-param name="expandedColumnCount" select="$expandedColumnCount"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+
+ </xsl:template>
+
+ <xsl:template name="get-expanded-column-count">
+ <xsl:choose>
+ <xsl:when test="ss:Table/@ss:ExpandedColumnCount">
+ <xsl:value-of select="ss:Table/@ss:ExpandedColumnCount"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="ss:Table/ss:Column/@ss:Span">
+ <!-- No absolute column number (ss:ExpandedColumnCount) is add the nodes and spanned columns -->
+ <xsl:variable name="spannedColumns">
+ <xsl:call-template name="count-spanned-columns">
+ <xsl:with-param name="columns" select="ss:Table/ss:Column[@ss:Span]"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="count(ss:Table/ss:Column) + number($spannedColumns)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- No absolute column number (ss:ExpandedColumnCount) is add the nodes -->
+ <xsl:value-of select="count(ss:Table/ss:Column)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-expanded-row-count">
+ <xsl:choose>
+ <xsl:when test="ss:Table/@ss:ExpandedRowCount">
+ <xsl:value-of select="ss:Table/@ss:ExpandedRowCount"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="ss:Table/ss:Row/@ss:Index and not(ss:Table/ss:Row/@ss:Span)">
+ <xsl:variable name="lastIndexedRow" select="ss:Table/ss:Row[@ss:Index][last()]"/>
+ <xsl:value-of select="number($lastIndexedRow/@ss:Index) + count($lastIndexedRow/following-sibling::ss:Row)"/>
+ </xsl:when>
+ <xsl:when test="ss:Table/ss:Row/@ss:Index and ss:Table/ss:Row/@ss:Span">
+ <xsl:variable name="lastIndexedRow" select="ss:Table/ss:Row[@ss:Index][last()]"/>
+ <xsl:variable name="spannedRows">
+ <xsl:call-template name="count-spanned-rows">
+ <xsl:with-param name="rows" select="$lastIndexedRow/following-sibling::ss:Row[@ss:Span]"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="number($lastIndexedRow/@ss:Index) + count($lastIndexedRow/following-sibling::ss:Row) + number($spannedRows)"/>
+ </xsl:when>
+ <xsl:when test="not(ss:Table/ss:Row/@ss:Index) and ss:Table/ss:Row/@ss:Span">
+ <xsl:variable name="spannedRows">
+ <xsl:call-template name="count-spanned-rows">
+ <xsl:with-param name="rows" select="ss:Table/ss:Rows[@ss:Span]"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="count(ss:Table/ss:Row + number($spannedRows))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="count(ss:Table/ss:Row)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="count-spanned-rows">
+ <xsl:param name="expandedRowCount" select="0"/>
+ <xsl:param name="rows"/>
+ <xsl:param name="rowsCount" select="count($rows)"/>
+ <xsl:param name="rowIndex" select="1"/>
+ <xsl:choose>
+ <xsl:when test="$rowIndex &lt;= $rowsCount">
+ <xsl:call-template name="count-spanned-rows">
+ <xsl:with-param name="rows" select="$rows"/>
+ <xsl:with-param name="rowsCount" select="$rowsCount"/>
+ <xsl:with-param name="rowIndex" select="$rowIndex + 1"/>
+ <xsl:with-param name="expandedRowCount" select="$expandedRowCount + $rows[$rowIndex]/@ss:Span"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$expandedRowCount"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-default-cell-style">
+ <xsl:param name="currentColumnNode"/>
+ <xsl:choose>
+ <xsl:when test="$currentColumnNode">
+ <xsl:choose>
+ <xsl:when test="$currentColumnNode/@ss:StyleID">
+ <xsl:value-of select="$currentColumnNode/@ss:StyleID"/>
+ </xsl:when>
+ <xsl:otherwise>Default</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="./ss:Table[@ss:StyleID]">
+ <xsl:value-of select="./ss:Table/@ss:StyleID"/>
+ </xsl:when>
+ <xsl:otherwise>Default</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-row-beyond-last">
+ <!-- dealing the RowBreak after last row by recursion -->
+ <xsl:param name="index-value"/>
+ <xsl:param name="worksheetNo"/>
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="end-pos"/>
+ <xsl:param name="total-col"/>
+ <xsl:variable name="current" select="concat('R',$index-value)"/>
+ <xsl:element name="table:table-row">
+ <xsl:choose>
+ <xsl:when test="./x:PageBreaks/x:RowBreaks/x:RowBreak/x:Row = ($index-value - 1)">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('rob',$worksheetNo)"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('ro',$worksheetNo)"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <!-- Note: 2 be refactored
+ <xsl:when test="./ss:Table/ss:Column[@ss:StyleID] or ./ss:Table[@ss:StyleID]">
+ <xsl:if test="256 - count(ss:Table/ss:Column) &gt; 0">
+ <table:table-cell table:number-columns-repeated="{256 - count(ss:Table/ss:Column)}" />
+ </xsl:if>
+ </xsl:when>-->
+ <xsl:when test="contains($condition-pos-str,$current)">
+ <xsl:call-template name="create-spanning-cells">
+ <xsl:with-param name="row-pos" select="$index-value"/>
+ <xsl:with-param name="c-start" select="1"/>
+ <xsl:with-param name="c-end" select="$total-col"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- OASIS XML does not allow rows without a cell -->
+ <table:table-cell/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="$index-value &lt; ($end-pos + 1)">
+ <xsl:call-template name="get-row-beyond-last">
+ <xsl:with-param name="index-value" select="$index-value + 1"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="end-pos" select="$end-pos"/>
+ <xsl:with-param name="total-col" select="$total-col"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="break-row-beyond-max">
+ <!-- returns the max position of the row from condition-pos-str -->
+ <xsl:param name="pos"/>
+ <xsl:param name="last-value"/>
+ <xsl:param name="count-value"/>
+ <xsl:variable name="pre-value" select="./x:PageBreaks/x:RowBreaks/x:RowBreak[position() = $pos]/x:Row"/>
+ <xsl:variable name="end-value">
+ <xsl:choose>
+ <xsl:when test="$last-value &lt; $pre-value">
+ <xsl:value-of select="$pre-value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$last-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$pos &lt; $count-value">
+ <xsl:call-template name="break-row-beyond-max">
+ <xsl:with-param name="pos" select="$pos + 1"/>
+ <xsl:with-param name="last-value" select="$end-value"/>
+ <xsl:with-param name="count-value" select="$count-value"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$end-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-column-beyond-last">
+ <!-- dealing the ColBreak after last column by recursion -->
+ <xsl:param name="index-value"/>
+ <xsl:param name="worksheetNo"/>
+ <xsl:for-each select="./x:PageBreaks/x:ColBreaks/x:ColBreak">
+ <xsl:variable name="each-column-value" select="./x:Column"/>
+ <xsl:choose>
+ <xsl:when test="$each-column-value + 1 &gt; $index-value">
+ <xsl:variable name="number-repeated">
+ <xsl:choose>
+ <xsl:when test="preceding-sibling::x:ColBreak[position()=count(.)]/x:Column + 1 = $index-value">
+ <xsl:value-of select="$each-column-value - preceding-sibling::x:ColBreak[position()=count(.)]/x:Column - 1"/>
+ </xsl:when>
+ <xsl:when test="preceding-sibling::x:ColBreak[position()=count(.)]/x:Column + 1 &gt; $index-value">
+ <xsl:value-of select="$each-column-value - preceding-sibling::x:ColBreak[position()=count(.)]/x:Column - 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$each-column-value - $index-value + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$number-repeated &gt; 0">
+ <xsl:element name="table:table-column">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="'co1'"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="$number-repeated"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="table:table-column">
+ <xsl:if test="./../../../ss:Table[@ss:StyleID]">
+ <xsl:attribute name="table:default-cell-style-name">
+ <xsl:value-of select="./ss:Table/@ss:StyleID"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('cob',$worksheetNo)"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="$each-column-value + 1 = $index-value">
+ <xsl:element name="table:table-column">
+ <xsl:if test="./../../../ss:Table[@ss:StyleID]">
+ <xsl:attribute name="table:default-cell-style-name">
+ <xsl:value-of select="./../../../ss:Table/@ss:StyleID"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="concat('cob',$worksheetNo)"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="create-spanning-cells">
+ <!-- judge the position of the Cell in the condition-pos-str -->
+ <xsl:param name="row-pos"/>
+ <xsl:param name="c-start"/>
+ <xsl:param name="c-end"/>
+ <xsl:param name="condition-pos-str"/>
+
+ <xsl:variable name="current" select="concat('R',$row-pos,'C',$c-start,',')"/>
+ <xsl:variable name="style-name">
+ <xsl:choose>
+ <xsl:when test="contains($condition-pos-str,$current)">
+ <xsl:variable name="temp-str">
+ <xsl:call-template name="condition-str">
+ <xsl:with-param name="param-str" select="substring-before($condition-pos-str,$current)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with($temp-str, 'c')">
+ <xsl:value-of select="concat('ce', substring-after($temp-str, 'c'))"/>
+ </xsl:when>
+ <xsl:when test="starts-with($temp-str, 'v')">
+ <xsl:value-of select="concat('val', substring-after($temp-str, 'v'))"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- as for the spanned cells no style is taken.. -->
+ <xsl:choose>
+ <!-- inherit style from parent row style-->
+ <xsl:when test="../@ss:StyleID">
+ <xsl:value-of select="../@ss:StyleID"/>
+ </xsl:when>
+ <!-- if no correspondent column style exisit.. -->
+ <!-- inherit style from parent table style -->
+ <xsl:when test="../../@ss:StyleID">
+ <!-- function to give in col-pos and get back column style -->
+ <xsl:variable name="relatedColumnStyle">
+ <xsl:call-template name="get-related-column-style">
+ <!-- the given position of the cell in the table, a column style is searched -->
+ <xsl:with-param name="calculatedCellPosition" select="$c-start" />
+ <!-- all columns in XML -->
+ <xsl:with-param name="columnXMLNodes" select="../../ss:Column"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$relatedColumnStyle = ''">
+ <xsl:value-of select="../../@ss:StyleID"/>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="table:table-cell">
+ <xsl:if test="not($style-name = '')">
+ <xsl:choose>
+ <xsl:when test="starts-with($style-name, 'val')">
+ <xsl:attribute name="table:content-validation-name">
+ <xsl:value-of select="$style-name"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="starts-with($style-name, 'ce')">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="$style-name"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="$style-name"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="$c-start &lt; $c-end">
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="$c-end - $c-start + 1"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="condition-row-col-pos-max">
+ <!-- returns the max position of the column or row from condition-pos-str -->
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="last-value"/>
+ <xsl:param name="div-value"/>
+ <xsl:variable name="pre-value">
+ <xsl:choose>
+ <xsl:when test="$div-value = 'R'">
+ <xsl:value-of select="substring-before(substring-after($condition-pos-str,$div-value),'C')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before(substring-after($condition-pos-str,$div-value),',')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="end-value">
+ <xsl:choose>
+ <xsl:when test="$last-value &lt; $pre-value">
+ <xsl:value-of select="$pre-value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$last-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($condition-pos-str,$div-value)">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="substring-after($condition-pos-str,$div-value)"/>
+ <xsl:with-param name="last-value" select="$end-value"/>
+ <xsl:with-param name="div-value" select="$div-value"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$end-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="condition-str">
+ <!-- returns the string of style name of condition-pos-str -->
+ <xsl:param name="param-str"/>
+ <xsl:choose>
+ <xsl:when test="contains($param-str,'(')">
+ <xsl:call-template name="condition-str">
+ <xsl:with-param name="param-str" select="substring-after($param-str,'(')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before($param-str,':')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:key name="Style" match="/ss:Workbook/ss:Styles/ss:Style" use="@ss:ID"/>
+ <xsl:template name="create-cells">
+ <xsl:param name="row-pos"/>
+ <xsl:param name="expandedColumnCount"/>
+ <xsl:param name="condition-pos-str"/>
+ <xsl:choose>
+ <xsl:when test="ss:Cell">
+ <xsl:apply-templates select="ss:Cell[1]" mode="selected">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$expandedColumnCount"/>
+ <!--
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str" />
+ <xsl:with-param name="last-value" select="0" />
+ <xsl:with-param name="div-value" select="'C'" />
+ </xsl:call-template>
+ </xsl:with-param> -->
+ <xsl:with-param name="col-pos-written" select="0"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="current" select="concat('R',$row-pos,'C')"/>
+ <xsl:choose>
+ <xsl:when test="contains($condition-pos-str,$current)">
+ <xsl:call-template name="create-spanning-cells">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="c-start" select="1"/>
+ <xsl:with-param name="c-end">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="div-value" select="'C'"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos" select="1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- OASIS XML does not allow an empty row -->
+ <xsl:choose>
+ <xsl:when test="$expandedColumnCount != 0">
+ <table:table-cell table:number-columns-repeated="{$expandedColumnCount}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- OASIS XML row can not be empty -->
+ <table:table-cell table:number-columns-repeated="256"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="ss:Cell" name="ss:Cell" mode="selected">
+ <!-- Contains the max position of the column or row from the concatenation from
+ x:ConditionalFormatting
+ and
+ x:DataValidation -->
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="col-pos-max"/>
+ <xsl:param name="col-pos-written" select="0"/>
+ <xsl:param name="col-pos-current" select="0"/>
+ <xsl:param name="row-pos"/>
+ <xsl:param name="col-repeated" select="1"/>
+
+ <!-- The column position of the cell (might jumped by ss:Index) -->
+ <xsl:variable name="col-pos">
+ <xsl:choose>
+ <xsl:when test="@ss:Index">
+ <xsl:choose>
+ <xsl:when test="@ss:MergeAcross">
+ <xsl:value-of select="@ss:MergeAcross + @ss:Index"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@ss:Index"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="@ss:MergeAcross">
+ <xsl:value-of select="1 + @ss:MergeAcross + $col-pos-current"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="1 + $col-pos-current"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="nextCell" select="following-sibling::ss:Cell[1]"/>
+ <!-- Multiple empty cells with the same or no style will be moved to one cell with a 'table:number-columns-repeated' attribute -->
+ <xsl:variable name="cell-is-repeatable" select="
+ not(current()/*)
+ and
+ not(current()/text())
+ and
+ (
+ not($nextCell)
+ and $col-pos &gt; $col-pos-written + 1
+ or
+ (
+ $nextCell
+ and
+ not($nextCell/*)
+ and
+ not($nextCell/text())
+ and
+ (
+ (current()/@ss:StyleID = $nextCell/@ss:StyleID)
+ or
+ (not(current()/@ss:StyleID) and not($nextCell/@ss:StyleID))
+ )
+ and
+ (
+ not($nextCell/@ss:Index)
+ or
+ ($nextCell/@ss:Index = $col-pos + 1)
+ )
+ )
+ ) "/>
+ <xsl:choose>
+ <!-- Scenario: The missing cells scipped by using the ss:Index attribute will be added -->
+ <xsl:when test="@ss:Index and @ss:Index &gt; $col-pos-written + 1">
+ <!-- In Open Document nothing comparable to Index exists,
+ the missing cells might have to be created, if they had content as only style will be repeated-->
+ <xsl:call-template name="create-spanning-cells">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="c-start" select="$col-pos-current + 1"/>
+ <xsl:with-param name="c-end" select="@ss:Index - 1"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ <xsl:call-template name="ss:Cell">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-written" select="@ss:Index - 1"/>
+ <xsl:with-param name="col-pos-current" select="$col-pos"/>
+ <xsl:with-param name="col-repeated" select="$col-repeated"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- Scenario: A sequence of cells can be put together as one cell -->
+ <xsl:when test="$cell-is-repeatable">
+ <xsl:apply-templates select="$nextCell" mode="selected">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-written" select="$col-pos-written"/>
+ <xsl:with-param name="col-pos-current" select="$col-pos"/>
+ <xsl:with-param name="col-repeated" select="$col-repeated"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- if the cell wasn't repeated yet, created first -->
+ <xsl:if test="$col-repeated = 1">
+ <xsl:element name="table:table-cell">
+ <!-- in case the cell has an Index and is repeatable (s.above) and therefore has not been repeated earlier -->
+ <xsl:choose>
+ <xsl:when test="@ss:MergeAcross">
+ <xsl:if test="$col-pos - @ss:MergeAcross &gt; $col-pos-written + 1">
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="$col-pos - $col-pos-written"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$col-pos &gt; $col-pos-written + 1">
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="$col-pos - $col-pos-written"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="create-table-cell-attributes">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos" select="$col-pos"/>
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ </xsl:call-template>
+ <xsl:call-template name="create-table-cell-content">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos" select="$col-pos"/>
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ </xsl:call-template>
+ </xsl:element>
+ <!-- ss:MergeAcross (column spanned) indicates a covered table-cell in Open Document XML-->
+ <xsl:if test="@ss:MergeAcross">
+ <xsl:element name="table:covered-table-cell">
+ <xsl:if test="@ss:MergeAcross &gt; 1">
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="@ss:MergeAcross"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:if>
+ <xsl:choose>
+ <!-- the following block is not used, if the cell had been repeated earlier -->
+ <xsl:when test="$nextCell and not($cell-is-repeatable and $col-repeated = 1)">
+ <xsl:choose>
+ <!-- After cells can no longer be repeated write out the attribute -->
+ <xsl:when test="not($cell-is-repeatable) and $col-repeated > 1">
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="$col-repeated"/>
+ </xsl:attribute>
+ </xsl:when>
+ <!-- At the end of the row -->
+ <xsl:when test="not($nextCell)">
+ <xsl:if test="../../../x:ConditionalFormatting">
+ <!-- at the last position of the Cell tag,inspecting the following cell before condition-row-col-pos-max -->
+ <xsl:call-template name="create-spanning-cells">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="c-start" select="$col-pos"/>
+ <xsl:with-param name="c-end" select="$col-pos-max"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <!-- If the cells can not be repeated (default) -->
+ <xsl:when test="not($cell-is-repeatable)">
+ <!-- Traverse the following Cell -->
+ <xsl:apply-templates select="$nextCell" mode="selected">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-written" select="$col-pos"/>
+ <xsl:with-param name="col-pos-current" select="$col-pos"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <!-- Go on with started repetition -->
+ <xsl:otherwise>
+ <xsl:apply-templates select="$nextCell" mode="selected">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-written" select="$col-pos"/>
+ <xsl:with-param name="col-pos-current" select="$col-pos"/>
+ <xsl:with-param name="col-repeated" select="$col-repeated + 1"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="not($nextCell)">
+ <xsl:choose>
+ <xsl:when test="$col-repeated = 1 and ($col-pos &lt; $col-pos-max)">
+ <table:table-cell table:number-columns-repeated="{$col-pos-max - $col-pos}"/>
+ </xsl:when>
+ <xsl:when test="$col-repeated &gt; 1">
+ <xsl:attribute name="table:number-columns-repeated">
+ <xsl:value-of select="$col-repeated"/>
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$nextCell" mode="skip">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-written" select="$col-pos"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="ss:Cell" mode="skip">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="col-pos-max"/>
+ <xsl:param name="col-pos-written"/>
+ <xsl:param name="row-pos"/>
+
+ <xsl:variable name="nextCell" select="following-sibling::ss:Cell[1]"/>
+ <!-- Multiple empty cells with the same style will be moved to one cell with a 'table:number-columns-repeated' attribute -->
+ <xsl:variable name="cell-is-repeatable" select="not($nextCell/*) and not($nextCell/text()) and ((current()/@ss:StyleID = $nextCell/@ss:StyleID) or (not(current()/@ss:StyleID) and not($nextCell/@ss:StyleID))) and not($nextCell/@ss:Index)"/>
+ <xsl:choose>
+ <xsl:when test="$cell-is-repeatable">
+ <xsl:apply-templates select="$nextCell" mode="skip">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-written" select="$col-pos-written + 1"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$nextCell" mode="selected">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-written" select="$col-pos-written + 1"/>
+ <xsl:with-param name="col-pos-current" select="$col-pos-written + 1"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="create-table-cell-attributes">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="col-pos-max"/>
+ <xsl:param name="col-pos"/>
+ <xsl:param name="row-pos"/>
+
+ <xsl:choose>
+ <xsl:when test="$condition-pos-str">
+ <xsl:call-template name="get-condition-dependent-cell-attributes">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="current-pos-str" select="concat('R',$row-pos,'C',$col-pos,',')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="@ss:StyleID">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="@ss:StyleID"/>
+ </xsl:attribute>
+ </xsl:when>
+ <!-- inherit style from parent row style-->
+ <xsl:when test="../@ss:StyleID">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="../@ss:StyleID"/>
+ </xsl:attribute>
+ </xsl:when>
+ <!-- if no correspondent column style exisit.. -->
+ <!-- inherit style from parent table style -->
+ <xsl:when test="../../@ss:StyleID">
+ <!-- function to give in col-pos and get back column style -->
+ <xsl:variable name="relatedColumnStyle">
+ <xsl:call-template name="get-related-column-style">
+ <!-- the given position of the cell in the table, a column style is searched -->
+ <xsl:with-param name="calculatedCellPosition" select="$col-pos" />
+ <!-- all columns in XML -->
+ <xsl:with-param name="columnXMLNodes" select="../../ss:Column"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$relatedColumnStyle = ''">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="../../@ss:StyleID"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@ss:MergeAcross or @ss:MergeDown">
+ <xsl:choose>
+ <xsl:when test="@ss:MergeAcross">
+ <xsl:attribute name="table:number-columns-spanned">
+ <xsl:value-of select="@ss:MergeAcross + 1"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:number-columns-spanned">1</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@ss:MergeDown">
+ <xsl:attribute name="table:number-rows-spanned">
+ <xsl:value-of select="@ss:MergeDown+1"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:number-rows-spanned">1</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@ss:Formula">
+ <!-- formula translation from Excel to Calc -->
+ <xsl:variable name="calc-formula">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$col-pos"/>
+ <xsl:with-param name="expression" select="@ss:Formula"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="table:formula">
+ <xsl:value-of select="$calc-formula"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ss:Data">
+ <xsl:variable name="data-format">
+ <xsl:value-of select="key('Style', @ss:StyleID)/ss:NumberFormat/@ss:Format"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="ss:Data/@ss:Type = 'Number'">
+ <xsl:choose>
+ <xsl:when test="$data-format = 'Percent' or contains( $data-format, '%')">
+ <xsl:attribute name="office:value-type">percentage</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains(key('Style', @ss:StyleID)/ss:NumberFormat/@ss:Format, 'Currency')">
+ <xsl:attribute name="office:value-type">currency</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="office:value-type">float</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="office:value">
+ <xsl:value-of select="ss:Data"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="ss:Data/@ss:Type = 'DateTime'">
+ <xsl:choose>
+ <xsl:when test="(contains( $data-format, 'Date') or contains($data-format,'y') or contains($data-format,'g') or contains($data-format,'d') or contains($data-format,'e') or starts-with( substring( ss:Data, 11), 'T00:00:00.000' ) ) and (not (contains( $data-format, 'Time') ) )">
+ <xsl:attribute name="office:value-type">date</xsl:attribute>
+ <xsl:attribute name="office:date-value">
+ <xsl:value-of select="substring-before(ss:Data, 'T')"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="office:value-type">time</xsl:attribute>
+ <xsl:attribute name="office:time-value">
+ <xsl:value-of select="concat('P',substring(ss:Data, 11, 3), 'H', substring(ss:Data, 15, 2), 'M', substring(ss:Data, 18,2), 'S')"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="ss:Data/@ss:Type = 'Boolean'">
+ <xsl:attribute name="office:value-type">boolean</xsl:attribute>
+ <xsl:attribute name="office:boolean-value">
+ <xsl:choose>
+ <xsl:when test="ss:Data = '1'">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="ss:Data/@ss:Type = 'String'">
+ <xsl:attribute name="office:value-type">string</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="get-related-column-style">
+ <!-- the given position of the cell in the table, a column style is searched -->
+ <xsl:param name="calculatedCellPosition" />
+ <!-- the current position of the column as XML node -->
+ <xsl:param name="columnXMLPosition" select="1" />
+ <!-- all columns in XML -->
+ <xsl:param name="columnXMLNodes" />
+ <!-- the ending column position of the earlier column style in the table -->
+ <xsl:param name="earlierCalculatedColumnEnd" select="0" />
+
+ <!-- the current column as XML node -->
+ <xsl:variable name="columnXMLNode" select="$columnXMLNodes[1]" />
+ <xsl:if test="$columnXMLNodes and count($columnXMLNodes) > 0">
+ <!-- the starting column position of the style in the table -->
+ <xsl:variable name="calculatedColumnStart">
+ <!-- if ss:Index exists, this is the start of the column -->
+ <xsl:choose>
+ <xsl:when test="$columnXMLNode/@ss:Index">
+ <xsl:value-of select="$columnXMLNode/@ss:Index" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$earlierCalculatedColumnEnd + 1" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- the ending column position of the style in the table -->
+ <xsl:variable name="calculatedColumnEnd">
+ <xsl:choose>
+ <xsl:when test="$columnXMLNode/@ss:Span">
+ <xsl:value-of select="$calculatedColumnStart + $columnXMLNode/@ss:Span" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$calculatedColumnStart" />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$calculatedColumnStart &gt;= $calculatedCellPosition and $calculatedCellPosition &lt;= $calculatedColumnEnd">
+ <xsl:value-of select="$columnXMLNode/@ss:StyleID"/>
+ </xsl:when>
+ <xsl:when test="$calculatedColumnEnd &lt;= $calculatedCellPosition">
+ <xsl:call-template name="get-related-column-style">
+ <!-- the given position of the cell in the table, a column style is searched -->
+ <xsl:with-param name="calculatedCellPosition" select="$calculatedCellPosition" />
+ <!-- all columns in XML -->
+ <xsl:with-param name="columnXMLNodes" select="$columnXMLNodes[position() != 1]"/>
+ <!-- the ending column position of the style in the table -->
+ <xsl:with-param name="earlierCalculatedColumnEnd" select="$calculatedColumnEnd" />
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="create-table-cell-content">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="col-pos-max"/>
+ <xsl:param name="col-pos"/>
+ <xsl:param name="row-pos"/>
+ <xsl:apply-templates select="ss:Comment" mode="body"/>
+ <xsl:if test="ss:Data">
+ <text:p>
+ <xsl:call-template name="create-data-content">
+ <xsl:with-param name="style-id" select="@ss:StyleID"/>
+ </xsl:call-template>
+ </text:p>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="create-data-content">
+ <xsl:param name="style-id" select="@ss:StyleID"/>
+ <xsl:choose>
+ <xsl:when test="ss:Data//text()[string-length(.) != 0] and ss:Data[count(*)>0]">
+ <xsl:for-each select="ss:Data//text()[string-length(.) != 0]">
+ <xsl:sort select="position( )" order="ascending" data-type="number"/>
+ <text:span text:style-name="{concat($style-id, 'T', count(preceding::ss:Data[child::html:*]), '_', position())}">
+ <xsl:value-of select="."/>
+ </text:span>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="contains(key('Style', $style-id)/ss:Font/@ss:VerticalAlign, 'script')">
+ <text:span text:style-name="{concat($style-id, 'T0')}">
+ <xsl:choose>
+ <xsl:when test="@ss:HRef">
+ <text:a xlink:href="{@ss:HRef}">
+ <xsl:value-of select="ss:Data"/>
+ </text:a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="ss:Data"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </text:span>
+ </xsl:when>
+ <xsl:when test="@ss:HRef">
+ <text:a xlink:href="{@ss:HRef}">
+ <xsl:value-of select="ss:Data"/>
+ </text:a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="ss:Data"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-condition-dependent-cell-attributes">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="current-pos-str"/>
+ <xsl:variable name="temp-str">
+ <xsl:call-template name="condition-str">
+ <xsl:with-param name="param-str" select="substring-before($condition-pos-str,$current-pos-str)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="base-style-name">
+ <xsl:choose>
+ <xsl:when test="@ss:StyleID">
+ <xsl:value-of select="@ss:StyleID"/>
+ </xsl:when>
+ <xsl:when test="../@ss:StyleID">
+ <xsl:value-of select="../@ss:StyleID"/>
+ </xsl:when>
+ <xsl:when test="../../@ss:StyleID">
+ <xsl:value-of select="../../@ss:StyleID"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="style-name">
+ <xsl:choose>
+ <xsl:when test="contains($condition-pos-str, $current-pos-str) and starts-with($temp-str, 'c')">
+ <xsl:choose>
+ <xsl:when test="string-length($base-style-name) &gt; 0"><xsl:value-of select="concat($base-style-name, '-ce', substring-after($temp-str, 'c'))"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="concat('Default-ce', substring-after($temp-str, 'c'))"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$base-style-name"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with($style-name, 'val')">
+ <xsl:attribute name="table:content-validation-name">
+ <xsl:value-of select="$style-name"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="not($style-name = '')">
+ <xsl:attribute name="table:style-name">
+ <xsl:value-of select="$style-name"/>
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <!-- maybe multi functions occur at same time in the same Cell, such as ConditionalFormatting and DataValidation -->
+ <xsl:if test="contains($condition-pos-str, $current-pos-str)">
+ <xsl:choose>
+ <xsl:when test="starts-with($temp-str, 'v')">
+ <xsl:attribute name="table:content-validation-name">
+ <xsl:value-of select="concat('val', substring-after($temp-str, 'v'))"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="after-str" select="substring-after($condition-pos-str, $current-pos-str)"/>
+ <xsl:if test="contains( $after-str, $current-pos-str)">
+ <xsl:variable name="temp-str-2">
+ <xsl:call-template name="condition-str">
+ <xsl:with-param name="param-str" select="substring-before( $after-str,$current-pos-str)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="starts-with( $temp-str-2, 'v')">
+ <xsl:attribute name="table:content-validation-name">
+ <xsl:value-of select="concat('val', substring-after($temp-str-2, 'v'))"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="validation-row-column-string">
+ <!-- returns a string with structer,including row\column position by extraction from x:DataValidation -->
+ <xsl:param name="last"/>
+ <xsl:param name="total"/>
+ <xsl:param name="index"/>
+ <xsl:variable name="table-pos" select="count(preceding-sibling::ss:Worksheet)+1"/>
+ <xsl:variable name="current">
+ <xsl:call-template name="parse-range">
+ <xsl:with-param name="range-value" select="./x:DataValidation[position() = $index]/x:Range"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="current-value" select="concat('(v',$index,':', $current,');')"/>
+ <xsl:if test="$index &lt; $total">
+ <xsl:call-template name="validation-row-column-string">
+ <xsl:with-param name="last" select="concat($last, $current-value)"/>
+ <xsl:with-param name="total" select="$total"/>
+ <xsl:with-param name="index" select="$index + 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$index = $total">
+ <xsl:value-of select="concat($last, $current-value)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="condition-row-column-string">
+ <!-- returns a string with structer,including row\column position by extraction from x:ConditionalFormatting -->
+ <xsl:param name="last"/>
+ <xsl:param name="total"/>
+ <xsl:param name="index"/>
+ <xsl:variable name="table-pos" select="count(preceding-sibling::ss:Worksheet)+1"/>
+ <xsl:variable name="current">
+ <xsl:call-template name="parse-range">
+ <xsl:with-param name="range-value" select="./x:ConditionalFormatting[position() = $index]/x:Range"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="current-value" select="concat('(c',$table-pos,'-',$index,':', $current,');')"/>
+ <xsl:if test="$index &lt; $total">
+ <xsl:call-template name="condition-row-column-string">
+ <xsl:with-param name="last" select="concat($last, $current-value)"/>
+ <xsl:with-param name="total" select="$total"/>
+ <xsl:with-param name="index" select="$index + 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$index = $total">
+ <xsl:value-of select="concat($last, $current-value)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="parse-range">
+ <!-- returns a string,input param:the value of x:Range -->
+ <xsl:param name="range-value"/>
+ <xsl:param name="last"/>
+ <xsl:variable name="first-pit">
+ <xsl:choose>
+ <xsl:when test="contains($range-value,',')">
+ <xsl:value-of select="substring-before($range-value,',')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$range-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="current">
+ <xsl:choose>
+ <xsl:when test="contains($first-pit,':')">
+ <xsl:variable name="R-start" select="substring-before(substring-after($first-pit,'R'),'C')"/>
+ <xsl:variable name="C-start" select="substring-before(substring-after($first-pit,'C'),':')"/>
+ <xsl:variable name="second-pit" select="substring-after($first-pit,':')"/>
+ <xsl:variable name="R-end" select="substring-before(substring-after($second-pit,'R'),'C')"/>
+ <xsl:variable name="C-end" select="substring-after($second-pit,'C')"/>
+ <xsl:variable name="the-str">
+ <xsl:call-template name="condition-rc-str">
+ <xsl:with-param name="r-start" select="$R-start"/>
+ <xsl:with-param name="r-end" select="$R-end"/>
+ <xsl:with-param name="c-start" select="$C-start"/>
+ <xsl:with-param name="c-end" select="$C-end"/>
+ <xsl:with-param name="last" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$the-str"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($first-pit,',')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($range-value,',')">
+ <xsl:call-template name="parse-range">
+ <xsl:with-param name="range-value" select="substring-after($range-value,',')"/>
+ <xsl:with-param name="last" select="concat($last,$current)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($last,$current)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="condition-rc-str">
+ <!-- dealing the range of row\column -->
+ <xsl:param name="r-start"/>
+ <xsl:param name="r-end"/>
+ <xsl:param name="c-start"/>
+ <xsl:param name="c-end"/>
+ <xsl:param name="last"/>
+ <xsl:variable name="current">
+ <xsl:call-template name="condition-c-str">
+ <xsl:with-param name="rc-str" select="concat('R',$r-start)"/>
+ <xsl:with-param name="start" select="$c-start"/>
+ <xsl:with-param name="end" select="$c-end"/>
+ <xsl:with-param name="last" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$r-start &lt; $r-end">
+ <xsl:call-template name="condition-rc-str">
+ <xsl:with-param name="r-start" select="$r-start + 1"/>
+ <xsl:with-param name="r-end" select="$r-end"/>
+ <xsl:with-param name="c-start" select="$c-start"/>
+ <xsl:with-param name="c-end" select="$c-end"/>
+ <xsl:with-param name="last" select="concat($last,$current)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$r-start = $r-end">
+ <xsl:value-of select="concat($last,$current)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="condition-c-str">
+ <!-- return value for the template condition-rc-str -->
+ <xsl:param name="rc-str"/>
+ <xsl:param name="start"/>
+ <xsl:param name="end"/>
+ <xsl:param name="last"/>
+ <xsl:variable name="current" select="concat($rc-str,'C',$start,',')"/>
+ <xsl:if test="$start &lt; $end">
+ <xsl:call-template name="condition-c-str">
+ <xsl:with-param name="rc-str" select="$rc-str"/>
+ <xsl:with-param name="start" select="$start + 1"/>
+ <xsl:with-param name="end" select="$end"/>
+ <xsl:with-param name="last" select="concat($last,$current)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$start = $end">
+ <xsl:value-of select="concat($last,$current)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="ss:Data[count(*)>0]">
+ <xsl:for-each select=".//text()[string-length(.) != 0]">
+ <style:style style:name="{concat(ancestor::ss:Cell/@ss:StyleID,'T',count(preceding::ss:Data[child::html:*]), '_', position())}" style:family="text">
+ <xsl:element name="style:text-properties">
+ <xsl:if test="ancestor-or-self::html:Font/@html:Face">
+ <xsl:attribute name="style:font-name">
+ <xsl:value-of select="ancestor-or-self::html:Font/@html:Face"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::html:Font/@html:Size">
+ <xsl:attribute name="fo:font-size">
+ <xsl:value-of select="concat(ancestor-or-self::html:Font/@html:Size,'pt')"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:font-size-asian">
+ <xsl:value-of select="concat(ancestor-or-self::html:Font/@html:Size,'pt')"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:font-size-complex">
+ <xsl:value-of select="concat(ancestor-or-self::html:Font/@html:Size,'pt')"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::html:Font/@html:Color">
+ <xsl:attribute name="fo:color">
+ <xsl:value-of select="ancestor-or-self::html:Font/@html:Color"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::html:B">
+ <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::html:I">
+ <xsl:attribute name="fo:font-style">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::html:U">
+ <xsl:attribute name="style:text-underline-type">single</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::html:S">
+ <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::html:Sup">
+ <xsl:attribute name="style:text-position">33% 58%</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="ancestor-or-self::html:Sub">
+ <xsl:attribute name="style:text-position">-33% 58%</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </style:style>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="get-pos-content">
+ <xsl:param name="content"/>
+ <xsl:param name="pos"/>
+ <xsl:choose>
+ <xsl:when test="$pos = 'left'">
+ <xsl:choose>
+ <xsl:when test="contains($content,'&amp;C')">
+ <xsl:value-of select="substring-before( substring-after( $content, '&amp;L'), '&amp;C')"/>
+ </xsl:when>
+ <xsl:when test="contains($content,'&amp;R')">
+ <xsl:value-of select="substring-before( substring-after( $content, '&amp;L'), '&amp;R')"/>
+ </xsl:when>
+ <xsl:when test="contains($content,'&amp;L')">
+ <xsl:value-of select="substring-after( $content, '&amp;L')"/>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$pos = 'center'">
+ <xsl:choose>
+ <xsl:when test="contains($content,'&amp;R')">
+ <xsl:value-of select="substring-before( substring-after( $content, '&amp;C'), '&amp;R')"/>
+ </xsl:when>
+ <xsl:when test="contains($content,'&amp;C')">
+ <xsl:value-of select="substring-after( $content, '&amp;C')"/>
+ </xsl:when>
+ <xsl:when test="contains($content,'&amp;L')"/>
+ <xsl:otherwise>
+ <xsl:value-of select="$content"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$pos = 'right'">
+ <xsl:value-of select="substring-after( $content, '&amp;R')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="@x:Data">
+ <xsl:variable name="style-name-header">
+ <xsl:value-of select="concat(ancestor::ss:Worksheet/@ss:Name, substring(name(..),1,1))"/>
+ </xsl:variable>
+ <xsl:variable name="left-style-data">
+ <xsl:call-template name="get-pos-content">
+ <xsl:with-param name="content" select="."/>
+ <xsl:with-param name="pos" select="'left'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="string-length($left-style-data)&gt;0 and contains($left-style-data,'&amp;')">
+ <xsl:call-template name="create-header-footer-style">
+ <xsl:with-param name="style-name-header" select="concat($style-name-header,'L')"/>
+ <xsl:with-param name="style-data" select="$left-style-data"/>
+ <xsl:with-param name="index" select="0"/>
+ <xsl:with-param name="current-pos" select="1"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:variable name="center-style-data">
+ <xsl:call-template name="get-pos-content">
+ <xsl:with-param name="content" select="."/>
+ <xsl:with-param name="pos" select="'center'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="string-length($center-style-data)&gt;0 and contains($center-style-data,'&amp;')">
+ <xsl:call-template name="create-header-footer-style">
+ <xsl:with-param name="style-name-header" select="concat($style-name-header,'C')"/>
+ <xsl:with-param name="style-data" select="$center-style-data"/>
+ <xsl:with-param name="index" select="0"/>
+ <xsl:with-param name="current-pos" select="1"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:variable name="right-style-data">
+ <xsl:call-template name="get-pos-content">
+ <xsl:with-param name="content" select="."/>
+ <xsl:with-param name="pos" select="'right'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="string-length($right-style-data)&gt;0 and contains($right-style-data,'&amp;')">
+ <xsl:call-template name="create-header-footer-style">
+ <xsl:with-param name="style-name-header" select="concat($style-name-header,'R')"/>
+ <xsl:with-param name="style-data" select="$right-style-data"/>
+ <xsl:with-param name="index" select="0"/>
+ <xsl:with-param name="current-pos" select="1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="create-header-footer-style">
+ <xsl:param name="style-name-header"/>
+ <xsl:param name="style-data"/>
+ <xsl:param name="index"/>
+ <xsl:param name="current-pos"/>
+ <xsl:variable name="current-style-data">
+ <xsl:value-of select="substring($style-data,$current-pos)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with($current-style-data,'&amp;D') or starts-with($current-style-data,'&amp;T') or starts-with($current-style-data,'&amp;P') or starts-with($current-style-data,'&amp;N') or starts-with($current-style-data,'&amp;A') or starts-with($current-style-data,'&amp;F') or starts-with($current-style-data,'&amp;Z')">
+ <xsl:call-template name="create-header-footer-style">
+ <xsl:with-param name="style-name-header" select="$style-name-header"/>
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="index" select="$index"/>
+ <xsl:with-param name="current-pos" select="$current-pos +2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;')">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">
+ <xsl:value-of select="concat($style-name-header,$index)"/>
+ </xsl:attribute>
+ <xsl:attribute name="style:family">text</xsl:attribute>
+ <xsl:element name="style:text-properties">
+ <xsl:call-template name="process-header-footer-style-properties">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ <xsl:variable name="next-style-header-pos">
+ <xsl:call-template name="get-current-content-pos">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="create-header-footer-style">
+ <xsl:with-param name="style-name-header" select="$style-name-header"/>
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="index" select="$index+1"/>
+ <xsl:with-param name="current-pos" select="$next-style-header-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains($current-style-data,'&amp;')">
+ <xsl:variable name="temp" select="substring-before($current-style-data,'&amp;')"/>
+ <xsl:call-template name="create-header-footer-style">
+ <xsl:with-param name="style-name-header" select="$style-name-header"/>
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="index" select="$index"/>
+ <xsl:with-param name="current-pos" select="string-length($temp)+$current-pos"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="process-header-footer-style-properties">
+ <xsl:param name="style-data"/>
+ <xsl:param name="current-pos"/>
+ <xsl:variable name="current-style-data">
+ <xsl:value-of select="substring($style-data,$current-pos)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <!-- stack operations necessary -->
+ <xsl:when test="starts-with($current-style-data,'&amp;&quot;')">
+ <xsl:attribute name="style:font-name">
+ <xsl:value-of select="substring-before(substring-after($current-style-data,'&amp;&quot;'),',')"/>
+ </xsl:attribute>
+ <xsl:if test="contains(substring-before(substring-after($current-style-data,','),'&quot;'),'Bold')">
+ <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="contains(substring-before(substring-after($current-style-data,','),'&quot;'),'Italic')">
+ <xsl:attribute name="fo:font-style">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="temp" select="substring-before(substring($style-data,$current-pos+2),'&quot;')"/>
+ <xsl:call-template name="process-header-footer-style-properties">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="string-length($temp)+$current-pos+3"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;0') or starts-with($current-style-data,'&amp;1') or starts-with($current-style-data,'&amp;2') or starts-with($current-style-data,'&amp;3') or starts-with($current-style-data,'&amp;4') or starts-with($current-style-data,'&amp;5') or starts-with($current-style-data,'&amp;6') or starts-with($current-style-data,'&amp;7') or starts-with($current-style-data,'&amp;8') or starts-with($current-style-data,'&amp;9')">
+ <xsl:variable name="font-size-length">
+ <xsl:call-template name="get-digit-length">
+ <xsl:with-param name="complexive-string" select="substring-after($current-style-data,'&amp;')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="fo:font-size">
+ <xsl:value-of select="concat(substring($current-style-data,2,$font-size-length),'pt')"/>
+ </xsl:attribute>
+ <xsl:call-template name="process-header-footer-style-properties">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos + 1 + $font-size-length"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- don't consider tangled or adjoined '&X' and '&Y', '&U' & '&E', processing-check is necessary, too complex. :( -->
+ <xsl:when test="starts-with($current-style-data,'&amp;X')">
+ <xsl:variable name="superscript-count-before">
+ <xsl:call-template name="get-substyle-count-in-data">
+ <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
+ <xsl:with-param name="substyle" select="'&amp;X'"/>
+ <xsl:with-param name="count" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$superscript-count-before mod 2 = 0">
+ <xsl:attribute name="style:text-position">33% 58%</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="process-header-footer-style-properties">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos + 2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;B')">
+ <xsl:variable name="subscript-count-before">
+ <xsl:call-template name="get-substyle-count-in-data">
+ <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
+ <xsl:with-param name="substyle" select="'&amp;B'"/>
+ <xsl:with-param name="count" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$subscript-count-before mod 2 = 0">
+ <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="process-header-footer-style-properties">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos + 2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;Y')">
+ <xsl:variable name="subscript-count-before">
+ <xsl:call-template name="get-substyle-count-in-data">
+ <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
+ <xsl:with-param name="substyle" select="'&amp;Y'"/>
+ <xsl:with-param name="count" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$subscript-count-before mod 2 = 0">
+ <xsl:attribute name="style:text-position">-33% 58%</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="process-header-footer-style-properties">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos + 2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;S')">
+ <xsl:variable name="strikethrough-count-before">
+ <xsl:call-template name="get-substyle-count-in-data">
+ <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
+ <xsl:with-param name="substyle" select="'&amp;S'"/>
+ <xsl:with-param name="count" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$strikethrough-count-before mod 2 = 0">
+ <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="process-header-footer-style-properties">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos + 2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;U')">
+ <xsl:variable name="single-underline-count-before">
+ <xsl:call-template name="get-substyle-count-in-data">
+ <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
+ <xsl:with-param name="substyle" select="'&amp;U'"/>
+ <xsl:with-param name="count" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$single-underline-count-before mod 2 = 0">
+ <xsl:attribute name="style:text-underline-type">single</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="process-header-footer-style-properties">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos + 2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;E')">
+ <xsl:variable name="double-underline-count-before">
+ <xsl:call-template name="get-substyle-count-in-data">
+ <xsl:with-param name="style-data" select="substring($style-data,1,$current-pos)"/>
+ <xsl:with-param name="substyle" select="'&amp;E'"/>
+ <xsl:with-param name="count" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$double-underline-count-before mod 2 = 0">
+ <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="process-header-footer-style-properties">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos + 2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-substyle-count-in-data">
+ <xsl:param name="style-data"/>
+ <xsl:param name="substyle"/>
+ <xsl:param name="count"/>
+ <xsl:choose>
+ <xsl:when test="contains($style-data,$substyle)">
+ <xsl:call-template name="get-substyle-count-in-data">
+ <xsl:with-param name="style-data" select="substring-after($style-data,$substyle)"/>
+ <xsl:with-param name="substyle" select="$substyle"/>
+ <xsl:with-param name="count" select="$count+1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$count"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-current-content-pos">
+ <xsl:param name="style-data"/>
+ <xsl:param name="current-pos"/>
+ <xsl:variable name="current-style-data">
+ <xsl:value-of select="substring($style-data,$current-pos)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with($current-style-data,'&amp;X') or starts-with($current-style-data,'&amp;Y') or starts-with($current-style-data,'&amp;S') or starts-with($current-style-data,'&amp;U') or starts-with($current-style-data,'&amp;E') or starts-with($current-style-data,'&amp;B')">
+ <xsl:call-template name="get-current-content-pos">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos+2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;0') or starts-with($current-style-data,'&amp;1') or starts-with($current-style-data,'&amp;2') or starts-with($current-style-data,'&amp;3') or starts-with($current-style-data,'&amp;4') or starts-with($current-style-data,'&amp;5') or starts-with($current-style-data,'&amp;6') or starts-with($current-style-data,'&amp;7') or starts-with($current-style-data,'&amp;8') or starts-with($current-style-data,'&amp;9')">
+ <xsl:variable name="font-size-length">
+ <xsl:call-template name="get-digit-length">
+ <xsl:with-param name="complexive-string" select="substring-after($current-style-data,'&amp;')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="get-current-content-pos">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="$current-pos+1+$font-size-length"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data,'&amp;&quot;')">
+ <xsl:variable name="temp" select="substring-before(substring($style-data,$current-pos+2),'&quot;')"/>
+ <xsl:call-template name="get-current-content-pos">
+ <xsl:with-param name="style-data" select="$style-data"/>
+ <xsl:with-param name="current-pos" select="string-length($temp)+$current-pos+3"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="starts-with($current-style-data, '&amp;')">
+ <xsl:value-of select="$current-pos + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$current-pos"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- OASIS OpenDocument Format change:
+ Excel "=RC4*6"
+ OOoXML "=$D22*6"
+ OASIS XML "oooc:=[.$D22]*6" -->
+ <xsl:template name="translate-expression">
+ <!-- return position or range for formula or other -->
+ <xsl:param name="cell-row-pos"/>
+ <!-- the position in row (vertical) of cell -->
+ <xsl:param name="cell-column-pos"/>
+ <!-- the position in column (horizontal of cell -->
+ <xsl:param name="expression"/>
+ <!-- recomposed expression containing cell positions after every conversion -->
+ <xsl:param name="is-range-mode" select="false()"/>
+ <!-- as mode changes a '[.' resp. ']' is written out -->
+ <xsl:param name="return-value"/>
+ <!-- expression of table:cell-range-address is different than formula (e.g. no prefix) -->
+ <xsl:param name="isRangeAddress"/>
+ <!-- determines if the currently processed expression is relative -->
+ <xsl:param name="isRelative" select="false()" />
+
+ <!-- value to be given out later -->
+ <!-- to judge whether this input expression contains any cell position to convert -->
+ <xsl:variable name="temp-range">
+ <xsl:choose>
+ <xsl:when test="$expression != ''">
+ <xsl:call-template name="parse-range-name">
+ <xsl:with-param name="expression" select="$expression"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- if $range-type = 1, then range is representing a sheet, function's name or separated symbol, but not cell position,
+ or if $range-type = 2, range should be handled because it contains certain cell position.
+ The first character marks the type of that expression. -->
+ <xsl:variable name="range-type">
+ <xsl:choose>
+ <xsl:when test="substring($temp-range, 1, 1) = '1'">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:when test="substring($temp-range, 1, 1) = '2'">
+ <xsl:value-of select="2"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- remove that added range type token -->
+ <xsl:variable name="current-range">
+ <xsl:value-of select="substring($temp-range, 2)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$range-type = 1">
+ <!-- Nothing to convert, so just join the front and behind strings. -->
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression">
+ <!-- get current converting position from $temp-token or $current-range, then join the expression. -->
+ <xsl:choose>
+ <xsl:when test="contains($current-range, '#$')">
+ <!-- because of recomposing of string, the $current-range may not be the pit
+ of $expression, so the char #$ should not be used for nominal -->
+ <xsl:variable name="temp-token">
+ <xsl:choose>
+ <xsl:when test="contains($current-range, '\')">
+ <xsl:value-of select="concat(']', substring-after($current-range, '#$'), &quot;&apos;&quot;)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($current-range, '#$')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="substring-after($expression, $temp-token)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($expression, $current-range)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="return-value">
+ <!-- react on range mode change (when to insert closing ']' or in case of '!' change the mode to RANGE and create open '[' -->
+ <xsl:choose>
+ <xsl:when test="$current-range = '=' and $return-value = '' and not($isRangeAddress)">
+ <xsl:text>oooc:=</xsl:text>
+ </xsl:when>
+ <xsl:when test="contains($current-range, '!') and not($isRangeAddress)">
+ <xsl:value-of select="concat($return-value, '[', $current-range)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$is-range-mode = 'true' and $current-range != ':' and not($isRangeAddress)">
+ <xsl:value-of select="concat($return-value, ']', substring-before($expression, $current-range), $current-range)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), $current-range)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="is-range-mode">
+ <xsl:choose>
+ <!-- ! is the separator of worksheet and range
+ : is the separator for a cell range -->
+ <xsl:when test="contains($current-range, '!') or $current-range = ':'">
+ <xsl:value-of select="true()"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="false()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- types of range to handle in $current-range, i.e. the cell position expression to convert
+ 1: special cell including row and column; e.g. R4C5
+ 2: whole row; e.g. R3
+ 3: whole column; e.g. C5
+ 4: other name not for cell or row/column; e.g. RANDOM() or something unknown
+ -->
+ <xsl:variable name="handle-type">
+ <xsl:choose>
+ <xsl:when test="starts-with($current-range, 'R')">
+ <!-- It's type 1 or type 2 or 4/unknown cell position. -->
+ <xsl:choose>
+ <xsl:when test="contains($current-range, 'C')">
+ <!-- It's type 1, specifying the cell position or 4/unknown -->
+ <xsl:variable name="part-type-r">
+ <xsl:call-template name="handle-type-number">
+ <xsl:with-param name="t-part" select="substring-before( substring-after($current-range, 'R'), 'C')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="part-type-c">
+ <xsl:call-template name="handle-type-number">
+ <xsl:with-param name="t-part" select="substring-after($current-range, 'C')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="($part-type-r = 1) and ($part-type-c = 1)">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="4"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- It's type 2 specifying the cell position, or 4/unknown. -->
+ <xsl:variable name="part-type">
+ <xsl:call-template name="handle-type-number">
+ <xsl:with-param name="t-part" select="substring-after($current-range, 'R')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$part-type = 1">
+ <xsl:value-of select="2"/>
+ </xsl:when>
+ <xsl:when test="$part-type = 2">
+ <xsl:value-of select="4"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="4"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="starts-with($current-range, 'C')">
+ <!-- It's type 3 of cell position, or 4/unknown -->
+ <xsl:variable name="part-type">
+ <xsl:call-template name="handle-type-number">
+ <xsl:with-param name="t-part" select="substring-after($current-range, 'C')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$part-type = 1">
+ <xsl:value-of select="3"/>
+ </xsl:when>
+ <xsl:when test="$part-type = 2">
+ <xsl:value-of select="4"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="4"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- It's type 4, not cell position -->
+ <xsl:value-of select="4"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Start to convert that cell position expression, that cell position unit -->
+ <xsl:choose>
+ <xsl:when test="$handle-type = 1">
+ <!-- It's type 1, e.g. R1C2 -->
+ <!-- process the row part -->
+ <xsl:variable name="after-R">
+ <xsl:value-of select="substring(substring-after($current-range,'R'),1,1)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <!-- found one cell unit -->
+ <xsl:when test="$after-R='C' or $after-R='[' or $after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
+ <xsl:variable name="row-pos">
+ <xsl:choose>
+ <xsl:when test="$after-R='['">
+ <xsl:value-of select="$cell-row-pos+substring-before( substring-after($current-range,'R['),']')"/>
+ </xsl:when>
+ <xsl:when test="$after-R='C'">
+ <xsl:value-of select="$cell-row-pos"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before(substring-after($current-range,'R'),'C')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="row-pos-style">
+ <xsl:choose>
+ <xsl:when test="$after-R='[' or $after-R='C'">relative</xsl:when>
+ <xsl:otherwise>absolute</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- process the column part -->
+ <xsl:variable name="after-C">
+ <xsl:value-of select="substring(substring-after(substring-after($current-range,'R'),'C'),1,1)"/>
+ </xsl:variable>
+ <xsl:variable name="column-digit-length">
+ <xsl:choose>
+ <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
+ <xsl:call-template name="get-digit-length">
+ <xsl:with-param name="complexive-string" select="substring-after(substring-after($current-range,'R'),'C')"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="column-pos">
+ <xsl:choose>
+ <xsl:when test="$after-C='['">
+ <xsl:value-of select="$cell-column-pos + substring-before(substring-after(substring-after($current-range,'R'),'C['),']')"/>
+ </xsl:when>
+ <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
+ <xsl:value-of select="substring(substring-after(substring-after($current-range,'R'),'C'),1,$column-digit-length)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$cell-column-pos"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="column-pos-style">
+ <xsl:choose>
+ <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">absolute</xsl:when>
+ <xsl:otherwise>relative</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="trans-unit">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="$column-pos"/>
+ <xsl:with-param name="row-number" select="$row-pos"/>
+ <xsl:with-param name="column-pos-style" select="$column-pos-style"/>
+ <xsl:with-param name="row-pos-style" select="$row-pos-style"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit)"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
+ <xsl:with-param name="return-value">
+ <xsl:choose>
+ <xsl:when test="$is-range-mode = 'true'">
+ <xsl:value-of select="concat($return-value, $name-unit)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="is-range-mode" select="true()"/>
+ <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before(substring-after($expression, '('),'R'),',!', ';.'))"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($current-range,'R')"/>
+ <xsl:with-param name="return-value">
+ <xsl:choose>
+ <xsl:when test="$is-range-mode = 'true'">
+ <xsl:value-of select="concat($return-value, $name-unit)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="is-range-mode" select="true()"/>
+ <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$handle-type = 2">
+ <!-- It's type 2, e.g. R3 -->
+ <!-- process the range only including a whole row -->
+ <xsl:variable name="after-R">
+ <xsl:value-of select="substring(substring-after($current-range,'R'),1,1)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$after-R='[' or $after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
+ <xsl:variable name="row-number">
+ <xsl:choose>
+ <xsl:when test="$after-R = '['">
+ <xsl:value-of select="substring-before(substring-after($current-range, 'R['), ']')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($current-range, 'R')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="row-pos">
+ <xsl:choose>
+ <xsl:when test="$after-R='['">
+ <xsl:value-of select="$cell-row-pos + $row-number"/>
+ </xsl:when>
+ <xsl:when test="$after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
+ <xsl:value-of select="$row-number"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$cell-row-pos"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="trans-unit1">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="1"/>
+ <xsl:with-param name="row-number" select="$row-pos"/>
+ <xsl:with-param name="column-pos-style" select="'relative'"/>
+ <xsl:with-param name="row-pos-style" select="'relative'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="trans-unit2">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="256"/>
+ <xsl:with-param name="row-number" select="$row-pos"/>
+ <xsl:with-param name="column-pos-style" select="'relative'"/>
+ <xsl:with-param name="row-pos-style" select="'relative'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit1, ':', $trans-unit2)"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
+ <xsl:with-param name="return-value">
+ <xsl:choose>
+ <xsl:when test="$is-range-mode = 'true'">
+ <xsl:value-of select="concat($return-value, $name-unit)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="is-range-mode" select="true()"/>
+ <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before($current-range,'R'),',!', ';.'),'R')"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($current-range,'R')"/>
+ <xsl:with-param name="return-value">
+ <xsl:choose>
+ <xsl:when test="$is-range-mode = 'true'">
+ <xsl:value-of select="concat($return-value, $name-unit)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="is-range-mode" select="true()"/>
+ <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$handle-type = 3">
+ <!-- It's type 3, e.g. C4 -->
+ <!-- process the range only including a whole column -->
+ <xsl:variable name="after-C">
+ <xsl:value-of select="substring(substring-after($current-range,'C'),1,1)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$after-C='[' or $after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
+ <xsl:variable name="column-number">
+ <xsl:choose>
+ <xsl:when test="$after-C = '['">
+ <xsl:value-of select="substring-before(substring-after($current-range, 'C['), ']')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($current-range, 'C')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="column-pos">
+ <xsl:choose>
+ <xsl:when test="$after-C='['">
+ <xsl:value-of select="$cell-column-pos + $column-number"/>
+ </xsl:when>
+ <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
+ <xsl:value-of select="$column-number"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$cell-column-pos"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="trans-unit1">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="$column-pos"/>
+ <xsl:with-param name="row-number" select="1"/>
+ <xsl:with-param name="column-pos-style" select="'relative'"/>
+ <xsl:with-param name="row-pos-style" select="'relative'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="trans-unit2">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="$column-pos"/>
+ <xsl:with-param name="row-number" select="65565"/>
+ <xsl:with-param name="column-pos-style" select="'relative'"/>
+ <xsl:with-param name="row-pos-style" select="'relative'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit1, ':', $trans-unit2)"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
+ <xsl:with-param name="return-value">
+ <xsl:choose>
+ <xsl:when test="$is-range-mode = 'true'">
+ <xsl:value-of select="concat($return-value, $name-unit)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="is-range-mode" select="true()"/>
+ <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before($current-range,'C'),',!', ';.'),'C')"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($current-range,'C')"/>
+ <xsl:with-param name="return-value">
+ <xsl:choose>
+ <xsl:when test="$is-range-mode = 'true'">
+ <xsl:value-of select="concat($return-value, $name-unit)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="is-range-mode" select="true()"/>
+ <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- It's unknown, so just jump over it -->
+ <xsl:variable name="next-pit" select="substring-after($expression, $current-range)"/>
+ <xsl:choose>
+ <xsl:when test="contains($next-pit, '+') or contains($next-pit, '-') or contains($next-pit, '*') or contains($next-pit, '/') or contains($next-pit, ')') or contains($next-pit, '^') or contains($next-pit, ':') or contains($next-pit, '&quot;') or contains($next-pit, ';') or contains($next-pit, ',') or contains($next-pit, '[')">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
+ <xsl:with-param name="return-value" select="concat($return-value, substring-before($expression, $current-range), $current-range)"/>
+ <xsl:with-param name="is-range-mode" select="false()"/>
+ <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- return the final range or formula -->
+ <xsl:choose>
+ <!-- in case the closing bracket of the range wasn't set, do it now -->
+ <xsl:when test="$is-range-mode = 'true' and $current-range = ''">
+ <xsl:value-of select="translate( concat($return-value, ']'),',!', ';.')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate( concat($return-value, substring-before($expression, $current-range), $current-range),',!', ';.')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="parse-range-name">
+ <!-- return the string or name for next handle. the type 1 is names of function, sheet, special separated symbol, not to parse as range; type 2 is the range including R/C to be parsed -->
+ <xsl:param name="expression"/>
+ <xsl:param name="return-value"/>
+ <xsl:variable name="first-one" select="substring($expression,1,1)"/>
+ <xsl:choose>
+ <xsl:when test="$first-one = '='">
+ <xsl:choose>
+ <xsl:when test="string-length(normalize-space($return-value)) &gt; 0">
+ <xsl:value-of select="concat('2', $return-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>1=</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$first-one='(' or $first-one='!' or $first-one='&amp;'">
+ <xsl:value-of select="concat('1', $return-value, $first-one)"/>
+ </xsl:when>
+ <xsl:when test="$first-one='['">
+ <xsl:choose>
+ <xsl:when test="starts-with(substring-after($expression, ']'), 'C')">
+ <xsl:call-template name="parse-range-name">
+ <xsl:with-param name="expression" select="substring-after($expression, ']')"/>
+ <xsl:with-param name="return-value" select="concat($return-value, substring-before($expression, ']'), ']')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains(substring-before($expression, ']'), '.') and contains(substring-after($expression, ']'), '!')">
+ <xsl:value-of select="concat('1', &quot;&apos;&quot;, substring-before(substring-after($expression, '['), ']'), &quot;&apos;&quot;, '#$', substring-before(substring-after($expression, ']'), '!'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('2', $return-value, substring-before($expression, ']'), ']')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$first-one='&quot;'">
+ <xsl:value-of select="concat('1', $first-one, substring-before(substring-after($expression, '&quot;'), '&quot;'), '&quot;')"/>
+ </xsl:when>
+ <xsl:when test="$first-one=&quot;&apos;&quot;">
+ <!-- here the string &quot;&apos;&quot; represents a char &apos; -->
+ <xsl:variable name="str-in" select="substring-before(substring-after($expression, &quot;&apos;&quot;), &quot;&apos;&quot;)"/>
+ <xsl:choose>
+ <!-- for file path transformation -->
+ <xsl:when test="contains($str-in, '\') and contains($str-in, '[') and contains($str-in, ']')">
+ <xsl:variable name="first-pos" select="substring-before($str-in, '[')"/>
+ <xsl:variable name="second-pos" select="substring-before(substring-after($str-in, '['), ']')"/>
+ <xsl:variable name="third-pos" select="substring-after($str-in, ']')"/>
+ <xsl:value-of select="concat('1', &quot;&apos;&quot;, $first-pos, $second-pos, &quot;&apos;&quot;, '#$', $third-pos)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('1', &quot;&apos;&quot;, $str-in, &quot;&apos;&quot;)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$first-one='+' or $first-one='-' or $first-one='*' or $first-one='/' or $first-one=')' or $first-one='^' or $first-one=':' or $first-one='&quot;' or $first-one=';' or $first-one=',' or $first-one='&gt;' or $first-one='&lt;'">
+ <xsl:choose>
+ <xsl:when test="$return-value = ''">
+ <xsl:value-of select="concat('1', $first-one)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('2', $return-value)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$expression = ''">
+ <xsl:value-of select="concat('2', $return-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="parse-range-name">
+ <xsl:with-param name="expression" select="substring($expression, 2, string-length($expression)-1)"/>
+ <xsl:with-param name="return-value" select="concat($return-value, substring($expression, 1, 1))"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="handle-type-number">
+ <!-- to handle the part between R and C, or after C in range string in translate-expression. return type: 1: number or cell range; 2: other, not for next step -->
+ <xsl:param name="t-part"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($t-part, '[')">
+ <xsl:variable name="tt-str" select="substring-before( substring-after( $t-part, '['), ']')"/>
+ <xsl:choose>
+ <xsl:when test="($tt-str &lt; 0) or ($tt-str &gt; 0) or ($tt-str = 0)">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="($t-part &lt; 0) or ($t-part &gt; 0) or ($t-part = 0)">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:when test="$t-part = ''">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="translate-unit">
+ <!-- convert cell position expression unit, R1C1, R3, C4 -->
+ <xsl:param name="column-number"/>
+ <xsl:param name="row-number"/>
+ <xsl:param name="column-pos-style"/>
+ <xsl:param name="row-pos-style"/>
+ <xsl:variable name="column-number1">
+ <xsl:value-of select="floor( $column-number div 26 )"/>
+ </xsl:variable>
+ <xsl:variable name="column-number2">
+ <xsl:value-of select="$column-number mod 26"/>
+ </xsl:variable>
+ <xsl:variable name="column-character1">
+ <xsl:call-template name="number-to-character">
+ <xsl:with-param name="number" select="$column-number1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="column-character2">
+ <xsl:call-template name="number-to-character">
+ <xsl:with-param name="number" select="$column-number2"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- position styles are 'absolute' or 'relative', -->
+ <xsl:choose>
+ <xsl:when test="$column-pos-style = 'absolute'">
+ <xsl:value-of select="concat( '$', $column-character1, $column-character2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat( $column-character1, $column-character2)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="$row-pos-style ='absolute'">
+ <xsl:value-of select="concat( '$', $row-number)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$row-number"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="number-to-character">
+ <xsl:param name="number"/>
+ <xsl:choose>
+ <xsl:when test="$number = 0"/>
+ <xsl:when test="$number = 1">A</xsl:when>
+ <xsl:when test="$number = 2">B</xsl:when>
+ <xsl:when test="$number = 3">C</xsl:when>
+ <xsl:when test="$number = 4">D</xsl:when>
+ <xsl:when test="$number = 5">E</xsl:when>
+ <xsl:when test="$number = 6">F</xsl:when>
+ <xsl:when test="$number = 7">G</xsl:when>
+ <xsl:when test="$number = 8">H</xsl:when>
+ <xsl:when test="$number = 9">I</xsl:when>
+ <xsl:when test="$number = 10">J</xsl:when>
+ <xsl:when test="$number = 11">K</xsl:when>
+ <xsl:when test="$number = 12">L</xsl:when>
+ <xsl:when test="$number = 13">M</xsl:when>
+ <xsl:when test="$number = 14">N</xsl:when>
+ <xsl:when test="$number = 15">O</xsl:when>
+ <xsl:when test="$number = 16">P</xsl:when>
+ <xsl:when test="$number = 17">Q</xsl:when>
+ <xsl:when test="$number = 18">R</xsl:when>
+ <xsl:when test="$number = 19">S</xsl:when>
+ <xsl:when test="$number = 20">T</xsl:when>
+ <xsl:when test="$number = 21">U</xsl:when>
+ <xsl:when test="$number = 22">V</xsl:when>
+ <xsl:when test="$number = 23">W</xsl:when>
+ <xsl:when test="$number = 24">X</xsl:when>
+ <xsl:when test="$number = 25">Y</xsl:when>
+ <xsl:when test="$number = 26">Z</xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-digit-length">
+ <xsl:param name="complexive-string"/>
+ <xsl:variable name="first-char">
+ <xsl:value-of select="substring( $complexive-string, 1, 1)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-char = '1' or $first-char = '2' or $first-char = '3' or $first-char = '4' or $first-char = '5' or $first-char = '6' or $first-char = '7' or $first-char = '8' or $first-char = '9' or $first-char = '0' ">
+ <xsl:variable name="temp">
+ <xsl:call-template name="get-digit-length">
+ <xsl:with-param name="complexive-string" select="substring( $complexive-string, 2)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$temp+1"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="ss:Comment" mode="body">
+ <xsl:element name="office:annotation">
+ <xsl:if test="@ss:ShowAlways = '1'">
+ <xsl:attribute name="office:display">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@ss:Author">
+ <xsl:element name="dc:creator">
+ <xsl:value-of select="@ss:Author"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="ss:Data">
+ <text:p>
+ <xsl:call-template name="create-data-content">
+ <xsl:with-param name="style-id" select="@ss:StyleID"/>
+ </xsl:call-template>
+ </text:p>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Names">
+ <xsl:variable name="namedRanges" select="/ss:Workbook/ss:Worksheet/ss:Names/ss:NamedRange |
+ /ss:Workbook/ss:Names/ss:NamedRange" />
+ <xsl:if test="$namedRanges">
+ <table:named-expressions>
+ <xsl:for-each select="$namedRanges">
+ <xsl:choose>
+ <xsl:when test="contains( @ss:RefersTo, '!R')">
+ <xsl:variable name="referto">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="isRangeAddress" select="true()"/>
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="@ss:RefersTo"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:element name="table:named-range">
+ <xsl:attribute name="table:name">
+ <xsl:value-of select="@ss:Name"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:base-cell-address">
+ <xsl:variable name="worksheetName" select="translate(substring-before(@ss:RefersTo, '!'), '=', '$')" />
+ <xsl:call-template name="encode-as-cell-address">
+ <xsl:with-param name="string" select="concat($worksheetName,'.$A$1')"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:attribute name="table:cell-range-address">
+ <xsl:call-template name="encode-as-cell-range-address">
+ <xsl:with-param name="string" select="translate( $referto, '=', '$')"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:if test="@ss:Name = 'Print_Area'">
+ <xsl:attribute name="table:range-usable-as">print-range</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="expression-name">
+ <xsl:value-of select="@ss:Name"/>
+ </xsl:variable>
+ <xsl:element name="table:named-expression">
+ <xsl:attribute name="table:name">
+ <xsl:value-of select="@ss:Name"/>
+ </xsl:attribute>
+ <!-- just set '$Sheet1.$A$1' as named-expressions virtual base-cell-address -->
+ <xsl:attribute name="table:base-cell-address">
+ <xsl:variable name="worksheetName" select="following-sibling::ss:Worksheet/@ss:Name" />
+ <xsl:call-template name="encode-as-cell-address">
+ <xsl:with-param name="string" select="concat('$', $worksheetName,'.$A$1')"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:attribute name="table:expression">
+ <xsl:value-of select="substring( @ss:RefersTo, 2)"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </table:named-expressions>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="transform-advanced-filter">
+ <!-- transform the params of Advanced Filter.it's different from AutoFilter -->
+ <xsl:param name="target-value"/>
+ <xsl:param name="condition-pos"/>
+ <xsl:element name="table:database-range">
+ <xsl:variable name="target-range">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="$target-value"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="condition-range">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="$condition-pos"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="table:target-range-address">
+ <xsl:value-of select="$target-range"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:name">
+ <xsl:value-of select="concat($target-range, '.filter')"/>
+ </xsl:attribute>
+ <xsl:element name="table:filter">
+ <xsl:attribute name="table:condition-source-range-address">
+ <xsl:value-of select="$condition-range"/>
+ </xsl:attribute>
+ <xsl:element name="table:filter-condition">
+ <xsl:attribute name="table:field-number">0</xsl:attribute>
+ <!-- The two attributes are recommended by OASIS -->
+ <xsl:attribute name="table:value"/>
+ <xsl:attribute name="table:operator"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="x:AutoFilter">
+ <!-- for AutoFilter -->
+ <xsl:element name="table:database-range">
+ <xsl:attribute name="table:name">
+ <xsl:value-of select="concat(../@ss:Name,'_',@x:Range)"/>
+ </xsl:attribute>
+ <xsl:variable name="range">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="@x:Range"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="table:target-range-address">
+ <xsl:value-of select="concat('$',../@ss:Name,'.',$range)"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:display-filter-buttons">true</xsl:attribute>
+ <xsl:element name="table:filter">
+ <xsl:call-template name="auto-filter-condition">
+ <xsl:with-param name="item-pos" select="1"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="total" select="count(./x:AutoFilterColumn)"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="auto-filter-condition">
+ <!--?? generate element of filter-condition for AutoCondition to get position of index -->
+ <xsl:param name="item-pos"/>
+ <xsl:param name="index"/>
+ <xsl:param name="total"/>
+ <xsl:if test="($index - 1 &lt; $total) or ($index - 1 = $total)">
+ <xsl:element name="table:filter-condition">
+ <xsl:attribute name="table:data-type">number</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'TopPercent'">
+ <xsl:attribute name="table:operator">
+ <xsl:value-of select="'top value'"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:value">
+ <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Value"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'Top'">
+ <xsl:attribute name="table:operator">
+ <xsl:value-of select="'top values'"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:value">
+ <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Value"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'TopPercent'">
+ <xsl:attribute name="table:operator">
+ <xsl:value-of select="'top percent'"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:value">
+ <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Value"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'Bottom'">
+ <xsl:attribute name="table:operator">
+ <xsl:value-of select="'bottom values'"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:value">
+ <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Value"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'BottomPercent'">
+ <xsl:attribute name="table:operator">
+ <xsl:value-of select="'bottom percent'"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:value">
+ <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Value"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'Custom'">
+ <xsl:choose>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/x:AutoFilterOr or ./x:AutoFilterColumn[position() = $item-pos]/x:AutoFilterAnd">
+ <xsl:attribute name="table:operator">
+ <xsl:choose>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'Equals'">
+ <xsl:value-of select="'='"/>
+ </xsl:when>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'DoesNotEquals'">
+ <xsl:value-of select="'!='"/>
+ </xsl:when>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'GreaterThan'">
+ <xsl:value-of select="'&gt;'"/>
+ </xsl:when>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'GreaterThanOrEqual'">
+ <xsl:value-of select="'&gt;='"/>
+ </xsl:when>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'LessThan'">
+ <xsl:value-of select="'&lt;'"/>
+ </xsl:when>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'LessThanOrEqual'">
+ <xsl:value-of select="'&lt;='"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'='"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="table:value">
+ <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]//@x:Value"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:operator">
+ <xsl:value-of select="'bottom percent'"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:value">
+ <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]//@x:Value"/>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:attribute name="table:field-number">
+ <xsl:choose>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Index">
+ <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Index - 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$index - 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="auto-filter-condition">
+ <xsl:with-param name="item-pos" select="$item-pos + 1"/>
+ <xsl:with-param name="index">
+ <xsl:choose>
+ <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Index">
+ <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Index + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$index + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="total" select="count(./x:AutoFilterColumn)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="x:Sorting">
+ <!-- for Sorting don't contains header row -->
+ <xsl:if test="contains(./x:Sort, 'Column')">
+ <xsl:element name="table:database-range">
+ <xsl:variable name="first-sort-letter" select="normalize-space(substring-after(./x:Sort[position() = 1], 'Column'))"/>
+ <xsl:variable name="second-sort-letter" select="normalize-space(substring-after(./x:Sort[position() = 2], 'Column'))"/>
+ <xsl:variable name="third-sort-letter" select="normalize-space(substring-after(./x:Sort[position() = 3], 'Column'))"/>
+ <xsl:variable name="first-sort-num">
+ <xsl:call-template name="letter-to-number">
+ <xsl:with-param name="source-letter" select="$first-sort-letter"/>
+ <xsl:with-param name="return-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="second-sort-num">
+ <xsl:call-template name="letter-to-number">
+ <xsl:with-param name="source-letter" select="$second-sort-letter"/>
+ <xsl:with-param name="return-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="third-sort-num">
+ <xsl:call-template name="letter-to-number">
+ <xsl:with-param name="source-letter" select="$third-sort-letter"/>
+ <xsl:with-param name="return-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="min-left-num">
+ <xsl:call-template name="min-of-three">
+ <xsl:with-param name="first-num" select="$first-sort-num"/>
+ <xsl:with-param name="second-num" select="$second-sort-num"/>
+ <xsl:with-param name="third-num" select="$third-sort-num"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="max-right-num">
+ <xsl:call-template name="max-of-three">
+ <xsl:with-param name="first-num" select="$first-sort-num"/>
+ <xsl:with-param name="second-num" select="$second-sort-num"/>
+ <xsl:with-param name="third-num" select="$third-sort-num"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="left-column">
+ <xsl:call-template name="number-to-letter">
+ <xsl:with-param name="source-number" select="$min-left-num"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="right-column">
+ <xsl:call-template name="number-to-letter">
+ <xsl:with-param name="source-number" select="$max-right-num"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="table:target-range-address">
+ <xsl:value-of select="concat(../@ss:Name, '.', $left-column, '1:', ../@ss:Name, '.', $right-column, '32000')"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:name">
+ <xsl:value-of select="concat(../@ss:Name, '.sort')"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:contains-header">
+ <xsl:value-of select="'false'"/>
+ </xsl:attribute>
+ <xsl:element name="table:sort">
+ <xsl:for-each select="./x:Sort">
+ <xsl:element name="table:sort-by">
+ <xsl:attribute name="table:field-number">
+ <xsl:value-of select="0"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:data-type">
+ <xsl:value-of select="'automatic'"/>
+ </xsl:attribute>
+ <xsl:variable name="after-sort" select="following-sibling::*"/>
+ <xsl:if test="name($after-sort[position() = 1]) = 'Descending'">
+ <xsl:attribute name="table:order">
+ <xsl:value-of select="'descending'"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="position() = 1">
+ <xsl:attribute name="table:field-number">
+ <xsl:value-of select="$first-sort-num - $min-left-num"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="position() = 2">
+ <xsl:attribute name="table:field-number">
+ <xsl:value-of select="$second-sort-num - $min-left-num"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:when test="position() = 3">
+ <xsl:attribute name="table:field-number">
+ <xsl:value-of select="$third-sort-num - $min-left-num"/>
+ </xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="letter-to-number">
+ <!-- convert letter to number for sorting. the string source-letter should be normalize-space and the first return-value should be zero -->
+ <xsl:param name="source-letter"/>
+ <xsl:param name="return-value"/>
+ <xsl:choose>
+ <xsl:when test="string-length($source-letter) &gt; 0">
+ <xsl:variable name="first-pit" select="substring($source-letter, 1, 1)"/>
+ <xsl:variable name="pit-number">
+ <xsl:choose>
+ <xsl:when test="($first-pit = 'A') or ($first-pit = 'a')">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'B') or ($first-pit = 'b')">
+ <xsl:value-of select="2"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'C') or ($first-pit = 'c')">
+ <xsl:value-of select="3"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'D') or ($first-pit = 'd')">
+ <xsl:value-of select="4"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'E') or ($first-pit = 'e')">
+ <xsl:value-of select="5"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'F') or ($first-pit = 'f')">
+ <xsl:value-of select="6"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'G') or ($first-pit = 'g')">
+ <xsl:value-of select="7"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'H') or ($first-pit = 'h')">
+ <xsl:value-of select="8"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'I') or ($first-pit = 'i')">
+ <xsl:value-of select="9"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'J') or ($first-pit = 'j')">
+ <xsl:value-of select="10"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'K') or ($first-pit = 'k')">
+ <xsl:value-of select="11"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'L') or ($first-pit = 'l')">
+ <xsl:value-of select="12"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'M') or ($first-pit = 'm')">
+ <xsl:value-of select="13"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'N') or ($first-pit = 'n')">
+ <xsl:value-of select="14"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'O') or ($first-pit = 'o')">
+ <xsl:value-of select="15"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'P') or ($first-pit = 'p')">
+ <xsl:value-of select="16"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'Q') or ($first-pit = 'q')">
+ <xsl:value-of select="17"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'R') or ($first-pit = 'r')">
+ <xsl:value-of select="18"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'S') or ($first-pit = 's')">
+ <xsl:value-of select="19"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'T') or ($first-pit = 't')">
+ <xsl:value-of select="20"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'U') or ($first-pit = 'u')">
+ <xsl:value-of select="21"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'V') or ($first-pit = 'v')">
+ <xsl:value-of select="22"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'W') or ($first-pit = 'w')">
+ <xsl:value-of select="23"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'X') or ($first-pit = 'x')">
+ <xsl:value-of select="24"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'Y') or ($first-pit = 'y')">
+ <xsl:value-of select="25"/>
+ </xsl:when>
+ <xsl:when test="($first-pit = 'Z') or ($first-pit = 'z')">
+ <xsl:value-of select="26"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="letter-to-number">
+ <xsl:with-param name="source-letter" select="substring($source-letter, 2)"/>
+ <xsl:with-param name="return-value">
+ <xsl:choose>
+ <xsl:when test="string-length($source-letter) &gt;= 2">
+ <xsl:value-of select="$pit-number * 26 + $return-value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$pit-number + $return-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$return-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="number-to-letter">
+ <!--?? convert number to letter for sorting -->
+ <xsl:param name="source-number"/>
+ <xsl:param name="return-value"/>
+ <xsl:variable name="current-value">
+ <xsl:call-template name="num-conv-letter">
+ <xsl:with-param name="first-pit">
+ <xsl:choose>
+ <xsl:when test="$source-number &gt; 26">
+ <xsl:value-of select="floor($source-number div 26)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$source-number"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$source-number &gt; 26">
+ <xsl:call-template name="number-to-letter">
+ <xsl:with-param name="source-number" select="$source-number mod 26"/>
+ <xsl:with-param name="return-value" select="concat($return-value,$current-value)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$source-number &lt; 27">
+ <xsl:value-of select="concat($return-value,$current-value)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="num-conv-letter">
+ <!-- convert number to number by pit of 26 -->
+ <xsl:param name="first-pit"/>
+ <xsl:choose>
+ <xsl:when test="$first-pit = 1">
+ <xsl:value-of select="'A'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 2">
+ <xsl:value-of select="'B'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 3">
+ <xsl:value-of select="'C'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 4">
+ <xsl:value-of select="'D'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 5">
+ <xsl:value-of select="'E'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 6">
+ <xsl:value-of select="'F'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 7">
+ <xsl:value-of select="'G'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 8">
+ <xsl:value-of select="'H'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 9">
+ <xsl:value-of select="'I'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 10">
+ <xsl:value-of select="'J'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 11">
+ <xsl:value-of select="'K'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 12">
+ <xsl:value-of select="'L'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 13">
+ <xsl:value-of select="'M'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 14">
+ <xsl:value-of select="'N'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 15">
+ <xsl:value-of select="'O'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 16">
+ <xsl:value-of select="'P'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 17">
+ <xsl:value-of select="'Q'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 18">
+ <xsl:value-of select="'R'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 19">
+ <xsl:value-of select="'S'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 20">
+ <xsl:value-of select="'T'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 21">
+ <xsl:value-of select="'U'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 22">
+ <xsl:value-of select="'V'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 23">
+ <xsl:value-of select="'W'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 24">
+ <xsl:value-of select="'X'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 25">
+ <xsl:value-of select="'Y'"/>
+ </xsl:when>
+ <xsl:when test="$first-pit = 26">
+ <xsl:value-of select="'Z'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'A'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="min-of-three">
+ <!-- return minest of three for sorting -->
+ <xsl:param name="first-num"/>
+ <xsl:param name="second-num"/>
+ <xsl:param name="third-num"/>
+ <xsl:variable name="first-comp">
+ <xsl:choose>
+ <xsl:when test="$first-num = 0">
+ <xsl:value-of select="$second-num"/>
+ </xsl:when>
+ <xsl:when test="($first-num &lt; $second-num) or ($second-num = 0)">
+ <xsl:value-of select="$first-num"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$second-num"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="second-comp">
+ <xsl:choose>
+ <xsl:when test="($first-comp &lt; $third-num) or ($third-num = 0)">
+ <xsl:value-of select="$first-comp"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$third-num"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="$second-comp"/>
+ </xsl:template>
+ <xsl:template name="max-of-three">
+ <!-- return maxest of three for sorting -->
+ <xsl:param name="first-num"/>
+ <xsl:param name="second-num"/>
+ <xsl:param name="third-num"/>
+ <xsl:variable name="first-comp">
+ <xsl:choose>
+ <xsl:when test="$first-num &gt; $second-num">
+ <xsl:value-of select="$first-num"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$second-num"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="second-comp">
+ <xsl:choose>
+ <xsl:when test="$first-comp &gt; $third-num">
+ <xsl:value-of select="$first-comp"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$third-num"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="$second-comp"/>
+ </xsl:template>
+ <xsl:template name="set-calculation">
+ <xsl:element name="table:calculation-settings">
+ <xsl:if test="/ss:Workbook/x:ExcelWorkbook/x:PrecisionAsDisplayed">
+ <xsl:attribute name="table:precision-as-shown">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="/ss:Workbook/x:ExcelWorkbook/x:Date1904">
+ <table:null-date office:date-value="1904-01-01"/>
+ </xsl:if>
+ <xsl:element name="table:iteration">
+ <xsl:if test="/ss:Workbook/x:ExcelWorkbook/x:Iteration">
+ <xsl:attribute name="table:status">enable</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="/ss:Workbook/x:ExcelWorkbook/x:MaxIterations">
+ <xsl:attribute name="table:steps">
+ <xsl:value-of select="/ss:Workbook/x:ExcelWorkbook/x:MaxIterations"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="/ss:Workbook/x:ExcelWorkbook/x:MaxChange">
+ <xsl:attribute name="table:maximum-difference">
+ <xsl:value-of select="/ss:Workbook/x:ExcelWorkbook/x:MaxChange"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="x:DataValidation">
+ <!-- for DataValidation. don't support the attribute IMEMode currently. -->
+ <xsl:element name="table:content-validation">
+ <xsl:attribute name="table:name">
+ <xsl:value-of select="concat('val', position())"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:condition"><!-- don't support two type of qualifier: List, Custom -->
+ <xsl:variable name="qualifier-content">
+ <xsl:choose>
+ <xsl:when test="./x:Qualifier = 'NotBetween'">
+ <xsl:value-of select="concat('cell-content-is-not-between(', ./x:Min, ',', ./x:Max, ')')"/>
+ </xsl:when>
+ <xsl:when test="./x:Qualifier = 'NotEqual'">
+ <xsl:value-of select="concat('!=', ./x:Value)"/>
+ </xsl:when>
+ <xsl:when test="./x:Qualifier = 'Equal'">
+ <xsl:value-of select="concat('=', ./x:Value)"/>
+ </xsl:when>
+ <xsl:when test="./x:Qualifier = 'Less'">
+ <xsl:value-of select="concat('&lt;', ./x:Value)"/>
+ </xsl:when>
+ <xsl:when test="./x:Qualifier = 'Greater'">
+ <xsl:value-of select="concat('&gt;', ./x:Value)"/>
+ </xsl:when>
+ <xsl:when test="./x:Qualifier = 'GreaterOrEqual'">
+ <xsl:value-of select="concat('&gt;=', ./x:Value)"/>
+ </xsl:when>
+ <xsl:when test="./x:Qualifier = 'LessOrEqual'">
+ <xsl:value-of select="concat('&lt;=', ./x:Value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('cell-content-is-between(', ./x:Min, ',', ./x:Max)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="qualifier-value">
+ <xsl:choose>
+ <xsl:when test="./x:Type = 'Whole'">
+ <xsl:choose>
+ <xsl:when test="(./x:Qualifier = 'NotBetween') or ./x:Max">
+ <xsl:value-of select="concat('cell-content-is-whole-number() and ', $qualifier-content, ')')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('cell-content-is-whole-number() and ', 'cell-content()', $qualifier-content)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="./x:Type = 'Decimal'">
+ <xsl:choose>
+ <xsl:when test="(./x:Qualifier = 'NotBetween') or ./x:Max">
+ <xsl:value-of select="concat('cell-content-is-decimal-number() and ', $qualifier-content, ')')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('cell-content-is-decimal-number() and ', 'cell-content()', $qualifier-content)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="./x:Type = 'Date'">
+ <xsl:choose>
+ <xsl:when test="(./x:Qualifier = 'NotBetween') or ./x:Max">
+ <xsl:value-of select="concat('cell-content-is-date() and ', $qualifier-content, ')')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('cell-content-is-date() and ', 'cell-content()', $qualifier-content)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="./x:Type = 'Time'">
+ <xsl:choose>
+ <xsl:when test="(./x:Qualifier = 'NotBetween') or ./x:Max">
+ <xsl:value-of select="concat('cell-content-is-time() and ', $qualifier-content, ')')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('cell-content-is-time() and ', 'cell-content()', $qualifier-content)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="./x:Type = 'TextLength'">
+ <xsl:choose>
+ <xsl:when test="./x:Qualifier = 'NotBetween'">
+ <xsl:value-of select="concat('cell-content-text-length-is-not-between(', ./x:Min, ',', ./x:Max, ')')"/>
+ </xsl:when>
+ <xsl:when test="./x:Max and ./x:Min">
+ <xsl:value-of select="concat('cell-content-text-length-is-between(', ./x:Min, ',', ./x:Max, ')')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('cell-content-text-length()', $qualifier-content)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./x:Type"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="$qualifier-value"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:base-cell-address">
+ <xsl:variable name="first-range">
+ <xsl:choose>
+ <xsl:when test="contains(./x:Range, ',')">
+ <xsl:value-of select="substring-before(./x:Range, ',')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./x:Range"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="range">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="$first-range"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="encode-as-cell-address">
+ <xsl:with-param name="string" select="concat(../../ss:Worksheet/@ss:Name, '.', $range)"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:element name="table:help-message">
+ <xsl:attribute name="table:title">
+ <xsl:value-of select="./x:InputTitle"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:display">
+ <xsl:choose>
+ <xsl:when test="./x:InputHide">
+ <xsl:value-of select="'false'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'true'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:element name="text:p">
+ <xsl:value-of select="./x:InputMessage"/>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="table:error-message">
+ <xsl:attribute name="table:message-type">
+ <xsl:choose>
+ <xsl:when test="./x:ErrorStyle= 'Info'">
+ <xsl:value-of select="'information'"/>
+ </xsl:when>
+ <xsl:when test="./x:ErrorStyle= 'Warn'">
+ <xsl:value-of select="'warning'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'stop'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="table:title">
+ <xsl:value-of select="./x:ErrorTitle"/>
+ </xsl:attribute>
+ <xsl:attribute name="table:display">
+ <xsl:choose>
+ <xsl:when test="./x:ErrorHide">
+ <xsl:value-of select="'false'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'true'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:element name="text:p">
+ <xsl:value-of select="./x:ErrorMessage"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <!-- Note: Move template to common section -->
+ <xsl:template name="encode-as-cell-range-address">
+ <xsl:param name="string"/>
+ <xsl:value-of select="$string"/>
+ </xsl:template>
+ <xsl:template name="encode-as-cell-address">
+ <xsl:param name="string"/>
+ <xsl:value-of select="$string"/>
+ </xsl:template>
+ <xsl:template name="encode-as-nc-name">
+ <xsl:param name="string"/>
+ <xsl:value-of select="translate($string, '.%()/\+[]', '')"/>
+ </xsl:template>
+
+ <xsl:template name="set:distinct">
+ <xsl:param name="nodes" select="/.."/>
+ <xsl:param name="distinct" select="/.."/>
+ <xsl:choose>
+ <xsl:when test="$nodes">
+ <xsl:call-template name="set:distinct">
+ <xsl:with-param name="distinct" select="$distinct | $nodes[1][not(. = $distinct)]"/>
+ <xsl:with-param name="nodes" select="$nodes[position() > 1]"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$distinct" mode="set:distinct"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="node()|@*" mode="set:distinct">
+ <xsl:copy-of select="." />
+ </xsl:template>
- <!-- value to be given out later -->
- <!-- to judge whether this input expression contains any cell position to convert -->
- <xsl:variable name="temp-range">
- <xsl:choose>
- <xsl:when test="$expression != ''">
- <xsl:call-template name="parse-range-name">
- <xsl:with-param name="expression" select="$expression"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- if $range-type = 1, then range is representing a sheet, function's name or separated symbol, but not cell position,
- or if $range-type = 2, range should be handled because it contains certain cell position.
- The first character marks the type of that expression. -->
- <xsl:variable name="range-type">
- <xsl:choose>
- <xsl:when test="substring($temp-range, 1, 1) = '1'">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:when test="substring($temp-range, 1, 1) = '2'">
- <xsl:value-of select="2"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- remove that added range type token -->
- <xsl:variable name="current-range">
- <xsl:value-of select="substring($temp-range, 2)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$range-type = 1">
- <!-- Nothing to convert, so just join the front and behind strings. -->
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression">
- <!-- get current converting position from $temp-token or $current-range, then join the expression. -->
- <xsl:choose>
- <xsl:when test="contains($current-range, '#$')">
- <!-- because of recomposing of string, the $current-range may not be the pit
- of $expression, so the char #$ should not be used for nominal -->
- <xsl:variable name="temp-token">
- <xsl:choose>
- <xsl:when test="contains($current-range, '\')">
- <xsl:value-of select="concat(']', substring-after($current-range, '#$'), &quot;&apos;&quot;)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after($current-range, '#$')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="substring-after($expression, $temp-token)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after($expression, $current-range)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="return-value">
- <!-- react on range mode change (when to insert closing ']' or in case of '!' change the mode to RANGE and create open '[' -->
- <xsl:choose>
- <xsl:when test="$current-range = '=' and $return-value = '' and not($isRangeAddress)">
- <xsl:text>oooc:=</xsl:text>
- </xsl:when>
- <xsl:when test="contains($current-range, '!') and not($isRangeAddress)">
- <xsl:value-of select="concat($return-value, '[', $current-range)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$is-range-mode = 'true' and $current-range != ':' and not($isRangeAddress)">
- <xsl:value-of select="concat($return-value, ']', substring-before($expression, $current-range), $current-range)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), $current-range)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="is-range-mode">
- <xsl:choose>
- <!-- ! is the separator of worksheet and range
- : is the separator for a cell range -->
- <xsl:when test="contains($current-range, '!') or $current-range = ':'">
- <xsl:value-of select="true()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="false()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- types of range to handle in $current-range, i.e. the cell position expression to convert
- 1: special cell including row and column; e.g. R4C5
- 2: whole row; e.g. R3
- 3: whole column; e.g. C5
- 4: other name not for cell or row/column; e.g. RANDOM() or something unknown
- -->
- <xsl:variable name="handle-type">
- <xsl:choose>
- <xsl:when test="starts-with($current-range, 'R')">
- <!-- It's type 1 or type 2 or 4/unknown cell position. -->
- <xsl:choose>
- <xsl:when test="contains($current-range, 'C')">
- <!-- It's type 1, specifying the cell position or 4/unknown -->
- <xsl:variable name="part-type-r">
- <xsl:call-template name="handle-type-number">
- <xsl:with-param name="t-part" select="substring-before( substring-after($current-range, 'R'), 'C')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="part-type-c">
- <xsl:call-template name="handle-type-number">
- <xsl:with-param name="t-part" select="substring-after($current-range, 'C')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="($part-type-r = 1) and ($part-type-c = 1)">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="4"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- It's type 2 specifying the cell position, or 4/unknown. -->
- <xsl:variable name="part-type">
- <xsl:call-template name="handle-type-number">
- <xsl:with-param name="t-part" select="substring-after($current-range, 'R')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$part-type = 1">
- <xsl:value-of select="2"/>
- </xsl:when>
- <xsl:when test="$part-type = 2">
- <xsl:value-of select="4"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="4"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="starts-with($current-range, 'C')">
- <!-- It's type 3 of cell position, or 4/unknown -->
- <xsl:variable name="part-type">
- <xsl:call-template name="handle-type-number">
- <xsl:with-param name="t-part" select="substring-after($current-range, 'C')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$part-type = 1">
- <xsl:value-of select="3"/>
- </xsl:when>
- <xsl:when test="$part-type = 2">
- <xsl:value-of select="4"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="4"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- It's type 4, not cell position -->
- <xsl:value-of select="4"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Start to convert that cell position expression, that cell position unit -->
- <xsl:choose>
- <xsl:when test="$handle-type = 1">
- <!-- It's type 1, e.g. R1C2 -->
- <!-- process the row part -->
- <xsl:variable name="after-R">
- <xsl:value-of select="substring(substring-after($current-range,'R'),1,1)"/>
- </xsl:variable>
- <xsl:choose>
- <!-- found one cell unit -->
- <xsl:when test="$after-R='C' or $after-R='[' or $after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
- <xsl:variable name="row-pos">
- <xsl:choose>
- <xsl:when test="$after-R='['">
- <xsl:value-of select="$cell-row-pos+substring-before( substring-after($current-range,'R['),']')"/>
- </xsl:when>
- <xsl:when test="$after-R='C'">
- <xsl:value-of select="$cell-row-pos"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before(substring-after($current-range,'R'),'C')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="row-pos-style">
- <xsl:choose>
- <xsl:when test="$after-R='[' or $after-R='C'">relative</xsl:when>
- <xsl:otherwise>absolute</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- process the column part -->
- <xsl:variable name="after-C">
- <xsl:value-of select="substring(substring-after(substring-after($current-range,'R'),'C'),1,1)"/>
- </xsl:variable>
- <xsl:variable name="column-digit-length">
- <xsl:choose>
- <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
- <xsl:call-template name="get-digit-length">
- <xsl:with-param name="complexive-string" select="substring-after(substring-after($current-range,'R'),'C')"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="column-pos">
- <xsl:choose>
- <xsl:when test="$after-C='['">
- <xsl:value-of select="$cell-column-pos + substring-before(substring-after(substring-after($current-range,'R'),'C['),']')"/>
- </xsl:when>
- <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
- <xsl:value-of select="substring(substring-after(substring-after($current-range,'R'),'C'),1,$column-digit-length)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$cell-column-pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="column-pos-style">
- <xsl:choose>
- <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">absolute</xsl:when>
- <xsl:otherwise>relative</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="trans-unit">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="$column-pos"/>
- <xsl:with-param name="row-number" select="$row-pos"/>
- <xsl:with-param name="column-pos-style" select="$column-pos-style"/>
- <xsl:with-param name="row-pos-style" select="$row-pos-style"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit)"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
- <xsl:with-param name="return-value">
- <xsl:choose>
- <xsl:when test="$is-range-mode = 'true'">
- <xsl:value-of select="concat($return-value, $name-unit)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="is-range-mode" select="true()"/>
- <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before(substring-after($expression, '('),'R'),',!', ';.'))"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($current-range,'R')"/>
- <xsl:with-param name="return-value">
- <xsl:choose>
- <xsl:when test="$is-range-mode = 'true'">
- <xsl:value-of select="concat($return-value, $name-unit)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="is-range-mode" select="true()"/>
- <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$handle-type = 2">
- <!-- It's type 2, e.g. R3 -->
- <!-- process the range only including a whole row -->
- <xsl:variable name="after-R">
- <xsl:value-of select="substring(substring-after($current-range,'R'),1,1)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$after-R='[' or $after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
- <xsl:variable name="row-number">
- <xsl:choose>
- <xsl:when test="$after-R = '['">
- <xsl:value-of select="substring-before(substring-after($current-range, 'R['), ']')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after($current-range, 'R')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="row-pos">
- <xsl:choose>
- <xsl:when test="$after-R='['">
- <xsl:value-of select="$cell-row-pos + $row-number"/>
- </xsl:when>
- <xsl:when test="$after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
- <xsl:value-of select="$row-number"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$cell-row-pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="trans-unit1">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="1"/>
- <xsl:with-param name="row-number" select="$row-pos"/>
- <xsl:with-param name="column-pos-style" select="'relative'"/>
- <xsl:with-param name="row-pos-style" select="'relative'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="trans-unit2">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="256"/>
- <xsl:with-param name="row-number" select="$row-pos"/>
- <xsl:with-param name="column-pos-style" select="'relative'"/>
- <xsl:with-param name="row-pos-style" select="'relative'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit1, ':', $trans-unit2)"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
- <xsl:with-param name="return-value">
- <xsl:choose>
- <xsl:when test="$is-range-mode = 'true'">
- <xsl:value-of select="concat($return-value, $name-unit)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="is-range-mode" select="true()"/>
- <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before($current-range,'R'),',!', ';.'),'R')"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($current-range,'R')"/>
- <xsl:with-param name="return-value">
- <xsl:choose>
- <xsl:when test="$is-range-mode = 'true'">
- <xsl:value-of select="concat($return-value, $name-unit)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="is-range-mode" select="true()"/>
- <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$handle-type = 3">
- <!-- It's type 3, e.g. C4 -->
- <!-- process the range only including a whole column -->
- <xsl:variable name="after-C">
- <xsl:value-of select="substring(substring-after($current-range,'C'),1,1)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$after-C='[' or $after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
- <xsl:variable name="column-number">
- <xsl:choose>
- <xsl:when test="$after-C = '['">
- <xsl:value-of select="substring-before(substring-after($current-range, 'C['), ']')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after($current-range, 'C')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="column-pos">
- <xsl:choose>
- <xsl:when test="$after-C='['">
- <xsl:value-of select="$cell-column-pos + $column-number"/>
- </xsl:when>
- <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
- <xsl:value-of select="$column-number"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$cell-column-pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="trans-unit1">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="$column-pos"/>
- <xsl:with-param name="row-number" select="1"/>
- <xsl:with-param name="column-pos-style" select="'relative'"/>
- <xsl:with-param name="row-pos-style" select="'relative'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="trans-unit2">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="$column-pos"/>
- <xsl:with-param name="row-number" select="65565"/>
- <xsl:with-param name="column-pos-style" select="'relative'"/>
- <xsl:with-param name="row-pos-style" select="'relative'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit1, ':', $trans-unit2)"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
- <xsl:with-param name="return-value">
- <xsl:choose>
- <xsl:when test="$is-range-mode = 'true'">
- <xsl:value-of select="concat($return-value, $name-unit)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="is-range-mode" select="true()"/>
- <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before($current-range,'C'),',!', ';.'),'C')"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($current-range,'C')"/>
- <xsl:with-param name="return-value">
- <xsl:choose>
- <xsl:when test="$is-range-mode = 'true'">
- <xsl:value-of select="concat($return-value, $name-unit)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($return-value, '[.', $name-unit)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="is-range-mode" select="true()"/>
- <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- It's unknown, so just jump over it -->
- <xsl:variable name="next-pit" select="substring-after($expression, $current-range)"/>
- <xsl:choose>
- <xsl:when test="contains($next-pit, '+') or contains($next-pit, '-') or contains($next-pit, '*') or contains($next-pit, '/') or contains($next-pit, ')') or contains($next-pit, '^') or contains($next-pit, ':') or contains($next-pit, '&quot;') or contains($next-pit, ';') or contains($next-pit, ',') or contains($next-pit, '[')">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
- <xsl:with-param name="return-value" select="concat($return-value, substring-before($expression, $current-range), $current-range)"/>
- <xsl:with-param name="is-range-mode" select="false()"/>
- <xsl:with-param name="isRangeAddress" select="$isRangeAddress"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- return the final range or formula -->
- <xsl:choose>
- <!-- in case the closing bracket of the range wasn't set, do it now -->
- <xsl:when test="$is-range-mode = 'true' and $current-range = ''">
- <xsl:value-of select="translate( concat($return-value, ']'),',!', ';.')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate( concat($return-value, substring-before($expression, $current-range), $current-range),',!', ';.')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="parse-range-name">
- <!-- return the string or name for next handle. the type 1 is names of function, sheet, special separated symbol, not to parse as range; type 2 is the range including R/C to be parsed -->
- <xsl:param name="expression"/>
- <xsl:param name="return-value"/>
- <xsl:variable name="first-one" select="substring($expression,1,1)"/>
- <xsl:choose>
- <xsl:when test="$first-one = '='">
- <xsl:choose>
- <xsl:when test="string-length(normalize-space($return-value)) &gt; 0">
- <xsl:value-of select="concat('2', $return-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>1=</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$first-one='(' or $first-one='!' or $first-one='&amp;'">
- <xsl:value-of select="concat('1', $return-value, $first-one)"/>
- </xsl:when>
- <xsl:when test="$first-one='['">
- <xsl:choose>
- <xsl:when test="starts-with(substring-after($expression, ']'), 'C')">
- <xsl:call-template name="parse-range-name">
- <xsl:with-param name="expression" select="substring-after($expression, ']')"/>
- <xsl:with-param name="return-value" select="concat($return-value, substring-before($expression, ']'), ']')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains(substring-before($expression, ']'), '.') and contains(substring-after($expression, ']'), '!')">
- <xsl:value-of select="concat('1', &quot;&apos;&quot;, substring-before(substring-after($expression, '['), ']'), &quot;&apos;&quot;, '#$', substring-before(substring-after($expression, ']'), '!'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('2', $return-value, substring-before($expression, ']'), ']')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$first-one='&quot;'">
- <xsl:value-of select="concat('1', $first-one, substring-before(substring-after($expression, '&quot;'), '&quot;'), '&quot;')"/>
- </xsl:when>
- <xsl:when test="$first-one=&quot;&apos;&quot;">
- <!-- here the string &quot;&apos;&quot; represents a char &apos; -->
- <xsl:variable name="str-in" select="substring-before(substring-after($expression, &quot;&apos;&quot;), &quot;&apos;&quot;)"/>
- <xsl:choose>
- <!-- for file path transformation -->
- <xsl:when test="contains($str-in, '\') and contains($str-in, '[') and contains($str-in, ']')">
- <xsl:variable name="first-pos" select="substring-before($str-in, '[')"/>
- <xsl:variable name="second-pos" select="substring-before(substring-after($str-in, '['), ']')"/>
- <xsl:variable name="third-pos" select="substring-after($str-in, ']')"/>
- <xsl:value-of select="concat('1', &quot;&apos;&quot;, $first-pos, $second-pos, &quot;&apos;&quot;, '#$', $third-pos)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('1', &quot;&apos;&quot;, $str-in, &quot;&apos;&quot;)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$first-one='+' or $first-one='-' or $first-one='*' or $first-one='/' or $first-one=')' or $first-one='^' or $first-one=':' or $first-one='&quot;' or $first-one=';' or $first-one=',' or $first-one='&gt;' or $first-one='&lt;'">
- <xsl:choose>
- <xsl:when test="$return-value = ''">
- <xsl:value-of select="concat('1', $first-one)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('2', $return-value)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$expression = ''">
- <xsl:value-of select="concat('2', $return-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="parse-range-name">
- <xsl:with-param name="expression" select="substring($expression, 2, string-length($expression)-1)"/>
- <xsl:with-param name="return-value" select="concat($return-value, substring($expression, 1, 1))"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="handle-type-number">
- <!-- to handle the part between R and C, or after C in range string in translate-expression. return type: 1: number or cell range; 2: other, not for next step -->
- <xsl:param name="t-part"/>
- <xsl:choose>
- <xsl:when test="starts-with($t-part, '[')">
- <xsl:variable name="tt-str" select="substring-before( substring-after( $t-part, '['), ']')"/>
- <xsl:choose>
- <xsl:when test="($tt-str &lt; 0) or ($tt-str &gt; 0) or ($tt-str = 0)">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="($t-part &lt; 0) or ($t-part &gt; 0) or ($t-part = 0)">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:when test="$t-part = ''">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="translate-unit">
- <!-- convert cell position expression unit, R1C1, R3, C4 -->
- <xsl:param name="column-number"/>
- <xsl:param name="row-number"/>
- <xsl:param name="column-pos-style"/>
- <xsl:param name="row-pos-style"/>
- <xsl:variable name="column-number1">
- <xsl:value-of select="floor( $column-number div 26 )"/>
- </xsl:variable>
- <xsl:variable name="column-number2">
- <xsl:value-of select="$column-number mod 26"/>
- </xsl:variable>
- <xsl:variable name="column-character1">
- <xsl:call-template name="number-to-character">
- <xsl:with-param name="number" select="$column-number1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="column-character2">
- <xsl:call-template name="number-to-character">
- <xsl:with-param name="number" select="$column-number2"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- position styles are 'absolute' or 'relative', -->
- <xsl:choose>
- <xsl:when test="$column-pos-style = 'absolute'">
- <xsl:value-of select="concat( '$', $column-character1, $column-character2)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat( $column-character1, $column-character2)"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$row-pos-style ='absolute'">
- <xsl:value-of select="concat( '$', $row-number)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$row-number"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="number-to-character">
- <xsl:param name="number"/>
- <xsl:choose>
- <xsl:when test="$number = 0"/>
- <xsl:when test="$number = 1">A</xsl:when>
- <xsl:when test="$number = 2">B</xsl:when>
- <xsl:when test="$number = 3">C</xsl:when>
- <xsl:when test="$number = 4">D</xsl:when>
- <xsl:when test="$number = 5">E</xsl:when>
- <xsl:when test="$number = 6">F</xsl:when>
- <xsl:when test="$number = 7">G</xsl:when>
- <xsl:when test="$number = 8">H</xsl:when>
- <xsl:when test="$number = 9">I</xsl:when>
- <xsl:when test="$number = 10">J</xsl:when>
- <xsl:when test="$number = 11">K</xsl:when>
- <xsl:when test="$number = 12">L</xsl:when>
- <xsl:when test="$number = 13">M</xsl:when>
- <xsl:when test="$number = 14">N</xsl:when>
- <xsl:when test="$number = 15">O</xsl:when>
- <xsl:when test="$number = 16">P</xsl:when>
- <xsl:when test="$number = 17">Q</xsl:when>
- <xsl:when test="$number = 18">R</xsl:when>
- <xsl:when test="$number = 19">S</xsl:when>
- <xsl:when test="$number = 20">T</xsl:when>
- <xsl:when test="$number = 21">U</xsl:when>
- <xsl:when test="$number = 22">V</xsl:when>
- <xsl:when test="$number = 23">W</xsl:when>
- <xsl:when test="$number = 24">X</xsl:when>
- <xsl:when test="$number = 25">Y</xsl:when>
- <xsl:when test="$number = 26">Z</xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-digit-length">
- <xsl:param name="complexive-string"/>
- <xsl:variable name="first-char">
- <xsl:value-of select="substring( $complexive-string, 1, 1)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-char = '1' or $first-char = '2' or $first-char = '3' or $first-char = '4' or $first-char = '5' or $first-char = '6' or $first-char = '7' or $first-char = '8' or $first-char = '9' or $first-char = '0' ">
- <xsl:variable name="temp">
- <xsl:call-template name="get-digit-length">
- <xsl:with-param name="complexive-string" select="substring( $complexive-string, 2)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$temp+1"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="ss:Comment" mode="body">
- <xsl:element name="office:annotation">
- <xsl:if test="@ss:ShowAlways = '1'">
- <xsl:attribute name="office:display">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="@ss:Author">
- <xsl:element name="dc:creator">
- <xsl:value-of select="@ss:Author"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="ss:Data">
- <text:p>
- <xsl:call-template name="create-data-content">
- <xsl:with-param name="style-id" select="@ss:StyleID"/>
- </xsl:call-template>
- </text:p>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Names">
- <xsl:variable name="namedRanges" select="/ss:Workbook/ss:Worksheet/ss:Names/ss:NamedRange |
- /ss:Workbook/ss:Names/ss:NamedRange" />
- <xsl:if test="$namedRanges">
- <table:named-expressions>
- <xsl:for-each select="$namedRanges">
- <xsl:choose>
- <xsl:when test="contains( @ss:RefersTo, '!R')">
- <xsl:variable name="referto">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="isRangeAddress" select="true()"/>
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="@ss:RefersTo"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:element name="table:named-range">
- <xsl:attribute name="table:name">
- <xsl:value-of select="@ss:Name"/>
- </xsl:attribute>
- <xsl:attribute name="table:base-cell-address">
- <xsl:variable name="worksheetName" select="translate(substring-before(@ss:RefersTo, '!'), '=', '$')" />
- <xsl:call-template name="encode-as-cell-address">
- <xsl:with-param name="string" select="concat($worksheetName,'.$A$1')"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="table:cell-range-address">
- <xsl:call-template name="encode-as-cell-range-address">
- <xsl:with-param name="string" select="translate( $referto, '=', '$')"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:if test="@ss:Name = 'Print_Area'">
- <xsl:attribute name="table:range-usable-as">print-range</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="expression-name">
- <xsl:value-of select="@ss:Name"/>
- </xsl:variable>
- <xsl:element name="table:named-expression">
- <xsl:attribute name="table:name">
- <xsl:value-of select="@ss:Name"/>
- </xsl:attribute>
- <!-- just set '$Sheet1.$A$1' as named-expressions virtual base-cell-address -->
- <xsl:attribute name="table:base-cell-address">
- <xsl:variable name="worksheetName" select="following-sibling::ss:Worksheet/@ss:Name" />
- <xsl:call-template name="encode-as-cell-address">
- <xsl:with-param name="string" select="concat('$', $worksheetName,'.$A$1')"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:attribute name="table:expression">
- <xsl:value-of select="substring( @ss:RefersTo, 2)"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </table:named-expressions>
- </xsl:if>
- </xsl:template>
- <xsl:template name="transform-advanced-filter">
- <!-- transform the params of Advanced Filter.it's different from AutoFilter -->
- <xsl:param name="target-value"/>
- <xsl:param name="condition-pos"/>
- <xsl:element name="table:database-range">
- <xsl:variable name="target-range">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="$target-value"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="condition-range">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="$condition-pos"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="table:target-range-address">
- <xsl:value-of select="$target-range"/>
- </xsl:attribute>
- <xsl:attribute name="table:name">
- <xsl:value-of select="concat($target-range, '.filter')"/>
- </xsl:attribute>
- <xsl:element name="table:filter">
- <xsl:attribute name="table:condition-source-range-address">
- <xsl:value-of select="$condition-range"/>
- </xsl:attribute>
- <xsl:element name="table:filter-condition">
- <xsl:attribute name="table:field-number">0</xsl:attribute>
- <!-- The two attributes are recommended by OASIS -->
- <xsl:attribute name="table:value"/>
- <xsl:attribute name="table:operator"/>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template match="x:AutoFilter">
- <!-- for AutoFilter -->
- <xsl:element name="table:database-range">
- <xsl:attribute name="table:name">
- <xsl:value-of select="concat(../@ss:Name,'_',@x:Range)"/>
- </xsl:attribute>
- <xsl:variable name="range">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="@x:Range"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="table:target-range-address">
- <xsl:value-of select="concat('$',../@ss:Name,'.',$range)"/>
- </xsl:attribute>
- <xsl:attribute name="table:display-filter-buttons">true</xsl:attribute>
- <xsl:element name="table:filter">
- <xsl:call-template name="auto-filter-condition">
- <xsl:with-param name="item-pos" select="1"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="total" select="count(./x:AutoFilterColumn)"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="auto-filter-condition">
- <!--?? generate element of filter-condition for AutoCondition to get position of index -->
- <xsl:param name="item-pos"/>
- <xsl:param name="index"/>
- <xsl:param name="total"/>
- <xsl:if test="($index - 1 &lt; $total) or ($index - 1 = $total)">
- <xsl:element name="table:filter-condition">
- <xsl:attribute name="table:data-type">number</xsl:attribute>
- <xsl:choose>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'TopPercent'">
- <xsl:attribute name="table:operator">
- <xsl:value-of select="'top value'"/>
- </xsl:attribute>
- <xsl:attribute name="table:value">
- <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Value"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'Top'">
- <xsl:attribute name="table:operator">
- <xsl:value-of select="'top values'"/>
- </xsl:attribute>
- <xsl:attribute name="table:value">
- <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Value"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'TopPercent'">
- <xsl:attribute name="table:operator">
- <xsl:value-of select="'top percent'"/>
- </xsl:attribute>
- <xsl:attribute name="table:value">
- <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Value"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'Bottom'">
- <xsl:attribute name="table:operator">
- <xsl:value-of select="'bottom values'"/>
- </xsl:attribute>
- <xsl:attribute name="table:value">
- <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Value"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'BottomPercent'">
- <xsl:attribute name="table:operator">
- <xsl:value-of select="'bottom percent'"/>
- </xsl:attribute>
- <xsl:attribute name="table:value">
- <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Value"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Type = 'Custom'">
- <xsl:choose>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/x:AutoFilterOr or ./x:AutoFilterColumn[position() = $item-pos]/x:AutoFilterAnd">
- <xsl:attribute name="table:operator">
- <xsl:choose>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'Equals'">
- <xsl:value-of select="'='"/>
- </xsl:when>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'DoesNotEquals'">
- <xsl:value-of select="'!='"/>
- </xsl:when>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'GreaterThan'">
- <xsl:value-of select="'&gt;'"/>
- </xsl:when>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'GreaterThanOrEqual'">
- <xsl:value-of select="'&gt;='"/>
- </xsl:when>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'LessThan'">
- <xsl:value-of select="'&lt;'"/>
- </xsl:when>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]//@x:Operator = 'LessThanOrEqual'">
- <xsl:value-of select="'&lt;='"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'='"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="table:value">
- <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]//@x:Value"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:operator">
- <xsl:value-of select="'bottom percent'"/>
- </xsl:attribute>
- <xsl:attribute name="table:value">
- <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]//@x:Value"/>
- </xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- <xsl:attribute name="table:field-number">
- <xsl:choose>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Index">
- <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Index - 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$index - 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:element>
- <xsl:call-template name="auto-filter-condition">
- <xsl:with-param name="item-pos" select="$item-pos + 1"/>
- <xsl:with-param name="index">
- <xsl:choose>
- <xsl:when test="./x:AutoFilterColumn[position() = $item-pos]/@x:Index">
- <xsl:value-of select="./x:AutoFilterColumn[position() = $item-pos]/@x:Index + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$index + 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="total" select="count(./x:AutoFilterColumn)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template match="x:Sorting">
- <!-- for Sorting don't contains header row -->
- <xsl:if test="contains(./x:Sort, 'Column')">
- <xsl:element name="table:database-range">
- <xsl:variable name="first-sort-letter" select="normalize-space(substring-after(./x:Sort[position() = 1], 'Column'))"/>
- <xsl:variable name="second-sort-letter" select="normalize-space(substring-after(./x:Sort[position() = 2], 'Column'))"/>
- <xsl:variable name="third-sort-letter" select="normalize-space(substring-after(./x:Sort[position() = 3], 'Column'))"/>
- <xsl:variable name="first-sort-num">
- <xsl:call-template name="letter-to-number">
- <xsl:with-param name="source-letter" select="$first-sort-letter"/>
- <xsl:with-param name="return-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="second-sort-num">
- <xsl:call-template name="letter-to-number">
- <xsl:with-param name="source-letter" select="$second-sort-letter"/>
- <xsl:with-param name="return-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="third-sort-num">
- <xsl:call-template name="letter-to-number">
- <xsl:with-param name="source-letter" select="$third-sort-letter"/>
- <xsl:with-param name="return-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="min-left-num">
- <xsl:call-template name="min-of-three">
- <xsl:with-param name="first-num" select="$first-sort-num"/>
- <xsl:with-param name="second-num" select="$second-sort-num"/>
- <xsl:with-param name="third-num" select="$third-sort-num"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="max-right-num">
- <xsl:call-template name="max-of-three">
- <xsl:with-param name="first-num" select="$first-sort-num"/>
- <xsl:with-param name="second-num" select="$second-sort-num"/>
- <xsl:with-param name="third-num" select="$third-sort-num"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="left-column">
- <xsl:call-template name="number-to-letter">
- <xsl:with-param name="source-number" select="$min-left-num"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="right-column">
- <xsl:call-template name="number-to-letter">
- <xsl:with-param name="source-number" select="$max-right-num"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="table:target-range-address">
- <xsl:value-of select="concat(../@ss:Name, '.', $left-column, '1:', ../@ss:Name, '.', $right-column, '32000')"/>
- </xsl:attribute>
- <xsl:attribute name="table:name">
- <xsl:value-of select="concat(../@ss:Name, '.sort')"/>
- </xsl:attribute>
- <xsl:attribute name="table:contains-header">
- <xsl:value-of select="'false'"/>
- </xsl:attribute>
- <xsl:element name="table:sort">
- <xsl:for-each select="./x:Sort">
- <xsl:element name="table:sort-by">
- <xsl:attribute name="table:field-number">
- <xsl:value-of select="0"/>
- </xsl:attribute>
- <xsl:attribute name="table:data-type">
- <xsl:value-of select="'automatic'"/>
- </xsl:attribute>
- <xsl:variable name="after-sort" select="following-sibling::*"/>
- <xsl:if test="name($after-sort[position() = 1]) = 'Descending'">
- <xsl:attribute name="table:order">
- <xsl:value-of select="'descending'"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="position() = 1">
- <xsl:attribute name="table:field-number">
- <xsl:value-of select="$first-sort-num - $min-left-num"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="position() = 2">
- <xsl:attribute name="table:field-number">
- <xsl:value-of select="$second-sort-num - $min-left-num"/>
- </xsl:attribute>
- </xsl:when>
- <xsl:when test="position() = 3">
- <xsl:attribute name="table:field-number">
- <xsl:value-of select="$third-sort-num - $min-left-num"/>
- </xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="letter-to-number">
- <!-- convert letter to number for sorting. the string source-letter should be normalize-space and the first return-value should be zero -->
- <xsl:param name="source-letter"/>
- <xsl:param name="return-value"/>
- <xsl:choose>
- <xsl:when test="string-length($source-letter) &gt; 0">
- <xsl:variable name="first-pit" select="substring($source-letter, 1, 1)"/>
- <xsl:variable name="pit-number">
- <xsl:choose>
- <xsl:when test="($first-pit = 'A') or ($first-pit = 'a')">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'B') or ($first-pit = 'b')">
- <xsl:value-of select="2"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'C') or ($first-pit = 'c')">
- <xsl:value-of select="3"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'D') or ($first-pit = 'd')">
- <xsl:value-of select="4"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'E') or ($first-pit = 'e')">
- <xsl:value-of select="5"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'F') or ($first-pit = 'f')">
- <xsl:value-of select="6"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'G') or ($first-pit = 'g')">
- <xsl:value-of select="7"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'H') or ($first-pit = 'h')">
- <xsl:value-of select="8"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'I') or ($first-pit = 'i')">
- <xsl:value-of select="9"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'J') or ($first-pit = 'j')">
- <xsl:value-of select="10"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'K') or ($first-pit = 'k')">
- <xsl:value-of select="11"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'L') or ($first-pit = 'l')">
- <xsl:value-of select="12"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'M') or ($first-pit = 'm')">
- <xsl:value-of select="13"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'N') or ($first-pit = 'n')">
- <xsl:value-of select="14"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'O') or ($first-pit = 'o')">
- <xsl:value-of select="15"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'P') or ($first-pit = 'p')">
- <xsl:value-of select="16"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'Q') or ($first-pit = 'q')">
- <xsl:value-of select="17"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'R') or ($first-pit = 'r')">
- <xsl:value-of select="18"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'S') or ($first-pit = 's')">
- <xsl:value-of select="19"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'T') or ($first-pit = 't')">
- <xsl:value-of select="20"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'U') or ($first-pit = 'u')">
- <xsl:value-of select="21"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'V') or ($first-pit = 'v')">
- <xsl:value-of select="22"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'W') or ($first-pit = 'w')">
- <xsl:value-of select="23"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'X') or ($first-pit = 'x')">
- <xsl:value-of select="24"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'Y') or ($first-pit = 'y')">
- <xsl:value-of select="25"/>
- </xsl:when>
- <xsl:when test="($first-pit = 'Z') or ($first-pit = 'z')">
- <xsl:value-of select="26"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="letter-to-number">
- <xsl:with-param name="source-letter" select="substring($source-letter, 2)"/>
- <xsl:with-param name="return-value">
- <xsl:choose>
- <xsl:when test="string-length($source-letter) &gt;= 2">
- <xsl:value-of select="$pit-number * 26 + $return-value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$pit-number + $return-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$return-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="number-to-letter">
- <!--?? convert number to letter for sorting -->
- <xsl:param name="source-number"/>
- <xsl:param name="return-value"/>
- <xsl:variable name="current-value">
- <xsl:call-template name="num-conv-letter">
- <xsl:with-param name="first-pit">
- <xsl:choose>
- <xsl:when test="$source-number &gt; 26">
- <xsl:value-of select="floor($source-number div 26)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$source-number"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$source-number &gt; 26">
- <xsl:call-template name="number-to-letter">
- <xsl:with-param name="source-number" select="$source-number mod 26"/>
- <xsl:with-param name="return-value" select="concat($return-value,$current-value)"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$source-number &lt; 27">
- <xsl:value-of select="concat($return-value,$current-value)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="num-conv-letter">
- <!-- convert number to number by pit of 26 -->
- <xsl:param name="first-pit"/>
- <xsl:choose>
- <xsl:when test="$first-pit = 1">
- <xsl:value-of select="'A'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 2">
- <xsl:value-of select="'B'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 3">
- <xsl:value-of select="'C'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 4">
- <xsl:value-of select="'D'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 5">
- <xsl:value-of select="'E'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 6">
- <xsl:value-of select="'F'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 7">
- <xsl:value-of select="'G'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 8">
- <xsl:value-of select="'H'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 9">
- <xsl:value-of select="'I'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 10">
- <xsl:value-of select="'J'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 11">
- <xsl:value-of select="'K'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 12">
- <xsl:value-of select="'L'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 13">
- <xsl:value-of select="'M'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 14">
- <xsl:value-of select="'N'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 15">
- <xsl:value-of select="'O'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 16">
- <xsl:value-of select="'P'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 17">
- <xsl:value-of select="'Q'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 18">
- <xsl:value-of select="'R'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 19">
- <xsl:value-of select="'S'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 20">
- <xsl:value-of select="'T'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 21">
- <xsl:value-of select="'U'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 22">
- <xsl:value-of select="'V'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 23">
- <xsl:value-of select="'W'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 24">
- <xsl:value-of select="'X'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 25">
- <xsl:value-of select="'Y'"/>
- </xsl:when>
- <xsl:when test="$first-pit = 26">
- <xsl:value-of select="'Z'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'A'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="min-of-three">
- <!-- return minest of three for sorting -->
- <xsl:param name="first-num"/>
- <xsl:param name="second-num"/>
- <xsl:param name="third-num"/>
- <xsl:variable name="first-comp">
- <xsl:choose>
- <xsl:when test="$first-num = 0">
- <xsl:value-of select="$second-num"/>
- </xsl:when>
- <xsl:when test="($first-num &lt; $second-num) or ($second-num = 0)">
- <xsl:value-of select="$first-num"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$second-num"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="second-comp">
- <xsl:choose>
- <xsl:when test="($first-comp &lt; $third-num) or ($third-num = 0)">
- <xsl:value-of select="$first-comp"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$third-num"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$second-comp"/>
- </xsl:template>
- <xsl:template name="max-of-three">
- <!-- return maxest of three for sorting -->
- <xsl:param name="first-num"/>
- <xsl:param name="second-num"/>
- <xsl:param name="third-num"/>
- <xsl:variable name="first-comp">
- <xsl:choose>
- <xsl:when test="$first-num &gt; $second-num">
- <xsl:value-of select="$first-num"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$second-num"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="second-comp">
- <xsl:choose>
- <xsl:when test="$first-comp &gt; $third-num">
- <xsl:value-of select="$first-comp"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$third-num"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$second-comp"/>
- </xsl:template>
- <xsl:template name="set-calculation">
- <xsl:element name="table:calculation-settings">
- <xsl:if test="/ss:Workbook/x:ExcelWorkbook/x:PrecisionAsDisplayed">
- <xsl:attribute name="table:precision-as-shown">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="/ss:Workbook/x:ExcelWorkbook/x:Date1904">
- <table:null-date office:date-value="1904-01-01"/>
- </xsl:if>
- <xsl:element name="table:iteration">
- <xsl:if test="/ss:Workbook/x:ExcelWorkbook/x:Iteration">
- <xsl:attribute name="table:status">enable</xsl:attribute>
- </xsl:if>
- <xsl:if test="/ss:Workbook/x:ExcelWorkbook/x:MaxIterations">
- <xsl:attribute name="table:steps">
- <xsl:value-of select="/ss:Workbook/x:ExcelWorkbook/x:MaxIterations"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="/ss:Workbook/x:ExcelWorkbook/x:MaxChange">
- <xsl:attribute name="table:maximum-difference">
- <xsl:value-of select="/ss:Workbook/x:ExcelWorkbook/x:MaxChange"/>
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template match="x:DataValidation">
- <!-- for DataValidation. don't support the attribute IMEMode currently. -->
- <xsl:element name="table:content-validation">
- <xsl:attribute name="table:name">
- <xsl:value-of select="concat('val', position())"/>
- </xsl:attribute>
- <xsl:attribute name="table:condition"><!-- don't support two type of qualifier: List, Custom -->
- <xsl:variable name="qualifier-content">
- <xsl:choose>
- <xsl:when test="./x:Qualifier = 'NotBetween'">
- <xsl:value-of select="concat('cell-content-is-not-between(', ./x:Min, ',', ./x:Max, ')')"/>
- </xsl:when>
- <xsl:when test="./x:Qualifier = 'NotEqual'">
- <xsl:value-of select="concat('!=', ./x:Value)"/>
- </xsl:when>
- <xsl:when test="./x:Qualifier = 'Equal'">
- <xsl:value-of select="concat('=', ./x:Value)"/>
- </xsl:when>
- <xsl:when test="./x:Qualifier = 'Less'">
- <xsl:value-of select="concat('&lt;', ./x:Value)"/>
- </xsl:when>
- <xsl:when test="./x:Qualifier = 'Greater'">
- <xsl:value-of select="concat('&gt;', ./x:Value)"/>
- </xsl:when>
- <xsl:when test="./x:Qualifier = 'GreaterOrEqual'">
- <xsl:value-of select="concat('&gt;=', ./x:Value)"/>
- </xsl:when>
- <xsl:when test="./x:Qualifier = 'LessOrEqual'">
- <xsl:value-of select="concat('&lt;=', ./x:Value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('cell-content-is-between(', ./x:Min, ',', ./x:Max)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="qualifier-value">
- <xsl:choose>
- <xsl:when test="./x:Type = 'Whole'">
- <xsl:choose>
- <xsl:when test="(./x:Qualifier = 'NotBetween') or ./x:Max">
- <xsl:value-of select="concat('cell-content-is-whole-number() and ', $qualifier-content, ')')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('cell-content-is-whole-number() and ', 'cell-content()', $qualifier-content)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="./x:Type = 'Decimal'">
- <xsl:choose>
- <xsl:when test="(./x:Qualifier = 'NotBetween') or ./x:Max">
- <xsl:value-of select="concat('cell-content-is-decimal-number() and ', $qualifier-content, ')')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('cell-content-is-decimal-number() and ', 'cell-content()', $qualifier-content)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="./x:Type = 'Date'">
- <xsl:choose>
- <xsl:when test="(./x:Qualifier = 'NotBetween') or ./x:Max">
- <xsl:value-of select="concat('cell-content-is-date() and ', $qualifier-content, ')')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('cell-content-is-date() and ', 'cell-content()', $qualifier-content)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="./x:Type = 'Time'">
- <xsl:choose>
- <xsl:when test="(./x:Qualifier = 'NotBetween') or ./x:Max">
- <xsl:value-of select="concat('cell-content-is-time() and ', $qualifier-content, ')')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('cell-content-is-time() and ', 'cell-content()', $qualifier-content)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="./x:Type = 'TextLength'">
- <xsl:choose>
- <xsl:when test="./x:Qualifier = 'NotBetween'">
- <xsl:value-of select="concat('cell-content-text-length-is-not-between(', ./x:Min, ',', ./x:Max, ')')"/>
- </xsl:when>
- <xsl:when test="./x:Max and ./x:Min">
- <xsl:value-of select="concat('cell-content-text-length-is-between(', ./x:Min, ',', ./x:Max, ')')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('cell-content-text-length()', $qualifier-content)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./x:Type"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="$qualifier-value"/>
- </xsl:attribute>
- <xsl:attribute name="table:base-cell-address">
- <xsl:variable name="first-range">
- <xsl:choose>
- <xsl:when test="contains(./x:Range, ',')">
- <xsl:value-of select="substring-before(./x:Range, ',')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./x:Range"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="range">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="$first-range"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="encode-as-cell-address">
- <xsl:with-param name="string" select="concat(../../ss:Worksheet/@ss:Name, '.', $range)"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:element name="table:help-message">
- <xsl:attribute name="table:title">
- <xsl:value-of select="./x:InputTitle"/>
- </xsl:attribute>
- <xsl:attribute name="table:display">
- <xsl:choose>
- <xsl:when test="./x:InputHide">
- <xsl:value-of select="'false'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'true'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:element name="text:p">
- <xsl:value-of select="./x:InputMessage"/>
- </xsl:element>
- </xsl:element>
- <xsl:element name="table:error-message">
- <xsl:attribute name="table:message-type">
- <xsl:choose>
- <xsl:when test="./x:ErrorStyle= 'Info'">
- <xsl:value-of select="'information'"/>
- </xsl:when>
- <xsl:when test="./x:ErrorStyle= 'Warn'">
- <xsl:value-of select="'warning'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'stop'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="table:title">
- <xsl:value-of select="./x:ErrorTitle"/>
- </xsl:attribute>
- <xsl:attribute name="table:display">
- <xsl:choose>
- <xsl:when test="./x:ErrorHide">
- <xsl:value-of select="'false'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'true'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:element name="text:p">
- <xsl:value-of select="./x:ErrorMessage"/>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <!-- Note: Move template to common section -->
- <xsl:template name="encode-as-cell-range-address">
- <xsl:param name="string"/>
- <xsl:value-of select="$string"/>
- </xsl:template>
- <xsl:template name="encode-as-cell-address">
- <xsl:param name="string"/>
- <xsl:value-of select="$string"/>
- </xsl:template>
- <xsl:template name="encode-as-nc-name">
- <xsl:param name="string"/>
- <xsl:value-of select="translate($string, '.%()/\+[]', '')"/>
- </xsl:template>
-
- <xsl:template name="set:distinct">
- <xsl:param name="nodes" select="/.."/>
- <xsl:param name="distinct" select="/.."/>
- <xsl:choose>
- <xsl:when test="$nodes">
- <xsl:call-template name="set:distinct">
- <xsl:with-param name="distinct" select="$distinct | $nodes[1][not(. = $distinct)]"/>
- <xsl:with-param name="nodes" select="$nodes[position() > 1]"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$distinct" mode="set:distinct"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="node()|@*" mode="set:distinct">
- <xsl:copy-of select="." />
- </xsl:template>
-
</xsl:stylesheet>
diff --git a/filter/source/xslt/import/uof/uof2odf_presentation.xsl b/filter/source/xslt/import/uof/uof2odf_presentation.xsl
index 5150da381f13..ee01cce8759b 100644
--- a/filter/source/xslt/import/uof/uof2odf_presentation.xsl
+++ b/filter/source/xslt/import/uof/uof2odf_presentation.xsl
@@ -17,3478 +17,3478 @@
* 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:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
- <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
- <xsl:template match="uof:UOF">
- <office:document 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
- <xsl:apply-templates select="uof:元数据"/>
- <office:settings>
- <xsl:variable name="PageNumberFormat" select="/uof:UOF/uof:演示文稿/演:公用处理规则/演:页面设置集/演:页面设置/演:页码格式[1]"/>
- <xsl:variable name="proportion">
- <xsl:value-of select="substring-before(/uof:UOF/uof:演示文稿/演:公用处理规则/演:显示比例,'%')"/>
- </xsl:variable>
- <config:config-item-set config:name="ooo:view-settings">
- <config:config-item config:name="VisibleAreaTop" config:type="int">0</config:config-item>
- <config:config-item config:name="VisibleAreaLeft" config:type="int">0</config:config-item>
- <config:config-item config:name="VisibleAreaWidth" config:type="int">14098</config:config-item>
- <config:config-item config:name="VisibleAreaHeight" config:type="int">9998</config:config-item>
- <config:config-item-map-indexed config:name="Views">
- <config:config-item-map-entry>
- <config:config-item config:name="ViewId" config:type="string">view1</config:config-item>
- <config:config-item config:name="GridIsVisible" config:type="boolean">false</config:config-item>
- <config:config-item config:name="GridIsFront" config:type="boolean">false</config:config-item>
- <config:config-item config:name="IsSnapToGrid" config:type="boolean">true</config:config-item>
- <config:config-item config:name="IsSnapToPageMargins" config:type="boolean">true</config:config-item>
- <config:config-item config:name="IsSnapToSnapLines" config:type="boolean">false</config:config-item>
- <config:config-item config:name="IsSnapToObjectFrame" config:type="boolean">false</config:config-item>
- <config:config-item config:name="IsSnapToObjectPoints" config:type="boolean">false</config:config-item>
- <config:config-item config:name="IsPlusHandlesAlwaysVisible" config:type="boolean">false</config:config-item>
- <config:config-item config:name="IsFrameDragSingles" config:type="boolean">true</config:config-item>
- <config:config-item config:name="EliminatePolyPointLimitAngle" config:type="int">1500</config:config-item>
- <config:config-item config:name="IsEliminatePolyPoints" config:type="boolean">false</config:config-item>
- <config:config-item config:name="VisibleLayers" config:type="base64Binary">//////////////////////////////////////////8=</config:config-item>
- <config:config-item config:name="PrintableLayers" config:type="base64Binary">//////////////////////////////////////////8=</config:config-item>
- <config:config-item config:name="LockedLayers" config:type="base64Binary"/>
- <config:config-item config:name="NoAttribs" config:type="boolean">false</config:config-item>
- <config:config-item config:name="NoColors" config:type="boolean">true</config:config-item>
- <config:config-item config:name="RulerIsVisible" config:type="boolean">false</config:config-item>
- <config:config-item config:name="PageKind" config:type="short">0</config:config-item>
- <config:config-item config:name="SelectedPage" config:type="short">0</config:config-item>
- <config:config-item config:name="IsLayerMode" config:type="boolean">false</config:config-item>
- <config:config-item config:name="IsDoubleClickTextEdit" config:type="boolean">true</config:config-item>
- <config:config-item config:name="IsClickChangeRotation" config:type="boolean">false</config:config-item>
- <config:config-item config:name="SlidesPerRow" config:type="short">4</config:config-item>
- <config:config-item config:name="EditModeStandard" config:type="int">0</config:config-item>
- <config:config-item config:name="EditModeNotes" config:type="int">0</config:config-item>
- <config:config-item config:name="EditModeHandout" config:type="int">1</config:config-item>
- <config:config-item config:name="VisibleAreaTop" config:type="int">-5402</config:config-item>
- <config:config-item config:name="VisibleAreaLeft" config:type="int">-441</config:config-item>
- <config:config-item config:name="VisibleAreaWidth" config:type="int">
- <xsl:value-of select="(100*13997) div $proportion"/>
- </config:config-item>
- <config:config-item config:name="VisibleAreaHeight" config:type="int">
- <xsl:value-of select="(100*15426) div $proportion"/>
- </config:config-item>
- <config:config-item config:name="GridCoarseWidth" config:type="int">1000</config:config-item>
- <config:config-item config:name="GridCoarseHeight" config:type="int">1000</config:config-item>
- <config:config-item config:name="GridFineWidth" config:type="int">500</config:config-item>
- <config:config-item config:name="GridFineHeight" config:type="int">500</config:config-item>
- <config:config-item config:name="GridSnapWidth" config:type="int">1000</config:config-item>
- <config:config-item config:name="GridSnapHeight" config:type="int">1000</config:config-item>
- <config:config-item config:name="GridSnapWidthXNumerator" config:type="int">500</config:config-item>
- <config:config-item config:name="GridSnapWidthXDenominator" config:type="int">1</config:config-item>
- <config:config-item config:name="GridSnapWidthYNumerator" config:type="int">500</config:config-item>
- <config:config-item config:name="GridSnapWidthYDenominator" config:type="int">1</config:config-item>
- <config:config-item config:name="IsAngleSnapEnabled" config:type="boolean">false</config:config-item>
- <config:config-item config:name="SnapAngle" config:type="int">1500</config:config-item>
- <config:config-item config:name="ZoomOnPage" config:type="boolean">true</config:config-item>
- </config:config-item-map-entry>
- </config:config-item-map-indexed>
- </config:config-item-set>
- <config:config-item-set config:name="ooo:configuration-settings">
- <config:config-item config:name="PageNumberFormat" config:type="int">
- <xsl:choose>
- <xsl:when test="/uof:UOF/uof:演示文稿/演:公用处理规则/演:页面设置集/演:页面设置/演:页码格式">
- <xsl:choose>
- <xsl:when test="$PageNumberFormat='upper-letter'">0</xsl:when>
- <xsl:when test="$PageNumberFormat='lower-letter'">1</xsl:when>
- <xsl:when test="$PageNumberFormat='upper-roman'">2</xsl:when>
- <xsl:when test="$PageNumberFormat='lower-letter'">3</xsl:when>
- <xsl:when test="$PageNumberFormat='decimal'">4</xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>5</xsl:otherwise>
- </xsl:choose>
- </config:config-item>
- </config:config-item-set>
- </office:settings>
- <office:scripts/>
- <xsl:element name="office:font-face-decls">
- <style:font-face style:name="宋体" svg:font-family="宋体" style:font-family-generic="swiss" style:font-pitch="variable"/>
- <xsl:apply-templates select="uof:式样集/uof:字体集"/>
- </xsl:element>
- <office:styles>
- <xsl:apply-templates select="uof:演示文稿/演:公用处理规则/演:页面版式集/演:页面版式"/>
- <xsl:call-template name="编号字体"/>
- <xsl:for-each select="uof:式样集/uof:段落式样">
- <xsl:variable name="outline" select="@字:标识符"/>
- <xsl:choose>
- <xsl:when test="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符=$outline]">
- <xsl:call-template name="段落式样"/>
- </xsl:when>
- <xsl:when test="contains($outline,'outline')">
- <xsl:call-template name="段落式样"/>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </office:styles>
- <office:automatic-styles>
- <xsl:apply-templates select="uof:演示文稿/演:公用处理规则/演:配色方案集/演:配色方案"/>
- <xsl:apply-templates select="uof:式样集/uof:句式样"/>
- <xsl:for-each select="uof:式样集/uof:段落式样">
- <xsl:variable name="outline" select="@字:标识符"/>
- <xsl:if test="not(/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符=$outline]) and not(contains($outline,'outline'))">
- <xsl:call-template name="段落式样"/>
- </xsl:if>
- </xsl:for-each>
- <xsl:apply-templates select="uof:对象集"/>
- <xsl:call-template name="create-page-master">
- <xsl:with-param name="impressoptions" select="uof:演示文稿/演:公用处理规则/演:页面设置集/演:页面设置"/>
- </xsl:call-template>
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形/图:文本内容/字:段落/字:段落属性/字:自动编号信息">
- <xsl:variable name="currlistid" select="@字:编号引用"/>
- <xsl:variable name="currlist" select="."/>
- <xsl:variable name="rootlist" select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符 =$currlistid]"/>
- <xsl:if test="not(ancestor::字:段落/preceding-sibling::字:段落[1]/字:段落属性/字:自动编号信息/@字:编号引用= $currlistid)">
- <xsl:element name="text:list-style">
- <xsl:attribute name="style:name">List<xsl:value-of select="count(preceding::字:自动编号信息)"/></xsl:attribute>
- <xsl:for-each select="$rootlist">
- <xsl:call-template name="自动编号"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- </office:automatic-styles>
- <office:master-styles>
- <xsl:apply-templates select="uof:演示文稿/演:主体/演:母版集"/>
- </office:master-styles>
- <office:body>
- <office:presentation>
- <xsl:apply-templates select="uof:演示文稿/演:主体/演:幻灯片集"/>
- <xsl:apply-templates select="uof:演示文稿/演:公用处理规则/演:放映设置"/>
- </office:presentation>
- </office:body>
- </office:document>
- </xsl:template>
- <xsl:template match="演:放映设置">
- <presentation:settings>
- <xsl:variable name="start-page">
- <xsl:choose>
- <xsl:when test="contains(演:幻灯片序列,' ')">
- <xsl:value-of select="substring-before(演:幻灯片序列,' ')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="演:幻灯片序列"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="first-page">
- <xsl:value-of select="/uof:UOF/uof:演示文稿/演:主体/演:幻灯片集/演:幻灯片[1]/@演:名称"/>
- </xsl:variable>
- <xsl:if test="not($start-page = $first-page)">
- <xsl:attribute name="presentation:start-page"><xsl:value-of select="$start-page"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="演:全屏放映='false'">
- <xsl:attribute name="presentation:full-screen">false</xsl:attribute>
- </xsl:if>
- <xsl:if test="演:循环放映='true'">
- <xsl:attribute name="presentation:endless">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="演:放映间隔">
- <xsl:attribute name="presentation:pause"><xsl:variable name="OOtime"><xsl:value-of select="substring-after(演:放映间隔,'P0Y0M0DT')"/></xsl:variable><xsl:value-of select="concat('PT',$OOtime)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="演:手动方式='true'">
- <xsl:attribute name="presentation:force-manual">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="演:导航帮助='true'">
- <xsl:attribute name="presentation:start-with-navigator">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="演:放映动画='false'">
- <xsl:attribute name="presentation:animations">disabled</xsl:attribute>
- </xsl:if>
- <xsl:if test="演:前端显示='true'">
- <xsl:attribute name="presentation:stay-on-top">true</xsl:attribute>
- </xsl:if>
- </presentation:settings>
- </xsl:template>
- <xsl:template name="自动编号">
- <xsl:for-each select="字:级别">
- <xsl:choose>
- <xsl:when test="字:项目符号">
- <xsl:call-template name="xiangmufuhao">
- <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="字:图片符号引用">
- <xsl:call-template name="imagefuhao">
- <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="jibianhao">
- <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="编号字体">
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号">
- <xsl:if test="字:级别/字:符号字体">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="concat( @字:标识符,字:级别/@字:级别值)"/></xsl:attribute>
- <xsl:attribute name="style:family">text</xsl:attribute>
- <xsl:element name="style:text-properties">
- <xsl:attribute name="fo:color"><xsl:value-of select="字:级别/字:符号字体/字:字体/@字:颜色"/></xsl:attribute>
- <xsl:if test="字:级别/字:符号字体/字:粗体 and 字:级别/字:符号字体/字:粗体/@字:值='true'">
- <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
- <xsl:attribute name="style:font-style-asian">bold</xsl:attribute>
- </xsl:if>
- <xsl:variable name="ziti">
- <xsl:value-of select="字:级别/字:符号字体/字:字体/@字:中文字体引用"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:字体集/uof:字体声明">
- <xsl:if test="@uof:标识符=$ziti">
- <xsl:attribute name="style:font-name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- <xsl:attribute name="fo:font-style">normal</xsl:attribute>
- <xsl:attribute name="style:font-weight-asian">normal</xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="uof:对象集">
- <xsl:apply-templates select="图:图形"/>
- <xsl:apply-templates select="图:图形/图:文本内容/字:段落/字:句/字:句属性" mode="style"/>
- </xsl:template>
- <xsl:variable name="uofUnit">
- <xsl:variable name="uu">
- <xsl:value-of select="/uof:UOF/uof:演示文稿/演:公用处理规则/演:度量单位"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$uu='cm'">cm</xsl:when>
- <xsl:when test="$uu='mm'">mm</xsl:when>
- <xsl:when test="$uu='pt'">pt</xsl:when>
- <xsl:when test="$uu='inch'">inch</xsl:when>
- <xsl:otherwise>pt</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="other-to-cm-conversion-factor">
- <xsl:choose>
- <xsl:when test="$uofUnit='cm'">1</xsl:when>
- <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
- <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
- <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
- <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:key match="/uof:UOF/uof:演示文稿/演:主体/演:母版集/演:母版/uof:锚点 | /uof:UOF/uof:演示文稿/演:主体/演:幻灯片集/演:幻灯片/uof:锚点 | /uof:UOF/uof:演示文稿/演:主体/演:幻灯片集/演:幻灯片/演:幻灯片备注/uof:锚点" name="rel_graphic_name" use="@uof:图形引用"/>
- <xsl:template match="图:图形">
- <xsl:variable name="random-name">
- <xsl:value-of select="generate-id()"/>
- </xsl:variable>
- <xsl:variable name="draw-name">
- <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
- </xsl:variable>
- <xsl:call-template name="graphic-fill">
- <xsl:with-param name="draw-name" select="$draw-name"/>
- <xsl:with-param name="gradient-name" select="图:预定义图形/图:属性/图:填充/图:渐变"/>
- </xsl:call-template>
- <xsl:variable name="biaozhifu" select="@图:标识符"/>
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="style:family"><xsl:choose><xsl:when test="图:预定义图形/图:类别='3' or 图:预定义图形/图:类别='67'">presentation</xsl:when><xsl:otherwise>graphic</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="/uof:UOF/uof:演示文稿/演:主体/演:母版集/演:母版/uof:锚点[@uof:图形引用=$biaozhifu]">
- <xsl:variable name="duan" select="图:文本内容/字:段落/字:段落属性/@字:式样引用"/>
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="/uof:UOF/uof:式样集/uof:段落式样[@字:标识符=$duan]/@字:基式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="style:graphic-properties">
- <xsl:call-template name="process-graphics">
- <xsl:with-param name="draw-name" select="$draw-name"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="style:family"><xsl:choose><xsl:when test="图:预定义图形/图:类别='3' or 图:预定义图形/图:类别='67'">presentation</xsl:when><xsl:otherwise>graphic</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="/uof:UOF/uof:演示文稿/演:主体/演:母版集/演:母版/uof:锚点[@uof:图形引用=$biaozhifu]">
- <xsl:variable name="duan" select="图:文本内容/字:段落/字:段落属性/@字:式样引用"/>
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="/uof:UOF/uof:式样集/uof:段落式样[@字:标识符=$duan]/@字:基式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="style:graphic-properties">
- <xsl:if test="@图:其他对象">
- <xsl:attribute name="fo:clip">rect(0cm 0cm 0cm 0cm)</xsl:attribute>
- <xsl:attribute name="draw:color-mode">standard</xsl:attribute>
- <xsl:attribute name="draw:luminance">0%</xsl:attribute>
- <xsl:attribute name="draw:contrast">0%</xsl:attribute>
- <xsl:attribute name="draw:gamma">100%</xsl:attribute>
- <xsl:attribute name="draw:red">0%</xsl:attribute>
- <xsl:attribute name="draw:green">0%</xsl:attribute>
- <xsl:attribute name="draw:blue">0%</xsl:attribute>
- <xsl:attribute name="draw:image-opacity">100%</xsl:attribute>
- <xsl:attribute name="style:mirror">none</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="process-graphics"/>
- </xsl:element>
- <xsl:if test="图:文本内容/@图:文字排列方向='vert-r2l' or 图:文本内容/@图:文字排列方向='vert-l2r'">
- <xsl:element name="style:paragraph-properties">
- <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="process-graphics">
- <xsl:param name="draw-name"/>
- <xsl:if test="not(key('rel_graphic_name',@图:标识符)/@uof:随动方式='movesize')">
- <xsl:attribute name="style:protect"><xsl:choose><xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:随动方式='move'">size</xsl:when><xsl:otherwise>position size</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="not(图:预定义图形/图:属性/图:填充)">
- <xsl:attribute name="draw:fill">none</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片">
- <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
- <xsl:attribute name="draw:fill-image-name"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:attribute>
- <xsl:if test="not(图:预定义图形/图:属性/图:填充/图:图片/@图:位置='title')">
- <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案">
- <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:前景色"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:颜色">
- <xsl:attribute name="draw:fill">solid</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
- <xsl:attribute name="draw:fill">gradient</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:渐变/@图:起始色"/></xsl:attribute>
- <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="图:预定义图形/图:属性/图:线颜色">
- <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:线型 and not(图:预定义图形/图:属性/图:线型 = 'single') and not(图:预定义图形/图:属性/图:线型 = 'thick')">
- <xsl:variable name="linetype" select="图:预定义图形/图:属性/图:线型"/>
- <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="$linetype='none'">none</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$linetype='dot-dot-dash' or $linetype='dash-dot-dot-heavy'">_32__20_Dots_20_1_20_Dash</xsl:when><xsl:when test="$linetype='dash' or $linetype='dashed-heavy'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$linetype='dotted' or $linetype='dotted-heavy'">Ultrafine_20_Dotted_20__28_var_29_</xsl:when><xsl:when test="$linetype='double'">Line_20_with_20_Fine_20_Dots</xsl:when><xsl:when test="$linetype='dot-dash' or $linetype='dash-dot-heavy'">_33__20_Dashes_20_3_20_Dots_20__28_var_29_</xsl:when><xsl:when test="$linetype='wave' or $linetype='wavy-heavy'">Ultrafine_20_2_20_Dots_20_3_20_Dashes</xsl:when><xsl:when test="$linetype='wavy-double'">Fine_20_Dashed_20__28_var_29_</xsl:when><xsl:otherwise>Fine Dashed</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:线粗细">
- <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:线粗细,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
- <xsl:attribute name="draw:marker-start"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line_20_Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow_20_concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square_20_45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:前端箭头/图:大小">
- <xsl:attribute name="draw:marker-start-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
- <xsl:attribute name="draw:marker-end"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line_20_Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow_20_concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square_20_45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:后端箭头/图:大小">
- <xsl:attribute name="draw:marker-end-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:透明度">
- <xsl:attribute name="draw:opacity"><xsl:variable name="opacity"><xsl:value-of select="./图:预定义图形/图:属性/图:透明度"/></xsl:variable><xsl:value-of select="concat((1 - $opacity)*100,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:for-each select="图:文本内容">
- <xsl:if test="@图:上边距">
- <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(@图:上边距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(@图:下边距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(@图:左边距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(@图:右边距,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="not(@图:文字排列方向='middle')">
- <xsl:variable name="hori-or-vert" select="@图:文字排列方向"/>
- <xsl:choose>
- <xsl:when test="$hori-or-vert='vert-l2r'">
- <xsl:attribute name="draw:textarea-vertical-align">bottom</xsl:attribute>
- </xsl:when>
- <xsl:when test="$hori-or-vert='hori-l2r'">
- <xsl:attribute name="draw:textarea-horizontal-align">left</xsl:attribute>
- </xsl:when>
- <xsl:when test="$hori-or-vert='hori-r2l'">
- <xsl:attribute name="draw:textarea-horizontal-align">right</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$hori-or-vert"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@图:自动换行">
- <xsl:attribute name="fo:wrap-option">no-wrap</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="draw:auto-grow-width"><xsl:choose><xsl:when test="@图:大小适应文字">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:for-each>
- </xsl:if>
- </xsl:template>
- <xsl:template name="bina_graphic">
- <xsl:param name="refGraphic"/>
- <xsl:element name="office:binary-data">
- <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符 = $refGraphic]">
- <xsl:value-of select="uof:数据"/>
- </xsl:for-each>
- </xsl:element>
- <text:p/>
- </xsl:template>
- <xsl:template name="graphic-fill">
- <xsl:param name="draw-name"/>
- <xsl:param name="gradient-name"/>
- <xsl:if test="图:预定义图形/图:属性/图:填充/图:渐变">
- <xsl:element name="draw:gradient">
- <xsl:attribute name="draw:name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
- <xsl:attribute name="draw:style"><xsl:choose><xsl:when test="$gradient-name/@图:种子类型='linear'"><xsl:value-of select="'linear'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='radar'"><xsl:value-of select="'radial'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='oval'"><xsl:value-of select="'ellipsoid'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='square'"><xsl:value-of select="'square'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='rectangle'"><xsl:value-of select="'rectangular'"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="draw:start-color"><xsl:value-of select="$gradient-name/@图:起始色"/></xsl:attribute>
- <xsl:attribute name="draw:end-color"><xsl:value-of select="$gradient-name/@图:终止色"/></xsl:attribute>
- <xsl:attribute name="draw:start-intensity"><xsl:value-of select="concat($gradient-name/@图:起始浓度,'%')"/></xsl:attribute>
- <xsl:attribute name="draw:end-intensity"><xsl:value-of select="concat($gradient-name/@图:终止浓度,'%')"/></xsl:attribute>
- <xsl:attribute name="draw:angle"><xsl:value-of select="$gradient-name/@图:渐变方向 * 10"/></xsl:attribute>
- <xsl:attribute name="draw:border"><xsl:value-of select="concat($gradient-name/@图:边界,'%')"/></xsl:attribute>
- <xsl:if test="$gradient-name/@图:种子X位置">
- <xsl:attribute name="draw:cx"><xsl:value-of select="concat($gradient-name/@图:种子X位置,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$gradient-name/@图:种子Y位置">
- <xsl:attribute name="draw:cy"><xsl:value-of select="concat($gradient-name/@图:种子Y位置,'%')"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
- <xsl:element name="draw:marker">
- <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line_20_Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow_20_concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square_20_45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">
- <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
- <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">
- <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
- <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
- <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
- <xsl:element name="draw:marker">
- <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line_20_Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow_20_concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square_20_45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">
- <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
- <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">
- <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
- <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
- <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用 or 图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
- <xsl:element name="draw:fill-image">
- <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:类型"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:call-template name="bina_graphic">
- <xsl:with-param name="refGraphic">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
- <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"/>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用">
- <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
- </xsl:when>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- <xsl:if test="not(图:预定义图形/图:属性/图:线型='single') and not(图:预定义图形/图:属性/图:线型='thick') and 图:预定义图形/图:属性/图:线型">
- <xsl:variable name="line" select="图:预定义图形/图:属性/图:线型"/>
- <xsl:element name="draw:stroke-dash">
- <xsl:choose>
- <xsl:when test="$line='dash-long' or $line='dash-long-heavy'">
- <xsl:attribute name="draw:name">Fine_20_Dashed</xsl:attribute>
- <xsl:attribute name="draw:display-name">Fine dashed</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">0.508cm</xsl:attribute>
- <xsl:attribute name="draw:dots2">1</xsl:attribute>
- <xsl:attribute name="draw:dots2-length">0.508cm</xsl:attribute>
- <xsl:attribute name="draw:distance">0.508cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='dot-dot-dash' or $line='dash-dot-dot-heavy'">
- <xsl:attribute name="draw:name">_32__20_Dots_20_1_20_Dash</xsl:attribute>
- <xsl:attribute name="draw:display-name">2 Dots 1 Dash</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">2</xsl:attribute>
- <xsl:attribute name="draw:dots2">1</xsl:attribute>
- <xsl:attribute name="draw:dots2-length">0.203cm</xsl:attribute>
- <xsl:attribute name="draw:distance">0.203cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='dash' or $line='dashed-heavy'">
- <xsl:attribute name="draw:name">Ultrafine_20_Dashed</xsl:attribute>
- <xsl:attribute name="draw:display-name">Ultrafine Dashed</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">0.051cm</xsl:attribute>
- <xsl:attribute name="draw:dots2">1</xsl:attribute>
- <xsl:attribute name="draw:dots2-length">0.051cm</xsl:attribute>
- <xsl:attribute name="draw:distance">0.051cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='dotted' or $line='dotted-heavy'">
- <xsl:attribute name="draw:name">Ultrafine_20_Dotted_20__28_var_29_</xsl:attribute>
- <xsl:attribute name="draw:display-name">Ultrafine Dotted (var)</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:distance">50%</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='wave' or $line='wavy-heavy'">
- <xsl:attribute name="draw:name">Ultrafine_20_2_20_Dots_20_3_20_Dashes</xsl:attribute>
- <xsl:attribute name="draw:display-name">Ultrafine 2 Dots 3 Dashes</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">2</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">0.051cm</xsl:attribute>
- <xsl:attribute name="draw:dots2">3</xsl:attribute>
- <xsl:attribute name="draw:dots2-length">0.254cm</xsl:attribute>
- <xsl:attribute name="draw:distance">0.127cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='dot-dash' or $line='dash-dot-heavy'">
- <xsl:attribute name="draw:name">_33__20_Dashes_20_3_20_Dots_20__28_var_29_</xsl:attribute>
- <xsl:attribute name="draw:display-name">3 Dashes 3 Dots (var)</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">3</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">197%</xsl:attribute>
- <xsl:attribute name="draw:dots2">3</xsl:attribute>
- <xsl:attribute name="draw:distance">100%</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='double'">
- <xsl:attribute name="draw:name">Line_20_with_20_Fine_20_Dots</xsl:attribute>
- <xsl:attribute name="draw:display-name">Line with Fine Dots</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">2.007cm</xsl:attribute>
- <xsl:attribute name="draw:dots2">10</xsl:attribute>
- <xsl:attribute name="draw:distance">0.152cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='wavy-double'">
- <xsl:attribute name="draw:name">Fine_20_Dashed_20__28_var_29_</xsl:attribute>
- <xsl:attribute name="draw:display-name">Fine Dashed (var)</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">197%</xsl:attribute>
- <xsl:attribute name="draw:distance">197%</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="draw:name">Fine Dashed</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">0.508cm</xsl:attribute>
- <xsl:attribute name="draw:dots2">1</xsl:attribute>
- <xsl:attribute name="draw:dots2-length">0.508cm</xsl:attribute>
- <xsl:attribute name="draw:distance">0.508cm</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="create-page-master">
- <xsl:param name="impressoptions"/>
- <xsl:for-each select="$impressoptions">
- <xsl:element name="style:page-layout">
- <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="@演:标识符"/></xsl:call-template></xsl:attribute>
- <xsl:element name="style:page-layout-properties">
- <xsl:if test="演:纸张/@uof:宽度">
- <xsl:attribute name="fo:page-width"><xsl:value-of select="concat(演:纸张/@uof:宽度,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="演:纸张/@uof:高度">
- <xsl:attribute name="fo:page-height"><xsl:value-of select="concat((演:纸张/@uof:高度),$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="演:页边距">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(演:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(演:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(演:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(演:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="演:纸张方向 = 'landscape'">
- <xsl:attribute name="style:print-orientation">landscape</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:print-orientation">portrait</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="encode-as-nc-name">
- <xsl:param name="string"/>
- <xsl:value-of select="translate($string, '. %()/\+', '')"/>
- </xsl:template>
- <xsl:key name="tianchongmu" match="/uof:UOF/uof:演示文稿/演:主体/演:母版集/演:母版" use="@演:配色方案引用"/>
- <xsl:key name="tianchonghuan" match="/uof:UOF/uof:演示文稿/演:主体/演:幻灯片集/演:幻灯片" use="@演:标识符"/>
- <xsl:template match="演:配色方案">
- <xsl:if test="key('tianchongmu',@演:标识符)/演:背景">
- <xsl:for-each select="key('tianchongmu',@演:标识符)/演:背景">
- <xsl:call-template name="officestyle"/>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="key('tianchonghuan',@演:标识符)/演:背景">
- <xsl:for-each select="key('tianchonghuan',@演:标识符)/演:背景">
- <xsl:call-template name="officestyle"/>
- </xsl:for-each>
- </xsl:if>
- <xsl:element name="style:style">
- <xsl:attribute name="style:family">drawing-page</xsl:attribute>
- <xsl:attribute name="style:name"><xsl:value-of select="@演:标识符"/></xsl:attribute>
- <xsl:element name="style:drawing-page-properties">
- <xsl:if test="演:填充">
- <xsl:attribute name="draw:fill">solid</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="演:背景色"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="演:背景色">
- <xsl:attribute name="draw:background-size">border</xsl:attribute>
- </xsl:if>
- <xsl:if test="演:阴影">
- <xsl:attribute name="draw:shadow">visible</xsl:attribute>
- <xsl:attribute name="draw:shadow-color"><xsl:value-of select="演:阴影"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="演:文本和线条">
- <xsl:attribute name="svg:stroke-color"><xsl:value-of select="演:文本和线条"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="key('tianchongmu',@演:标识符)/演:背景">
- <xsl:for-each select="key('tianchongmu',@演:标识符)/演:背景">
- <xsl:call-template name="background"/>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="key('tianchonghuan',@演:标识符)/演:背景">
- <xsl:for-each select="key('tianchonghuan',@演:标识符)/演:背景">
- <xsl:call-template name="background"/>
- </xsl:for-each>
- </xsl:if>
- </xsl:element>
- <xsl:variable name="style-name">
- <xsl:value-of select="@演:标识符"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF/uof:演示文稿/演:主体/演:幻灯片集/演:幻灯片[@演:标识符=$style-name]/演:切换">
- <style:drawing-page-properties>
- <xsl:if test="@演:速度='slow'">
- <xsl:attribute name="presentation:transition-speed">slow</xsl:attribute>
- </xsl:if>
- <xsl:if test="not(@演:效果 = 'none')">
- <xsl:variable name="effect">
- <xsl:value-of select="@演:效果"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$effect='box in'">
- <xsl:attribute name="smil:type">irisWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">rectangle</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='box out'">
- <xsl:attribute name="smil:type">irisWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">rectangle</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='checkerboard across'">
- <xsl:attribute name="smil:type">checkerBoardWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">across</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='checkerboard down'">
- <xsl:attribute name="smil:type">checkerBoardWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">down</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='comb horizontal'">
- <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">combHorizontal</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='comb vertical'">
- <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">combVertical</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='uncover down'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromTop</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='uncover left'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromRight</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='uncover right'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromLeft</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='uncover up'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromBottom</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='uncover left-down'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromTopRight</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='uncover left-up'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromBottomRight</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='uncover right-down'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromTopLeft</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='uncover right-up'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromBottomLeft</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='cover down'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromTop</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='cover left'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromRight</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='cover right'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromLeft</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='cover up'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromBottom</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='cover left-down'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromTopRight</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='cover left-up'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromBottomRight</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='cover right-down'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromTopLeft</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='cover right-up'">
- <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromBottomLeft</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='fade through black'">
- <xsl:attribute name="smil:type">fade</xsl:attribute>
- <xsl:attribute name="smil:subtype">fadeOverColor</xsl:attribute>
- <xsl:attribute name="smil:fadeColor">#000000</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='push down'">
- <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromTop</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='push left'">
- <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromRight</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='push right'">
- <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromLeft</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='push up'">
- <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fromBottom</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='random bars horizontal'">
- <xsl:attribute name="smil:type">randomBarWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">horizontal</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='random bars vertical'">
- <xsl:attribute name="smil:type">randomBarWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">vertical</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='shape circle'">
- <xsl:attribute name="smil:type">ellipseWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">circle</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='shape diamond'">
- <xsl:attribute name="smil:type">irisWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">diamond</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='shape plus'">
- <xsl:attribute name="smil:type">fourBoxWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">cornersOut</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='split horizontal in'">
- <xsl:attribute name="smil:type">barnDoorWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">horizontal</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='split horizontal out'">
- <xsl:attribute name="smil:type">barnDoorWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">horizontal</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='split vertical in'">
- <xsl:attribute name="smil:type">barnDoorWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">vertical</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='split vertical out'">
- <xsl:attribute name="smil:type">barnDoorWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">vertical</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='wedge'">
- <xsl:attribute name="smil:type">fanWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">centerTop</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='wheel clockwise – 1 spoke'">
- <xsl:attribute name="smil:type">pinWheelWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">oneBlade</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='wheel clockwise – 2 spoke'">
- <xsl:attribute name="smil:type">pinWheelWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">twoBladeVertical</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='wheel clockwise – 3 spoke'">
- <xsl:attribute name="smil:type">pinWheelWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">threeBlade</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='wheel clockwise – 4 spoke'">
- <xsl:attribute name="smil:type">pinWheelWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">fourBlade</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='wheel clockwise – 8 spoke'">
- <xsl:attribute name="smil:type">pinWheelWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">eightBlade</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='wipe left'">
- <xsl:attribute name="smil:type">barWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">leftToRight</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='wipe right'">
- <xsl:attribute name="smil:type">barWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">leftToRight</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='wipe up'">
- <xsl:attribute name="smil:type">barWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">topToBottom</xsl:attribute>
- <xsl:attribute name="smil:direction">reverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='wipe down'">
- <xsl:attribute name="smil:type">barWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">topToBottom</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='blinds vertical'">
- <xsl:attribute name="smil:type">blindsWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">vertical</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='blinds horizontal'">
- <xsl:attribute name="smil:type">blindsWipe</xsl:attribute>
- <xsl:attribute name="smil:subtype">horizontal</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='dissolve'">
- <xsl:attribute name="smil:type">dissolve</xsl:attribute>
- </xsl:when>
- <xsl:when test="$effect='random transition'">
- <xsl:attribute name="smil:type">random</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="演:方式/演:单击鼠标='false'">
- <xsl:attribute name="presentation:transition-type">automatic</xsl:attribute>
- </xsl:if>
- <xsl:if test="演:方式/演:时间间隔">
- <xsl:attribute name="presentation:duration"><xsl:value-of select="concat('PT00H00M',演:方式/演:时间间隔,'S')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="(演:声音/@演:预定义声音 and not(演:声音/@演:预定义声音='none')) or 演:声音/@演:自定义声音">
- <xsl:choose>
- <xsl:when test="演:声音/@演:预定义声音">
- <xsl:variable name="voice">
- <xsl:value-of select="演:声音/@演:预定义声音"/>
- </xsl:variable>
- <presentation:sound xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">
- <xsl:attribute name="xlink:href"><xsl:choose><xsl:when test="$voice='applause'">../../../../../../../softwware/Redoffcie%203.0/share/gallery/sounds/applause.wav</xsl:when><xsl:when test="$voice='explosion'">../../../../../../../softwware/Redoffcie%203.0/share/gallery/sounds/explos.wav</xsl:when><xsl:when test="$voice='laser'">../../../../../../../softwware/Redoffcie%203.0/share/gallery/sounds/laser.wav</xsl:when><xsl:otherwise><xsl:value-of select="演:声音/@演:预定义声音"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </presentation:sound>
- </xsl:when>
- <xsl:otherwise>
- <presentation:sound xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">
- <xsl:attribute name="xlink:href"><xsl:value-of select="演:声音/@演:自定义声音"/></xsl:attribute>
- </presentation:sound>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </style:drawing-page-properties>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template name="officestyle">
- <xsl:variable name="random-name">
- <xsl:value-of select="generate-id()"/>
- </xsl:variable>
- <xsl:variable name="draw-name">
- <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="图:渐变">
- <xsl:element name="draw:gradient">
- <xsl:attribute name="draw:name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
- <xsl:attribute name="draw:style"><xsl:choose><xsl:when test="图:渐变/@图:种子类型='linear'"><xsl:value-of select="'linear'"/></xsl:when><xsl:when test="图:渐变/@图:种子类型='radar'"><xsl:value-of select="'radial'"/></xsl:when><xsl:when test="图:渐变/@图:种子类型='oval'"><xsl:value-of select="'ellipsoid'"/></xsl:when><xsl:when test="图:渐变/@图:种子类型='square'"><xsl:value-of select="'square'"/></xsl:when><xsl:when test="图:渐变/@图:种子类型='rectangle'"><xsl:value-of select="'rectangular'"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="draw:start-color"><xsl:value-of select="图:渐变/@图:起始色"/></xsl:attribute>
- <xsl:attribute name="draw:end-color"><xsl:value-of select="图:渐变/@图:终止色"/></xsl:attribute>
- <xsl:attribute name="draw:start-intensity"><xsl:value-of select="concat(图:渐变/@图:起始浓度,'%')"/></xsl:attribute>
- <xsl:attribute name="draw:end-intensity"><xsl:value-of select="concat(图:渐变/@图:终止浓度,'%')"/></xsl:attribute>
- <xsl:attribute name="draw:angle"><xsl:value-of select="图:渐变/@图:渐变方向 * 10"/></xsl:attribute>
- <xsl:attribute name="draw:border"><xsl:value-of select="concat(图:渐变/@图:边界,'%')"/></xsl:attribute>
- <xsl:if test="图:渐变/@图:种子X位置">
- <xsl:attribute name="draw:cx"><xsl:value-of select="concat(图:渐变/@图:种子X位置,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:渐变/@图:种子Y位置">
- <xsl:attribute name="draw:cy"><xsl:value-of select="concat(图:渐变/@图:种子Y位置,'%')"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:when>
- <xsl:when test="图:图片/@图:图形引用 or 图:图案/@图:图形引用">
- <xsl:element name="draw:fill-image">
- <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:图案/@图:图形引用"><xsl:value-of select="图:图案/@图:类型"/></xsl:when><xsl:when test="图:图片/@图:图形引用"><xsl:value-of select="图:图片/@图:名称"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:call-template name="bina_graphic">
- <xsl:with-param name="refGraphic">
- <xsl:choose>
- <xsl:when test="图:图案/@图:图形引用">
- <xsl:value-of select="图:图案/@图:图形引用"/>
- </xsl:when>
- <xsl:when test="图:图片/@图:图形引用">
- <xsl:value-of select="图:图片/@图:图形引用"/>
- </xsl:when>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="background">
- <xsl:variable name="random-name">
- <xsl:value-of select="generate-id()"/>
- </xsl:variable>
- <xsl:variable name="draw-name">
- <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="图:图片">
- <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
- <xsl:attribute name="draw:fill-image-name"><xsl:value-of select="图:图片/@图:名称"/></xsl:attribute>
- <xsl:if test="not(图:图片/@图:位置='title')">
- <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:when>
- <xsl:when test="图:图案">
- <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:图案/@图:前景色"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:颜色">
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:颜色"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:渐变">
- <xsl:attribute name="draw:fill">gradient</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:渐变/@图:起始色"/></xsl:attribute>
- <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="演:母版集">
- <draw:layer-set>
- <draw:layer draw:name="layout"/>
- <draw:layer draw:name="background"/>
- <draw:layer draw:name="backgroundobjects"/>
- <draw:layer draw:name="controls"/>
- <draw:layer draw:name="measurelines"/>
- </draw:layer-set>
- <xsl:apply-templates select="演:母版"/>
- </xsl:template>
- <xsl:template match="演:母版">
- <xsl:choose>
- <xsl:when test="@演:类型 = 'handout' ">
- <xsl:element name="style:handout-master">
- <xsl:attribute name="style:name"><xsl:value-of select="@演:标识符"/></xsl:attribute>
- <xsl:attribute name="style:page-layout-name"><xsl:value-of select="@演:页面设置引用"/></xsl:attribute>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@演:配色方案引用"/></xsl:attribute>
- <xsl:for-each select="uof:锚点[@uof:缩略图='true']">
- <draw:page-thumbnail draw:layer="backgroundobjects">
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
- </draw:page-thumbnail>
- </xsl:for-each>
- <xsl:apply-templates select="uof:锚点[not(@uof:缩略图='true')]"/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@演:类型 = 'slide'">
- <xsl:element name="style:master-page">
- <xsl:attribute name="style:name"><xsl:value-of select="@演:标识符"/></xsl:attribute>
- <xsl:attribute name="style:page-layout-name"><xsl:value-of select="@演:页面设置引用"/></xsl:attribute>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@演:配色方案引用"/></xsl:attribute>
- <xsl:apply-templates select="uof:锚点 "/>
- <xsl:for-each select="/uof:UOF/uof:演示文稿/演:主体/演:母版集/演:母版">
- <xsl:if test="@演:类型 = 'notes'">
- <xsl:element name="presentation:notes">
- <xsl:attribute name="style:page-layout-name"><xsl:value-of select="@演:页面设置引用"/></xsl:attribute>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@演:配色方案引用"/></xsl:attribute>
- <xsl:apply-templates select="uof:锚点 "/>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="uof:句式样">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
- <xsl:if test="@字:基式样引用">
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="ancestor::字:段落式样">
- <xsl:attribute name="style:family">paragraph</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:family">text</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:element name="style:text-properties">
- <xsl:apply-templates select="*"/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="段落式样">
- <xsl:element name="style:style">
- <xsl:variable name="outline" select="@字:标识符"/>
- <xsl:attribute name="style:family"><xsl:choose><xsl:when test="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符=$outline]">presentation</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
- <xsl:if test="@字:基式样引用">
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符=$outline]">
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符=$outline]">
- <style:graphic-properties draw:stroke="none" draw:fill="none">
- <xsl:element name="text:list-style">
- <xsl:call-template name="自动编号"/>
- </xsl:element>
- </style:graphic-properties>
- </xsl:for-each>
- </xsl:if>
- <xsl:element name="style:paragraph-properties">
- <xsl:if test="字:自动编号信息">
- <xsl:attribute name="text:enable-numbering">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="contains($outline,'title')">
- <xsl:attribute name="fo:text-align">center</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="paragraph-properties"/>
- </xsl:element>
- <xsl:element name="style:text-properties">
- <xsl:apply-templates select="*"/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="paragraph-properties">
- <xsl:choose>
- <xsl:when test="descendant::字:页边距[@uof:左]">
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="number(((descendant::字:页边距/@uof:左)div 10) *1)"/>cm</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:margin-left">0cm</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="descendant::字:页边距[@uof:右]">
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="number(((descendant::字:页边距/@uof:右)div 10) *1)"/>cm</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:margin-right">0cm</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:text-indent">0cm</xsl:attribute>
- <xsl:call-template name="bidi"/>
- </xsl:template>
- <xsl:template name="bidi">
- </xsl:template>
- <xsl:template name="jibianhao">
- <xsl:param name="biaoshifu"/>
- <xsl:element name="text:list-level-style-number">
- <xsl:variable name="currlevel" select="number(@字:级别值)"/>
- <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
- <xsl:attribute name="text:style-name">Numbering Symbols</xsl:attribute>
- <xsl:if test="字:起始编号">
- <xsl:attribute name="text:start-value"><xsl:value-of select="字:起始编号"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:正规格式">
- <xsl:attribute name="text:num-regular-exp"><xsl:value-of select="字:正规格式/@值"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="text:display-levels"><xsl:value-of select="string-length(字:编号格式表示) - string-length(translate(字:编号格式表示,'%','') )"/></xsl:attribute>
- <xsl:if test="字:编号格式">
- <xsl:call-template name="编号格式"/>
- </xsl:if>
- <xsl:if test="字:编号格式表示">
- <xsl:attribute name="style:num-prefix"><xsl:choose><xsl:when test="number($currlevel) =1"><xsl:value-of select="substring-before(字:编号格式表示,concat('%',$currlevel))"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-after(substring-after( substring-before(字:编号格式表示,concat('%',$currlevel)),concat('%',string(number($currlevel) -1))),'.')"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,concat('%',$currlevel))"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="style:list-level-properties">
- <xsl:if test="@字:编号对齐方式">
- <xsl:attribute name="fo:text-align"><xsl:value-of select="@字:编号对齐方式"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="suojinleixing"/>
- </xsl:element>
- <xsl:element name="style:text-properties">
- <xsl:if test="字:符号字体">
- <xsl:variable name="Font-ID">
- <xsl:value-of select="字:符号字体/@字:式样引用"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
- <xsl:if test="@字:标识符=$Font-ID">
- <xsl:if test="字:字体/@字:中文字体引用">
- <xsl:attribute name="fo:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="字:符号字体">
- <xsl:apply-templates select="*"/>
- </xsl:for-each>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="xiangmufuhao">
- <xsl:param name="biaoshifu"/>
- <xsl:variable name="currlevel" select="number(@字:级别值)"/>
- <xsl:element name="text:list-level-style-bullet">
- <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat( $biaoshifu,$currlevel)"/></xsl:attribute>
- <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,'%1')"/></xsl:attribute>
- <xsl:attribute name="text:bullet-char"><xsl:value-of select="字:项目符号"/></xsl:attribute>
- <xsl:element name="style:list-level-properties">
- <xsl:if test="@字:编号对齐方式">
- <xsl:attribute name="fo:text-align"><xsl:value-of select="@字:编号对齐方式"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="suojinleixing"/>
- </xsl:element>
- <xsl:element name="style:text-properties">
- <xsl:if test="字:符号字体">
- <xsl:variable name="Font-ID">
- <xsl:value-of select="字:符号字体/@字:式样引用"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样[@字:标识符=$Font-ID]">
- <xsl:if test="字:字体/@字:中文字体引用">
- <xsl:attribute name="fo:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="字:符号字体">
- <xsl:apply-templates select="*"/>
- </xsl:for-each>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="suojinleixing">
- <xsl:if test="字:缩进/字:左/字:绝对/@字:值">
- <xsl:attribute name="text:space-before"><xsl:value-of select="concat(number(字:缩进/字:左/字:绝对/@字:值),$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:缩进/字:右/字:绝对/@字:值">
- <xsl:attribute name="text:min-label-width"><xsl:value-of select="concat(number(字:缩进/字:右/字:绝对/@字:值),$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:缩进/字:首行/字:绝对/@字:值">
- <xsl:attribute name="text:min-label-distance"><xsl:value-of select="concat(number(字:缩进/字:首行/字:绝对/@字:值),$uofUnit)"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template name="imagefuhao">
- <xsl:param name="biaoshifu"/>
- <xsl:variable name="currlevel" select="number(@字:级别值)"/>
- <xsl:element name="text:list-level-style-image" style:vertical-pos="middle" style:vertical-rel="line" fo:width="0.265cm" fo:height="0.265cm">
- <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat( $biaoshifu,$currlevel)"/></xsl:attribute>
- <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,'%1')"/></xsl:attribute>
- <xsl:if test="字:图片符号引用">
- <xsl:variable name="gid">
- <xsl:value-of select="字:图片符号引用"/>
- </xsl:variable>
- <xsl:element name="office:binary-data">
- <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据"/>
- </xsl:element>
- </xsl:if>
- <xsl:element name="style:list-level-properties">
- <xsl:attribute name="style:vertical-pos">middle</xsl:attribute>
- <xsl:attribute name="style:vertical-rel">line</xsl:attribute>
- <xsl:attribute name="fo:width"><xsl:value-of select="concat(字:图片符号引用/@字:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:height"><xsl:value-of select="concat(字:图片符号引用/@字:高度,$uofUnit)"/></xsl:attribute>
- <xsl:if test="字:符号字体">
- <xsl:variable name="Font-ID">
- <xsl:value-of select="字:符号字体/@字:式样引用"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
- <xsl:if test="@字:标识符=$Font-ID">
- <xsl:if test="字:字体/@字:中文字体引用">
- <xsl:attribute name="fo:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:if>
- <xsl:call-template name="suojinleixing"/>
- <xsl:if test="@字:编号对齐方式">
- <xsl:attribute name="fo:text-align"><xsl:value-of select="@字:编号对齐方式"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:element name="style:text-properties">
- <xsl:for-each select="字:符号字体">
- <xsl:apply-templates select="*"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="编号格式">
- <xsl:attribute name="style:num-format"><xsl:choose><xsl:when test="string(字:编号格式)='lower-letter'">a</xsl:when><xsl:when test="string(字:编号格式)='upper-letter'">A</xsl:when><xsl:when test="string(字:编号格式)='lower-roman'">i</xsl:when><xsl:when test="string(字:编号格式)='upper-roman'">I</xsl:when><xsl:when test="string(字:编号格式)='decimal-enclosed-circle'">①, ②, ③, ...</xsl:when><xsl:when test="string(字:编号格式)='ideograph-traditional'">甲, 乙, 丙, ...</xsl:when><xsl:when test="string(字:编号格式)='ideograph-zodiac'">子, 丑, 寅, ...</xsl:when><xsl:when test="string(字:编号格式)='chinese-counting'">一, 二, 三, ...</xsl:when><xsl:when test="string(字:编号格式)='chinese-legal-simplified'">壹, 贰, 叁, ...</xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:template>
- <xsl:template match="演:幻灯片集">
- <xsl:for-each select="演:幻灯片">
- <xsl:element name="draw:page">
- <xsl:attribute name="draw:name"><xsl:value-of select="@演:名称"/></xsl:attribute>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@演:标识符"/></xsl:attribute>
- <xsl:attribute name="draw:master-page-name"><xsl:value-of select="@演:母版引用"/></xsl:attribute>
- <xsl:if test="@演:页面版式引用">
- <xsl:attribute name="presentation:presentation-page-layout-name"><xsl:value-of select="@演:页面版式引用"/></xsl:attribute>
- </xsl:if>
- <office:forms form:automatic-focus="false" form:apply-design-mode="false"/>
- <xsl:apply-templates select="uof:锚点"/>
- <xsl:apply-templates select="演:动画"/>
- <xsl:element name="presentation:notes">
- <xsl:attribute name="draw:style-name">dp2</xsl:attribute>
- <xsl:apply-templates select="./演:幻灯片备注/uof:锚点"/>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="演:动画">
- <xsl:element name="anim:par">
- <xsl:attribute name="presentation:node-type">timing-root</xsl:attribute>
- <anim:seq presentation:node-type="main-sequence">
- <xsl:for-each select="演:序列">
- <anim:par begin="next">
- <anim:par smil:begin="0s">
- <xsl:variable name="animnodename">anim:par</xsl:variable>
- <xsl:choose>
- <xsl:when test="演:效果//演:其他">
- <xsl:copy-of select="演:效果//演:其他/*"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="{$animnodename}">
- <xsl:attribute name="smil:fill"><xsl:choose><xsl:when test="演:定时/@演:回卷='true'">remove</xsl:when><xsl:otherwise>hold</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:choose>
- <xsl:when test="演:增强/演:动画播放后/@演:播放后隐藏='true'">
- <xsl:attribute name="presentation:preset-property">Direction;Accelerate;Decelerate</xsl:attribute>
- </xsl:when>
- <xsl:when test=".//演:轮子">
- <xsl:attribute name="presentation:preset-property">Spokes</xsl:attribute>
- </xsl:when>
- <xsl:when test="演:效果/演:强调/演:更改填充颜色">
- <xsl:attribute name="presentation:preset-property">FillColor;ColorStyle;Accelerate;Decelerate;AutoReverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="演:效果/演:强调/演:更改字体颜色">
- <xsl:attribute name="presentation:preset-property">CharColor;ColorStyle;Accelerate;Decelerate;AutoReverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="演:效果/演:强调/演:更改字号">
- <xsl:attribute name="presentation:preset-property">CharHeight</xsl:attribute>
- </xsl:when>
- <xsl:when test="演:效果/演:强调/演:更改字形">
- <xsl:attribute name="presentation:preset-property">CharDecoration</xsl:attribute>
- </xsl:when>
- <xsl:when test="演:效果/演:强调/演:陀螺旋">
- <xsl:attribute name="presentation:preset-property">Rotate;Accelerate;Decelerate;AutoReverse</xsl:attribute>
- </xsl:when>
- <xsl:when test="演:效果/演:强调/演:透明">
- <xsl:attribute name="presentation:preset-property">Transparency</xsl:attribute>
- </xsl:when>
- <xsl:when test="演:效果/演:强调/演:更改线条颜色">
- <xsl:attribute name="presentation:preset-property">LineColor;ColorStyle;Accelerate;Decelerate;AutoReverse</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:attribute name="presentation:node-type"><xsl:choose><xsl:when test="演:定时/@演:事件='on click'">on-click</xsl:when><xsl:otherwise><xsl:value-of select="演:定时/@演:事件"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="smil:begin"><xsl:value-of select="演:定时/@演:延时"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="演:定时/@演:重复='until next click' ">
- <xsl:attribute name="smil:repeatCount">indefinite</xsl:attribute>
- <xsl:attribute name="smil:end">next</xsl:attribute>
- </xsl:when>
- <xsl:when test="演:定时/@演:重复='until next slide' ">
- <xsl:attribute name="smil:repeatCount">indefinite</xsl:attribute>
- </xsl:when>
- <xsl:when test="演:定时/@演:重复 !='none'">
- <xsl:attribute name="smil:repeatCount"><xsl:value-of select="演:定时/@演:重复"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="演:增强/演:动画文本/@演:发送">
- <xsl:attribute name="anim:iterate-type"><xsl:choose><xsl:when test="演:增强/演:动画文本/@演:发送='by word'">by-word</xsl:when><xsl:when test="演:增强/演:动画文本/@演:发送='by letter'">by-letter</xsl:when><xsl:otherwise>all at once</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="演:增强/演:动画文本/@演:间隔">
- <xsl:attribute name="anim:iterate-interval"><xsl:value-of select="演:增强/演:动画文本/@演:间隔"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$animnodename='anim:iterate' ">
- <xsl:attribute name="anim:id"><xsl:value-of select="@演:动画对象"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="演:效果"/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </anim:par>
- </anim:par>
- </xsl:for-each>
- </anim:seq>
- </xsl:element>
- </xsl:template>
- <xsl:template match="演:效果">
- <xsl:apply-templates select="演:进入 "/>
- <xsl:apply-templates select="演:强调"/>
- <xsl:apply-templates select="演:退出"/>
- </xsl:template>
- <xsl:template match="演:进入">
- <xsl:attribute name="presentation:preset-class">entrance</xsl:attribute>
- <xsl:apply-templates select="." mode="entrance"/>
- </xsl:template>
- <xsl:template match="演:强调">
- <xsl:attribute name="presentation:preset-class">emphasis</xsl:attribute>
- <xsl:apply-templates select="." mode="emphasis"/>
- </xsl:template>
- <xsl:template match="演:退出">
- <xsl:attribute name="presentation:preset-class">exit</xsl:attribute>
- <xsl:apply-templates select="." mode="exit"/>
- </xsl:template>
- <xsl:template name="演速度">
- <xsl:choose>
- <xsl:when test="./@演:速度='very fast' ">0.5s</xsl:when>
- <xsl:when test="./@演:速度='fast'">1s</xsl:when>
- <xsl:when test="./@演:速度='medium'">2s</xsl:when>
- <xsl:when test="./@演:速度='slow'">3s</xsl:when>
- <xsl:when test="./@演:速度='very slow'">5s</xsl:when>
- <xsl:otherwise>1s</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="演:出现" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-appear</xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" anim:sub-item="text" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:盒状" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-box</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.004s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="irisWipe" smil:subtype="rectangle" smil:direction="reverse">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:棋盘" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-checkerboard</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向='down'">downward</xsl:when><xsl:when test="@演:方向='across'">across</xsl:when></xsl:choose></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.004s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:dur="2s" anim:sub-item="text" smil:type="checkerBoardWipe" smil:subtype="down">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:圆形扩展" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-circle</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="ellipseWipe" smil:subtype="horizontal" smil:direction="reverse">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:阶梯状" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-diagonal-squares</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向='left down'">left-to-bottom</xsl:when><xsl:when test="@演:方向='left up'">left-to-top</xsl:when><xsl:when test="@演:方向='right down'">right-to-bottom</xsl:when><xsl:when test="@演:方向='right up'">right-to-top</xsl:when></xsl:choose></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="waterfallWipe" smil:direction="reverse">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向='left down'">horizontalLeft</xsl:when><xsl:when test="@演:方向='left up'">horizontalLeft</xsl:when><xsl:when test="@演:方向='right down'">horizontalRight</xsl:when><xsl:when test="@演:方向='right up'">horizontalRight</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:菱形" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-diamond</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="irisWipe" smil:subtype="diamond" smil:direction="reverse">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:内向溶解" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-dissolve-in</xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="dissolve" smil:direction="reverse">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:闪烁一次" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-flash-once</xsl:attribute>
- <anim:set smil:begin="0s" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:飞入" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-fly-in</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'from top-right'">from-top-right</xsl:when><xsl:when test="@演:方向 = 'from top-left'">from-top-left</xsl:when><xsl:when test="@演:方向 = 'from bottom-left'">from-bottom-left</xsl:when><xsl:when test="@演:方向 = 'from bottom-right'">from-bottom-right</xsl:when><xsl:when test="@演:方向 = 'from right'">from-right</xsl:when><xsl:when test="@演:方向 = 'from left'">from-left</xsl:when><xsl:when test="@演:方向 = 'from top'">from-top</xsl:when></xsl:choose></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <xsl:variable name="smilvalueX">
- <xsl:choose>
- <xsl:when test="contains(@演:方向,'right')">1+width/2;x</xsl:when>
- <xsl:when test="contains(@演:方向,'left')">0-width/2;x</xsl:when>
- <xsl:otherwise>x;x</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="smilvalueY">
- <xsl:choose>
- <xsl:when test="contains(@演:方向,'bottom')">1+height/2;y</xsl:when>
- <xsl:when test="contains(@演:方向,'top')">0-height/2;y</xsl:when>
- <xsl:otherwise>y;y</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <anim:animate smil:fill="hold" smil:attributeName="x" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueX"/></xsl:attribute>
- </anim:animate>
- <anim:animate smil:fill="hold" smil:attributeName="y" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueY"/></xsl:attribute>
- </anim:animate>
- </xsl:template>
- <xsl:template match="演:缓慢飞入" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-fly-in-slow</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'from right'">from-right</xsl:when><xsl:when test="@演:方向 = 'from left'">from-left</xsl:when><xsl:when test="@演:方向 = 'from top'">from-top</xsl:when></xsl:choose></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <xsl:variable name="smilvalueX">
- <xsl:choose>
- <xsl:when test="contains(@演:方向,'right')">1+width/2;x</xsl:when>
- <xsl:when test="contains(@演:方向,'left')">0-width/2;x</xsl:when>
- <xsl:otherwise>x;x</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="smilvalueY">
- <xsl:choose>
- <xsl:when test="contains(@演:方向,'bottom')">1+height/2;y</xsl:when>
- <xsl:when test="contains(@演:方向,'top')">0-height/2;y</xsl:when>
- <xsl:otherwise>y;y</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <anim:animate smil:fill="hold" smil:attributeName="x" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueX"/></xsl:attribute>
- </anim:animate>
- <anim:animate smil:fill="hold" smil:attributeName="y" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueY"/></xsl:attribute>
- </anim:animate>
- </xsl:template>
- <xsl:template match="演:切入" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-peek-in</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'from right'">from-right</xsl:when><xsl:when test="@演:方向 = 'from left'">from-left</xsl:when><xsl:when test="@演:方向 = 'from top'">from-top</xsl:when></xsl:choose></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="slideWipe" smil:direction="reverse">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">fromBottom</xsl:when><xsl:when test="@演:方向 = 'from right'">fromRight</xsl:when><xsl:when test="@演:方向 = 'from left'">fromLeft</xsl:when><xsl:when test="@演:方向 = 'from top'">fromTop</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:十字形扩展" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-plus</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.00025s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="fourBoxWipe" smil:direction="reverse">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'in'">cornersIn</xsl:when><xsl:when test="@演:方向 = 'out'">cornersOut</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:随机线条" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-bars</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="randomBarWipe" smil:direction="reverse">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'horizontal'">vertical</xsl:when><xsl:when test="@演:方向 = 'vertical'">horizontal</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:劈裂" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-split</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向 = 'horizontal out'">horizontal-out</xsl:when><xsl:when test="@演:方向= 'horizontal in'">horizontal-in</xsl:when><xsl:when test="@演:方向= 'vertical in'">vertical-in</xsl:when><xsl:when test="@演:方向= 'vertical out'">vertical-out</xsl:when></xsl:choose></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:dur="0.5s" smil:type="barnDoorWipe">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向 = 'horizontal out'">horizontal</xsl:when><xsl:when test="@演:方向= 'horizontal in'">horizontal</xsl:when><xsl:when test="@演:方向= 'vertical in'">vertical</xsl:when><xsl:when test="@演:方向= 'vertical out'">vertical</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:百叶窗" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-venetian-blinds</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="blindsWipe" smil:direction="reverse">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'horizontal'">vertical</xsl:when><xsl:when test="@演:方向 = 'vertical'">horizontal</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:扇形展开" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-wedge</xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.0015s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="fanWipe" smil:subtype="centerTop">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:轮子" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-wheel</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:辐射状"/></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.00025s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:dur="0.5s" smil:type="pinWheelWipe">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:辐射状='1'">oneBlade</xsl:when><xsl:when test="@演:辐射状='2'">twoBlade</xsl:when><xsl:when test="@演:辐射状='3'">threeBlade</xsl:when><xsl:when test="@演:辐射状='4'">fourBlade</xsl:when><xsl:when test="@演:辐射状='8'">eightBlade</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:擦除" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-wipe</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:速度 = 'from right'">from-right</xsl:when><xsl:when test="@演:速度 = 'from left'">from-left</xsl:when><xsl:when test="@演:速度 = 'from top'">from-top</xsl:when><xsl:when test="@演:速度 = 'from bottom'">from-bottom</xsl:when><xsl:otherwise>from-left</xsl:otherwise></xsl:choose></xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.006s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:transitionFilter smil:type="barWipe" smil:subtype="leftToRight" smil:direction="reverse">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="(@演:速度 = 'from right') or (@演:速度 = 'from left')">leftToRight</xsl:when><xsl:when test="(@演:速度 = 'from top') or (@演:速度 = 'from bottom')">topToBottom</xsl:when><xsl:otherwise>leftToRight</xsl:otherwise></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="演:随机效果" mode="entrance">
- <xsl:attribute name="presentation:preset-id">ooo-entrance-random</xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- <anim:animate smil:dur="1s" smil:fill="hold" smil:attributeName="width" smil:values="0;width" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- </anim:animate>
- <anim:animate smil:fill="hold" smil:attributeName="height" smil:values="0;height" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- </anim:animate>
- <anim:animate smil:fill="hold" smil:attributeName="rotate" smil:values="90;0" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- </anim:animate>
- <anim:transitionFilter smil:type="fade" smil:subtype="crossfade">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- </anim:transitionFilter>
- </xsl:template>
- <xsl:template match="更改填充颜色" mode="emphasis">
- <xsl:attribute name="presentation:preset-id">ooo-emphasis-fill-color</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type">2</xsl:attribute>
- <anim:animateColor smil:fill="hold" smil:attributeName="fill-color" presentation:additive="base" anim:color-interpolation="rgb" anim:color-interpolation-direction="clockwise">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:to"><xsl:value-of select="@演:颜色"/></xsl:attribute>
- </anim:animateColor>
- <anim:set smil:dur="0.5s" smil:fill="hold" smil:attributeName="fill" smil:to="solid">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="更改字体颜色" mode="emphasis">
- <xsl:attribute name="presentation:preset-id">ooo-emphasis-font-color</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type">2</xsl:attribute>
- <anim:animateColor smil:fill="hold" smil:attributeName="fill-color" presentation:additive="base" anim:color-interpolation="rgb" anim:color-interpolation-direction="clockwise">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:to"><xsl:value-of select="@演:颜色"/></xsl:attribute>
- </anim:animateColor>
- </xsl:template>
- <xsl:template match="演:更改字号" mode="emphasis">
- <xsl:attribute name="presentation:preset-id">ooo-emphasis-font-size</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type">2</xsl:attribute>
- <anim:animate smil:fill="hold" smil:attributeName="font-size" presentation:additive="base">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:to"><xsl:choose><xsl:when test="@演:预定义尺寸='tiny' ">0.25,1</xsl:when><xsl:when test="@演:预定义尺寸='smaller' ">0.5,1</xsl:when><xsl:when test="@演:预定义尺寸='larger' ">1.5,1</xsl:when><xsl:when test="@演:预定义尺寸='huge' ">4,1</xsl:when><xsl:when test="@演:自定义尺寸"><xsl:value-of select="@演:自定义尺寸"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
- </anim:animate>
- </xsl:template>
- <xsl:template name="emp_font_style">
- <xsl:param name="fontstyle"/>
- <xsl:choose>
- <xsl:when test="contains($fontstyle,' ')">
- <anim:set smil:dur="indefinite" smil:attributeName="font-style">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:to"><xsl:value-of select="substring-before($fontstyle,' ')"/></xsl:attribute>
- </anim:set>
- <xsl:variable name="fontstyle1">
- <xsl:choose>
- <xsl:when test="contains($fontstyle,' ')">
- <xsl:value-of select="substring-after($fontstyle,' ')"/>
- </xsl:when>
- <xsl:when test="not($fontstyle=' ')">
- <xsl:value-of select="$fontstyle"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="emp_font_style">
- <xsl:with-param name="fontstyle">
- <xsl:value-of select="$fontstyle1"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="演:更改字形" mode="emphasis">
- <xsl:attribute name="presentation:preset-id">ooo-emphasis-font-style</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type">1</xsl:attribute>
- <xsl:call-template name="emp_font_style">
- <xsl:with-param name="fontstyle">
- <xsl:value-of select="@演:字形"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="演:更改线条颜色" mode="emphasis">
- <xsl:attribute name="presentation:preset-id">ooo-emphasis-line-color</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type">2</xsl:attribute>
- <anim:animateColor smil:dur="0s" smil:fill="hold" smil:attributeName="stroke-color" presentation:additive="base" anim:color-interpolation="rgb" anim:color-interpolation-direction="clockwise">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:to"><xsl:value-of select="@演:颜色"/></xsl:attribute>
- </anim:animateColor>
- <anim:set smil:dur="0s" smil:fill="hold" anim:sub-item="text" smil:attributeName="stroke" smil:to="solid">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:陀螺旋" mode="emphasis">
- <xsl:attribute name="presentation:preset-id">ooo-emphasis-spin</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type">2</xsl:attribute>
- <anim:animateTransform smil:fill="hold" smil:by="180" presentation:additive="base" svg:type="rotate">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:by"><xsl:choose><xsl:when test="@演:预定义角度='quarter spin'">90</xsl:when><xsl:when test="@演:预定义角度='half spin'">180</xsl:when><xsl:when test="@演:预定义角度='full spin'">360</xsl:when><xsl:when test="@演:预定义角度='two spins'">720 </xsl:when><xsl:when test="@演:自定义角度"><xsl:value-of select="@演:自定义角度"/></xsl:when></xsl:choose></xsl:attribute>
- </anim:animateTransform>
- </xsl:template>
- <xsl:template match="演:透明" mode="emphasis">
- <xsl:attribute name="presentation:preset-id">ooo-emphasis-transparency</xsl:attribute>
- <xsl:attribute name="smil:repeatCount"><xsl:choose><xsl:when test="(@演:期间 = 'until next click') or (@演:期间 ='until next slide') ">indefinite</xsl:when><xsl:when test="@演:期间='2' or @演:期间 ='3' or @演:期间 ='4' or @演:期间 ='5' or @演:期间 ='10'"><xsl:value-of select="@演:期间"/></xsl:when><xsl:otherwise>2</xsl:otherwise></xsl:choose></xsl:attribute>
- <anim:set smil:dur="indefinite" anim:sub-item="text" smil:attributeName="opacity">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:to"><xsl:choose><xsl:when test="@演:预定义透明度='25' ">0.25</xsl:when><xsl:when test="@演:预定义透明度='50' ">0.5</xsl:when><xsl:when test="@演:预定义透明度='75' ">0.75</xsl:when><xsl:when test="@演:预定义透明度='100' ">1</xsl:when><xsl:when test="@演:自定义透明度"><xsl:value-of select="@演:自定义透明度"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:缩放" mode="emphasis">
- <xsl:attribute name="presentation:preset-id">ooo-emphasis-grow-and-shrink</xsl:attribute>
- <anim:animateTransform smil:fill="hold" anim:sub-item="text" presentation:additive="base" svg:type="scale">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:to"><xsl:choose><xsl:when test="@演:预定义尺寸='tiny' ">0.25,1</xsl:when><xsl:when test="@演:预定义尺寸='smaller' ">0.5,1</xsl:when><xsl:when test="@演:预定义尺寸='larger' ">1.5,1</xsl:when><xsl:when test="@演:预定义尺寸='huge' ">4,1</xsl:when><xsl:when test="@演:自定义尺寸"><xsl:value-of select="@演:自定义尺寸"/></xsl:when><xsl:otherwise>0.5,1</xsl:otherwise></xsl:choose></xsl:attribute>
- </anim:animateTransform>
- </xsl:template>
- <xsl:template match="演:盒状" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-box</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:transitionFilter smil:type="irisWipe" smil:subtype="rectangle" smil:direction="reverse" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.004s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:棋盘" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-checkerboard</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向='down'">downward</xsl:when><xsl:when test="@演:方向='across'">across</xsl:when></xsl:choose></xsl:attribute>
- <anim:transitionFilter smil:dur="2s" anim:sub-item="text" smil:type="checkerBoardWipe" smil:subtype="down" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.004s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:圆形扩展" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-circle</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:transitionFilter smil:type="ellipseWipe" smil:subtype="horizontal" smil:direction="reverse" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:阶梯状" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-diagonal-squares</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向='left down'">left-to-bottom</xsl:when><xsl:when test="@演:方向='left up'">left-to-top</xsl:when><xsl:when test="@演:方向='right down'">right-to-bottom</xsl:when><xsl:when test="@演:方向='right up'">right-to-top</xsl:when></xsl:choose></xsl:attribute>
- <anim:transitionFilter smil:type="waterfallWipe" smil:direction="reverse" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向='left down'">horizontalLeft</xsl:when><xsl:when test="@演:方向='left up'">horizontalLeft</xsl:when><xsl:when test="@演:方向='right down'">horizontalRight</xsl:when><xsl:when test="@演:方向='right up'">horizontalRight</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:菱形" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-diamond</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:transitionFilter smil:type="irisWipe" smil:subtype="diamond" smil:direction="reverse" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:消失" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-disappear</xsl:attribute>
- <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" anim:sub-item="text" smil:attributeName="visibility" smil:to="visible">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:向外溶解" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-dissolve</xsl:attribute>
- <anim:transitionFilter smil:type="dissolve" smil:direction="reverse" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:闪烁一次" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-flash-once</xsl:attribute>
- <anim:animate smil:attributeName="visibility" smil:values="hidden;visible" smil:keyTimes="0;0.5" smil:calcMode="discrete" presentation:additive="base">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:animate>
- <anim:set smil:dur="0s" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:飞出" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-fly-out</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'to bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'to top-right'">from-top-right</xsl:when><xsl:when test="@演:方向 = 'to top-left'">from-top-left</xsl:when><xsl:when test="@演:方向 = 'to bottom-left'">from-bottom-left</xsl:when><xsl:when test="@演:方向 = 'to bottom-right'">from-bottom-right</xsl:when><xsl:when test="@演:方向 = 'to right'">from-right</xsl:when><xsl:when test="@演:方向 = 'to left'">from-left</xsl:when><xsl:when test="@演:方向 = 'to top'">from-top</xsl:when></xsl:choose></xsl:attribute>
- <xsl:variable name="smilvalueX">
- <xsl:choose>
- <xsl:when test="contains(@演:方向,'right')">x;1+width/2</xsl:when>
- <xsl:when test="contains(@演:方向,'left')">x;0-width/2</xsl:when>
- <xsl:otherwise>x;x</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="smilvalueY">
- <xsl:choose>
- <xsl:when test="contains(@演:方向,'bottom')">y;1+height/2</xsl:when>
- <xsl:when test="contains(@演:方向,'top')">y;0-height/2</xsl:when>
- <xsl:otherwise>y;y</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <anim:animate smil:fill="hold" smil:attributeName="x" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueX"/></xsl:attribute>
- </anim:animate>
- <anim:animate smil:fill="hold" smil:attributeName="y" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueY"/></xsl:attribute>
- </anim:animate>
- <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:缓慢移出" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-crawl-out</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'to bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'to right'">from-right</xsl:when><xsl:when test="@演:方向 = 'to left'">from-left</xsl:when><xsl:when test="@演:方向 = 'to top'">from-top</xsl:when></xsl:choose></xsl:attribute>
- <xsl:variable name="smilvalueX">
- <xsl:choose>
- <xsl:when test="contains(@演:方向,'right')">x;1+width/2</xsl:when>
- <xsl:when test="contains(@演:方向,'left')">x;0-width/2</xsl:when>
- <xsl:otherwise>x;x</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="smilvalueY">
- <xsl:choose>
- <xsl:when test="contains(@演:方向,'bottom')">y;1+height/2</xsl:when>
- <xsl:when test="contains(@演:方向,'top')">y;0-height/2</xsl:when>
- <xsl:otherwise>y;y</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <anim:animate smil:fill="hold" smil:attributeName="x" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueX"/></xsl:attribute>
- </anim:animate>
- <anim:animate smil:fill="hold" smil:attributeName="y" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueY"/></xsl:attribute>
- </anim:animate>
- <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:切出" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-peek-out</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'from right'">from-right</xsl:when><xsl:when test="@演:方向 = 'from left'">from-left</xsl:when><xsl:when test="@演:方向 = 'from top'">from-top</xsl:when></xsl:choose></xsl:attribute>
- <anim:transitionFilter smil:type="slideWipe" smil:direction="reverse" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">fromBottom</xsl:when><xsl:when test="@演:方向 = 'from right'">fromRight</xsl:when><xsl:when test="@演:方向 = 'from left'">fromLeft</xsl:when><xsl:when test="@演:方向 = 'from top'">fromTop</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:十字形扩展" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-plus</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:transitionFilter smil:type="fourBoxWipe" smil:direction="reverse" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'in'">cornersIn</xsl:when><xsl:when test="@演:方向 = 'out'">cornersOut</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.00025s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:随机线条" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-random-bars</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:transitionFilter smil:type="randomBarWipe" smil:direction="reverse" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'horizontal'">vertical</xsl:when><xsl:when test="@演:方向 = 'vertical'">horizontal</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:劈裂" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-split</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向 = 'horizontal out'">horizontal-out</xsl:when><xsl:when test="@演:方向= 'horizontal in'">horizontal-in</xsl:when><xsl:when test="@演:方向= 'vertical in'">vertical-in</xsl:when><xsl:when test="@演:方向= 'vertical out'">vertical-out</xsl:when></xsl:choose></xsl:attribute>
- <anim:transitionFilter smil:dur="0.5s" smil:type="barnDoorWipe" smil:mode="out">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向 = 'horizontal out'">horizontal</xsl:when><xsl:when test="@演:方向= 'horizontal in'">horizontal</xsl:when><xsl:when test="@演:方向= 'vertical in'">vertical</xsl:when><xsl:when test="@演:方向= 'vertical out'">vertical</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:百叶窗" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-venetian-blinds</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
- <anim:transitionFilter smil:type="blindsWipe" smil:direction="reverse" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'horizontal'">vertical</xsl:when><xsl:when test="@演:方向 = 'vertical'">horizontal</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:扇形展开" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-wedge</xsl:attribute>
- <anim:transitionFilter smil:type="fanWipe" smil:subtype="centerTop" smil:mode="out">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.0015s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:轮子" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-wheel</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:辐射状"/></xsl:attribute>
- <anim:transitionFilter smil:dur="0.5s" smil:type="pinWheelWipe" smil:mode="out">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:辐射状='1'">oneBlade</xsl:when><xsl:when test="@演:辐射状='2'">twoBlade</xsl:when><xsl:when test="@演:辐射状='3'">threeBlade</xsl:when><xsl:when test="@演:辐射状='4'">fourBlade</xsl:when><xsl:when test="@演:辐射状='8'">eightBlade</xsl:when></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.00025s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:擦除" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-wipe</xsl:attribute>
- <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:速度 = 'from right'">from-right</xsl:when><xsl:when test="@演:速度 = 'from left'">from-left</xsl:when><xsl:when test="@演:速度 = 'from top'">from-top</xsl:when><xsl:when test="@演:速度 = 'from bottom'">from-bottom</xsl:when><xsl:otherwise>from-left</xsl:otherwise></xsl:choose></xsl:attribute>
- <anim:transitionFilter smil:type="barWipe" smil:subtype="leftToRight" smil:direction="reverse" smil:mode="out">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="(@演:速度 = 'from right') or (@演:速度 = 'from left')">leftToRight</xsl:when><xsl:when test="(@演:速度 = 'from top') or (@演:速度 = 'from bottom')">topToBottom</xsl:when><xsl:otherwise>leftToRight</xsl:otherwise></xsl:choose></xsl:attribute>
- </anim:transitionFilter>
- <anim:set smil:dur="0.006s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="演:随机效果" mode="exit">
- <xsl:attribute name="presentation:preset-id">ooo-exit-random</xsl:attribute>
- <anim:transitionFilter smil:type="fade" smil:subtype="crossfade" smil:mode="out">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:transitionFilter>
- <anim:animate smil:attributeName="x" smil:values="x;x" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:animate>
- <anim:animate smil:dur="0.1s" smil:decelerate="1" smil:attributeName="y" smil:values="y;y-.03" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:animate>
- <anim:animate smil:begin="0.1s" smil:dur="0.9s" smil:accelerate="1" smil:attributeName="y" smil:values="y;y+1" smil:keyTimes="0;1" presentation:additive="base">
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:animate>
- <anim:set smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
- <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
- <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
- </anim:set>
- </xsl:template>
- <xsl:template match="uof:锚点" name="图形解析">
- <xsl:variable name="tuxing1" select="@uof:图形引用"/>
- <xsl:choose>
- <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]">
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='png' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='jpg' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='gif'">
- <xsl:element name="draw:frame">
- <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::uof:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
- <xsl:attribute name="presentation:class">graphic</xsl:attribute>
- <xsl:attribute name="presentation:user-transformed">true</xsl:attribute>
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="draw:layer">layout</xsl:attribute>
- <xsl:if test="../演:动画/演:序列/@演:动画对象=$tuxing1">
- <xsl:attribute name="draw:id"><xsl:value-of select="$tuxing1"/></xsl:attribute>
- </xsl:if>
- <draw:image>
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
- <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
- <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据">
- <office:binary-data>
- <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据"/>
- </office:binary-data>
- </xsl:if>
- </draw:image>
- </xsl:element>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="graph">
- <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]"/>
- <xsl:with-param name="groupx" select="0"/>
- <xsl:with-param name="groupy" select="0"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="graph">
- <xsl:param name="id"/>
- <xsl:param name="groupx"/>
- <xsl:param name="groupy"/>
- <xsl:for-each select="$id">
- <xsl:variable name="tuxing1">
- <xsl:value-of select="图:预定义图形/图:类别"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$tuxing1='11'">
- <xsl:call-template name="Rectangle">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='19'">
- <xsl:call-template name="Oval">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='61'">
- <xsl:call-template name="Line">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='64'">
- <xsl:call-template name="Curve">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='65'">
- <xsl:call-template name="Freeform">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='66'">
- <xsl:call-template name="Scribble">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='3'">
- <xsl:call-template name="演文本框"/>
- </xsl:when>
- <xsl:when test="$tuxing1='67'">
- <xsl:call-template name="演缩略图"/>
- </xsl:when>
- <xsl:when test="$tuxing1='4'">
- <xsl:element name="draw:g">
- <xsl:variable name="tu">
- <xsl:value-of select="@图:标识符"/>
- </xsl:variable>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="$tu"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:variable name="this-group-x">
- <xsl:value-of select="key('rel_graphic_name',@图:标识符)/@uof:x坐标"/>
- </xsl:variable>
- <xsl:variable name="this-group-y">
- <xsl:value-of select="key('rel_graphic_name',@图:标识符)/uof:y坐标"/>
- </xsl:variable>
- <xsl:variable name="group-x">
- <xsl:value-of select="number($groupx + $this-group-x)"/>
- </xsl:variable>
- <xsl:variable name="group-y">
- <xsl:value-of select="number($groupy + $this-group-y)"/>
- </xsl:variable>
- <xsl:call-template name="组合图形">
- <xsl:with-param name="zuheliebiao" select="@图:组合列表"/>
- <xsl:with-param name="groupx1" select="$group-x"/>
- <xsl:with-param name="groupy1" select="$group-y"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="common">
- <xsl:param name="groupx"/>
- <xsl:param name="groupy"/>
- <xsl:variable name="tuxing">
- <xsl:value-of select="@图:标识符"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="key('rel_graphic_name',@图:标识符)">
- <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="draw:layer"><xsl:choose><xsl:when test="parent::演:母版">backgroundobjects</xsl:when><xsl:otherwise>layout</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="../演:动画/演:序列/@演:动画对象=$tuxing">
- <xsl:attribute name="draw:id"><xsl:value-of select="$tuxing"/></xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="zuheweizhi-x">
- <xsl:value-of select="图:组合位置/@图:x坐标"/>
- </xsl:variable>
- <xsl:variable name="zuheweizhi-y">
- <xsl:value-of select="图:组合位置/@图:y坐标"/>
- </xsl:variable>
- <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(($groupx + $zuheweizhi-x),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(($groupy + $zuheweizhi-y),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(图:预定义图形 /图:属性/图:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(图:预定义图形/图:属性 /图:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="draw:layer">layout</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="rotate-angle">
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- <xsl:apply-templates select="图:文本内容/字:文字表"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="组合图形">
- <xsl:param name="zuheliebiao"/>
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:variable name="x">
- <xsl:value-of select="$groupx1"/>
- </xsl:variable>
- <xsl:variable name="y">
- <xsl:value-of select="$groupy1"/>
- </xsl:variable>
- <xsl:variable name="first-pictures">
- <xsl:value-of select="substring-before($zuheliebiao,',')"/>
- </xsl:variable>
- <xsl:variable name="other-pictures">
- <xsl:value-of select="substring-after($zuheliebiao,',')"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($other-pictures,',')">
- <xsl:call-template name="graph">
- <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $first-pictures]"/>
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- <xsl:call-template name="组合图形">
- <xsl:with-param name="zuheliebiao" select="$other-pictures"/>
- <xsl:with-param name="groupx1" select="$x"/>
- <xsl:with-param name="groupy1" select="$y"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="graph">
- <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $first-pictures]"/>
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- <xsl:call-template name="graph">
- <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $other-pictures]"/>
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="Curve">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:path">
- <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
- <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
- <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
- <xsl:attribute name="svg:d"><xsl:value-of select="图:预定义图形/图:关键点坐标/@图:路径"/></xsl:attribute>
- <xsl:call-template name="common">
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Freeform">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:polygon">
- <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
- <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
- <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
- <xsl:attribute name="draw:points"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="图:预定义图形/图:关键点坐标/@图:路径"/><xsl:with-param name="value"/></xsl:call-template></xsl:attribute>
- <xsl:call-template name="common">
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Scribble">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:polyline">
- <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
- <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
- <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
- <xsl:attribute name="draw:points"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="图:预定义图形/图:关键点坐标/@图:路径"/><xsl:with-param name="value"/></xsl:call-template></xsl:attribute>
- <xsl:call-template name="common">
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="drawpoints">
- <xsl:param name="points"/>
- <xsl:param name="value"/>
- <xsl:variable name="frist-piont">
- <xsl:value-of select="substring-before($points,'lineto')"/>
- </xsl:variable>
- <xsl:variable name="other-points">
- <xsl:value-of select="substring-after($points,'lineto')"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($other-points,'lineto')">
- <xsl:variable name="x-coor">
- <xsl:value-of select="substring-before($frist-piont,' ') * 1000"/>
- </xsl:variable>
- <xsl:variable name="y-coor">
- <xsl:value-of select="substring-after($frist-piont,' ') * 1000"/>
- </xsl:variable>
- <xsl:variable name="all-points">
- <xsl:value-of select="concat($value,$x-coor,',',$y-coor,' ')"/>
- </xsl:variable>
- <xsl:call-template name="drawpoints">
- <xsl:with-param name="points" select="$other-points"/>
- <xsl:with-param name="value" select="$all-points"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="q-x-coor">
- <xsl:value-of select="substring-before($frist-piont,' ') * 1000"/>
- </xsl:variable>
- <xsl:variable name="q-y-coor">
- <xsl:value-of select="substring-after($frist-piont,' ') * 1000"/>
- </xsl:variable>
- <xsl:variable name="e-x-coor">
- <xsl:value-of select="substring-before($other-points,' ') * 1000"/>
- </xsl:variable>
- <xsl:variable name="e-y-coor">
- <xsl:value-of select="substring-after($other-points,' ') * 1000"/>
- </xsl:variable>
- <xsl:value-of select="concat($value,$q-x-coor,',',$q-y-coor,' ',$e-x-coor,',',$e-y-coor)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="Oval">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:ellipse">
- <xsl:call-template name="common">
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Rectangle">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:rect">
- <xsl:call-template name="common">
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Line">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:line">
- <xsl:variable name="tuxing1" select="@图:标识符"/>
- <xsl:choose>
- <xsl:when test="key('rel_graphic_name',@图:标识符)">
- <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
- <xsl:attribute name="svg:x1"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y1"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:x2"><xsl:value-of select="concat((@uof:x坐标 + @uof:宽度),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y2"><xsl:value-of select="concat((@uof:y坐标 + @uof:高度),$uofUnit)"/></xsl:attribute>
- <xsl:if test="../演:动画/演:序列/@演:动画对象=$tuxing1">
- <xsl:attribute name="draw:id"><xsl:value-of select="$tuxing1"/></xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="zuheweizhi-x">
- <xsl:value-of select="图:组合位置/@图:x坐标"/>
- </xsl:variable>
- <xsl:variable name="zuheweizhi-y">
- <xsl:value-of select="图:组合位置/@图:y坐标"/>
- </xsl:variable>
- <xsl:variable name="hex">
- <xsl:value-of select="concat(number($groupx1 + $zuheweizhi-x),$uofUnit)"/>
- </xsl:variable>
- <xsl:variable name="hey">
- <xsl:value-of select="concat(number($groupy1 + $zuheweizhi-y),$uofUnit)"/>
- </xsl:variable>
- <xsl:attribute name="svg:x1"><xsl:value-of select="$hex"/></xsl:attribute>
- <xsl:attribute name="svg:y1"><xsl:value-of select="$hey"/></xsl:attribute>
- <xsl:attribute name="svg:x2"><xsl:value-of select="concat(($hex + 图:预定义图形/图:属性/图:宽度),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y2"><xsl:value-of select="concat(($hey + 图:预定义图形/图:属性/图:高度),$uofUnit)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="rotate-angle">
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- <xsl:apply-templates select="图:文本内容/字:文字表"/>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="演文本框">
- <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
- <xsl:variable name="tuxing1" select="@uof:图形引用"/>
- <xsl:element name="draw:frame">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="draw:layer"><xsl:choose><xsl:when test="parent::演:母版">backgroundobjects</xsl:when><xsl:otherwise>layout</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:类别 = '3' and (parent::演:幻灯片/@演:配色方案引用) and not(@uof:占位符 = 'graphic')">
- <xsl:attribute name="presentation:style-name"><xsl:value-of select="parent::演:幻灯片/@演:配色方案引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="../演:动画/演:序列/@演:动画对象=$tuxing1">
- <xsl:attribute name="draw:id"><xsl:value-of select="$tuxing1"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="not(@uof:占位符 = 'graphic')">
- <xsl:attribute name="presentation:style-name"><xsl:value-of select="@uof:图形引用"/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="placeholdType">
- <xsl:value-of select="@uof:占位符"/>
- </xsl:variable>
- <xsl:if test="@uof:占位符">
- <xsl:attribute name="presentation:class"><xsl:choose><xsl:when test="@uof:占位符 = 'clipart'">graphic</xsl:when><xsl:when test="@uof:占位符 = 'media_clip'">graphic</xsl:when><xsl:when test="@uof:占位符 = 'graphics'">graphic</xsl:when><xsl:when test="@uof:占位符 = 'number'">page_number</xsl:when><xsl:when test="@uof:占位符 = 'centertitle'">title</xsl:when><xsl:when test="@uof:占位符 = 'date'">date-time</xsl:when><xsl:when test="@uof:占位符 = 'vertical_text'">vertical_outline</xsl:when><xsl:when test="@uof:占位符 = 'vertical_subtitle'">vertical_outline</xsl:when><xsl:otherwise><xsl:value-of select="@uof:占位符"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
- <xsl:variable name="leibie">
- <xsl:value-of select="图:预定义图形/图:类别"/>
- </xsl:variable>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="rotate-angle">
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="图:文本内容 or @图:其他对象">
- <xsl:attribute name="presentation:user-transformed">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="presentation:placeholder">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$placeholdType = 'graphic' or $placeholdType = 'clipart' or $placeholdType ='media_clip'">
- <draw:image/>
- </xsl:when>
- <xsl:when test="$placeholdType = 'table' or $placeholdType = 'chart' or $placeholdType ='object'">
- <draw:object/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="draw:text-box">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="演缩略图">
- <draw:page-thumbnail>
- <xsl:call-template name="common"/>
- <xsl:attribute name="draw:layer">layout</xsl:attribute>
- <xsl:attribute name="draw:page-number"><xsl:for-each select="../.."><xsl:value-of select="count(preceding-sibling::演:幻灯片) + 1"/></xsl:for-each></xsl:attribute>
- <xsl:attribute name="presentation:class">page</xsl:attribute>
- </draw:page-thumbnail>
- </xsl:template>
- <xsl:template match="演:页面版式">
- <xsl:element name="style:presentation-page-layout">
- <xsl:attribute name="style:name"><xsl:value-of select="@演:标识符"/></xsl:attribute>
- <xsl:apply-templates select="演:占位符" mode="layout"/>
- </xsl:element>
- </xsl:template>
- <xsl:template match="演:占位符" mode="layout">
- <presentation:placeholder>
- <xsl:attribute name="presentation:object"><xsl:choose><xsl:when test="@演:类型='vertical_text'">vertical_outline</xsl:when><xsl:when test="@演:类型='date'">date-time</xsl:when><xsl:when test="@演:类型='number'">page_number</xsl:when><xsl:otherwise><xsl:value-of select="@演:类型"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(uof:锚点/@uof:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(uof:锚点/@uof:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(uof:锚点/@uof:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(uof:锚点/@uof:高度,$uofUnit)"/></xsl:attribute>
- </presentation:placeholder>
- </xsl:template>
- <xsl:template match="字:段落">
- <xsl:choose>
- <xsl:when test="字:段落属性/字:自动编号信息">
- <xsl:call-template name="编号解析"/>
- </xsl:when>
- <xsl:when test="字:句/字:分页符">
- <xsl:call-template name="processPageBreaks"/>
- </xsl:when>
- <xsl:when test="string(parent::node()/@uof:locID)='t0107'">
- <xsl:call-template name="jiaozhu"/>
- </xsl:when>
- <xsl:when test="string(parent::node()/@uof:locID)='t0108'">
- <xsl:call-template name="weizhu"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="commonParagraph"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="jiaozhu">
- <xsl:element name="text:footnote">
- <xsl:element name="text:footnote-body">
- <xsl:call-template name="commonParagraph"/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="weizhu">
- <xsl:element name="text:endnote">
- <xsl:element name="text:endnote-body">
- <xsl:call-template name="commonParagraph"/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="processPageBreaks">
- <xsl:variable name="pageBreak" select="字:句/字:分页符"/>
- <xsl:call-template name="createSubParagraph">
- <xsl:with-param name="list" select="$pageBreak[1]/preceding-sibling::字:句"/>
- <xsl:with-param name="pageBreak"/>
- <xsl:with-param name="needsPageBreak">false</xsl:with-param>
- </xsl:call-template>
- <xsl:for-each select="$pageBreak">
- <xsl:call-template name="createSubParagraph">
- <xsl:with-param name="list" select="./following-sibling::字:句[preceding::字:句/字:分页符 = '.']"/>
- <xsl:with-param name="pageBreak" select="."/>
- <xsl:with-param name="needsPageBreak">true</xsl:with-param>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="createSubParagraph">
- <xsl:param name="list"/>
- <xsl:param name="pageBreak"/>
- <xsl:param name="needsPageBreak"/>
- <xsl:if test="(count($list) &gt; 0) or ($needsPageBreak ='true') ">
- <xsl:element name="text:p">
- <xsl:choose>
- <xsl:when test="$needsPageBreak = 'true'">
- <xsl:choose>
- <xsl:when test="ancestor::字:段落/字:段落属性">
- <xsl:attribute name="text:style-name">P<xsl:number from="/uof:UOF/uof:演示文稿/演:主体" level="any" count="字:段落属性"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="text:style-name">PageBreak</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="$pageBreak">
- <xsl:apply-templates select="$pageBreak"/>
- </xsl:if>
- <xsl:apply-templates select="$list"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:区域开始[@字:类型='bookmark']">
- <text:bookmark-start text:name="{@字:标识符}"/>
- </xsl:template>
- <xsl:template match="字:区域结束[preceding::字:区域开始[1]/@字:类型='bookmark']">
- <text:bookmark-end text:name="{@字:标识符引用}"/>
- </xsl:template>
- <xsl:template match="字:段落/字:域开始">
- <xsl:choose>
- <xsl:when test="@字:类型='CREATEDATE'">
- <xsl:variable name="datestr" select="../字:句/字:文本串"/>
- <xsl:element name="text:date">
- <xsl:attribute name="style:data-style-name">Time<xsl:number from="/uof:UOF/uof:演示文稿/演:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'CREATEDATE']"/></xsl:attribute>
- <xsl:attribute name="text:date-value"><xsl:value-of select="concat(substring-before($datestr,' '),'T',substring-after($datestr,' '))"/></xsl:attribute>
- <xsl:value-of select="$datestr"/>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="commonParagraph">
- <xsl:element name="text:p">
- <xsl:if test="@字:动画标识">
- <xsl:attribute name="text:id"><xsl:value-of select="@字:动画标识"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="commonParagraphAttributes"/>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:template>
- <xsl:template name="commonParagraphAttributes">
- <xsl:choose>
- <xsl:when test="字:段落属性">
- <xsl:attribute name="text:style-name"><xsl:value-of select="字:段落属性/@字:式样引用"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="generate-id(ancestor::字:主体/descendant::字:段落[1]) = generate-id(.)">
- <xsl:variable name="paragraph-number">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
- </xsl:variable>
- <xsl:attribute name="text:style-name">P<xsl:value-of select="number($paragraph-number)"/>_1</xsl:attribute>
- </xsl:when>
- <xsl:when test="not(字:段落属性) and (descendant::字:分栏符 or ancestor::字:分节/descendant::字:节属性[字:分栏/@字:栏数 &gt; 1])">
- <xsl:attribute name="text:style-name">ColumnBreakPara</xsl:attribute>
- </xsl:when>
- <xsl:when test="字:句">
- <xsl:apply-templates select="字:文本串"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:段落属性"/>
- <xsl:template match="字:句/字:句属性"/>
- <xsl:template match="字:句属性" mode="style">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">T<xsl:number from="/uof:UOF/uof:对象集" level="any" count="字:句属性" format="1"/></xsl:attribute>
- <xsl:attribute name="style:family">text</xsl:attribute>
- <xsl:if test="@字:式样引用">
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="style:text-properties">
- <xsl:apply-templates select="./*"/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template match="字:句/字:文本串">
- <xsl:choose>
- <xsl:when test="string(.) = ' ' ">
- <xsl:element name="text:s"/>
- </xsl:when>
- <xsl:when test="contains(.,' ')">
- <xsl:call-template name="replace-spaces">
- <xsl:with-param name="curr-string" select="."/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="replace-spaces">
- <xsl:param name="curr-string"/>
- <xsl:if test="contains($curr-string,' ')">
- <xsl:value-of select="substring-before($curr-string,' ')"/>
- <text:s text:c="2"/>
- <xsl:variable name="next-string" select="substring-after($curr-string,' ')"/>
- <xsl:choose>
- <xsl:when test="contains($next-string, ' ')">
- <xsl:call-template name="replace-spaces">
- <xsl:with-param name="curr-string" select="$next-string"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$next-string"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:句">
- <xsl:if test="name(following-sibling::*[1])!='字:域结束'">
- <xsl:if test="字:换行符">
- <xsl:element name="text:line-break"/>
- </xsl:if>
- <xsl:variable name="currently-node" select="./字:锚点"/>
- <xsl:choose>
- <xsl:when test="字:句属性//字:隐藏文字/@字:值='true'">
- <text:hidden-text text:is-hidden="true" text:string-value="{.}"/>
- </xsl:when>
- <xsl:when test="字:区域开始[@字:类型='hyperlink']">
- <xsl:element name="text:a">
- <xsl:attribute name="xlink:type">simple</xsl:attribute>
- <xsl:variable name="hyperDest" select="字:区域开始/@字:标识符"/>
- <xsl:attribute name="xlink:href"><xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接"><xsl:if test="@uof:链源=$hyperDest"><xsl:if test="@uof:目标"><xsl:value-of select="@uof:目标"/></xsl:if><xsl:if test="@uof:书签"><xsl:variable name="bookmarkDest" select="@uof:书签"/><xsl:for-each select="/uof:UOF/uof:书签集/uof:书签"><xsl:if test="@uof:名称=$bookmarkDest"><xsl:value-of select="concat('#',uof:文本位置/@字:区域引用)"/></xsl:if></xsl:for-each></xsl:if></xsl:if></xsl:for-each></xsl:attribute>
- <xsl:apply-templates select="字:文本串"/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="(preceding-sibling::字:句) or (字:句属性)or(字:区域开始)">
- <xsl:element name="text:span">
- <xsl:choose>
- <xsl:when test="字:区域开始[@字:类型='annotation']">
- <xsl:variable name="ref_comment">
- <xsl:value-of select="字:区域开始/@字:标识符"/>
- </xsl:variable>
- <xsl:apply-templates/>
- <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:公用处理规则/字:批注集/字:批注[@字:区域引用 = $ref_comment]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="stylenum">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
- </xsl:variable>
- <xsl:attribute name="text:style-name"><xsl:value-of select="字:句属性/@字:式样引用"/></xsl:attribute>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template match="node()[name() = '字:位置']">
- <xsl:variable name="height">100% </xsl:variable>
- <xsl:variable name="position">
- <xsl:choose>
- <xsl:when test="parent::字:句属性//字:位置">
- <xsl:value-of select="concat( parent::字:句属性//字:位置, '%')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="style:text-position"><xsl:value-of select="concat(concat( $position, ' '), $height)"/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:字体">
- <xsl:if test="@字:字号">
- <xsl:attribute name="fo:font-size"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-asian"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-complex"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:相对字号 and self::node( )[not(parent::字:句属性)]">
- <xsl:variable name="stylename" select="parent::node()/@字:基式样引用"/>
- <xsl:variable name="zihao">
- <xsl:for-each select="/uof:UOF/uof:式样集//uof:段落式样[@字:标识符=$stylename]">
- <xsl:value-of select="字:字体/@字:字号"/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="font-size" select="@字:相对字号"/>
- <xsl:attribute name="fo:font-size"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-asian"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-complex"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:颜色">
- <xsl:attribute name="fo:color"><xsl:value-of select="string(@字:颜色)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:中文字体引用">
- <xsl:attribute name="style:font-name-asian"><xsl:value-of select="@字:中文字体引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:西文字体引用">
- <xsl:attribute name="style:font-name"><xsl:value-of select="@字:西文字体引用"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:斜体">
- <xsl:if test="@字:值='true'">
- <xsl:attribute name="fo:font-style">italic</xsl:attribute>
- <xsl:attribute name="fo:font-style-asian">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:粗体">
- <xsl:if test="@字:值='true'">
- <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
- <xsl:attribute name="fo:font-weight-asian">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:下划线">
- <xsl:choose>
- <xsl:when test="@字:字下划线 = 'true'">
- <xsl:attribute name="style:text-underline">single</xsl:attribute>
- <xsl:attribute name="style:text-underline-color">font-color</xsl:attribute>
- <xsl:attribute name="fo:score-spaces">false</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'thick'">
- <xsl:attribute name="style:text-underline">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dotted-heavy'">
- <xsl:attribute name="style:text-underline">bold-dotted</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dashed-heavy'">
- <xsl:attribute name="style:text-underline">bold-dash</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-long'">
- <xsl:attribute name="style:text-underline">long-dash</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-long-heavy'">
- <xsl:attribute name="style:text-underline">bold-long-dash</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-dot-heavy'">
- <xsl:attribute name="style:text-underline">bold-dot-dash</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-dot-dot-heavy'">
- <xsl:attribute name="style:text-underline">bold-dot-dot-dash</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'wavy-heavy'">
- <xsl:attribute name="style:text-underline">bold-wave</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'wavy-double'">
- <xsl:attribute name="style:text-underline">double-wave</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:text-underline"><xsl:value-of select="@字:类型"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="@字:颜色 and not(@字:颜色 = 'auto')">
- <xsl:attribute name="style:text-underline-color"><xsl:value-of select="concat( '#', @字:颜色)"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:阴影">
- <xsl:attribute name="style:text-shadow">1pt 1pt</xsl:attribute>
- <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
- </xsl:template>
- <xsl:template match="字:删除线">
- <xsl:choose>
- <xsl:when test="@字:类型 = 'single' ">
- <xsl:attribute name="style:text-crossing-out">single-line</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字类型 = 'double'">
- <xsl:attribute name="style:text-crossing-out">double-line</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:突出显示">
- <xsl:attribute name="fo:text-transform">uppercase</xsl:attribute>
- <xsl:attribute name="fo:text-background-color"><xsl:value-of select="string(@字:颜色)"/></xsl:attribute>
- </xsl:template>
- <xsl:template match="@字:颜色[not(.='auto')]">
- <xsl:attribute name="fo:color">#<xsl:value-of select="."/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:浮雕">
- <xsl:attribute name="style:font-relief">embossed</xsl:attribute>
- </xsl:template>
- <xsl:template match="字:外框">
- <xsl:attribute name="style:text-outline">true</xsl:attribute>
- </xsl:template>
- <xsl:template match="字:缩放">
- <xsl:attribute name="style:text-scale"><xsl:value-of select="@字:字号"/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:字符间距[parent::字:句属性]">
- <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="concat( floor(number(字:字符间距 div 1440) * 2540) div 1000, 'cm')"/></xsl:attribute>
- </xsl:template>
- <xsl:template match="uof:字体集">
- <xsl:if test="not(uof:字体声明[@uof:名称='StarSymbol'])">
- <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </xsl:if>
- <xsl:for-each select="uof:字体声明">
- <xsl:element name="style:font-face">
- <xsl:attribute name="style:name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
- <xsl:attribute name="svg:font-family"><xsl:value-of select="@uof:字体族"/></xsl:attribute>
- <xsl:if test="@uof:字符集 = '02'">
- <xsl:attribute name="style:font-charset">x-symbol</xsl:attribute>
- </xsl:if>
- <xsl:if test="@uof:字体族">
- <xsl:choose>
- <xsl:when test="@uof:字体族 = 'Swiss'">
- <xsl:attribute name="style:font-family-generic">swiss</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='Modern'">
- <xsl:attribute name="style:font-family-generic">modern</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族='Roman'">
- <xsl:attribute name="style:font-family-generic">roman</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='Script'">
- <xsl:attribute name="style:font-family-generic">script</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='Decorative'">
- <xsl:attribute name="style:font-family-generic">decorative</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='System'">
- <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:attribute name="style:font-pitch">12</xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- <xsl:apply-templates select="uof:字体声明"/>
- </xsl:template>
- <xsl:template match="uof:元数据">
- <office:meta>
- <meta:generator>UOFText 2004</meta:generator>
- <dc:title>
- <xsl:value-of select="uof:标题"/>
- </dc:title>
- <dc:description>
- <xsl:value-of select="uof:摘要"/>
- </dc:description>
- <dc:subject>
- <xsl:value-of select="uof:主题"/>
- </dc:subject>
- <meta:initial-creator>
- <xsl:value-of select="uof:作者"/>
- </meta:initial-creator>
- <meta:creation-date>
- <xsl:value-of select="substring-before( uof:创建日期, 'Z')"/>
- </meta:creation-date>
- <dc:creator>
- <xsl:value-of select="uof:最后作者"/>
- </dc:creator>
- <dc:date>
- <xsl:value-of select="substring-before( uof:编辑时间, 'Z')"/>
- </dc:date>
- <meta:printed-by/>
- <meta:print-date/>
- <meta:keywords>
- <meta:keyword>
- <xsl:value-of select="uof:关键字集/uof:关键字"/>
- </meta:keyword>
- </meta:keywords>
- <dc:language/>
- <meta:editing-cycles>
- <xsl:value-of select="uof:编辑次数"/>
- </meta:editing-cycles>
- <meta:editing-duration>
- <xsl:if test="uof:编辑时间">
- <xsl:value-of select="concat('PT', floor(uof:编辑时间 div 60), 'H', uof:编辑时间 mod 60, 'M0S')"/>
- </xsl:if>
- </meta:editing-duration>
- <meta:user-defined meta:name="Category">
- <xsl:value-of select="uof:分类"/>
- </meta:user-defined>
- <meta:user-defined meta:name="Manager">
- <xsl:value-of select="uof:经理名称"/>
- </meta:user-defined>
- <meta:user-defined meta:name="Company">
- <xsl:value-of select="uof:公司名称"/>
- </meta:user-defined>
- <meta:user-defined meta:name="Version">
- <xsl:value-of select="uof:创建应用程序"/>
- </meta:user-defined>
- <xsl:if test="uof:文档模板|child::*[@uof:locID='u0013']">
- <meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:href="{child::*[@uof:locID='u0013']}"/>
- </xsl:if>
- <xsl:if test="uof:用户自定义元数据集/uof:用户自定义元数据|child::*[@uof:locID='u0016']/*[@uof:locID='u0017']">
- <xsl:for-each select="uof:用户自定义元数据集/uof:用户自定义元数据|child::*[@uof:locID='u0016']/*[@uof:locID='u0017']">
- <xsl:element name="meta:user-defined">
- <xsl:attribute name="meta:name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:if>
- <meta:document-statistic meta:page-count="{child::*[@uof:locID='u0020']}" meta:paragraph-count="{child::*[@uof:locID='u0025']}" meta:word-count="{child::*[@uof:locID='u0023']}" meta:object-count="{child::*[@uof:locID='u0026']}" meta:character-count="{child::*[@uof:locID='u0021']}"/>
- <meta:document-statistic/>
- </office:meta>
- </xsl:template>
- <xsl:template match="uof:用户自定义元数据集">
- <xsl:for-each select="node()[@名称]">
- <meta:user-defined meta:name="{name()}">
- <xsl:value-of select="."/>
- </meta:user-defined>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="parse-range">
- <xsl:param name="range-value"/>
- <xsl:param name="last"/>
- <xsl:variable name="first-pit">
- <xsl:choose>
- <xsl:when test="contains($range-value,',')">
- <xsl:value-of select="substring-before($range-value,',')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$range-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="current">
- <xsl:choose>
- <xsl:when test="contains($first-pit,':')">
- <xsl:variable name="R-start" select="substring-before(substring-after($first-pit,'R'),'C')"/>
- <xsl:variable name="C-start" select="substring-before(substring-after($first-pit,'C'),':')"/>
- <xsl:variable name="second-pit" select="substring-after($first-pit,':')"/>
- <xsl:variable name="R-end" select="substring-before(substring-after($second-pit,'R'),'C')"/>
- <xsl:variable name="C-end" select="substring-after($second-pit,'C')"/>
- <xsl:variable name="the-str">
- <xsl:call-template name="condition-rc-str">
- <xsl:with-param name="r-start" select="$R-start"/>
- <xsl:with-param name="r-end" select="$R-end"/>
- <xsl:with-param name="c-start" select="$C-start"/>
- <xsl:with-param name="c-end" select="$C-end"/>
- <xsl:with-param name="last" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$the-str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($first-pit,',')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($range-value,',')">
- <xsl:call-template name="parse-range">
- <xsl:with-param name="range-value" select="substring-after($range-value,',')"/>
- <xsl:with-param name="last" select="concat($last,$current)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($last,$current)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="condition-rc-str">
- <xsl:param name="r-start"/>
- <xsl:param name="r-end"/>
- <xsl:param name="c-start"/>
- <xsl:param name="c-end"/>
- <xsl:param name="last"/>
- <xsl:variable name="current">
- <xsl:call-template name="condition-c-str">
- <xsl:with-param name="rc-str" select="concat('R',$r-start)"/>
- <xsl:with-param name="start" select="$c-start"/>
- <xsl:with-param name="end" select="$c-end"/>
- <xsl:with-param name="last" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$r-start &lt; $r-end">
- <xsl:call-template name="condition-rc-str">
- <xsl:with-param name="r-start" select="$r-start + 1"/>
- <xsl:with-param name="r-end" select="$r-end"/>
- <xsl:with-param name="c-start" select="$c-start"/>
- <xsl:with-param name="c-end" select="$c-end"/>
- <xsl:with-param name="last" select="concat($last,$current)"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$r-start = $r-end">
- <xsl:value-of select="concat($last,$current)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="condition-c-str">
- <xsl:param name="rc-str"/>
- <xsl:param name="start"/>
- <xsl:param name="end"/>
- <xsl:param name="last"/>
- <xsl:variable name="current" select="concat($rc-str,'C',$start,',')"/>
- <xsl:if test="$start &lt; $end">
- <xsl:call-template name="condition-c-str">
- <xsl:with-param name="rc-str" select="$rc-str"/>
- <xsl:with-param name="start" select="$start + 1"/>
- <xsl:with-param name="end" select="$end"/>
- <xsl:with-param name="last" select="concat($last,$current)"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$start = $end">
- <xsl:value-of select="concat($last,$current)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="condition-str">
- <xsl:param name="param-str"/>
- <xsl:choose>
- <xsl:when test="contains($param-str,'(')">
- <xsl:call-template name="condition-str">
- <xsl:with-param name="param-str" select="substring-after($param-str,'(')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before($param-str,':')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="encode-as-cell-range-address">
- <xsl:param name="string"/>
- <xsl:value-of select="$string"/>
- </xsl:template>
- <xsl:template name="encode-as-cell-address">
- <xsl:param name="string"/>
- <xsl:value-of select="$string"/>
- </xsl:template>
- <xsl:param name="dpi" select="111"/>
- <xsl:param name="centimeter-in-mm" select="10"/>
- <xsl:param name="inch-in-mm" select="25.4"/>
- <xsl:param name="didot-point-in-mm" select="0.376065"/>
- <xsl:param name="pica-in-mm" select="4.2333333"/>
- <xsl:param name="point-in-mm" select="0.3527778"/>
- <xsl:param name="twip-in-mm" select="0.017636684"/>
- <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
- <!-- ***** MEASUREMENT CONVERSIONS *****
- PARAM 'value'
- The measure to be converted.
- The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
- directly added to the number.
+ <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
+ <xsl:template match="uof:UOF">
+ <office:document 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
+ <xsl:apply-templates select="uof:元数据"/>
+ <office:settings>
+ <xsl:variable name="PageNumberFormat" select="/uof:UOF/uof:演示文稿/演:公用处理规则/演:页面设置集/演:页面设置/演:页码格式[1]"/>
+ <xsl:variable name="proportion">
+ <xsl:value-of select="substring-before(/uof:UOF/uof:演示文稿/演:公用处理规则/演:显示比例,'%')"/>
+ </xsl:variable>
+ <config:config-item-set config:name="ooo:view-settings">
+ <config:config-item config:name="VisibleAreaTop" config:type="int">0</config:config-item>
+ <config:config-item config:name="VisibleAreaLeft" config:type="int">0</config:config-item>
+ <config:config-item config:name="VisibleAreaWidth" config:type="int">14098</config:config-item>
+ <config:config-item config:name="VisibleAreaHeight" config:type="int">9998</config:config-item>
+ <config:config-item-map-indexed config:name="Views">
+ <config:config-item-map-entry>
+ <config:config-item config:name="ViewId" config:type="string">view1</config:config-item>
+ <config:config-item config:name="GridIsVisible" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="GridIsFront" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IsSnapToGrid" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="IsSnapToPageMargins" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="IsSnapToSnapLines" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IsSnapToObjectFrame" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IsSnapToObjectPoints" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IsPlusHandlesAlwaysVisible" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IsFrameDragSingles" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="EliminatePolyPointLimitAngle" config:type="int">1500</config:config-item>
+ <config:config-item config:name="IsEliminatePolyPoints" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="VisibleLayers" config:type="base64Binary">//////////////////////////////////////////8=</config:config-item>
+ <config:config-item config:name="PrintableLayers" config:type="base64Binary">//////////////////////////////////////////8=</config:config-item>
+ <config:config-item config:name="LockedLayers" config:type="base64Binary"/>
+ <config:config-item config:name="NoAttribs" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="NoColors" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="RulerIsVisible" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="PageKind" config:type="short">0</config:config-item>
+ <config:config-item config:name="SelectedPage" config:type="short">0</config:config-item>
+ <config:config-item config:name="IsLayerMode" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="IsDoubleClickTextEdit" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="IsClickChangeRotation" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="SlidesPerRow" config:type="short">4</config:config-item>
+ <config:config-item config:name="EditModeStandard" config:type="int">0</config:config-item>
+ <config:config-item config:name="EditModeNotes" config:type="int">0</config:config-item>
+ <config:config-item config:name="EditModeHandout" config:type="int">1</config:config-item>
+ <config:config-item config:name="VisibleAreaTop" config:type="int">-5402</config:config-item>
+ <config:config-item config:name="VisibleAreaLeft" config:type="int">-441</config:config-item>
+ <config:config-item config:name="VisibleAreaWidth" config:type="int">
+ <xsl:value-of select="(100*13997) div $proportion"/>
+ </config:config-item>
+ <config:config-item config:name="VisibleAreaHeight" config:type="int">
+ <xsl:value-of select="(100*15426) div $proportion"/>
+ </config:config-item>
+ <config:config-item config:name="GridCoarseWidth" config:type="int">1000</config:config-item>
+ <config:config-item config:name="GridCoarseHeight" config:type="int">1000</config:config-item>
+ <config:config-item config:name="GridFineWidth" config:type="int">500</config:config-item>
+ <config:config-item config:name="GridFineHeight" config:type="int">500</config:config-item>
+ <config:config-item config:name="GridSnapWidth" config:type="int">1000</config:config-item>
+ <config:config-item config:name="GridSnapHeight" config:type="int">1000</config:config-item>
+ <config:config-item config:name="GridSnapWidthXNumerator" config:type="int">500</config:config-item>
+ <config:config-item config:name="GridSnapWidthXDenominator" config:type="int">1</config:config-item>
+ <config:config-item config:name="GridSnapWidthYNumerator" config:type="int">500</config:config-item>
+ <config:config-item config:name="GridSnapWidthYDenominator" config:type="int">1</config:config-item>
+ <config:config-item config:name="IsAngleSnapEnabled" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="SnapAngle" config:type="int">1500</config:config-item>
+ <config:config-item config:name="ZoomOnPage" config:type="boolean">true</config:config-item>
+ </config:config-item-map-entry>
+ </config:config-item-map-indexed>
+ </config:config-item-set>
+ <config:config-item-set config:name="ooo:configuration-settings">
+ <config:config-item config:name="PageNumberFormat" config:type="int">
+ <xsl:choose>
+ <xsl:when test="/uof:UOF/uof:演示文稿/演:公用处理规则/演:页面设置集/演:页面设置/演:页码格式">
+ <xsl:choose>
+ <xsl:when test="$PageNumberFormat='upper-letter'">0</xsl:when>
+ <xsl:when test="$PageNumberFormat='lower-letter'">1</xsl:when>
+ <xsl:when test="$PageNumberFormat='upper-roman'">2</xsl:when>
+ <xsl:when test="$PageNumberFormat='lower-letter'">3</xsl:when>
+ <xsl:when test="$PageNumberFormat='decimal'">4</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>5</xsl:otherwise>
+ </xsl:choose>
+ </config:config-item>
+ </config:config-item-set>
+ </office:settings>
+ <office:scripts/>
+ <xsl:element name="office:font-face-decls">
+ <style:font-face style:name="宋体" svg:font-family="宋体" style:font-family-generic="swiss" style:font-pitch="variable"/>
+ <xsl:apply-templates select="uof:式样集/uof:字体集"/>
+ </xsl:element>
+ <office:styles>
+ <xsl:apply-templates select="uof:演示文稿/演:公用处理规则/演:页面版式集/演:页面版式"/>
+ <xsl:call-template name="编号字体"/>
+ <xsl:for-each select="uof:式样集/uof:段落式样">
+ <xsl:variable name="outline" select="@字:标识符"/>
+ <xsl:choose>
+ <xsl:when test="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符=$outline]">
+ <xsl:call-template name="段落式样"/>
+ </xsl:when>
+ <xsl:when test="contains($outline,'outline')">
+ <xsl:call-template name="段落式样"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </office:styles>
+ <office:automatic-styles>
+ <xsl:apply-templates select="uof:演示文稿/演:公用处理规则/演:配色方案集/演:配色方案"/>
+ <xsl:apply-templates select="uof:式样集/uof:句式样"/>
+ <xsl:for-each select="uof:式样集/uof:段落式样">
+ <xsl:variable name="outline" select="@字:标识符"/>
+ <xsl:if test="not(/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符=$outline]) and not(contains($outline,'outline'))">
+ <xsl:call-template name="段落式样"/>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:apply-templates select="uof:对象集"/>
+ <xsl:call-template name="create-page-master">
+ <xsl:with-param name="impressoptions" select="uof:演示文稿/演:公用处理规则/演:页面设置集/演:页面设置"/>
+ </xsl:call-template>
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形/图:文本内容/字:段落/字:段落属性/字:自动编号信息">
+ <xsl:variable name="currlistid" select="@字:编号引用"/>
+ <xsl:variable name="currlist" select="."/>
+ <xsl:variable name="rootlist" select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符 =$currlistid]"/>
+ <xsl:if test="not(ancestor::字:段落/preceding-sibling::字:段落[1]/字:段落属性/字:自动编号信息/@字:编号引用= $currlistid)">
+ <xsl:element name="text:list-style">
+ <xsl:attribute name="style:name">List<xsl:value-of select="count(preceding::字:自动编号信息)"/></xsl:attribute>
+ <xsl:for-each select="$rootlist">
+ <xsl:call-template name="自动编号"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </office:automatic-styles>
+ <office:master-styles>
+ <xsl:apply-templates select="uof:演示文稿/演:主体/演:母版集"/>
+ </office:master-styles>
+ <office:body>
+ <office:presentation>
+ <xsl:apply-templates select="uof:演示文稿/演:主体/演:幻灯片集"/>
+ <xsl:apply-templates select="uof:演示文稿/演:公用处理规则/演:放映设置"/>
+ </office:presentation>
+ </office:body>
+ </office:document>
+ </xsl:template>
+ <xsl:template match="演:放映设置">
+ <presentation:settings>
+ <xsl:variable name="start-page">
+ <xsl:choose>
+ <xsl:when test="contains(演:幻灯片序列,' ')">
+ <xsl:value-of select="substring-before(演:幻灯片序列,' ')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="演:幻灯片序列"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="first-page">
+ <xsl:value-of select="/uof:UOF/uof:演示文稿/演:主体/演:幻灯片集/演:幻灯片[1]/@演:名称"/>
+ </xsl:variable>
+ <xsl:if test="not($start-page = $first-page)">
+ <xsl:attribute name="presentation:start-page"><xsl:value-of select="$start-page"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:全屏放映='false'">
+ <xsl:attribute name="presentation:full-screen">false</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:循环放映='true'">
+ <xsl:attribute name="presentation:endless">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:放映间隔">
+ <xsl:attribute name="presentation:pause"><xsl:variable name="OOtime"><xsl:value-of select="substring-after(演:放映间隔,'P0Y0M0DT')"/></xsl:variable><xsl:value-of select="concat('PT',$OOtime)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:手动方式='true'">
+ <xsl:attribute name="presentation:force-manual">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:导航帮助='true'">
+ <xsl:attribute name="presentation:start-with-navigator">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:放映动画='false'">
+ <xsl:attribute name="presentation:animations">disabled</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:前端显示='true'">
+ <xsl:attribute name="presentation:stay-on-top">true</xsl:attribute>
+ </xsl:if>
+ </presentation:settings>
+ </xsl:template>
+ <xsl:template name="自动编号">
+ <xsl:for-each select="字:级别">
+ <xsl:choose>
+ <xsl:when test="字:项目符号">
+ <xsl:call-template name="xiangmufuhao">
+ <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="字:图片符号引用">
+ <xsl:call-template name="imagefuhao">
+ <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="jibianhao">
+ <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="编号字体">
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号">
+ <xsl:if test="字:级别/字:符号字体">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="concat( @字:标识符,字:级别/@字:级别值)"/></xsl:attribute>
+ <xsl:attribute name="style:family">text</xsl:attribute>
+ <xsl:element name="style:text-properties">
+ <xsl:attribute name="fo:color"><xsl:value-of select="字:级别/字:符号字体/字:字体/@字:颜色"/></xsl:attribute>
+ <xsl:if test="字:级别/字:符号字体/字:粗体 and 字:级别/字:符号字体/字:粗体/@字:值='true'">
+ <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
+ <xsl:attribute name="style:font-style-asian">bold</xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="ziti">
+ <xsl:value-of select="字:级别/字:符号字体/字:字体/@字:中文字体引用"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:字体集/uof:字体声明">
+ <xsl:if test="@uof:标识符=$ziti">
+ <xsl:attribute name="style:font-name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:attribute name="fo:font-style">normal</xsl:attribute>
+ <xsl:attribute name="style:font-weight-asian">normal</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="uof:对象集">
+ <xsl:apply-templates select="图:图形"/>
+ <xsl:apply-templates select="图:图形/图:文本内容/字:段落/字:句/字:句属性" mode="style"/>
+ </xsl:template>
+ <xsl:variable name="uofUnit">
+ <xsl:variable name="uu">
+ <xsl:value-of select="/uof:UOF/uof:演示文稿/演:公用处理规则/演:度量单位"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$uu='cm'">cm</xsl:when>
+ <xsl:when test="$uu='mm'">mm</xsl:when>
+ <xsl:when test="$uu='pt'">pt</xsl:when>
+ <xsl:when test="$uu='inch'">inch</xsl:when>
+ <xsl:otherwise>pt</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="other-to-cm-conversion-factor">
+ <xsl:choose>
+ <xsl:when test="$uofUnit='cm'">1</xsl:when>
+ <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
+ <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
+ <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
+ <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:key match="/uof:UOF/uof:演示文稿/演:主体/演:母版集/演:母版/uof:锚点 | /uof:UOF/uof:演示文稿/演:主体/演:幻灯片集/演:幻灯片/uof:锚点 | /uof:UOF/uof:演示文稿/演:主体/演:幻灯片集/演:幻灯片/演:幻灯片备注/uof:锚点" name="rel_graphic_name" use="@uof:图形引用"/>
+ <xsl:template match="图:图形">
+ <xsl:variable name="random-name">
+ <xsl:value-of select="generate-id()"/>
+ </xsl:variable>
+ <xsl:variable name="draw-name">
+ <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
+ </xsl:variable>
+ <xsl:call-template name="graphic-fill">
+ <xsl:with-param name="draw-name" select="$draw-name"/>
+ <xsl:with-param name="gradient-name" select="图:预定义图形/图:属性/图:填充/图:渐变"/>
+ </xsl:call-template>
+ <xsl:variable name="biaozhifu" select="@图:标识符"/>
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:family"><xsl:choose><xsl:when test="图:预定义图形/图:类别='3' or 图:预定义图形/图:类别='67'">presentation</xsl:when><xsl:otherwise>graphic</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="/uof:UOF/uof:演示文稿/演:主体/演:母版集/演:母版/uof:锚点[@uof:图形引用=$biaozhifu]">
+ <xsl:variable name="duan" select="图:文本内容/字:段落/字:段落属性/@字:式样引用"/>
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="/uof:UOF/uof:式样集/uof:段落式样[@字:标识符=$duan]/@字:基式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="style:graphic-properties">
+ <xsl:call-template name="process-graphics">
+ <xsl:with-param name="draw-name" select="$draw-name"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:family"><xsl:choose><xsl:when test="图:预定义图形/图:类别='3' or 图:预定义图形/图:类别='67'">presentation</xsl:when><xsl:otherwise>graphic</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="/uof:UOF/uof:演示文稿/演:主体/演:母版集/演:母版/uof:锚点[@uof:图形引用=$biaozhifu]">
+ <xsl:variable name="duan" select="图:文本内容/字:段落/字:段落属性/@字:式样引用"/>
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="/uof:UOF/uof:式样集/uof:段落式样[@字:标识符=$duan]/@字:基式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="style:graphic-properties">
+ <xsl:if test="@图:其他对象">
+ <xsl:attribute name="fo:clip">rect(0cm 0cm 0cm 0cm)</xsl:attribute>
+ <xsl:attribute name="draw:color-mode">standard</xsl:attribute>
+ <xsl:attribute name="draw:luminance">0%</xsl:attribute>
+ <xsl:attribute name="draw:contrast">0%</xsl:attribute>
+ <xsl:attribute name="draw:gamma">100%</xsl:attribute>
+ <xsl:attribute name="draw:red">0%</xsl:attribute>
+ <xsl:attribute name="draw:green">0%</xsl:attribute>
+ <xsl:attribute name="draw:blue">0%</xsl:attribute>
+ <xsl:attribute name="draw:image-opacity">100%</xsl:attribute>
+ <xsl:attribute name="style:mirror">none</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="process-graphics"/>
+ </xsl:element>
+ <xsl:if test="图:文本内容/@图:文字排列方向='vert-r2l' or 图:文本内容/@图:文字排列方向='vert-l2r'">
+ <xsl:element name="style:paragraph-properties">
+ <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="process-graphics">
+ <xsl:param name="draw-name"/>
+ <xsl:if test="not(key('rel_graphic_name',@图:标识符)/@uof:随动方式='movesize')">
+ <xsl:attribute name="style:protect"><xsl:choose><xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:随动方式='move'">size</xsl:when><xsl:otherwise>position size</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="not(图:预定义图形/图:属性/图:填充)">
+ <xsl:attribute name="draw:fill">none</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片">
+ <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
+ <xsl:attribute name="draw:fill-image-name"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:attribute>
+ <xsl:if test="not(图:预定义图形/图:属性/图:填充/图:图片/@图:位置='title')">
+ <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案">
+ <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:前景色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:颜色">
+ <xsl:attribute name="draw:fill">solid</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
+ <xsl:attribute name="draw:fill">gradient</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:渐变/@图:起始色"/></xsl:attribute>
+ <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="图:预定义图形/图:属性/图:线颜色">
+ <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:线型 and not(图:预定义图形/图:属性/图:线型 = 'single') and not(图:预定义图形/图:属性/图:线型 = 'thick')">
+ <xsl:variable name="linetype" select="图:预定义图形/图:属性/图:线型"/>
+ <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="$linetype='none'">none</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$linetype='dot-dot-dash' or $linetype='dash-dot-dot-heavy'">_32__20_Dots_20_1_20_Dash</xsl:when><xsl:when test="$linetype='dash' or $linetype='dashed-heavy'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$linetype='dotted' or $linetype='dotted-heavy'">Ultrafine_20_Dotted_20__28_var_29_</xsl:when><xsl:when test="$linetype='double'">Line_20_with_20_Fine_20_Dots</xsl:when><xsl:when test="$linetype='dot-dash' or $linetype='dash-dot-heavy'">_33__20_Dashes_20_3_20_Dots_20__28_var_29_</xsl:when><xsl:when test="$linetype='wave' or $linetype='wavy-heavy'">Ultrafine_20_2_20_Dots_20_3_20_Dashes</xsl:when><xsl:when test="$linetype='wavy-double'">Fine_20_Dashed_20__28_var_29_</xsl:when><xsl:otherwise>Fine Dashed</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:线粗细">
+ <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:线粗细,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
+ <xsl:attribute name="draw:marker-start"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line_20_Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow_20_concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square_20_45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:前端箭头/图:大小">
+ <xsl:attribute name="draw:marker-start-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
+ <xsl:attribute name="draw:marker-end"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line_20_Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow_20_concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square_20_45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:后端箭头/图:大小">
+ <xsl:attribute name="draw:marker-end-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:透明度">
+ <xsl:attribute name="draw:opacity"><xsl:variable name="opacity"><xsl:value-of select="./图:预定义图形/图:属性/图:透明度"/></xsl:variable><xsl:value-of select="concat((1 - $opacity)*100,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:for-each select="图:文本内容">
+ <xsl:if test="@图:上边距">
+ <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(@图:上边距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(@图:下边距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(@图:左边距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(@图:右边距,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(@图:文字排列方向='middle')">
+ <xsl:variable name="hori-or-vert" select="@图:文字排列方向"/>
+ <xsl:choose>
+ <xsl:when test="$hori-or-vert='vert-l2r'">
+ <xsl:attribute name="draw:textarea-vertical-align">bottom</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$hori-or-vert='hori-l2r'">
+ <xsl:attribute name="draw:textarea-horizontal-align">left</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$hori-or-vert='hori-r2l'">
+ <xsl:attribute name="draw:textarea-horizontal-align">right</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$hori-or-vert"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@图:自动换行">
+ <xsl:attribute name="fo:wrap-option">no-wrap</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="draw:auto-grow-width"><xsl:choose><xsl:when test="@图:大小适应文字">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="bina_graphic">
+ <xsl:param name="refGraphic"/>
+ <xsl:element name="office:binary-data">
+ <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符 = $refGraphic]">
+ <xsl:value-of select="uof:数据"/>
+ </xsl:for-each>
+ </xsl:element>
+ <text:p/>
+ </xsl:template>
+ <xsl:template name="graphic-fill">
+ <xsl:param name="draw-name"/>
+ <xsl:param name="gradient-name"/>
+ <xsl:if test="图:预定义图形/图:属性/图:填充/图:渐变">
+ <xsl:element name="draw:gradient">
+ <xsl:attribute name="draw:name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
+ <xsl:attribute name="draw:style"><xsl:choose><xsl:when test="$gradient-name/@图:种子类型='linear'"><xsl:value-of select="'linear'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='radar'"><xsl:value-of select="'radial'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='oval'"><xsl:value-of select="'ellipsoid'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='square'"><xsl:value-of select="'square'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='rectangle'"><xsl:value-of select="'rectangular'"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="draw:start-color"><xsl:value-of select="$gradient-name/@图:起始色"/></xsl:attribute>
+ <xsl:attribute name="draw:end-color"><xsl:value-of select="$gradient-name/@图:终止色"/></xsl:attribute>
+ <xsl:attribute name="draw:start-intensity"><xsl:value-of select="concat($gradient-name/@图:起始浓度,'%')"/></xsl:attribute>
+ <xsl:attribute name="draw:end-intensity"><xsl:value-of select="concat($gradient-name/@图:终止浓度,'%')"/></xsl:attribute>
+ <xsl:attribute name="draw:angle"><xsl:value-of select="$gradient-name/@图:渐变方向 * 10"/></xsl:attribute>
+ <xsl:attribute name="draw:border"><xsl:value-of select="concat($gradient-name/@图:边界,'%')"/></xsl:attribute>
+ <xsl:if test="$gradient-name/@图:种子X位置">
+ <xsl:attribute name="draw:cx"><xsl:value-of select="concat($gradient-name/@图:种子X位置,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$gradient-name/@图:种子Y位置">
+ <xsl:attribute name="draw:cy"><xsl:value-of select="concat($gradient-name/@图:种子Y位置,'%')"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
+ <xsl:element name="draw:marker">
+ <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line_20_Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow_20_concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square_20_45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">
+ <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
+ <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">
+ <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
+ <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
+ <xsl:element name="draw:marker">
+ <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line_20_Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow_20_concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square_20_45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">
+ <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
+ <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">
+ <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
+ <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用 or 图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
+ <xsl:element name="draw:fill-image">
+ <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:类型"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:call-template name="bina_graphic">
+ <xsl:with-param name="refGraphic">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
+ <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"/>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用">
+ <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="not(图:预定义图形/图:属性/图:线型='single') and not(图:预定义图形/图:属性/图:线型='thick') and 图:预定义图形/图:属性/图:线型">
+ <xsl:variable name="line" select="图:预定义图形/图:属性/图:线型"/>
+ <xsl:element name="draw:stroke-dash">
+ <xsl:choose>
+ <xsl:when test="$line='dash-long' or $line='dash-long-heavy'">
+ <xsl:attribute name="draw:name">Fine_20_Dashed</xsl:attribute>
+ <xsl:attribute name="draw:display-name">Fine dashed</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">0.508cm</xsl:attribute>
+ <xsl:attribute name="draw:dots2">1</xsl:attribute>
+ <xsl:attribute name="draw:dots2-length">0.508cm</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.508cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='dot-dot-dash' or $line='dash-dot-dot-heavy'">
+ <xsl:attribute name="draw:name">_32__20_Dots_20_1_20_Dash</xsl:attribute>
+ <xsl:attribute name="draw:display-name">2 Dots 1 Dash</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">2</xsl:attribute>
+ <xsl:attribute name="draw:dots2">1</xsl:attribute>
+ <xsl:attribute name="draw:dots2-length">0.203cm</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.203cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='dash' or $line='dashed-heavy'">
+ <xsl:attribute name="draw:name">Ultrafine_20_Dashed</xsl:attribute>
+ <xsl:attribute name="draw:display-name">Ultrafine Dashed</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">0.051cm</xsl:attribute>
+ <xsl:attribute name="draw:dots2">1</xsl:attribute>
+ <xsl:attribute name="draw:dots2-length">0.051cm</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.051cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='dotted' or $line='dotted-heavy'">
+ <xsl:attribute name="draw:name">Ultrafine_20_Dotted_20__28_var_29_</xsl:attribute>
+ <xsl:attribute name="draw:display-name">Ultrafine Dotted (var)</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:distance">50%</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='wave' or $line='wavy-heavy'">
+ <xsl:attribute name="draw:name">Ultrafine_20_2_20_Dots_20_3_20_Dashes</xsl:attribute>
+ <xsl:attribute name="draw:display-name">Ultrafine 2 Dots 3 Dashes</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">2</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">0.051cm</xsl:attribute>
+ <xsl:attribute name="draw:dots2">3</xsl:attribute>
+ <xsl:attribute name="draw:dots2-length">0.254cm</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.127cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='dot-dash' or $line='dash-dot-heavy'">
+ <xsl:attribute name="draw:name">_33__20_Dashes_20_3_20_Dots_20__28_var_29_</xsl:attribute>
+ <xsl:attribute name="draw:display-name">3 Dashes 3 Dots (var)</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">3</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">197%</xsl:attribute>
+ <xsl:attribute name="draw:dots2">3</xsl:attribute>
+ <xsl:attribute name="draw:distance">100%</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='double'">
+ <xsl:attribute name="draw:name">Line_20_with_20_Fine_20_Dots</xsl:attribute>
+ <xsl:attribute name="draw:display-name">Line with Fine Dots</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">2.007cm</xsl:attribute>
+ <xsl:attribute name="draw:dots2">10</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.152cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='wavy-double'">
+ <xsl:attribute name="draw:name">Fine_20_Dashed_20__28_var_29_</xsl:attribute>
+ <xsl:attribute name="draw:display-name">Fine Dashed (var)</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">197%</xsl:attribute>
+ <xsl:attribute name="draw:distance">197%</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="draw:name">Fine Dashed</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">0.508cm</xsl:attribute>
+ <xsl:attribute name="draw:dots2">1</xsl:attribute>
+ <xsl:attribute name="draw:dots2-length">0.508cm</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.508cm</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="create-page-master">
+ <xsl:param name="impressoptions"/>
+ <xsl:for-each select="$impressoptions">
+ <xsl:element name="style:page-layout">
+ <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="@演:标识符"/></xsl:call-template></xsl:attribute>
+ <xsl:element name="style:page-layout-properties">
+ <xsl:if test="演:纸张/@uof:宽度">
+ <xsl:attribute name="fo:page-width"><xsl:value-of select="concat(演:纸张/@uof:宽度,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:纸张/@uof:高度">
+ <xsl:attribute name="fo:page-height"><xsl:value-of select="concat((演:纸张/@uof:高度),$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:页边距">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(演:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(演:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(演:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(演:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="演:纸张方向 = 'landscape'">
+ <xsl:attribute name="style:print-orientation">landscape</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:print-orientation">portrait</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="encode-as-nc-name">
+ <xsl:param name="string"/>
+ <xsl:value-of select="translate($string, '. %()/\+', '')"/>
+ </xsl:template>
+ <xsl:key name="tianchongmu" match="/uof:UOF/uof:演示文稿/演:主体/演:母版集/演:母版" use="@演:配色方案引用"/>
+ <xsl:key name="tianchonghuan" match="/uof:UOF/uof:演示文稿/演:主体/演:幻灯片集/演:幻灯片" use="@演:标识符"/>
+ <xsl:template match="演:配色方案">
+ <xsl:if test="key('tianchongmu',@演:标识符)/演:背景">
+ <xsl:for-each select="key('tianchongmu',@演:标识符)/演:背景">
+ <xsl:call-template name="officestyle"/>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="key('tianchonghuan',@演:标识符)/演:背景">
+ <xsl:for-each select="key('tianchonghuan',@演:标识符)/演:背景">
+ <xsl:call-template name="officestyle"/>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:family">drawing-page</xsl:attribute>
+ <xsl:attribute name="style:name"><xsl:value-of select="@演:标识符"/></xsl:attribute>
+ <xsl:element name="style:drawing-page-properties">
+ <xsl:if test="演:填充">
+ <xsl:attribute name="draw:fill">solid</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="演:背景色"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:背景色">
+ <xsl:attribute name="draw:background-size">border</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:阴影">
+ <xsl:attribute name="draw:shadow">visible</xsl:attribute>
+ <xsl:attribute name="draw:shadow-color"><xsl:value-of select="演:阴影"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:文本和线条">
+ <xsl:attribute name="svg:stroke-color"><xsl:value-of select="演:文本和线条"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="key('tianchongmu',@演:标识符)/演:背景">
+ <xsl:for-each select="key('tianchongmu',@演:标识符)/演:背景">
+ <xsl:call-template name="background"/>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="key('tianchonghuan',@演:标识符)/演:背景">
+ <xsl:for-each select="key('tianchonghuan',@演:标识符)/演:背景">
+ <xsl:call-template name="background"/>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:element>
+ <xsl:variable name="style-name">
+ <xsl:value-of select="@演:标识符"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF/uof:演示文稿/演:主体/演:幻灯片集/演:幻灯片[@演:标识符=$style-name]/演:切换">
+ <style:drawing-page-properties>
+ <xsl:if test="@演:速度='slow'">
+ <xsl:attribute name="presentation:transition-speed">slow</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(@演:效果 = 'none')">
+ <xsl:variable name="effect">
+ <xsl:value-of select="@演:效果"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$effect='box in'">
+ <xsl:attribute name="smil:type">irisWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">rectangle</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='box out'">
+ <xsl:attribute name="smil:type">irisWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">rectangle</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='checkerboard across'">
+ <xsl:attribute name="smil:type">checkerBoardWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">across</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='checkerboard down'">
+ <xsl:attribute name="smil:type">checkerBoardWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">down</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='comb horizontal'">
+ <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">combHorizontal</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='comb vertical'">
+ <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">combVertical</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='uncover down'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromTop</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='uncover left'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromRight</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='uncover right'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromLeft</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='uncover up'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromBottom</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='uncover left-down'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromTopRight</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='uncover left-up'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromBottomRight</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='uncover right-down'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromTopLeft</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='uncover right-up'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromBottomLeft</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='cover down'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromTop</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='cover left'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromRight</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='cover right'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromLeft</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='cover up'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromBottom</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='cover left-down'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromTopRight</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='cover left-up'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromBottomRight</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='cover right-down'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromTopLeft</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='cover right-up'">
+ <xsl:attribute name="smil:type">slideWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromBottomLeft</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='fade through black'">
+ <xsl:attribute name="smil:type">fade</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fadeOverColor</xsl:attribute>
+ <xsl:attribute name="smil:fadeColor">#000000</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='push down'">
+ <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromTop</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='push left'">
+ <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromRight</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='push right'">
+ <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromLeft</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='push up'">
+ <xsl:attribute name="smil:type">pushWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fromBottom</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='random bars horizontal'">
+ <xsl:attribute name="smil:type">randomBarWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">horizontal</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='random bars vertical'">
+ <xsl:attribute name="smil:type">randomBarWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">vertical</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='shape circle'">
+ <xsl:attribute name="smil:type">ellipseWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">circle</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='shape diamond'">
+ <xsl:attribute name="smil:type">irisWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">diamond</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='shape plus'">
+ <xsl:attribute name="smil:type">fourBoxWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">cornersOut</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='split horizontal in'">
+ <xsl:attribute name="smil:type">barnDoorWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">horizontal</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='split horizontal out'">
+ <xsl:attribute name="smil:type">barnDoorWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">horizontal</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='split vertical in'">
+ <xsl:attribute name="smil:type">barnDoorWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">vertical</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='split vertical out'">
+ <xsl:attribute name="smil:type">barnDoorWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">vertical</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='wedge'">
+ <xsl:attribute name="smil:type">fanWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">centerTop</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='wheel clockwise – 1 spoke'">
+ <xsl:attribute name="smil:type">pinWheelWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">oneBlade</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='wheel clockwise – 2 spoke'">
+ <xsl:attribute name="smil:type">pinWheelWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">twoBladeVertical</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='wheel clockwise – 3 spoke'">
+ <xsl:attribute name="smil:type">pinWheelWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">threeBlade</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='wheel clockwise – 4 spoke'">
+ <xsl:attribute name="smil:type">pinWheelWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">fourBlade</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='wheel clockwise – 8 spoke'">
+ <xsl:attribute name="smil:type">pinWheelWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">eightBlade</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='wipe left'">
+ <xsl:attribute name="smil:type">barWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">leftToRight</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='wipe right'">
+ <xsl:attribute name="smil:type">barWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">leftToRight</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='wipe up'">
+ <xsl:attribute name="smil:type">barWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">topToBottom</xsl:attribute>
+ <xsl:attribute name="smil:direction">reverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='wipe down'">
+ <xsl:attribute name="smil:type">barWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">topToBottom</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='blinds vertical'">
+ <xsl:attribute name="smil:type">blindsWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">vertical</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='blinds horizontal'">
+ <xsl:attribute name="smil:type">blindsWipe</xsl:attribute>
+ <xsl:attribute name="smil:subtype">horizontal</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='dissolve'">
+ <xsl:attribute name="smil:type">dissolve</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$effect='random transition'">
+ <xsl:attribute name="smil:type">random</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="演:方式/演:单击鼠标='false'">
+ <xsl:attribute name="presentation:transition-type">automatic</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:方式/演:时间间隔">
+ <xsl:attribute name="presentation:duration"><xsl:value-of select="concat('PT00H00M',演:方式/演:时间间隔,'S')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="(演:声音/@演:预定义声音 and not(演:声音/@演:预定义声音='none')) or 演:声音/@演:自定义声音">
+ <xsl:choose>
+ <xsl:when test="演:声音/@演:预定义声音">
+ <xsl:variable name="voice">
+ <xsl:value-of select="演:声音/@演:预定义声音"/>
+ </xsl:variable>
+ <presentation:sound xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">
+ <xsl:attribute name="xlink:href"><xsl:choose><xsl:when test="$voice='applause'">../../../../../../../softwware/Redoffcie%203.0/share/gallery/sounds/applause.wav</xsl:when><xsl:when test="$voice='explosion'">../../../../../../../softwware/Redoffcie%203.0/share/gallery/sounds/explos.wav</xsl:when><xsl:when test="$voice='laser'">../../../../../../../softwware/Redoffcie%203.0/share/gallery/sounds/laser.wav</xsl:when><xsl:otherwise><xsl:value-of select="演:声音/@演:预定义声音"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </presentation:sound>
+ </xsl:when>
+ <xsl:otherwise>
+ <presentation:sound xlink:type="simple" xlink:show="new" xlink:actuate="onRequest">
+ <xsl:attribute name="xlink:href"><xsl:value-of select="演:声音/@演:自定义声音"/></xsl:attribute>
+ </presentation:sound>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </style:drawing-page-properties>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="officestyle">
+ <xsl:variable name="random-name">
+ <xsl:value-of select="generate-id()"/>
+ </xsl:variable>
+ <xsl:variable name="draw-name">
+ <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="图:渐变">
+ <xsl:element name="draw:gradient">
+ <xsl:attribute name="draw:name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
+ <xsl:attribute name="draw:style"><xsl:choose><xsl:when test="图:渐变/@图:种子类型='linear'"><xsl:value-of select="'linear'"/></xsl:when><xsl:when test="图:渐变/@图:种子类型='radar'"><xsl:value-of select="'radial'"/></xsl:when><xsl:when test="图:渐变/@图:种子类型='oval'"><xsl:value-of select="'ellipsoid'"/></xsl:when><xsl:when test="图:渐变/@图:种子类型='square'"><xsl:value-of select="'square'"/></xsl:when><xsl:when test="图:渐变/@图:种子类型='rectangle'"><xsl:value-of select="'rectangular'"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="draw:start-color"><xsl:value-of select="图:渐变/@图:起始色"/></xsl:attribute>
+ <xsl:attribute name="draw:end-color"><xsl:value-of select="图:渐变/@图:终止色"/></xsl:attribute>
+ <xsl:attribute name="draw:start-intensity"><xsl:value-of select="concat(图:渐变/@图:起始浓度,'%')"/></xsl:attribute>
+ <xsl:attribute name="draw:end-intensity"><xsl:value-of select="concat(图:渐变/@图:终止浓度,'%')"/></xsl:attribute>
+ <xsl:attribute name="draw:angle"><xsl:value-of select="图:渐变/@图:渐变方向 * 10"/></xsl:attribute>
+ <xsl:attribute name="draw:border"><xsl:value-of select="concat(图:渐变/@图:边界,'%')"/></xsl:attribute>
+ <xsl:if test="图:渐变/@图:种子X位置">
+ <xsl:attribute name="draw:cx"><xsl:value-of select="concat(图:渐变/@图:种子X位置,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:渐变/@图:种子Y位置">
+ <xsl:attribute name="draw:cy"><xsl:value-of select="concat(图:渐变/@图:种子Y位置,'%')"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="图:图片/@图:图形引用 or 图:图案/@图:图形引用">
+ <xsl:element name="draw:fill-image">
+ <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:图案/@图:图形引用"><xsl:value-of select="图:图案/@图:类型"/></xsl:when><xsl:when test="图:图片/@图:图形引用"><xsl:value-of select="图:图片/@图:名称"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:call-template name="bina_graphic">
+ <xsl:with-param name="refGraphic">
+ <xsl:choose>
+ <xsl:when test="图:图案/@图:图形引用">
+ <xsl:value-of select="图:图案/@图:图形引用"/>
+ </xsl:when>
+ <xsl:when test="图:图片/@图:图形引用">
+ <xsl:value-of select="图:图片/@图:图形引用"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="background">
+ <xsl:variable name="random-name">
+ <xsl:value-of select="generate-id()"/>
+ </xsl:variable>
+ <xsl:variable name="draw-name">
+ <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="图:图片">
+ <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
+ <xsl:attribute name="draw:fill-image-name"><xsl:value-of select="图:图片/@图:名称"/></xsl:attribute>
+ <xsl:if test="not(图:图片/@图:位置='title')">
+ <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="图:图案">
+ <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:图案/@图:前景色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:颜色">
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:颜色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:渐变">
+ <xsl:attribute name="draw:fill">gradient</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:渐变/@图:起始色"/></xsl:attribute>
+ <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="演:母版集">
+ <draw:layer-set>
+ <draw:layer draw:name="layout"/>
+ <draw:layer draw:name="background"/>
+ <draw:layer draw:name="backgroundobjects"/>
+ <draw:layer draw:name="controls"/>
+ <draw:layer draw:name="measurelines"/>
+ </draw:layer-set>
+ <xsl:apply-templates select="演:母版"/>
+ </xsl:template>
+ <xsl:template match="演:母版">
+ <xsl:choose>
+ <xsl:when test="@演:类型 = 'handout' ">
+ <xsl:element name="style:handout-master">
+ <xsl:attribute name="style:name"><xsl:value-of select="@演:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:page-layout-name"><xsl:value-of select="@演:页面设置引用"/></xsl:attribute>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@演:配色方案引用"/></xsl:attribute>
+ <xsl:for-each select="uof:锚点[@uof:缩略图='true']">
+ <draw:page-thumbnail draw:layer="backgroundobjects">
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ </draw:page-thumbnail>
+ </xsl:for-each>
+ <xsl:apply-templates select="uof:锚点[not(@uof:缩略图='true')]"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@演:类型 = 'slide'">
+ <xsl:element name="style:master-page">
+ <xsl:attribute name="style:name"><xsl:value-of select="@演:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:page-layout-name"><xsl:value-of select="@演:页面设置引用"/></xsl:attribute>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@演:配色方案引用"/></xsl:attribute>
+ <xsl:apply-templates select="uof:锚点 "/>
+ <xsl:for-each select="/uof:UOF/uof:演示文稿/演:主体/演:母版集/演:母版">
+ <xsl:if test="@演:类型 = 'notes'">
+ <xsl:element name="presentation:notes">
+ <xsl:attribute name="style:page-layout-name"><xsl:value-of select="@演:页面设置引用"/></xsl:attribute>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@演:配色方案引用"/></xsl:attribute>
+ <xsl:apply-templates select="uof:锚点 "/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="uof:句式样">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
+ <xsl:if test="@字:基式样引用">
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="ancestor::字:段落式样">
+ <xsl:attribute name="style:family">paragraph</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:family">text</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:element name="style:text-properties">
+ <xsl:apply-templates select="*"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="段落式样">
+ <xsl:element name="style:style">
+ <xsl:variable name="outline" select="@字:标识符"/>
+ <xsl:attribute name="style:family"><xsl:choose><xsl:when test="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符=$outline]">presentation</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
+ <xsl:if test="@字:基式样引用">
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符=$outline]">
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符=$outline]">
+ <style:graphic-properties draw:stroke="none" draw:fill="none">
+ <xsl:element name="text:list-style">
+ <xsl:call-template name="自动编号"/>
+ </xsl:element>
+ </style:graphic-properties>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:element name="style:paragraph-properties">
+ <xsl:if test="字:自动编号信息">
+ <xsl:attribute name="text:enable-numbering">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="contains($outline,'title')">
+ <xsl:attribute name="fo:text-align">center</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="paragraph-properties"/>
+ </xsl:element>
+ <xsl:element name="style:text-properties">
+ <xsl:apply-templates select="*"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="paragraph-properties">
+ <xsl:choose>
+ <xsl:when test="descendant::字:页边距[@uof:左]">
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="number(((descendant::字:页边距/@uof:左)div 10) *1)"/>cm</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:margin-left">0cm</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="descendant::字:页边距[@uof:右]">
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="number(((descendant::字:页边距/@uof:右)div 10) *1)"/>cm</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:margin-right">0cm</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:text-indent">0cm</xsl:attribute>
+ <xsl:call-template name="bidi"/>
+ </xsl:template>
+ <xsl:template name="bidi">
+ </xsl:template>
+ <xsl:template name="jibianhao">
+ <xsl:param name="biaoshifu"/>
+ <xsl:element name="text:list-level-style-number">
+ <xsl:variable name="currlevel" select="number(@字:级别值)"/>
+ <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
+ <xsl:attribute name="text:style-name">Numbering Symbols</xsl:attribute>
+ <xsl:if test="字:起始编号">
+ <xsl:attribute name="text:start-value"><xsl:value-of select="字:起始编号"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:正规格式">
+ <xsl:attribute name="text:num-regular-exp"><xsl:value-of select="字:正规格式/@值"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="text:display-levels"><xsl:value-of select="string-length(字:编号格式表示) - string-length(translate(字:编号格式表示,'%','') )"/></xsl:attribute>
+ <xsl:if test="字:编号格式">
+ <xsl:call-template name="编号格式"/>
+ </xsl:if>
+ <xsl:if test="字:编号格式表示">
+ <xsl:attribute name="style:num-prefix"><xsl:choose><xsl:when test="number($currlevel) =1"><xsl:value-of select="substring-before(字:编号格式表示,concat('%',$currlevel))"/></xsl:when><xsl:otherwise><xsl:value-of select="substring-after(substring-after( substring-before(字:编号格式表示,concat('%',$currlevel)),concat('%',string(number($currlevel) -1))),'.')"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,concat('%',$currlevel))"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="style:list-level-properties">
+ <xsl:if test="@字:编号对齐方式">
+ <xsl:attribute name="fo:text-align"><xsl:value-of select="@字:编号对齐方式"/></xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="suojinleixing"/>
+ </xsl:element>
+ <xsl:element name="style:text-properties">
+ <xsl:if test="字:符号字体">
+ <xsl:variable name="Font-ID">
+ <xsl:value-of select="字:符号字体/@字:式样引用"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
+ <xsl:if test="@字:标识符=$Font-ID">
+ <xsl:if test="字:字体/@字:中文字体引用">
+ <xsl:attribute name="fo:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="字:符号字体">
+ <xsl:apply-templates select="*"/>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="xiangmufuhao">
+ <xsl:param name="biaoshifu"/>
+ <xsl:variable name="currlevel" select="number(@字:级别值)"/>
+ <xsl:element name="text:list-level-style-bullet">
+ <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat( $biaoshifu,$currlevel)"/></xsl:attribute>
+ <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,'%1')"/></xsl:attribute>
+ <xsl:attribute name="text:bullet-char"><xsl:value-of select="字:项目符号"/></xsl:attribute>
+ <xsl:element name="style:list-level-properties">
+ <xsl:if test="@字:编号对齐方式">
+ <xsl:attribute name="fo:text-align"><xsl:value-of select="@字:编号对齐方式"/></xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="suojinleixing"/>
+ </xsl:element>
+ <xsl:element name="style:text-properties">
+ <xsl:if test="字:符号字体">
+ <xsl:variable name="Font-ID">
+ <xsl:value-of select="字:符号字体/@字:式样引用"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样[@字:标识符=$Font-ID]">
+ <xsl:if test="字:字体/@字:中文字体引用">
+ <xsl:attribute name="fo:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="字:符号字体">
+ <xsl:apply-templates select="*"/>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="suojinleixing">
+ <xsl:if test="字:缩进/字:左/字:绝对/@字:值">
+ <xsl:attribute name="text:space-before"><xsl:value-of select="concat(number(字:缩进/字:左/字:绝对/@字:值),$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:缩进/字:右/字:绝对/@字:值">
+ <xsl:attribute name="text:min-label-width"><xsl:value-of select="concat(number(字:缩进/字:右/字:绝对/@字:值),$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:缩进/字:首行/字:绝对/@字:值">
+ <xsl:attribute name="text:min-label-distance"><xsl:value-of select="concat(number(字:缩进/字:首行/字:绝对/@字:值),$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="imagefuhao">
+ <xsl:param name="biaoshifu"/>
+ <xsl:variable name="currlevel" select="number(@字:级别值)"/>
+ <xsl:element name="text:list-level-style-image" style:vertical-pos="middle" style:vertical-rel="line" fo:width="0.265cm" fo:height="0.265cm">
+ <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat( $biaoshifu,$currlevel)"/></xsl:attribute>
+ <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,'%1')"/></xsl:attribute>
+ <xsl:if test="字:图片符号引用">
+ <xsl:variable name="gid">
+ <xsl:value-of select="字:图片符号引用"/>
+ </xsl:variable>
+ <xsl:element name="office:binary-data">
+ <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="style:list-level-properties">
+ <xsl:attribute name="style:vertical-pos">middle</xsl:attribute>
+ <xsl:attribute name="style:vertical-rel">line</xsl:attribute>
+ <xsl:attribute name="fo:width"><xsl:value-of select="concat(字:图片符号引用/@字:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:height"><xsl:value-of select="concat(字:图片符号引用/@字:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:if test="字:符号字体">
+ <xsl:variable name="Font-ID">
+ <xsl:value-of select="字:符号字体/@字:式样引用"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
+ <xsl:if test="@字:标识符=$Font-ID">
+ <xsl:if test="字:字体/@字:中文字体引用">
+ <xsl:attribute name="fo:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:call-template name="suojinleixing"/>
+ <xsl:if test="@字:编号对齐方式">
+ <xsl:attribute name="fo:text-align"><xsl:value-of select="@字:编号对齐方式"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:element name="style:text-properties">
+ <xsl:for-each select="字:符号字体">
+ <xsl:apply-templates select="*"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="编号格式">
+ <xsl:attribute name="style:num-format"><xsl:choose><xsl:when test="string(字:编号格式)='lower-letter'">a</xsl:when><xsl:when test="string(字:编号格式)='upper-letter'">A</xsl:when><xsl:when test="string(字:编号格式)='lower-roman'">i</xsl:when><xsl:when test="string(字:编号格式)='upper-roman'">I</xsl:when><xsl:when test="string(字:编号格式)='decimal-enclosed-circle'">①, ②, ③, ...</xsl:when><xsl:when test="string(字:编号格式)='ideograph-traditional'">甲, 乙, 丙, ...</xsl:when><xsl:when test="string(字:编号格式)='ideograph-zodiac'">子, 丑, 寅, ...</xsl:when><xsl:when test="string(字:编号格式)='chinese-counting'">一, 二, 三, ...</xsl:when><xsl:when test="string(字:编号格式)='chinese-legal-simplified'">壹, 贰, 叁, ...</xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="演:幻灯片集">
+ <xsl:for-each select="演:幻灯片">
+ <xsl:element name="draw:page">
+ <xsl:attribute name="draw:name"><xsl:value-of select="@演:名称"/></xsl:attribute>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@演:标识符"/></xsl:attribute>
+ <xsl:attribute name="draw:master-page-name"><xsl:value-of select="@演:母版引用"/></xsl:attribute>
+ <xsl:if test="@演:页面版式引用">
+ <xsl:attribute name="presentation:presentation-page-layout-name"><xsl:value-of select="@演:页面版式引用"/></xsl:attribute>
+ </xsl:if>
+ <office:forms form:automatic-focus="false" form:apply-design-mode="false"/>
+ <xsl:apply-templates select="uof:锚点"/>
+ <xsl:apply-templates select="演:动画"/>
+ <xsl:element name="presentation:notes">
+ <xsl:attribute name="draw:style-name">dp2</xsl:attribute>
+ <xsl:apply-templates select="./演:幻灯片备注/uof:锚点"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="演:动画">
+ <xsl:element name="anim:par">
+ <xsl:attribute name="presentation:node-type">timing-root</xsl:attribute>
+ <anim:seq presentation:node-type="main-sequence">
+ <xsl:for-each select="演:序列">
+ <anim:par begin="next">
+ <anim:par smil:begin="0s">
+ <xsl:variable name="animnodename">anim:par</xsl:variable>
+ <xsl:choose>
+ <xsl:when test="演:效果//演:其他">
+ <xsl:copy-of select="演:效果//演:其他/*"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="{$animnodename}">
+ <xsl:attribute name="smil:fill"><xsl:choose><xsl:when test="演:定时/@演:回卷='true'">remove</xsl:when><xsl:otherwise>hold</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="演:增强/演:动画播放后/@演:播放后隐藏='true'">
+ <xsl:attribute name="presentation:preset-property">Direction;Accelerate;Decelerate</xsl:attribute>
+ </xsl:when>
+ <xsl:when test=".//演:轮子">
+ <xsl:attribute name="presentation:preset-property">Spokes</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="演:效果/演:强调/演:更改填充颜色">
+ <xsl:attribute name="presentation:preset-property">FillColor;ColorStyle;Accelerate;Decelerate;AutoReverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="演:效果/演:强调/演:更改字体颜色">
+ <xsl:attribute name="presentation:preset-property">CharColor;ColorStyle;Accelerate;Decelerate;AutoReverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="演:效果/演:强调/演:更改字号">
+ <xsl:attribute name="presentation:preset-property">CharHeight</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="演:效果/演:强调/演:更改字形">
+ <xsl:attribute name="presentation:preset-property">CharDecoration</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="演:效果/演:强调/演:陀螺旋">
+ <xsl:attribute name="presentation:preset-property">Rotate;Accelerate;Decelerate;AutoReverse</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="演:效果/演:强调/演:透明">
+ <xsl:attribute name="presentation:preset-property">Transparency</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="演:效果/演:强调/演:更改线条颜色">
+ <xsl:attribute name="presentation:preset-property">LineColor;ColorStyle;Accelerate;Decelerate;AutoReverse</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:attribute name="presentation:node-type"><xsl:choose><xsl:when test="演:定时/@演:事件='on click'">on-click</xsl:when><xsl:otherwise><xsl:value-of select="演:定时/@演:事件"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="smil:begin"><xsl:value-of select="演:定时/@演:延时"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="演:定时/@演:重复='until next click' ">
+ <xsl:attribute name="smil:repeatCount">indefinite</xsl:attribute>
+ <xsl:attribute name="smil:end">next</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="演:定时/@演:重复='until next slide' ">
+ <xsl:attribute name="smil:repeatCount">indefinite</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="演:定时/@演:重复 !='none'">
+ <xsl:attribute name="smil:repeatCount"><xsl:value-of select="演:定时/@演:重复"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="演:增强/演:动画文本/@演:发送">
+ <xsl:attribute name="anim:iterate-type"><xsl:choose><xsl:when test="演:增强/演:动画文本/@演:发送='by word'">by-word</xsl:when><xsl:when test="演:增强/演:动画文本/@演:发送='by letter'">by-letter</xsl:when><xsl:otherwise>all at once</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="演:增强/演:动画文本/@演:间隔">
+ <xsl:attribute name="anim:iterate-interval"><xsl:value-of select="演:增强/演:动画文本/@演:间隔"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$animnodename='anim:iterate' ">
+ <xsl:attribute name="anim:id"><xsl:value-of select="@演:动画对象"/></xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="演:效果"/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </anim:par>
+ </anim:par>
+ </xsl:for-each>
+ </anim:seq>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="演:效果">
+ <xsl:apply-templates select="演:进入 "/>
+ <xsl:apply-templates select="演:强调"/>
+ <xsl:apply-templates select="演:退出"/>
+ </xsl:template>
+ <xsl:template match="演:进入">
+ <xsl:attribute name="presentation:preset-class">entrance</xsl:attribute>
+ <xsl:apply-templates select="." mode="entrance"/>
+ </xsl:template>
+ <xsl:template match="演:强调">
+ <xsl:attribute name="presentation:preset-class">emphasis</xsl:attribute>
+ <xsl:apply-templates select="." mode="emphasis"/>
+ </xsl:template>
+ <xsl:template match="演:退出">
+ <xsl:attribute name="presentation:preset-class">exit</xsl:attribute>
+ <xsl:apply-templates select="." mode="exit"/>
+ </xsl:template>
+ <xsl:template name="演速度">
+ <xsl:choose>
+ <xsl:when test="./@演:速度='very fast' ">0.5s</xsl:when>
+ <xsl:when test="./@演:速度='fast'">1s</xsl:when>
+ <xsl:when test="./@演:速度='medium'">2s</xsl:when>
+ <xsl:when test="./@演:速度='slow'">3s</xsl:when>
+ <xsl:when test="./@演:速度='very slow'">5s</xsl:when>
+ <xsl:otherwise>1s</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="演:出现" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-appear</xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" anim:sub-item="text" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:盒状" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-box</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.004s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="irisWipe" smil:subtype="rectangle" smil:direction="reverse">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:棋盘" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-checkerboard</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向='down'">downward</xsl:when><xsl:when test="@演:方向='across'">across</xsl:when></xsl:choose></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.004s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:dur="2s" anim:sub-item="text" smil:type="checkerBoardWipe" smil:subtype="down">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:圆形扩展" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-circle</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="ellipseWipe" smil:subtype="horizontal" smil:direction="reverse">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:阶梯状" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-diagonal-squares</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向='left down'">left-to-bottom</xsl:when><xsl:when test="@演:方向='left up'">left-to-top</xsl:when><xsl:when test="@演:方向='right down'">right-to-bottom</xsl:when><xsl:when test="@演:方向='right up'">right-to-top</xsl:when></xsl:choose></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="waterfallWipe" smil:direction="reverse">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向='left down'">horizontalLeft</xsl:when><xsl:when test="@演:方向='left up'">horizontalLeft</xsl:when><xsl:when test="@演:方向='right down'">horizontalRight</xsl:when><xsl:when test="@演:方向='right up'">horizontalRight</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:菱形" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-diamond</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="irisWipe" smil:subtype="diamond" smil:direction="reverse">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:内向溶解" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-dissolve-in</xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="dissolve" smil:direction="reverse">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:闪烁一次" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-flash-once</xsl:attribute>
+ <anim:set smil:begin="0s" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:飞入" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-fly-in</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'from top-right'">from-top-right</xsl:when><xsl:when test="@演:方向 = 'from top-left'">from-top-left</xsl:when><xsl:when test="@演:方向 = 'from bottom-left'">from-bottom-left</xsl:when><xsl:when test="@演:方向 = 'from bottom-right'">from-bottom-right</xsl:when><xsl:when test="@演:方向 = 'from right'">from-right</xsl:when><xsl:when test="@演:方向 = 'from left'">from-left</xsl:when><xsl:when test="@演:方向 = 'from top'">from-top</xsl:when></xsl:choose></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <xsl:variable name="smilvalueX">
+ <xsl:choose>
+ <xsl:when test="contains(@演:方向,'right')">1+width/2;x</xsl:when>
+ <xsl:when test="contains(@演:方向,'left')">0-width/2;x</xsl:when>
+ <xsl:otherwise>x;x</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="smilvalueY">
+ <xsl:choose>
+ <xsl:when test="contains(@演:方向,'bottom')">1+height/2;y</xsl:when>
+ <xsl:when test="contains(@演:方向,'top')">0-height/2;y</xsl:when>
+ <xsl:otherwise>y;y</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <anim:animate smil:fill="hold" smil:attributeName="x" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueX"/></xsl:attribute>
+ </anim:animate>
+ <anim:animate smil:fill="hold" smil:attributeName="y" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueY"/></xsl:attribute>
+ </anim:animate>
+ </xsl:template>
+ <xsl:template match="演:缓慢飞入" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-fly-in-slow</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'from right'">from-right</xsl:when><xsl:when test="@演:方向 = 'from left'">from-left</xsl:when><xsl:when test="@演:方向 = 'from top'">from-top</xsl:when></xsl:choose></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <xsl:variable name="smilvalueX">
+ <xsl:choose>
+ <xsl:when test="contains(@演:方向,'right')">1+width/2;x</xsl:when>
+ <xsl:when test="contains(@演:方向,'left')">0-width/2;x</xsl:when>
+ <xsl:otherwise>x;x</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="smilvalueY">
+ <xsl:choose>
+ <xsl:when test="contains(@演:方向,'bottom')">1+height/2;y</xsl:when>
+ <xsl:when test="contains(@演:方向,'top')">0-height/2;y</xsl:when>
+ <xsl:otherwise>y;y</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <anim:animate smil:fill="hold" smil:attributeName="x" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueX"/></xsl:attribute>
+ </anim:animate>
+ <anim:animate smil:fill="hold" smil:attributeName="y" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueY"/></xsl:attribute>
+ </anim:animate>
+ </xsl:template>
+ <xsl:template match="演:切入" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-peek-in</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'from right'">from-right</xsl:when><xsl:when test="@演:方向 = 'from left'">from-left</xsl:when><xsl:when test="@演:方向 = 'from top'">from-top</xsl:when></xsl:choose></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="slideWipe" smil:direction="reverse">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">fromBottom</xsl:when><xsl:when test="@演:方向 = 'from right'">fromRight</xsl:when><xsl:when test="@演:方向 = 'from left'">fromLeft</xsl:when><xsl:when test="@演:方向 = 'from top'">fromTop</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:十字形扩展" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-plus</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.00025s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="fourBoxWipe" smil:direction="reverse">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'in'">cornersIn</xsl:when><xsl:when test="@演:方向 = 'out'">cornersOut</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:随机线条" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-bars</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="randomBarWipe" smil:direction="reverse">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'horizontal'">vertical</xsl:when><xsl:when test="@演:方向 = 'vertical'">horizontal</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:劈裂" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-split</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向 = 'horizontal out'">horizontal-out</xsl:when><xsl:when test="@演:方向= 'horizontal in'">horizontal-in</xsl:when><xsl:when test="@演:方向= 'vertical in'">vertical-in</xsl:when><xsl:when test="@演:方向= 'vertical out'">vertical-out</xsl:when></xsl:choose></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:dur="0.5s" smil:type="barnDoorWipe">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向 = 'horizontal out'">horizontal</xsl:when><xsl:when test="@演:方向= 'horizontal in'">horizontal</xsl:when><xsl:when test="@演:方向= 'vertical in'">vertical</xsl:when><xsl:when test="@演:方向= 'vertical out'">vertical</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:百叶窗" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-venetian-blinds</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="blindsWipe" smil:direction="reverse">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'horizontal'">vertical</xsl:when><xsl:when test="@演:方向 = 'vertical'">horizontal</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:扇形展开" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-wedge</xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.0015s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="fanWipe" smil:subtype="centerTop">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:轮子" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-wheel</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:辐射状"/></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.00025s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:dur="0.5s" smil:type="pinWheelWipe">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:辐射状='1'">oneBlade</xsl:when><xsl:when test="@演:辐射状='2'">twoBlade</xsl:when><xsl:when test="@演:辐射状='3'">threeBlade</xsl:when><xsl:when test="@演:辐射状='4'">fourBlade</xsl:when><xsl:when test="@演:辐射状='8'">eightBlade</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:擦除" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-wipe</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:速度 = 'from right'">from-right</xsl:when><xsl:when test="@演:速度 = 'from left'">from-left</xsl:when><xsl:when test="@演:速度 = 'from top'">from-top</xsl:when><xsl:when test="@演:速度 = 'from bottom'">from-bottom</xsl:when><xsl:otherwise>from-left</xsl:otherwise></xsl:choose></xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.006s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:transitionFilter smil:type="barWipe" smil:subtype="leftToRight" smil:direction="reverse">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="(@演:速度 = 'from right') or (@演:速度 = 'from left')">leftToRight</xsl:when><xsl:when test="(@演:速度 = 'from top') or (@演:速度 = 'from bottom')">topToBottom</xsl:when><xsl:otherwise>leftToRight</xsl:otherwise></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="演:随机效果" mode="entrance">
+ <xsl:attribute name="presentation:preset-id">ooo-entrance-random</xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ <anim:animate smil:dur="1s" smil:fill="hold" smil:attributeName="width" smil:values="0;width" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ </anim:animate>
+ <anim:animate smil:fill="hold" smil:attributeName="height" smil:values="0;height" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ </anim:animate>
+ <anim:animate smil:fill="hold" smil:attributeName="rotate" smil:values="90;0" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ </anim:animate>
+ <anim:transitionFilter smil:type="fade" smil:subtype="crossfade">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ </anim:transitionFilter>
+ </xsl:template>
+ <xsl:template match="更改填充颜色" mode="emphasis">
+ <xsl:attribute name="presentation:preset-id">ooo-emphasis-fill-color</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type">2</xsl:attribute>
+ <anim:animateColor smil:fill="hold" smil:attributeName="fill-color" presentation:additive="base" anim:color-interpolation="rgb" anim:color-interpolation-direction="clockwise">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:to"><xsl:value-of select="@演:颜色"/></xsl:attribute>
+ </anim:animateColor>
+ <anim:set smil:dur="0.5s" smil:fill="hold" smil:attributeName="fill" smil:to="solid">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="更改字体颜色" mode="emphasis">
+ <xsl:attribute name="presentation:preset-id">ooo-emphasis-font-color</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type">2</xsl:attribute>
+ <anim:animateColor smil:fill="hold" smil:attributeName="fill-color" presentation:additive="base" anim:color-interpolation="rgb" anim:color-interpolation-direction="clockwise">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:to"><xsl:value-of select="@演:颜色"/></xsl:attribute>
+ </anim:animateColor>
+ </xsl:template>
+ <xsl:template match="演:更改字号" mode="emphasis">
+ <xsl:attribute name="presentation:preset-id">ooo-emphasis-font-size</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type">2</xsl:attribute>
+ <anim:animate smil:fill="hold" smil:attributeName="font-size" presentation:additive="base">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:to"><xsl:choose><xsl:when test="@演:预定义尺寸='tiny' ">0.25,1</xsl:when><xsl:when test="@演:预定义尺寸='smaller' ">0.5,1</xsl:when><xsl:when test="@演:预定义尺寸='larger' ">1.5,1</xsl:when><xsl:when test="@演:预定义尺寸='huge' ">4,1</xsl:when><xsl:when test="@演:自定义尺寸"><xsl:value-of select="@演:自定义尺寸"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
+ </anim:animate>
+ </xsl:template>
+ <xsl:template name="emp_font_style">
+ <xsl:param name="fontstyle"/>
+ <xsl:choose>
+ <xsl:when test="contains($fontstyle,' ')">
+ <anim:set smil:dur="indefinite" smil:attributeName="font-style">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:to"><xsl:value-of select="substring-before($fontstyle,' ')"/></xsl:attribute>
+ </anim:set>
+ <xsl:variable name="fontstyle1">
+ <xsl:choose>
+ <xsl:when test="contains($fontstyle,' ')">
+ <xsl:value-of select="substring-after($fontstyle,' ')"/>
+ </xsl:when>
+ <xsl:when test="not($fontstyle=' ')">
+ <xsl:value-of select="$fontstyle"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="emp_font_style">
+ <xsl:with-param name="fontstyle">
+ <xsl:value-of select="$fontstyle1"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="演:更改字形" mode="emphasis">
+ <xsl:attribute name="presentation:preset-id">ooo-emphasis-font-style</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type">1</xsl:attribute>
+ <xsl:call-template name="emp_font_style">
+ <xsl:with-param name="fontstyle">
+ <xsl:value-of select="@演:字形"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template match="演:更改线条颜色" mode="emphasis">
+ <xsl:attribute name="presentation:preset-id">ooo-emphasis-line-color</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type">2</xsl:attribute>
+ <anim:animateColor smil:dur="0s" smil:fill="hold" smil:attributeName="stroke-color" presentation:additive="base" anim:color-interpolation="rgb" anim:color-interpolation-direction="clockwise">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:to"><xsl:value-of select="@演:颜色"/></xsl:attribute>
+ </anim:animateColor>
+ <anim:set smil:dur="0s" smil:fill="hold" anim:sub-item="text" smil:attributeName="stroke" smil:to="solid">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:陀螺旋" mode="emphasis">
+ <xsl:attribute name="presentation:preset-id">ooo-emphasis-spin</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type">2</xsl:attribute>
+ <anim:animateTransform smil:fill="hold" smil:by="180" presentation:additive="base" svg:type="rotate">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:by"><xsl:choose><xsl:when test="@演:预定义角度='quarter spin'">90</xsl:when><xsl:when test="@演:预定义角度='half spin'">180</xsl:when><xsl:when test="@演:预定义角度='full spin'">360</xsl:when><xsl:when test="@演:预定义角度='two spins'">720 </xsl:when><xsl:when test="@演:自定义角度"><xsl:value-of select="@演:自定义角度"/></xsl:when></xsl:choose></xsl:attribute>
+ </anim:animateTransform>
+ </xsl:template>
+ <xsl:template match="演:透明" mode="emphasis">
+ <xsl:attribute name="presentation:preset-id">ooo-emphasis-transparency</xsl:attribute>
+ <xsl:attribute name="smil:repeatCount"><xsl:choose><xsl:when test="(@演:期间 = 'until next click') or (@演:期间 ='until next slide') ">indefinite</xsl:when><xsl:when test="@演:期间='2' or @演:期间 ='3' or @演:期间 ='4' or @演:期间 ='5' or @演:期间 ='10'"><xsl:value-of select="@演:期间"/></xsl:when><xsl:otherwise>2</xsl:otherwise></xsl:choose></xsl:attribute>
+ <anim:set smil:dur="indefinite" anim:sub-item="text" smil:attributeName="opacity">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:to"><xsl:choose><xsl:when test="@演:预定义透明度='25' ">0.25</xsl:when><xsl:when test="@演:预定义透明度='50' ">0.5</xsl:when><xsl:when test="@演:预定义透明度='75' ">0.75</xsl:when><xsl:when test="@演:预定义透明度='100' ">1</xsl:when><xsl:when test="@演:自定义透明度"><xsl:value-of select="@演:自定义透明度"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:缩放" mode="emphasis">
+ <xsl:attribute name="presentation:preset-id">ooo-emphasis-grow-and-shrink</xsl:attribute>
+ <anim:animateTransform smil:fill="hold" anim:sub-item="text" presentation:additive="base" svg:type="scale">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:to"><xsl:choose><xsl:when test="@演:预定义尺寸='tiny' ">0.25,1</xsl:when><xsl:when test="@演:预定义尺寸='smaller' ">0.5,1</xsl:when><xsl:when test="@演:预定义尺寸='larger' ">1.5,1</xsl:when><xsl:when test="@演:预定义尺寸='huge' ">4,1</xsl:when><xsl:when test="@演:自定义尺寸"><xsl:value-of select="@演:自定义尺寸"/></xsl:when><xsl:otherwise>0.5,1</xsl:otherwise></xsl:choose></xsl:attribute>
+ </anim:animateTransform>
+ </xsl:template>
+ <xsl:template match="演:盒状" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-box</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:transitionFilter smil:type="irisWipe" smil:subtype="rectangle" smil:direction="reverse" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.004s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:棋盘" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-checkerboard</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向='down'">downward</xsl:when><xsl:when test="@演:方向='across'">across</xsl:when></xsl:choose></xsl:attribute>
+ <anim:transitionFilter smil:dur="2s" anim:sub-item="text" smil:type="checkerBoardWipe" smil:subtype="down" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.004s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:圆形扩展" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-circle</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:transitionFilter smil:type="ellipseWipe" smil:subtype="horizontal" smil:direction="reverse" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:阶梯状" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-diagonal-squares</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向='left down'">left-to-bottom</xsl:when><xsl:when test="@演:方向='left up'">left-to-top</xsl:when><xsl:when test="@演:方向='right down'">right-to-bottom</xsl:when><xsl:when test="@演:方向='right up'">right-to-top</xsl:when></xsl:choose></xsl:attribute>
+ <anim:transitionFilter smil:type="waterfallWipe" smil:direction="reverse" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向='left down'">horizontalLeft</xsl:when><xsl:when test="@演:方向='left up'">horizontalLeft</xsl:when><xsl:when test="@演:方向='right down'">horizontalRight</xsl:when><xsl:when test="@演:方向='right up'">horizontalRight</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:菱形" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-diamond</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:transitionFilter smil:type="irisWipe" smil:subtype="diamond" smil:direction="reverse" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:消失" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-disappear</xsl:attribute>
+ <anim:set smil:begin="0s" smil:dur="0.001s" smil:fill="hold" anim:sub-item="text" smil:attributeName="visibility" smil:to="visible">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:向外溶解" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-dissolve</xsl:attribute>
+ <anim:transitionFilter smil:type="dissolve" smil:direction="reverse" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:闪烁一次" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-flash-once</xsl:attribute>
+ <anim:animate smil:attributeName="visibility" smil:values="hidden;visible" smil:keyTimes="0;0.5" smil:calcMode="discrete" presentation:additive="base">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:animate>
+ <anim:set smil:dur="0s" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:飞出" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-fly-out</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'to bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'to top-right'">from-top-right</xsl:when><xsl:when test="@演:方向 = 'to top-left'">from-top-left</xsl:when><xsl:when test="@演:方向 = 'to bottom-left'">from-bottom-left</xsl:when><xsl:when test="@演:方向 = 'to bottom-right'">from-bottom-right</xsl:when><xsl:when test="@演:方向 = 'to right'">from-right</xsl:when><xsl:when test="@演:方向 = 'to left'">from-left</xsl:when><xsl:when test="@演:方向 = 'to top'">from-top</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:variable name="smilvalueX">
+ <xsl:choose>
+ <xsl:when test="contains(@演:方向,'right')">x;1+width/2</xsl:when>
+ <xsl:when test="contains(@演:方向,'left')">x;0-width/2</xsl:when>
+ <xsl:otherwise>x;x</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="smilvalueY">
+ <xsl:choose>
+ <xsl:when test="contains(@演:方向,'bottom')">y;1+height/2</xsl:when>
+ <xsl:when test="contains(@演:方向,'top')">y;0-height/2</xsl:when>
+ <xsl:otherwise>y;y</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <anim:animate smil:fill="hold" smil:attributeName="x" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueX"/></xsl:attribute>
+ </anim:animate>
+ <anim:animate smil:fill="hold" smil:attributeName="y" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueY"/></xsl:attribute>
+ </anim:animate>
+ <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:缓慢移出" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-crawl-out</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'to bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'to right'">from-right</xsl:when><xsl:when test="@演:方向 = 'to left'">from-left</xsl:when><xsl:when test="@演:方向 = 'to top'">from-top</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:variable name="smilvalueX">
+ <xsl:choose>
+ <xsl:when test="contains(@演:方向,'right')">x;1+width/2</xsl:when>
+ <xsl:when test="contains(@演:方向,'left')">x;0-width/2</xsl:when>
+ <xsl:otherwise>x;x</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="smilvalueY">
+ <xsl:choose>
+ <xsl:when test="contains(@演:方向,'bottom')">y;1+height/2</xsl:when>
+ <xsl:when test="contains(@演:方向,'top')">y;0-height/2</xsl:when>
+ <xsl:otherwise>y;y</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <anim:animate smil:fill="hold" smil:attributeName="x" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueX"/></xsl:attribute>
+ </anim:animate>
+ <anim:animate smil:fill="hold" smil:attributeName="y" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:values"><xsl:value-of select="$smilvalueY"/></xsl:attribute>
+ </anim:animate>
+ <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:切出" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-peek-out</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">from-bottom</xsl:when><xsl:when test="@演:方向 = 'from right'">from-right</xsl:when><xsl:when test="@演:方向 = 'from left'">from-left</xsl:when><xsl:when test="@演:方向 = 'from top'">from-top</xsl:when></xsl:choose></xsl:attribute>
+ <anim:transitionFilter smil:type="slideWipe" smil:direction="reverse" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'from bottom'">fromBottom</xsl:when><xsl:when test="@演:方向 = 'from right'">fromRight</xsl:when><xsl:when test="@演:方向 = 'from left'">fromLeft</xsl:when><xsl:when test="@演:方向 = 'from top'">fromTop</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.0005s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:十字形扩展" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-plus</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:transitionFilter smil:type="fourBoxWipe" smil:direction="reverse" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'in'">cornersIn</xsl:when><xsl:when test="@演:方向 = 'out'">cornersOut</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.00025s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:随机线条" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-random-bars</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:transitionFilter smil:type="randomBarWipe" smil:direction="reverse" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'horizontal'">vertical</xsl:when><xsl:when test="@演:方向 = 'vertical'">horizontal</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:劈裂" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-split</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:方向 = 'horizontal out'">horizontal-out</xsl:when><xsl:when test="@演:方向= 'horizontal in'">horizontal-in</xsl:when><xsl:when test="@演:方向= 'vertical in'">vertical-in</xsl:when><xsl:when test="@演:方向= 'vertical out'">vertical-out</xsl:when></xsl:choose></xsl:attribute>
+ <anim:transitionFilter smil:dur="0.5s" smil:type="barnDoorWipe" smil:mode="out">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向 = 'horizontal out'">horizontal</xsl:when><xsl:when test="@演:方向= 'horizontal in'">horizontal</xsl:when><xsl:when test="@演:方向= 'vertical in'">vertical</xsl:when><xsl:when test="@演:方向= 'vertical out'">vertical</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:百叶窗" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-venetian-blinds</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:方向"/></xsl:attribute>
+ <anim:transitionFilter smil:type="blindsWipe" smil:direction="reverse" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:方向= 'horizontal'">vertical</xsl:when><xsl:when test="@演:方向 = 'vertical'">horizontal</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:扇形展开" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-wedge</xsl:attribute>
+ <anim:transitionFilter smil:type="fanWipe" smil:subtype="centerTop" smil:mode="out">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.0015s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:轮子" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-wheel</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:value-of select="@演:辐射状"/></xsl:attribute>
+ <anim:transitionFilter smil:dur="0.5s" smil:type="pinWheelWipe" smil:mode="out">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="@演:辐射状='1'">oneBlade</xsl:when><xsl:when test="@演:辐射状='2'">twoBlade</xsl:when><xsl:when test="@演:辐射状='3'">threeBlade</xsl:when><xsl:when test="@演:辐射状='4'">fourBlade</xsl:when><xsl:when test="@演:辐射状='8'">eightBlade</xsl:when></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.00025s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:擦除" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-wipe</xsl:attribute>
+ <xsl:attribute name="presentation:preset-sub-type"><xsl:choose><xsl:when test="@演:速度 = 'from right'">from-right</xsl:when><xsl:when test="@演:速度 = 'from left'">from-left</xsl:when><xsl:when test="@演:速度 = 'from top'">from-top</xsl:when><xsl:when test="@演:速度 = 'from bottom'">from-bottom</xsl:when><xsl:otherwise>from-left</xsl:otherwise></xsl:choose></xsl:attribute>
+ <anim:transitionFilter smil:type="barWipe" smil:subtype="leftToRight" smil:direction="reverse" smil:mode="out">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:subtype"><xsl:choose><xsl:when test="(@演:速度 = 'from right') or (@演:速度 = 'from left')">leftToRight</xsl:when><xsl:when test="(@演:速度 = 'from top') or (@演:速度 = 'from bottom')">topToBottom</xsl:when><xsl:otherwise>leftToRight</xsl:otherwise></xsl:choose></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:set smil:dur="0.006s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="演:随机效果" mode="exit">
+ <xsl:attribute name="presentation:preset-id">ooo-exit-random</xsl:attribute>
+ <anim:transitionFilter smil:type="fade" smil:subtype="crossfade" smil:mode="out">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:transitionFilter>
+ <anim:animate smil:attributeName="x" smil:values="x;x" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:dur"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:animate>
+ <anim:animate smil:dur="0.1s" smil:decelerate="1" smil:attributeName="y" smil:values="y;y-.03" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:animate>
+ <anim:animate smil:begin="0.1s" smil:dur="0.9s" smil:accelerate="1" smil:attributeName="y" smil:values="y;y+1" smil:keyTimes="0;1" presentation:additive="base">
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:animate>
+ <anim:set smil:dur="0.001s" smil:fill="hold" smil:attributeName="visibility" smil:to="hidden">
+ <xsl:attribute name="smil:begin"><xsl:call-template name="演速度"/></xsl:attribute>
+ <xsl:attribute name="smil:targetElement"><xsl:value-of select="ancestor::演:序列/@演:动画对象"/></xsl:attribute>
+ </anim:set>
+ </xsl:template>
+ <xsl:template match="uof:锚点" name="图形解析">
+ <xsl:variable name="tuxing1" select="@uof:图形引用"/>
+ <xsl:choose>
+ <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]">
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='png' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='jpg' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='gif'">
+ <xsl:element name="draw:frame">
+ <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::uof:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
+ <xsl:attribute name="presentation:class">graphic</xsl:attribute>
+ <xsl:attribute name="presentation:user-transformed">true</xsl:attribute>
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="draw:layer">layout</xsl:attribute>
+ <xsl:if test="../演:动画/演:序列/@演:动画对象=$tuxing1">
+ <xsl:attribute name="draw:id"><xsl:value-of select="$tuxing1"/></xsl:attribute>
+ </xsl:if>
+ <draw:image>
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
+ <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
+ <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据">
+ <office:binary-data>
+ <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据"/>
+ </office:binary-data>
+ </xsl:if>
+ </draw:image>
+ </xsl:element>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="graph">
+ <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]"/>
+ <xsl:with-param name="groupx" select="0"/>
+ <xsl:with-param name="groupy" select="0"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="graph">
+ <xsl:param name="id"/>
+ <xsl:param name="groupx"/>
+ <xsl:param name="groupy"/>
+ <xsl:for-each select="$id">
+ <xsl:variable name="tuxing1">
+ <xsl:value-of select="图:预定义图形/图:类别"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$tuxing1='11'">
+ <xsl:call-template name="Rectangle">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='19'">
+ <xsl:call-template name="Oval">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='61'">
+ <xsl:call-template name="Line">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='64'">
+ <xsl:call-template name="Curve">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='65'">
+ <xsl:call-template name="Freeform">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='66'">
+ <xsl:call-template name="Scribble">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='3'">
+ <xsl:call-template name="演文本框"/>
+ </xsl:when>
+ <xsl:when test="$tuxing1='67'">
+ <xsl:call-template name="演缩略图"/>
+ </xsl:when>
+ <xsl:when test="$tuxing1='4'">
+ <xsl:element name="draw:g">
+ <xsl:variable name="tu">
+ <xsl:value-of select="@图:标识符"/>
+ </xsl:variable>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="$tu"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:variable name="this-group-x">
+ <xsl:value-of select="key('rel_graphic_name',@图:标识符)/@uof:x坐标"/>
+ </xsl:variable>
+ <xsl:variable name="this-group-y">
+ <xsl:value-of select="key('rel_graphic_name',@图:标识符)/uof:y坐标"/>
+ </xsl:variable>
+ <xsl:variable name="group-x">
+ <xsl:value-of select="number($groupx + $this-group-x)"/>
+ </xsl:variable>
+ <xsl:variable name="group-y">
+ <xsl:value-of select="number($groupy + $this-group-y)"/>
+ </xsl:variable>
+ <xsl:call-template name="组合图形">
+ <xsl:with-param name="zuheliebiao" select="@图:组合列表"/>
+ <xsl:with-param name="groupx1" select="$group-x"/>
+ <xsl:with-param name="groupy1" select="$group-y"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="common">
+ <xsl:param name="groupx"/>
+ <xsl:param name="groupy"/>
+ <xsl:variable name="tuxing">
+ <xsl:value-of select="@图:标识符"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="key('rel_graphic_name',@图:标识符)">
+ <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="draw:layer"><xsl:choose><xsl:when test="parent::演:母版">backgroundobjects</xsl:when><xsl:otherwise>layout</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="../演:动画/演:序列/@演:动画对象=$tuxing">
+ <xsl:attribute name="draw:id"><xsl:value-of select="$tuxing"/></xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="zuheweizhi-x">
+ <xsl:value-of select="图:组合位置/@图:x坐标"/>
+ </xsl:variable>
+ <xsl:variable name="zuheweizhi-y">
+ <xsl:value-of select="图:组合位置/@图:y坐标"/>
+ </xsl:variable>
+ <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(($groupx + $zuheweizhi-x),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(($groupy + $zuheweizhi-y),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(图:预定义图形 /图:属性/图:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(图:预定义图形/图:属性 /图:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="draw:layer">layout</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="rotate-angle">
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ <xsl:apply-templates select="图:文本内容/字:文字表"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="组合图形">
+ <xsl:param name="zuheliebiao"/>
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:variable name="x">
+ <xsl:value-of select="$groupx1"/>
+ </xsl:variable>
+ <xsl:variable name="y">
+ <xsl:value-of select="$groupy1"/>
+ </xsl:variable>
+ <xsl:variable name="first-pictures">
+ <xsl:value-of select="substring-before($zuheliebiao,',')"/>
+ </xsl:variable>
+ <xsl:variable name="other-pictures">
+ <xsl:value-of select="substring-after($zuheliebiao,',')"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($other-pictures,',')">
+ <xsl:call-template name="graph">
+ <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $first-pictures]"/>
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ <xsl:call-template name="组合图形">
+ <xsl:with-param name="zuheliebiao" select="$other-pictures"/>
+ <xsl:with-param name="groupx1" select="$x"/>
+ <xsl:with-param name="groupy1" select="$y"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="graph">
+ <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $first-pictures]"/>
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ <xsl:call-template name="graph">
+ <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $other-pictures]"/>
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="Curve">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:path">
+ <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
+ <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
+ <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
+ <xsl:attribute name="svg:d"><xsl:value-of select="图:预定义图形/图:关键点坐标/@图:路径"/></xsl:attribute>
+ <xsl:call-template name="common">
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Freeform">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:polygon">
+ <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
+ <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
+ <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
+ <xsl:attribute name="draw:points"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="图:预定义图形/图:关键点坐标/@图:路径"/><xsl:with-param name="value"/></xsl:call-template></xsl:attribute>
+ <xsl:call-template name="common">
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Scribble">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:polyline">
+ <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
+ <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
+ <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
+ <xsl:attribute name="draw:points"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="图:预定义图形/图:关键点坐标/@图:路径"/><xsl:with-param name="value"/></xsl:call-template></xsl:attribute>
+ <xsl:call-template name="common">
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="drawpoints">
+ <xsl:param name="points"/>
+ <xsl:param name="value"/>
+ <xsl:variable name="frist-piont">
+ <xsl:value-of select="substring-before($points,'lineto')"/>
+ </xsl:variable>
+ <xsl:variable name="other-points">
+ <xsl:value-of select="substring-after($points,'lineto')"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($other-points,'lineto')">
+ <xsl:variable name="x-coor">
+ <xsl:value-of select="substring-before($frist-piont,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:variable name="y-coor">
+ <xsl:value-of select="substring-after($frist-piont,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:variable name="all-points">
+ <xsl:value-of select="concat($value,$x-coor,',',$y-coor,' ')"/>
+ </xsl:variable>
+ <xsl:call-template name="drawpoints">
+ <xsl:with-param name="points" select="$other-points"/>
+ <xsl:with-param name="value" select="$all-points"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="q-x-coor">
+ <xsl:value-of select="substring-before($frist-piont,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:variable name="q-y-coor">
+ <xsl:value-of select="substring-after($frist-piont,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:variable name="e-x-coor">
+ <xsl:value-of select="substring-before($other-points,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:variable name="e-y-coor">
+ <xsl:value-of select="substring-after($other-points,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:value-of select="concat($value,$q-x-coor,',',$q-y-coor,' ',$e-x-coor,',',$e-y-coor)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="Oval">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:ellipse">
+ <xsl:call-template name="common">
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Rectangle">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:rect">
+ <xsl:call-template name="common">
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Line">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:line">
+ <xsl:variable name="tuxing1" select="@图:标识符"/>
+ <xsl:choose>
+ <xsl:when test="key('rel_graphic_name',@图:标识符)">
+ <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
+ <xsl:attribute name="svg:x1"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y1"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:x2"><xsl:value-of select="concat((@uof:x坐标 + @uof:宽度),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y2"><xsl:value-of select="concat((@uof:y坐标 + @uof:高度),$uofUnit)"/></xsl:attribute>
+ <xsl:if test="../演:动画/演:序列/@演:动画对象=$tuxing1">
+ <xsl:attribute name="draw:id"><xsl:value-of select="$tuxing1"/></xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="zuheweizhi-x">
+ <xsl:value-of select="图:组合位置/@图:x坐标"/>
+ </xsl:variable>
+ <xsl:variable name="zuheweizhi-y">
+ <xsl:value-of select="图:组合位置/@图:y坐标"/>
+ </xsl:variable>
+ <xsl:variable name="hex">
+ <xsl:value-of select="concat(number($groupx1 + $zuheweizhi-x),$uofUnit)"/>
+ </xsl:variable>
+ <xsl:variable name="hey">
+ <xsl:value-of select="concat(number($groupy1 + $zuheweizhi-y),$uofUnit)"/>
+ </xsl:variable>
+ <xsl:attribute name="svg:x1"><xsl:value-of select="$hex"/></xsl:attribute>
+ <xsl:attribute name="svg:y1"><xsl:value-of select="$hey"/></xsl:attribute>
+ <xsl:attribute name="svg:x2"><xsl:value-of select="concat(($hex + 图:预定义图形/图:属性/图:宽度),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y2"><xsl:value-of select="concat(($hey + 图:预定义图形/图:属性/图:高度),$uofUnit)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="rotate-angle">
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ <xsl:apply-templates select="图:文本内容/字:文字表"/>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="演文本框">
+ <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
+ <xsl:variable name="tuxing1" select="@uof:图形引用"/>
+ <xsl:element name="draw:frame">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="draw:layer"><xsl:choose><xsl:when test="parent::演:母版">backgroundobjects</xsl:when><xsl:otherwise>layout</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:类别 = '3' and (parent::演:幻灯片/@演:配色方案引用) and not(@uof:占位符 = 'graphic')">
+ <xsl:attribute name="presentation:style-name"><xsl:value-of select="parent::演:幻灯片/@演:配色方案引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="../演:动画/演:序列/@演:动画对象=$tuxing1">
+ <xsl:attribute name="draw:id"><xsl:value-of select="$tuxing1"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(@uof:占位符 = 'graphic')">
+ <xsl:attribute name="presentation:style-name"><xsl:value-of select="@uof:图形引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="placeholdType">
+ <xsl:value-of select="@uof:占位符"/>
+ </xsl:variable>
+ <xsl:if test="@uof:占位符">
+ <xsl:attribute name="presentation:class"><xsl:choose><xsl:when test="@uof:占位符 = 'clipart'">graphic</xsl:when><xsl:when test="@uof:占位符 = 'media_clip'">graphic</xsl:when><xsl:when test="@uof:占位符 = 'graphics'">graphic</xsl:when><xsl:when test="@uof:占位符 = 'number'">page_number</xsl:when><xsl:when test="@uof:占位符 = 'centertitle'">title</xsl:when><xsl:when test="@uof:占位符 = 'date'">date-time</xsl:when><xsl:when test="@uof:占位符 = 'vertical_text'">vertical_outline</xsl:when><xsl:when test="@uof:占位符 = 'vertical_subtitle'">vertical_outline</xsl:when><xsl:otherwise><xsl:value-of select="@uof:占位符"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
+ <xsl:variable name="leibie">
+ <xsl:value-of select="图:预定义图形/图:类别"/>
+ </xsl:variable>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="rotate-angle">
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="图:文本内容 or @图:其他对象">
+ <xsl:attribute name="presentation:user-transformed">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="presentation:placeholder">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="$placeholdType = 'graphic' or $placeholdType = 'clipart' or $placeholdType ='media_clip'">
+ <draw:image/>
+ </xsl:when>
+ <xsl:when test="$placeholdType = 'table' or $placeholdType = 'chart' or $placeholdType ='object'">
+ <draw:object/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="draw:text-box">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="演缩略图">
+ <draw:page-thumbnail>
+ <xsl:call-template name="common"/>
+ <xsl:attribute name="draw:layer">layout</xsl:attribute>
+ <xsl:attribute name="draw:page-number"><xsl:for-each select="../.."><xsl:value-of select="count(preceding-sibling::演:幻灯片) + 1"/></xsl:for-each></xsl:attribute>
+ <xsl:attribute name="presentation:class">page</xsl:attribute>
+ </draw:page-thumbnail>
+ </xsl:template>
+ <xsl:template match="演:页面版式">
+ <xsl:element name="style:presentation-page-layout">
+ <xsl:attribute name="style:name"><xsl:value-of select="@演:标识符"/></xsl:attribute>
+ <xsl:apply-templates select="演:占位符" mode="layout"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="演:占位符" mode="layout">
+ <presentation:placeholder>
+ <xsl:attribute name="presentation:object"><xsl:choose><xsl:when test="@演:类型='vertical_text'">vertical_outline</xsl:when><xsl:when test="@演:类型='date'">date-time</xsl:when><xsl:when test="@演:类型='number'">page_number</xsl:when><xsl:otherwise><xsl:value-of select="@演:类型"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(uof:锚点/@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(uof:锚点/@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(uof:锚点/@uof:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(uof:锚点/@uof:高度,$uofUnit)"/></xsl:attribute>
+ </presentation:placeholder>
+ </xsl:template>
+ <xsl:template match="字:段落">
+ <xsl:choose>
+ <xsl:when test="字:段落属性/字:自动编号信息">
+ <xsl:call-template name="编号解析"/>
+ </xsl:when>
+ <xsl:when test="字:句/字:分页符">
+ <xsl:call-template name="processPageBreaks"/>
+ </xsl:when>
+ <xsl:when test="string(parent::node()/@uof:locID)='t0107'">
+ <xsl:call-template name="jiaozhu"/>
+ </xsl:when>
+ <xsl:when test="string(parent::node()/@uof:locID)='t0108'">
+ <xsl:call-template name="weizhu"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="commonParagraph"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="jiaozhu">
+ <xsl:element name="text:footnote">
+ <xsl:element name="text:footnote-body">
+ <xsl:call-template name="commonParagraph"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="weizhu">
+ <xsl:element name="text:endnote">
+ <xsl:element name="text:endnote-body">
+ <xsl:call-template name="commonParagraph"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="processPageBreaks">
+ <xsl:variable name="pageBreak" select="字:句/字:分页符"/>
+ <xsl:call-template name="createSubParagraph">
+ <xsl:with-param name="list" select="$pageBreak[1]/preceding-sibling::字:句"/>
+ <xsl:with-param name="pageBreak"/>
+ <xsl:with-param name="needsPageBreak">false</xsl:with-param>
+ </xsl:call-template>
+ <xsl:for-each select="$pageBreak">
+ <xsl:call-template name="createSubParagraph">
+ <xsl:with-param name="list" select="./following-sibling::字:句[preceding::字:句/字:分页符 = '.']"/>
+ <xsl:with-param name="pageBreak" select="."/>
+ <xsl:with-param name="needsPageBreak">true</xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="createSubParagraph">
+ <xsl:param name="list"/>
+ <xsl:param name="pageBreak"/>
+ <xsl:param name="needsPageBreak"/>
+ <xsl:if test="(count($list) &gt; 0) or ($needsPageBreak ='true') ">
+ <xsl:element name="text:p">
+ <xsl:choose>
+ <xsl:when test="$needsPageBreak = 'true'">
+ <xsl:choose>
+ <xsl:when test="ancestor::字:段落/字:段落属性">
+ <xsl:attribute name="text:style-name">P<xsl:number from="/uof:UOF/uof:演示文稿/演:主体" level="any" count="字:段落属性"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="text:style-name">PageBreak</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="$pageBreak">
+ <xsl:apply-templates select="$pageBreak"/>
+ </xsl:if>
+ <xsl:apply-templates select="$list"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:区域开始[@字:类型='bookmark']">
+ <text:bookmark-start text:name="{@字:标识符}"/>
+ </xsl:template>
+ <xsl:template match="字:区域结束[preceding::字:区域开始[1]/@字:类型='bookmark']">
+ <text:bookmark-end text:name="{@字:标识符引用}"/>
+ </xsl:template>
+ <xsl:template match="字:段落/字:域开始">
+ <xsl:choose>
+ <xsl:when test="@字:类型='CREATEDATE'">
+ <xsl:variable name="datestr" select="../字:句/字:文本串"/>
+ <xsl:element name="text:date">
+ <xsl:attribute name="style:data-style-name">Time<xsl:number from="/uof:UOF/uof:演示文稿/演:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'CREATEDATE']"/></xsl:attribute>
+ <xsl:attribute name="text:date-value"><xsl:value-of select="concat(substring-before($datestr,' '),'T',substring-after($datestr,' '))"/></xsl:attribute>
+ <xsl:value-of select="$datestr"/>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="commonParagraph">
+ <xsl:element name="text:p">
+ <xsl:if test="@字:动画标识">
+ <xsl:attribute name="text:id"><xsl:value-of select="@字:动画标识"/></xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="commonParagraphAttributes"/>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="commonParagraphAttributes">
+ <xsl:choose>
+ <xsl:when test="字:段落属性">
+ <xsl:attribute name="text:style-name"><xsl:value-of select="字:段落属性/@字:式样引用"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="generate-id(ancestor::字:主体/descendant::字:段落[1]) = generate-id(.)">
+ <xsl:variable name="paragraph-number">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
+ </xsl:variable>
+ <xsl:attribute name="text:style-name">P<xsl:value-of select="number($paragraph-number)"/>_1</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="not(字:段落属性) and (descendant::字:分栏符 or ancestor::字:分节/descendant::字:节属性[字:分栏/@字:栏数 &gt; 1])">
+ <xsl:attribute name="text:style-name">ColumnBreakPara</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:句">
+ <xsl:apply-templates select="字:文本串"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:段落属性"/>
+ <xsl:template match="字:句/字:句属性"/>
+ <xsl:template match="字:句属性" mode="style">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">T<xsl:number from="/uof:UOF/uof:对象集" level="any" count="字:句属性" format="1"/></xsl:attribute>
+ <xsl:attribute name="style:family">text</xsl:attribute>
+ <xsl:if test="@字:式样引用">
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="style:text-properties">
+ <xsl:apply-templates select="./*"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="字:句/字:文本串">
+ <xsl:choose>
+ <xsl:when test="string(.) = ' ' ">
+ <xsl:element name="text:s"/>
+ </xsl:when>
+ <xsl:when test="contains(.,' ')">
+ <xsl:call-template name="replace-spaces">
+ <xsl:with-param name="curr-string" select="."/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="replace-spaces">
+ <xsl:param name="curr-string"/>
+ <xsl:if test="contains($curr-string,' ')">
+ <xsl:value-of select="substring-before($curr-string,' ')"/>
+ <text:s text:c="2"/>
+ <xsl:variable name="next-string" select="substring-after($curr-string,' ')"/>
+ <xsl:choose>
+ <xsl:when test="contains($next-string, ' ')">
+ <xsl:call-template name="replace-spaces">
+ <xsl:with-param name="curr-string" select="$next-string"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$next-string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:句">
+ <xsl:if test="name(following-sibling::*[1])!='字:域结束'">
+ <xsl:if test="字:换行符">
+ <xsl:element name="text:line-break"/>
+ </xsl:if>
+ <xsl:variable name="currently-node" select="./字:锚点"/>
+ <xsl:choose>
+ <xsl:when test="字:句属性//字:隐藏文字/@字:值='true'">
+ <text:hidden-text text:is-hidden="true" text:string-value="{.}"/>
+ </xsl:when>
+ <xsl:when test="字:区域开始[@字:类型='hyperlink']">
+ <xsl:element name="text:a">
+ <xsl:attribute name="xlink:type">simple</xsl:attribute>
+ <xsl:variable name="hyperDest" select="字:区域开始/@字:标识符"/>
+ <xsl:attribute name="xlink:href"><xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接"><xsl:if test="@uof:链源=$hyperDest"><xsl:if test="@uof:目标"><xsl:value-of select="@uof:目标"/></xsl:if><xsl:if test="@uof:书签"><xsl:variable name="bookmarkDest" select="@uof:书签"/><xsl:for-each select="/uof:UOF/uof:书签集/uof:书签"><xsl:if test="@uof:名称=$bookmarkDest"><xsl:value-of select="concat('#',uof:文本位置/@字:区域引用)"/></xsl:if></xsl:for-each></xsl:if></xsl:if></xsl:for-each></xsl:attribute>
+ <xsl:apply-templates select="字:文本串"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="(preceding-sibling::字:句) or (字:句属性)or(字:区域开始)">
+ <xsl:element name="text:span">
+ <xsl:choose>
+ <xsl:when test="字:区域开始[@字:类型='annotation']">
+ <xsl:variable name="ref_comment">
+ <xsl:value-of select="字:区域开始/@字:标识符"/>
+ </xsl:variable>
+ <xsl:apply-templates/>
+ <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:公用处理规则/字:批注集/字:批注[@字:区域引用 = $ref_comment]"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="stylenum">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
+ </xsl:variable>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="字:句属性/@字:式样引用"/></xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="node()[name() = '字:位置']">
+ <xsl:variable name="height">100% </xsl:variable>
+ <xsl:variable name="position">
+ <xsl:choose>
+ <xsl:when test="parent::字:句属性//字:位置">
+ <xsl:value-of select="concat( parent::字:句属性//字:位置, '%')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="style:text-position"><xsl:value-of select="concat(concat( $position, ' '), $height)"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:字体">
+ <xsl:if test="@字:字号">
+ <xsl:attribute name="fo:font-size"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-asian"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-complex"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:相对字号 and self::node( )[not(parent::字:句属性)]">
+ <xsl:variable name="stylename" select="parent::node()/@字:基式样引用"/>
+ <xsl:variable name="zihao">
+ <xsl:for-each select="/uof:UOF/uof:式样集//uof:段落式样[@字:标识符=$stylename]">
+ <xsl:value-of select="字:字体/@字:字号"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="font-size" select="@字:相对字号"/>
+ <xsl:attribute name="fo:font-size"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-asian"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-complex"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:颜色">
+ <xsl:attribute name="fo:color"><xsl:value-of select="string(@字:颜色)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:中文字体引用">
+ <xsl:attribute name="style:font-name-asian"><xsl:value-of select="@字:中文字体引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:西文字体引用">
+ <xsl:attribute name="style:font-name"><xsl:value-of select="@字:西文字体引用"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:斜体">
+ <xsl:if test="@字:值='true'">
+ <xsl:attribute name="fo:font-style">italic</xsl:attribute>
+ <xsl:attribute name="fo:font-style-asian">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:粗体">
+ <xsl:if test="@字:值='true'">
+ <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
+ <xsl:attribute name="fo:font-weight-asian">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:下划线">
+ <xsl:choose>
+ <xsl:when test="@字:字下划线 = 'true'">
+ <xsl:attribute name="style:text-underline">single</xsl:attribute>
+ <xsl:attribute name="style:text-underline-color">font-color</xsl:attribute>
+ <xsl:attribute name="fo:score-spaces">false</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'thick'">
+ <xsl:attribute name="style:text-underline">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dotted-heavy'">
+ <xsl:attribute name="style:text-underline">bold-dotted</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dashed-heavy'">
+ <xsl:attribute name="style:text-underline">bold-dash</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-long'">
+ <xsl:attribute name="style:text-underline">long-dash</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-long-heavy'">
+ <xsl:attribute name="style:text-underline">bold-long-dash</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-dot-heavy'">
+ <xsl:attribute name="style:text-underline">bold-dot-dash</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-dot-dot-heavy'">
+ <xsl:attribute name="style:text-underline">bold-dot-dot-dash</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'wavy-heavy'">
+ <xsl:attribute name="style:text-underline">bold-wave</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'wavy-double'">
+ <xsl:attribute name="style:text-underline">double-wave</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:text-underline"><xsl:value-of select="@字:类型"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@字:颜色 and not(@字:颜色 = 'auto')">
+ <xsl:attribute name="style:text-underline-color"><xsl:value-of select="concat( '#', @字:颜色)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:阴影">
+ <xsl:attribute name="style:text-shadow">1pt 1pt</xsl:attribute>
+ <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:删除线">
+ <xsl:choose>
+ <xsl:when test="@字:类型 = 'single' ">
+ <xsl:attribute name="style:text-crossing-out">single-line</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字类型 = 'double'">
+ <xsl:attribute name="style:text-crossing-out">double-line</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:突出显示">
+ <xsl:attribute name="fo:text-transform">uppercase</xsl:attribute>
+ <xsl:attribute name="fo:text-background-color"><xsl:value-of select="string(@字:颜色)"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="@字:颜色[not(.='auto')]">
+ <xsl:attribute name="fo:color">#<xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:浮雕">
+ <xsl:attribute name="style:font-relief">embossed</xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:外框">
+ <xsl:attribute name="style:text-outline">true</xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:缩放">
+ <xsl:attribute name="style:text-scale"><xsl:value-of select="@字:字号"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:字符间距[parent::字:句属性]">
+ <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="concat( floor(number(字:字符间距 div 1440) * 2540) div 1000, 'cm')"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="uof:字体集">
+ <xsl:if test="not(uof:字体声明[@uof:名称='StarSymbol'])">
+ <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </xsl:if>
+ <xsl:for-each select="uof:字体声明">
+ <xsl:element name="style:font-face">
+ <xsl:attribute name="style:name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
+ <xsl:attribute name="svg:font-family"><xsl:value-of select="@uof:字体族"/></xsl:attribute>
+ <xsl:if test="@uof:字符集 = '02'">
+ <xsl:attribute name="style:font-charset">x-symbol</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@uof:字体族">
+ <xsl:choose>
+ <xsl:when test="@uof:字体族 = 'Swiss'">
+ <xsl:attribute name="style:font-family-generic">swiss</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='Modern'">
+ <xsl:attribute name="style:font-family-generic">modern</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族='Roman'">
+ <xsl:attribute name="style:font-family-generic">roman</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='Script'">
+ <xsl:attribute name="style:font-family-generic">script</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='Decorative'">
+ <xsl:attribute name="style:font-family-generic">decorative</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='System'">
+ <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:attribute name="style:font-pitch">12</xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="uof:字体声明"/>
+ </xsl:template>
+ <xsl:template match="uof:元数据">
+ <office:meta>
+ <meta:generator>UOFText 2004</meta:generator>
+ <dc:title>
+ <xsl:value-of select="uof:标题"/>
+ </dc:title>
+ <dc:description>
+ <xsl:value-of select="uof:摘要"/>
+ </dc:description>
+ <dc:subject>
+ <xsl:value-of select="uof:主题"/>
+ </dc:subject>
+ <meta:initial-creator>
+ <xsl:value-of select="uof:作者"/>
+ </meta:initial-creator>
+ <meta:creation-date>
+ <xsl:value-of select="substring-before( uof:创建日期, 'Z')"/>
+ </meta:creation-date>
+ <dc:creator>
+ <xsl:value-of select="uof:最后作者"/>
+ </dc:creator>
+ <dc:date>
+ <xsl:value-of select="substring-before( uof:编辑时间, 'Z')"/>
+ </dc:date>
+ <meta:printed-by/>
+ <meta:print-date/>
+ <meta:keywords>
+ <meta:keyword>
+ <xsl:value-of select="uof:关键字集/uof:关键字"/>
+ </meta:keyword>
+ </meta:keywords>
+ <dc:language/>
+ <meta:editing-cycles>
+ <xsl:value-of select="uof:编辑次数"/>
+ </meta:editing-cycles>
+ <meta:editing-duration>
+ <xsl:if test="uof:编辑时间">
+ <xsl:value-of select="concat('PT', floor(uof:编辑时间 div 60), 'H', uof:编辑时间 mod 60, 'M0S')"/>
+ </xsl:if>
+ </meta:editing-duration>
+ <meta:user-defined meta:name="Category">
+ <xsl:value-of select="uof:分类"/>
+ </meta:user-defined>
+ <meta:user-defined meta:name="Manager">
+ <xsl:value-of select="uof:经理名称"/>
+ </meta:user-defined>
+ <meta:user-defined meta:name="Company">
+ <xsl:value-of select="uof:公司名称"/>
+ </meta:user-defined>
+ <meta:user-defined meta:name="Version">
+ <xsl:value-of select="uof:创建应用程序"/>
+ </meta:user-defined>
+ <xsl:if test="uof:文档模板|child::*[@uof:locID='u0013']">
+ <meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:href="{child::*[@uof:locID='u0013']}"/>
+ </xsl:if>
+ <xsl:if test="uof:用户自定义元数据集/uof:用户自定义元数据|child::*[@uof:locID='u0016']/*[@uof:locID='u0017']">
+ <xsl:for-each select="uof:用户自定义元数据集/uof:用户自定义元数据|child::*[@uof:locID='u0016']/*[@uof:locID='u0017']">
+ <xsl:element name="meta:user-defined">
+ <xsl:attribute name="meta:name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:if>
+ <meta:document-statistic meta:page-count="{child::*[@uof:locID='u0020']}" meta:paragraph-count="{child::*[@uof:locID='u0025']}" meta:word-count="{child::*[@uof:locID='u0023']}" meta:object-count="{child::*[@uof:locID='u0026']}" meta:character-count="{child::*[@uof:locID='u0021']}"/>
+ <meta:document-statistic/>
+ </office:meta>
+ </xsl:template>
+ <xsl:template match="uof:用户自定义元数据集">
+ <xsl:for-each select="node()[@名称]">
+ <meta:user-defined meta:name="{name()}">
+ <xsl:value-of select="."/>
+ </meta:user-defined>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="parse-range">
+ <xsl:param name="range-value"/>
+ <xsl:param name="last"/>
+ <xsl:variable name="first-pit">
+ <xsl:choose>
+ <xsl:when test="contains($range-value,',')">
+ <xsl:value-of select="substring-before($range-value,',')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$range-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="current">
+ <xsl:choose>
+ <xsl:when test="contains($first-pit,':')">
+ <xsl:variable name="R-start" select="substring-before(substring-after($first-pit,'R'),'C')"/>
+ <xsl:variable name="C-start" select="substring-before(substring-after($first-pit,'C'),':')"/>
+ <xsl:variable name="second-pit" select="substring-after($first-pit,':')"/>
+ <xsl:variable name="R-end" select="substring-before(substring-after($second-pit,'R'),'C')"/>
+ <xsl:variable name="C-end" select="substring-after($second-pit,'C')"/>
+ <xsl:variable name="the-str">
+ <xsl:call-template name="condition-rc-str">
+ <xsl:with-param name="r-start" select="$R-start"/>
+ <xsl:with-param name="r-end" select="$R-end"/>
+ <xsl:with-param name="c-start" select="$C-start"/>
+ <xsl:with-param name="c-end" select="$C-end"/>
+ <xsl:with-param name="last" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$the-str"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($first-pit,',')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($range-value,',')">
+ <xsl:call-template name="parse-range">
+ <xsl:with-param name="range-value" select="substring-after($range-value,',')"/>
+ <xsl:with-param name="last" select="concat($last,$current)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($last,$current)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="condition-rc-str">
+ <xsl:param name="r-start"/>
+ <xsl:param name="r-end"/>
+ <xsl:param name="c-start"/>
+ <xsl:param name="c-end"/>
+ <xsl:param name="last"/>
+ <xsl:variable name="current">
+ <xsl:call-template name="condition-c-str">
+ <xsl:with-param name="rc-str" select="concat('R',$r-start)"/>
+ <xsl:with-param name="start" select="$c-start"/>
+ <xsl:with-param name="end" select="$c-end"/>
+ <xsl:with-param name="last" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$r-start &lt; $r-end">
+ <xsl:call-template name="condition-rc-str">
+ <xsl:with-param name="r-start" select="$r-start + 1"/>
+ <xsl:with-param name="r-end" select="$r-end"/>
+ <xsl:with-param name="c-start" select="$c-start"/>
+ <xsl:with-param name="c-end" select="$c-end"/>
+ <xsl:with-param name="last" select="concat($last,$current)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$r-start = $r-end">
+ <xsl:value-of select="concat($last,$current)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="condition-c-str">
+ <xsl:param name="rc-str"/>
+ <xsl:param name="start"/>
+ <xsl:param name="end"/>
+ <xsl:param name="last"/>
+ <xsl:variable name="current" select="concat($rc-str,'C',$start,',')"/>
+ <xsl:if test="$start &lt; $end">
+ <xsl:call-template name="condition-c-str">
+ <xsl:with-param name="rc-str" select="$rc-str"/>
+ <xsl:with-param name="start" select="$start + 1"/>
+ <xsl:with-param name="end" select="$end"/>
+ <xsl:with-param name="last" select="concat($last,$current)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$start = $end">
+ <xsl:value-of select="concat($last,$current)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="condition-str">
+ <xsl:param name="param-str"/>
+ <xsl:choose>
+ <xsl:when test="contains($param-str,'(')">
+ <xsl:call-template name="condition-str">
+ <xsl:with-param name="param-str" select="substring-after($param-str,'(')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before($param-str,':')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="encode-as-cell-range-address">
+ <xsl:param name="string"/>
+ <xsl:value-of select="$string"/>
+ </xsl:template>
+ <xsl:template name="encode-as-cell-address">
+ <xsl:param name="string"/>
+ <xsl:value-of select="$string"/>
+ </xsl:template>
+ <xsl:param name="dpi" select="111"/>
+ <xsl:param name="centimeter-in-mm" select="10"/>
+ <xsl:param name="inch-in-mm" select="25.4"/>
+ <xsl:param name="didot-point-in-mm" select="0.376065"/>
+ <xsl:param name="pica-in-mm" select="4.2333333"/>
+ <xsl:param name="point-in-mm" select="0.3527778"/>
+ <xsl:param name="twip-in-mm" select="0.017636684"/>
+ <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
+ <!-- ***** MEASUREMENT CONVERSIONS *****
+ PARAM 'value'
+ The measure to be converted.
+ The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
+ directly added to the number.
- PARAM 'rounding-factor'
- Is used for the rounding of decimal places.
- The parameter number is the product of 1 and some '10', where
- every zero represents a decimal place.
+ PARAM 'rounding-factor'
+ Is used for the rounding of decimal places.
+ The parameter number is the product of 1 and some '10', where
+ every zero represents a decimal place.
- For example, providing as parameter:
- <xsl:param name="rounding-factor" select="10000" />
- Gives by default four decimal places.
+ For example, providing as parameter:
+ <xsl:param name="rounding-factor" select="10000" />
+ Gives by default four decimal places.
- To round two decimal places, basically the following is done:
- <xsl:value-of select="round(100 * value) div 100"/>
+ To round two decimal places, basically the following is done:
+ <xsl:value-of select="round(100 * value) div 100"/>
- RETURN The converted number, by default rounded to four decimal places.
- In case the input measure could not be matched the same value is
- returned and a warning message is written out.
+ RETURN The converted number, by default rounded to four decimal places.
+ In case the input measure could not be matched the same value is
+ returned and a warning message is written out.
- MEASURE LIST:
- * 1 milimeter (mm), the basic measure
+ MEASURE LIST:
+ * 1 milimeter (mm), the basic measure
- * 1 centimeter (cm) = 10 mm
+ * 1 centimeter (cm) = 10 mm
- * 1 inch (in) = 25.4 mm
- While the English have already seen the light (read: the metric system), the US
- remains loyal to this medieval system.
+ * 1 inch (in) = 25.4 mm
+ While the English have already seen the light (read: the metric system), the US
+ remains loyal to this medieval system.
- * 1 point (pt) = 0.35277777.. mm
- Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
- There are exactly 72 PostScript points in 1 inch.
+ * 1 point (pt) = 0.35277777.. mm
+ Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
+ There are exactly 72 PostScript points in 1 inch.
- * 1 twip = twentieth of a (PostScript) point
- A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
+ * 1 twip = twentieth of a (PostScript) point
+ A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
- * 1 didot point (dpt) = 0.376065 mm
- Didot point after the French typographer Firmin Didot (1764-1836).
+ * 1 didot point (dpt) = 0.376065 mm
+ Didot point after the French typographer Firmin Didot (1764-1836).
- More details under
- http://www.unc.edu/~rowlett/units/dictP.html:
- "A unit of length used by typographers and printers. When printing was done
- from hand-set metal type, one point represented the smallest element of type
- that could be handled, roughly 1/64 inch. Eventually, the point was standardized
- in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
- about 0.35 mm (351.46 micrometers). In continental Europe, typographers
- traditionally used a slightly larger point of 0.014 83 inch (about
- 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
- after the French typographer Firmin Didot (1764-1836). In the U.S.,
- Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
- or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
- of 0.351 459 8035 mm. The German standards agency DIN has proposed that
- all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
+ More details under
+ http://www.unc.edu/~rowlett/units/dictP.html:
+ "A unit of length used by typographers and printers. When printing was done
+ from hand-set metal type, one point represented the smallest element of type
+ that could be handled, roughly 1/64 inch. Eventually, the point was standardized
+ in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
+ about 0.35 mm (351.46 micrometers). In continental Europe, typographers
+ traditionally used a slightly larger point of 0.014 83 inch (about
+ 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
+ after the French typographer Firmin Didot (1764-1836). In the U.S.,
+ Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
+ or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
+ of 0.351 459 8035 mm. The German standards agency DIN has proposed that
+ all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
- * 1 pica = 4.233333 mm
- 1/6 inch or 12 points
+ * 1 pica = 4.233333 mm
+ 1/6 inch or 12 points
- * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
- Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
+ * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
+ Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
- -->
- <!-- changing measure to mm -->
- <xsl:template name="convert2mm">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="substring-before($value, 'mm')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm' ) * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in' ) * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'mm'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to cm -->
- <xsl:template name="convert2cm">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="substring-before($value, 'cm')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to inch (cp. section comment) -->
- <xsl:template name="convert2in">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $inch-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="substring-before($value, 'in')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $inch-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $inch-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $inch-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $inch-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $inch-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'in'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to dpt (cp. section comment) -->
- <xsl:template name="convert2dpt">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $didot-point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $didot-point-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $didot-point-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="substring-before($value, 'dpt')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $didot-point-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $didot-point-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $didot-point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'dpt'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pica (cp. section comment) -->
- <xsl:template name="convert2pica">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $pica-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $pica-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $pica-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $pica-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="substring-before($value, 'pica')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $pica-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $pica-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pica'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pt (cp. section comment) -->
- <xsl:template name="convert2pt">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $point-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="substring-before($value, 'pt')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $point-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $point-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $point-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pt'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="编号解析">
- <xsl:variable name="bianhao">
- <xsl:value-of select="字:段落属性/字:自动编号信息/@字:编号引用"/>
- </xsl:variable>
- <xsl:variable name="bianhaojibie">
- <xsl:value-of select="字:段落属性/字:自动编号信息/@字:编号级别"/>
- </xsl:variable>
- <xsl:variable name="isxiangmuorisimage">
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号">
- <xsl:choose>
- <xsl:when test="$bianhao=@字:标识符">
- <xsl:choose>
- <xsl:when test="字:级别[@字:级别值= (number($bianhaojibie))]/字:项目符号">true</xsl:when>
- <xsl:when test="字:级别[@字:级别值= (number($bianhaojibie))]/字:图片符号引用">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$isxiangmuorisimage='true'">
- <xsl:call-template name="无序"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="有序"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="有序">
- <xsl:variable name="currlistid" select="字:段落属性/字:自动编号信息/@字:编号引用"/>
- <xsl:variable name="currlistlvl" select="字:段落属性/字:自动编号信息/@字:编号级别"/>
- <xsl:variable name="firstoccur" select="/descendant::字:段落属性[字:自动编号信息/@字:编号引用 = $currlistid][1]"/>
- <xsl:element name="text:list">
- <xsl:attribute name="text:style-name">List<xsl:value-of select="count($firstoccur/preceding::字:自动编号信息)"/></xsl:attribute>
- <xsl:if test="字:段落属性/字:自动编号信息/@字:重新编号">
- <xsl:attribute name="text:continue-numbering"><xsl:choose><xsl:when test="字:段落属性/字:自动编号信息/@字:重新编号='true'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:element name="text:list-item">
- <xsl:call-template name="ordered-levels">
- <xsl:with-param name="level" select="$currlistlvl -1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="ordered-levels">
- <xsl:param name="level"/>
- <xsl:choose>
- <xsl:when test="$level = '0'">
- <xsl:call-template name="commonParagraph"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="text:list">
- <xsl:element name="text:list-item">
- <xsl:call-template name="ordered-levels">
- <xsl:with-param name="level" select="$level -1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="无序">
- <xsl:variable name="currlistid" select="字:段落属性/字:自动编号信息/@字:编号引用"/>
- <xsl:variable name="currlistlvl" select="字:段落属性/字:自动编号信息/@字:编号级别"/>
- <xsl:variable name="firstoccur" select="/descendant::字:段落属性[字:自动编号信息/@字:编号引用 = $currlistid][1]"/>
- <xsl:element name="text:list">
- <xsl:attribute name="text:style-name">List<xsl:value-of select="count($firstoccur/preceding::字:自动编号信息)"/></xsl:attribute>
- <xsl:element name="text:list-item">
- <xsl:call-template name="unordered-levels">
- <xsl:with-param name="level" select="$currlistlvl -1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="unordered-levels">
- <xsl:param name="level"/>
- <xsl:choose>
- <xsl:when test="$level = '0'">
- <xsl:call-template name="commonParagraph"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="text:list">
- <xsl:element name="text:list-item">
- <xsl:call-template name="unordered-levels">
- <xsl:with-param name="level" select="$level -1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pt (cp. section comment) -->
- <xsl:template name="convert2twip">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $twip-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $twip-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $twip-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $twip-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $twip-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="substring-before($value, 'twip')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $twip-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'twip'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pixel by via parameter provided dpi (dots per inch) standard factor (cp. section comment) -->
- <xsl:template name="convert2px">
- <xsl:param name="value"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round(number(substring-before($value, 'mm')) div $pixel-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round(number(substring-before($value, 'cm')) div $pixel-in-mm * $centimeter-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round(number(substring-before($value, 'in')) div $pixel-in-mm * $inch-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round(number(substring-before($value, 'pt')) div $pixel-in-mm * $point-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round(number(substring-before($value, 'dpt')) div $pixel-in-mm * $didot-point-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round(number(substring-before($value, 'pica')) div $pixel-in-mm * $pica-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round(number(substring-before($value, 'twip')) div $pixel-in-mm * $twip-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'px'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ -->
+ <!-- changing measure to mm -->
+ <xsl:template name="convert2mm">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="substring-before($value, 'mm')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm' ) * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in' ) * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'mm'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to cm -->
+ <xsl:template name="convert2cm">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="substring-before($value, 'cm')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to inch (cp. section comment) -->
+ <xsl:template name="convert2in">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $inch-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="substring-before($value, 'in')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $inch-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $inch-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $inch-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $inch-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $inch-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'in'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to dpt (cp. section comment) -->
+ <xsl:template name="convert2dpt">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $didot-point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $didot-point-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $didot-point-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="substring-before($value, 'dpt')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $didot-point-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $didot-point-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $didot-point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'dpt'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pica (cp. section comment) -->
+ <xsl:template name="convert2pica">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $pica-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $pica-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $pica-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $pica-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="substring-before($value, 'pica')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $pica-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $pica-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pica'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pt (cp. section comment) -->
+ <xsl:template name="convert2pt">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $point-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="substring-before($value, 'pt')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $point-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $point-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $point-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pt'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="编号解析">
+ <xsl:variable name="bianhao">
+ <xsl:value-of select="字:段落属性/字:自动编号信息/@字:编号引用"/>
+ </xsl:variable>
+ <xsl:variable name="bianhaojibie">
+ <xsl:value-of select="字:段落属性/字:自动编号信息/@字:编号级别"/>
+ </xsl:variable>
+ <xsl:variable name="isxiangmuorisimage">
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号">
+ <xsl:choose>
+ <xsl:when test="$bianhao=@字:标识符">
+ <xsl:choose>
+ <xsl:when test="字:级别[@字:级别值= (number($bianhaojibie))]/字:项目符号">true</xsl:when>
+ <xsl:when test="字:级别[@字:级别值= (number($bianhaojibie))]/字:图片符号引用">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$isxiangmuorisimage='true'">
+ <xsl:call-template name="无序"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="有序"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="有序">
+ <xsl:variable name="currlistid" select="字:段落属性/字:自动编号信息/@字:编号引用"/>
+ <xsl:variable name="currlistlvl" select="字:段落属性/字:自动编号信息/@字:编号级别"/>
+ <xsl:variable name="firstoccur" select="/descendant::字:段落属性[字:自动编号信息/@字:编号引用 = $currlistid][1]"/>
+ <xsl:element name="text:list">
+ <xsl:attribute name="text:style-name">List<xsl:value-of select="count($firstoccur/preceding::字:自动编号信息)"/></xsl:attribute>
+ <xsl:if test="字:段落属性/字:自动编号信息/@字:重新编号">
+ <xsl:attribute name="text:continue-numbering"><xsl:choose><xsl:when test="字:段落属性/字:自动编号信息/@字:重新编号='true'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="text:list-item">
+ <xsl:call-template name="ordered-levels">
+ <xsl:with-param name="level" select="$currlistlvl -1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="ordered-levels">
+ <xsl:param name="level"/>
+ <xsl:choose>
+ <xsl:when test="$level = '0'">
+ <xsl:call-template name="commonParagraph"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="text:list">
+ <xsl:element name="text:list-item">
+ <xsl:call-template name="ordered-levels">
+ <xsl:with-param name="level" select="$level -1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="无序">
+ <xsl:variable name="currlistid" select="字:段落属性/字:自动编号信息/@字:编号引用"/>
+ <xsl:variable name="currlistlvl" select="字:段落属性/字:自动编号信息/@字:编号级别"/>
+ <xsl:variable name="firstoccur" select="/descendant::字:段落属性[字:自动编号信息/@字:编号引用 = $currlistid][1]"/>
+ <xsl:element name="text:list">
+ <xsl:attribute name="text:style-name">List<xsl:value-of select="count($firstoccur/preceding::字:自动编号信息)"/></xsl:attribute>
+ <xsl:element name="text:list-item">
+ <xsl:call-template name="unordered-levels">
+ <xsl:with-param name="level" select="$currlistlvl -1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="unordered-levels">
+ <xsl:param name="level"/>
+ <xsl:choose>
+ <xsl:when test="$level = '0'">
+ <xsl:call-template name="commonParagraph"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="text:list">
+ <xsl:element name="text:list-item">
+ <xsl:call-template name="unordered-levels">
+ <xsl:with-param name="level" select="$level -1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pt (cp. section comment) -->
+ <xsl:template name="convert2twip">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $twip-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $twip-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $twip-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $twip-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $twip-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="substring-before($value, 'twip')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $twip-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'twip'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pixel by via parameter provided dpi (dots per inch) standard factor (cp. section comment) -->
+ <xsl:template name="convert2px">
+ <xsl:param name="value"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round(number(substring-before($value, 'mm')) div $pixel-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round(number(substring-before($value, 'cm')) div $pixel-in-mm * $centimeter-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round(number(substring-before($value, 'in')) div $pixel-in-mm * $inch-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round(number(substring-before($value, 'pt')) div $pixel-in-mm * $point-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round(number(substring-before($value, 'dpt')) div $pixel-in-mm * $didot-point-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round(number(substring-before($value, 'pica')) div $pixel-in-mm * $pica-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round(number(substring-before($value, 'twip')) div $pixel-in-mm * $twip-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="$value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'px'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/import/uof/uof2odf_spreadsheet.xsl b/filter/source/xslt/import/uof/uof2odf_spreadsheet.xsl
index 0cc023da9b51..2c2c9c0cd317 100644
--- a/filter/source/xslt/import/uof/uof2odf_spreadsheet.xsl
+++ b/filter/source/xslt/import/uof/uof2odf_spreadsheet.xsl
@@ -17,9055 +17,9055 @@
* 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:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
- <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
- <xsl:template match="uof:UOF">
- <!--chengxz0804 OK-->
- <!--office:document xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0" office:class="spreadsheet"-->
- <office:document 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
- <xsl:apply-templates select="uof:元数据"/>
- <office:settings>
- <xsl:call-template name="工作表属性"/>
- </office:settings>
- <xsl:apply-templates select="uof:式样集"/>
- <!--xsl:apply-templates select="表:公用处理规则"/-->
- <xsl:apply-templates select="uof:电子表格"/>
- </office:document>
- </xsl:template>
- <!--Redoffice comment lil from chenjh SC0013 06.02.15-->
- <!--增加内容-->
- <xsl:variable name="uofUnit">
- <xsl:variable name="uu">
- <xsl:value-of select="/uof:UOF/uof:电子表格/表:公用处理规则/表:度量单位"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$uu='cm'">cm</xsl:when>
- <xsl:when test="$uu='mm'">mm</xsl:when>
- <xsl:when test="$uu='pt'">pt</xsl:when>
- <xsl:when test="$uu='inch'">inch</xsl:when>
- <xsl:otherwise>cm</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="other-to-cm-conversion-factor">
- <xsl:choose>
- <xsl:when test="$uofUnit='cm'">1</xsl:when>
- <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
- <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
- <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
- <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
- <xsl:otherwise>0.03527</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!--Redoffice comment liliang end 06.02.15-->
- <xsl:template name="set-calculation">
- <xsl:element name="table:calculation-settings">
- <xsl:if test="表:公用处理规则/表:度量单位">
- <xsl:variable name="uofUnit">
- <xsl:variable name="uu">
- <xsl:value-of select="表:公用处理规则/表:度量单位"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$uu='cm'">cm</xsl:when>
- <xsl:when test="$uu='mm'">mm</xsl:when>
- <xsl:when test="$uu='pt'">pt</xsl:when>
- <xsl:when test="$uu='inch'">inch</xsl:when>
- <xsl:otherwise>cm</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="other-to-cm-conversion-factor">
- <xsl:choose>
- <xsl:when test="$uofUnit='cm'">1</xsl:when>
- <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
- <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
- <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
- <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- </xsl:if>
- <xsl:if test="表:公用处理规则/表:精确度以显示值为准">
- <xsl:attribute name="table:precision-as-shown">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="表:公用处理规则/表:日期系统-1904/@表:值='true'">
- <table:null-date table:date-value="1904-01-01"/>
- </xsl:if>
- <xsl:if test="表:公用处理规则/表:计算设置">
- <xsl:element name="table:iteration">
- <xsl:attribute name="table:status">enable</xsl:attribute>
- <xsl:attribute name="table:steps"><xsl:value-of select="表:公用处理规则/表:计算设置/@表:迭代次数"/></xsl:attribute>
- <xsl:attribute name="table:maximum-difference"><xsl:value-of select="表:公用处理规则/表:计算设置/@表:偏差值"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template match="uof:字体集">
- <xsl:if test="not(uof:字体声明[@uof:名称='StarSymbol'])">
- <style:font-face style:name="StarSymbol" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </xsl:if>
- <xsl:for-each select="uof:字体声明">
- <xsl:element name="style:font-face">
- <xsl:attribute name="style:name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
- <xsl:attribute name="svg:font-family"><xsl:value-of select="@uof:字体族"/></xsl:attribute>
- <xsl:if test="@uof:字符集 = '02'">
- <xsl:attribute name="style:font-charset">x-symbol</xsl:attribute>
- </xsl:if>
- <xsl:if test="@uof:字体族">
- <xsl:choose>
- <xsl:when test="@uof:字体族 = 'Swiss'">
- <xsl:attribute name="style:font-family-generic">swiss</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='Modern'">
- <xsl:attribute name="style:font-family-generic">modern</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族='Roman'">
- <xsl:attribute name="style:font-family-generic">roman</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='Script'">
- <xsl:attribute name="style:font-family-generic">script</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='Decorative'">
- <xsl:attribute name="style:font-family-generic">decorative</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='System'">
- <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:attribute name="style:font-pitch">12</xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- <xsl:apply-templates select="uof:字体声明"/>
- </xsl:template>
- <xsl:template match="uof:电子表格">
- <office:body>
- <office:spreadsheet>
- <xsl:call-template name="trackchange"/>
- <xsl:call-template name="set-calculation"/>
- <xsl:if test="表:公用处理规则/表:数据有效性集">
- <xsl:element name="table:content-validations">
- <xsl:call-template name="create-content-validations">
- <xsl:with-param name="validation-set" select="表:公用处理规则/表:数据有效性集/表:数据有效性"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- <xsl:apply-templates select="表:主体/表:工作表"/>
- <!--MSexcel 中的names暂时没有对应的-->
- <xsl:element name="table:database-ranges">
- <xsl:for-each select="表:主体/表:工作表">
- <xsl:if test="./表:筛选">
- <xsl:variable name="filter" select="./表:筛选"/>
- <xsl:variable name="column-and-row" select="substring-before(substring-after($filter/表:范围/text(),'.'),':')"/>
- <xsl:variable name="dd" select="number(substring($column-and-row,2,1))"/>
- <xsl:variable name="zone-left-column-string">
- <xsl:choose>
- <xsl:when test="contains($dd,'NaN') ">
- <xsl:value-of select="substring($column-and-row,1,2)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($column-and-row,1,1)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="zone-left-column-num">
- <xsl:call-template name="translate-column-char-to-number">
- <xsl:with-param name="string" select="$zone-left-column-string"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:element name="table:database-range">
- <xsl:attribute name="table:name"><xsl:value-of select="uof:电子表格/表:主体/表:工作表/@表:名称"/></xsl:attribute>
- <xsl:attribute name="table:target-range-address"><xsl:call-template name="translate-expression2"><xsl:with-param name="expression2" select="translate($filter/表:范围/text(),'$','')"/></xsl:call-template></xsl:attribute>
- <xsl:if test="$filter/@表:类型='auto'">
- <xsl:attribute name="table:display-filter-buttons">true</xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$filter/表:条件区域">
- <xsl:element name="table:filter">
- <xsl:attribute name="table:condition-source-range-address"><xsl:call-template name="translate-expression2"><xsl:with-param name="expression2" select="translate($filter/表:条件区域/text(),'$','')"/></xsl:call-template></xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="table:filter">
- <xsl:element name="table:filter-and">
- <xsl:call-template name="auto-filter-condition">
- <xsl:with-param name="conditon-set" select="$filter/表:条件"/>
- <xsl:with-param name="zone-left-column-num" select="$zone-left-column-num"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </office:spreadsheet>
- </office:body>
- </xsl:template>
- <xsl:template name="trackchange">
- <xsl:for-each select="表:主体/表:工作表/表:工作表内容//字:修订开始">
- <xsl:variable name="num">
- <xsl:number level="any" from="表:主体/表:工作表/表:工作表内容//*" count="字:修订开始"/>
- </xsl:variable>
- <table:tracked-changes>
- <table:cell-content-change>
- <xsl:attribute name="table:id"><xsl:value-of select="concat('ct',$num)"/></xsl:attribute>
- <table:cell-address>
- <xsl:attribute name="table:column"><xsl:value-of select="substring-after(@字:标识符,'-')"/></xsl:attribute>
- <xsl:attribute name="table:row"><xsl:value-of select="substring-before(@字:标识符,'-')"/></xsl:attribute>
- <xsl:attribute name="table:table">0</xsl:attribute>
- </table:cell-address>
- <office:change-info>
- <dc:creator>
- <xsl:choose>
- <xsl:when test="starts-with(@字:修订信息引用,'+')"/>
- <xsl:otherwise>
- <xsl:value-of select="substring-before(@字:修订信息引用,'+')"/>
- </xsl:otherwise>
- </xsl:choose>
- </dc:creator>
- <!--xsl:value-of select="/uof:UOF/uof:元数据/uof:作者"/-->
- <!--xsl:value-of select="/uof:UOF/uof:元数据/uof:创建日期"/-->
- <dc:date>
- <xsl:value-of select="substring-before(substring-after(@字:修订信息引用,'+'),'%')"/>
- </dc:date>
- </office:change-info>
- <table:previous>
- <table:change-track-table-cell>
- <text:p>
- <xsl:value-of select="substring-after(@字:修订信息引用,'%')"/>
- </text:p>
- </table:change-track-table-cell>
- </table:previous>
- </table:cell-content-change>
- </table:tracked-changes>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="uof:式样集">
- <xsl:element name="office:font-face-decls">
- <style:font-face style:name="宋体" svg:font-family="宋体" style:font-family-generic="swiss"/>
- <xsl:apply-templates select="uof:字体集"/>
- </xsl:element>
- <xsl:call-template name="单元格式样"/>
- </xsl:template>
- <xsl:key match="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/uof:锚点 | /uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/表:单元格/uof:锚点" name="rel_graphic_name" use="@uof:图形引用"/>
- <xsl:template match="图:图形">
- <xsl:variable name="random-name">
- <xsl:value-of select="generate-id()"/>
- </xsl:variable>
- <xsl:variable name="draw-name">
- <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
- </xsl:variable>
- <xsl:call-template name="graphic-fill">
- <xsl:with-param name="draw-name" select="$draw-name"/>
- <xsl:with-param name="gradient-name" select="图:预定义图形/图:属性/图:填充/图:渐变"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="style:family">graphic</xsl:attribute>
- <xsl:element name="style:graphic-properties">
- <xsl:call-template name="process-graphics">
- <xsl:with-param name="draw-name" select="$draw-name"/>
- </xsl:call-template>
- </xsl:element>
- <xsl:element name="style:paragraph-properties">
- <xsl:if test="图:文本内容/@图:文字排列方向">
- <xsl:choose>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
- <xsl:attribute name="style:writing-mode">tb-lr</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
- <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="style:family">graphic</xsl:attribute>
- <xsl:element name="style:graphic-properties">
- <xsl:if test="@图:其他对象">
- <xsl:attribute name="fo:clip">rect(0cm 0cm 0cm 0cm)</xsl:attribute>
- <xsl:attribute name="draw:color-mode">standard</xsl:attribute>
- <xsl:attribute name="draw:luminance">0%</xsl:attribute>
- <xsl:attribute name="draw:contrast">0%</xsl:attribute>
- <xsl:attribute name="draw:gamma">100%</xsl:attribute>
- <xsl:attribute name="draw:red">0%</xsl:attribute>
- <xsl:attribute name="draw:green">0%</xsl:attribute>
- <xsl:attribute name="draw:blue">0%</xsl:attribute>
- <xsl:attribute name="draw:image-opacity">100%</xsl:attribute>
- <xsl:attribute name="style:mirror">none</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="process-graphics"/>
- </xsl:element>
- <xsl:element name="style:paragraph-properties">
- <xsl:if test="图:文本内容/@图:文字排列方向">
- <xsl:choose>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
- <xsl:attribute name="style:writing-mode">tb-lr</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
- <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="process-graphics">
- <xsl:param name="draw-name"/>
- <xsl:if test="not(key('rel_graphic_name',@图:标识符)/@uof:随动方式='movesize')">
- <xsl:attribute name="style:protect"><xsl:choose><xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:随动方式='move'">size</xsl:when><xsl:otherwise>position size</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="not(图:预定义图形/图:属性/图:填充)">
- <xsl:attribute name="draw:fill">none</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片">
- <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
- <xsl:attribute name="draw:fill-image-name"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:attribute>
- <xsl:if test="not(图:预定义图形/图:属性/图:填充/图:图片/@图:位置='tile')">
- <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案">
- <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:前景色"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:颜色">
- <xsl:attribute name="draw:fill">solid</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
- <xsl:attribute name="draw:fill">gradient</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:渐变/@图:起始色"/></xsl:attribute>
- <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="图:预定义图形/图:属性/图:线颜色">
- <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:线型 and not(图:预定义图形/图:属性/图:线型 = 'single') and not(图:预定义图形/图:属性/图:线型 = 'thick')">
- <xsl:variable name="type" select="图:预定义图形/图:属性/图:线型"/>
- <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="$type='none'">none</xsl:when><xsl:when test="$type='single'">solid</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$type='dash'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$type='dot-dash'">Ultrafine_20_2_20_Dots_20_3_20_Dashes</xsl:when><xsl:when test="$type='dashed-heavy'">Fine_20_Dashed</xsl:when><xsl:when test="$type='dotted' ">Fine_20_Dotted</xsl:when><xsl:when test="$type='dash-long-heavy'">Line_20_with_20_Fine_20_Dots</xsl:when><xsl:when test="$type='dash-long'">Fine_20_Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-dot'">_33__20_Dashes_20_3_20_Dots_20__28_var_29_</xsl:when><xsl:when test="$type='dotted-heavy'">Ultrafine_20_Dotted_20__28_var_29_</xsl:when><xsl:when test="$type='thick'">Line_20_Style_20_9</xsl:when><xsl:when test="$type='dot-dot-dash'">_32__20_Dots_20_1_20_Dash</xsl:when><xsl:when test="$type='dash-dot-dot-heavy'">Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-heavy'">Dash_20_10</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:线粗细">
- <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:线粗细,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
- <xsl:attribute name="draw:marker-start"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:前端箭头/图:大小">
- <xsl:attribute name="draw:marker-start-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
- <xsl:attribute name="draw:marker-end"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:后端箭头/图:大小">
- <xsl:attribute name="draw:marker-end-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:透明度">
- <xsl:attribute name="draw:opacity"><xsl:value-of select="concat(图:预定义图形/图:属性/图:透明度,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:if test="图:文本内容/@图:上边距">
- <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(图:文本内容/@图:上边距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(图:文本内容/@图:下边距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(图:文本内容/@图:左边距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(图:文本内容/@图:右边距,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容/@图:文字排列方向">
- <xsl:choose>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
- <xsl:attribute name="style:writing-mode">tb-lr</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
- <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:文本内容/@图:文字排列方向='hori-r2l'">
- <xsl:attribute name="draw:textarea-horizontal-align">right</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:文本内容/@图:文字排列方向='hori-12r'">
- <xsl:attribute name="draw:textarea-horizontal-align">left</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="图:文本内容/@图:水平对齐">
- <xsl:attribute name="draw:textarea-horizontal-align"><xsl:value-of select="图:文本内容/@图:水平对齐"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容/@图:垂直对齐">
- <xsl:attribute name="draw:textarea-vertical-align"><xsl:value-of select="图:文本内容/@图:垂直对齐"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容/@图:自动换行">
- <xsl:attribute name="fo:wrap-option">no-wrap</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="draw:auto-grow-width"><xsl:choose><xsl:when test="图:文本内容/@图:大小适应文字">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="draw:auto-grow-height"><xsl:choose><xsl:when test="图:文本内容/@图:大小适应文字">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template name="bina_graphic">
- <xsl:param name="refGraphic"/>
- <xsl:element name="office:binary-data">
- <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符 = $refGraphic]">
- <xsl:value-of select="uof:数据"/>
- </xsl:for-each>
- </xsl:element>
- <text:p/>
- </xsl:template>
- <xsl:template name="graphic-fill">
- <xsl:param name="draw-name"/>
- <xsl:param name="gradient-name"/>
- <xsl:if test="图:预定义图形/图:属性/图:填充/图:渐变">
- <xsl:element name="draw:gradient">
- <xsl:attribute name="draw:name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
- <xsl:attribute name="draw:style"><xsl:choose><xsl:when test="$gradient-name/@图:种子类型='linear'"><xsl:value-of select="'linear'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='radar'"><xsl:value-of select="'radial'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='oval'"><xsl:value-of select="'ellipsoid'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='square'"><xsl:value-of select="'square'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='rectangle'"><xsl:value-of select="'rectangular'"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="draw:start-color"><xsl:value-of select="$gradient-name/@图:起始色"/></xsl:attribute>
- <xsl:attribute name="draw:end-color"><xsl:value-of select="$gradient-name/@图:终止色"/></xsl:attribute>
- <xsl:attribute name="draw:start-intensity"><xsl:value-of select="concat($gradient-name/@图:起始浓度,'%')"/></xsl:attribute>
- <xsl:attribute name="draw:end-intensity"><xsl:value-of select="concat($gradient-name/@图:终止浓度,'%')"/></xsl:attribute>
- <xsl:attribute name="draw:angle"><xsl:value-of select="$gradient-name/@图:渐变方向 * 10"/></xsl:attribute>
- <xsl:attribute name="draw:border"><xsl:value-of select="concat($gradient-name/@图:边界,'%')"/></xsl:attribute>
- <xsl:if test="$gradient-name/@图:种子X位置">
- <xsl:attribute name="draw:cx"><xsl:value-of select="concat($gradient-name/@图:种子X位置,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$gradient-name/@图:种子Y位置">
- <xsl:attribute name="draw:cy"><xsl:value-of select="concat($gradient-name/@图:种子Y位置,'%')"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
- <xsl:element name="draw:marker">
- <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">
- <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
- <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">
- <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
- <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
- <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
- <xsl:element name="draw:marker">
- <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">
- <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
- <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">
- <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
- <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
- <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用 or 图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
- <xsl:element name="draw:fill-image">
- <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:类型"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:call-template name="bina_graphic">
- <xsl:with-param name="refGraphic">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
- <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"/>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用">
- <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
- </xsl:when>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- <xsl:if test="not(图:预定义图形/图:属性/图:线型='single') and not(图:预定义图形/图:属性/图:线型='thick') and 图:预定义图形/图:属性/图:线型">
- <draw:stroke-dash draw:name="Ultrafine_20_Dashed" draw:display-name="Ultrafine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.051cm" draw:dots2="1" draw:dots2-length="0.051cm" draw:distance="0.051cm"/>
- <draw:stroke-dash draw:name="Fine_20_Dashed" draw:display-name="Fine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.508cm" draw:dots2="1" draw:dots2-length="0.508cm" draw:distance="0.508cm"/>
- <draw:stroke-dash draw:name="Ultrafine_20_2_20_Dots_20_3_20_Dashes" draw:display-name="Ultrafine 2 Dots 3 Dashes" draw:style="rect" draw:dots1="2" draw:dots1-length="0.051cm" draw:dots2="3" draw:dots2-length="0.254cm" draw:distance="0.127cm"/>
- <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
- <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
- <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
- <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
- <draw:stroke-dash draw:name="Line_20_with_20_Fine_20_Dots" draw:display-name="Line with Fine Dots" draw:style="rect" draw:dots1="1" draw:dots1-length="2.007cm" draw:dots2="10" draw:distance="0.152cm"/>
- <draw:stroke-dash draw:name="Line_20_Style_20_9" draw:display-name="Line Style 9" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="120%"/>
- <draw:stroke-dash draw:name="_33__20_Dashes_20_3_20_Dots_20__28_var_29_" draw:display-name="3 Dashes 3 Dots (var)" draw:style="rect" draw:dots1="3" draw:dots1-length="197%" draw:dots2="3" draw:distance="100%"/>
- <draw:stroke-dash draw:name="_32__20_Dots_20_1_20_Dash" draw:display-name="2 Dots 1 Dash" draw:style="rect" draw:dots1="2" draw:dots2="1" draw:dots2-length="0.203cm" draw:distance="0.203cm"/>
- <draw:stroke-dash draw:name="Ultrafine_20_Dotted_20__28_var_29_" draw:display-name="Ultrafine Dotted (var)" draw:style="rect" draw:dots1="1" draw:distance="50%"/>
- <draw:stroke-dash draw:name="Dash_20_10" draw:display-name="Dash 10" draw:style="rect" draw:dots1="1" draw:dots1-length="0.02cm" draw:dots2="1" draw:dots2-length="0.02cm" draw:distance="0.02cm"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="单元格式样">
- <xsl:variable name="uofSheet" select="/uof:UOF/uof:电子表格"/>
- <xsl:variable name="uofSheet1" select="/uof:UOF/uof:电子表格/表:主体/表:工作表"/>
- <xsl:variable name="uofSheetCom" select="$uofSheet/表:公用处理规则"/>
- <xsl:variable name="first-style" select="/uof:UOF/uof:式样集/uof:单元格式样"/>
- <xsl:variable name="quyu" select="/uof:UOF/uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化/表:区域"/>
- <xsl:variable name="condition-format-set" select="/uof:UOF/uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化"/>
- <xsl:variable name="aa">
- <xsl:for-each select="$first-style">
- <xsl:if test="@表:标识符!=@表:名称 and @表:名称!='Normal'">
- <xsl:value-of select="@表:名称"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="bb">
- <xsl:for-each select="$first-style">
- <xsl:if test="@表:标识符!=@表:名称 and @表:名称!='Normal'">
- <xsl:value-of select="@表:标识符"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <office:styles>
- <!-- if ConditionalFormatting exists,it should generate some styles for style:style -->
- <!--xsl:if test="$uofSheetCom/表:条件格式化集">
- <xsl:call-template name="CondFormat_office_style"/>
- </xsl:if-->
- <!--ro000179 chenjh-->
- <xsl:for-each select="$first-style[@表:类型='custom' or @表:类型='default']">
- <xsl:call-template name="单元格具体式样"/>
- <xsl:apply-templates select="表:数字格式[@表:格式码]"/>
- <xsl:apply-templates select="表:字体格式[字:上下标]"/>
- </xsl:for-each>
- </office:styles>
- <office:automatic-styles>
- <xsl:for-each select="$first-style[@表:类型='auto']">
- <xsl:variable name="apply-style-name" select="@表:名称"/>
- <xsl:variable name="style-name" select="@表:标识符"/>
- <xsl:choose>
- <xsl:when test="$style-name!=$apply-style-name and $apply-style-name!='Normal'">
- <xsl:for-each select="$condition-format-set/表:条件">
- <style:style>
- <xsl:attribute name="style:name"><xsl:value-of select="//uof:单元格式样[@表:名称=current()/表:格式/@表:式样引用 and @表:类型='auto']/@表:标识符"/></xsl:attribute>
- <xsl:attribute name="style:family">table-cell</xsl:attribute>
- <xsl:attribute name="style:parent-style-name">Default</xsl:attribute>
- <xsl:for-each select="parent::表:条件格式化/表:条件">
- <xsl:variable name="condition-text">
- <xsl:choose>
- <xsl:when test="@表:类型='cell value'">
- <xsl:choose>
- <xsl:when test="表:操作码/text()='between' ">
- <xsl:value-of select="concat('cell-content-is-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test=" 表:操作码/text()='not between'">
- <xsl:value-of select="concat('cell-content-is-not-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='equal to'">
- <xsl:value-of select="concat('cell-content()=',表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='not equal to'">
- <xsl:value-of select="concat('cell-content()!=',表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='greater than'">
- <xsl:value-of select="concat('cell-content()&gt;',表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='less than'">
- <xsl:value-of select="concat('cell-content()&lt;',表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='greater than or equal to'">
- <xsl:value-of select="concat('cell-content()&gt;=',表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='less than or equal to'">
- <xsl:value-of select="concat('cell-content()&lt;=',表:第一操作数/text())"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@表:类型='formula'">
- <xsl:value-of select="concat('is-true-formula','(',表:第一操作数/text(),')')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="style:map">
- <xsl:variable name="address">
- <xsl:value-of select="preceding-sibling::表:区域"/>
- </xsl:variable>
- <xsl:attribute name="style:condition"><xsl:value-of select="$condition-text"/></xsl:attribute>
- <xsl:attribute name="style:apply-style-name"><xsl:value-of select="表:格式/@表:式样引用"/></xsl:attribute>
- <xsl:attribute name="style:base-cell-address"><xsl:value-of select="substring-after($address,':')"/></xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </style:style>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="uof:单元格式样 ">
- <xsl:if test="@表:类型='auto' and (@表:标识符=@表:名称 or @表:名称='Normal')">
- <xsl:call-template name="单元格具体式样"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <!--Redoffie comment liliang SC0008 06.02.14-->
- <!--1新增内容-->
- <xsl:if test="uof:单元格式样">
- <xsl:for-each select="uof:单元格式样">
- <xsl:if test="@表:类型='auto' and (@表:标识符=@表:名称 or @表:名称='Normal')">
- <xsl:call-template name="单元格具体式样"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='png' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='ipg' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='gif'">
- <style:style style:name="Graphics" style:family="graphics">
- <style:properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
- </style:style>
- </xsl:if>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形"/>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形/图:文本内容/字:段落/字:句/字:句属性" mode="style"/>
- <!--Redoffice comment end 06.02.14-->
- <xsl:apply-templates select="$uofSheet1/表:工作表内容"/>
- <xsl:if test="uof:单元格式样">
- <xsl:for-each select="uof:单元格式样[@表:类型='auto' and (@表:标识符=@表:名称 or @表:名称='Normal')]">
- <xsl:call-template name="单元格具体式样"/>
- <xsl:apply-templates select="表:数字格式[@表:格式码]"/>
- <xsl:apply-templates select="表:字体格式[字:上下标]"/>
- </xsl:for-each>
- </xsl:if>
- <!-- if ConditionalFormatting exists,transforing the styles -->
- <!--xsl:if test="$uofSheetCom/表:条件格式化集">
- <xsl:call-template name="CondFormat_automatic_style"/>
- </xsl:if-->
- <xsl:if test="$uofSheetCom/表:条件格式化集/表:条件格式化">
- <xsl:variable name="style-name" select="$first-style/@表:标识符"/>
- <xsl:variable name="left-top">
- <xsl:call-template name="search-left-top-in-tables">
- <xsl:with-param name="cellstylename" select="$style-name"/>
- <xsl:with-param name="tableslist" select="$uofSheet1/表:工作表内容"/>
- <xsl:with-param name="return" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="after-translated-left-top">
- <xsl:call-template name="translate-left-top">
- <xsl:with-param name="left-top" select="$left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$after-translated-left-top!=''">
- <xsl:call-template name="create-the-condition-format-map">
- <xsl:with-param name="condition-format-set" select="$uofSheetCom/表:条件格式化集//表:条件格式化"/>
- <xsl:with-param name="current-left-top" select="$after-translated-left-top"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- <xsl:apply-templates select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列/表:单元格/*[descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40']]"/>
- <!--xsl:apply-templates select="$uofSheet1/表:工作表属性/表:页面设置/表:页眉页脚/字:段落" /-->
- <xsl:call-template name="create-page-master">
- <xsl:with-param name="worksheetoptions" select="$uofSheet1/表:工作表属性"/>
- </xsl:call-template>
- <xsl:for-each select="uof:句式样">
- <style:style>
- <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
- <xsl:attribute name="style:family">text</xsl:attribute>
- <style:text-properties>
- <xsl:apply-templates select="./*"/>
- </style:text-properties>
- </style:style>
- </xsl:for-each>
- </office:automatic-styles>
- <office:master-styles>
- <xsl:call-template name="create-master-styles">
- <xsl:with-param name="worksheetoptions" select="$uofSheet1/表:工作表属性"/>
- </xsl:call-template>
- </office:master-styles>
- </xsl:template>
- <xsl:template match="表:数据有效性">
- <xsl:variable name="range-name-temp">
- <xsl:value-of select="substring-before(表:区域,'!')"/>
- </xsl:variable>
- <xsl:variable name="range-name">
- <xsl:value-of select="substring($range-name-temp,2,string-length($range-name-temp)-2)"/>
- </xsl:variable>
- <xsl:variable name="first-range">
- <xsl:choose>
- <xsl:when test="contains(表:区域, ',')">
- <xsl:value-of select="translate(substring-after(substring-before(表:区域, ','),'!'),'$','')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate(substring-after(表:区域,'!'),'$','')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="value-first">
- <xsl:value-of select="translate(表:第一操作数,'=','')"/>
- </xsl:variable>
- <xsl:variable name="value-second">
- <xsl:value-of select="translate(表:第二操作数,'=','')"/>
- </xsl:variable>
- <xsl:element name="table:content-validation">
- <xsl:attribute name="table:name"><xsl:value-of select="concat('val', position())"/></xsl:attribute>
- <!--数据有效性:第一操作数、第二操作数-->
- <!-- don't support two type of qualifier: List, Custom -->
- <xsl:attribute name="table:condition"><xsl:variable name="qualifier-content"><xsl:choose><xsl:when test="表:操作码 = 'between'"><xsl:choose><xsl:when test="(number($value-second))"><xsl:value-of select="concat('cell-content-is-between([',$range-name,'.',$value-first,'],',$value-second)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('cell-content-is-between([',$range-name,'.',$value-first,'],[',$range-name,'.',$value-second,']')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:操作码 = 'not between'"><xsl:choose><xsl:when test="number($value-second)"><xsl:value-of select="concat('cell-content-is-not-between([',$range-name,'.',$value-first,'],',$value-second)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('cell-content-is-not-between([',$range-name,'.',$value-first,'],[',$range-name,'.',$value-second,']')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:操作码 = 'not equal to'"><xsl:value-of select="concat('!=', $value-first)"/></xsl:when><xsl:when test="表:操作码 = 'equal to'"><xsl:variable name="range1"><xsl:value-of select="substring-after(substring-before($value-first,':'),'(')"/></xsl:variable><xsl:variable name="range2"><xsl:value-of select="substring-before(substring-after($value-first,':'),')')"/></xsl:variable><xsl:value-of select="concat('=SUM([',$range-name,'.',$range1,':',$range-name,'.',$range2,']')"/></xsl:when><xsl:when test="表:操作码 = 'less than'"><xsl:value-of select="concat('&lt;', $value-first)"/></xsl:when><xsl:when test="表:操作码 = 'greater than'"><xsl:value-of select="concat('&gt;', $value-first)"/></xsl:when><xsl:when test="表:操作码 = 'greater than or equal to'"><xsl:value-of select="concat('&gt;=[',$range-name, '.',$value-first,']')"/></xsl:when><xsl:when test="表:操作码 = 'less than or equal to'"><xsl:value-of select="concat('&lt;=[',$range-name,'.', $value-first,']')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('([',$range-name,'.',substring-before($value-first,':'),':',$range-name,'.',substring-after($value-first,':'),'])')"/></xsl:otherwise></xsl:choose></xsl:variable><!--操作码、校验类型--><xsl:variable name="qualifier-value"><xsl:choose><xsl:when test="表:校验类型 = 'whole number'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-whole-number() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-whole-number() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'decimal'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'list'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-in-list() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-in-list',$qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'date'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-date() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-date() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'time'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-time() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-time() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'text length'"><xsl:choose><xsl:when test="表:操作码 = 'not between'"><xsl:choose><xsl:when test="number($value-second)"><xsl:value-of select="concat('oooc:cell-content-text-length-is-not-between([', $range-name,'.',$value-first, '],', $value-second, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-text-length-is-not-between([',$range-name,'.', $value-first, '],[',$range-name,'.', $value-second, '])')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="$value-second and $value-first"><xsl:choose><xsl:when test="number($value-second)"><xsl:value-of select="concat('oooc:cell-content-text-length-is-between([',$range-name,'.',$value-first,'],',$value-second,')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-text-length-is-between([',$range-name,'.',$value-first,'],[',$range-name,'.',$value-second,'])')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-text-length()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'custom'"><xsl:choose><xsl:when test="表:操作码 = 'between'"><xsl:value-of select="concat('and cell-content-is-between(',substring-before($value-first,'('),'([',$range-name,'.',substring-after(substring-before($value-first,':'),'('),':',$range-name,'.',substring-before(substring-after($value-first,':'),')'),']),0')"/></xsl:when><xsl:when test="表:操作码 = 'not between'"><xsl:value-of select="concat('oooc:and cell-content-is-not-between(',substring-before($value-first,'('),'([',$range-name,'.',substring-after(substring-before($value-first,':'),'('),':',$range-name,'.',substring-before(substring-after($value-first,':'),')'),']),0')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-custom() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="表:校验类型"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:value-of select="$qualifier-value"/></xsl:attribute>
- <!--忽略空格-->
- <xsl:attribute name="table:allow-empty-cell"><xsl:choose><xsl:when test="表:忽略空格"><xsl:value-of select="'false'"/></xsl:when><xsl:otherwise><xsl:value-of select="'true'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="table:base-cell-address"><xsl:variable name="range"><xsl:value-of select="$first-range"/><!--xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0" />
- <xsl:with-param name="cell-column-pos" select="0" />
- <xsl:with-param name="expression" select="$first-range" />
- <xsl:with-param name="return-value" select="''" />
- </xsl:call-template--></xsl:variable><xsl:call-template name="encode-as-cell-address"><xsl:with-param name="string" select="concat($range-name, '.', $range)"/></xsl:call-template></xsl:attribute>
- <!--输入提示-->
- <xsl:element name="table:help-message">
- <xsl:attribute name="table:title"><xsl:value-of select="表:输入提示/@表:标题"/></xsl:attribute>
- <xsl:attribute name="table:display"><xsl:choose><xsl:when test="表:输入提示/@表:显示"><xsl:value-of select="表:输入提示/@表:显示"/></xsl:when><xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:element name="text:p">
- <xsl:value-of select="表:输入提示/@表:内容"/>
- </xsl:element>
- </xsl:element>
- <!--错误提示-->
- <xsl:element name="table:error-message">
- <xsl:attribute name="table:message-type"><xsl:choose><xsl:when test="表:错误提示/@表:类型= 'information'"><xsl:value-of select="'information'"/></xsl:when><xsl:when test="表:错误提示/@表:类型= 'warning'"><xsl:value-of select="'warning'"/></xsl:when><xsl:otherwise><xsl:value-of select="'stop'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="table:title"><xsl:value-of select="表:错误提示/@表:标题"/></xsl:attribute>
- <xsl:attribute name="table:display"><xsl:choose><xsl:when test="表:错误提示/@表:显示"><xsl:value-of select="表:错误提示/@表:显示"/></xsl:when><xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:element name="text:p">
- <xsl:value-of select="表:错误提示/@表:内容"/>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="CondFormat_office_style">
- <xsl:for-each select="../../uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化">
- <xsl:variable name="table-pos" select="count(../../../preceding-sibling::表:公用处理规则)+1"/>
- <xsl:variable name="conditions" select="count(../preceding-sibling::表:条件格式化集)+1"/>
- <xsl:for-each select="表:条件">
- <xsl:variable name="condition-number" select="count(preceding-sibling::表:条件)+1"/>
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat('Excel_CondFormat_',$table-pos,'_',$conditions,'_',$condition-number)"/></xsl:call-template></xsl:attribute>
- <xsl:attribute name="style:family">table-cell</xsl:attribute>
- <xsl:element name="style:properties">
- <xsl:choose>
- <xsl:when test="表:格式/@表:式样引用">
- <xsl:variable name="stylevalue" select="表:格式/@表:式样引用"/>
- <xsl:call-template name="recursion-condformat-style-table-cell">
- <xsl:with-param name="style-value-t">
- <xsl:choose>
- <xsl:when test="substring($stylevalue,string-length($stylevalue),1) != ';'">
- <xsl:value-of select="concat($stylevalue,';')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$stylevalue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <!--xsl:element name="style:text-properties"-->
- <!--chengxz0618-->
- <xsl:element name="style:properties">
- <xsl:choose>
- <xsl:when test="表:格式/@表:式样引用">
- <xsl:variable name="stylevalue" select="表:格式/@表:式样引用"/>
- <xsl:call-template name="recursion-condformat-style-text">
- <xsl:with-param name="style-value-t">
- <xsl:choose>
- <xsl:when test="substring($stylevalue,string-length($stylevalue),1) != ';'">
- <xsl:value-of select="concat($stylevalue,';')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$stylevalue"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:font-style"><xsl:value-of select="'italic'"/></xsl:attribute>
- <xsl:attribute name="style:text-underline-type"><xsl:value-of select="'single'"/></xsl:attribute>
- <xsl:attribute name="style:text-underline-color"><xsl:value-of select="'font-color'"/></xsl:attribute>
- <xsl:attribute name="fo:font-weight"><xsl:value-of select="'bold'"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="cell-pattern-color">
- <xsl:param name="pattern"/>
- <xsl:param name="color-value"/>
- <xsl:param name="pattern-color-value"/>
- <xsl:variable name="rev-pattern" select="1 - $pattern"/>
- <xsl:variable name="color-R-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($color-value,2,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="color-G-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($color-value,4,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="color-B-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($color-value,6,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="pattern-R-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($pattern-color-value,2,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="pattern-G-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($pattern-color-value,4,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="pattern-B-value">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="substring($pattern-color-value,6,2)"/>
- <xsl:with-param name="index" select="1"/>
- <xsl:with-param name="str-length" select="2"/>
- <xsl:with-param name="last-value" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="R-value">
- <xsl:variable name="combined-R-value">
- <xsl:call-template name="decimal2hex">
- <xsl:with-param name="dec-number" select="floor($color-R-value * $rev-pattern + $pattern-R-value * $pattern)"/>
- <xsl:with-param name="last-value" select="'H'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($combined-R-value) = 1">
- <xsl:value-of select="concat('0',$combined-R-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$combined-R-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="G-value">
- <xsl:variable name="combined-G-value">
- <xsl:call-template name="decimal2hex">
- <xsl:with-param name="dec-number" select="floor($color-G-value * $rev-pattern + $pattern-G-value * $pattern)"/>
- <xsl:with-param name="last-value" select="'H'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($combined-G-value) = 1">
- <xsl:value-of select="concat('0',$combined-G-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$combined-G-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="B-value">
- <xsl:variable name="combined-B-value">
- <xsl:call-template name="decimal2hex">
- <xsl:with-param name="dec-number" select="floor($color-B-value * $rev-pattern + $pattern-B-value * $pattern)"/>
- <xsl:with-param name="last-value" select="'H'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($combined-B-value) = 1">
- <xsl:value-of select="concat('0',$combined-B-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$combined-B-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="concat('#',$R-value,$G-value,$B-value)"/>
- </xsl:template>
- <xsl:template name="hex2decimal">
- <xsl:param name="hex-number"/>
- <xsl:param name="index"/>
- <xsl:param name="str-length"/>
- <xsl:param name="last-value"/>
- <xsl:variable name="dec-char">
- <xsl:call-template name="hexNumber2dec">
- <xsl:with-param name="hex-value" select="substring($hex-number, $index ,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="current-value" select="$last-value * 16 + $dec-char"/>
- <xsl:if test="$index &lt; $str-length">
- <xsl:call-template name="hex2decimal">
- <xsl:with-param name="hex-number" select="$hex-number"/>
- <xsl:with-param name="index" select="$index + 1"/>
- <xsl:with-param name="str-length" select="$str-length"/>
- <xsl:with-param name="last-value" select="$current-value"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$index = $str-length">
- <xsl:value-of select="$current-value"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="hexNumber2dec">
- <xsl:param name="hex-value"/>
- <xsl:choose>
- <xsl:when test="$hex-value = 'A' or ($hex-value = 'a')">
- <xsl:value-of select="10"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'B' or ($hex-value = 'b')">
- <xsl:value-of select="11"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'C' or ($hex-value = 'c')">
- <xsl:value-of select="12"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'D' or ($hex-value = 'd')">
- <xsl:value-of select="13"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'E' or ($hex-value = 'e')">
- <xsl:value-of select="14"/>
- </xsl:when>
- <xsl:when test="$hex-value = 'F' or ($hex-value = 'f')">
- <xsl:value-of select="15"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$hex-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="decimal2hex">
- <xsl:param name="dec-number"/>
- <xsl:param name="last-value"/>
- <xsl:variable name="current-value">
- <xsl:call-template name="decNumber2hex">
- <xsl:with-param name="dec-value">
- <xsl:if test="$dec-number &gt; 15">
- <xsl:value-of select="floor($dec-number div 16)"/>
- </xsl:if>
- <xsl:if test="$dec-number &lt; 16">
- <xsl:value-of select="$dec-number"/>
- </xsl:if>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$dec-number &gt; 15">
- <xsl:call-template name="decimal2hex">
- <xsl:with-param name="dec-number" select="$dec-number mod 16"/>
- <xsl:with-param name="last-value" select="concat($last-value,$current-value)"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$dec-number &lt; 16">
- <xsl:value-of select="substring-after(concat($last-value,$current-value),'H')"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="decNumber2hex">
- <xsl:param name="dec-value"/>
- <xsl:choose>
- <xsl:when test="$dec-value = 10">
- <xsl:value-of select="'A'"/>
- </xsl:when>
- <xsl:when test="$dec-value = 11">
- <xsl:value-of select="'B'"/>
- </xsl:when>
- <xsl:when test="$dec-value = 12">
- <xsl:value-of select="'C'"/>
- </xsl:when>
- <xsl:when test="$dec-value = 13">
- <xsl:value-of select="'D'"/>
- </xsl:when>
- <xsl:when test="$dec-value = 14">
- <xsl:value-of select="'E'"/>
- </xsl:when>
- <xsl:when test="$dec-value = 15">
- <xsl:value-of select="'F'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$dec-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="recursion-condformat-style-table-cell">
- <xsl:param name="style-value-t"/>
- <xsl:variable name="style-value" select="$style-value-t"/>
- <xsl:choose>
- <xsl:when test="starts-with($style-value,'background')">
- <xsl:choose>
- <xsl:when test="contains($style-value,'mso-pattern')">
- <xsl:variable name="color-value">
- <xsl:call-template name="translate-color-style">
- <xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="mso-value">
- <xsl:call-template name="translate-color-style">
- <xsl:with-param name="source-str" select="normalize-space(substring-after($style-value,'mso-pattern'))"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="mso-color" select="substring-after($mso-value,'#')"/>
- <xsl:variable name="pattern-color-value" select="substring($mso-color,1,6)"/>
- <xsl:variable name="pattern" select="concat('0.',normalize-space(substring-before(substring-after($mso-color,'gray-'),';')))"/>
- <xsl:variable name="pattern-color">
- <xsl:call-template name="cell-pattern-color">
- <xsl:with-param name="pattern" select="$pattern"/>
- <xsl:with-param name="color-value" select="$color-value"/>
- <xsl:with-param name="pattern-color-value" select="concat('#',$pattern-color-value)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="fo:background-color"><xsl:value-of select="normalize-space($pattern-color)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:background-color"><xsl:call-template name="translate-color-style"><xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:call-template></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="starts-with($style-value,'border')">
- <xsl:attribute name="fo:border"><xsl:value-of select="'0.002cm solid #000000'"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="contains($style-value,':')">
- <xsl:call-template name="recursion-condformat-style-table-cell">
- <xsl:with-param name="style-value-t" select="substring-after($style-value,';')"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="recursion-condformat-style-text">
- <xsl:param name="style-value-t"/>
- <xsl:variable name="style-value" select="normalize-space($style-value-t)"/>
- <xsl:choose>
- <xsl:when test="starts-with($style-value,'color')">
- <xsl:attribute name="fo:color"><xsl:call-template name="translate-color-style"><xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:call-template></xsl:attribute>
- </xsl:when>
- <xsl:when test="starts-with($style-value,'font-style')">
- <xsl:attribute name="fo:font-style"><xsl:value-of select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="starts-with($style-value,'font-weight')">
- <xsl:variable name="font-weight" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
- <xsl:attribute name="fo:font-weight"><xsl:choose><xsl:when test="($font-weight &gt; 300) and ($font-weight &lt; 500)"><xsl:value-of select="'normal'"/></xsl:when><xsl:when test="($font-weight &gt; 500) or ($font-weight = 500)"><xsl:value-of select="'bold'"/></xsl:when><xsl:otherwise><xsl:value-of select="'0'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="starts-with($style-value,'text-underline-style')">
- <xsl:attribute name="style:text-underline-type"><xsl:value-of select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:attribute>
- <xsl:attribute name="style:text-underline-color"><xsl:value-of select="'#000000'"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="contains($style-value,':')">
- <xsl:call-template name="recursion-condformat-style-text">
- <xsl:with-param name="style-value-t" select="substring-after($style-value,';')"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="translate-color-style">
- <xsl:param name="source-str"/>
- <xsl:choose>
- <xsl:when test="starts-with($source-str,'#')">
- <xsl:value-of select="$source-str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="starts-with($source-str,'black')">
- <xsl:value-of select="'#000000'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'maroon')">
- <xsl:value-of select="'#800000'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'red')">
- <xsl:value-of select="'#FF0000'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'fuchsia')">
- <xsl:value-of select="'#FF00FF'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'olive')">
- <xsl:value-of select="'#808000'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'yellow')">
- <xsl:value-of select="'#FFFF00'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'green')">
- <xsl:value-of select="'#008000'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'lime')">
- <xsl:value-of select="'#00FF00'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'teal')">
- <xsl:value-of select="'#008080'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'aqua')">
- <xsl:value-of select="'#00FFFF'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'navy')">
- <xsl:value-of select="'#000080'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'blue')">
- <xsl:value-of select="'#0000FF'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'purple')">
- <xsl:value-of select="'#800080'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'gray')">
- <xsl:value-of select="'#808080'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'silver')">
- <xsl:value-of select="'#C0C0C0'"/>
- </xsl:when>
- <xsl:when test="starts-with($source-str,'white')">
- <xsl:value-of select="'#FFFFFF'"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'#FFFFFF'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="CondFormat_automatic_style">
- <xsl:for-each select="../uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化">
- <xsl:variable name="table-pos" select="count(../../../preceding-sibling::表:公用处理规则)+1"/>
- <xsl:variable name="conditions" select="count(../preceding-sibling::表:条件格式化集)+1"/>
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat('ce',$table-pos,'-',$conditions)"/></xsl:call-template></xsl:attribute>
- <xsl:attribute name="style:family">table-cell</xsl:attribute>
- <xsl:for-each select="uof:单元格式样/表:条件">
- <xsl:variable name="condition-number" select="count(preceding-sibling::表:条件)+1"/>
- <xsl:variable name="base-address">
- <xsl:choose>
- <xsl:when test="contains(../表:区域,',')">
- <xsl:choose>
- <xsl:when test="contains(substring-before(../表:区域,','),':')">
- <xsl:value-of select="substring-before(substring-after(../表:区域,':'),',')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before(../表:区域,',')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="../表:区域"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="base-cell-address">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="substring-before(substring-after($base-address,'R'),'C')"/>
- <xsl:with-param name="row-number" select="substring-after($base-address,'C')"/>
- <xsl:with-param name="column-pos-style" select="absolute"/>
- <xsl:with-param name="row-pos-style" select="absolute"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="condition-value">
- <xsl:call-template name="translate-condition">
- </xsl:call-template>
- </xsl:variable>
- <xsl:element name="style:map">
- <xsl:attribute name="style:condition"><xsl:value-of select="$condition-value"/></xsl:attribute>
- <xsl:attribute name="style:apply-style-name"><xsl:value-of select="concat('Excel_CondFormat_',$table-pos,'_',$conditions,'_',$condition-number)"/></xsl:attribute>
- <xsl:attribute name="style:base-cell-address"><xsl:value-of select="concat(../../@Name,'.',$base-cell-address)"/></xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="translate-condition">
- <xsl:variable name="address-value">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="表:第一操作数"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="表:操作码">
- <xsl:variable name="qualifier" select="表:操作码"/>
- <xsl:variable name="first-value" select="表:第一操作数"/>
- <xsl:choose>
- <xsl:when test="$qualifier = 'Equal'">
- <xsl:choose>
- <xsl:when test="starts-with($first-value,'&quot;')">
- <xsl:value-of select="concat('cell-content()=',$address-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('cell-content()=[',$address-value,']')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$qualifier = 'Less'">
- <xsl:value-of select="concat('cell-content()&lt;[',$address-value,']')"/>
- </xsl:when>
- <xsl:when test="$qualifier = 'Greater'">
- <xsl:value-of select="concat('cell-content()&gt;[',$address-value,']')"/>
- </xsl:when>
- <xsl:when test="$qualifier = 'LessOrEqual'">
- <xsl:value-of select="concat('cell-content()&lt;=[',$address-value,']')"/>
- </xsl:when>
- <xsl:when test="$qualifier = 'GreaterOrEqual'">
- <xsl:value-of select="concat('cell-content()&gt;=[',$address-value,']')"/>
- </xsl:when>
- <xsl:when test="$qualifier = 'NotEqual'">
- <xsl:value-of select="concat('cell-content()!=[',$address-value,']')"/>
- </xsl:when>
- <xsl:when test="$qualifier = 'Between'">
- <xsl:variable name="second-value">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="表:第二操作数"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat('cell-content-is-between([',$address-value,'],[',$second-value,'])')"/>
- </xsl:when>
- <xsl:when test="$qualifier = 'NotBetween'">
- <xsl:variable name="second-value">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="0"/>
- <xsl:with-param name="cell-column-pos" select="0"/>
- <xsl:with-param name="expression" select="表:第二操作数"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat('cell-content-is-not-between([',$address-value,'],[',$second-value,'])')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('is-true-formula(',$address-value,')')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="translate-expression">
- <xsl:param name="cell-row-pos"/>
- <xsl:param name="cell-column-pos"/>
- <xsl:param name="expression"/>
- <xsl:param name="return-value"/>
- <xsl:variable name="temp-range">
- <xsl:choose>
- <xsl:when test="$expression != ''">
- <xsl:call-template name="parse-range-name">
- <xsl:with-param name="expression" select="$expression"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="range-type">
- <xsl:choose>
- <xsl:when test="substring($temp-range, 1, 1) = '1'">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:when test="substring($temp-range, 1, 1) = '2'">
- <xsl:value-of select="2"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="current-range">
- <xsl:value-of select="substring($temp-range, 2)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$range-type = 1">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression">
- <xsl:choose>
- <xsl:when test="contains($current-range, '#$')">
- <xsl:variable name="temp-token">
- <xsl:choose>
- <xsl:when test="contains($current-range, '\')">
- <xsl:value-of select="concat(']', substring-after($current-range, '#$'), &quot;&apos;&quot;)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after($current-range, '#$')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="substring-after($expression, $temp-token)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after($expression, $current-range)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="return-value">
- <xsl:choose>
- <xsl:when test="$current-range = '='">
- <xsl:text>oooc:=</xsl:text>
- </xsl:when>
- <xsl:when test="substring($current-range, string-length($current-range)) = '('">
- <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), $current-range, '[.')"/>
- </xsl:when>
- <xsl:when test="$current-range = ','">
- <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), '];[.')"/>
- </xsl:when>
- <xsl:when test="$current-range = ')'">
- <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), '])')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), $current-range)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="handle-type">
- <xsl:choose>
- <xsl:when test="starts-with($current-range, 'R')">
- <xsl:choose>
- <xsl:when test="contains($current-range, 'C')">
- <xsl:variable name="part-type-r">
- <xsl:call-template name="handle-type-number">
- <xsl:with-param name="t-part" select="substring-before( substring-after($current-range, 'R'), 'C')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="part-type-c">
- <xsl:call-template name="handle-type-number">
- <xsl:with-param name="t-part" select="substring-after($current-range, 'C')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="($part-type-r = 1) and ($part-type-c = 1)">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="4"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="part-type">
- <xsl:call-template name="handle-type-number">
- <xsl:with-param name="t-part" select="substring-after($current-range, 'R')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$part-type = 1">
- <xsl:value-of select="2"/>
- </xsl:when>
- <xsl:when test="$part-type = 2">
- <xsl:value-of select="4"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="4"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="starts-with($current-range, 'C')">
- <xsl:variable name="part-type">
- <xsl:call-template name="handle-type-number">
- <xsl:with-param name="t-part" select="substring-after($current-range, 'C')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$part-type = 1">
- <xsl:value-of select="3"/>
- </xsl:when>
- <xsl:when test="$part-type = 2">
- <xsl:value-of select="4"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="4"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="4"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$handle-type = 1">
- <xsl:variable name="after-R">
- <xsl:value-of select="substring(substring-after($current-range,'R'),1,1)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$after-R='C' or $after-R='[' or $after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
- <xsl:variable name="row-pos">
- <xsl:choose>
- <xsl:when test="$after-R='['">
- <xsl:value-of select="$cell-row-pos+substring-before( substring-after($current-range,'R['),']')"/>
- </xsl:when>
- <xsl:when test="$after-R='C'">
- <xsl:value-of select="$cell-row-pos"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before(substring-after($current-range,'R'),'C')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="row-pos-style">
- <xsl:choose>
- <xsl:when test="$after-R='[' or $after-R='C'">relative</xsl:when>
- <xsl:otherwise>absolute</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="after-C">
- <xsl:value-of select="substring(substring-after(substring-after($current-range,'R'),'C'),1,1)"/>
- </xsl:variable>
- <xsl:variable name="column-digit-length">
- <xsl:choose>
- <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
- <xsl:call-template name="get-digit-length">
- <xsl:with-param name="complexive-string" select="substring-after(substring-after($current-range,'R'),'C')"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="column-pos">
- <xsl:choose>
- <xsl:when test="$after-C='['">
- <xsl:value-of select="$cell-column-pos + substring-before(substring-after(substring-after($current-range,'R'),'C['),']')"/>
- </xsl:when>
- <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
- <xsl:value-of select="substring(substring-after(substring-after($current-range,'R'),'C'),1,$column-digit-length)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$cell-column-pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="column-pos-style">
- <xsl:choose>
- <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">absolute</xsl:when>
- <xsl:otherwise>relative</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="trans-unit">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="$column-pos"/>
- <xsl:with-param name="row-number" select="$row-pos"/>
- <xsl:with-param name="column-pos-style" select="$column-pos-style"/>
- <xsl:with-param name="row-pos-style" select="$row-pos-style"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit)"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
- <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before(substring-after($expression, '('),'R'),',!', ';.'))"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($current-range,'R')"/>
- <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$handle-type = 2">
- <xsl:variable name="after-R">
- <xsl:value-of select="substring(substring-after($current-range,'R'),1,1)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$after-R='[' or $after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
- <xsl:variable name="row-number">
- <xsl:choose>
- <xsl:when test="$after-R = '['">
- <xsl:value-of select="substring-before(substring-after($current-range, 'R['), ']')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after($current-range, 'R')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="row-pos">
- <xsl:choose>
- <xsl:when test="$after-R='['">
- <xsl:value-of select="$cell-row-pos + $row-number"/>
- </xsl:when>
- <xsl:when test="$after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
- <xsl:value-of select="$row-number"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$cell-row-pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="trans-unit1">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="1"/>
- <xsl:with-param name="row-number" select="$row-pos"/>
- <xsl:with-param name="column-pos-style" select="'relative'"/>
- <xsl:with-param name="row-pos-style" select="'relative'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="trans-unit2">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="256"/>
- <xsl:with-param name="row-number" select="$row-pos"/>
- <xsl:with-param name="column-pos-style" select="'relative'"/>
- <xsl:with-param name="row-pos-style" select="'relative'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit1, ':', $trans-unit2)"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
- <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before($current-range,'R'),',!', ';.'),'R')"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($current-range,'R')"/>
- <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$handle-type = 3">
- <xsl:variable name="after-C">
- <xsl:value-of select="substring(substring-after($current-range,'C'),1,1)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$after-C='[' or $after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
- <xsl:variable name="column-number">
- <xsl:choose>
- <xsl:when test="$after-C = '['">
- <xsl:value-of select="substring-before(substring-after($current-range, 'C['), ']')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-after($current-range, 'C')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="column-pos">
- <xsl:choose>
- <xsl:when test="$after-C='['">
- <xsl:value-of select="$cell-column-pos + $column-number"/>
- </xsl:when>
- <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
- <xsl:value-of select="$column-number"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$cell-column-pos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="trans-unit1">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="$column-pos"/>
- <xsl:with-param name="row-number" select="1"/>
- <xsl:with-param name="column-pos-style" select="'relative'"/>
- <xsl:with-param name="row-pos-style" select="'relative'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="trans-unit2">
- <xsl:call-template name="translate-unit">
- <xsl:with-param name="column-number" select="$column-pos"/>
- <xsl:with-param name="row-number" select="32000"/>
- <xsl:with-param name="column-pos-style" select="'relative'"/>
- <xsl:with-param name="row-pos-style" select="'relative'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit1, ':', $trans-unit2)"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
- <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before($current-range,'C'),',!', ';.'),'C')"/>
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($current-range,'C')"/>
- <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="next-pit" select="substring-after($expression, $current-range)"/>
- <xsl:choose>
- <xsl:when test="contains($next-pit, '+') or contains($next-pit, '-') or contains($next-pit, '*') or contains($next-pit, '/') or contains($next-pit, ')') or contains($next-pit, '^') or contains($next-pit, ':') or contains($next-pit, '&quot;') or contains($next-pit, ';') or contains($next-pit, ',') or contains($next-pit, '[')">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
- <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
- <xsl:with-param name="return-value" select="concat($return-value, substring-before($expression, $current-range), $current-range)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate( concat($return-value, substring-before($expression, $current-range), $current-range),',!', ';.')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="parse-range-name">
- <xsl:param name="expression"/>
- <xsl:param name="return-value"/>
- <xsl:variable name="first-one" select="substring($expression,1,1)"/>
- <xsl:choose>
- <xsl:when test="$first-one = '='">
- <xsl:choose>
- <xsl:when test="string-length(normalize-space($return-value)) &gt; 0">
- <xsl:value-of select="concat('2', $return-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>1=</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$first-one='(' or $first-one='!' or $first-one='&amp;'">
- <xsl:value-of select="concat('1', $return-value, $first-one)"/>
- </xsl:when>
- <xsl:when test="$first-one='['">
- <xsl:choose>
- <xsl:when test="starts-with(substring-after($expression, ']'), 'C')">
- <xsl:call-template name="parse-range-name">
- <xsl:with-param name="expression" select="substring-after($expression, ']')"/>
- <xsl:with-param name="return-value" select="concat($return-value, substring-before($expression, ']'), ']')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains(substring-before($expression, ']'), '.') and contains(substring-after($expression, ']'), '!')">
- <xsl:value-of select="concat('1', &quot;&apos;&quot;, substring-before(substring-after($expression, '['), ']'), &quot;&apos;&quot;, '#$', substring-before(substring-after($expression, ']'), '!'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('2', $return-value, substring-before($expression, ']'), ']')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$first-one='&quot;'">
- <xsl:value-of select="concat('1', $first-one, substring-before(substring-after($expression, '&quot;'), '&quot;'), '&quot;')"/>
- </xsl:when>
- <xsl:when test="$first-one=&quot;&apos;&quot;">
- <xsl:variable name="str-in" select="substring-before(substring-after($expression, &quot;&apos;&quot;), &quot;&apos;&quot;)"/>
- <xsl:choose>
- <xsl:when test="contains($str-in, '\') and contains($str-in, '[') and contains($str-in, ']')">
- <xsl:variable name="first-pos" select="substring-before($str-in, '[')"/>
- <xsl:variable name="second-pos" select="substring-before(substring-after($str-in, '['), ']')"/>
- <xsl:variable name="third-pos" select="substring-after($str-in, ']')"/>
- <xsl:value-of select="concat('1', &quot;&apos;&quot;, $first-pos, $second-pos, &quot;&apos;&quot;, '#$', $third-pos)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('1', &quot;&apos;&quot;, $str-in, &quot;&apos;&quot;)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$first-one='+' or $first-one='-' or $first-one='*' or $first-one='/' or $first-one=')' or $first-one='^' or $first-one=':' or $first-one='&quot;' or $first-one=';' or $first-one=',' or $first-one='&gt;' or $first-one='&lt;'">
- <xsl:choose>
- <xsl:when test="$return-value = ''">
- <xsl:value-of select="concat('1', $first-one)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat('2', $return-value)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$expression = ''">
- <xsl:value-of select="concat('2', $return-value)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="parse-range-name">
- <xsl:with-param name="expression" select="substring($expression, 2, string-length($expression)-1)"/>
- <xsl:with-param name="return-value" select="concat($return-value, substring($expression, 1, 1))"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="handle-type-number">
- <xsl:param name="t-part"/>
- <xsl:choose>
- <xsl:when test="starts-with($t-part, '[')">
- <xsl:variable name="tt-str" select="substring-before( substring-after( $t-part, '['), ']')"/>
- <xsl:choose>
- <xsl:when test="($tt-str &lt; 0) or ($tt-str &gt; 0) or ($tt-str = 0)">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="($t-part &lt; 0) or ($t-part &gt; 0) or ($t-part = 0)">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:when test="$t-part = ''">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="2"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="translate-unit">
- <xsl:param name="column-number"/>
- <xsl:param name="row-number"/>
- <xsl:param name="column-pos-style"/>
- <xsl:param name="row-pos-style"/>
- <xsl:variable name="column-number1">
- <xsl:value-of select="floor( $column-number div 26 )"/>
- </xsl:variable>
- <xsl:variable name="column-number2">
- <xsl:value-of select="$column-number mod 26"/>
- </xsl:variable>
- <xsl:variable name="column-character1">
- <xsl:call-template name="number-to-character">
- <xsl:with-param name="number" select="$column-number1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="column-character2">
- <xsl:call-template name="number-to-character">
- <xsl:with-param name="number" select="$column-number2"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$column-pos-style = 'absolute'">
- <xsl:value-of select="concat( '$', $column-character1, $column-character2)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat( $column-character1, $column-character2)"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$row-pos-style ='absolute'">
- <xsl:value-of select="concat( '$', $row-number)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$row-number"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="number-to-character">
- <xsl:param name="number"/>
- <xsl:choose>
- <xsl:when test="$number = 0"/>
- <xsl:when test="$number = 1">A</xsl:when>
- <xsl:when test="$number = 2">B</xsl:when>
- <xsl:when test="$number = 3">C</xsl:when>
- <xsl:when test="$number = 4">D</xsl:when>
- <xsl:when test="$number = 5">E</xsl:when>
- <xsl:when test="$number = 6">F</xsl:when>
- <xsl:when test="$number = 7">G</xsl:when>
- <xsl:when test="$number = 8">H</xsl:when>
- <xsl:when test="$number = 9">I</xsl:when>
- <xsl:when test="$number = 10">J</xsl:when>
- <xsl:when test="$number = 11">K</xsl:when>
- <xsl:when test="$number = 12">L</xsl:when>
- <xsl:when test="$number = 13">M</xsl:when>
- <xsl:when test="$number = 14">N</xsl:when>
- <xsl:when test="$number = 15">O</xsl:when>
- <xsl:when test="$number = 16">P</xsl:when>
- <xsl:when test="$number = 17">Q</xsl:when>
- <xsl:when test="$number = 18">R</xsl:when>
- <xsl:when test="$number = 19">S</xsl:when>
- <xsl:when test="$number = 20">T</xsl:when>
- <xsl:when test="$number = 21">U</xsl:when>
- <xsl:when test="$number = 22">V</xsl:when>
- <xsl:when test="$number = 23">W</xsl:when>
- <xsl:when test="$number = 24">X</xsl:when>
- <xsl:when test="$number = 25">Y</xsl:when>
- <xsl:when test="$number = 26">Z</xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-digit-length">
- <xsl:param name="complexive-string"/>
- <xsl:variable name="first-char">
- <xsl:value-of select="substring( $complexive-string, 1, 1)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-char = '1' or $first-char = '2' or $first-char = '3' or $first-char = '4' or $first-char = '5' or $first-char = '6' or $first-char = '7' or $first-char = '8' or $first-char = '9' or $first-char = '0' ">
- <xsl:variable name="temp">
- <xsl:call-template name="get-digit-length">
- <xsl:with-param name="complexive-string" select="substring( $complexive-string, 2)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$temp+1"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:句属性" mode="style">
- <!--chengxz 0725-->
- <xsl:if test="not(@字:式样引用)">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">T<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句属性" format="1"/></xsl:attribute>
- <xsl:attribute name="style:family">text</xsl:attribute>
- <xsl:if test="@字:式样引用">
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="style:text-properties">
- <xsl:apply-templates select="./*"/>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="style-style-content">
- <xsl:variable name="style-name" select="@表:标识符"/>
- <xsl:variable name="apply-style-name" select="@表:名称"/>
- <xsl:attribute name="style:family"><xsl:choose><xsl:when test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]">table-column</xsl:when><xsl:otherwise>table-cell</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]/@表:列宽">
- <xsl:element name="style:table-column-properties">
- <xsl:attribute name="style:column-width"><xsl:value-of select="concat(/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]/@表:列宽,$uofUnit)"/></xsl:attribute>
- <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]/@表:跨度">
- <xsl:attribute name="fo:break-before">auto</xsl:attribute>
- </xsl:if>
- <xsl:for-each select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]">
- <xsl:if test="preceding-sibling::表:列[1]/@表:跨度 and ancestor::表:工作表/表:分页符集/表:分页符/@表:列号">
- <xsl:variable name="kuadu">
- <xsl:value-of select="preceding-sibling::表:列[1]/@表:跨度"/>
- </xsl:variable>
- <xsl:if test="not($kuadu='1')">
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- </xsl:if>
- <xsl:if test="$kuadu='1' and not(preceding::表:列[2])">
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:element name="style:table-cell-properties">
- <xsl:if test="表:对齐格式">
- <xsl:if test="表:对齐格式/表:垂直对齐方式">
- <xsl:variable name="vertical-align">
- <xsl:choose>
- <xsl:when test="表:对齐格式/表:垂直对齐方式 = 'top'">top</xsl:when>
- <xsl:when test="表:对齐格式/表:垂直对齐方式 = 'center'">center</xsl:when>
- <xsl:when test="表:对齐格式/表:垂直对齐方式 = 'bottom'">bottom</xsl:when>
- <xsl:otherwise>middle</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="style:vertical-align"><xsl:value-of select="$vertical-align"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:对齐格式/表:自动换行/@表:值 = 'true'">
- <xsl:attribute name="fo:wrap-option">wrap</xsl:attribute>
- </xsl:if>
- <xsl:if test="表:对齐格式/表:缩进">
- <xsl:attribute name="fo:padding-left"><xsl:variable name="indent" select="表:对齐格式/表:缩进 * 10"/><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat($indent,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:对齐格式/表:文字旋转角度">
- <xsl:attribute name="style:rotation-angle"><xsl:choose><xsl:when test="表:对齐格式/表:文字旋转角度 &lt; 0"><xsl:value-of select="360 - 表:对齐格式/表:文字旋转角度"/></xsl:when><xsl:otherwise><xsl:value-of select="表:对齐格式/表:文字旋转角度"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:rotation-align">none</xsl:attribute>
- </xsl:if>
- <xsl:if test="表:对齐格式/表:文字方向 = 'vertical'">
- <xsl:attribute name="style:direction">ttb</xsl:attribute>
- <xsl:if test="not(表:对齐格式/字:水平对齐方式)">
- <xsl:attribute name="style:text-align-source">fix</xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:if>
- <!--xsl:if test="表:边框">
- <xsl:apply-templates select="表:边框" />
- </xsl:if-->
- <!--chenjh add 边框 again-->
- <xsl:if test="表:边框/uof:上/@uof:宽度 !=''">
- <xsl:variable name="top-line-width" select="concat(表:边框/uof:上/@uof:宽度,$uofUnit)"/>
- <xsl:variable name="top-line-tyle">
- <xsl:choose>
- <xsl:when test="表:边框/uof:上/@uof:类型='single'">solid</xsl:when>
- <xsl:when test="表:边框/uof:上/@uof:类型='double'">double</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="top-line-color" select="表:边框/uof:上/@uof:颜色"/>
- <xsl:variable name="border-top" select="concat($top-line-width,' ',$top-line-tyle,' ',$top-line-color)"/>
- <xsl:attribute name="fo:border-top"><xsl:value-of select="$border-top"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:边框/uof:下/@uof:宽度 !=''">
- <xsl:variable name="bottom-line-width" select="concat(表:边框/uof:下/@uof:宽度,$uofUnit)"/>
- <xsl:variable name="bottom-line-tyle">
- <xsl:choose>
- <xsl:when test="表:边框/uof:下/@uof:类型='single'">solid</xsl:when>
- <xsl:when test="表:边框/uof:下/@uof:类型='double'">double</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="bottom-line-color" select="表:边框/uof:下/@uof:颜色"/>
- <xsl:variable name="border-bottom" select="concat($bottom-line-width,' ',$bottom-line-tyle,' ',$bottom-line-color)"/>
- <xsl:attribute name="fo:border-bottom"><xsl:value-of select="$border-bottom"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:边框/uof:左/@uof:宽度 !=''">
- <xsl:variable name="left-line-width" select="concat(表:边框/uof:左/@uof:宽度,$uofUnit)"/>
- <xsl:variable name="left-line-tyle">
- <xsl:choose>
- <xsl:when test="表:边框/uof:左/@uof:类型='single'">solid</xsl:when>
- <xsl:when test="表:边框/uof:左/@uof:类型='double'">double</xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="left-line-color" select="表:边框/uof:左/@uof:颜色"/>
- <xsl:variable name="border-left" select="concat($left-line-width,' ',$left-line-tyle,' ',$left-line-color)"/>
- <xsl:attribute name="fo:border-left"><xsl:value-of select="$border-left"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:边框/uof:右/@uof:宽度 !=''">
- <xsl:variable name="right-line-width" select="concat(表:边框/uof:右/@uof:宽度,$uofUnit)"/>
- <xsl:variable name="right-line-tyle">
- <xsl:choose>
- <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
- <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
- <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
- <xsl:otherwise>solid</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="right-line-color" select="表:边框/uof:右/@uof:颜色"/>
- <xsl:variable name="border-right" select="concat($right-line-width,' ',$right-line-tyle,' ',$right-line-color)"/>
- <xsl:attribute name="fo:border-right"><xsl:value-of select="$border-right"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:边框/uof:对角线1/@uof:宽度 !=''">
- <xsl:variable name="diagonal-lr-width" select="concat(表:边框/uof:对角线1/@uof:宽度,$uofUnit)"/>
- <xsl:variable name="diagonal-lr-tyle">
- <xsl:choose>
- <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'none'">none</xsl:when>
- <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'continuous'">solid</xsl:when>
- <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'double'">double</xsl:when>
- <xsl:otherwise>solid</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="diagonal-lr-color" select="表:边框/uof:对角线1/@uof:颜色"/>
- <xsl:variable name="border-diagonal" select="concat($diagonal-lr-width,' ',$diagonal-lr-tyle,' ',$diagonal-lr-color)"/>
- <xsl:attribute name="style:diagonal-bl-tr"><xsl:value-of select="$border-diagonal"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:边框/uof:对角线2/@uof:宽度 !=''">
- <xsl:variable name="diagonal-rl-width" select="concat(表:边框/uof:对角线2/@uof:宽度,$uofUnit)"/>
- <xsl:variable name="diagonal-rl-tyle">
- <xsl:choose>
- <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'none'">none</xsl:when>
- <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'continuous'">solid</xsl:when>
- <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'double'">double</xsl:when>
- <xsl:otherwise>solid</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="diagonal-rl-color" select="表:边框/uof:对角线2/@uof:颜色"/>
- <xsl:variable name="border-diagonal" select="concat($diagonal-rl-width,' ',$diagonal-rl-tyle,' ',$diagonal-rl-color)"/>
- <xsl:attribute name="style:diagonal-tl-br"><xsl:value-of select="$border-diagonal"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:边框/*/@uof:阴影">
- <xsl:choose>
- <xsl:when test="表:边框/uof:下/@uof:阴影 and 表:边框/uof:右/@uof:阴影">
- <xsl:attribute name="style:shadow">#808080 0.18cm 0.18cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="表:边框/uof:下/@uof:阴影 and 表:边框/uof:左/@uof:阴影">
- <xsl:attribute name="style:shadow">#808080 -0.18cm 0.18cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="表:边框/uof:上/@uof:阴影 and 表:边框/uof:右/@uof:阴影">
- <xsl:attribute name="style:shadow">#808080 0.18cm -0.18cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="表:边框/uof:上/@uof:阴影 and 表:边框/uof:左/@uof:阴影">
- <xsl:attribute name="style:shadow">#808080 -0.18cm -0.18cm</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <!--边框 end -->
- <xsl:if test="表:填充">
- <xsl:choose>
- <xsl:when test="表:填充/图:颜色">
- <xsl:attribute name="fo:background-color"><xsl:value-of select="表:填充/图:颜色"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="表:填充/图:图案/@图:前景色">
- <xsl:variable name="pattern-value">
- <xsl:call-template name="cell-pattern-color">
- <xsl:with-param name="pattern" select="concat('0.',substring-after(表:填充/图:图案/图:背景色,'y'))"/>
- <xsl:with-param name="color-value" select="表:填充/图:颜色"/>
- <xsl:with-param name="pattern-color-value" select="表:填充/图:图案/图:背景色"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="fo:background-color"><xsl:value-of select="$pattern-value"/></xsl:attribute>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="表:字体格式/字:隐藏文字">
- <xsl:choose>
- <xsl:when test="表:字体格式/字:隐藏文字 = 'true'">
- <xsl:attribute name="style:cell-protect">protected formula-hidden</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:cell-protect">none</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:attribute name="style:cell-protect">none</xsl:attribute>
- <xsl:attribute name="style:text-align-source">fix</xsl:attribute>
- </xsl:element>
- <xsl:element name="style:paragraph-properties">
- <xsl:if test="表:对齐格式/表:水平对齐方式">
- <xsl:variable name="text-align">
- <xsl:choose>
- <xsl:when test="表:对齐格式/表:水平对齐方式 = 'left'">start</xsl:when>
- <xsl:when test="表:对齐格式/表:水平对齐方式 = 'center'">center</xsl:when>
- <xsl:when test="表:对齐格式/表:水平对齐方式 = 'right'">end</xsl:when>
- <xsl:when test="表:对齐格式/表:水平对齐方式 = 'justify'">justify</xsl:when>
- <xsl:otherwise>start</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="fo:text-align"><xsl:value-of select="$text-align"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:element name="style:text-properties">
- <xsl:if test="表:字体格式/字:字体">
- <xsl:choose>
- <xsl:when test="(表:字体格式/字:字体/@字:中文字体引用)or (表:字体格式/字:字体/@字:西文字体引用)">
- <xsl:variable name="fontnameZ" select="表:字体格式/字:字体/@字:中文字体引用"/>
- <xsl:variable name="fontnameX" select="表:字体格式/字:字体/@字:西文字体引用"/>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:字体集/uof:字体声明">
- <xsl:if test="(./@uof:标识符 = $fontnameZ)or(./@uof:标识符 = $fontnameX)">
- <xsl:attribute name="style:font-name"><xsl:value-of select="./@uof:名称"/></xsl:attribute>
- <xsl:attribute name="style:font-name-asian"><xsl:value-of select="./@uof:名称"/></xsl:attribute>
- <xsl:attribute name="style:font-name-complex"><xsl:value-of select="./@uof:名称"/></xsl:attribute>
- <xsl:attribute name="style:font-charset"><xsl:value-of select="./@uof:字体族"/></xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:font-name">Arial</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="表:字体格式/字:粗体/@字:值">
- <xsl:attribute name="fo:font-weight"><xsl:choose><xsl:when test="表:字体格式/字:粗体/@字:值=1 or 表:字体格式/字:粗体/@字:值='true'">bold</xsl:when><xsl:when test="表:字体格式/字:粗体/@字:值=0 or 表:字体格式/字:粗体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:font-weight-asian"><xsl:choose><xsl:when test="表:字体格式/字:粗体/@字:值=1 or 表:字体格式/字:粗体/@字:值='true'">bold</xsl:when><xsl:when test="表:字体格式/字:粗体/@字:值=0 or 表:字体格式/字:粗体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:font-weight-complex"><xsl:choose><xsl:when test="表:字体格式/字:粗体/@字:值=1 or 表:字体格式/字:粗体/@字:值='true'">bold</xsl:when><xsl:when test="表:字体格式/字:粗体/@字:值=0 or 表:字体格式/字:粗体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:字体格式/字:斜体/@字:值">
- <xsl:attribute name="fo:font-style"><xsl:choose><xsl:when test="表:字体格式/字:斜体/@字:值=1 or 表:字体格式/字:斜体/@字:值='true'">italic</xsl:when><xsl:when test="表:字体格式/字:斜体/@字:值=0 or 表:字体格式/字:斜体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:font-style-asian"><xsl:choose><xsl:when test="表:字体格式/字:斜体/@字:值=1 or 表:字体格式/字:斜体/@字:值='true'">italic</xsl:when><xsl:when test="表:字体格式/字:斜体/@字:值=0 or 表:字体格式/字:斜体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:font-style-complex"><xsl:choose><xsl:when test="表:字体格式/字:斜体/@字:值=1 or 表:字体格式/字:斜体/@字:值='true'">italic</xsl:when><xsl:when test="表:字体格式/字:斜体/@字:值=0 or 表:字体格式/字:斜体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="表:字体格式/字:字体/@字:颜色">
- <xsl:attribute name="fo:color"><xsl:value-of select="表:字体格式/字:字体/@字:颜色"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:use-window-font-color">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="表:字体格式/字:字体/@字:字号">
- <xsl:attribute name="fo:font-size"><xsl:value-of select="concat( 表:字体格式/字:字体/@字:字号, 'pt')"/></xsl:attribute>
- <xsl:attribute name="style:font-size-asian"><xsl:value-of select="concat( 表:字体格式/字:字体/@字:字号, 'pt')"/></xsl:attribute>
- <xsl:attribute name="style:font-size-complex"><xsl:value-of select="concat( 表:字体格式/字:字体/@字:字号, 'pt')"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:font-size">12pt</xsl:attribute>
- <xsl:attribute name="style:font-size-asian">12pt</xsl:attribute>
- <xsl:attribute name="style:font-size-complex">12pt</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="表:字体格式/字:浮雕">
- <xsl:variable name="aa">
- <xsl:value-of select="表:字体格式/字:浮雕/@字:类型"/>
- </xsl:variable>
- <xsl:attribute name="style:font-relief"><xsl:choose><xsl:when test="$aa='emboss'">embossed</xsl:when><xsl:when test="$aa='engrave'">engraved</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:字体格式/字:阴影/@字:值 = '1' or 表:字体格式/字:阴影/@字:值 = 'true'">
- <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
- </xsl:if>
- <xsl:if test="表:字体格式/字:删除线">
- <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
- <xsl:choose>
- <xsl:when test="表:字体格式/字:删除线/@字:类型='double'">
- <xsl:attribute name="style:text-line-through-type">double</xsl:attribute>
- </xsl:when>
- <xsl:when test="表:字体格式/字:删除线/@字:类型='single'">
- <xsl:attribute name="style:text-underline-mode">continuous</xsl:attribute>
- <xsl:attribute name="style:text-line-through-mode">continuous</xsl:attribute>
- </xsl:when>
- <xsl:when test="表:字体格式/字:删除线/@字:类型='bold'">
- <xsl:attribute name="style:text-line-through-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="表:字体格式/字:删除线/@字:类型='带/'">
- <xsl:attribute name="style:text-line-through-text">/</xsl:attribute>
- </xsl:when>
- <xsl:when test="表:字体格式/字:删除线/@字:类型='带X'">
- <xsl:attribute name="style:text-line-through-text">X</xsl:attribute>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="表:字体格式/字:下划线">
- <xsl:apply-templates select="表:字体格式/字:下划线"/>
- </xsl:if>
- </xsl:if>
- <xsl:if test="表:字体格式/字:着重号">
- <xsl:apply-templates select="表:字体格式/字:着重号"/>
- </xsl:if>
- <xsl:if test="表:字体格式/字:空心/@字:值='true'">
- <xsl:attribute name="style:text-outline">true</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="单元格具体式样">
- <xsl:choose>
- <xsl:when test="@表:类型 = 'Default'">
- <xsl:element name="style:default-style">
- <xsl:call-template name="style-style-content"/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="@表:标识符"/></xsl:attribute>
- <xsl:if test="表:数字格式/@表:格式码 = 'general'">
- <xsl:attribute name="style:parent-style-name">Default</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style:parent-style-name">Default</xsl:attribute>
- <xsl:attribute name="style:data-style-name"><xsl:value-of select="concat( @表:标识符, 'F')"/></xsl:attribute>
- <!--chengxz这里要改 -->
- <!--xsl:attribute name="style:data-style-name"><xsl:value-of select="'N2'"/></xsl:attribute-->
- <xsl:call-template name="style-style-content"/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="表:边框">
- <!--chengxz 0622-->
- <xsl:if test="not(uof:下)">
- <xsl:attribute name="fo:border-bottom">none</xsl:attribute>
- </xsl:if>
- <xsl:if test="not(uof:上)">
- <xsl:attribute name="fo:border-top">none</xsl:attribute>
- </xsl:if>
- <xsl:if test="not(uof:左)">
- <xsl:attribute name="fo:border-left">none</xsl:attribute>
- </xsl:if>
- <xsl:if test="not(uof:右)">
- <xsl:attribute name="fo:border-right">none</xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="uof:对角线1"/>
- <xsl:apply-templates select="uof:对角线2"/>
- <xsl:apply-templates select="uof:上"/>
- <xsl:apply-templates select="uof:下"/>
- <xsl:apply-templates select="uof:左"/>
- <xsl:apply-templates select="uof:右"/>
- </xsl:template>
- <xsl:template match="uof:上">
- <xsl:variable name="bordtype">
- <xsl:choose>
- <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
- <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
- <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
- <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
- <xsl:otherwise>solid</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="fo:border-top"><xsl:value-of select="concat(@uof:宽度 div 30,$uofUnit, ' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
- <xsl:if test="@uof:类型 = 'double'">
- <xsl:attribute name="style:border-line-width-top">0.035cm 0.035cm 0.035cm</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="uof:下">
- <xsl:variable name="bordtype">
- <xsl:choose>
- <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
- <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
- <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
- <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
- <xsl:otherwise>solid</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="fo:border-bottom"><xsl:value-of select="concat(@uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ',@uof:颜色)"/></xsl:attribute>
- <xsl:if test="@uof:类型 = 'double'">
- <xsl:attribute name="style:border-line-width-bottom">0.035cm 0.035cm 0.035cm</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="uof:左">
- <xsl:variable name="bordtype">
- <xsl:choose>
- <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
- <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
- <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
- <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
- <xsl:otherwise>solid</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="fo:border-left"><xsl:value-of select="concat(@uof:宽度 div 30,$uofUnit, ' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
- <xsl:if test="@uof:类型 = 'double'">
- <xsl:attribute name="style:border-line-width-left">0.035cm 0.035cm 0.035cm</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="uof:右">
- <xsl:variable name="bordtype">
- <xsl:choose>
- <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
- <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
- <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
- <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
- <xsl:otherwise>solid</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="fo:border-right"><xsl:value-of select="concat( @uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
- <xsl:if test="@uof:类型 = 'double'">
- <xsl:attribute name="style:border-line-width-right">0.035cm 0.035cm 0.035cm</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="uof:对角线1">
- <xsl:variable name="bordtype">
- <xsl:choose>
- <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
- <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
- <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
- <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
- <xsl:otherwise>solid</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="style:diagonal-bl-tr"><xsl:value-of select="concat( @uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
- <xsl:if test="@uof:类型 = 'double'">
- <xsl:attribute name="style:diagonal-bl-tr-width">0.035cm 0.035cm 0.035cm</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="uof:对角线2">
- <xsl:variable name="bordtype">
- <xsl:choose>
- <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
- <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
- <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
- <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
- <xsl:otherwise>solid</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="style:diagonal-tl-br"><xsl:value-of select="concat( @uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
- <xsl:if test="@uof:类型 = 'double'">
- <xsl:attribute name="style:diagonal-tl-br-width">0.035cm 0.035cm 0.035cm</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="表:字体格式">
- <xsl:choose>
- <xsl:when test="字:上下标/@字:上下标 = 'sup'">
- <style:style style:name="{concat(../@表:标识符,'T0')}" style:family="text">
- <style:text-properties style:text-position="33% 58%"/>
- </style:style>
- </xsl:when>
- <xsl:when test="字:上下标/@字:上下标 = 'sub'">
- <style:style style:name="{concat(../@表:标识符,'T0')}" style:family="text">
- <style:text-properties style:text-position="-33% 58%"/>
- </style:style>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="tablecolumngroup">
- <xsl:param name="start"/>
- <xsl:param name="end"/>
- <xsl:param name="prestart"/>
- <xsl:param name="preend"/>
- <xsl:param name="nextstart"/>
- <xsl:param name="nextend"/>
- <table:table-column-group>
- <table:table-column>
- <xsl:attribute name="table:style-name">co1</xsl:attribute>
- <xsl:attribute name="table:table-column-repeated"><xsl:value-of select="@表:终止 - @表:起始 + 1"/></xsl:attribute>
- </table:table-column>
- <xsl:if test="$nextstart &gt;= $start and $nextend &lt;= $end">
- <xsl:for-each select="following-sibling::表:列[1]">
- <xsl:call-template name="tablecolumngroup"/>
- </xsl:for-each>
- </xsl:if>
- </table:table-column-group>
- </xsl:template>
- <xsl:template match="表:工作表">
- <xsl:variable name="rowpath" select="表:工作表内容/表:行"/>
- <xsl:variable name="colpath" select="表:工作表内容/表:列"/>
- <xsl:element name="table:table">
- <xsl:attribute name="table:name"><xsl:value-of select="@表:名称"/></xsl:attribute>
- <xsl:if test="表:工作表内容">
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat( 'ta', count(preceding-sibling::表:工作表)+1)"/></xsl:attribute>
- <xsl:if test="(@表:隐藏 = '1')or(@表:隐藏 = 'true')">
- <xsl:attribute name="table:protected">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="表:工作表内容/uof:锚点 or 表:工作表内容/表:图表">
- <table:shapes>
- <xsl:apply-templates select="表:工作表内容/uof:锚点"/>
- <xsl:apply-templates select="表:工作表内容/表:图表">
- <xsl:with-param name="table-name" select="@表:名称"/>
- </xsl:apply-templates>
- </table:shapes>
- </xsl:if>
- <xsl:variable name="table-pos">
- <xsl:value-of select="count(../preceding-sibling::表:工作表)+1"/>
- </xsl:variable>
- <xsl:if test="表:工作表内容/表:分组集/表:列">
- <xsl:for-each select="表:工作表内容/表:分组集/表:列">
- <xsl:variable name="start" select="@表:起始"/>
- <xsl:variable name="end" select="@表:终止"/>
- <xsl:variable name="prestart" select="preceding-sibling::表:列/@表:起始"/>
- <xsl:variable name="preend" select="preceding-sibling::表:列/@表:终止"/>
- <xsl:variable name="nextstart" select="following-sibling::表:列/@表:起始"/>
- <xsl:variable name="nextend" select="following-sibling::表:列/@表:终止"/>
- <xsl:call-template name="tablecolumngroup">
- <xsl:with-param name="start" select="$start"/>
- <xsl:with-param name="end" select="$end"/>
- <xsl:with-param name="prestart" select="$prestart"/>
- <xsl:with-param name="preend" select="$preend"/>
- <xsl:with-param name="nextstart" select="$nextstart"/>
- <xsl:with-param name="nextend" select="$nextend"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:for-each select="表:工作表内容/表:列">
- <table:table-column>
- <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
- <xsl:if test="@表:跨度 and not(@表:跨度='1')">
- <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="@表:跨度"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@表:隐藏">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- </table:table-column>
- </xsl:for-each>
- <xsl:variable name="condition-pos-str1">
- <xsl:if test="../../表:公用处理规则/表:条件格式化集/表:条件格式化">
- <xsl:call-template name="condition-row-column-string">
- <xsl:with-param name="last" select="''"/>
- <xsl:with-param name="total" select="count(../../表:公用处理规则/表:条件格式化集/表:条件格式化)"/>
- <xsl:with-param name="index" select="1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="condition-pos-str2">
- <xsl:if test="../../表:公用处理规则/表:数据有效性集/表:数据有效性">
- <xsl:call-template name="validation-row-column-string">
- <xsl:with-param name="last" select="''"/>
- <xsl:with-param name="total" select="count(../../表:公用处理规则/表:数据有效性集/表:数据有效性)"/>
- <xsl:with-param name="index" select="1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="condition-pos-str" select="concat($condition-pos-str1, $condition-pos-str2)"/>
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行">
- <xsl:call-template name="create-rows">
- <xsl:with-param name="lastrowpos" select="0"/>
- <xsl:with-param name="row-count" select="count(表:工作表内容/表:行)"/>
- <xsl:with-param name="currentRow" select="1"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="tableHasStyle">
- <xsl:choose>
- <xsl:when test="./表:工作表内容[@表:式样引用]">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="0"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="./表:分页符集/表:分页符[@表:行号]">
- <xsl:for-each select="./表:分页符集/表:分页符[@表:行号]">
- <xsl:variable name="number-repeated">
- <xsl:choose>
- <xsl:when test="position() = 1">
- <xsl:value-of select="./@表:行号"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./@表:行号 - preceding::表:分页符[@表:行号 and (position()=count(.))]/@表:行号 - 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$number-repeated &gt; 0">
- <xsl:element name="table:table-row">
- <xsl:if test="($rowpath/@表:隐藏 = '1') or ($rowpath/@表:隐藏 = 'true')">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro',$table-pos)"/></xsl:attribute>
- <xsl:attribute name="table:number-rows-repeated"><xsl:value-of select="$number-repeated"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="$tableHasStyle = 1">
- <table:table-cell table:number-columns-repeated="256"/>
- </xsl:when>
- <xsl:otherwise>
- <table:table-cell/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:element name="table:table-row">
- <xsl:if test="($colpath/@表:隐藏 = '1') or ($colpath/@表:隐藏 = 'true')">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob',$table-pos)"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="$tableHasStyle = 1">
- <table:table-cell table:number-columns-repeated="256"/>
- </xsl:when>
- <xsl:otherwise>
- <table:table-cell/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="table:table-row">
- <xsl:choose>
- <xsl:when test="表:工作表内容/@表:式样引用">
- <xsl:attribute name="table:style-name"><xsl:value-of select="表:工作表内容/@表:式样引用"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name"><xsl:text>ro1</xsl:text></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:element name="table:table-cell"/>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="../../表:公用处理规则/表:条件格式化集/表:条件格式化">
- <xsl:variable name="condition-row-max">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="div-value" select="'R'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="condition-col-max">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="div-value" select="'C'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="break-row-max">
- <xsl:call-template name="break-row-beyond-max">
- <xsl:with-param name="pos" select="1"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="count-value" select="count(./表:分页符集/表:分页符[@表:行号])"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="end-value">
- <xsl:choose>
- <xsl:when test="$condition-row-max &lt; $break-row-max">
- <xsl:value-of select="$break-row-max"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$condition-row-max"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="get-row-beyond-last">
- <xsl:with-param name="index-value" select="1"/>
- <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="end-pos" select="$end-value"/>
- <xsl:with-param name="total-col" select="$condition-col-max"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="./表:工作表内容/@表:式样引用">
- <table:table-row table:style-name="ro1" table:number-rows-repeated="32000">
- <table:table-cell table:number-columns-repeated="256"/>
- </table:table-row>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:element>
- <xsl:if test="表:图表">
- <table:shapes>
- <xsl:apply-templates select="表:图表">
- <xsl:with-param name="table-name" select="@表:名称"/>
- </xsl:apply-templates>
- </table:shapes>
- </xsl:if>
- </xsl:template>
- <!--xsl:template name="create-columns-without-input"></xsl:template>
- <xsl:template name="create-columns"></xsl:template>
- <xsl:template name="condition-row-column-string"></xsl:template>
+ <xsl:output method="xml" indent="no" encoding="UTF-8" version="1.0"/>
+ <xsl:template match="uof:UOF">
+ <!--chengxz0804 OK-->
+ <!--office:document xmlns:office="http://openoffice.org/2000/office" xmlns:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0" office:class="spreadsheet"-->
+ <office:document 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
+ <xsl:apply-templates select="uof:元数据"/>
+ <office:settings>
+ <xsl:call-template name="工作表属性"/>
+ </office:settings>
+ <xsl:apply-templates select="uof:式样集"/>
+ <!--xsl:apply-templates select="表:公用处理规则"/-->
+ <xsl:apply-templates select="uof:电子表格"/>
+ </office:document>
+ </xsl:template>
+ <!--Redoffice comment lil from chenjh SC0013 06.02.15-->
+ <!--增加内容-->
+ <xsl:variable name="uofUnit">
+ <xsl:variable name="uu">
+ <xsl:value-of select="/uof:UOF/uof:电子表格/表:公用处理规则/表:度量单位"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$uu='cm'">cm</xsl:when>
+ <xsl:when test="$uu='mm'">mm</xsl:when>
+ <xsl:when test="$uu='pt'">pt</xsl:when>
+ <xsl:when test="$uu='inch'">inch</xsl:when>
+ <xsl:otherwise>cm</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="other-to-cm-conversion-factor">
+ <xsl:choose>
+ <xsl:when test="$uofUnit='cm'">1</xsl:when>
+ <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
+ <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
+ <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
+ <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
+ <xsl:otherwise>0.03527</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!--Redoffice comment liliang end 06.02.15-->
+ <xsl:template name="set-calculation">
+ <xsl:element name="table:calculation-settings">
+ <xsl:if test="表:公用处理规则/表:度量单位">
+ <xsl:variable name="uofUnit">
+ <xsl:variable name="uu">
+ <xsl:value-of select="表:公用处理规则/表:度量单位"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$uu='cm'">cm</xsl:when>
+ <xsl:when test="$uu='mm'">mm</xsl:when>
+ <xsl:when test="$uu='pt'">pt</xsl:when>
+ <xsl:when test="$uu='inch'">inch</xsl:when>
+ <xsl:otherwise>cm</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="other-to-cm-conversion-factor">
+ <xsl:choose>
+ <xsl:when test="$uofUnit='cm'">1</xsl:when>
+ <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
+ <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
+ <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
+ <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ </xsl:if>
+ <xsl:if test="表:公用处理规则/表:精确度以显示值为准">
+ <xsl:attribute name="table:precision-as-shown">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:公用处理规则/表:日期系统-1904/@表:值='true'">
+ <table:null-date table:date-value="1904-01-01"/>
+ </xsl:if>
+ <xsl:if test="表:公用处理规则/表:计算设置">
+ <xsl:element name="table:iteration">
+ <xsl:attribute name="table:status">enable</xsl:attribute>
+ <xsl:attribute name="table:steps"><xsl:value-of select="表:公用处理规则/表:计算设置/@表:迭代次数"/></xsl:attribute>
+ <xsl:attribute name="table:maximum-difference"><xsl:value-of select="表:公用处理规则/表:计算设置/@表:偏差值"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="uof:字体集">
+ <xsl:if test="not(uof:字体声明[@uof:名称='StarSymbol'])">
+ <style:font-face style:name="StarSymbol" fo:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </xsl:if>
+ <xsl:for-each select="uof:字体声明">
+ <xsl:element name="style:font-face">
+ <xsl:attribute name="style:name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
+ <xsl:attribute name="svg:font-family"><xsl:value-of select="@uof:字体族"/></xsl:attribute>
+ <xsl:if test="@uof:字符集 = '02'">
+ <xsl:attribute name="style:font-charset">x-symbol</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@uof:字体族">
+ <xsl:choose>
+ <xsl:when test="@uof:字体族 = 'Swiss'">
+ <xsl:attribute name="style:font-family-generic">swiss</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='Modern'">
+ <xsl:attribute name="style:font-family-generic">modern</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族='Roman'">
+ <xsl:attribute name="style:font-family-generic">roman</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='Script'">
+ <xsl:attribute name="style:font-family-generic">script</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='Decorative'">
+ <xsl:attribute name="style:font-family-generic">decorative</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='System'">
+ <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:attribute name="style:font-pitch">12</xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="uof:字体声明"/>
+ </xsl:template>
+ <xsl:template match="uof:电子表格">
+ <office:body>
+ <office:spreadsheet>
+ <xsl:call-template name="trackchange"/>
+ <xsl:call-template name="set-calculation"/>
+ <xsl:if test="表:公用处理规则/表:数据有效性集">
+ <xsl:element name="table:content-validations">
+ <xsl:call-template name="create-content-validations">
+ <xsl:with-param name="validation-set" select="表:公用处理规则/表:数据有效性集/表:数据有效性"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ <xsl:apply-templates select="表:主体/表:工作表"/>
+ <!--MSexcel 中的names暂时没有对应的-->
+ <xsl:element name="table:database-ranges">
+ <xsl:for-each select="表:主体/表:工作表">
+ <xsl:if test="./表:筛选">
+ <xsl:variable name="filter" select="./表:筛选"/>
+ <xsl:variable name="column-and-row" select="substring-before(substring-after($filter/表:范围/text(),'.'),':')"/>
+ <xsl:variable name="dd" select="number(substring($column-and-row,2,1))"/>
+ <xsl:variable name="zone-left-column-string">
+ <xsl:choose>
+ <xsl:when test="contains($dd,'NaN') ">
+ <xsl:value-of select="substring($column-and-row,1,2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring($column-and-row,1,1)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="zone-left-column-num">
+ <xsl:call-template name="translate-column-char-to-number">
+ <xsl:with-param name="string" select="$zone-left-column-string"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:element name="table:database-range">
+ <xsl:attribute name="table:name"><xsl:value-of select="uof:电子表格/表:主体/表:工作表/@表:名称"/></xsl:attribute>
+ <xsl:attribute name="table:target-range-address"><xsl:call-template name="translate-expression2"><xsl:with-param name="expression2" select="translate($filter/表:范围/text(),'$','')"/></xsl:call-template></xsl:attribute>
+ <xsl:if test="$filter/@表:类型='auto'">
+ <xsl:attribute name="table:display-filter-buttons">true</xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$filter/表:条件区域">
+ <xsl:element name="table:filter">
+ <xsl:attribute name="table:condition-source-range-address"><xsl:call-template name="translate-expression2"><xsl:with-param name="expression2" select="translate($filter/表:条件区域/text(),'$','')"/></xsl:call-template></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="table:filter">
+ <xsl:element name="table:filter-and">
+ <xsl:call-template name="auto-filter-condition">
+ <xsl:with-param name="conditon-set" select="$filter/表:条件"/>
+ <xsl:with-param name="zone-left-column-num" select="$zone-left-column-num"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </office:spreadsheet>
+ </office:body>
+ </xsl:template>
+ <xsl:template name="trackchange">
+ <xsl:for-each select="表:主体/表:工作表/表:工作表内容//字:修订开始">
+ <xsl:variable name="num">
+ <xsl:number level="any" from="表:主体/表:工作表/表:工作表内容//*" count="字:修订开始"/>
+ </xsl:variable>
+ <table:tracked-changes>
+ <table:cell-content-change>
+ <xsl:attribute name="table:id"><xsl:value-of select="concat('ct',$num)"/></xsl:attribute>
+ <table:cell-address>
+ <xsl:attribute name="table:column"><xsl:value-of select="substring-after(@字:标识符,'-')"/></xsl:attribute>
+ <xsl:attribute name="table:row"><xsl:value-of select="substring-before(@字:标识符,'-')"/></xsl:attribute>
+ <xsl:attribute name="table:table">0</xsl:attribute>
+ </table:cell-address>
+ <office:change-info>
+ <dc:creator>
+ <xsl:choose>
+ <xsl:when test="starts-with(@字:修订信息引用,'+')"/>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before(@字:修订信息引用,'+')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </dc:creator>
+ <!--xsl:value-of select="/uof:UOF/uof:元数据/uof:作者"/-->
+ <!--xsl:value-of select="/uof:UOF/uof:元数据/uof:创建日期"/-->
+ <dc:date>
+ <xsl:value-of select="substring-before(substring-after(@字:修订信息引用,'+'),'%')"/>
+ </dc:date>
+ </office:change-info>
+ <table:previous>
+ <table:change-track-table-cell>
+ <text:p>
+ <xsl:value-of select="substring-after(@字:修订信息引用,'%')"/>
+ </text:p>
+ </table:change-track-table-cell>
+ </table:previous>
+ </table:cell-content-change>
+ </table:tracked-changes>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="uof:式样集">
+ <xsl:element name="office:font-face-decls">
+ <style:font-face style:name="宋体" svg:font-family="宋体" style:font-family-generic="swiss"/>
+ <xsl:apply-templates select="uof:字体集"/>
+ </xsl:element>
+ <xsl:call-template name="单元格式样"/>
+ </xsl:template>
+ <xsl:key match="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/uof:锚点 | /uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/表:单元格/uof:锚点" name="rel_graphic_name" use="@uof:图形引用"/>
+ <xsl:template match="图:图形">
+ <xsl:variable name="random-name">
+ <xsl:value-of select="generate-id()"/>
+ </xsl:variable>
+ <xsl:variable name="draw-name">
+ <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
+ </xsl:variable>
+ <xsl:call-template name="graphic-fill">
+ <xsl:with-param name="draw-name" select="$draw-name"/>
+ <xsl:with-param name="gradient-name" select="图:预定义图形/图:属性/图:填充/图:渐变"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:family">graphic</xsl:attribute>
+ <xsl:element name="style:graphic-properties">
+ <xsl:call-template name="process-graphics">
+ <xsl:with-param name="draw-name" select="$draw-name"/>
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:element name="style:paragraph-properties">
+ <xsl:if test="图:文本内容/@图:文字排列方向">
+ <xsl:choose>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
+ <xsl:attribute name="style:writing-mode">tb-lr</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
+ <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:family">graphic</xsl:attribute>
+ <xsl:element name="style:graphic-properties">
+ <xsl:if test="@图:其他对象">
+ <xsl:attribute name="fo:clip">rect(0cm 0cm 0cm 0cm)</xsl:attribute>
+ <xsl:attribute name="draw:color-mode">standard</xsl:attribute>
+ <xsl:attribute name="draw:luminance">0%</xsl:attribute>
+ <xsl:attribute name="draw:contrast">0%</xsl:attribute>
+ <xsl:attribute name="draw:gamma">100%</xsl:attribute>
+ <xsl:attribute name="draw:red">0%</xsl:attribute>
+ <xsl:attribute name="draw:green">0%</xsl:attribute>
+ <xsl:attribute name="draw:blue">0%</xsl:attribute>
+ <xsl:attribute name="draw:image-opacity">100%</xsl:attribute>
+ <xsl:attribute name="style:mirror">none</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="process-graphics"/>
+ </xsl:element>
+ <xsl:element name="style:paragraph-properties">
+ <xsl:if test="图:文本内容/@图:文字排列方向">
+ <xsl:choose>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
+ <xsl:attribute name="style:writing-mode">tb-lr</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
+ <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="process-graphics">
+ <xsl:param name="draw-name"/>
+ <xsl:if test="not(key('rel_graphic_name',@图:标识符)/@uof:随动方式='movesize')">
+ <xsl:attribute name="style:protect"><xsl:choose><xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:随动方式='move'">size</xsl:when><xsl:otherwise>position size</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="not(图:预定义图形/图:属性/图:填充)">
+ <xsl:attribute name="draw:fill">none</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片">
+ <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
+ <xsl:attribute name="draw:fill-image-name"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:attribute>
+ <xsl:if test="not(图:预定义图形/图:属性/图:填充/图:图片/@图:位置='tile')">
+ <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案">
+ <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:前景色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:颜色">
+ <xsl:attribute name="draw:fill">solid</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
+ <xsl:attribute name="draw:fill">gradient</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:渐变/@图:起始色"/></xsl:attribute>
+ <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="图:预定义图形/图:属性/图:线颜色">
+ <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:线型 and not(图:预定义图形/图:属性/图:线型 = 'single') and not(图:预定义图形/图:属性/图:线型 = 'thick')">
+ <xsl:variable name="type" select="图:预定义图形/图:属性/图:线型"/>
+ <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="$type='none'">none</xsl:when><xsl:when test="$type='single'">solid</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$type='dash'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$type='dot-dash'">Ultrafine_20_2_20_Dots_20_3_20_Dashes</xsl:when><xsl:when test="$type='dashed-heavy'">Fine_20_Dashed</xsl:when><xsl:when test="$type='dotted' ">Fine_20_Dotted</xsl:when><xsl:when test="$type='dash-long-heavy'">Line_20_with_20_Fine_20_Dots</xsl:when><xsl:when test="$type='dash-long'">Fine_20_Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-dot'">_33__20_Dashes_20_3_20_Dots_20__28_var_29_</xsl:when><xsl:when test="$type='dotted-heavy'">Ultrafine_20_Dotted_20__28_var_29_</xsl:when><xsl:when test="$type='thick'">Line_20_Style_20_9</xsl:when><xsl:when test="$type='dot-dot-dash'">_32__20_Dots_20_1_20_Dash</xsl:when><xsl:when test="$type='dash-dot-dot-heavy'">Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-heavy'">Dash_20_10</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:线粗细">
+ <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:线粗细,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
+ <xsl:attribute name="draw:marker-start"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:前端箭头/图:大小">
+ <xsl:attribute name="draw:marker-start-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
+ <xsl:attribute name="draw:marker-end"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:后端箭头/图:大小">
+ <xsl:attribute name="draw:marker-end-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:透明度">
+ <xsl:attribute name="draw:opacity"><xsl:value-of select="concat(图:预定义图形/图:属性/图:透明度,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:if test="图:文本内容/@图:上边距">
+ <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(图:文本内容/@图:上边距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(图:文本内容/@图:下边距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(图:文本内容/@图:左边距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(图:文本内容/@图:右边距,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容/@图:文字排列方向">
+ <xsl:choose>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
+ <xsl:attribute name="style:writing-mode">tb-lr</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
+ <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:文本内容/@图:文字排列方向='hori-r2l'">
+ <xsl:attribute name="draw:textarea-horizontal-align">right</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:文本内容/@图:文字排列方向='hori-12r'">
+ <xsl:attribute name="draw:textarea-horizontal-align">left</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="图:文本内容/@图:水平对齐">
+ <xsl:attribute name="draw:textarea-horizontal-align"><xsl:value-of select="图:文本内容/@图:水平对齐"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容/@图:垂直对齐">
+ <xsl:attribute name="draw:textarea-vertical-align"><xsl:value-of select="图:文本内容/@图:垂直对齐"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容/@图:自动换行">
+ <xsl:attribute name="fo:wrap-option">no-wrap</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="draw:auto-grow-width"><xsl:choose><xsl:when test="图:文本内容/@图:大小适应文字">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="draw:auto-grow-height"><xsl:choose><xsl:when test="图:文本内容/@图:大小适应文字">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="bina_graphic">
+ <xsl:param name="refGraphic"/>
+ <xsl:element name="office:binary-data">
+ <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符 = $refGraphic]">
+ <xsl:value-of select="uof:数据"/>
+ </xsl:for-each>
+ </xsl:element>
+ <text:p/>
+ </xsl:template>
+ <xsl:template name="graphic-fill">
+ <xsl:param name="draw-name"/>
+ <xsl:param name="gradient-name"/>
+ <xsl:if test="图:预定义图形/图:属性/图:填充/图:渐变">
+ <xsl:element name="draw:gradient">
+ <xsl:attribute name="draw:name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
+ <xsl:attribute name="draw:style"><xsl:choose><xsl:when test="$gradient-name/@图:种子类型='linear'"><xsl:value-of select="'linear'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='radar'"><xsl:value-of select="'radial'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='oval'"><xsl:value-of select="'ellipsoid'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='square'"><xsl:value-of select="'square'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='rectangle'"><xsl:value-of select="'rectangular'"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="draw:start-color"><xsl:value-of select="$gradient-name/@图:起始色"/></xsl:attribute>
+ <xsl:attribute name="draw:end-color"><xsl:value-of select="$gradient-name/@图:终止色"/></xsl:attribute>
+ <xsl:attribute name="draw:start-intensity"><xsl:value-of select="concat($gradient-name/@图:起始浓度,'%')"/></xsl:attribute>
+ <xsl:attribute name="draw:end-intensity"><xsl:value-of select="concat($gradient-name/@图:终止浓度,'%')"/></xsl:attribute>
+ <xsl:attribute name="draw:angle"><xsl:value-of select="$gradient-name/@图:渐变方向 * 10"/></xsl:attribute>
+ <xsl:attribute name="draw:border"><xsl:value-of select="concat($gradient-name/@图:边界,'%')"/></xsl:attribute>
+ <xsl:if test="$gradient-name/@图:种子X位置">
+ <xsl:attribute name="draw:cx"><xsl:value-of select="concat($gradient-name/@图:种子X位置,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$gradient-name/@图:种子Y位置">
+ <xsl:attribute name="draw:cy"><xsl:value-of select="concat($gradient-name/@图:种子Y位置,'%')"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
+ <xsl:element name="draw:marker">
+ <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">
+ <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
+ <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">
+ <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
+ <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
+ <xsl:element name="draw:marker">
+ <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">
+ <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
+ <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">
+ <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
+ <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用 or 图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
+ <xsl:element name="draw:fill-image">
+ <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:类型"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:call-template name="bina_graphic">
+ <xsl:with-param name="refGraphic">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
+ <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"/>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用">
+ <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="not(图:预定义图形/图:属性/图:线型='single') and not(图:预定义图形/图:属性/图:线型='thick') and 图:预定义图形/图:属性/图:线型">
+ <draw:stroke-dash draw:name="Ultrafine_20_Dashed" draw:display-name="Ultrafine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.051cm" draw:dots2="1" draw:dots2-length="0.051cm" draw:distance="0.051cm"/>
+ <draw:stroke-dash draw:name="Fine_20_Dashed" draw:display-name="Fine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.508cm" draw:dots2="1" draw:dots2-length="0.508cm" draw:distance="0.508cm"/>
+ <draw:stroke-dash draw:name="Ultrafine_20_2_20_Dots_20_3_20_Dashes" draw:display-name="Ultrafine 2 Dots 3 Dashes" draw:style="rect" draw:dots1="2" draw:dots1-length="0.051cm" draw:dots2="3" draw:dots2-length="0.254cm" draw:distance="0.127cm"/>
+ <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
+ <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
+ <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
+ <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
+ <draw:stroke-dash draw:name="Line_20_with_20_Fine_20_Dots" draw:display-name="Line with Fine Dots" draw:style="rect" draw:dots1="1" draw:dots1-length="2.007cm" draw:dots2="10" draw:distance="0.152cm"/>
+ <draw:stroke-dash draw:name="Line_20_Style_20_9" draw:display-name="Line Style 9" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="120%"/>
+ <draw:stroke-dash draw:name="_33__20_Dashes_20_3_20_Dots_20__28_var_29_" draw:display-name="3 Dashes 3 Dots (var)" draw:style="rect" draw:dots1="3" draw:dots1-length="197%" draw:dots2="3" draw:distance="100%"/>
+ <draw:stroke-dash draw:name="_32__20_Dots_20_1_20_Dash" draw:display-name="2 Dots 1 Dash" draw:style="rect" draw:dots1="2" draw:dots2="1" draw:dots2-length="0.203cm" draw:distance="0.203cm"/>
+ <draw:stroke-dash draw:name="Ultrafine_20_Dotted_20__28_var_29_" draw:display-name="Ultrafine Dotted (var)" draw:style="rect" draw:dots1="1" draw:distance="50%"/>
+ <draw:stroke-dash draw:name="Dash_20_10" draw:display-name="Dash 10" draw:style="rect" draw:dots1="1" draw:dots1-length="0.02cm" draw:dots2="1" draw:dots2-length="0.02cm" draw:distance="0.02cm"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="单元格式样">
+ <xsl:variable name="uofSheet" select="/uof:UOF/uof:电子表格"/>
+ <xsl:variable name="uofSheet1" select="/uof:UOF/uof:电子表格/表:主体/表:工作表"/>
+ <xsl:variable name="uofSheetCom" select="$uofSheet/表:公用处理规则"/>
+ <xsl:variable name="first-style" select="/uof:UOF/uof:式样集/uof:单元格式样"/>
+ <xsl:variable name="quyu" select="/uof:UOF/uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化/表:区域"/>
+ <xsl:variable name="condition-format-set" select="/uof:UOF/uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化"/>
+ <xsl:variable name="aa">
+ <xsl:for-each select="$first-style">
+ <xsl:if test="@表:标识符!=@表:名称 and @表:名称!='Normal'">
+ <xsl:value-of select="@表:名称"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="bb">
+ <xsl:for-each select="$first-style">
+ <xsl:if test="@表:标识符!=@表:名称 and @表:名称!='Normal'">
+ <xsl:value-of select="@表:标识符"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <office:styles>
+ <!-- if ConditionalFormatting exists,it should generate some styles for style:style -->
+ <!--xsl:if test="$uofSheetCom/表:条件格式化集">
+ <xsl:call-template name="CondFormat_office_style"/>
+ </xsl:if-->
+ <!--ro000179 chenjh-->
+ <xsl:for-each select="$first-style[@表:类型='custom' or @表:类型='default']">
+ <xsl:call-template name="单元格具体式样"/>
+ <xsl:apply-templates select="表:数字格式[@表:格式码]"/>
+ <xsl:apply-templates select="表:字体格式[字:上下标]"/>
+ </xsl:for-each>
+ </office:styles>
+ <office:automatic-styles>
+ <xsl:for-each select="$first-style[@表:类型='auto']">
+ <xsl:variable name="apply-style-name" select="@表:名称"/>
+ <xsl:variable name="style-name" select="@表:标识符"/>
+ <xsl:choose>
+ <xsl:when test="$style-name!=$apply-style-name and $apply-style-name!='Normal'">
+ <xsl:for-each select="$condition-format-set/表:条件">
+ <style:style>
+ <xsl:attribute name="style:name"><xsl:value-of select="//uof:单元格式样[@表:名称=current()/表:格式/@表:式样引用 and @表:类型='auto']/@表:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:family">table-cell</xsl:attribute>
+ <xsl:attribute name="style:parent-style-name">Default</xsl:attribute>
+ <xsl:for-each select="parent::表:条件格式化/表:条件">
+ <xsl:variable name="condition-text">
+ <xsl:choose>
+ <xsl:when test="@表:类型='cell value'">
+ <xsl:choose>
+ <xsl:when test="表:操作码/text()='between' ">
+ <xsl:value-of select="concat('cell-content-is-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test=" 表:操作码/text()='not between'">
+ <xsl:value-of select="concat('cell-content-is-not-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='equal to'">
+ <xsl:value-of select="concat('cell-content()=',表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='not equal to'">
+ <xsl:value-of select="concat('cell-content()!=',表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='greater than'">
+ <xsl:value-of select="concat('cell-content()&gt;',表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='less than'">
+ <xsl:value-of select="concat('cell-content()&lt;',表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='greater than or equal to'">
+ <xsl:value-of select="concat('cell-content()&gt;=',表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='less than or equal to'">
+ <xsl:value-of select="concat('cell-content()&lt;=',表:第一操作数/text())"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="@表:类型='formula'">
+ <xsl:value-of select="concat('is-true-formula','(',表:第一操作数/text(),')')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="style:map">
+ <xsl:variable name="address">
+ <xsl:value-of select="preceding-sibling::表:区域"/>
+ </xsl:variable>
+ <xsl:attribute name="style:condition"><xsl:value-of select="$condition-text"/></xsl:attribute>
+ <xsl:attribute name="style:apply-style-name"><xsl:value-of select="表:格式/@表:式样引用"/></xsl:attribute>
+ <xsl:attribute name="style:base-cell-address"><xsl:value-of select="substring-after($address,':')"/></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </style:style>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="uof:单元格式样 ">
+ <xsl:if test="@表:类型='auto' and (@表:标识符=@表:名称 or @表:名称='Normal')">
+ <xsl:call-template name="单元格具体式样"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ <!--Redoffie comment liliang SC0008 06.02.14-->
+ <!--1新增内容-->
+ <xsl:if test="uof:单元格式样">
+ <xsl:for-each select="uof:单元格式样">
+ <xsl:if test="@表:类型='auto' and (@表:标识符=@表:名称 or @表:名称='Normal')">
+ <xsl:call-template name="单元格具体式样"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='png' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='ipg' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='gif'">
+ <style:style style:name="Graphics" style:family="graphics">
+ <style:properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
+ </style:style>
+ </xsl:if>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形"/>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形/图:文本内容/字:段落/字:句/字:句属性" mode="style"/>
+ <!--Redoffice comment end 06.02.14-->
+ <xsl:apply-templates select="$uofSheet1/表:工作表内容"/>
+ <xsl:if test="uof:单元格式样">
+ <xsl:for-each select="uof:单元格式样[@表:类型='auto' and (@表:标识符=@表:名称 or @表:名称='Normal')]">
+ <xsl:call-template name="单元格具体式样"/>
+ <xsl:apply-templates select="表:数字格式[@表:格式码]"/>
+ <xsl:apply-templates select="表:字体格式[字:上下标]"/>
+ </xsl:for-each>
+ </xsl:if>
+ <!-- if ConditionalFormatting exists,transforing the styles -->
+ <!--xsl:if test="$uofSheetCom/表:条件格式化集">
+ <xsl:call-template name="CondFormat_automatic_style"/>
+ </xsl:if-->
+ <xsl:if test="$uofSheetCom/表:条件格式化集/表:条件格式化">
+ <xsl:variable name="style-name" select="$first-style/@表:标识符"/>
+ <xsl:variable name="left-top">
+ <xsl:call-template name="search-left-top-in-tables">
+ <xsl:with-param name="cellstylename" select="$style-name"/>
+ <xsl:with-param name="tableslist" select="$uofSheet1/表:工作表内容"/>
+ <xsl:with-param name="return" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="after-translated-left-top">
+ <xsl:call-template name="translate-left-top">
+ <xsl:with-param name="left-top" select="$left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$after-translated-left-top!=''">
+ <xsl:call-template name="create-the-condition-format-map">
+ <xsl:with-param name="condition-format-set" select="$uofSheetCom/表:条件格式化集//表:条件格式化"/>
+ <xsl:with-param name="current-left-top" select="$after-translated-left-top"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ <xsl:apply-templates select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列/表:单元格/*[descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40']]"/>
+ <!--xsl:apply-templates select="$uofSheet1/表:工作表属性/表:页面设置/表:页眉页脚/字:段落" /-->
+ <xsl:call-template name="create-page-master">
+ <xsl:with-param name="worksheetoptions" select="$uofSheet1/表:工作表属性"/>
+ </xsl:call-template>
+ <xsl:for-each select="uof:句式样">
+ <style:style>
+ <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:family">text</xsl:attribute>
+ <style:text-properties>
+ <xsl:apply-templates select="./*"/>
+ </style:text-properties>
+ </style:style>
+ </xsl:for-each>
+ </office:automatic-styles>
+ <office:master-styles>
+ <xsl:call-template name="create-master-styles">
+ <xsl:with-param name="worksheetoptions" select="$uofSheet1/表:工作表属性"/>
+ </xsl:call-template>
+ </office:master-styles>
+ </xsl:template>
+ <xsl:template match="表:数据有效性">
+ <xsl:variable name="range-name-temp">
+ <xsl:value-of select="substring-before(表:区域,'!')"/>
+ </xsl:variable>
+ <xsl:variable name="range-name">
+ <xsl:value-of select="substring($range-name-temp,2,string-length($range-name-temp)-2)"/>
+ </xsl:variable>
+ <xsl:variable name="first-range">
+ <xsl:choose>
+ <xsl:when test="contains(表:区域, ',')">
+ <xsl:value-of select="translate(substring-after(substring-before(表:区域, ','),'!'),'$','')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate(substring-after(表:区域,'!'),'$','')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="value-first">
+ <xsl:value-of select="translate(表:第一操作数,'=','')"/>
+ </xsl:variable>
+ <xsl:variable name="value-second">
+ <xsl:value-of select="translate(表:第二操作数,'=','')"/>
+ </xsl:variable>
+ <xsl:element name="table:content-validation">
+ <xsl:attribute name="table:name"><xsl:value-of select="concat('val', position())"/></xsl:attribute>
+ <!--数据有效性:第一操作数、第二操作数-->
+ <!-- don't support two type of qualifier: List, Custom -->
+ <xsl:attribute name="table:condition"><xsl:variable name="qualifier-content"><xsl:choose><xsl:when test="表:操作码 = 'between'"><xsl:choose><xsl:when test="(number($value-second))"><xsl:value-of select="concat('cell-content-is-between([',$range-name,'.',$value-first,'],',$value-second)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('cell-content-is-between([',$range-name,'.',$value-first,'],[',$range-name,'.',$value-second,']')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:操作码 = 'not between'"><xsl:choose><xsl:when test="number($value-second)"><xsl:value-of select="concat('cell-content-is-not-between([',$range-name,'.',$value-first,'],',$value-second)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('cell-content-is-not-between([',$range-name,'.',$value-first,'],[',$range-name,'.',$value-second,']')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:操作码 = 'not equal to'"><xsl:value-of select="concat('!=', $value-first)"/></xsl:when><xsl:when test="表:操作码 = 'equal to'"><xsl:variable name="range1"><xsl:value-of select="substring-after(substring-before($value-first,':'),'(')"/></xsl:variable><xsl:variable name="range2"><xsl:value-of select="substring-before(substring-after($value-first,':'),')')"/></xsl:variable><xsl:value-of select="concat('=SUM([',$range-name,'.',$range1,':',$range-name,'.',$range2,']')"/></xsl:when><xsl:when test="表:操作码 = 'less than'"><xsl:value-of select="concat('&lt;', $value-first)"/></xsl:when><xsl:when test="表:操作码 = 'greater than'"><xsl:value-of select="concat('&gt;', $value-first)"/></xsl:when><xsl:when test="表:操作码 = 'greater than or equal to'"><xsl:value-of select="concat('&gt;=[',$range-name, '.',$value-first,']')"/></xsl:when><xsl:when test="表:操作码 = 'less than or equal to'"><xsl:value-of select="concat('&lt;=[',$range-name,'.', $value-first,']')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('([',$range-name,'.',substring-before($value-first,':'),':',$range-name,'.',substring-after($value-first,':'),'])')"/></xsl:otherwise></xsl:choose></xsl:variable><!--操作码、校验类型--><xsl:variable name="qualifier-value"><xsl:choose><xsl:when test="表:校验类型 = 'whole number'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-whole-number() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-whole-number() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'decimal'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'list'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-in-list() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-in-list',$qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'date'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-date() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-date() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'time'"><xsl:choose><xsl:when test="(表:操作码 = 'not between') or (表:操作码 = 'between')"><xsl:value-of select="concat('oooc:cell-content-is-time() and ', $qualifier-content, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-time() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'text length'"><xsl:choose><xsl:when test="表:操作码 = 'not between'"><xsl:choose><xsl:when test="number($value-second)"><xsl:value-of select="concat('oooc:cell-content-text-length-is-not-between([', $range-name,'.',$value-first, '],', $value-second, ')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-text-length-is-not-between([',$range-name,'.', $value-first, '],[',$range-name,'.', $value-second, '])')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="$value-second and $value-first"><xsl:choose><xsl:when test="number($value-second)"><xsl:value-of select="concat('oooc:cell-content-text-length-is-between([',$range-name,'.',$value-first,'],',$value-second,')')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-text-length-is-between([',$range-name,'.',$value-first,'],[',$range-name,'.',$value-second,'])')"/></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-text-length()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:when test="表:校验类型 = 'custom'"><xsl:choose><xsl:when test="表:操作码 = 'between'"><xsl:value-of select="concat('and cell-content-is-between(',substring-before($value-first,'('),'([',$range-name,'.',substring-after(substring-before($value-first,':'),'('),':',$range-name,'.',substring-before(substring-after($value-first,':'),')'),']),0')"/></xsl:when><xsl:when test="表:操作码 = 'not between'"><xsl:value-of select="concat('oooc:and cell-content-is-not-between(',substring-before($value-first,'('),'([',$range-name,'.',substring-after(substring-before($value-first,':'),'('),':',$range-name,'.',substring-before(substring-after($value-first,':'),')'),']),0')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('oooc:cell-content-is-custom() and ', 'cell-content()', $qualifier-content)"/></xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="表:校验类型"/></xsl:otherwise></xsl:choose></xsl:variable><xsl:value-of select="$qualifier-value"/></xsl:attribute>
+ <!--忽略空格-->
+ <xsl:attribute name="table:allow-empty-cell"><xsl:choose><xsl:when test="表:忽略空格"><xsl:value-of select="'false'"/></xsl:when><xsl:otherwise><xsl:value-of select="'true'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="table:base-cell-address"><xsl:variable name="range"><xsl:value-of select="$first-range"/><!--xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0" />
+ <xsl:with-param name="cell-column-pos" select="0" />
+ <xsl:with-param name="expression" select="$first-range" />
+ <xsl:with-param name="return-value" select="''" />
+ </xsl:call-template--></xsl:variable><xsl:call-template name="encode-as-cell-address"><xsl:with-param name="string" select="concat($range-name, '.', $range)"/></xsl:call-template></xsl:attribute>
+ <!--输入提示-->
+ <xsl:element name="table:help-message">
+ <xsl:attribute name="table:title"><xsl:value-of select="表:输入提示/@表:标题"/></xsl:attribute>
+ <xsl:attribute name="table:display"><xsl:choose><xsl:when test="表:输入提示/@表:显示"><xsl:value-of select="表:输入提示/@表:显示"/></xsl:when><xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:element name="text:p">
+ <xsl:value-of select="表:输入提示/@表:内容"/>
+ </xsl:element>
+ </xsl:element>
+ <!--错误提示-->
+ <xsl:element name="table:error-message">
+ <xsl:attribute name="table:message-type"><xsl:choose><xsl:when test="表:错误提示/@表:类型= 'information'"><xsl:value-of select="'information'"/></xsl:when><xsl:when test="表:错误提示/@表:类型= 'warning'"><xsl:value-of select="'warning'"/></xsl:when><xsl:otherwise><xsl:value-of select="'stop'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="table:title"><xsl:value-of select="表:错误提示/@表:标题"/></xsl:attribute>
+ <xsl:attribute name="table:display"><xsl:choose><xsl:when test="表:错误提示/@表:显示"><xsl:value-of select="表:错误提示/@表:显示"/></xsl:when><xsl:otherwise><xsl:value-of select="'false'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:element name="text:p">
+ <xsl:value-of select="表:错误提示/@表:内容"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="CondFormat_office_style">
+ <xsl:for-each select="../../uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化">
+ <xsl:variable name="table-pos" select="count(../../../preceding-sibling::表:公用处理规则)+1"/>
+ <xsl:variable name="conditions" select="count(../preceding-sibling::表:条件格式化集)+1"/>
+ <xsl:for-each select="表:条件">
+ <xsl:variable name="condition-number" select="count(preceding-sibling::表:条件)+1"/>
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat('Excel_CondFormat_',$table-pos,'_',$conditions,'_',$condition-number)"/></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="style:family">table-cell</xsl:attribute>
+ <xsl:element name="style:properties">
+ <xsl:choose>
+ <xsl:when test="表:格式/@表:式样引用">
+ <xsl:variable name="stylevalue" select="表:格式/@表:式样引用"/>
+ <xsl:call-template name="recursion-condformat-style-table-cell">
+ <xsl:with-param name="style-value-t">
+ <xsl:choose>
+ <xsl:when test="substring($stylevalue,string-length($stylevalue),1) != ';'">
+ <xsl:value-of select="concat($stylevalue,';')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$stylevalue"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <!--xsl:element name="style:text-properties"-->
+ <!--chengxz0618-->
+ <xsl:element name="style:properties">
+ <xsl:choose>
+ <xsl:when test="表:格式/@表:式样引用">
+ <xsl:variable name="stylevalue" select="表:格式/@表:式样引用"/>
+ <xsl:call-template name="recursion-condformat-style-text">
+ <xsl:with-param name="style-value-t">
+ <xsl:choose>
+ <xsl:when test="substring($stylevalue,string-length($stylevalue),1) != ';'">
+ <xsl:value-of select="concat($stylevalue,';')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$stylevalue"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:font-style"><xsl:value-of select="'italic'"/></xsl:attribute>
+ <xsl:attribute name="style:text-underline-type"><xsl:value-of select="'single'"/></xsl:attribute>
+ <xsl:attribute name="style:text-underline-color"><xsl:value-of select="'font-color'"/></xsl:attribute>
+ <xsl:attribute name="fo:font-weight"><xsl:value-of select="'bold'"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="cell-pattern-color">
+ <xsl:param name="pattern"/>
+ <xsl:param name="color-value"/>
+ <xsl:param name="pattern-color-value"/>
+ <xsl:variable name="rev-pattern" select="1 - $pattern"/>
+ <xsl:variable name="color-R-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($color-value,2,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="color-G-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($color-value,4,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="color-B-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($color-value,6,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="pattern-R-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($pattern-color-value,2,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="pattern-G-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($pattern-color-value,4,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="pattern-B-value">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="substring($pattern-color-value,6,2)"/>
+ <xsl:with-param name="index" select="1"/>
+ <xsl:with-param name="str-length" select="2"/>
+ <xsl:with-param name="last-value" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="R-value">
+ <xsl:variable name="combined-R-value">
+ <xsl:call-template name="decimal2hex">
+ <xsl:with-param name="dec-number" select="floor($color-R-value * $rev-pattern + $pattern-R-value * $pattern)"/>
+ <xsl:with-param name="last-value" select="'H'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($combined-R-value) = 1">
+ <xsl:value-of select="concat('0',$combined-R-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$combined-R-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="G-value">
+ <xsl:variable name="combined-G-value">
+ <xsl:call-template name="decimal2hex">
+ <xsl:with-param name="dec-number" select="floor($color-G-value * $rev-pattern + $pattern-G-value * $pattern)"/>
+ <xsl:with-param name="last-value" select="'H'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($combined-G-value) = 1">
+ <xsl:value-of select="concat('0',$combined-G-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$combined-G-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="B-value">
+ <xsl:variable name="combined-B-value">
+ <xsl:call-template name="decimal2hex">
+ <xsl:with-param name="dec-number" select="floor($color-B-value * $rev-pattern + $pattern-B-value * $pattern)"/>
+ <xsl:with-param name="last-value" select="'H'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="string-length($combined-B-value) = 1">
+ <xsl:value-of select="concat('0',$combined-B-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$combined-B-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="concat('#',$R-value,$G-value,$B-value)"/>
+ </xsl:template>
+ <xsl:template name="hex2decimal">
+ <xsl:param name="hex-number"/>
+ <xsl:param name="index"/>
+ <xsl:param name="str-length"/>
+ <xsl:param name="last-value"/>
+ <xsl:variable name="dec-char">
+ <xsl:call-template name="hexNumber2dec">
+ <xsl:with-param name="hex-value" select="substring($hex-number, $index ,1)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="current-value" select="$last-value * 16 + $dec-char"/>
+ <xsl:if test="$index &lt; $str-length">
+ <xsl:call-template name="hex2decimal">
+ <xsl:with-param name="hex-number" select="$hex-number"/>
+ <xsl:with-param name="index" select="$index + 1"/>
+ <xsl:with-param name="str-length" select="$str-length"/>
+ <xsl:with-param name="last-value" select="$current-value"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$index = $str-length">
+ <xsl:value-of select="$current-value"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="hexNumber2dec">
+ <xsl:param name="hex-value"/>
+ <xsl:choose>
+ <xsl:when test="$hex-value = 'A' or ($hex-value = 'a')">
+ <xsl:value-of select="10"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'B' or ($hex-value = 'b')">
+ <xsl:value-of select="11"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'C' or ($hex-value = 'c')">
+ <xsl:value-of select="12"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'D' or ($hex-value = 'd')">
+ <xsl:value-of select="13"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'E' or ($hex-value = 'e')">
+ <xsl:value-of select="14"/>
+ </xsl:when>
+ <xsl:when test="$hex-value = 'F' or ($hex-value = 'f')">
+ <xsl:value-of select="15"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$hex-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="decimal2hex">
+ <xsl:param name="dec-number"/>
+ <xsl:param name="last-value"/>
+ <xsl:variable name="current-value">
+ <xsl:call-template name="decNumber2hex">
+ <xsl:with-param name="dec-value">
+ <xsl:if test="$dec-number &gt; 15">
+ <xsl:value-of select="floor($dec-number div 16)"/>
+ </xsl:if>
+ <xsl:if test="$dec-number &lt; 16">
+ <xsl:value-of select="$dec-number"/>
+ </xsl:if>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$dec-number &gt; 15">
+ <xsl:call-template name="decimal2hex">
+ <xsl:with-param name="dec-number" select="$dec-number mod 16"/>
+ <xsl:with-param name="last-value" select="concat($last-value,$current-value)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$dec-number &lt; 16">
+ <xsl:value-of select="substring-after(concat($last-value,$current-value),'H')"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="decNumber2hex">
+ <xsl:param name="dec-value"/>
+ <xsl:choose>
+ <xsl:when test="$dec-value = 10">
+ <xsl:value-of select="'A'"/>
+ </xsl:when>
+ <xsl:when test="$dec-value = 11">
+ <xsl:value-of select="'B'"/>
+ </xsl:when>
+ <xsl:when test="$dec-value = 12">
+ <xsl:value-of select="'C'"/>
+ </xsl:when>
+ <xsl:when test="$dec-value = 13">
+ <xsl:value-of select="'D'"/>
+ </xsl:when>
+ <xsl:when test="$dec-value = 14">
+ <xsl:value-of select="'E'"/>
+ </xsl:when>
+ <xsl:when test="$dec-value = 15">
+ <xsl:value-of select="'F'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$dec-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="recursion-condformat-style-table-cell">
+ <xsl:param name="style-value-t"/>
+ <xsl:variable name="style-value" select="$style-value-t"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($style-value,'background')">
+ <xsl:choose>
+ <xsl:when test="contains($style-value,'mso-pattern')">
+ <xsl:variable name="color-value">
+ <xsl:call-template name="translate-color-style">
+ <xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="mso-value">
+ <xsl:call-template name="translate-color-style">
+ <xsl:with-param name="source-str" select="normalize-space(substring-after($style-value,'mso-pattern'))"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="mso-color" select="substring-after($mso-value,'#')"/>
+ <xsl:variable name="pattern-color-value" select="substring($mso-color,1,6)"/>
+ <xsl:variable name="pattern" select="concat('0.',normalize-space(substring-before(substring-after($mso-color,'gray-'),';')))"/>
+ <xsl:variable name="pattern-color">
+ <xsl:call-template name="cell-pattern-color">
+ <xsl:with-param name="pattern" select="$pattern"/>
+ <xsl:with-param name="color-value" select="$color-value"/>
+ <xsl:with-param name="pattern-color-value" select="concat('#',$pattern-color-value)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="fo:background-color"><xsl:value-of select="normalize-space($pattern-color)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:background-color"><xsl:call-template name="translate-color-style"><xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:call-template></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="starts-with($style-value,'border')">
+ <xsl:attribute name="fo:border"><xsl:value-of select="'0.002cm solid #000000'"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="contains($style-value,':')">
+ <xsl:call-template name="recursion-condformat-style-table-cell">
+ <xsl:with-param name="style-value-t" select="substring-after($style-value,';')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="recursion-condformat-style-text">
+ <xsl:param name="style-value-t"/>
+ <xsl:variable name="style-value" select="normalize-space($style-value-t)"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($style-value,'color')">
+ <xsl:attribute name="fo:color"><xsl:call-template name="translate-color-style"><xsl:with-param name="source-str" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:call-template></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="starts-with($style-value,'font-style')">
+ <xsl:attribute name="fo:font-style"><xsl:value-of select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="starts-with($style-value,'font-weight')">
+ <xsl:variable name="font-weight" select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/>
+ <xsl:attribute name="fo:font-weight"><xsl:choose><xsl:when test="($font-weight &gt; 300) and ($font-weight &lt; 500)"><xsl:value-of select="'normal'"/></xsl:when><xsl:when test="($font-weight &gt; 500) or ($font-weight = 500)"><xsl:value-of select="'bold'"/></xsl:when><xsl:otherwise><xsl:value-of select="'0'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="starts-with($style-value,'text-underline-style')">
+ <xsl:attribute name="style:text-underline-type"><xsl:value-of select="normalize-space(substring-before(substring-after($style-value,':'),';'))"/></xsl:attribute>
+ <xsl:attribute name="style:text-underline-color"><xsl:value-of select="'#000000'"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="contains($style-value,':')">
+ <xsl:call-template name="recursion-condformat-style-text">
+ <xsl:with-param name="style-value-t" select="substring-after($style-value,';')"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="translate-color-style">
+ <xsl:param name="source-str"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($source-str,'#')">
+ <xsl:value-of select="$source-str"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="starts-with($source-str,'black')">
+ <xsl:value-of select="'#000000'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'maroon')">
+ <xsl:value-of select="'#800000'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'red')">
+ <xsl:value-of select="'#FF0000'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'fuchsia')">
+ <xsl:value-of select="'#FF00FF'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'olive')">
+ <xsl:value-of select="'#808000'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'yellow')">
+ <xsl:value-of select="'#FFFF00'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'green')">
+ <xsl:value-of select="'#008000'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'lime')">
+ <xsl:value-of select="'#00FF00'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'teal')">
+ <xsl:value-of select="'#008080'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'aqua')">
+ <xsl:value-of select="'#00FFFF'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'navy')">
+ <xsl:value-of select="'#000080'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'blue')">
+ <xsl:value-of select="'#0000FF'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'purple')">
+ <xsl:value-of select="'#800080'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'gray')">
+ <xsl:value-of select="'#808080'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'silver')">
+ <xsl:value-of select="'#C0C0C0'"/>
+ </xsl:when>
+ <xsl:when test="starts-with($source-str,'white')">
+ <xsl:value-of select="'#FFFFFF'"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'#FFFFFF'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="CondFormat_automatic_style">
+ <xsl:for-each select="../uof:电子表格/表:公用处理规则/表:条件格式化集/表:条件格式化">
+ <xsl:variable name="table-pos" select="count(../../../preceding-sibling::表:公用处理规则)+1"/>
+ <xsl:variable name="conditions" select="count(../preceding-sibling::表:条件格式化集)+1"/>
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat('ce',$table-pos,'-',$conditions)"/></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="style:family">table-cell</xsl:attribute>
+ <xsl:for-each select="uof:单元格式样/表:条件">
+ <xsl:variable name="condition-number" select="count(preceding-sibling::表:条件)+1"/>
+ <xsl:variable name="base-address">
+ <xsl:choose>
+ <xsl:when test="contains(../表:区域,',')">
+ <xsl:choose>
+ <xsl:when test="contains(substring-before(../表:区域,','),':')">
+ <xsl:value-of select="substring-before(substring-after(../表:区域,':'),',')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before(../表:区域,',')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="../表:区域"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="base-cell-address">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="substring-before(substring-after($base-address,'R'),'C')"/>
+ <xsl:with-param name="row-number" select="substring-after($base-address,'C')"/>
+ <xsl:with-param name="column-pos-style" select="absolute"/>
+ <xsl:with-param name="row-pos-style" select="absolute"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="condition-value">
+ <xsl:call-template name="translate-condition">
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:element name="style:map">
+ <xsl:attribute name="style:condition"><xsl:value-of select="$condition-value"/></xsl:attribute>
+ <xsl:attribute name="style:apply-style-name"><xsl:value-of select="concat('Excel_CondFormat_',$table-pos,'_',$conditions,'_',$condition-number)"/></xsl:attribute>
+ <xsl:attribute name="style:base-cell-address"><xsl:value-of select="concat(../../@Name,'.',$base-cell-address)"/></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="translate-condition">
+ <xsl:variable name="address-value">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="表:第一操作数"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="表:操作码">
+ <xsl:variable name="qualifier" select="表:操作码"/>
+ <xsl:variable name="first-value" select="表:第一操作数"/>
+ <xsl:choose>
+ <xsl:when test="$qualifier = 'Equal'">
+ <xsl:choose>
+ <xsl:when test="starts-with($first-value,'&quot;')">
+ <xsl:value-of select="concat('cell-content()=',$address-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('cell-content()=[',$address-value,']')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$qualifier = 'Less'">
+ <xsl:value-of select="concat('cell-content()&lt;[',$address-value,']')"/>
+ </xsl:when>
+ <xsl:when test="$qualifier = 'Greater'">
+ <xsl:value-of select="concat('cell-content()&gt;[',$address-value,']')"/>
+ </xsl:when>
+ <xsl:when test="$qualifier = 'LessOrEqual'">
+ <xsl:value-of select="concat('cell-content()&lt;=[',$address-value,']')"/>
+ </xsl:when>
+ <xsl:when test="$qualifier = 'GreaterOrEqual'">
+ <xsl:value-of select="concat('cell-content()&gt;=[',$address-value,']')"/>
+ </xsl:when>
+ <xsl:when test="$qualifier = 'NotEqual'">
+ <xsl:value-of select="concat('cell-content()!=[',$address-value,']')"/>
+ </xsl:when>
+ <xsl:when test="$qualifier = 'Between'">
+ <xsl:variable name="second-value">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="表:第二操作数"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat('cell-content-is-between([',$address-value,'],[',$second-value,'])')"/>
+ </xsl:when>
+ <xsl:when test="$qualifier = 'NotBetween'">
+ <xsl:variable name="second-value">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="0"/>
+ <xsl:with-param name="cell-column-pos" select="0"/>
+ <xsl:with-param name="expression" select="表:第二操作数"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat('cell-content-is-not-between([',$address-value,'],[',$second-value,'])')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('is-true-formula(',$address-value,')')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="translate-expression">
+ <xsl:param name="cell-row-pos"/>
+ <xsl:param name="cell-column-pos"/>
+ <xsl:param name="expression"/>
+ <xsl:param name="return-value"/>
+ <xsl:variable name="temp-range">
+ <xsl:choose>
+ <xsl:when test="$expression != ''">
+ <xsl:call-template name="parse-range-name">
+ <xsl:with-param name="expression" select="$expression"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="range-type">
+ <xsl:choose>
+ <xsl:when test="substring($temp-range, 1, 1) = '1'">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:when test="substring($temp-range, 1, 1) = '2'">
+ <xsl:value-of select="2"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="current-range">
+ <xsl:value-of select="substring($temp-range, 2)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$range-type = 1">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression">
+ <xsl:choose>
+ <xsl:when test="contains($current-range, '#$')">
+ <xsl:variable name="temp-token">
+ <xsl:choose>
+ <xsl:when test="contains($current-range, '\')">
+ <xsl:value-of select="concat(']', substring-after($current-range, '#$'), &quot;&apos;&quot;)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($current-range, '#$')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="substring-after($expression, $temp-token)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($expression, $current-range)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="return-value">
+ <xsl:choose>
+ <xsl:when test="$current-range = '='">
+ <xsl:text>oooc:=</xsl:text>
+ </xsl:when>
+ <xsl:when test="substring($current-range, string-length($current-range)) = '('">
+ <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), $current-range, '[.')"/>
+ </xsl:when>
+ <xsl:when test="$current-range = ','">
+ <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), '];[.')"/>
+ </xsl:when>
+ <xsl:when test="$current-range = ')'">
+ <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), '])')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($return-value, substring-before($expression, $current-range), $current-range)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="handle-type">
+ <xsl:choose>
+ <xsl:when test="starts-with($current-range, 'R')">
+ <xsl:choose>
+ <xsl:when test="contains($current-range, 'C')">
+ <xsl:variable name="part-type-r">
+ <xsl:call-template name="handle-type-number">
+ <xsl:with-param name="t-part" select="substring-before( substring-after($current-range, 'R'), 'C')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="part-type-c">
+ <xsl:call-template name="handle-type-number">
+ <xsl:with-param name="t-part" select="substring-after($current-range, 'C')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="($part-type-r = 1) and ($part-type-c = 1)">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="4"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="part-type">
+ <xsl:call-template name="handle-type-number">
+ <xsl:with-param name="t-part" select="substring-after($current-range, 'R')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$part-type = 1">
+ <xsl:value-of select="2"/>
+ </xsl:when>
+ <xsl:when test="$part-type = 2">
+ <xsl:value-of select="4"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="4"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="starts-with($current-range, 'C')">
+ <xsl:variable name="part-type">
+ <xsl:call-template name="handle-type-number">
+ <xsl:with-param name="t-part" select="substring-after($current-range, 'C')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$part-type = 1">
+ <xsl:value-of select="3"/>
+ </xsl:when>
+ <xsl:when test="$part-type = 2">
+ <xsl:value-of select="4"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="4"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="4"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$handle-type = 1">
+ <xsl:variable name="after-R">
+ <xsl:value-of select="substring(substring-after($current-range,'R'),1,1)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$after-R='C' or $after-R='[' or $after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
+ <xsl:variable name="row-pos">
+ <xsl:choose>
+ <xsl:when test="$after-R='['">
+ <xsl:value-of select="$cell-row-pos+substring-before( substring-after($current-range,'R['),']')"/>
+ </xsl:when>
+ <xsl:when test="$after-R='C'">
+ <xsl:value-of select="$cell-row-pos"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before(substring-after($current-range,'R'),'C')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="row-pos-style">
+ <xsl:choose>
+ <xsl:when test="$after-R='[' or $after-R='C'">relative</xsl:when>
+ <xsl:otherwise>absolute</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="after-C">
+ <xsl:value-of select="substring(substring-after(substring-after($current-range,'R'),'C'),1,1)"/>
+ </xsl:variable>
+ <xsl:variable name="column-digit-length">
+ <xsl:choose>
+ <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
+ <xsl:call-template name="get-digit-length">
+ <xsl:with-param name="complexive-string" select="substring-after(substring-after($current-range,'R'),'C')"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="column-pos">
+ <xsl:choose>
+ <xsl:when test="$after-C='['">
+ <xsl:value-of select="$cell-column-pos + substring-before(substring-after(substring-after($current-range,'R'),'C['),']')"/>
+ </xsl:when>
+ <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
+ <xsl:value-of select="substring(substring-after(substring-after($current-range,'R'),'C'),1,$column-digit-length)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$cell-column-pos"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="column-pos-style">
+ <xsl:choose>
+ <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">absolute</xsl:when>
+ <xsl:otherwise>relative</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="trans-unit">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="$column-pos"/>
+ <xsl:with-param name="row-number" select="$row-pos"/>
+ <xsl:with-param name="column-pos-style" select="$column-pos-style"/>
+ <xsl:with-param name="row-pos-style" select="$row-pos-style"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit)"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
+ <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before(substring-after($expression, '('),'R'),',!', ';.'))"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($current-range,'R')"/>
+ <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$handle-type = 2">
+ <xsl:variable name="after-R">
+ <xsl:value-of select="substring(substring-after($current-range,'R'),1,1)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$after-R='[' or $after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
+ <xsl:variable name="row-number">
+ <xsl:choose>
+ <xsl:when test="$after-R = '['">
+ <xsl:value-of select="substring-before(substring-after($current-range, 'R['), ']')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($current-range, 'R')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="row-pos">
+ <xsl:choose>
+ <xsl:when test="$after-R='['">
+ <xsl:value-of select="$cell-row-pos + $row-number"/>
+ </xsl:when>
+ <xsl:when test="$after-R='0' or $after-R='1' or $after-R='2' or $after-R='3' or $after-R='4' or $after-R='5' or $after-R='6' or $after-R='7' or $after-R='8' or $after-R='9'">
+ <xsl:value-of select="$row-number"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$cell-row-pos"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="trans-unit1">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="1"/>
+ <xsl:with-param name="row-number" select="$row-pos"/>
+ <xsl:with-param name="column-pos-style" select="'relative'"/>
+ <xsl:with-param name="row-pos-style" select="'relative'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="trans-unit2">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="256"/>
+ <xsl:with-param name="row-number" select="$row-pos"/>
+ <xsl:with-param name="column-pos-style" select="'relative'"/>
+ <xsl:with-param name="row-pos-style" select="'relative'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit1, ':', $trans-unit2)"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
+ <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before($current-range,'R'),',!', ';.'),'R')"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($current-range,'R')"/>
+ <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$handle-type = 3">
+ <xsl:variable name="after-C">
+ <xsl:value-of select="substring(substring-after($current-range,'C'),1,1)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$after-C='[' or $after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
+ <xsl:variable name="column-number">
+ <xsl:choose>
+ <xsl:when test="$after-C = '['">
+ <xsl:value-of select="substring-before(substring-after($current-range, 'C['), ']')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-after($current-range, 'C')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="column-pos">
+ <xsl:choose>
+ <xsl:when test="$after-C='['">
+ <xsl:value-of select="$cell-column-pos + $column-number"/>
+ </xsl:when>
+ <xsl:when test="$after-C='0' or $after-C='1' or $after-C='2' or $after-C='3' or $after-C='4' or $after-C='5' or $after-C='6' or $after-C='7' or $after-C='8' or $after-C='9'">
+ <xsl:value-of select="$column-number"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$cell-column-pos"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="trans-unit1">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="$column-pos"/>
+ <xsl:with-param name="row-number" select="1"/>
+ <xsl:with-param name="column-pos-style" select="'relative'"/>
+ <xsl:with-param name="row-pos-style" select="'relative'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="trans-unit2">
+ <xsl:call-template name="translate-unit">
+ <xsl:with-param name="column-number" select="$column-pos"/>
+ <xsl:with-param name="row-number" select="32000"/>
+ <xsl:with-param name="column-pos-style" select="'relative'"/>
+ <xsl:with-param name="row-pos-style" select="'relative'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), $trans-unit1, ':', $trans-unit2)"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
+ <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="name-unit" select="concat(substring-before($expression, $current-range), translate( substring-before($current-range,'C'),',!', ';.'),'C')"/>
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($current-range,'C')"/>
+ <xsl:with-param name="return-value" select="concat($return-value, $name-unit)"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="next-pit" select="substring-after($expression, $current-range)"/>
+ <xsl:choose>
+ <xsl:when test="contains($next-pit, '+') or contains($next-pit, '-') or contains($next-pit, '*') or contains($next-pit, '/') or contains($next-pit, ')') or contains($next-pit, '^') or contains($next-pit, ':') or contains($next-pit, '&quot;') or contains($next-pit, ';') or contains($next-pit, ',') or contains($next-pit, '[')">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$cell-row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$cell-column-pos"/>
+ <xsl:with-param name="expression" select="substring-after($expression, $current-range)"/>
+ <xsl:with-param name="return-value" select="concat($return-value, substring-before($expression, $current-range), $current-range)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate( concat($return-value, substring-before($expression, $current-range), $current-range),',!', ';.')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="parse-range-name">
+ <xsl:param name="expression"/>
+ <xsl:param name="return-value"/>
+ <xsl:variable name="first-one" select="substring($expression,1,1)"/>
+ <xsl:choose>
+ <xsl:when test="$first-one = '='">
+ <xsl:choose>
+ <xsl:when test="string-length(normalize-space($return-value)) &gt; 0">
+ <xsl:value-of select="concat('2', $return-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>1=</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$first-one='(' or $first-one='!' or $first-one='&amp;'">
+ <xsl:value-of select="concat('1', $return-value, $first-one)"/>
+ </xsl:when>
+ <xsl:when test="$first-one='['">
+ <xsl:choose>
+ <xsl:when test="starts-with(substring-after($expression, ']'), 'C')">
+ <xsl:call-template name="parse-range-name">
+ <xsl:with-param name="expression" select="substring-after($expression, ']')"/>
+ <xsl:with-param name="return-value" select="concat($return-value, substring-before($expression, ']'), ']')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains(substring-before($expression, ']'), '.') and contains(substring-after($expression, ']'), '!')">
+ <xsl:value-of select="concat('1', &quot;&apos;&quot;, substring-before(substring-after($expression, '['), ']'), &quot;&apos;&quot;, '#$', substring-before(substring-after($expression, ']'), '!'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('2', $return-value, substring-before($expression, ']'), ']')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$first-one='&quot;'">
+ <xsl:value-of select="concat('1', $first-one, substring-before(substring-after($expression, '&quot;'), '&quot;'), '&quot;')"/>
+ </xsl:when>
+ <xsl:when test="$first-one=&quot;&apos;&quot;">
+ <xsl:variable name="str-in" select="substring-before(substring-after($expression, &quot;&apos;&quot;), &quot;&apos;&quot;)"/>
+ <xsl:choose>
+ <xsl:when test="contains($str-in, '\') and contains($str-in, '[') and contains($str-in, ']')">
+ <xsl:variable name="first-pos" select="substring-before($str-in, '[')"/>
+ <xsl:variable name="second-pos" select="substring-before(substring-after($str-in, '['), ']')"/>
+ <xsl:variable name="third-pos" select="substring-after($str-in, ']')"/>
+ <xsl:value-of select="concat('1', &quot;&apos;&quot;, $first-pos, $second-pos, &quot;&apos;&quot;, '#$', $third-pos)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('1', &quot;&apos;&quot;, $str-in, &quot;&apos;&quot;)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$first-one='+' or $first-one='-' or $first-one='*' or $first-one='/' or $first-one=')' or $first-one='^' or $first-one=':' or $first-one='&quot;' or $first-one=';' or $first-one=',' or $first-one='&gt;' or $first-one='&lt;'">
+ <xsl:choose>
+ <xsl:when test="$return-value = ''">
+ <xsl:value-of select="concat('1', $first-one)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat('2', $return-value)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$expression = ''">
+ <xsl:value-of select="concat('2', $return-value)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="parse-range-name">
+ <xsl:with-param name="expression" select="substring($expression, 2, string-length($expression)-1)"/>
+ <xsl:with-param name="return-value" select="concat($return-value, substring($expression, 1, 1))"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="handle-type-number">
+ <xsl:param name="t-part"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($t-part, '[')">
+ <xsl:variable name="tt-str" select="substring-before( substring-after( $t-part, '['), ']')"/>
+ <xsl:choose>
+ <xsl:when test="($tt-str &lt; 0) or ($tt-str &gt; 0) or ($tt-str = 0)">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="($t-part &lt; 0) or ($t-part &gt; 0) or ($t-part = 0)">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:when test="$t-part = ''">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="2"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="translate-unit">
+ <xsl:param name="column-number"/>
+ <xsl:param name="row-number"/>
+ <xsl:param name="column-pos-style"/>
+ <xsl:param name="row-pos-style"/>
+ <xsl:variable name="column-number1">
+ <xsl:value-of select="floor( $column-number div 26 )"/>
+ </xsl:variable>
+ <xsl:variable name="column-number2">
+ <xsl:value-of select="$column-number mod 26"/>
+ </xsl:variable>
+ <xsl:variable name="column-character1">
+ <xsl:call-template name="number-to-character">
+ <xsl:with-param name="number" select="$column-number1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="column-character2">
+ <xsl:call-template name="number-to-character">
+ <xsl:with-param name="number" select="$column-number2"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$column-pos-style = 'absolute'">
+ <xsl:value-of select="concat( '$', $column-character1, $column-character2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat( $column-character1, $column-character2)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="$row-pos-style ='absolute'">
+ <xsl:value-of select="concat( '$', $row-number)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$row-number"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="number-to-character">
+ <xsl:param name="number"/>
+ <xsl:choose>
+ <xsl:when test="$number = 0"/>
+ <xsl:when test="$number = 1">A</xsl:when>
+ <xsl:when test="$number = 2">B</xsl:when>
+ <xsl:when test="$number = 3">C</xsl:when>
+ <xsl:when test="$number = 4">D</xsl:when>
+ <xsl:when test="$number = 5">E</xsl:when>
+ <xsl:when test="$number = 6">F</xsl:when>
+ <xsl:when test="$number = 7">G</xsl:when>
+ <xsl:when test="$number = 8">H</xsl:when>
+ <xsl:when test="$number = 9">I</xsl:when>
+ <xsl:when test="$number = 10">J</xsl:when>
+ <xsl:when test="$number = 11">K</xsl:when>
+ <xsl:when test="$number = 12">L</xsl:when>
+ <xsl:when test="$number = 13">M</xsl:when>
+ <xsl:when test="$number = 14">N</xsl:when>
+ <xsl:when test="$number = 15">O</xsl:when>
+ <xsl:when test="$number = 16">P</xsl:when>
+ <xsl:when test="$number = 17">Q</xsl:when>
+ <xsl:when test="$number = 18">R</xsl:when>
+ <xsl:when test="$number = 19">S</xsl:when>
+ <xsl:when test="$number = 20">T</xsl:when>
+ <xsl:when test="$number = 21">U</xsl:when>
+ <xsl:when test="$number = 22">V</xsl:when>
+ <xsl:when test="$number = 23">W</xsl:when>
+ <xsl:when test="$number = 24">X</xsl:when>
+ <xsl:when test="$number = 25">Y</xsl:when>
+ <xsl:when test="$number = 26">Z</xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-digit-length">
+ <xsl:param name="complexive-string"/>
+ <xsl:variable name="first-char">
+ <xsl:value-of select="substring( $complexive-string, 1, 1)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-char = '1' or $first-char = '2' or $first-char = '3' or $first-char = '4' or $first-char = '5' or $first-char = '6' or $first-char = '7' or $first-char = '8' or $first-char = '9' or $first-char = '0' ">
+ <xsl:variable name="temp">
+ <xsl:call-template name="get-digit-length">
+ <xsl:with-param name="complexive-string" select="substring( $complexive-string, 2)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$temp+1"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:句属性" mode="style">
+ <!--chengxz 0725-->
+ <xsl:if test="not(@字:式样引用)">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">T<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句属性" format="1"/></xsl:attribute>
+ <xsl:attribute name="style:family">text</xsl:attribute>
+ <xsl:if test="@字:式样引用">
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="style:text-properties">
+ <xsl:apply-templates select="./*"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="style-style-content">
+ <xsl:variable name="style-name" select="@表:标识符"/>
+ <xsl:variable name="apply-style-name" select="@表:名称"/>
+ <xsl:attribute name="style:family"><xsl:choose><xsl:when test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]">table-column</xsl:when><xsl:otherwise>table-cell</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]/@表:列宽">
+ <xsl:element name="style:table-column-properties">
+ <xsl:attribute name="style:column-width"><xsl:value-of select="concat(/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]/@表:列宽,$uofUnit)"/></xsl:attribute>
+ <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]/@表:跨度">
+ <xsl:attribute name="fo:break-before">auto</xsl:attribute>
+ </xsl:if>
+ <xsl:for-each select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:列[@表:式样引用=$style-name]">
+ <xsl:if test="preceding-sibling::表:列[1]/@表:跨度 and ancestor::表:工作表/表:分页符集/表:分页符/@表:列号">
+ <xsl:variable name="kuadu">
+ <xsl:value-of select="preceding-sibling::表:列[1]/@表:跨度"/>
+ </xsl:variable>
+ <xsl:if test="not($kuadu='1')">
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$kuadu='1' and not(preceding::表:列[2])">
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="style:table-cell-properties">
+ <xsl:if test="表:对齐格式">
+ <xsl:if test="表:对齐格式/表:垂直对齐方式">
+ <xsl:variable name="vertical-align">
+ <xsl:choose>
+ <xsl:when test="表:对齐格式/表:垂直对齐方式 = 'top'">top</xsl:when>
+ <xsl:when test="表:对齐格式/表:垂直对齐方式 = 'center'">center</xsl:when>
+ <xsl:when test="表:对齐格式/表:垂直对齐方式 = 'bottom'">bottom</xsl:when>
+ <xsl:otherwise>middle</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="style:vertical-align"><xsl:value-of select="$vertical-align"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:对齐格式/表:自动换行/@表:值 = 'true'">
+ <xsl:attribute name="fo:wrap-option">wrap</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:对齐格式/表:缩进">
+ <xsl:attribute name="fo:padding-left"><xsl:variable name="indent" select="表:对齐格式/表:缩进 * 10"/><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat($indent,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:对齐格式/表:文字旋转角度">
+ <xsl:attribute name="style:rotation-angle"><xsl:choose><xsl:when test="表:对齐格式/表:文字旋转角度 &lt; 0"><xsl:value-of select="360 - 表:对齐格式/表:文字旋转角度"/></xsl:when><xsl:otherwise><xsl:value-of select="表:对齐格式/表:文字旋转角度"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:rotation-align">none</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:对齐格式/表:文字方向 = 'vertical'">
+ <xsl:attribute name="style:direction">ttb</xsl:attribute>
+ <xsl:if test="not(表:对齐格式/字:水平对齐方式)">
+ <xsl:attribute name="style:text-align-source">fix</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ <!--xsl:if test="表:边框">
+ <xsl:apply-templates select="表:边框" />
+ </xsl:if-->
+ <!--chenjh add 边框 again-->
+ <xsl:if test="表:边框/uof:上/@uof:宽度 !=''">
+ <xsl:variable name="top-line-width" select="concat(表:边框/uof:上/@uof:宽度,$uofUnit)"/>
+ <xsl:variable name="top-line-tyle">
+ <xsl:choose>
+ <xsl:when test="表:边框/uof:上/@uof:类型='single'">solid</xsl:when>
+ <xsl:when test="表:边框/uof:上/@uof:类型='double'">double</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="top-line-color" select="表:边框/uof:上/@uof:颜色"/>
+ <xsl:variable name="border-top" select="concat($top-line-width,' ',$top-line-tyle,' ',$top-line-color)"/>
+ <xsl:attribute name="fo:border-top"><xsl:value-of select="$border-top"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:边框/uof:下/@uof:宽度 !=''">
+ <xsl:variable name="bottom-line-width" select="concat(表:边框/uof:下/@uof:宽度,$uofUnit)"/>
+ <xsl:variable name="bottom-line-tyle">
+ <xsl:choose>
+ <xsl:when test="表:边框/uof:下/@uof:类型='single'">solid</xsl:when>
+ <xsl:when test="表:边框/uof:下/@uof:类型='double'">double</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="bottom-line-color" select="表:边框/uof:下/@uof:颜色"/>
+ <xsl:variable name="border-bottom" select="concat($bottom-line-width,' ',$bottom-line-tyle,' ',$bottom-line-color)"/>
+ <xsl:attribute name="fo:border-bottom"><xsl:value-of select="$border-bottom"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:边框/uof:左/@uof:宽度 !=''">
+ <xsl:variable name="left-line-width" select="concat(表:边框/uof:左/@uof:宽度,$uofUnit)"/>
+ <xsl:variable name="left-line-tyle">
+ <xsl:choose>
+ <xsl:when test="表:边框/uof:左/@uof:类型='single'">solid</xsl:when>
+ <xsl:when test="表:边框/uof:左/@uof:类型='double'">double</xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="left-line-color" select="表:边框/uof:左/@uof:颜色"/>
+ <xsl:variable name="border-left" select="concat($left-line-width,' ',$left-line-tyle,' ',$left-line-color)"/>
+ <xsl:attribute name="fo:border-left"><xsl:value-of select="$border-left"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:边框/uof:右/@uof:宽度 !=''">
+ <xsl:variable name="right-line-width" select="concat(表:边框/uof:右/@uof:宽度,$uofUnit)"/>
+ <xsl:variable name="right-line-tyle">
+ <xsl:choose>
+ <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
+ <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
+ <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
+ <xsl:otherwise>solid</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="right-line-color" select="表:边框/uof:右/@uof:颜色"/>
+ <xsl:variable name="border-right" select="concat($right-line-width,' ',$right-line-tyle,' ',$right-line-color)"/>
+ <xsl:attribute name="fo:border-right"><xsl:value-of select="$border-right"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:边框/uof:对角线1/@uof:宽度 !=''">
+ <xsl:variable name="diagonal-lr-width" select="concat(表:边框/uof:对角线1/@uof:宽度,$uofUnit)"/>
+ <xsl:variable name="diagonal-lr-tyle">
+ <xsl:choose>
+ <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'none'">none</xsl:when>
+ <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'continuous'">solid</xsl:when>
+ <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'double'">double</xsl:when>
+ <xsl:otherwise>solid</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="diagonal-lr-color" select="表:边框/uof:对角线1/@uof:颜色"/>
+ <xsl:variable name="border-diagonal" select="concat($diagonal-lr-width,' ',$diagonal-lr-tyle,' ',$diagonal-lr-color)"/>
+ <xsl:attribute name="style:diagonal-bl-tr"><xsl:value-of select="$border-diagonal"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:边框/uof:对角线2/@uof:宽度 !=''">
+ <xsl:variable name="diagonal-rl-width" select="concat(表:边框/uof:对角线2/@uof:宽度,$uofUnit)"/>
+ <xsl:variable name="diagonal-rl-tyle">
+ <xsl:choose>
+ <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'none'">none</xsl:when>
+ <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'continuous'">solid</xsl:when>
+ <xsl:when test="表:边框/uof:对角线1/@uof:类型 = 'double'">double</xsl:when>
+ <xsl:otherwise>solid</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="diagonal-rl-color" select="表:边框/uof:对角线2/@uof:颜色"/>
+ <xsl:variable name="border-diagonal" select="concat($diagonal-rl-width,' ',$diagonal-rl-tyle,' ',$diagonal-rl-color)"/>
+ <xsl:attribute name="style:diagonal-tl-br"><xsl:value-of select="$border-diagonal"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:边框/*/@uof:阴影">
+ <xsl:choose>
+ <xsl:when test="表:边框/uof:下/@uof:阴影 and 表:边框/uof:右/@uof:阴影">
+ <xsl:attribute name="style:shadow">#808080 0.18cm 0.18cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:边框/uof:下/@uof:阴影 and 表:边框/uof:左/@uof:阴影">
+ <xsl:attribute name="style:shadow">#808080 -0.18cm 0.18cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:边框/uof:上/@uof:阴影 and 表:边框/uof:右/@uof:阴影">
+ <xsl:attribute name="style:shadow">#808080 0.18cm -0.18cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:边框/uof:上/@uof:阴影 and 表:边框/uof:左/@uof:阴影">
+ <xsl:attribute name="style:shadow">#808080 -0.18cm -0.18cm</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <!--边框 end -->
+ <xsl:if test="表:填充">
+ <xsl:choose>
+ <xsl:when test="表:填充/图:颜色">
+ <xsl:attribute name="fo:background-color"><xsl:value-of select="表:填充/图:颜色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="表:填充/图:图案/@图:前景色">
+ <xsl:variable name="pattern-value">
+ <xsl:call-template name="cell-pattern-color">
+ <xsl:with-param name="pattern" select="concat('0.',substring-after(表:填充/图:图案/图:背景色,'y'))"/>
+ <xsl:with-param name="color-value" select="表:填充/图:颜色"/>
+ <xsl:with-param name="pattern-color-value" select="表:填充/图:图案/图:背景色"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="fo:background-color"><xsl:value-of select="$pattern-value"/></xsl:attribute>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="表:字体格式/字:隐藏文字">
+ <xsl:choose>
+ <xsl:when test="表:字体格式/字:隐藏文字 = 'true'">
+ <xsl:attribute name="style:cell-protect">protected formula-hidden</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:cell-protect">none</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:attribute name="style:cell-protect">none</xsl:attribute>
+ <xsl:attribute name="style:text-align-source">fix</xsl:attribute>
+ </xsl:element>
+ <xsl:element name="style:paragraph-properties">
+ <xsl:if test="表:对齐格式/表:水平对齐方式">
+ <xsl:variable name="text-align">
+ <xsl:choose>
+ <xsl:when test="表:对齐格式/表:水平对齐方式 = 'left'">start</xsl:when>
+ <xsl:when test="表:对齐格式/表:水平对齐方式 = 'center'">center</xsl:when>
+ <xsl:when test="表:对齐格式/表:水平对齐方式 = 'right'">end</xsl:when>
+ <xsl:when test="表:对齐格式/表:水平对齐方式 = 'justify'">justify</xsl:when>
+ <xsl:otherwise>start</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="fo:text-align"><xsl:value-of select="$text-align"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:element name="style:text-properties">
+ <xsl:if test="表:字体格式/字:字体">
+ <xsl:choose>
+ <xsl:when test="(表:字体格式/字:字体/@字:中文字体引用)or (表:字体格式/字:字体/@字:西文字体引用)">
+ <xsl:variable name="fontnameZ" select="表:字体格式/字:字体/@字:中文字体引用"/>
+ <xsl:variable name="fontnameX" select="表:字体格式/字:字体/@字:西文字体引用"/>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:字体集/uof:字体声明">
+ <xsl:if test="(./@uof:标识符 = $fontnameZ)or(./@uof:标识符 = $fontnameX)">
+ <xsl:attribute name="style:font-name"><xsl:value-of select="./@uof:名称"/></xsl:attribute>
+ <xsl:attribute name="style:font-name-asian"><xsl:value-of select="./@uof:名称"/></xsl:attribute>
+ <xsl:attribute name="style:font-name-complex"><xsl:value-of select="./@uof:名称"/></xsl:attribute>
+ <xsl:attribute name="style:font-charset"><xsl:value-of select="./@uof:字体族"/></xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:font-name">Arial</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="表:字体格式/字:粗体/@字:值">
+ <xsl:attribute name="fo:font-weight"><xsl:choose><xsl:when test="表:字体格式/字:粗体/@字:值=1 or 表:字体格式/字:粗体/@字:值='true'">bold</xsl:when><xsl:when test="表:字体格式/字:粗体/@字:值=0 or 表:字体格式/字:粗体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:font-weight-asian"><xsl:choose><xsl:when test="表:字体格式/字:粗体/@字:值=1 or 表:字体格式/字:粗体/@字:值='true'">bold</xsl:when><xsl:when test="表:字体格式/字:粗体/@字:值=0 or 表:字体格式/字:粗体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:font-weight-complex"><xsl:choose><xsl:when test="表:字体格式/字:粗体/@字:值=1 or 表:字体格式/字:粗体/@字:值='true'">bold</xsl:when><xsl:when test="表:字体格式/字:粗体/@字:值=0 or 表:字体格式/字:粗体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:字体格式/字:斜体/@字:值">
+ <xsl:attribute name="fo:font-style"><xsl:choose><xsl:when test="表:字体格式/字:斜体/@字:值=1 or 表:字体格式/字:斜体/@字:值='true'">italic</xsl:when><xsl:when test="表:字体格式/字:斜体/@字:值=0 or 表:字体格式/字:斜体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:font-style-asian"><xsl:choose><xsl:when test="表:字体格式/字:斜体/@字:值=1 or 表:字体格式/字:斜体/@字:值='true'">italic</xsl:when><xsl:when test="表:字体格式/字:斜体/@字:值=0 or 表:字体格式/字:斜体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:font-style-complex"><xsl:choose><xsl:when test="表:字体格式/字:斜体/@字:值=1 or 表:字体格式/字:斜体/@字:值='true'">italic</xsl:when><xsl:when test="表:字体格式/字:斜体/@字:值=0 or 表:字体格式/字:斜体/@字:值='false'">normal</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="表:字体格式/字:字体/@字:颜色">
+ <xsl:attribute name="fo:color"><xsl:value-of select="表:字体格式/字:字体/@字:颜色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:use-window-font-color">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="表:字体格式/字:字体/@字:字号">
+ <xsl:attribute name="fo:font-size"><xsl:value-of select="concat( 表:字体格式/字:字体/@字:字号, 'pt')"/></xsl:attribute>
+ <xsl:attribute name="style:font-size-asian"><xsl:value-of select="concat( 表:字体格式/字:字体/@字:字号, 'pt')"/></xsl:attribute>
+ <xsl:attribute name="style:font-size-complex"><xsl:value-of select="concat( 表:字体格式/字:字体/@字:字号, 'pt')"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:font-size">12pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-asian">12pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-complex">12pt</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="表:字体格式/字:浮雕">
+ <xsl:variable name="aa">
+ <xsl:value-of select="表:字体格式/字:浮雕/@字:类型"/>
+ </xsl:variable>
+ <xsl:attribute name="style:font-relief"><xsl:choose><xsl:when test="$aa='emboss'">embossed</xsl:when><xsl:when test="$aa='engrave'">engraved</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:字体格式/字:阴影/@字:值 = '1' or 表:字体格式/字:阴影/@字:值 = 'true'">
+ <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:字体格式/字:删除线">
+ <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="表:字体格式/字:删除线/@字:类型='double'">
+ <xsl:attribute name="style:text-line-through-type">double</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:字体格式/字:删除线/@字:类型='single'">
+ <xsl:attribute name="style:text-underline-mode">continuous</xsl:attribute>
+ <xsl:attribute name="style:text-line-through-mode">continuous</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:字体格式/字:删除线/@字:类型='bold'">
+ <xsl:attribute name="style:text-line-through-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:字体格式/字:删除线/@字:类型='带/'">
+ <xsl:attribute name="style:text-line-through-text">/</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:字体格式/字:删除线/@字:类型='带X'">
+ <xsl:attribute name="style:text-line-through-text">X</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="表:字体格式/字:下划线">
+ <xsl:apply-templates select="表:字体格式/字:下划线"/>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="表:字体格式/字:着重号">
+ <xsl:apply-templates select="表:字体格式/字:着重号"/>
+ </xsl:if>
+ <xsl:if test="表:字体格式/字:空心/@字:值='true'">
+ <xsl:attribute name="style:text-outline">true</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="单元格具体式样">
+ <xsl:choose>
+ <xsl:when test="@表:类型 = 'Default'">
+ <xsl:element name="style:default-style">
+ <xsl:call-template name="style-style-content"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="@表:标识符"/></xsl:attribute>
+ <xsl:if test="表:数字格式/@表:格式码 = 'general'">
+ <xsl:attribute name="style:parent-style-name">Default</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style:parent-style-name">Default</xsl:attribute>
+ <xsl:attribute name="style:data-style-name"><xsl:value-of select="concat( @表:标识符, 'F')"/></xsl:attribute>
+ <!--chengxz这里要改 -->
+ <!--xsl:attribute name="style:data-style-name"><xsl:value-of select="'N2'"/></xsl:attribute-->
+ <xsl:call-template name="style-style-content"/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="表:边框">
+ <!--chengxz 0622-->
+ <xsl:if test="not(uof:下)">
+ <xsl:attribute name="fo:border-bottom">none</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(uof:上)">
+ <xsl:attribute name="fo:border-top">none</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(uof:左)">
+ <xsl:attribute name="fo:border-left">none</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(uof:右)">
+ <xsl:attribute name="fo:border-right">none</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="uof:对角线1"/>
+ <xsl:apply-templates select="uof:对角线2"/>
+ <xsl:apply-templates select="uof:上"/>
+ <xsl:apply-templates select="uof:下"/>
+ <xsl:apply-templates select="uof:左"/>
+ <xsl:apply-templates select="uof:右"/>
+ </xsl:template>
+ <xsl:template match="uof:上">
+ <xsl:variable name="bordtype">
+ <xsl:choose>
+ <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
+ <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
+ <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
+ <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
+ <xsl:otherwise>solid</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="fo:border-top"><xsl:value-of select="concat(@uof:宽度 div 30,$uofUnit, ' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
+ <xsl:if test="@uof:类型 = 'double'">
+ <xsl:attribute name="style:border-line-width-top">0.035cm 0.035cm 0.035cm</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="uof:下">
+ <xsl:variable name="bordtype">
+ <xsl:choose>
+ <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
+ <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
+ <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
+ <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
+ <xsl:otherwise>solid</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="fo:border-bottom"><xsl:value-of select="concat(@uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ',@uof:颜色)"/></xsl:attribute>
+ <xsl:if test="@uof:类型 = 'double'">
+ <xsl:attribute name="style:border-line-width-bottom">0.035cm 0.035cm 0.035cm</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="uof:左">
+ <xsl:variable name="bordtype">
+ <xsl:choose>
+ <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
+ <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
+ <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
+ <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
+ <xsl:otherwise>solid</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="fo:border-left"><xsl:value-of select="concat(@uof:宽度 div 30,$uofUnit, ' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
+ <xsl:if test="@uof:类型 = 'double'">
+ <xsl:attribute name="style:border-line-width-left">0.035cm 0.035cm 0.035cm</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="uof:右">
+ <xsl:variable name="bordtype">
+ <xsl:choose>
+ <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
+ <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
+ <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
+ <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
+ <xsl:otherwise>solid</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="fo:border-right"><xsl:value-of select="concat( @uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
+ <xsl:if test="@uof:类型 = 'double'">
+ <xsl:attribute name="style:border-line-width-right">0.035cm 0.035cm 0.035cm</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="uof:对角线1">
+ <xsl:variable name="bordtype">
+ <xsl:choose>
+ <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
+ <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
+ <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
+ <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
+ <xsl:otherwise>solid</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="style:diagonal-bl-tr"><xsl:value-of select="concat( @uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
+ <xsl:if test="@uof:类型 = 'double'">
+ <xsl:attribute name="style:diagonal-bl-tr-width">0.035cm 0.035cm 0.035cm</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="uof:对角线2">
+ <xsl:variable name="bordtype">
+ <xsl:choose>
+ <xsl:when test="@uof:类型 = 'none'">none</xsl:when>
+ <xsl:when test="@uof:类型 = 'continuous'">solid</xsl:when>
+ <xsl:when test="@uof:类型 = 'double'">double</xsl:when>
+ <!-- Dash, Dot, DashDot, DashDotDot, SlantDashDot are not supported yet -->
+ <xsl:otherwise>solid</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="style:diagonal-tl-br"><xsl:value-of select="concat( @uof:宽度 div 30, $uofUnit,' ',$bordtype, ' ', @uof:颜色)"/></xsl:attribute>
+ <xsl:if test="@uof:类型 = 'double'">
+ <xsl:attribute name="style:diagonal-tl-br-width">0.035cm 0.035cm 0.035cm</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="表:字体格式">
+ <xsl:choose>
+ <xsl:when test="字:上下标/@字:上下标 = 'sup'">
+ <style:style style:name="{concat(../@表:标识符,'T0')}" style:family="text">
+ <style:text-properties style:text-position="33% 58%"/>
+ </style:style>
+ </xsl:when>
+ <xsl:when test="字:上下标/@字:上下标 = 'sub'">
+ <style:style style:name="{concat(../@表:标识符,'T0')}" style:family="text">
+ <style:text-properties style:text-position="-33% 58%"/>
+ </style:style>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="tablecolumngroup">
+ <xsl:param name="start"/>
+ <xsl:param name="end"/>
+ <xsl:param name="prestart"/>
+ <xsl:param name="preend"/>
+ <xsl:param name="nextstart"/>
+ <xsl:param name="nextend"/>
+ <table:table-column-group>
+ <table:table-column>
+ <xsl:attribute name="table:style-name">co1</xsl:attribute>
+ <xsl:attribute name="table:table-column-repeated"><xsl:value-of select="@表:终止 - @表:起始 + 1"/></xsl:attribute>
+ </table:table-column>
+ <xsl:if test="$nextstart &gt;= $start and $nextend &lt;= $end">
+ <xsl:for-each select="following-sibling::表:列[1]">
+ <xsl:call-template name="tablecolumngroup"/>
+ </xsl:for-each>
+ </xsl:if>
+ </table:table-column-group>
+ </xsl:template>
+ <xsl:template match="表:工作表">
+ <xsl:variable name="rowpath" select="表:工作表内容/表:行"/>
+ <xsl:variable name="colpath" select="表:工作表内容/表:列"/>
+ <xsl:element name="table:table">
+ <xsl:attribute name="table:name"><xsl:value-of select="@表:名称"/></xsl:attribute>
+ <xsl:if test="表:工作表内容">
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat( 'ta', count(preceding-sibling::表:工作表)+1)"/></xsl:attribute>
+ <xsl:if test="(@表:隐藏 = '1')or(@表:隐藏 = 'true')">
+ <xsl:attribute name="table:protected">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:工作表内容/uof:锚点 or 表:工作表内容/表:图表">
+ <table:shapes>
+ <xsl:apply-templates select="表:工作表内容/uof:锚点"/>
+ <xsl:apply-templates select="表:工作表内容/表:图表">
+ <xsl:with-param name="table-name" select="@表:名称"/>
+ </xsl:apply-templates>
+ </table:shapes>
+ </xsl:if>
+ <xsl:variable name="table-pos">
+ <xsl:value-of select="count(../preceding-sibling::表:工作表)+1"/>
+ </xsl:variable>
+ <xsl:if test="表:工作表内容/表:分组集/表:列">
+ <xsl:for-each select="表:工作表内容/表:分组集/表:列">
+ <xsl:variable name="start" select="@表:起始"/>
+ <xsl:variable name="end" select="@表:终止"/>
+ <xsl:variable name="prestart" select="preceding-sibling::表:列/@表:起始"/>
+ <xsl:variable name="preend" select="preceding-sibling::表:列/@表:终止"/>
+ <xsl:variable name="nextstart" select="following-sibling::表:列/@表:起始"/>
+ <xsl:variable name="nextend" select="following-sibling::表:列/@表:终止"/>
+ <xsl:call-template name="tablecolumngroup">
+ <xsl:with-param name="start" select="$start"/>
+ <xsl:with-param name="end" select="$end"/>
+ <xsl:with-param name="prestart" select="$prestart"/>
+ <xsl:with-param name="preend" select="$preend"/>
+ <xsl:with-param name="nextstart" select="$nextstart"/>
+ <xsl:with-param name="nextend" select="$nextend"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:for-each select="表:工作表内容/表:列">
+ <table:table-column>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
+ <xsl:if test="@表:跨度 and not(@表:跨度='1')">
+ <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="@表:跨度"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@表:隐藏">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ </table:table-column>
+ </xsl:for-each>
+ <xsl:variable name="condition-pos-str1">
+ <xsl:if test="../../表:公用处理规则/表:条件格式化集/表:条件格式化">
+ <xsl:call-template name="condition-row-column-string">
+ <xsl:with-param name="last" select="''"/>
+ <xsl:with-param name="total" select="count(../../表:公用处理规则/表:条件格式化集/表:条件格式化)"/>
+ <xsl:with-param name="index" select="1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="condition-pos-str2">
+ <xsl:if test="../../表:公用处理规则/表:数据有效性集/表:数据有效性">
+ <xsl:call-template name="validation-row-column-string">
+ <xsl:with-param name="last" select="''"/>
+ <xsl:with-param name="total" select="count(../../表:公用处理规则/表:数据有效性集/表:数据有效性)"/>
+ <xsl:with-param name="index" select="1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="condition-pos-str" select="concat($condition-pos-str1, $condition-pos-str2)"/>
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行">
+ <xsl:call-template name="create-rows">
+ <xsl:with-param name="lastrowpos" select="0"/>
+ <xsl:with-param name="row-count" select="count(表:工作表内容/表:行)"/>
+ <xsl:with-param name="currentRow" select="1"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="tableHasStyle">
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容[@表:式样引用]">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="./表:分页符集/表:分页符[@表:行号]">
+ <xsl:for-each select="./表:分页符集/表:分页符[@表:行号]">
+ <xsl:variable name="number-repeated">
+ <xsl:choose>
+ <xsl:when test="position() = 1">
+ <xsl:value-of select="./@表:行号"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./@表:行号 - preceding::表:分页符[@表:行号 and (position()=count(.))]/@表:行号 - 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$number-repeated &gt; 0">
+ <xsl:element name="table:table-row">
+ <xsl:if test="($rowpath/@表:隐藏 = '1') or ($rowpath/@表:隐藏 = 'true')">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro',$table-pos)"/></xsl:attribute>
+ <xsl:attribute name="table:number-rows-repeated"><xsl:value-of select="$number-repeated"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$tableHasStyle = 1">
+ <table:table-cell table:number-columns-repeated="256"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <table:table-cell/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="table:table-row">
+ <xsl:if test="($colpath/@表:隐藏 = '1') or ($colpath/@表:隐藏 = 'true')">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob',$table-pos)"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$tableHasStyle = 1">
+ <table:table-cell table:number-columns-repeated="256"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <table:table-cell/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="table:table-row">
+ <xsl:choose>
+ <xsl:when test="表:工作表内容/@表:式样引用">
+ <xsl:attribute name="table:style-name"><xsl:value-of select="表:工作表内容/@表:式样引用"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name"><xsl:text>ro1</xsl:text></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:element name="table:table-cell"/>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="../../表:公用处理规则/表:条件格式化集/表:条件格式化">
+ <xsl:variable name="condition-row-max">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="div-value" select="'R'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="condition-col-max">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="div-value" select="'C'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="break-row-max">
+ <xsl:call-template name="break-row-beyond-max">
+ <xsl:with-param name="pos" select="1"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="count-value" select="count(./表:分页符集/表:分页符[@表:行号])"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="end-value">
+ <xsl:choose>
+ <xsl:when test="$condition-row-max &lt; $break-row-max">
+ <xsl:value-of select="$break-row-max"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$condition-row-max"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="get-row-beyond-last">
+ <xsl:with-param name="index-value" select="1"/>
+ <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="end-pos" select="$end-value"/>
+ <xsl:with-param name="total-col" select="$condition-col-max"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="./表:工作表内容/@表:式样引用">
+ <table:table-row table:style-name="ro1" table:number-rows-repeated="32000">
+ <table:table-cell table:number-columns-repeated="256"/>
+ </table:table-row>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test="表:图表">
+ <table:shapes>
+ <xsl:apply-templates select="表:图表">
+ <xsl:with-param name="table-name" select="@表:名称"/>
+ </xsl:apply-templates>
+ </table:shapes>
+ </xsl:if>
+ </xsl:template>
+ <!--xsl:template name="create-columns-without-input"></xsl:template>
+ <xsl:template name="create-columns"></xsl:template>
+ <xsl:template name="condition-row-column-string"></xsl:template>
<xsl:template name="validation-row-column-string"></xsl:template>
<xsl:template name="create-rows"></xsl:template>
<xsl:template name="condition-row-col-pos-max"></xsl:template>
<xsl:template name="get-row-beyond-last"></xsl:template-->
- <!--xsl:template name="break-row-beyond-max"></xsl:template-->
- <!-- chengxz有问题-->
- <xsl:template name="create-columns-without-input">
- <xsl:param name="table-pos"/>
- <xsl:variable name="rowpath" select="表:工作表内容/表:行"/>
- <xsl:variable name="colpath" select="表:工作表内容/表:列"/>
- <xsl:choose>
- <xsl:when test="./表:分页符集/表:分页符[@表:列号]">
- <xsl:for-each select="./表:分页符集/表:分页符[@表:列号]">
- <xsl:variable name="number-repeated">
- <xsl:choose>
- <xsl:when test="position() = 1">
- <xsl:value-of select="./@表:列号"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./@表:列号 - preceding::表:分页符[@表:列号 and (position()=count(.))]/@表:列号 - 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$number-repeated &gt; 0">
- <xsl:element name="table:table-column">
- <xsl:if test="ancestor::表:工作表/表:工作表内容/@表:式样引用">
- <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="ancestor::表:工作表/表:工作表内容/@表:式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="($colpath/@表:隐藏 = '1') or ($colpath/@表:隐藏 = 'true')">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('co',$table-pos)"/></xsl:attribute>
- <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$number-repeated"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="table:table-column">
- <xsl:if test="ancestor::表:工作表/表:工作表内容/@表:式样引用">
- <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="ancestor::表:工作表/表:工作表内容/@表:式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="($colpath/@表:隐藏 = '1') or ($colpath/@表:隐藏 = 'true')">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$table-pos)"/></xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="table:table-column">
- <xsl:choose>
- <xsl:when test="表:工作表内容/@表:式样引用">
- <xsl:attribute name="table:style-name"><xsl:value-of select="表:工作表内容/@表:式样引用"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name"><xsl:text>co1</xsl:text></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="表:工作表内容/@表:最大列 and 表:工作表内容/@表:最大列 > 0">
- <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="表:工作表内容/@表:最大列"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:default-cell-style-name"><xsl:text>Default</xsl:text></xsl:attribute>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="create-columns">
- <xsl:param name="columnCount"/>
- <xsl:param name="currentColumn" select="1"/>
- <xsl:param name="finishedColumns" select="0"/>
- <xsl:param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
- <xsl:param name="currentColumnNode"/>
- <xsl:choose>
- <xsl:when test="$finishedColumns &lt; $columnCount">
- <xsl:choose>
- <xsl:when test="$currentColumnNode">
- <xsl:choose>
- <xsl:when test="$currentColumnNode/@表:列号 - $finishedColumns &gt; 1">
- <xsl:call-template name="create-default-column">
- <xsl:with-param name="currentColumn" select="$currentColumn"/>
- <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- <xsl:call-template name="create-columns">
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="currentColumn" select="$currentColumn"/>
- <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
- <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="table:table-column">
- <xsl:if test="($currentColumnNode/@表:隐藏 = '1') or ($currentColumnNode/@表:隐藏 = 'true')">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- <xsl:if test="$currentColumnNode/@表:跨度">
- <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$currentColumnNode/@表:跨度 + 1"/></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="key('ColBreak', $currentColumn)">
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob', $worksheetNo, '-', $currentColumn)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('co', $worksheetNo, '-', $currentColumn)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:call-template name="create-columns">
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="currentColumn" select="$currentColumn + 1"/>
- <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
- <xsl:with-param name="currentColumnNode" select="表:工作表属性/表:列[$currentColumn + 1]"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="create-default-column">
- <xsl:with-param name="currentColumn" select="$currentColumn"/>
- <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- <xsl:call-template name="create-columns">
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="currentColumn" select="$currentColumn"/>
- <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$currentColumn = $columnCount">
- <xsl:if test="表:分页符集/表:分页符/@表:列号 &gt; $finishedColumns">
- <xsl:call-template name="get-column-beyond-last">
- <xsl:with-param name="index-value" select="$finishedColumns"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-column-beyond-last">
- <xsl:param name="index-value"/>
- <xsl:param name="worksheetNo"/>
- <xsl:for-each select="表:分页符集/表:分页符[@表:列号]">
- <xsl:variable name="each-column-value" select="@表:列号"/>
- <xsl:choose>
- <xsl:when test="$each-column-value + 1 &gt; $index-value">
- <xsl:variable name="number-repeated">
- <xsl:choose>
- <xsl:when test="preceding-sibling::表:分页符[@表:列号][position()=count(.)]/@表:列号 + 1 = $index-value">
- <xsl:value-of select="$each-column-value - preceding-sibling::表:分页符[@表:列号 and (position()=count(.))]/@表:列号 - 1"/>
- </xsl:when>
- <xsl:when test="preceding-sibling::表:分页符[@表:列号 and (position()=count(.))]/@表:列号 + 1 &gt; $index-value">
- <xsl:value-of select="$each-column-value - preceding-sibling::表:分页符[@表:列号][position()=count(.)]/@表:列号 - 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$each-column-value - $index-value + 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$number-repeated &gt; 0">
- <xsl:element name="table:table-column">
- <xsl:attribute name="table:style-name"><xsl:value-of select="'co1'"/></xsl:attribute>
- <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$number-repeated"/></xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:element name="table:table-column">
- <xsl:if test="../../表:工作表内容[@表:式样引用]">
- <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="./表:工作表内容/@表:式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$worksheetNo)"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- <xsl:when test="$each-column-value + 1 = $index-value">
- <xsl:element name="table:table-column">
- <xsl:if test="/../../表:工作表内容[@表:式样引用]">
- <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="./../../表:工作表内容/@表:式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$worksheetNo)"/></xsl:attribute>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="condition-row-column-string">
- <xsl:param name="last"/>
- <xsl:param name="total"/>
- <xsl:param name="index"/>
- <xsl:variable name="table-pos" select="count(preceding-sibling::表:工作表)+1"/>
- <xsl:variable name="current">
- <xsl:call-template name="parse-range">
- <xsl:with-param name="range-value" select="../../表:公用处理规则/表:条件格式化集/表:条件格式化[position() = $index]/表:范围"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="current-value" select="concat('(c',$table-pos,'-',$index,':', $current,');')"/>
- <xsl:if test="$index &lt; $total">
- <xsl:call-template name="condition-row-column-string">
- <xsl:with-param name="last" select="concat($last, $current-value)"/>
- <xsl:with-param name="total" select="$total"/>
- <xsl:with-param name="index" select="$index + 1"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$index = $total">
- <xsl:value-of select="concat($last, $current-value)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="validation-row-column-string">
- <xsl:param name="last"/>
- <xsl:param name="total"/>
- <xsl:param name="index"/>
- <xsl:variable name="table-pos" select="count(preceding-sibling::表:工作表)+1"/>
- <xsl:variable name="current">
- <xsl:call-template name="parse-range">
- <xsl:with-param name="range-value" select="../../表:公用处理规则/表:数据有效性集/表:数据有效性[position() = $index]/表:范围"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="current-value" select="concat('(v',$index,':', $current,');')"/>
- <xsl:if test="$index &lt; $total">
- <xsl:call-template name="validation-row-column-string">
- <xsl:with-param name="last" select="concat($last, $current-value)"/>
- <xsl:with-param name="total" select="$total"/>
- <xsl:with-param name="index" select="$index + 1"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$index = $total">
- <xsl:value-of select="concat($last, $current-value)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="create-rows">
- <xsl:param name="lastrowpos"/>
- <xsl:param name="row-count"/>
- <xsl:param name="currentRow"/>
- <xsl:param name="condition-pos-str"/>
- <xsl:choose>
- <xsl:when test="$currentRow &lt; ($row-count + 1)">
- <xsl:variable name="span-value">
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
- <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 - $lastrowpos + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 - $lastrowpos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
- <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度 + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="current-index">
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
- <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$lastrowpos + 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:分组集/表:行">
- <xsl:for-each select="./表:工作表内容/表:分组集/表:行[1]">
- <xsl:call-template name="table:table-row-group"/>
- </xsl:for-each>
- <xsl:for-each select="./表:工作表内容/表:行[not(@表:行号)]">
- <xsl:call-template name="create-row">
- <xsl:with-param name="index-value" select="$lastrowpos"/>
- <xsl:with-param name="span-value" select="$span-value"/>
- <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
- <xsl:with-param name="row-value" select="$currentRow"/>
- <xsl:with-param name="times" select="1"/>
- <xsl:with-param name="current-index" select="$current-index"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="./表:工作表内容/表:分组集 and ( ./表:工作表内容/表:分组集/表:行/@表:起始 &gt;= ($currentRow - 1) and ($currentRow - 1) &lt;= ./表:工作表内容/表:分组集/表:行/@表:终止 )">
- <xsl:element name="table:table-row-group">
- <xsl:variable name="TempStart">
- <xsl:value-of select="./表:工作表内容/表:分组集/表:行/@表:起始"/>
- </xsl:variable>
- <xsl:variable name="TempEnd">
- <xsl:value-of select="./表:工作表内容/表:分组集/表:行/@表:终止"/>
- </xsl:variable>
- <xsl:for-each select="./表:工作表内容/表:行">
- <xsl:if test="$TempStart &gt;= ($currentRow - 1) and ($currentRow - 1) &lt;= $TempEnd">
- <xsl:call-template name="create-row">
- <xsl:with-param name="index-value" select="$lastrowpos"/>
- <xsl:with-param name="span-value" select="$span-value"/>
- <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
- <xsl:with-param name="row-value" select="$currentRow"/>
- <xsl:with-param name="times" select="1"/>
- <xsl:with-param name="current-index" select="$current-index"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="create-row">
- <xsl:with-param name="index-value" select="$lastrowpos"/>
- <xsl:with-param name="span-value" select="$span-value"/>
- <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
- <xsl:with-param name="row-value" select="$currentRow"/>
- <xsl:with-param name="times" select="1"/>
- <xsl:with-param name="current-index" select="$current-index"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- <xsl:if test="$currentRow &lt; $row-count">
- <xsl:call-template name="create-rows">
- <xsl:with-param name="lastrowpos">
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
- <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
- <xsl:value-of select="$lastrowpos + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度 + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$lastrowpos + 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="row-count" select="$row-count"/>
- <xsl:with-param name="currentRow" select="$currentRow + 1"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$currentRow = $row-count">
- <xsl:variable name="last-pos">
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
- <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
- <xsl:value-of select="$lastrowpos + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度 + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$lastrowpos + 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="./表:分页符集/表:分页符/@表:行号 &gt; ($last-pos - 1) or ../../表:公用处理规则/表:条件格式化集/表:条件格式化">
- <xsl:variable name="condition-row-max">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="div-value" select="'R'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="condition-col-max">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="div-value" select="'C'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="break-row-max">
- <xsl:call-template name="break-row-beyond-max">
- <xsl:with-param name="pos" select="1"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="count-value" select="count(./表:分页符集/表:分页符[@表:行号])"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="end-value">
- <xsl:choose>
- <xsl:when test="$condition-row-max &lt; $break-row-max">
- <xsl:value-of select="$break-row-max"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$condition-row-max"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="get-row-beyond-last">
- <xsl:with-param name="index-value" select="$last-pos + 1"/>
- <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="end-pos" select="$end-value"/>
- <xsl:with-param name="total-col" select="$condition-col-max"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="./表:工作表内容/表:列[@表:式样引用] or ./表:工作表内容[@表:式样引用]">
- <table:table-row table:style-name="ro1" table:number-rows-repeated="31990">
- <table:table-cell table:number-columns-repeated="256"/>
- </table:table-row>
- <table:table-row table:style-name="ro1">
- <table:table-cell table:number-columns-repeated="256"/>
- </table:table-row>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <!-- add row-group 2.6-->
- <xsl:template name="table:table-row-group">
- <xsl:param name="start"/>
- <xsl:param name="end"/>
- <xsl:variable name="start1" select="@表:起始"/>
- <xsl:variable name="end1" select="@表:终止"/>
- <xsl:variable name="nextstart" select="following-sibling::表:行/@表:起始"/>
- <xsl:variable name="nextend" select="following-sibling::表:行/@表:终止"/>
- <xsl:variable name="prestart" select="preceding-sibling::表:行/@表:起始"/>
- <xsl:variable name="preend" select="preceding-sibling::表:行/@表:终止"/>
- <xsl:variable name="numrow" select="$end1 - $start1"/>
- <xsl:variable name="position" select="position()"/>
- <xsl:choose>
- <xsl:when test="$nextstart &gt;= $start1 and $nextend &lt;= $end1">
- <table:table-row-group>
- <xsl:call-template name="creategroup"/>
- </table:table-row-group>
- </xsl:when>
- <xsl:when test="$nextstart &gt;= $end1">
- <xsl:choose>
- <xsl:when test="$nextend &lt;=$preend">
- <xsl:call-template name="row">
- <xsl:with-param name="start1" select="$start1"/>
- <xsl:with-param name="end1" select="$end1"/>
- <xsl:with-param name="nextstart" select="$nextstart"/>
- <xsl:with-param name="nextend" select="$nextend"/>
- <xsl:with-param name="prestart" select="$prestart"/>
- <xsl:with-param name="preend" select="$preend"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="levelgroup"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="row">
- <xsl:with-param name="start1" select="$start1"/>
- <xsl:with-param name="end1" select="$end1"/>
- <xsl:with-param name="nextstart" select="$nextstart"/>
- <xsl:with-param name="nextend" select="$nextend"/>
- <xsl:with-param name="prestart" select="$prestart"/>
- <xsl:with-param name="preend" select="$preend"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="levelrowgroup">
- <xsl:param name="start"/>
- <xsl:param name="end"/>
- <xsl:variable name="start1" select="@表:起始"/>
- <xsl:variable name="end1" select="@表:终止"/>
- <xsl:variable name="nextstart" select="following-sibling::表:行/@表:起始"/>
- <xsl:variable name="nextend" select="following-sibling::表:行/@表:终止"/>
- <xsl:variable name="prestart" select="preceding-sibling::表:行/@表:起始"/>
- <xsl:variable name="preend" select="preceding-sibling::表:行/@表:终止"/>
- <xsl:variable name="numrow" select="$end1 - $start1"/>
- <xsl:variable name="position" select="position()"/>
- <xsl:call-template name="row">
- <xsl:with-param name="start1" select="$start1"/>
- <xsl:with-param name="end1" select="$end1"/>
- <xsl:with-param name="nextstart" select="$nextstart"/>
- <xsl:with-param name="nextend" select="$nextend"/>
- <xsl:with-param name="prestart" select="$prestart"/>
- <xsl:with-param name="preend" select="$preend"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template name="creategroup">
- <xsl:for-each select="following-sibling::表:行">
- <xsl:variable name="start1" select="@表:起始"/>
- <xsl:variable name="end1" select="@表:终止"/>
- <xsl:variable name="nextstart" select="following-sibling::表:行/@表:起始"/>
- <xsl:variable name="nextend" select="following-sibling::表:行/@表:终止"/>
- <xsl:variable name="prestart" select="preceding-sibling::表:行/@表:起始"/>
- <xsl:variable name="preend" select="preceding-sibling::表:行/@表:终止"/>
- <xsl:if test="$start1 &gt;= $prestart and $end1 &lt;= $preend">
- <xsl:call-template name="table:table-row-group"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="levelgroup">
- <xsl:for-each select="parent::表:分组集/表:行">
- <xsl:call-template name="levelrowgroup"/>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="row">
- <xsl:param name="start1"/>
- <xsl:param name="end1"/>
- <xsl:param name="nextstart"/>
- <xsl:param name="nextend"/>
- <xsl:param name="prestart"/>
- <xsl:param name="preend"/>
- <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
- <xsl:variable name="rownum" select="@表:行号"/>
- <xsl:variable name="aa" select="$start1 - $prestart"/>
- <xsl:if test="$rownum &gt;= $prestart and $rownum &lt;= ($prestart + $aa - 1) and $start1 &lt;= $preend">
- <table:table-row>
- <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
- <xsl:call-template name="celldata"/>
- </table:table-row>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
- <xsl:variable name="rownum" select="@表:行号"/>
- <xsl:variable name="ss" select="$start1 - $preend"/>
- <xsl:if test="$rownum &gt;= ($preend +1) and $rownum &lt;= ($preend + $ss - 1) and $start1 &gt;= $preend">
- <table:table-row>
- <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
- <xsl:call-template name="celldata"/>
- </table:table-row>
- </xsl:if>
- </xsl:for-each>
- <table:table-row-group>
- <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
- <xsl:variable name="rownum" select="@表:行号"/>
- <xsl:if test="$rownum &lt;= $end1">
- <xsl:if test="$rownum &gt;= $start1">
- <table:table-row>
- <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
- <xsl:call-template name="celldata"/>
- </table:table-row>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </table:table-row-group>
- <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
- <xsl:variable name="rownum" select="@表:行号"/>
- <xsl:variable name="bb" select="$preend - $end1"/>
- <xsl:if test="$rownum &gt;= ($end1 + 1) and $rownum &lt;= ($end1 + $bb) and $start1 &lt; $preend">
- <table:table-row>
- <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
- <xsl:call-template name="celldata"/>
- </table:table-row>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="celldata">
- <xsl:for-each select="./表:单元格">
- <table:table-cell>
- <xsl:choose>
- <xsl:when test="表:数据/@表:数据类型 = 'number'">
- <xsl:attribute name="office:value-type">float</xsl:attribute>
- <xsl:attribute name="office:value"><xsl:choose><xsl:when test="表:数据/@表:数据数值"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:when><xsl:otherwise><xsl:value-of select="表:数据/字:句/字:文本串"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="表:数据/@表:数据类型 = 'date'">
- <xsl:attribute name="office:value-type">date</xsl:attribute>
- <xsl:attribute name="table:date-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="表:数据/@表:数据类型 = 'time'">
- <xsl:attribute name="office:value-type">time</xsl:attribute>
- <xsl:attribute name="table:time-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="表:数据/@表:数据类型 = 'boolean'">
- <xsl:attribute name="office:value-type">boolean</xsl:attribute>
- <xsl:attribute name="table:boolean-value"><xsl:choose><xsl:when test="表:数据/字:句/字:文本串 = '1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="表:数据/@表:数据类型 = 'text'">
- <xsl:attribute name="office:value-type">string</xsl:attribute>
- <xsl:attribute name="table:string-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="表:数据/字:句/字:文本串">
- <text:p>
- <xsl:value-of select="表:数据/字:句/字:文本串"/>
- </text:p>
- </xsl:if>
- </table:table-cell>
- </xsl:for-each>
- </xsl:template>
- <!-- add row-group 2.8 -->
- <xsl:template name="create-row">
- <xsl:param name="index-value"/>
- <xsl:param name="span-value"/>
- <xsl:param name="worksheetNo"/>
- <xsl:param name="row-value"/>
- <xsl:param name="times"/>
- <xsl:param name="current-index"/>
- <xsl:param name="condition-pos-str"/>
- <xsl:element name="table:table-row">
- <xsl:choose>
- <xsl:when test="./表:分页符集/表:分页符/@表:行号 = ($index-value + $times - 1)">
- <xsl:choose>
- <xsl:when test="($index-value + $times &lt; $current-index) and ($current-index != 0)">
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob',$worksheetNo)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob', $worksheetNo, '-', $row-value)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="($index-value + $times &lt; $current-index) and ($current-index != 0)">
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro',$worksheetNo)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro', $worksheetNo, '-', $row-value)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- <!--chengxiuzhi0617-->
- <xsl:if test="./表:工作表内容/表:行[position() = $row-value]/@表:隐藏 = 'true'">
- <xsl:choose>
- <xsl:when test="./表:工作表内容/表:行[position() = $row-value]/@表:跨度">
- <xsl:if test="$index-value + $times &gt; ($current-index - 1)">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$index-value + $times = $current-index">
- <xsl:attribute name="table:visibility">collapse</xsl:attribute>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="not(./表:工作表内容/表:行[position() = $row-value]/*)">
- <table:table-cell>
- <xsl:for-each select="./表:单元格/表:数据">
- <xsl:choose>
- <xsl:when test="@表:数据类型 = 'number'">
- <xsl:attribute name="office:value-type">float</xsl:attribute>
- <xsl:attribute name="office:value"><xsl:choose><xsl:when test="@表:数据数值"><xsl:value-of select="@表:数据数值"/></xsl:when><xsl:otherwise><xsl:value-of select="字:句/字:文本串"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="@表:数据类型 = 'date'">
- <xsl:attribute name="office:value-type">date</xsl:attribute>
- <xsl:attribute name="table:date-value"><xsl:value-of select="@表:数据数值"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="@表:数据类型 = 'time'">
- <xsl:attribute name="office:value-type">time</xsl:attribute>
- <xsl:attribute name="table:time-value"><xsl:value-of select="@表:数据数值"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="@表:数据类型 = 'boolean'">
- <xsl:attribute name="office:value-type">boolean</xsl:attribute>
- <xsl:attribute name="table:boolean-value"><xsl:choose><xsl:when test="字:句/字:文本串 = '1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="@表:数据类型 = 'text'">
- <xsl:attribute name="office:value-type">string</xsl:attribute>
- <xsl:attribute name="table:string-value"><xsl:value-of select="@表:数据数值"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="字:句/字:文本串">
- <text:p>
- <xsl:value-of select="字:句/字:文本串"/>
- </text:p>
- </xsl:if>
- </xsl:for-each>
- </table:table-cell>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$index-value + $times &lt; $current-index">
- <xsl:variable name="current" select="concat('R',($index-value + $times),'C')"/>
- <xsl:variable name="col-pos-max">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="div-value" select="'C'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($condition-pos-str,$current)">
- <xsl:call-template name="get-cell-span-in">
- <xsl:with-param name="row-pos" select="$index-value + $times"/>
- <xsl:with-param name="c-start" select="1"/>
- <xsl:with-param name="c-end" select="$col-pos-max"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <table:table-cell/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$index-value + $times = $current-index">
- <xsl:apply-templates select="表:工作表内容/表:行[position() = $row-value]" mode="selected">
- <xsl:with-param name="row-pos" select="$index-value + $times"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <table:table-cell/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="$times &lt; $span-value">
- <xsl:call-template name="create-row">
- <xsl:with-param name="index-value" select="$index-value"/>
- <xsl:with-param name="span-value" select="$span-value"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- <xsl:with-param name="row-value" select="$row-value"/>
- <xsl:with-param name="times" select="$times + 1"/>
- <xsl:with-param name="current-index" select="$current-index"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="condition-row-col-pos-max">
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="last-value"/>
- <xsl:param name="div-value"/>
- <xsl:variable name="pre-value">
- <xsl:choose>
- <xsl:when test="$div-value = 'R'">
- <xsl:value-of select="substring-before(substring-after($condition-pos-str,$div-value),'C')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before(substring-after($condition-pos-str,$div-value),',')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="end-value">
- <xsl:choose>
- <xsl:when test="$last-value &lt; $pre-value">
- <xsl:value-of select="$pre-value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$last-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($condition-pos-str,$div-value)">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="substring-after($condition-pos-str,$div-value)"/>
- <xsl:with-param name="last-value" select="$end-value"/>
- <xsl:with-param name="div-value" select="$div-value"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$end-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="break-row-beyond-max">
- <xsl:param name="pos"/>
- <xsl:param name="last-value"/>
- <xsl:param name="count-value"/>
- <xsl:variable name="pre-value" select="./表:分页符集/表:分页符[@表:列号 and (position() = $pos)]/@表:列号"/>
- <xsl:variable name="end-value">
- <xsl:choose>
- <xsl:when test="$last-value &lt; $pre-value">
- <xsl:value-of select="$pre-value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$last-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$pos &lt; $count-value">
- <xsl:call-template name="break-row-beyond-max">
- <xsl:with-param name="pos" select="$pos + 1"/>
- <xsl:with-param name="last-value" select="$end-value"/>
- <xsl:with-param name="count-value" select="$count-value"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$end-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-row-beyond-last">
- <xsl:param name="index-value"/>
- <xsl:param name="worksheetNo"/>
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="end-pos"/>
- <xsl:param name="total-col"/>
- <xsl:variable name="current" select="concat('R',$index-value)"/>
- <xsl:element name="table:table-row">
- <xsl:choose>
- <xsl:when test="./表:分页符集/表:分页符/@行号 = ($index-value - 1)">
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob',$worksheetNo)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro',$worksheetNo)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="contains($condition-pos-str,$current)">
- <xsl:call-template name="get-cell-span-in">
- <xsl:with-param name="row-pos" select="$index-value"/>
- <xsl:with-param name="c-start" select="1"/>
- <xsl:with-param name="c-end" select="$total-col"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <table:table-cell/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:if test="$index-value &lt; ($end-pos + 1)">
- <xsl:call-template name="get-row-beyond-last">
- <xsl:with-param name="index-value" select="$index-value + 1"/>
- <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="end-pos" select="$end-pos"/>
- <xsl:with-param name="total-col" select="$total-col"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="get-cell-span-in">
- <xsl:param name="row-pos"/>
- <xsl:param name="c-start"/>
- <xsl:param name="c-end"/>
- <xsl:param name="condition-pos-str"/>
- <xsl:variable name="current" select="concat('R',$row-pos,'C',$c-start,',')"/>
- <xsl:variable name="style-name">
- <xsl:choose>
- <xsl:when test="contains($condition-pos-str,$current)">
- <xsl:variable name="temp-str">
- <xsl:call-template name="condition-str">
- <xsl:with-param name="param-str" select="substring-before($condition-pos-str,$current)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="starts-with($temp-str, 'c')">
- <xsl:value-of select="concat('ce', substring-after($temp-str, 'c'))"/>
- </xsl:when>
- <xsl:when test="starts-with($temp-str, 'v')">
- <xsl:value-of select="concat('val', substring-after($temp-str, 'v'))"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="../表:单元格[position() = position() - 1]/@表:式样引用">
- <xsl:value-of select="../表:单元格[position() = position() - 1]/@表:式样引用 "/>
- </xsl:when>
- <xsl:when test="../@表:式样引用">
- <xsl:value-of select="../@表:式样引用"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'Default'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$c-start &lt; $c-end">
- <xsl:call-template name="get-cell-condition-in">
- <xsl:with-param name="style-name" select="$style-name"/>
- </xsl:call-template>
- <xsl:call-template name="get-cell-span-in">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="c-start" select="$c-start + 1"/>
- <xsl:with-param name="c-end" select="$c-end"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$c-start = $c-end">
- <xsl:call-template name="get-cell-condition-in">
- <xsl:with-param name="style-name" select="$style-name"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <table:table-cell/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-cell-condition-in">
- <xsl:param name="style-name"/>
- <xsl:element name="table:table-cell">
- <xsl:if test="not( contains($style-name, 'Default'))">
- <xsl:choose>
- <xsl:when test="starts-with($style-name, 'val')">
- <xsl:attribute name="table:content-validation-name"><xsl:value-of select="$style-name"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="starts-with($style-name, 'ce')">
- <xsl:attribute name="table:style-name"><xsl:value-of select="$style-name"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name"><xsl:value-of select="$style-name"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <!--chengxiuzhi0617 单元格-->
- </xsl:element>
- </xsl:template>
- <xsl:key match="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:分页符集/表:分页符[@表:列号]" name="ColBreak" use="Column"/>
- <xsl:template name="create-default-column">
- <xsl:param name="currentColumn"/>
- <xsl:param name="currentColumnNode"/>
- <xsl:param name="worksheetNo"/>
- <xsl:element name="table:table-column">
- <xsl:attribute name="table:default-cell-style-name"><xsl:call-template name="get-default-cell-style"><xsl:with-param name="currentColumnNode" select="$currentColumnNode"/></xsl:call-template></xsl:attribute>
- <xsl:choose>
- <xsl:when test="key('ColBreak', $currentColumn)">
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$worksheetNo)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('co',$worksheetNo)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <!--chengxiuzhi0617用key就错-->
- </xsl:element>
- </xsl:template>
- <xsl:template name="get-default-cell-style">
- <xsl:param name="currentColumnNode"/>
- <xsl:choose>
- <xsl:when test="$currentColumnNode">
- <xsl:choose>
- <xsl:when test="$currentColumnNode/@表:式样引用">
- <xsl:value-of select="$currentColumnNode/@表:式样引用"/>
- </xsl:when>
- <xsl:otherwise>Default</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="./表:工作表内容[@表:式样引用]">
- <xsl:value-of select="./表:工作表内容/@表:式样引用"/>
- </xsl:when>
- <xsl:otherwise>Default</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="表:行" mode="selected">
- <xsl:param name="row-pos"/>
- <xsl:param name="condition-pos-str"/>
- <xsl:choose>
- <xsl:when test="表:单元格">
- <xsl:apply-templates select="表:单元格[1]" mode="selected">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="div-value" select="'C'"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="col-pos-before" select="0"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="current" select="concat('R',$row-pos,'C')"/>
- <xsl:choose>
- <xsl:when test="contains($condition-pos-str,$current)">
- <xsl:call-template name="get-cell-span-in">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="c-start" select="1"/>
- <xsl:with-param name="c-end">
- <xsl:call-template name="condition-row-col-pos-max">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="last-value" select="0"/>
- <xsl:with-param name="div-value" select="'C'"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos" select="1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <table:table-cell/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="表:单元格" mode="selected">
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="col-pos-max"/>
- <xsl:param name="col-pos-before"/>
- <xsl:param name="row-pos"/>
- <xsl:param name="col-repeated" select="1"/>
- <xsl:variable name="col-pos">
- <xsl:choose>
- <xsl:when test="@表:列号">
- <xsl:choose>
- <xsl:when test="@表:合并列数">
- <xsl:value-of select="@表:合并列数 + @表:列号"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@表:列号"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@表:合并列数">
- <xsl:value-of select="1 + @表:合并列数 + $col-pos-before"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="1 + $col-pos-before"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="next-cell" select="following-sibling::表:单元格[1]"/>
- <xsl:variable name="maodian" select="boolean($next-cell/uof:锚点)"/>
- <xsl:variable name="cell-is-repeatable" select="not(current()/*) and not($next-cell/*) and not($next-cell/text()) and (@表:式样引用 = $next-cell/@表:式样引用) and not($next-cell/@表:列号)"/>
- <xsl:if test="$col-repeated = 1">
- <xsl:if test="@表:列号 != ($col-pos-before + 1)">
- <xsl:call-template name="get-cell-span-in">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="c-start" select="$col-pos-before + 1"/>
- <xsl:with-param name="c-end" select="@表:列号 - 1"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:element name="table:table-cell">
- <xsl:call-template name="create-table-cell-attributes">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos" select="$col-pos"/>
- <xsl:with-param name="row-pos" select="$row-pos"/>
- </xsl:call-template>
- <xsl:if test="$cell-is-repeatable">
- <xsl:apply-templates select="$next-cell" mode="selected">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-before" select="$col-pos + 1"/>
- <xsl:with-param name="col-repeated" select="$col-repeated + 1"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:call-template name="create-table-cell-content">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos" select="$col-pos"/>
- <xsl:with-param name="row-pos" select="$row-pos"/>
- </xsl:call-template>
- </xsl:element>
- <xsl:if test="@表:合并列数">
- <xsl:element name="table:covered-table-cell">
- <xsl:if test="@表:合并列数 &gt; 1">
- <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="@表:合并列数"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="not($cell-is-repeatable and $col-repeated = 1)">
- <xsl:choose>
- <xsl:when test="not($cell-is-repeatable) and $col-repeated &gt; 1">
- <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$col-repeated"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="not($next-cell)">
- <xsl:if test="../../../../../表:公用处理规则/表:条件格式化集/表:条件格式化">
- <xsl:call-template name="get-cell-span-in">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="c-start" select="$col-pos"/>
- <xsl:with-param name="c-end" select="$col-pos-max"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:when test="not($cell-is-repeatable)">
- <xsl:apply-templates select="$next-cell" mode="selected">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-before" select="$col-pos"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="$next-cell" mode="selected">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-before" select="$col-pos"/>
- <xsl:with-param name="col-repeated" select="$col-repeated + 1"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$next-cell">
- <xsl:apply-templates select="$next-cell" mode="skip">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-before" select="$col-pos"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--Redoffice comment liliang sc0012 06.02.15-->
- <!--新增内容-->
- <xsl:template match="uof:锚点">
- <xsl:variable name="tuxing1" select="@uof:图形引用"/>
- <xsl:choose>
- <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]">
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='png' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='ipg' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='gif'">
- <xsl:element name="draw:frame">
- <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::uof:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="rotate-angle">
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- <xsl:apply-templates select="图:文本内容/字:文字表"/>
- </xsl:if>
- </xsl:for-each>
- <xsl:element name="draw:image">
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
- <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符= $tuxing1]/uof:路径"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据">
- <office:binary-data>
- <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据"/>
- </office:binary-data>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:when>
- <xsl:when test="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:文本内容[@图:文本框='true']">
- <draw:text-box text:anchor-type="paragraph">
- <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
- <xsl:if test="@uof:x坐标">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@uof:y坐标">
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="/uof:UOF/uof:对象集/图:图形/@图:层次"/></xsl:attribute>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:段落"/>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:文字表"/>
- </draw:text-box>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="graph">
- <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]"/>
- <xsl:with-param name="groupx" select="0"/>
- <xsl:with-param name="groupy" select="0"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="graph">
- <xsl:param name="id"/>
- <xsl:param name="groupx"/>
- <xsl:param name="groupy"/>
- <xsl:for-each select="$id">
- <xsl:variable name="tuxing1">
- <xsl:value-of select="图:预定义图形/图:类别"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$tuxing1='11'">
- <xsl:call-template name="Rectangle">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='19'">
- <xsl:call-template name="Oval">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='61'">
- <xsl:call-template name="Line">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='64'">
- <xsl:call-template name="Curve">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='65'">
- <xsl:call-template name="Freeform">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='66'">
- <xsl:call-template name="Scribble">
- <xsl:with-param name="groupx1" select="$groupx"/>
- <xsl:with-param name="groupy1" select="$groupy"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$tuxing1='4'">
- <xsl:element name="draw:g">
- <xsl:variable name="tu">
- <xsl:value-of select="@图:标识符"/>
- </xsl:variable>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="$tu"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:variable name="this-group-x">
- <xsl:choose>
- <xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:x坐标">
- <xsl:value-of select="key('rel_graphic_name',@图:标识符)/@uof:x坐标"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number(0)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="this-group-y">
- <xsl:choose>
- <xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:y坐标">
- <xsl:value-of select="key('rel_graphic_name',@图:标识符)/@uof:y坐标"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="number(0)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="group-x">
- <xsl:value-of select="number($groupx + $this-group-x)"/>
- </xsl:variable>
- <xsl:variable name="group-y">
- <xsl:value-of select="number($groupy + $this-group-y)"/>
- </xsl:variable>
- <xsl:call-template name="组合图形">
- <xsl:with-param name="zuheliebiao" select="@图:组合列表"/>
- <xsl:with-param name="groupx1" select="$group-x"/>
- <xsl:with-param name="groupy1" select="$group-y"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="common">
- <xsl:param name="groupx"/>
- <xsl:param name="groupy"/>
- <xsl:variable name="tuxing">
- <xsl:value-of select="@图:标识符"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:x坐标">
- <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
- <xsl:if test="@uof:x坐标">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@uof:y坐标">
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="tuxing1" select="@uof:图形引用"/>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="zuheweizhi-x">
- <xsl:value-of select="图:组合位置/@图:x坐标"/>
- </xsl:variable>
- <xsl:variable name="zuheweizhi-y">
- <xsl:value-of select="图:组合位置/@图:y坐标"/>
- </xsl:variable>
- <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(($groupx + $zuheweizhi-x),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(($groupy + $zuheweizhi-y),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(图:预定义图形/图:属性 /图:高度,$uofUnit)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="rotate-angle">
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- <xsl:apply-templates select="图:文本内容/字:文字表"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="组合图形">
- <xsl:param name="zuheliebiao"/>
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:variable name="x">
- <xsl:value-of select="$groupx1"/>
- </xsl:variable>
- <xsl:variable name="y">
- <xsl:value-of select="$groupy1"/>
- </xsl:variable>
- <xsl:variable name="first-pictures">
- <xsl:value-of select="substring-before($zuheliebiao,',')"/>
- </xsl:variable>
- <xsl:variable name="other-pictures">
- <xsl:value-of select="substring-after($zuheliebiao,',')"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($other-pictures,',')">
- <xsl:call-template name="graph">
- <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $first-pictures]"/>
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- <xsl:call-template name="组合图形">
- <xsl:with-param name="zuheliebiao" select="$other-pictures"/>
- <xsl:with-param name="groupx1" select="$x"/>
- <xsl:with-param name="groupy1" select="$y"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="graph">
- <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $first-pictures]"/>
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- <xsl:call-template name="graph">
- <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $other-pictures]"/>
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="Curve">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:path">
- <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
- <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
- <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
- <xsl:attribute name="svg:d"><xsl:value-of select="图:预定义图形/图:关键点坐标/@图:路径"/></xsl:attribute>
- <xsl:call-template name="common">
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Freeform">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:polygon">
- <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
- <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
- <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
- <xsl:attribute name="draw:points"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="图:预定义图形/图:关键点坐标/@图:路径"/><xsl:with-param name="value"/></xsl:call-template></xsl:attribute>
- <xsl:call-template name="common">
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Scribble">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:polyline">
- <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
- <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
- <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
- <xsl:attribute name="draw:points"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="图:预定义图形/图:关键点坐标/@图:路径"/><xsl:with-param name="value"/></xsl:call-template></xsl:attribute>
- <xsl:call-template name="common">
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="drawpoints">
- <xsl:param name="points"/>
- <xsl:param name="value"/>
- <xsl:variable name="frist-piont">
- <xsl:value-of select="substring-before($points,'lineto')"/>
- </xsl:variable>
- <xsl:variable name="other-points">
- <xsl:value-of select="substring-after($points,'lineto')"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($other-points,'lineto')">
- <xsl:variable name="x-coor">
- <xsl:value-of select="substring-before($frist-piont,' ') * 1000"/>
- </xsl:variable>
- <xsl:variable name="y-coor">
- <xsl:value-of select="substring-after($frist-piont,' ') * 1000"/>
- </xsl:variable>
- <xsl:variable name="all-points">
- <xsl:value-of select="concat($value,$x-coor,',',$y-coor,' ')"/>
- </xsl:variable>
- <xsl:call-template name="drawpoints">
- <xsl:with-param name="points" select="$other-points"/>
- <xsl:with-param name="value" select="$all-points"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="q-x-coor">
- <xsl:value-of select="substring-before($frist-piont,' ') * 1000"/>
- </xsl:variable>
- <xsl:variable name="q-y-coor">
- <xsl:value-of select="substring-after($frist-piont,' ') * 1000"/>
- </xsl:variable>
- <xsl:variable name="e-x-coor">
- <xsl:value-of select="substring-before($other-points,' ') * 1000"/>
- </xsl:variable>
- <xsl:variable name="e-y-coor">
- <xsl:value-of select="substring-after($other-points,' ') * 1000"/>
- </xsl:variable>
- <xsl:value-of select="concat($value,$q-x-coor,',',$q-y-coor,' ',$e-x-coor,',',$e-y-coor)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="Oval">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:ellipse">
- <xsl:call-template name="common">
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Rectangle">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:rect">
- <xsl:call-template name="common">
- <xsl:with-param name="groupx" select="$groupx1"/>
- <xsl:with-param name="groupy" select="$groupy1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Line">
- <xsl:param name="groupx1"/>
- <xsl:param name="groupy1"/>
- <xsl:element name="draw:line">
- <xsl:variable name="tuxing1" select="@图:标识符"/>
- <xsl:choose>
- <xsl:when test="key('rel_graphic_name',@图:标识符)">
- <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
- <xsl:attribute name="svg:x1"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y1"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:x2"><xsl:value-of select="concat((number(@uof:x坐标) + number(@uof:宽度)),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y2"><xsl:value-of select="concat((number(@uof:y坐标) + number(@uof:高度)),$uofUnit)"/></xsl:attribute>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="zuheweizhi-x">
- <xsl:value-of select="图:组合位置/@图:x坐标"/>
- </xsl:variable>
- <xsl:variable name="zuheweizhi-y">
- <xsl:value-of select="图:组合位置/@图:y坐标"/>
- </xsl:variable>
- <xsl:variable name="hex">
- <xsl:value-of select="concat(number($groupx1 + $zuheweizhi-x),$uofUnit)"/>
- </xsl:variable>
- <xsl:variable name="hey">
- <xsl:value-of select="concat(number($groupy1 + $zuheweizhi-y),$uofUnit)"/>
- </xsl:variable>
- <xsl:attribute name="svg:x1"><xsl:value-of select="$hex"/></xsl:attribute>
- <xsl:attribute name="svg:y1"><xsl:value-of select="$hey"/></xsl:attribute>
- <xsl:attribute name="svg:x2"><xsl:value-of select="concat(($hex + 图:预定义图形/图:属性/图:宽度),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y2"><xsl:value-of select="concat(($hey + 图:预定义图形/图:属性/图:高度),$uofUnit)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="rotate-angle">
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- <xsl:apply-templates select="图:文本内容/字:文字表"/>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <!--Redoffice comment liliang end 06.02.15-->
- <xsl:template match="表:单元格" mode="skip">
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="col-pos-max"/>
- <xsl:param name="col-pos-before"/>
- <xsl:param name="row-pos"/>
- <xsl:variable name="next-cell" select="following-sibling::表:单元格[1]"/>
- <xsl:variable name="cell-is-repeatable" select="not($next-cell/*) and not($next-cell/text()) and (@表:式样引用 = $next-cell/@表:式样引用) and not($next-cell/@表:列号)"/>
- <xsl:choose>
- <xsl:when test="$cell-is-repeatable">
- <xsl:apply-templates select="$next-cell" mode="skip">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-before" select="$col-pos-before + 1"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$next-cell">
- <xsl:apply-templates select="$next-cell" mode="selected">
- <xsl:with-param name="row-pos" select="$row-pos"/>
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
- <xsl:with-param name="col-pos-before" select="$col-pos-before +1"/>
- </xsl:apply-templates>
- <!--chengxz0925 no otherwise ,some content cells missed -->
- </xsl:if>
- <!--chengxz 060418 add if sentence-->
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--xsl:template name="create-table-cell-attributes"></xsl:template>
+ <!--xsl:template name="break-row-beyond-max"></xsl:template-->
+ <!-- chengxz有问题-->
+ <xsl:template name="create-columns-without-input">
+ <xsl:param name="table-pos"/>
+ <xsl:variable name="rowpath" select="表:工作表内容/表:行"/>
+ <xsl:variable name="colpath" select="表:工作表内容/表:列"/>
+ <xsl:choose>
+ <xsl:when test="./表:分页符集/表:分页符[@表:列号]">
+ <xsl:for-each select="./表:分页符集/表:分页符[@表:列号]">
+ <xsl:variable name="number-repeated">
+ <xsl:choose>
+ <xsl:when test="position() = 1">
+ <xsl:value-of select="./@表:列号"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./@表:列号 - preceding::表:分页符[@表:列号 and (position()=count(.))]/@表:列号 - 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$number-repeated &gt; 0">
+ <xsl:element name="table:table-column">
+ <xsl:if test="ancestor::表:工作表/表:工作表内容/@表:式样引用">
+ <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="ancestor::表:工作表/表:工作表内容/@表:式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="($colpath/@表:隐藏 = '1') or ($colpath/@表:隐藏 = 'true')">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('co',$table-pos)"/></xsl:attribute>
+ <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$number-repeated"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="table:table-column">
+ <xsl:if test="ancestor::表:工作表/表:工作表内容/@表:式样引用">
+ <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="ancestor::表:工作表/表:工作表内容/@表:式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="($colpath/@表:隐藏 = '1') or ($colpath/@表:隐藏 = 'true')">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$table-pos)"/></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="table:table-column">
+ <xsl:choose>
+ <xsl:when test="表:工作表内容/@表:式样引用">
+ <xsl:attribute name="table:style-name"><xsl:value-of select="表:工作表内容/@表:式样引用"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name"><xsl:text>co1</xsl:text></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="表:工作表内容/@表:最大列 and 表:工作表内容/@表:最大列 > 0">
+ <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="表:工作表内容/@表:最大列"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:default-cell-style-name"><xsl:text>Default</xsl:text></xsl:attribute>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="create-columns">
+ <xsl:param name="columnCount"/>
+ <xsl:param name="currentColumn" select="1"/>
+ <xsl:param name="finishedColumns" select="0"/>
+ <xsl:param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
+ <xsl:param name="currentColumnNode"/>
+ <xsl:choose>
+ <xsl:when test="$finishedColumns &lt; $columnCount">
+ <xsl:choose>
+ <xsl:when test="$currentColumnNode">
+ <xsl:choose>
+ <xsl:when test="$currentColumnNode/@表:列号 - $finishedColumns &gt; 1">
+ <xsl:call-template name="create-default-column">
+ <xsl:with-param name="currentColumn" select="$currentColumn"/>
+ <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ <xsl:call-template name="create-columns">
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="currentColumn" select="$currentColumn"/>
+ <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
+ <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="table:table-column">
+ <xsl:if test="($currentColumnNode/@表:隐藏 = '1') or ($currentColumnNode/@表:隐藏 = 'true')">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$currentColumnNode/@表:跨度">
+ <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$currentColumnNode/@表:跨度 + 1"/></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="key('ColBreak', $currentColumn)">
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob', $worksheetNo, '-', $currentColumn)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('co', $worksheetNo, '-', $currentColumn)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:call-template name="create-columns">
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="currentColumn" select="$currentColumn + 1"/>
+ <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
+ <xsl:with-param name="currentColumnNode" select="表:工作表属性/表:列[$currentColumn + 1]"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="create-default-column">
+ <xsl:with-param name="currentColumn" select="$currentColumn"/>
+ <xsl:with-param name="currentColumnNode" select="$currentColumnNode"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ <xsl:call-template name="create-columns">
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="currentColumn" select="$currentColumn"/>
+ <xsl:with-param name="finishedColumns" select="$finishedColumns + 1"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$currentColumn = $columnCount">
+ <xsl:if test="表:分页符集/表:分页符/@表:列号 &gt; $finishedColumns">
+ <xsl:call-template name="get-column-beyond-last">
+ <xsl:with-param name="index-value" select="$finishedColumns"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-column-beyond-last">
+ <xsl:param name="index-value"/>
+ <xsl:param name="worksheetNo"/>
+ <xsl:for-each select="表:分页符集/表:分页符[@表:列号]">
+ <xsl:variable name="each-column-value" select="@表:列号"/>
+ <xsl:choose>
+ <xsl:when test="$each-column-value + 1 &gt; $index-value">
+ <xsl:variable name="number-repeated">
+ <xsl:choose>
+ <xsl:when test="preceding-sibling::表:分页符[@表:列号][position()=count(.)]/@表:列号 + 1 = $index-value">
+ <xsl:value-of select="$each-column-value - preceding-sibling::表:分页符[@表:列号 and (position()=count(.))]/@表:列号 - 1"/>
+ </xsl:when>
+ <xsl:when test="preceding-sibling::表:分页符[@表:列号 and (position()=count(.))]/@表:列号 + 1 &gt; $index-value">
+ <xsl:value-of select="$each-column-value - preceding-sibling::表:分页符[@表:列号][position()=count(.)]/@表:列号 - 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$each-column-value - $index-value + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$number-repeated &gt; 0">
+ <xsl:element name="table:table-column">
+ <xsl:attribute name="table:style-name"><xsl:value-of select="'co1'"/></xsl:attribute>
+ <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$number-repeated"/></xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="table:table-column">
+ <xsl:if test="../../表:工作表内容[@表:式样引用]">
+ <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="./表:工作表内容/@表:式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$worksheetNo)"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="$each-column-value + 1 = $index-value">
+ <xsl:element name="table:table-column">
+ <xsl:if test="/../../表:工作表内容[@表:式样引用]">
+ <xsl:attribute name="table:default-cell-style-name"><xsl:value-of select="./../../表:工作表内容/@表:式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$worksheetNo)"/></xsl:attribute>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="condition-row-column-string">
+ <xsl:param name="last"/>
+ <xsl:param name="total"/>
+ <xsl:param name="index"/>
+ <xsl:variable name="table-pos" select="count(preceding-sibling::表:工作表)+1"/>
+ <xsl:variable name="current">
+ <xsl:call-template name="parse-range">
+ <xsl:with-param name="range-value" select="../../表:公用处理规则/表:条件格式化集/表:条件格式化[position() = $index]/表:范围"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="current-value" select="concat('(c',$table-pos,'-',$index,':', $current,');')"/>
+ <xsl:if test="$index &lt; $total">
+ <xsl:call-template name="condition-row-column-string">
+ <xsl:with-param name="last" select="concat($last, $current-value)"/>
+ <xsl:with-param name="total" select="$total"/>
+ <xsl:with-param name="index" select="$index + 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$index = $total">
+ <xsl:value-of select="concat($last, $current-value)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="validation-row-column-string">
+ <xsl:param name="last"/>
+ <xsl:param name="total"/>
+ <xsl:param name="index"/>
+ <xsl:variable name="table-pos" select="count(preceding-sibling::表:工作表)+1"/>
+ <xsl:variable name="current">
+ <xsl:call-template name="parse-range">
+ <xsl:with-param name="range-value" select="../../表:公用处理规则/表:数据有效性集/表:数据有效性[position() = $index]/表:范围"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="current-value" select="concat('(v',$index,':', $current,');')"/>
+ <xsl:if test="$index &lt; $total">
+ <xsl:call-template name="validation-row-column-string">
+ <xsl:with-param name="last" select="concat($last, $current-value)"/>
+ <xsl:with-param name="total" select="$total"/>
+ <xsl:with-param name="index" select="$index + 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$index = $total">
+ <xsl:value-of select="concat($last, $current-value)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="create-rows">
+ <xsl:param name="lastrowpos"/>
+ <xsl:param name="row-count"/>
+ <xsl:param name="currentRow"/>
+ <xsl:param name="condition-pos-str"/>
+ <xsl:choose>
+ <xsl:when test="$currentRow &lt; ($row-count + 1)">
+ <xsl:variable name="span-value">
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
+ <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 - $lastrowpos + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 - $lastrowpos"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
+ <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度 + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="current-index">
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
+ <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$lastrowpos + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:分组集/表:行">
+ <xsl:for-each select="./表:工作表内容/表:分组集/表:行[1]">
+ <xsl:call-template name="table:table-row-group"/>
+ </xsl:for-each>
+ <xsl:for-each select="./表:工作表内容/表:行[not(@表:行号)]">
+ <xsl:call-template name="create-row">
+ <xsl:with-param name="index-value" select="$lastrowpos"/>
+ <xsl:with-param name="span-value" select="$span-value"/>
+ <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
+ <xsl:with-param name="row-value" select="$currentRow"/>
+ <xsl:with-param name="times" select="1"/>
+ <xsl:with-param name="current-index" select="$current-index"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="./表:工作表内容/表:分组集 and ( ./表:工作表内容/表:分组集/表:行/@表:起始 &gt;= ($currentRow - 1) and ($currentRow - 1) &lt;= ./表:工作表内容/表:分组集/表:行/@表:终止 )">
+ <xsl:element name="table:table-row-group">
+ <xsl:variable name="TempStart">
+ <xsl:value-of select="./表:工作表内容/表:分组集/表:行/@表:起始"/>
+ </xsl:variable>
+ <xsl:variable name="TempEnd">
+ <xsl:value-of select="./表:工作表内容/表:分组集/表:行/@表:终止"/>
+ </xsl:variable>
+ <xsl:for-each select="./表:工作表内容/表:行">
+ <xsl:if test="$TempStart &gt;= ($currentRow - 1) and ($currentRow - 1) &lt;= $TempEnd">
+ <xsl:call-template name="create-row">
+ <xsl:with-param name="index-value" select="$lastrowpos"/>
+ <xsl:with-param name="span-value" select="$span-value"/>
+ <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
+ <xsl:with-param name="row-value" select="$currentRow"/>
+ <xsl:with-param name="times" select="1"/>
+ <xsl:with-param name="current-index" select="$current-index"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="create-row">
+ <xsl:with-param name="index-value" select="$lastrowpos"/>
+ <xsl:with-param name="span-value" select="$span-value"/>
+ <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
+ <xsl:with-param name="row-value" select="$currentRow"/>
+ <xsl:with-param name="times" select="1"/>
+ <xsl:with-param name="current-index" select="$current-index"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ <xsl:if test="$currentRow &lt; $row-count">
+ <xsl:call-template name="create-rows">
+ <xsl:with-param name="lastrowpos">
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
+ <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
+ <xsl:value-of select="$lastrowpos + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度 + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$lastrowpos + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="row-count" select="$row-count"/>
+ <xsl:with-param name="currentRow" select="$currentRow + 1"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$currentRow = $row-count">
+ <xsl:variable name="last-pos">
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:行号">
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
+ <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号 + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./表:工作表内容/表:行[position() = $currentRow]/@表:行号"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $currentRow]/@表:跨度">
+ <xsl:value-of select="$lastrowpos + ./表:工作表内容/表:行[position() = $currentRow]/@表:跨度 + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$lastrowpos + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="./表:分页符集/表:分页符/@表:行号 &gt; ($last-pos - 1) or ../../表:公用处理规则/表:条件格式化集/表:条件格式化">
+ <xsl:variable name="condition-row-max">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="div-value" select="'R'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="condition-col-max">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="div-value" select="'C'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="break-row-max">
+ <xsl:call-template name="break-row-beyond-max">
+ <xsl:with-param name="pos" select="1"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="count-value" select="count(./表:分页符集/表:分页符[@表:行号])"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="end-value">
+ <xsl:choose>
+ <xsl:when test="$condition-row-max &lt; $break-row-max">
+ <xsl:value-of select="$break-row-max"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$condition-row-max"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="get-row-beyond-last">
+ <xsl:with-param name="index-value" select="$last-pos + 1"/>
+ <xsl:with-param name="worksheetNo" select="count(preceding-sibling::表:工作表)+1"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="end-pos" select="$end-value"/>
+ <xsl:with-param name="total-col" select="$condition-col-max"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="./表:工作表内容/表:列[@表:式样引用] or ./表:工作表内容[@表:式样引用]">
+ <table:table-row table:style-name="ro1" table:number-rows-repeated="31990">
+ <table:table-cell table:number-columns-repeated="256"/>
+ </table:table-row>
+ <table:table-row table:style-name="ro1">
+ <table:table-cell table:number-columns-repeated="256"/>
+ </table:table-row>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <!-- add row-group 2.6-->
+ <xsl:template name="table:table-row-group">
+ <xsl:param name="start"/>
+ <xsl:param name="end"/>
+ <xsl:variable name="start1" select="@表:起始"/>
+ <xsl:variable name="end1" select="@表:终止"/>
+ <xsl:variable name="nextstart" select="following-sibling::表:行/@表:起始"/>
+ <xsl:variable name="nextend" select="following-sibling::表:行/@表:终止"/>
+ <xsl:variable name="prestart" select="preceding-sibling::表:行/@表:起始"/>
+ <xsl:variable name="preend" select="preceding-sibling::表:行/@表:终止"/>
+ <xsl:variable name="numrow" select="$end1 - $start1"/>
+ <xsl:variable name="position" select="position()"/>
+ <xsl:choose>
+ <xsl:when test="$nextstart &gt;= $start1 and $nextend &lt;= $end1">
+ <table:table-row-group>
+ <xsl:call-template name="creategroup"/>
+ </table:table-row-group>
+ </xsl:when>
+ <xsl:when test="$nextstart &gt;= $end1">
+ <xsl:choose>
+ <xsl:when test="$nextend &lt;=$preend">
+ <xsl:call-template name="row">
+ <xsl:with-param name="start1" select="$start1"/>
+ <xsl:with-param name="end1" select="$end1"/>
+ <xsl:with-param name="nextstart" select="$nextstart"/>
+ <xsl:with-param name="nextend" select="$nextend"/>
+ <xsl:with-param name="prestart" select="$prestart"/>
+ <xsl:with-param name="preend" select="$preend"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="levelgroup"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="row">
+ <xsl:with-param name="start1" select="$start1"/>
+ <xsl:with-param name="end1" select="$end1"/>
+ <xsl:with-param name="nextstart" select="$nextstart"/>
+ <xsl:with-param name="nextend" select="$nextend"/>
+ <xsl:with-param name="prestart" select="$prestart"/>
+ <xsl:with-param name="preend" select="$preend"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="levelrowgroup">
+ <xsl:param name="start"/>
+ <xsl:param name="end"/>
+ <xsl:variable name="start1" select="@表:起始"/>
+ <xsl:variable name="end1" select="@表:终止"/>
+ <xsl:variable name="nextstart" select="following-sibling::表:行/@表:起始"/>
+ <xsl:variable name="nextend" select="following-sibling::表:行/@表:终止"/>
+ <xsl:variable name="prestart" select="preceding-sibling::表:行/@表:起始"/>
+ <xsl:variable name="preend" select="preceding-sibling::表:行/@表:终止"/>
+ <xsl:variable name="numrow" select="$end1 - $start1"/>
+ <xsl:variable name="position" select="position()"/>
+ <xsl:call-template name="row">
+ <xsl:with-param name="start1" select="$start1"/>
+ <xsl:with-param name="end1" select="$end1"/>
+ <xsl:with-param name="nextstart" select="$nextstart"/>
+ <xsl:with-param name="nextend" select="$nextend"/>
+ <xsl:with-param name="prestart" select="$prestart"/>
+ <xsl:with-param name="preend" select="$preend"/>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template name="creategroup">
+ <xsl:for-each select="following-sibling::表:行">
+ <xsl:variable name="start1" select="@表:起始"/>
+ <xsl:variable name="end1" select="@表:终止"/>
+ <xsl:variable name="nextstart" select="following-sibling::表:行/@表:起始"/>
+ <xsl:variable name="nextend" select="following-sibling::表:行/@表:终止"/>
+ <xsl:variable name="prestart" select="preceding-sibling::表:行/@表:起始"/>
+ <xsl:variable name="preend" select="preceding-sibling::表:行/@表:终止"/>
+ <xsl:if test="$start1 &gt;= $prestart and $end1 &lt;= $preend">
+ <xsl:call-template name="table:table-row-group"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="levelgroup">
+ <xsl:for-each select="parent::表:分组集/表:行">
+ <xsl:call-template name="levelrowgroup"/>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="row">
+ <xsl:param name="start1"/>
+ <xsl:param name="end1"/>
+ <xsl:param name="nextstart"/>
+ <xsl:param name="nextend"/>
+ <xsl:param name="prestart"/>
+ <xsl:param name="preend"/>
+ <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
+ <xsl:variable name="rownum" select="@表:行号"/>
+ <xsl:variable name="aa" select="$start1 - $prestart"/>
+ <xsl:if test="$rownum &gt;= $prestart and $rownum &lt;= ($prestart + $aa - 1) and $start1 &lt;= $preend">
+ <table:table-row>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
+ <xsl:call-template name="celldata"/>
+ </table:table-row>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
+ <xsl:variable name="rownum" select="@表:行号"/>
+ <xsl:variable name="ss" select="$start1 - $preend"/>
+ <xsl:if test="$rownum &gt;= ($preend +1) and $rownum &lt;= ($preend + $ss - 1) and $start1 &gt;= $preend">
+ <table:table-row>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
+ <xsl:call-template name="celldata"/>
+ </table:table-row>
+ </xsl:if>
+ </xsl:for-each>
+ <table:table-row-group>
+ <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
+ <xsl:variable name="rownum" select="@表:行号"/>
+ <xsl:if test="$rownum &lt;= $end1">
+ <xsl:if test="$rownum &gt;= $start1">
+ <table:table-row>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
+ <xsl:call-template name="celldata"/>
+ </table:table-row>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </table:table-row-group>
+ <xsl:for-each select="ancestor::表:工作表内容/表:行[@表:行号]">
+ <xsl:variable name="rownum" select="@表:行号"/>
+ <xsl:variable name="bb" select="$preend - $end1"/>
+ <xsl:if test="$rownum &gt;= ($end1 + 1) and $rownum &lt;= ($end1 + $bb) and $start1 &lt; $preend">
+ <table:table-row>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="@表:式样引用"/></xsl:attribute>
+ <xsl:call-template name="celldata"/>
+ </table:table-row>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="celldata">
+ <xsl:for-each select="./表:单元格">
+ <table:table-cell>
+ <xsl:choose>
+ <xsl:when test="表:数据/@表:数据类型 = 'number'">
+ <xsl:attribute name="office:value-type">float</xsl:attribute>
+ <xsl:attribute name="office:value"><xsl:choose><xsl:when test="表:数据/@表:数据数值"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:when><xsl:otherwise><xsl:value-of select="表:数据/字:句/字:文本串"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:数据/@表:数据类型 = 'date'">
+ <xsl:attribute name="office:value-type">date</xsl:attribute>
+ <xsl:attribute name="table:date-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:数据/@表:数据类型 = 'time'">
+ <xsl:attribute name="office:value-type">time</xsl:attribute>
+ <xsl:attribute name="table:time-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:数据/@表:数据类型 = 'boolean'">
+ <xsl:attribute name="office:value-type">boolean</xsl:attribute>
+ <xsl:attribute name="table:boolean-value"><xsl:choose><xsl:when test="表:数据/字:句/字:文本串 = '1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:数据/@表:数据类型 = 'text'">
+ <xsl:attribute name="office:value-type">string</xsl:attribute>
+ <xsl:attribute name="table:string-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="表:数据/字:句/字:文本串">
+ <text:p>
+ <xsl:value-of select="表:数据/字:句/字:文本串"/>
+ </text:p>
+ </xsl:if>
+ </table:table-cell>
+ </xsl:for-each>
+ </xsl:template>
+ <!-- add row-group 2.8 -->
+ <xsl:template name="create-row">
+ <xsl:param name="index-value"/>
+ <xsl:param name="span-value"/>
+ <xsl:param name="worksheetNo"/>
+ <xsl:param name="row-value"/>
+ <xsl:param name="times"/>
+ <xsl:param name="current-index"/>
+ <xsl:param name="condition-pos-str"/>
+ <xsl:element name="table:table-row">
+ <xsl:choose>
+ <xsl:when test="./表:分页符集/表:分页符/@表:行号 = ($index-value + $times - 1)">
+ <xsl:choose>
+ <xsl:when test="($index-value + $times &lt; $current-index) and ($current-index != 0)">
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob',$worksheetNo)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob', $worksheetNo, '-', $row-value)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="($index-value + $times &lt; $current-index) and ($current-index != 0)">
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro',$worksheetNo)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro', $worksheetNo, '-', $row-value)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!--chengxiuzhi0617-->
+ <xsl:if test="./表:工作表内容/表:行[position() = $row-value]/@表:隐藏 = 'true'">
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容/表:行[position() = $row-value]/@表:跨度">
+ <xsl:if test="$index-value + $times &gt; ($current-index - 1)">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$index-value + $times = $current-index">
+ <xsl:attribute name="table:visibility">collapse</xsl:attribute>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="not(./表:工作表内容/表:行[position() = $row-value]/*)">
+ <table:table-cell>
+ <xsl:for-each select="./表:单元格/表:数据">
+ <xsl:choose>
+ <xsl:when test="@表:数据类型 = 'number'">
+ <xsl:attribute name="office:value-type">float</xsl:attribute>
+ <xsl:attribute name="office:value"><xsl:choose><xsl:when test="@表:数据数值"><xsl:value-of select="@表:数据数值"/></xsl:when><xsl:otherwise><xsl:value-of select="字:句/字:文本串"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@表:数据类型 = 'date'">
+ <xsl:attribute name="office:value-type">date</xsl:attribute>
+ <xsl:attribute name="table:date-value"><xsl:value-of select="@表:数据数值"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@表:数据类型 = 'time'">
+ <xsl:attribute name="office:value-type">time</xsl:attribute>
+ <xsl:attribute name="table:time-value"><xsl:value-of select="@表:数据数值"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@表:数据类型 = 'boolean'">
+ <xsl:attribute name="office:value-type">boolean</xsl:attribute>
+ <xsl:attribute name="table:boolean-value"><xsl:choose><xsl:when test="字:句/字:文本串 = '1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@表:数据类型 = 'text'">
+ <xsl:attribute name="office:value-type">string</xsl:attribute>
+ <xsl:attribute name="table:string-value"><xsl:value-of select="@表:数据数值"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="字:句/字:文本串">
+ <text:p>
+ <xsl:value-of select="字:句/字:文本串"/>
+ </text:p>
+ </xsl:if>
+ </xsl:for-each>
+ </table:table-cell>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$index-value + $times &lt; $current-index">
+ <xsl:variable name="current" select="concat('R',($index-value + $times),'C')"/>
+ <xsl:variable name="col-pos-max">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="div-value" select="'C'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($condition-pos-str,$current)">
+ <xsl:call-template name="get-cell-span-in">
+ <xsl:with-param name="row-pos" select="$index-value + $times"/>
+ <xsl:with-param name="c-start" select="1"/>
+ <xsl:with-param name="c-end" select="$col-pos-max"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <table:table-cell/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$index-value + $times = $current-index">
+ <xsl:apply-templates select="表:工作表内容/表:行[position() = $row-value]" mode="selected">
+ <xsl:with-param name="row-pos" select="$index-value + $times"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <table:table-cell/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="$times &lt; $span-value">
+ <xsl:call-template name="create-row">
+ <xsl:with-param name="index-value" select="$index-value"/>
+ <xsl:with-param name="span-value" select="$span-value"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ <xsl:with-param name="row-value" select="$row-value"/>
+ <xsl:with-param name="times" select="$times + 1"/>
+ <xsl:with-param name="current-index" select="$current-index"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="condition-row-col-pos-max">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="last-value"/>
+ <xsl:param name="div-value"/>
+ <xsl:variable name="pre-value">
+ <xsl:choose>
+ <xsl:when test="$div-value = 'R'">
+ <xsl:value-of select="substring-before(substring-after($condition-pos-str,$div-value),'C')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before(substring-after($condition-pos-str,$div-value),',')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="end-value">
+ <xsl:choose>
+ <xsl:when test="$last-value &lt; $pre-value">
+ <xsl:value-of select="$pre-value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$last-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($condition-pos-str,$div-value)">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="substring-after($condition-pos-str,$div-value)"/>
+ <xsl:with-param name="last-value" select="$end-value"/>
+ <xsl:with-param name="div-value" select="$div-value"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$end-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="break-row-beyond-max">
+ <xsl:param name="pos"/>
+ <xsl:param name="last-value"/>
+ <xsl:param name="count-value"/>
+ <xsl:variable name="pre-value" select="./表:分页符集/表:分页符[@表:列号 and (position() = $pos)]/@表:列号"/>
+ <xsl:variable name="end-value">
+ <xsl:choose>
+ <xsl:when test="$last-value &lt; $pre-value">
+ <xsl:value-of select="$pre-value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$last-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$pos &lt; $count-value">
+ <xsl:call-template name="break-row-beyond-max">
+ <xsl:with-param name="pos" select="$pos + 1"/>
+ <xsl:with-param name="last-value" select="$end-value"/>
+ <xsl:with-param name="count-value" select="$count-value"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$end-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-row-beyond-last">
+ <xsl:param name="index-value"/>
+ <xsl:param name="worksheetNo"/>
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="end-pos"/>
+ <xsl:param name="total-col"/>
+ <xsl:variable name="current" select="concat('R',$index-value)"/>
+ <xsl:element name="table:table-row">
+ <xsl:choose>
+ <xsl:when test="./表:分页符集/表:分页符/@行号 = ($index-value - 1)">
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('rob',$worksheetNo)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('ro',$worksheetNo)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="contains($condition-pos-str,$current)">
+ <xsl:call-template name="get-cell-span-in">
+ <xsl:with-param name="row-pos" select="$index-value"/>
+ <xsl:with-param name="c-start" select="1"/>
+ <xsl:with-param name="c-end" select="$total-col"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <table:table-cell/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:if test="$index-value &lt; ($end-pos + 1)">
+ <xsl:call-template name="get-row-beyond-last">
+ <xsl:with-param name="index-value" select="$index-value + 1"/>
+ <xsl:with-param name="worksheetNo" select="$worksheetNo"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="end-pos" select="$end-pos"/>
+ <xsl:with-param name="total-col" select="$total-col"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="get-cell-span-in">
+ <xsl:param name="row-pos"/>
+ <xsl:param name="c-start"/>
+ <xsl:param name="c-end"/>
+ <xsl:param name="condition-pos-str"/>
+ <xsl:variable name="current" select="concat('R',$row-pos,'C',$c-start,',')"/>
+ <xsl:variable name="style-name">
+ <xsl:choose>
+ <xsl:when test="contains($condition-pos-str,$current)">
+ <xsl:variable name="temp-str">
+ <xsl:call-template name="condition-str">
+ <xsl:with-param name="param-str" select="substring-before($condition-pos-str,$current)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="starts-with($temp-str, 'c')">
+ <xsl:value-of select="concat('ce', substring-after($temp-str, 'c'))"/>
+ </xsl:when>
+ <xsl:when test="starts-with($temp-str, 'v')">
+ <xsl:value-of select="concat('val', substring-after($temp-str, 'v'))"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="../表:单元格[position() = position() - 1]/@表:式样引用">
+ <xsl:value-of select="../表:单元格[position() = position() - 1]/@表:式样引用 "/>
+ </xsl:when>
+ <xsl:when test="../@表:式样引用">
+ <xsl:value-of select="../@表:式样引用"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'Default'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$c-start &lt; $c-end">
+ <xsl:call-template name="get-cell-condition-in">
+ <xsl:with-param name="style-name" select="$style-name"/>
+ </xsl:call-template>
+ <xsl:call-template name="get-cell-span-in">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="c-start" select="$c-start + 1"/>
+ <xsl:with-param name="c-end" select="$c-end"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$c-start = $c-end">
+ <xsl:call-template name="get-cell-condition-in">
+ <xsl:with-param name="style-name" select="$style-name"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <table:table-cell/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-cell-condition-in">
+ <xsl:param name="style-name"/>
+ <xsl:element name="table:table-cell">
+ <xsl:if test="not( contains($style-name, 'Default'))">
+ <xsl:choose>
+ <xsl:when test="starts-with($style-name, 'val')">
+ <xsl:attribute name="table:content-validation-name"><xsl:value-of select="$style-name"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="starts-with($style-name, 'ce')">
+ <xsl:attribute name="table:style-name"><xsl:value-of select="$style-name"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="$style-name"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <!--chengxiuzhi0617 单元格-->
+ </xsl:element>
+ </xsl:template>
+ <xsl:key match="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:分页符集/表:分页符[@表:列号]" name="ColBreak" use="Column"/>
+ <xsl:template name="create-default-column">
+ <xsl:param name="currentColumn"/>
+ <xsl:param name="currentColumnNode"/>
+ <xsl:param name="worksheetNo"/>
+ <xsl:element name="table:table-column">
+ <xsl:attribute name="table:default-cell-style-name"><xsl:call-template name="get-default-cell-style"><xsl:with-param name="currentColumnNode" select="$currentColumnNode"/></xsl:call-template></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="key('ColBreak', $currentColumn)">
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('cob',$worksheetNo)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('co',$worksheetNo)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!--chengxiuzhi0617用key就错-->
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="get-default-cell-style">
+ <xsl:param name="currentColumnNode"/>
+ <xsl:choose>
+ <xsl:when test="$currentColumnNode">
+ <xsl:choose>
+ <xsl:when test="$currentColumnNode/@表:式样引用">
+ <xsl:value-of select="$currentColumnNode/@表:式样引用"/>
+ </xsl:when>
+ <xsl:otherwise>Default</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="./表:工作表内容[@表:式样引用]">
+ <xsl:value-of select="./表:工作表内容/@表:式样引用"/>
+ </xsl:when>
+ <xsl:otherwise>Default</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="表:行" mode="selected">
+ <xsl:param name="row-pos"/>
+ <xsl:param name="condition-pos-str"/>
+ <xsl:choose>
+ <xsl:when test="表:单元格">
+ <xsl:apply-templates select="表:单元格[1]" mode="selected">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="div-value" select="'C'"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="col-pos-before" select="0"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="current" select="concat('R',$row-pos,'C')"/>
+ <xsl:choose>
+ <xsl:when test="contains($condition-pos-str,$current)">
+ <xsl:call-template name="get-cell-span-in">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="c-start" select="1"/>
+ <xsl:with-param name="c-end">
+ <xsl:call-template name="condition-row-col-pos-max">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="last-value" select="0"/>
+ <xsl:with-param name="div-value" select="'C'"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos" select="1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <table:table-cell/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="表:单元格" mode="selected">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="col-pos-max"/>
+ <xsl:param name="col-pos-before"/>
+ <xsl:param name="row-pos"/>
+ <xsl:param name="col-repeated" select="1"/>
+ <xsl:variable name="col-pos">
+ <xsl:choose>
+ <xsl:when test="@表:列号">
+ <xsl:choose>
+ <xsl:when test="@表:合并列数">
+ <xsl:value-of select="@表:合并列数 + @表:列号"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@表:列号"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="@表:合并列数">
+ <xsl:value-of select="1 + @表:合并列数 + $col-pos-before"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="1 + $col-pos-before"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="next-cell" select="following-sibling::表:单元格[1]"/>
+ <xsl:variable name="maodian" select="boolean($next-cell/uof:锚点)"/>
+ <xsl:variable name="cell-is-repeatable" select="not(current()/*) and not($next-cell/*) and not($next-cell/text()) and (@表:式样引用 = $next-cell/@表:式样引用) and not($next-cell/@表:列号)"/>
+ <xsl:if test="$col-repeated = 1">
+ <xsl:if test="@表:列号 != ($col-pos-before + 1)">
+ <xsl:call-template name="get-cell-span-in">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="c-start" select="$col-pos-before + 1"/>
+ <xsl:with-param name="c-end" select="@表:列号 - 1"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:element name="table:table-cell">
+ <xsl:call-template name="create-table-cell-attributes">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos" select="$col-pos"/>
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ </xsl:call-template>
+ <xsl:if test="$cell-is-repeatable">
+ <xsl:apply-templates select="$next-cell" mode="selected">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-before" select="$col-pos + 1"/>
+ <xsl:with-param name="col-repeated" select="$col-repeated + 1"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ <xsl:call-template name="create-table-cell-content">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos" select="$col-pos"/>
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:if test="@表:合并列数">
+ <xsl:element name="table:covered-table-cell">
+ <xsl:if test="@表:合并列数 &gt; 1">
+ <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="@表:合并列数"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="not($cell-is-repeatable and $col-repeated = 1)">
+ <xsl:choose>
+ <xsl:when test="not($cell-is-repeatable) and $col-repeated &gt; 1">
+ <xsl:attribute name="table:number-columns-repeated"><xsl:value-of select="$col-repeated"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="not($next-cell)">
+ <xsl:if test="../../../../../表:公用处理规则/表:条件格式化集/表:条件格式化">
+ <xsl:call-template name="get-cell-span-in">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="c-start" select="$col-pos"/>
+ <xsl:with-param name="c-end" select="$col-pos-max"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="not($cell-is-repeatable)">
+ <xsl:apply-templates select="$next-cell" mode="selected">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-before" select="$col-pos"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="$next-cell" mode="selected">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-before" select="$col-pos"/>
+ <xsl:with-param name="col-repeated" select="$col-repeated + 1"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$next-cell">
+ <xsl:apply-templates select="$next-cell" mode="skip">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-before" select="$col-pos"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--Redoffice comment liliang sc0012 06.02.15-->
+ <!--新增内容-->
+ <xsl:template match="uof:锚点">
+ <xsl:variable name="tuxing1" select="@uof:图形引用"/>
+ <xsl:choose>
+ <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]">
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='png' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='ipg' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='gif'">
+ <xsl:element name="draw:frame">
+ <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::uof:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="rotate-angle">
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ <xsl:apply-templates select="图:文本内容/字:文字表"/>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:element name="draw:image">
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
+ <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符= $tuxing1]/uof:路径"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据">
+ <office:binary-data>
+ <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据"/>
+ </office:binary-data>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:文本内容[@图:文本框='true']">
+ <draw:text-box text:anchor-type="paragraph">
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:if test="@uof:x坐标">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@uof:y坐标">
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="/uof:UOF/uof:对象集/图:图形/@图:层次"/></xsl:attribute>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:段落"/>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:文字表"/>
+ </draw:text-box>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="graph">
+ <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]"/>
+ <xsl:with-param name="groupx" select="0"/>
+ <xsl:with-param name="groupy" select="0"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="graph">
+ <xsl:param name="id"/>
+ <xsl:param name="groupx"/>
+ <xsl:param name="groupy"/>
+ <xsl:for-each select="$id">
+ <xsl:variable name="tuxing1">
+ <xsl:value-of select="图:预定义图形/图:类别"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$tuxing1='11'">
+ <xsl:call-template name="Rectangle">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='19'">
+ <xsl:call-template name="Oval">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='61'">
+ <xsl:call-template name="Line">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='64'">
+ <xsl:call-template name="Curve">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='65'">
+ <xsl:call-template name="Freeform">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='66'">
+ <xsl:call-template name="Scribble">
+ <xsl:with-param name="groupx1" select="$groupx"/>
+ <xsl:with-param name="groupy1" select="$groupy"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$tuxing1='4'">
+ <xsl:element name="draw:g">
+ <xsl:variable name="tu">
+ <xsl:value-of select="@图:标识符"/>
+ </xsl:variable>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="$tu"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:variable name="this-group-x">
+ <xsl:choose>
+ <xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:x坐标">
+ <xsl:value-of select="key('rel_graphic_name',@图:标识符)/@uof:x坐标"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="number(0)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="this-group-y">
+ <xsl:choose>
+ <xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:y坐标">
+ <xsl:value-of select="key('rel_graphic_name',@图:标识符)/@uof:y坐标"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="number(0)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="group-x">
+ <xsl:value-of select="number($groupx + $this-group-x)"/>
+ </xsl:variable>
+ <xsl:variable name="group-y">
+ <xsl:value-of select="number($groupy + $this-group-y)"/>
+ </xsl:variable>
+ <xsl:call-template name="组合图形">
+ <xsl:with-param name="zuheliebiao" select="@图:组合列表"/>
+ <xsl:with-param name="groupx1" select="$group-x"/>
+ <xsl:with-param name="groupy1" select="$group-y"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="common">
+ <xsl:param name="groupx"/>
+ <xsl:param name="groupy"/>
+ <xsl:variable name="tuxing">
+ <xsl:value-of select="@图:标识符"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="key('rel_graphic_name',@图:标识符)/@uof:x坐标">
+ <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
+ <xsl:if test="@uof:x坐标">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@uof:y坐标">
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="tuxing1" select="@uof:图形引用"/>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(@uof:高度,$uofUnit)"/></xsl:attribute>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="zuheweizhi-x">
+ <xsl:value-of select="图:组合位置/@图:x坐标"/>
+ </xsl:variable>
+ <xsl:variable name="zuheweizhi-y">
+ <xsl:value-of select="图:组合位置/@图:y坐标"/>
+ </xsl:variable>
+ <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(($groupx + $zuheweizhi-x),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(($groupy + $zuheweizhi-y),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(图:预定义图形/图:属性 /图:高度,$uofUnit)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="rotate-angle">
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ <xsl:apply-templates select="图:文本内容/字:文字表"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="组合图形">
+ <xsl:param name="zuheliebiao"/>
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:variable name="x">
+ <xsl:value-of select="$groupx1"/>
+ </xsl:variable>
+ <xsl:variable name="y">
+ <xsl:value-of select="$groupy1"/>
+ </xsl:variable>
+ <xsl:variable name="first-pictures">
+ <xsl:value-of select="substring-before($zuheliebiao,',')"/>
+ </xsl:variable>
+ <xsl:variable name="other-pictures">
+ <xsl:value-of select="substring-after($zuheliebiao,',')"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($other-pictures,',')">
+ <xsl:call-template name="graph">
+ <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $first-pictures]"/>
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ <xsl:call-template name="组合图形">
+ <xsl:with-param name="zuheliebiao" select="$other-pictures"/>
+ <xsl:with-param name="groupx1" select="$x"/>
+ <xsl:with-param name="groupy1" select="$y"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="graph">
+ <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $first-pictures]"/>
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ <xsl:call-template name="graph">
+ <xsl:with-param name="id" select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $other-pictures]"/>
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="Curve">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:path">
+ <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
+ <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
+ <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
+ <xsl:attribute name="svg:d"><xsl:value-of select="图:预定义图形/图:关键点坐标/@图:路径"/></xsl:attribute>
+ <xsl:call-template name="common">
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Freeform">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:polygon">
+ <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
+ <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
+ <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
+ <xsl:attribute name="draw:points"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="图:预定义图形/图:关键点坐标/@图:路径"/><xsl:with-param name="value"/></xsl:call-template></xsl:attribute>
+ <xsl:call-template name="common">
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Scribble">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:polyline">
+ <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
+ <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
+ <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
+ <xsl:attribute name="draw:points"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="图:预定义图形/图:关键点坐标/@图:路径"/><xsl:with-param name="value"/></xsl:call-template></xsl:attribute>
+ <xsl:call-template name="common">
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="drawpoints">
+ <xsl:param name="points"/>
+ <xsl:param name="value"/>
+ <xsl:variable name="frist-piont">
+ <xsl:value-of select="substring-before($points,'lineto')"/>
+ </xsl:variable>
+ <xsl:variable name="other-points">
+ <xsl:value-of select="substring-after($points,'lineto')"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($other-points,'lineto')">
+ <xsl:variable name="x-coor">
+ <xsl:value-of select="substring-before($frist-piont,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:variable name="y-coor">
+ <xsl:value-of select="substring-after($frist-piont,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:variable name="all-points">
+ <xsl:value-of select="concat($value,$x-coor,',',$y-coor,' ')"/>
+ </xsl:variable>
+ <xsl:call-template name="drawpoints">
+ <xsl:with-param name="points" select="$other-points"/>
+ <xsl:with-param name="value" select="$all-points"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="q-x-coor">
+ <xsl:value-of select="substring-before($frist-piont,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:variable name="q-y-coor">
+ <xsl:value-of select="substring-after($frist-piont,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:variable name="e-x-coor">
+ <xsl:value-of select="substring-before($other-points,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:variable name="e-y-coor">
+ <xsl:value-of select="substring-after($other-points,' ') * 1000"/>
+ </xsl:variable>
+ <xsl:value-of select="concat($value,$q-x-coor,',',$q-y-coor,' ',$e-x-coor,',',$e-y-coor)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="Oval">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:ellipse">
+ <xsl:call-template name="common">
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Rectangle">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:rect">
+ <xsl:call-template name="common">
+ <xsl:with-param name="groupx" select="$groupx1"/>
+ <xsl:with-param name="groupy" select="$groupy1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Line">
+ <xsl:param name="groupx1"/>
+ <xsl:param name="groupy1"/>
+ <xsl:element name="draw:line">
+ <xsl:variable name="tuxing1" select="@图:标识符"/>
+ <xsl:choose>
+ <xsl:when test="key('rel_graphic_name',@图:标识符)">
+ <xsl:for-each select="key('rel_graphic_name',@图:标识符)">
+ <xsl:attribute name="svg:x1"><xsl:value-of select="concat(@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y1"><xsl:value-of select="concat(@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:x2"><xsl:value-of select="concat((number(@uof:x坐标) + number(@uof:宽度)),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y2"><xsl:value-of select="concat((number(@uof:y坐标) + number(@uof:高度)),$uofUnit)"/></xsl:attribute>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="zuheweizhi-x">
+ <xsl:value-of select="图:组合位置/@图:x坐标"/>
+ </xsl:variable>
+ <xsl:variable name="zuheweizhi-y">
+ <xsl:value-of select="图:组合位置/@图:y坐标"/>
+ </xsl:variable>
+ <xsl:variable name="hex">
+ <xsl:value-of select="concat(number($groupx1 + $zuheweizhi-x),$uofUnit)"/>
+ </xsl:variable>
+ <xsl:variable name="hey">
+ <xsl:value-of select="concat(number($groupy1 + $zuheweizhi-y),$uofUnit)"/>
+ </xsl:variable>
+ <xsl:attribute name="svg:x1"><xsl:value-of select="$hex"/></xsl:attribute>
+ <xsl:attribute name="svg:y1"><xsl:value-of select="$hey"/></xsl:attribute>
+ <xsl:attribute name="svg:x2"><xsl:value-of select="concat(($hex + 图:预定义图形/图:属性/图:宽度),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y2"><xsl:value-of select="concat(($hey + 图:预定义图形/图:属性/图:高度),$uofUnit)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="rotate-angle">
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ <xsl:apply-templates select="图:文本内容/字:文字表"/>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <!--Redoffice comment liliang end 06.02.15-->
+ <xsl:template match="表:单元格" mode="skip">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="col-pos-max"/>
+ <xsl:param name="col-pos-before"/>
+ <xsl:param name="row-pos"/>
+ <xsl:variable name="next-cell" select="following-sibling::表:单元格[1]"/>
+ <xsl:variable name="cell-is-repeatable" select="not($next-cell/*) and not($next-cell/text()) and (@表:式样引用 = $next-cell/@表:式样引用) and not($next-cell/@表:列号)"/>
+ <xsl:choose>
+ <xsl:when test="$cell-is-repeatable">
+ <xsl:apply-templates select="$next-cell" mode="skip">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-before" select="$col-pos-before + 1"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$next-cell">
+ <xsl:apply-templates select="$next-cell" mode="selected">
+ <xsl:with-param name="row-pos" select="$row-pos"/>
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="col-pos-max" select="$col-pos-max"/>
+ <xsl:with-param name="col-pos-before" select="$col-pos-before +1"/>
+ </xsl:apply-templates>
+ <!--chengxz0925 no otherwise ,some content cells missed -->
+ </xsl:if>
+ <!--chengxz 060418 add if sentence-->
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--xsl:template name="create-table-cell-attributes"></xsl:template>
<xsl:template name="create-table-cell-content"></xsl:template>
<xsl:template name="create-data-content"></xsl:template>
<xsl:template name="get-condition-dependent-cell-attributes"></xsl:template-->
- <xsl:template name="create-table-cell-attributes">
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="col-pos-max"/>
- <xsl:param name="col-pos"/>
- <xsl:param name="row-pos"/>
- <xsl:choose>
- <xsl:when test="$condition-pos-str">
- <xsl:call-template name="get-condition-dependent-cell-attributes">
- <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
- <xsl:with-param name="current-pos-str" select="concat('R',$row-pos,'C',$col-pos,',')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name"><xsl:choose><xsl:when test="@表:式样引用"><xsl:value-of select="@表:式样引用"/></xsl:when><xsl:when test="../@表:式样引用 and ../@表:式样引用 != ''"><xsl:value-of select="../@表:式样引用"/></xsl:when><xsl:otherwise><xsl:value-of select="'Default'"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <!--chengxiuzhi-->
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="@表:合并列数 or @表:合并行数">
- <xsl:choose>
- <xsl:when test="@表:合并列数">
- <xsl:attribute name="table:number-columns-spanned"><xsl:value-of select="@表:合并列数 + 1"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:number-columns-spanned">1</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@表:合并行数">
- <xsl:attribute name="table:number-rows-spanned"><xsl:value-of select="@表:合并行数+1"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:number-rows-spanned">1</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="表:数据">
- <xsl:if test="表:数据/表:公式">
- <xsl:variable name="calc-formula">
- <xsl:call-template name="translate-expression">
- <xsl:with-param name="cell-row-pos" select="$row-pos"/>
- <xsl:with-param name="cell-column-pos" select="$col-pos"/>
- <xsl:with-param name="expression" select="表:数据/表:公式"/>
- <xsl:with-param name="return-value" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:attribute name="table:formula"><xsl:value-of select="$calc-formula"/></xsl:attribute>
- </xsl:if>
- <!--RedOffice Comment from Zengjh:UOF0020 2006-04-17 Based on Original-->
- <xsl:variable name="table-stylename" select="@表:式样引用"/>
- <xsl:variable name="data-format">
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:单元格式样">
- <xsl:if test="$table-stylename = ./@ 表:标识符">
- <xsl:value-of select="表:数字格式/@表:分类名称"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="data-formatcode">
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:单元格式样">
- <xsl:if test="$table-stylename= ./@表:标识符">
- <xsl:value-of select="表:数字格式/@表:格式码"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="表:数据/@表:数据类型 = 'number'">
- <xsl:choose>
- <xsl:when test="$data-format = 'percentage' or contains( $data-formatcode, '%')">
- <xsl:attribute name="office:value-type">percentage</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains($data-format, 'currency')">
- <xsl:attribute name="office:value-type">currency</xsl:attribute>
- <xsl:attribute name="office:currency">CNY</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="office:value-type">float</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="office:value"><xsl:choose><xsl:when test="表:数据/@表:数据数值"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:when><xsl:otherwise><xsl:value-of select="表:数据/字:句/字:文本串"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="表:数据/@表:数据类型 = 'date'">
- <xsl:attribute name="office:value-type">date</xsl:attribute>
- <xsl:attribute name="office:date-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="表:数据/@表:数据类型 = 'time'">
- <xsl:attribute name="office:value-type">time</xsl:attribute>
- <xsl:attribute name="office:time-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="表:数据/@表:数据类型 = 'boolean'">
- <xsl:attribute name="office:value-type">boolean</xsl:attribute>
- <xsl:attribute name="office:boolean-value"><xsl:choose><xsl:when test="表:数据/字:句/字:文本串 = '1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="表:数据/@表:数据类型 = 'text'">
- <xsl:attribute name="office:value-type">string</xsl:attribute>
- <xsl:attribute name="office:string-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <!-- zhangying ok and /uof:UOF/uof:电子表格/表:公共处理规则/表:数据有效性集-->
- <xsl:if test="表:数据">
- <xsl:variable name="validation-name">
- <xsl:call-template name="zyvalidationtest">
- <xsl:with-param name="column-num" select="$col-pos"/>
- <xsl:with-param name="row-num" select="$row-pos"/>
- <xsl:with-param name="table-name" select="ancestor::表:工作表/@表:名称"/>
- <xsl:with-param name="validation-set" select="/uof:UOF/uof:电子表格/表:公用处理规则/表:数据有效性集/表:数据有效性"/>
- <xsl:with-param name="validation-num" select="'1'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$validation-name!=''">
- <xsl:attribute name="table:content-validation-name"><xsl:value-of select="$validation-name"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <!-- zhangying mod end -->
- </xsl:template>
- <!-- zhangying o -->
- <xsl:template name="zyvalidationtest">
- <xsl:param name="row-num"/>
- <xsl:param name="column-num"/>
- <xsl:param name="table-name"/>
- <xsl:param name="validation-set"/>
- <xsl:param name="validation-num"/>
- <xsl:if test="$validation-set">
- <xsl:variable name="zone" select="$validation-set/表:区域/text()"/>
- <xsl:variable name="success">
- <xsl:choose>
- <xsl:when test="$table-name=substring-after(substring-before($zone,'.'),'$')">
- <xsl:variable name="validation-row-left-top" select="substring-before(substring-after(substring-after(substring-after($zone,'$'),'$'),'$'),':')"/>
- <xsl:variable name="validation-row-right-bottom" select="substring-after(substring-after(substring-after($zone,':$'),'$'),'$')"/>
- <xsl:choose>
- <xsl:when test="($row-num &gt;= $validation-row-left-top and $row-num &lt;= $validation-row-right-bottom) or $validation-row-left-top=$validation-row-right-bottom">
- <xsl:variable name="validation-column-left-top">
- <xsl:call-template name="translate-column-char-to-number">
- <xsl:with-param name="string" select="substring-before(substring-after(substring-after($zone,'$'),'$'),'$')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="validation-column-right-bottom">
- <xsl:call-template name="translate-column-char-to-number">
- <xsl:with-param name="string" select="substring-before(substring-after(substring-after($zone,':$'),'$'),'$')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="($column-num &gt;= $validation-column-left-top) and ($column-num &lt;= $validation-column-right-bottom)">yes</xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$success='yes'">
- <xsl:value-of select="concat('val',$validation-num)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="zyvalidationtest">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="row-num" select="$row-num"/>
- <xsl:with-param name="column-num" select="$column-num"/>
- <xsl:with-param name="validation-set" select="$validation-set[position()!=1]"/>
- <xsl:with-param name="validation-num" select="$validation-num + 1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <!--zhangying mod end -->
- <xsl:template name="create-table-cell-content">
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="col-pos-max"/>
- <xsl:param name="col-pos"/>
- <xsl:param name="row-pos"/>
- <!--Redoffice comment liliang SC0011 06.02.15 -->
- <!--新增内容-->
- <xsl:apply-templates select="uof:锚点"/>
- <!--Redoffice comment liliang end 06.02.15 -->
- <xsl:apply-templates select="表:批注" mode="body"/>
- <!--RedOffice Comment from Zengjh:UOF0020 2006-04-26 charts-->
- <xsl:apply-templates select="表:图表"/>
- <xsl:if test="表:数据/字:句">
- <text:p>
- <xsl:call-template name="create-data-content">
- <xsl:with-param name="style-id" select="../../@表:式样引用"/>
- </xsl:call-template>
- </text:p>
- </xsl:if>
- <!--chengxz0701多个句不能读入-->
- </xsl:template>
- <xsl:template name="create-data-content">
- <xsl:param name="style-id" select="@表:式样引用"/>
- <xsl:variable name="html-children" select="表:式样引用/descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40'][string-length(text()) != 0]"/>
- <xsl:choose>
- <xsl:when test="$html-children and $html-children != ''">
- <xsl:for-each select="$html-children">
- <text:span text:style-name="{concat($style-id, 'T', count(preceding::表:数据/字:句/字:文本串[child::html:*]), '_', position())}">
- <xsl:copy-of select="text()"/>
- </text:span>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="@表:超链接引用">
- <text:a xlink:href="{@表:超链接引用}">
- <xsl:value-of select="表:数据/字:句/字:文本串"/>
- </text:a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="表:数据/字:句">
- <xsl:choose>
- <xsl:when test="name(descendant::*[1])='字:句属性'">
- <text:span>
- <xsl:attribute name="text:style-name"><xsl:value-of select="descendant::*[1]/@字:式样引用"/></xsl:attribute>
- <xsl:value-of select="./字:文本串"/>
- </text:span>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./字:文本串"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="create-comment-data-content">
- <xsl:param name="style-id" select="@表:式样引用"/>
- <xsl:variable name="html-children" select="表:式样引用/descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40'][string-length(text()) != 0]"/>
- <xsl:choose>
- <xsl:when test="$html-children and $html-children != ''">
- <xsl:for-each select="$html-children">
- <text:span text:style-name="{concat($style-id, 'T', count(preceding::图:文本内容/字:段落/字:句/字:文本串[child::html:*]), '_', position())}">
- <xsl:copy-of select="text()"/>
- </text:span>
- </xsl:for-each>
- </xsl:when>
- <xsl:when test="@表:超链接引用">
- <text:a xlink:href="{@表:超链接引用}">
- <xsl:value-of select="图:文本内容/字:段落/字:句/字:文本串"/>
- </text:a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="图:文本内容/字:段落/字:句/字:文本串"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="get-condition-dependent-cell-attributes">
- <xsl:param name="condition-pos-str"/>
- <xsl:param name="current-pos-str"/>
- <xsl:variable name="temp-str">
- <xsl:call-template name="condition-str">
- <xsl:with-param name="param-str" select="substring-before($condition-pos-str,$current-pos-str)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="style-name">
- <xsl:choose>
- <xsl:when test="contains($condition-pos-str, $current-pos-str) and starts-with($temp-str, 'c')">
- <xsl:value-of select="concat('ce', substring-after($temp-str, 'c'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@表:式样引用">
- <xsl:value-of select="@表:式样引用"/>
- </xsl:when>
- <xsl:when test="../@表:式样引用">
- <xsl:value-of select="../@表:式样引用"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'Default'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="not( contains($style-name, 'Default'))">
- <xsl:choose>
- <xsl:when test="starts-with($style-name, 'val')">
- <xsl:attribute name="table:content-validation-name"><xsl:value-of select="$style-name"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name"><xsl:value-of select="$style-name"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="contains($style-name, 'Default')">
- <xsl:variable name="style-nametemp">
- <xsl:choose>
- <xsl:when test="@表:式样引用">
- <xsl:value-of select="@表:式样引用"/>
- </xsl:when>
- <xsl:when test="../@表:式样引用">
- <xsl:value-of select="../@表:式样引用"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="'Default'"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="table:style-name"><xsl:value-of select="$style-nametemp"/></xsl:attribute>
- <!--xsl:attribute name="style:data-style-name"><xsl:value-of select="N104" /></xsl:attribute-->
- </xsl:if>
- <!--chengxz-->
- <xsl:if test="contains($condition-pos-str, $current-pos-str)">
- <xsl:choose>
- <xsl:when test="starts-with($temp-str, 'v')">
- <xsl:attribute name="table:content-validation-name"><xsl:value-of select="concat('val', substring-after($temp-str, 'v'))"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="after-str" select="substring-after($condition-pos-str, $current-pos-str)"/>
- <xsl:if test="contains( $after-str, $current-pos-str)">
- <xsl:variable name="temp-str-2">
- <xsl:call-template name="condition-str">
- <xsl:with-param name="param-str" select="substring-before( $after-str,$current-pos-str)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="starts-with( $temp-str-2, 'v')">
- <xsl:attribute name="table:content-validation-name"><xsl:value-of select="concat('val', substring-after($temp-str-2, 'v'))"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template match="表:工作表内容">
- <xsl:variable name="default-column-width">
- <xsl:choose>
- <xsl:when test="@表:缺省列宽">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(@表:缺省列宽,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:when>
- <xsl:otherwise>2.096cm</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="table-pos">
- <xsl:value-of select="count(../preceding-sibling::表:工作表)+1"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="表:列">
- <xsl:call-template name="get-column-style-name">
- <xsl:with-param name="finishedColumns" select="0"/>
- <xsl:with-param name="columnCount" select="count(./表:列)"/>
- <xsl:with-param name="currentCount" select="1"/>
- <xsl:with-param name="table-pos" select="$table-pos"/>
- <xsl:with-param name="default-column-width" select="$default-column-width"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="../表:分页符集/表:分页符[@表:列号]">
- <style:style style:name="{concat('cob',$table-pos)}" style:family="table-column">
- <xsl:element name="style:table-column-properties">
- <xsl:attribute name="style:column-width"><xsl:value-of select="$default-column-width"/></xsl:attribute>
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- </xsl:element>
- </style:style>
- </xsl:if>
- <xsl:variable name="default-row-height">
- <xsl:choose>
- <xsl:when test="@表:缺省行高">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="concat(@表:缺省行高,'pt')"/>
- </xsl:call-template>
- <xsl:text>cm</xsl:text>
- </xsl:when>
- <xsl:otherwise>0.503cm</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <style:style style:family="table-row" style:name="{concat('ro', $table-pos)}">
- <style:table-row-properties style:row-height="{$default-row-height}" style:use-optimal-row-height="false"/>
- </style:style>
- <xsl:if test="表:行">
- <xsl:call-template name="get-row-style-name">
- <xsl:with-param name="lastrowpos" select="0"/>
- <xsl:with-param name="row-count" select="count(./表:行)"/>
- <xsl:with-param name="currentRow" select="1"/>
- <xsl:with-param name="table-pos" select="$table-pos"/>
- <xsl:with-param name="default-row-height" select="$default-row-height"/>
- </xsl:call-template>
- </xsl:if>
- <!--RedOffice Comment from Zengjh:UOF0020 2006-06-11 charts-->
- <xsl:for-each select="//表:图表">
- <xsl:variable name="chart-current">
- <xsl:number level="any" count="表:图表" format="1"/>
- </xsl:variable>
- <style:style style:family="graphics" style:name="{concat('chart', $chart-current)}">
- <style:graphic-properties>
- <xsl:choose>
- <xsl:when test="@表:随动方式='none'">
- <xsl:attribute name="draw:move-protect">true</xsl:attribute>
- <xsl:attribute name="draw:size-protect">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="@表:随动方式='move'">
- <xsl:attribute name="draw:size-protect">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </style:graphic-properties>
- </style:style>
- </xsl:for-each>
- <!--RedOffice comment (Zengjh) end charts-->
- <xsl:if test="../表:分页符集/表:分页符[@行号]">
- <style:style style:name="{concat('rob',$table-pos)}" style:family="table-row">
- <xsl:element name="style:table-row-properties">
- <xsl:attribute name="style:row-height"><xsl:value-of select="$default-row-height"/></xsl:attribute>
- <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- </xsl:element>
- </style:style>
- </xsl:if>
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="concat( 'ta', $table-pos)"/></xsl:attribute>
- <xsl:attribute name="style:family">table</xsl:attribute>
- <xsl:attribute name="style:master-page-name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'TAB_',../@表:名称)"/></xsl:call-template></xsl:attribute>
- <xsl:element name="style:properties">
- <xsl:choose>
- <xsl:when test="../@表:隐藏 = 'true'">
- <xsl:attribute name="table:display">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:display">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="get-column-style-name">
- <xsl:param name="finishedColumns"/>
- <xsl:param name="columnCount"/>
- <xsl:param name="currentCount"/>
- <xsl:param name="table-pos"/>
- <xsl:param name="default-column-width"/>
- <xsl:if test="$currentCount &lt; ($columnCount + 1)">
- <xsl:variable name="span-value">
- <xsl:choose>
- <xsl:when test="./表:列[position() = $currentCount]/@表:跨度">
- <xsl:value-of select="./表:跨度[position() = $currentCount]/@表:跨度 + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="0"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="current-index">
- <xsl:choose>
- <xsl:when test="./表:列[position() = $currentCount]/@表:列号">
- <xsl:value-of select="./表:列[position() = $currentCount]/@表:列号 - 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$finishedColumns"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="column-break">
- <xsl:choose>
- <xsl:when test="$span-value = 0">
- <xsl:if test="../表:分页符集/表:分页符/表:列 = $current-index">
- <xsl:value-of select="1"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="../表:分页符集/表:分页符[(@表:列号 &gt; $finishedColumns) and (@表:列号 &lt; ($finishedColumns + $span-value))]">
- <xsl:value-of select="1"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$column-break = 1">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat('cob', $table-pos, '-',$currentCount)"/></xsl:call-template></xsl:attribute>
- <xsl:attribute name="style:family">table-column</xsl:attribute>
- <xsl:element name="style:table-column-properties">
- <xsl:choose>
- <xsl:when test="./表:列[position() = $currentCount]/@表:列宽">
- <xsl:attribute name="style:column-width"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:列[position() = $currentCount]/@表:列宽,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:column-width"><xsl:value-of select="$default-column-width"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="./表:列[position() = $currentCount]/@表:列宽 &gt; 0">
- <xsl:attribute name="style:use-optimal-column-width">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:use-optimal-column-width">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- <style:style style:name="{concat('co', $table-pos, '-',$currentCount)}" style:family="table-column">
- <xsl:element name="style:table-column-properties">
- <xsl:choose>
- <xsl:when test="./表:列[position() = $currentCount]/@表:列宽">
- <xsl:attribute name="style:column-width"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:列[position() = $currentCount]/@表:列宽,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:column-width"><xsl:value-of select="$default-column-width"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:break-before">auto</xsl:attribute>
- </xsl:element>
- </style:style>
- <xsl:if test="$currentCount &lt; $columnCount">
- <xsl:call-template name="get-column-style-name">
- <xsl:with-param name="finishedColumns">
- <xsl:choose>
- <xsl:when test="./表:列[position() = $currentCount]/@表:列号">
- <xsl:choose>
- <xsl:when test="./表:列[position() = $currentCount]/@表:跨度">
- <xsl:value-of select="./表:列[position() = $currentCount]/@表:列宽 + ./表:列[position() = $currentCount]/@表:跨度"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./表:列[position() = $currentCount]/@表:列号"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="./表:列[position() = $currentCount]/@表:跨度">
- <xsl:value-of select="$finishedColumns + ./表:列[position() = $currentCount]/@表:跨度 + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$finishedColumns + 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="columnCount" select="$columnCount"/>
- <xsl:with-param name="currentCount" select="$currentCount + 1"/>
- <xsl:with-param name="table-pos" select="$table-pos"/>
- <xsl:with-param name="default-column-width" select="$default-column-width"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:template>
- <xsl:template name="get-row-style-name">
- <xsl:param name="lastrowpos"/>
- <xsl:param name="row-count"/>
- <xsl:param name="currentRow"/>
- <xsl:param name="table-pos"/>
- <xsl:param name="default-row-height"/>
- <xsl:if test="$currentRow &lt; ($row-count + 1)">
- <xsl:variable name="span-value">
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:行号">
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
- <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号 - $lastrowpos+ ./表:行[position() = $currentRow]/@表:跨度"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="0"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
- <xsl:value-of select="./表:行[position() = $currentRow]/@表:跨度 + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="0"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="current-index">
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:行号">
- <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号 - 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$lastrowpos"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="row-break">
- <xsl:choose>
- <xsl:when test="$span-value = 0">
- <xsl:if test="../表:分页符集/表:分页符/@表:行号 = $current-index">
- <xsl:value-of select="1"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="../表:分页符集/表:分页符[(@表:行号 &gt; $lastrowpos) and (@表:行号 &lt; ($lastrowpos + $span-value))]">
- <xsl:value-of select="1"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$row-break = 1">
- <style:style style:name="{concat('rob', $table-pos, '-',$currentRow)}" style:family="table-row">
- <xsl:element name="style:table-row-properties">
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:行高">
- <xsl:attribute name="style:row-height"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:行[position() = $currentRow]/@表:行高,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:row-height"><xsl:value-of select="$default-row-height"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:行高 &gt; 0">
- <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- </xsl:element>
- </style:style>
- </xsl:if>
- <style:style style:name="{concat('ro', $table-pos, '-',$currentRow)}" style:family="table-row">
- <xsl:element name="style:table-row-properties">
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:行高">
- <xsl:attribute name="style:row-height"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:行[position() = $currentRow]/@表:行高,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:row-height"><xsl:value-of select="$default-row-height"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:行高 &gt; 0">
- <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:break-before">auto</xsl:attribute>
- </xsl:element>
- </style:style>
- <xsl:if test="$currentRow &lt; $row-count">
- <xsl:call-template name="get-row-style-name">
- <xsl:with-param name="lastrowpos">
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:行号">
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
- <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号 + ./表:行[position() = $currentRow]/@表:跨度"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
- <xsl:value-of select="$lastrowpos + ./表:行[position() = $currentRow]/@表:跨度 + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$lastrowpos + 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="row-count" select="$row-count"/>
- <xsl:with-param name="currentRow" select="$currentRow + 1"/>
- <xsl:with-param name="table-pos" select="$table-pos"/>
- <xsl:with-param name="default-row-height" select="$default-row-height"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:template>
- <xsl:template name="encode-as-nc-name">
- <xsl:param name="string"/>
- <xsl:value-of select="translate($string, '. %()/\+', '')"/>
- </xsl:template>
- <xsl:key match="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/表:单元格" name="cells" use="@表:式样引用"/>
- <xsl:template match="表:数字格式">
- <xsl:variable name="unit-count" select="string-length(@表:格式码) - string-length(translate(@表:格式码,';','')) + 1"/>
- <xsl:variable name="style-id" select="../@表:标识符"/>
- <xsl:variable name="number-format-name">
- <xsl:choose>
- <xsl:when test="@表:分类名称='fraction' or @表:分类名称='scientific'">number</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@表:分类名称"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="process-number-format">
- <xsl:with-param name="number-format-name" select="$number-format-name"/>
- <xsl:with-param name="number-format-unit" select="@表:格式码"/>
- <xsl:with-param name="style-id" select="concat($style-id,'F')"/>
- <xsl:with-param name="format-type" select="key('cells', $style-id)/表:数据/@表:数据类型"/>
- <xsl:with-param name="total-unit" select="$unit-count"/>
- <xsl:with-param name="current-unit" select="0"/>
- </xsl:call-template>
- </xsl:template>
- <xsl:template name="process-number-format">
- <xsl:param name="number-format-name"/>
- <xsl:param name="number-format-unit"/>
- <xsl:param name="style-id"/>
- <xsl:param name="format-type"/>
- <xsl:param name="total-unit"/>
- <xsl:param name="current-unit"/>
- <xsl:choose>
- <xsl:when test="$current-unit &lt; ($total-unit -1)">
- <xsl:variable name="style-name">
- <xsl:choose>
- <xsl:when test="contains(substring-before($number-format-unit,';'),'[$')">currency</xsl:when>
- <xsl:when test="contains(substring-before($number-format-unit,';'),'%')">percentage</xsl:when>
- <xsl:otherwise>number</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="{concat('number:',$style-name,'-style')}">
- <xsl:attribute name="style:name"><xsl:value-of select="concat( $style-id, 'P',$current-unit)"/></xsl:attribute>
- <xsl:attribute name="style:volatile">true</xsl:attribute>
- <xsl:call-template name="general-number">
- <xsl:with-param name="number-format-unit" select="substring-before($number-format-unit,';')"/>
- </xsl:call-template>
- </xsl:element>
- <xsl:call-template name="process-number-format">
- <xsl:with-param name="number-format-name" select="$number-format-name"/>
- <xsl:with-param name="number-format-unit" select="substring-after($number-format-unit,';')"/>
- <xsl:with-param name="style-id" select="$style-id"/>
- <xsl:with-param name="format-type" select="$format-type"/>
- <xsl:with-param name="total-unit" select="$total-unit"/>
- <xsl:with-param name="current-unit" select="$current-unit +1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="{concat('number:',$number-format-name,'-style')}">
- <xsl:attribute name="style:name"><xsl:value-of select="$style-id"/></xsl:attribute>
- <xsl:call-template name="element-attribute">
- <xsl:with-param name="number-format-unit" select="string($number-format-unit)"/>
- </xsl:call-template>
- <xsl:call-template name="general-number">
- <xsl:with-param name="number-format-unit" select="string($number-format-unit)"/>
- </xsl:call-template>
- <xsl:call-template name="style-map">
- <xsl:with-param name="number-format-name" select="@表:分类名称"/>
- <xsl:with-param name="number-format-unit" select="@表:格式码"/>
- <xsl:with-param name="style-id" select="$style-id"/>
- <xsl:with-param name="format-type" select="$format-type"/>
- <xsl:with-param name="total-unit" select="$total-unit"/>
- <xsl:with-param name="current-unit" select="0"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="style-map">
- <xsl:param name="number-format-name"/>
- <xsl:param name="number-format-unit"/>
- <xsl:param name="style-id"/>
- <xsl:param name="format-type"/>
- <xsl:param name="total-unit"/>
- <xsl:param name="current-unit"/>
- <xsl:if test="$current-unit &lt; ($total-unit -1)">
- <xsl:variable name="stylecondition" select="substring-after(substring-before($number-format-unit,']'),'[')"/>
- <style:map style:condition="{$stylecondition}" style:apply-style-name="{concat( $style-id, 'P',$current-unit)}"/>
- <xsl:call-template name="style-map">
- <xsl:with-param name="number-format-name" select="$number-format-name"/>
- <xsl:with-param name="number-format-unit" select="substring-after($number-format-unit,';')"/>
- <xsl:with-param name="style-id" select="$style-id"/>
- <xsl:with-param name="format-type" select="$format-type"/>
- <xsl:with-param name="total-unit" select="$total-unit"/>
- <xsl:with-param name="current-unit" select="$current-unit +1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="general-number">
- <xsl:param name="number-format-unit"/>
- <xsl:call-template name="number-format-color">
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- </xsl:call-template>
- <xsl:call-template name="number-format-currency">
- <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="starts-with($number-format-unit,'&quot;')">
- <number:text>
- <xsl:value-of select="substring-before(substring-after($number-format-unit,'&quot;'),'&quot;')"/>
- </number:text>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'@')">
- <number:text-content/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'-') or starts-with($number-format-unit,'$') or starts-with($number-format-unit,'¥')">
- <number:text>
- <xsl:value-of select="substring($number-format-unit,1,1)"/>
- </number:text>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'YYYY')">
- <number:year number:style="long"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'YY')">
- <number:year number:style="rolong"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'MMMM')">
- <number:month number:style="long" number:textual="true"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'MMM')">
- <number:month number:style="rolong" number:textual="true"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'DD')">
- <number:day number:style="long"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'D')">
- <number:day number:style="rolong"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[HH]')">
- <number:hours number:style="long"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'HH')">
- <number:hours number:style="long"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'H')">
- <number:hours/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'SS.00')">
- <number:seconds number:style="long" number:decimal-places="2"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'SS')">
- <number:seconds number:style="long"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'S')">
- <number:seconds/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'AM/PM')">
- <number:am-pm/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'NNNN')">
- <number:day-of-week number:style="long"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'NNN')">
- <number:day-of-week/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'QQ')">
- <number:quarter number:style="long"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'Q')">
- <number:quarter/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'WW')">
- <number:week-of-year/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'MM')">
- <xsl:choose>
- <xsl:when test="starts-with(substring($number-format-unit,3),'S') or (starts-with(substring($number-format-unit,3),'&quot;') and starts-with(substring-after(substring-after($number-format-unit,'&quot;'),'&quot;'),'S'))">
- <number:minutes number:style="long"/>
- </xsl:when>
- <xsl:otherwise>
- <number:month number:style="long"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'M')">
- <xsl:choose>
- <xsl:when test="starts-with(substring($number-format-unit,2),'S') or (starts-with(substring($number-format-unit,2),'&quot;') and starts-with(substring-after(substring-after($number-format-unit,'&quot;'),'&quot;'),'S'))">
- <number:minutes/>
- </xsl:when>
- <xsl:otherwise>
- <number:month/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'#') or starts-with($number-format-unit,'0')">
- <xsl:variable name="digits-part">
- <xsl:choose>
- <xsl:when test="contains($number-format-unit,'&quot;')">
- <xsl:value-of select="substring-before($number-format-unit,'&quot;')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$number-format-unit"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="decimal-integer-exponent-fraction">
- <xsl:with-param name="digits-part" select="$digits-part"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
- <xsl:variable name="unit-length">
- <xsl:choose>
- <xsl:when test="starts-with($number-format-unit,'[value()')">
- <xsl:value-of select="string-length(substring-before($number-format-unit,']')) +2"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[NatNum')">
- <xsl:value-of select="string-length(substring-before($number-format-unit,']')) +2"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$-804]')">8</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'&quot;')">
- <xsl:value-of select="string-length(substring-before(substring-after($number-format-unit,'&quot;'),'&quot;')) +3"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'@')">2</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'-') or starts-with($number-format-unit,'$') or starts-with($number-format-unit,'¥')">2</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'YYYY')">5</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'YY')">3</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'MMMM')">5</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'MMM')">4</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'MM')">3</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'M')">2</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'DD')">3</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'D')">2</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[HH]')">5</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'HH')">3</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'H')">2</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'SS.00')">6</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'SS')">3</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'S')">2</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'AM/PM')">6</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'NNNN')">5</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'NNN')">4</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'QQ')">3</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'Q')">2</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'WW')">3</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'#') or starts-with($number-format-unit,'0')">
- <xsl:choose>
- <xsl:when test="contains($number-format-unit,'&quot;')">
- <xsl:value-of select="string-length(substring-before($number-format-unit,'&quot;')) +1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string-length($number-format-unit) +1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$unit-length &gt;1 and $unit-length &lt;=string-length($number-format-unit)">
- <xsl:call-template name="general-number">
- <xsl:with-param name="number-format-unit" select="substring($number-format-unit,$unit-length)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="decimal-integer-exponent-fraction">
- <xsl:param name="digits-part"/>
- <xsl:variable name="decimal-digits">
- <xsl:choose>
- <xsl:when test="contains($digits-part,'.')">
- <xsl:choose>
- <xsl:when test="contains($digits-part,' ')">
- <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),' '))"/>
- </xsl:when>
- <xsl:when test="contains(substring-after($digits-part,'.'),',')">
- <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),','))"/>
- </xsl:when>
- <xsl:when test="contains($digits-part,'E')">
- <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),'E'))"/>
- </xsl:when>
- <xsl:when test="contains($digits-part,'e')">
- <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),'e'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string-length(substring-after($digits-part,'.'))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="decimal-replacement">
- <xsl:choose>
- <xsl:when test="contains($digits-part,'.')">
- <xsl:choose>
- <xsl:when test="contains($digits-part,' ') and contains(substring-before(substring-after($digits-part,'.'),' '),'#')">true</xsl:when>
- <xsl:when test="contains($digits-part,'E') and contains(substring-before(substring-after($digits-part,'.'),'E'),'#')">true</xsl:when>
- <xsl:when test="contains($digits-part,'e') and contains(substring-before(substring-after($digits-part,'.'),'e'),'#')">true</xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="contains(substring-after($digits-part,'.'),'#')">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="integer-digits">
- <xsl:choose>
- <xsl:when test="contains($digits-part,'.')">
- <xsl:value-of select="string-length(substring-before($digits-part,'.')) - string-length(translate(substring-before($digits-part,'.'),'0',''))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="string-length($digits-part) - string-length(translate($digits-part,'0',''))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="factor-digits">
- <xsl:call-template name="display-factor-digits">
- <xsl:with-param name="digits-part" select="$digits-part"/>
- <xsl:with-param name="count" select="0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="grouping">
- <xsl:choose>
- <xsl:when test="(string-length($digits-part) - string-length(translate($digits-part,',',''))) &gt;$factor-digits">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="exponent-digits">
- <xsl:choose>
- <xsl:when test="contains($digits-part,'E')">
- <xsl:value-of select="string-length(substring-after($digits-part,'E')) -1"/>
- </xsl:when>
- <xsl:when test="contains($digits-part,'e')">
- <xsl:value-of select="string-length(substring-after($digits-part,'e')) -1"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="numerator-digits">
- <xsl:choose>
- <xsl:when test="contains($digits-part,' ')">
- <xsl:value-of select="string-length(substring-before(substring-after($digits-part,' '),'/'))"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="denominator-digits">
- <xsl:choose>
- <xsl:when test="contains($digits-part,' ')">
- <xsl:value-of select="string-length(substring-after(substring-after($digits-part,' '),'/'))"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="number-type">
- <xsl:choose>
- <xsl:when test="$exponent-digits &gt;0">number:scientific-number</xsl:when>
- <xsl:when test="($numerator-digits &gt;0) or ($denominator-digits &gt;0)">number:fraction</xsl:when>
- <xsl:otherwise>number:number</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="{$number-type}">
- <xsl:if test="$decimal-digits &gt;=0">
- <xsl:attribute name="number:decimal-places"><xsl:value-of select="$decimal-digits"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$decimal-replacement='true'">
- <xsl:attribute name="number:decimal-replacement"/>
- </xsl:if>
- <xsl:if test="$integer-digits &gt;=0">
- <xsl:attribute name="number:min-integer-digits"><xsl:value-of select="$integer-digits"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$grouping='true'">
- <xsl:attribute name="number:grouping"><xsl:value-of select="$grouping"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$factor-digits &gt;0">
- <xsl:attribute name="number:display-factor"><xsl:choose><xsl:when test="$factor-digits=1">1000</xsl:when><xsl:when test="$factor-digits=2">1000000</xsl:when><xsl:when test="$factor-digits=3">1000000000</xsl:when><xsl:when test="$factor-digits=4">1000000000000</xsl:when><xsl:when test="$factor-digits=5">1000000000000000</xsl:when><xsl:when test="$factor-digits=6">1000000000000000000</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="$exponent-digits &gt;0">
- <xsl:attribute name="number:min-exponent-digits"><xsl:value-of select="$exponent-digits"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$numerator-digits &gt;0">
- <xsl:attribute name="number:min-numerator-digits"><xsl:value-of select="$numerator-digits"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$denominator-digits &gt;0">
- <xsl:attribute name="number:min-denominator-digits"><xsl:value-of select="$denominator-digits"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="number-format-color">
- <xsl:param name="number-format-unit"/>
- <xsl:choose>
- <xsl:when test="starts-with($number-format-unit,'[Black]')">
- <style:text-properties fo:color="#000000"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Blue]')">
- <style:text-properties fo:color="#0000ff"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Cyan]')">
- <style:text-properties fo:color="#00ffff"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Green]')">
- <style:text-properties fo:color="#00ff00"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Magenta]')">
- <style:text-properties fo:color="#ff00ff"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Red]')">
- <style:text-properties fo:color="#ff0000"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[White]')">
- <style:text-properties fo:color="#ffffff"/>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Yellow]')">
- <style:text-properties fo:color="#ffff00"/>
- </xsl:when>
- </xsl:choose>
- <xsl:variable name="unit-length">
- <xsl:choose>
- <xsl:when test="starts-with($number-format-unit,'[Black]')">8</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Blue]')">7</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Cyan]')">7</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Green]')">8</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Magenta]')">10</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Red]')">6</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[White]')">8</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[Yellow]')">9</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$unit-length &gt;1 and $unit-length &lt;=string-length($number-format-unit)">
- <xsl:call-template name="general-number">
- <xsl:with-param name="number-format-unit" select="substring($number-format-unit,$unit-length)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="number-format-currency">
- <xsl:param name="number-format-unit"/>
- <xsl:choose>
- <xsl:when test="starts-with($number-format-unit,'[$¥-804]')">
- <number:currency-symbol number:language="zh" number:country="CN">¥</number:currency-symbol>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$$-409]')">
- <number:currency-symbol number:language="en" number:country="US">$</number:currency-symbol>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$$-2C0A]')">
- <number:currency-symbol number:language="es" number:country="AR">$</number:currency-symbol>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$$-C0C]')">
- <number:currency-symbol number:language="fr" number:country="CA">$</number:currency-symbol>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$CNY]')">
- <number:currency-symbol>CNY</number:currency-symbol>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$AFA]')">
- <number:currency-symbol>AFA</number:currency-symbol>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'CNY')">
- <number:currency-symbol>CNY</number:currency-symbol>
- </xsl:when>
- <xsl:when test="starts-with($number-format-unit,'CCC')">
- <number:currency-symbol>CCC</number:currency-symbol>
- </xsl:when>
- </xsl:choose>
- <xsl:variable name="unit-length">
- <xsl:choose>
- <xsl:when test="starts-with($number-format-unit,'[$¥-804]')">9</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$$-409]')">9</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$$-2C0A]')">10</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$$-C0C]')">9</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$CNY]')">7</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'[$AFA]')">7</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'CNY')">4</xsl:when>
- <xsl:when test="starts-with($number-format-unit,'CCC')">4</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$unit-length &gt;1 and $unit-length &lt;=string-length($number-format-unit)">
- <xsl:call-template name="general-number">
- <xsl:with-param name="number-format-unit" select="substring($number-format-unit,$unit-length)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="display-factor-digits">
- <xsl:param name="digits-part"/>
- <xsl:param name="count"/>
- <xsl:choose>
- <xsl:when test="not(substring($digits-part,string-length($digits-part),1) =',')">
- <xsl:value-of select="$count"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="display-factor-digits">
- <xsl:with-param name="digits-part" select="substring($digits-part,1,string-length($digits-part) -1)"/>
- <xsl:with-param name="count" select="$count +1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="element-attribute">
- <xsl:param name="number-format-unit"/>
- <xsl:if test="contains($number-format-unit,'[HH]')">
- <xsl:attribute name="number:truncate-on-overflow">false</xsl:attribute>
- </xsl:if>
- <xsl:if test="starts-with($number-format-unit,'[NatNum1]')">
- <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
- <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
- </xsl:if>
- <xsl:if test="starts-with($number-format-unit,'[NatNum2]')">
- <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
- <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
- </xsl:if>
- <xsl:if test="starts-with($number-format-unit,'[NatNum3]')">
- <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
- <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
- </xsl:if>
- <xsl:if test="starts-with($number-format-unit,'[NatNum4]')">
- <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
- <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
- </xsl:if>
- <xsl:if test="starts-with($number-format-unit,'[NatNum5]')">
- <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
- <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
- </xsl:if>
- <xsl:if test="starts-with($number-format-unit,'[NatNum6]')">
- <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
- <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
- </xsl:if>
- <xsl:if test="starts-with($number-format-unit,'[NatNum7]')">
- <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
- <xsl:attribute name="number:transliteration-style">medium</xsl:attribute>
- </xsl:if>
- <xsl:if test="starts-with($number-format-unit,'[NatNum8]')">
- <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
- <xsl:attribute name="number:transliteration-style">medium</xsl:attribute>
- </xsl:if>
- <xsl:if test="starts-with($number-format-unit,'[NatNum0]')">
- <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
- <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
- </xsl:if>
- <xsl:if test="contains($number-format-unit,'[$-804]')">
- <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
- <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:key name="pz" match="/uof:UOF/uof:对象集/图:图形" use="@图:标识符"/>
- <xsl:template match="表:批注" mode="body">
- <xsl:element name="office:annotation">
- <xsl:if test="@表:是否显示 = 'true'">
- <xsl:attribute name="office:display">true</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="uof:锚点/@uof:图形引用"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(uof:锚点/@uof:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(uof:锚点/@uof:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(uof:锚点/@uof:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(uof:锚点/@uof:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:variable name="w">
- <xsl:value-of select="./uof:锚点/@uof:图形引用"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="key('pz',$w)/图:文本内容/字:句/字:文本串">
- <text:p>
- <xsl:for-each select="key('pz',$w)/图:文本内容/字:句">
- <text:span>
- <xsl:if test="字:句属性/@字:式样引用">
- <xsl:attribute name="text:style-name"><xsl:value-of select="字:句属性/@字:式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:value-of select="字:文本串"/>
- </text:span>
- </xsl:for-each>
- </text:p>
- </xsl:when>
- </xsl:choose>
- <!--xsl:if test="图:文本内容/字:段落/字:句/字:文本串">
- <text:p>
- <xsl:call-template name="create-comment-data-content">
- <xsl:with-param name="style-id" select="../@表:式样引用"/>
- </xsl:call-template>
- </text:p>
- </xsl:if-->
- </xsl:element>
- </xsl:template>
- <xsl:template name="auto-filter-condition">
- <xsl:param name="conditon-set"/>
- <xsl:param name="zone-left-column-num"/>
- <xsl:if test="$conditon-set">
- <xsl:variable name="first-condition" select="$conditon-set[1]"/>
- <xsl:element name="table:filter-condition">
- <xsl:attribute name="table:field-number"><xsl:value-of select="$first-condition/@表:列号 - $zone-left-column-num"/></xsl:attribute>
- <xsl:attribute name="office:value"><xsl:choose><xsl:when test="$first-condition/表:普通"><xsl:value-of select="$first-condition/表:普通/@表:值"/></xsl:when><xsl:when test="$first-condition/表:自定义"><xsl:value-of select="$first-condition/表:自定义/表:操作条件/表:值"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:variable name="operator">
- <xsl:choose>
- <xsl:when test="$first-condition/表:普通">
- <xsl:variable name="general" select="$first-condition/表:普通/@表:类型"/>
- <xsl:choose>
- <xsl:when test="$general ='topitem'">top values</xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$first-condition/表:自定义">
- <xsl:variable name="operator-text" select="$first-condition/表:自定义/表:操作条件/表:操作码/text()"/>
- <xsl:choose>
- <xsl:when test="$operator-text ='less than'">&lt;</xsl:when>
- <xsl:when test="$operator-text ='greater than'">&gt;</xsl:when>
- <xsl:when test="$operator-text ='equal to'">
- <xsl:value-of select="'='"/>
- </xsl:when>
- <xsl:when test="$operator-text ='greater than or equal to'">
- <xsl:value-of select="'&gt;='"/>
- </xsl:when>
- <xsl:when test="$operator-text ='less than or equal to'">
- <xsl:value-of select="'&lt;='"/>
- </xsl:when>
- <xsl:when test="$operator-text ='not equal to'">
- <xsl:value-of select="'!='"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="table:operator"><xsl:value-of select="$operator"/></xsl:attribute>
- </xsl:element>
- <xsl:call-template name="auto-filter-condition">
- <xsl:with-param name="conditon-set" select="$conditon-set[position()!=1]"/>
- <xsl:with-param name="zone-left-column-num" select="$zone-left-column-num"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="translate-column-char-to-number">
- <xsl:param name="string"/>
- <xsl:choose>
- <xsl:when test="string-length($string)=1">
- <xsl:call-template name="char-to-number">
- <xsl:with-param name="char" select="$string"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="tens-place">
- <xsl:call-template name="char-to-number">
- <xsl:with-param name="char" select="substring($string,1,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="units-place">
- <xsl:call-template name="char-to-number">
- <xsl:with-param name="char" select="substring($string,2,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$tens-place * 26 + $units-place"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="char-to-number">
- <xsl:param name="char"/>
- <xsl:choose>
- <xsl:when test="$char='A'">1</xsl:when>
- <xsl:when test="$char='B'">2</xsl:when>
- <xsl:when test="$char='C'">3</xsl:when>
- <xsl:when test="$char='D'">4</xsl:when>
- <xsl:when test="$char='E'">5</xsl:when>
- <xsl:when test="$char='F'">6</xsl:when>
- <xsl:when test="$char='G'">7</xsl:when>
- <xsl:when test="$char='H'">8</xsl:when>
- <xsl:when test="$char='I'">9</xsl:when>
- <xsl:when test="$char='J'">10</xsl:when>
- <xsl:when test="$char='K'">11</xsl:when>
- <xsl:when test="$char='L'">12</xsl:when>
- <xsl:when test="$char='M'">13</xsl:when>
- <xsl:when test="$char='N'">14</xsl:when>
- <xsl:when test="$char='O'">15</xsl:when>
- <xsl:when test="$char='P'">16</xsl:when>
- <xsl:when test="$char='Q'">17</xsl:when>
- <xsl:when test="$char='R'">18</xsl:when>
- <xsl:when test="$char='S'">19</xsl:when>
- <xsl:when test="$char='T'">20</xsl:when>
- <xsl:when test="$char='U'">21</xsl:when>
- <xsl:when test="$char='V'">22</xsl:when>
- <xsl:when test="$char='W'">23</xsl:when>
- <xsl:when test="$char='X'">24</xsl:when>
- <xsl:when test="$char='Y'">25</xsl:when>
- <xsl:when test="$char='Z'">26</xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="translate-expression2">
- <xsl:param name="expression2"/>
- <xsl:choose>
- <xsl:when test="contains($expression2,':')">
- <xsl:variable name="column-one">
- <xsl:value-of select="substring(substring-before($expression2,':'),1,1)"/>
- </xsl:variable>
- <xsl:variable name="row-one">
- <xsl:value-of select="substring(substring-before($expression2,':'),2)"/>
- </xsl:variable>
- <xsl:variable name="column-two">
- <xsl:value-of select="substring(substring-after($expression2,':'),1,1)"/>
- </xsl:variable>
- <xsl:variable name="row-two">
- <xsl:value-of select="substring(substring-after($expression2,':'),2)"/>
- </xsl:variable>
- <xsl:variable name="column-value1">
- <xsl:call-template name="character-to-column">
- <xsl:with-param name="column-value" select="$column-one"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="column-value2">
- <xsl:call-template name="character-to-column">
- <xsl:with-param name="column-value" select="$column-two"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat('R',$row-one,'C',$column-value1,':','R',$row-two,'C',$column-value2)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="column-one">
- <xsl:value-of select="substring($expression2,1,1)"/>
- </xsl:variable>
- <xsl:variable name="row-one">
- <xsl:value-of select="substring($expression2,2)"/>
- </xsl:variable>
- <xsl:variable name="column-value1">
- <xsl:call-template name="character-to-column">
- <xsl:with-param name="column-value" select="$column-one"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat('R',$row-one,'C',$column-value1)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="character-to-column">
- <xsl:param name="column-value"/>
- <xsl:choose>
- <xsl:when test="$column-value= 'A'">1</xsl:when>
- <xsl:when test="$column-value= 'B'">2</xsl:when>
- <xsl:when test="$column-value= 'C'">3</xsl:when>
- <xsl:when test="$column-value= 'D'">4</xsl:when>
- <xsl:when test="$column-value= 'E'">5</xsl:when>
- <xsl:when test="$column-value= 'F'">6</xsl:when>
- <xsl:when test="$column-value= 'G'">7</xsl:when>
- <xsl:when test="$column-value= 'H'">8</xsl:when>
- <xsl:when test="$column-value= 'I'">9</xsl:when>
- <xsl:when test="$column-value= 'J'">10</xsl:when>
- <xsl:when test="$column-value= 'K'">11</xsl:when>
- <xsl:when test="$column-value= 'L'">12</xsl:when>
- <xsl:when test="$column-value= 'M'">13</xsl:when>
- <xsl:when test="$column-value= 'N'">14</xsl:when>
- <xsl:when test="$column-value= 'O'">15</xsl:when>
- <xsl:when test="$column-value= 'P'">16</xsl:when>
- <xsl:when test="$column-value= 'Q'">17</xsl:when>
- <xsl:when test="$column-value= 'R'">18</xsl:when>
- <xsl:when test="$column-value= 'S'">19</xsl:when>
- <xsl:when test="$column-value= 'T'">20</xsl:when>
- <xsl:when test="$column-value= 'U'">21</xsl:when>
- <xsl:when test="$column-value= 'V'">22</xsl:when>
- <xsl:when test="$column-value= 'W'">23</xsl:when>
- <xsl:when test="$column-value= 'X'">24</xsl:when>
- <xsl:when test="$column-value= 'Y'">25</xsl:when>
- <xsl:when test="$column-value= 'Z'">26</xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <!--chenjh end 20050611-->
- <xsl:template name="工作表属性">
- <!--office:settings-->
- <xsl:variable name="sheetprop" select="/uof:UOF/uof:电子表格/表:主体/表:工作表"/>
- <config:config-item-set config:name="ooo:view-settings">
- <xsl:variable name="ratio" select="15"/>
- <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/表:单元格/表:数据/字:句/字:修订开始">
- <config:config-item-set config:name="TrackedChangesViewSettings">
- <config:config-item config:name="ShowChanges" config:type="boolean">true</config:config-item>
- <config:config-item config:name="ShowAcceptedChanges" config:type="boolean">false</config:config-item>
- <config:config-item config:name="ShowRejectedChanges" config:type="boolean">false</config:config-item>
- <config:config-item config:name="ShowChangesByDatetime" config:type="boolean">false</config:config-item>
- <config:config-item config:name="ShowChangesByDatetimeMode" config:type="short">0</config:config-item>
- <config:config-item config:name="ShowChangesByDatetimeFirstDatetime" config:type="datetime">2007-01-17T10:56:46.21</config:config-item>
- <config:config-item config:name="ShowChangesByDatetimeSecondDatetime" config:type="datetime">2007-01-17T10:56:46.21</config:config-item>
- <config:config-item config:name="ShowChangesByAuthor" config:type="boolean">false</config:config-item>
- <config:config-item config:name="ShowChangesByAuthorName" config:type="string"/>
- <config:config-item config:name="ShowChangesByComment" config:type="boolean">false</config:config-item>
- <config:config-item config:name="ShowChangesByCommentText" config:type="string"/>
- <config:config-item config:name="ShowChangesByRanges" config:type="boolean">false</config:config-item>
- <config:config-item config:name="ShowChangesByRangesList" config:type="string"/>
- </config:config-item-set>
- </xsl:if>
- <config:config-item-map-indexed config:name="Views">
- <config:config-item-map-entry>
- <config:config-item config:name="ViewId" config:type="string">View1</config:config-item>
- <config:config-item-map-named config:name="Tables">
- <xsl:for-each select="$sheetprop/表:工作表属性/表:视图">
- <xsl:element name="config:config-item-map-entry">
- <xsl:attribute name="config:name"><xsl:value-of select="ancestor::表:工作表/@表:名称"/></xsl:attribute>
- <xsl:element name="config:config-item">
- <xsl:attribute name="config:name">HorizontalSplitMode</xsl:attribute>
- <xsl:attribute name="config:type">short</xsl:attribute>
- <xsl:choose>
- <xsl:when test="表:冻结 and 表:冻结/@表:列号!=0">2</xsl:when>
- <xsl:when test="表:冻结 and 表:冻结/@表:列号=0">0</xsl:when>
- <xsl:when test="表:拆分 and 表:拆分/@表:宽度!=0">1</xsl:when>
- <xsl:when test="表:拆分 and 表:拆分/@表:宽度=0">0</xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="config:config-item">
- <xsl:attribute name="config:name">VerticalSplitMode</xsl:attribute>
- <xsl:attribute name="config:type">short</xsl:attribute>
- <xsl:choose>
- <xsl:when test="表:冻结 and 表:冻结/@表:行号!=0">2</xsl:when>
- <xsl:when test="表:冻结 and 表:冻结/@表:行号=0">0</xsl:when>
- <xsl:when test="表:拆分 and 表:拆分/@表:高度!=0">1</xsl:when>
- <xsl:when test="表:拆分 and 表:拆分/@表:高度=0">0</xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="config:config-item">
- <xsl:attribute name="config:name">HorizontalSplitPosition</xsl:attribute>
- <xsl:attribute name="config:type">int</xsl:attribute>
- <xsl:choose>
- <xsl:when test="表:冻结 and 表:冻结/@表:列号=0">0</xsl:when>
- <xsl:when test="表:冻结 and 表:冻结/@表:列号!=0">
- <xsl:value-of select="表:冻结/@表:列号"/>
- </xsl:when>
- <xsl:when test="表:拆分 and 表:拆分/@表:宽度=0">0</xsl:when>
- <xsl:when test="表:拆分 and 表:拆分/@表:宽度!=0">
- <xsl:value-of select="表:拆分/@表:宽度"/>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:element name="config:config-item">
- <xsl:attribute name="config:name">VerticalSplitPosition</xsl:attribute>
- <xsl:attribute name="config:type">int</xsl:attribute>
- <xsl:choose>
- <xsl:when test="表:冻结 and 表:冻结/@表:行号=0">0</xsl:when>
- <xsl:when test="表:冻结 and 表:冻结/@表:行号!=0">
- <xsl:value-of select="表:冻结/@表:行号"/>
- </xsl:when>
- <xsl:when test="表:拆分 and 表:拆分/@表:高度=0">0</xsl:when>
- <xsl:when test="表:拆分 and 表:拆分/@表:高度!=0">
- <xsl:value-of select="表:拆分/@表:高度"/>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- <xsl:variable name="position-top">
- <xsl:choose>
- <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:最上行">
- <xsl:value-of select="//表:工作表属性/表:视图/表:最上行"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="position-left">
- <xsl:choose>
- <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:最左列">
- <xsl:value-of select="$sheetprop/表:工作表属性/表:视图/表:最左列"/>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <config:config-item config:name="PositionRight" config:type="int">
- <xsl:value-of select="$position-left"/>
- </config:config-item>
- <config:config-item config:name="PositionBottom" config:type="int">
- <xsl:value-of select="$position-top"/>
- </config:config-item>
- </xsl:element>
- </xsl:for-each>
- </config:config-item-map-named>
- <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:当前视图">
- <xsl:element name="config:config-item">
- <xsl:attribute name="config:name">ShowPageBreakPreview</xsl:attribute>
- <xsl:attribute name="config:type">boolean</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:当前视图/@表:类型='normal'">false</xsl:when>
- <xsl:otherwise>true</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:网格">
- <xsl:element name="config:config-item">
- <xsl:attribute name="config:name">ShowGrid</xsl:attribute>
- <xsl:attribute name="config:type">boolean</xsl:attribute>
- <xsl:choose>
- <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:网格/@表:值=1 or $sheetprop/表:工作表属性/表:视图/表:网格/@表:值='true'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:网格颜色">
- <xsl:element name="config:config-item">
- <xsl:attribute name="config:name">GridColor</xsl:attribute>
- <xsl:attribute name="config:type">long</xsl:attribute>
- <xsl:call-template name="transform-hex-to-decimal">
- <xsl:with-param name="number" select="//表:视图/表:网格颜色/text()"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:选中">
- <xsl:element name="config:config-item">
- <xsl:attribute name="config:name">ActiveTable</xsl:attribute>
- <xsl:attribute name="config:type">string</xsl:attribute>
- <xsl:value-of select="$sheetprop/表:工作表属性/表:视图[表:选中]/ancestor::表:工作表/@表:名称"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:缩放">
- <config:config-item config:name="ZoomValue" config:type="int">
- <xsl:value-of select="$sheetprop/表:工作表属性/表:视图/表:缩放/text()"/>
- </config:config-item>
- </xsl:if>
- <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:分页缩放">
- <config:config-item config:name="PageViewZoomValue" config:type="int">
- <xsl:value-of select="$sheetprop/表:工作表属性/表:视图/表:分页缩放/text()"/>
- </config:config-item>
- </xsl:if>
- </config:config-item-map-entry>
- </config:config-item-map-indexed>
- </config:config-item-set>
- </xsl:template>
- <xsl:template name="create-page-master">
- <xsl:param name="worksheetoptions"/>
- <xsl:for-each select="$worksheetoptions">
- <xsl:element name="style:page-layout">
- <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'pm_', ../@表:名称)"/></xsl:call-template></xsl:attribute>
- <xsl:element name="style:page-layout-properties">
- <xsl:if test="表:页面设置/表:纸张/@uof:宽度">
- <xsl:attribute name="fo:page-width"><xsl:value-of select="concat(表:页面设置/表:纸张/@uof:宽度,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:页面设置/表:纸张/@uof:高度">
- <xsl:attribute name="fo:page-height"><xsl:value-of select="concat(表:页面设置/表:纸张/@uof:高度,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:页面设置/表:纸张方向">
- <xsl:attribute name="style:print-orientation"><xsl:value-of select="表:页面设置/表:纸张方向"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:页面设置/表:缩放">
- <xsl:attribute name="style:scale-to"><xsl:value-of select="concat(表:页面设置/表:缩放,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/@表:背景">
- <xsl:attribute name="fo:background-color"><xsl:value-of select="/uof:UOF/uof:电子表格/表:主体/表:工作表/@表:背景"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style:first-page-number">continue</xsl:attribute>
- <xsl:if test="表:页面设置/表:页边距">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:页面设置/表:打印/@表:先列后行='true'">
- <xsl:attribute name="style:print-page-order">ltr</xsl:attribute>
- </xsl:if>
- <xsl:if test="表:页面设置/表:垂直对齐/@表:对齐方式">
- <xsl:attribute name="style:table-centering">vertical</xsl:attribute>
- </xsl:if>
- <xsl:if test="表:页面设置/表:水平对齐/@表:对齐方式">
- <xsl:attribute name="style:table-centering">horizontal</xsl:attribute>
- </xsl:if>
- </xsl:element>
- <xsl:element name="style:header-style">
- <xsl:element name="style:header-footer-properties">
- <xsl:attribute name="fo:min-height">0.75cm</xsl:attribute>
- <xsl:choose>
- <xsl:when test="表:页面设置/表:页眉页脚/@uof:边距">
- <xsl:attribute name="fo:margin-bottom"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(表:页面设置/表:页眉页脚/@uof:边距,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:margin-bottom">0.25cm</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- <xsl:element name="style:footer-style">
- <xsl:element name="style:header-footer-properties">
- <xsl:attribute name="fo:min-height">0.75cm</xsl:attribute>
- <xsl:choose>
- <xsl:when test="表:页面设置/表:页眉页脚/@uof:边距">
- <xsl:attribute name="fo:margin-top"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(表:页面设置/表:页眉页脚/@uof:边距,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:margin-top">0.25cm</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="字:文本串">
- <xsl:value-of select="text()"/>
- </xsl:template>
- <xsl:template match="字:换行符">
- <xsl:element name="text:line-break"/>
- </xsl:template>
- <xsl:template match="字:制表符">
- <xsl:element name="text:tab-stop"/>
- </xsl:template>
- <xsl:template match="字:区域开始">
- <xsl:if test="@字:类型='hyperlink'">
- <xsl:variable name="superlink" select="//uof:超级链接[@uof:标识符=current()/@字:标识符]"/>
- <xsl:element name="text:a">
- <xsl:attribute name="xlink:href"><xsl:value-of select="$superlink/@uof:目标"/></xsl:attribute>
- <xsl:value-of select="$superlink/@uof:提示"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:空格符">
- <xsl:element name="text:s">
- <xsl:if test="@字:个数">
- <xsl:attribute name="text:c"><xsl:value-of select="@字:个数"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:template>
- <xsl:template name="create-page-header-footer-text-p">
- <xsl:param name="paragragh-set"/>
- <xsl:choose>
- <xsl:when test="$paragragh-set">
- <xsl:element name="text:p">
- <xsl:for-each select="$paragragh-set[1]/字:句">
- <xsl:choose>
- <xsl:when test="not(字:句属性)">
- <xsl:apply-templates select="字:文本串 | 字:空格符 | 字:换行符"/>
- </xsl:when>
- <xsl:when test="字:句属性">
- <xsl:element name="text:span">
- <xsl:attribute name="text:style-name"><xsl:value-of select="//uof:句式样[@字:标识符=current()/字:句属性/@字:式样引用]/@字:名称"/></xsl:attribute>
- <xsl:apply-templates select="字:空格符 | 字:文本串 | 字:换行符 | 字:制表符"/>
- </xsl:element>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:element>
- <xsl:call-template name="create-page-header-footer-text-p">
- <xsl:with-param name="paragragh-set" select="$paragragh-set[position()!=1]"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <!--Redoffice comment lilliang SC0016 06.02.16 -->
- <!--新增内容-->
- <xsl:template match="字:段落">
- <xsl:element name="text:p">
- <xsl:choose>
- <xsl:when test="字:段落属性">
- <xsl:attribute name="text:style-name">P<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="generate-id(ancestor::字:主体/descendant::字:段落[1]) = generate-id(.)">
- <!-- create the leading paragraph style name in one section for master page style application, glu -->
- <xsl:variable name="paragraph-number">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
- </xsl:variable>
- <xsl:attribute name="text:style-name">P<xsl:value-of select="number($paragraph-number)"/>_1</xsl:attribute>
- </xsl:when>
- <xsl:when test="not(字:段落属性) and (descendant::字:分栏符 or ancestor::字:分节/descendant::字:节属性[字:分栏/@字:栏数 &gt; 1])">
- <xsl:attribute name="text:style-name">ColumnBreakPara</xsl:attribute>
- </xsl:when>
- <xsl:when test="字:句">
- <xsl:apply-templates select="字:句/字:文本串"/>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:template>
- <!--Redoffice comment liliang end 06.02.16-->
- <xsl:template name="create-master-styles">
- <xsl:param name="worksheetoptions"/>
- <xsl:for-each select="$worksheetoptions">
- <xsl:element name="style:master-page">
- <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'TAB_', ../@表:名称)"/></xsl:call-template></xsl:attribute>
- <!--xsl:attribute name="style:page-layout-name"-->
- <xsl:attribute name="style:page-layout-name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'pm_', ../@表:名称)"/></xsl:call-template></xsl:attribute>
- <xsl:attribute name="style:display-name"><xsl:value-of select="concat( 'PageStyle_', ../@表:名称)"/></xsl:attribute>
- <style:header>
- <xsl:for-each select="表:页面设置/表:页眉页脚">
- <xsl:variable name="temp" select="@表:位置"/>
- <xsl:choose>
- <xsl:when test="contains($temp,'header')">
- <xsl:if test="字:段落">
- <xsl:choose>
- <xsl:when test="@表:位置='headerleft'">
- <xsl:element name="style:region-left">
- <xsl:call-template name="create-page-header-footer-text-p">
- <xsl:with-param name="paragragh-set" select="字:段落"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@表:位置='headercenter'">
- <xsl:element name="style:region-center">
- <xsl:call-template name="create-page-header-footer-text-p">
- <xsl:with-param name="paragragh-set" select="字:段落"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@表:位置='headerright'">
- <xsl:element name="style:region-right">
- <xsl:call-template name="create-page-header-footer-text-p">
- <xsl:with-param name="paragragh-set" select="字:段落"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:for-each>
- </style:header>
- <style:footer>
- <xsl:for-each select="表:页面设置/表:页眉页脚">
- <xsl:variable name="temp" select="@表:位置"/>
- <xsl:choose>
- <xsl:when test="contains($temp,'footer')">
- <xsl:if test="字:段落">
- <xsl:choose>
- <xsl:when test="@表:位置='footerleft'">
- <xsl:element name="style:region-left">
- <xsl:call-template name="create-page-header-footer-text-p">
- <xsl:with-param name="paragragh-set" select="字:段落"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@表:位置='footercenter'">
- <xsl:element name="style:region-center">
- <xsl:call-template name="create-page-header-footer-text-p">
- <xsl:with-param name="paragragh-set" select="字:段落"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@表:位置='footerright'">
- <xsl:element name="style:region-right">
- <xsl:call-template name="create-page-header-footer-text-p">
- <xsl:with-param name="paragragh-set" select="字:段落"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:for-each>
- </style:footer>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <!--xsl:template name="create-page-master">
- </xsl:template>
- <xsl:template match="表:页面设置">
- </xsl:template>
+ <xsl:template name="create-table-cell-attributes">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="col-pos-max"/>
+ <xsl:param name="col-pos"/>
+ <xsl:param name="row-pos"/>
+ <xsl:choose>
+ <xsl:when test="$condition-pos-str">
+ <xsl:call-template name="get-condition-dependent-cell-attributes">
+ <xsl:with-param name="condition-pos-str" select="$condition-pos-str"/>
+ <xsl:with-param name="current-pos-str" select="concat('R',$row-pos,'C',$col-pos,',')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name"><xsl:choose><xsl:when test="@表:式样引用"><xsl:value-of select="@表:式样引用"/></xsl:when><xsl:when test="../@表:式样引用 and ../@表:式样引用 != ''"><xsl:value-of select="../@表:式样引用"/></xsl:when><xsl:otherwise><xsl:value-of select="'Default'"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <!--chengxiuzhi-->
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@表:合并列数 or @表:合并行数">
+ <xsl:choose>
+ <xsl:when test="@表:合并列数">
+ <xsl:attribute name="table:number-columns-spanned"><xsl:value-of select="@表:合并列数 + 1"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:number-columns-spanned">1</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@表:合并行数">
+ <xsl:attribute name="table:number-rows-spanned"><xsl:value-of select="@表:合并行数+1"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:number-rows-spanned">1</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="表:数据">
+ <xsl:if test="表:数据/表:公式">
+ <xsl:variable name="calc-formula">
+ <xsl:call-template name="translate-expression">
+ <xsl:with-param name="cell-row-pos" select="$row-pos"/>
+ <xsl:with-param name="cell-column-pos" select="$col-pos"/>
+ <xsl:with-param name="expression" select="表:数据/表:公式"/>
+ <xsl:with-param name="return-value" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:attribute name="table:formula"><xsl:value-of select="$calc-formula"/></xsl:attribute>
+ </xsl:if>
+ <!--RedOffice Comment from Zengjh:UOF0020 2006-04-17 Based on Original-->
+ <xsl:variable name="table-stylename" select="@表:式样引用"/>
+ <xsl:variable name="data-format">
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:单元格式样">
+ <xsl:if test="$table-stylename = ./@ 表:标识符">
+ <xsl:value-of select="表:数字格式/@表:分类名称"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="data-formatcode">
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:单元格式样">
+ <xsl:if test="$table-stylename= ./@表:标识符">
+ <xsl:value-of select="表:数字格式/@表:格式码"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="表:数据/@表:数据类型 = 'number'">
+ <xsl:choose>
+ <xsl:when test="$data-format = 'percentage' or contains( $data-formatcode, '%')">
+ <xsl:attribute name="office:value-type">percentage</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains($data-format, 'currency')">
+ <xsl:attribute name="office:value-type">currency</xsl:attribute>
+ <xsl:attribute name="office:currency">CNY</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="office:value-type">float</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="office:value"><xsl:choose><xsl:when test="表:数据/@表:数据数值"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:when><xsl:otherwise><xsl:value-of select="表:数据/字:句/字:文本串"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:数据/@表:数据类型 = 'date'">
+ <xsl:attribute name="office:value-type">date</xsl:attribute>
+ <xsl:attribute name="office:date-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:数据/@表:数据类型 = 'time'">
+ <xsl:attribute name="office:value-type">time</xsl:attribute>
+ <xsl:attribute name="office:time-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:数据/@表:数据类型 = 'boolean'">
+ <xsl:attribute name="office:value-type">boolean</xsl:attribute>
+ <xsl:attribute name="office:boolean-value"><xsl:choose><xsl:when test="表:数据/字:句/字:文本串 = '1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="表:数据/@表:数据类型 = 'text'">
+ <xsl:attribute name="office:value-type">string</xsl:attribute>
+ <xsl:attribute name="office:string-value"><xsl:value-of select="表:数据/@表:数据数值"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <!-- zhangying ok and /uof:UOF/uof:电子表格/表:公共处理规则/表:数据有效性集-->
+ <xsl:if test="表:数据">
+ <xsl:variable name="validation-name">
+ <xsl:call-template name="zyvalidationtest">
+ <xsl:with-param name="column-num" select="$col-pos"/>
+ <xsl:with-param name="row-num" select="$row-pos"/>
+ <xsl:with-param name="table-name" select="ancestor::表:工作表/@表:名称"/>
+ <xsl:with-param name="validation-set" select="/uof:UOF/uof:电子表格/表:公用处理规则/表:数据有效性集/表:数据有效性"/>
+ <xsl:with-param name="validation-num" select="'1'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$validation-name!=''">
+ <xsl:attribute name="table:content-validation-name"><xsl:value-of select="$validation-name"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <!-- zhangying mod end -->
+ </xsl:template>
+ <!-- zhangying o -->
+ <xsl:template name="zyvalidationtest">
+ <xsl:param name="row-num"/>
+ <xsl:param name="column-num"/>
+ <xsl:param name="table-name"/>
+ <xsl:param name="validation-set"/>
+ <xsl:param name="validation-num"/>
+ <xsl:if test="$validation-set">
+ <xsl:variable name="zone" select="$validation-set/表:区域/text()"/>
+ <xsl:variable name="success">
+ <xsl:choose>
+ <xsl:when test="$table-name=substring-after(substring-before($zone,'.'),'$')">
+ <xsl:variable name="validation-row-left-top" select="substring-before(substring-after(substring-after(substring-after($zone,'$'),'$'),'$'),':')"/>
+ <xsl:variable name="validation-row-right-bottom" select="substring-after(substring-after(substring-after($zone,':$'),'$'),'$')"/>
+ <xsl:choose>
+ <xsl:when test="($row-num &gt;= $validation-row-left-top and $row-num &lt;= $validation-row-right-bottom) or $validation-row-left-top=$validation-row-right-bottom">
+ <xsl:variable name="validation-column-left-top">
+ <xsl:call-template name="translate-column-char-to-number">
+ <xsl:with-param name="string" select="substring-before(substring-after(substring-after($zone,'$'),'$'),'$')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="validation-column-right-bottom">
+ <xsl:call-template name="translate-column-char-to-number">
+ <xsl:with-param name="string" select="substring-before(substring-after(substring-after($zone,':$'),'$'),'$')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="($column-num &gt;= $validation-column-left-top) and ($column-num &lt;= $validation-column-right-bottom)">yes</xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$success='yes'">
+ <xsl:value-of select="concat('val',$validation-num)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="zyvalidationtest">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="row-num" select="$row-num"/>
+ <xsl:with-param name="column-num" select="$column-num"/>
+ <xsl:with-param name="validation-set" select="$validation-set[position()!=1]"/>
+ <xsl:with-param name="validation-num" select="$validation-num + 1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <!--zhangying mod end -->
+ <xsl:template name="create-table-cell-content">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="col-pos-max"/>
+ <xsl:param name="col-pos"/>
+ <xsl:param name="row-pos"/>
+ <!--Redoffice comment liliang SC0011 06.02.15 -->
+ <!--新增内容-->
+ <xsl:apply-templates select="uof:锚点"/>
+ <!--Redoffice comment liliang end 06.02.15 -->
+ <xsl:apply-templates select="表:批注" mode="body"/>
+ <!--RedOffice Comment from Zengjh:UOF0020 2006-04-26 charts-->
+ <xsl:apply-templates select="表:图表"/>
+ <xsl:if test="表:数据/字:句">
+ <text:p>
+ <xsl:call-template name="create-data-content">
+ <xsl:with-param name="style-id" select="../../@表:式样引用"/>
+ </xsl:call-template>
+ </text:p>
+ </xsl:if>
+ <!--chengxz0701多个句不能读入-->
+ </xsl:template>
+ <xsl:template name="create-data-content">
+ <xsl:param name="style-id" select="@表:式样引用"/>
+ <xsl:variable name="html-children" select="表:式样引用/descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40'][string-length(text()) != 0]"/>
+ <xsl:choose>
+ <xsl:when test="$html-children and $html-children != ''">
+ <xsl:for-each select="$html-children">
+ <text:span text:style-name="{concat($style-id, 'T', count(preceding::表:数据/字:句/字:文本串[child::html:*]), '_', position())}">
+ <xsl:copy-of select="text()"/>
+ </text:span>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="@表:超链接引用">
+ <text:a xlink:href="{@表:超链接引用}">
+ <xsl:value-of select="表:数据/字:句/字:文本串"/>
+ </text:a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="表:数据/字:句">
+ <xsl:choose>
+ <xsl:when test="name(descendant::*[1])='字:句属性'">
+ <text:span>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="descendant::*[1]/@字:式样引用"/></xsl:attribute>
+ <xsl:value-of select="./字:文本串"/>
+ </text:span>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./字:文本串"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="create-comment-data-content">
+ <xsl:param name="style-id" select="@表:式样引用"/>
+ <xsl:variable name="html-children" select="表:式样引用/descendant-or-self::*[namespace-uri()='http://www.w3.org/TR/REC-html40'][string-length(text()) != 0]"/>
+ <xsl:choose>
+ <xsl:when test="$html-children and $html-children != ''">
+ <xsl:for-each select="$html-children">
+ <text:span text:style-name="{concat($style-id, 'T', count(preceding::图:文本内容/字:段落/字:句/字:文本串[child::html:*]), '_', position())}">
+ <xsl:copy-of select="text()"/>
+ </text:span>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:when test="@表:超链接引用">
+ <text:a xlink:href="{@表:超链接引用}">
+ <xsl:value-of select="图:文本内容/字:段落/字:句/字:文本串"/>
+ </text:a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="图:文本内容/字:段落/字:句/字:文本串"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="get-condition-dependent-cell-attributes">
+ <xsl:param name="condition-pos-str"/>
+ <xsl:param name="current-pos-str"/>
+ <xsl:variable name="temp-str">
+ <xsl:call-template name="condition-str">
+ <xsl:with-param name="param-str" select="substring-before($condition-pos-str,$current-pos-str)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="style-name">
+ <xsl:choose>
+ <xsl:when test="contains($condition-pos-str, $current-pos-str) and starts-with($temp-str, 'c')">
+ <xsl:value-of select="concat('ce', substring-after($temp-str, 'c'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="@表:式样引用">
+ <xsl:value-of select="@表:式样引用"/>
+ </xsl:when>
+ <xsl:when test="../@表:式样引用">
+ <xsl:value-of select="../@表:式样引用"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'Default'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="not( contains($style-name, 'Default'))">
+ <xsl:choose>
+ <xsl:when test="starts-with($style-name, 'val')">
+ <xsl:attribute name="table:content-validation-name"><xsl:value-of select="$style-name"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="$style-name"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="contains($style-name, 'Default')">
+ <xsl:variable name="style-nametemp">
+ <xsl:choose>
+ <xsl:when test="@表:式样引用">
+ <xsl:value-of select="@表:式样引用"/>
+ </xsl:when>
+ <xsl:when test="../@表:式样引用">
+ <xsl:value-of select="../@表:式样引用"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="'Default'"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="$style-nametemp"/></xsl:attribute>
+ <!--xsl:attribute name="style:data-style-name"><xsl:value-of select="N104" /></xsl:attribute-->
+ </xsl:if>
+ <!--chengxz-->
+ <xsl:if test="contains($condition-pos-str, $current-pos-str)">
+ <xsl:choose>
+ <xsl:when test="starts-with($temp-str, 'v')">
+ <xsl:attribute name="table:content-validation-name"><xsl:value-of select="concat('val', substring-after($temp-str, 'v'))"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="after-str" select="substring-after($condition-pos-str, $current-pos-str)"/>
+ <xsl:if test="contains( $after-str, $current-pos-str)">
+ <xsl:variable name="temp-str-2">
+ <xsl:call-template name="condition-str">
+ <xsl:with-param name="param-str" select="substring-before( $after-str,$current-pos-str)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="starts-with( $temp-str-2, 'v')">
+ <xsl:attribute name="table:content-validation-name"><xsl:value-of select="concat('val', substring-after($temp-str-2, 'v'))"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="表:工作表内容">
+ <xsl:variable name="default-column-width">
+ <xsl:choose>
+ <xsl:when test="@表:缺省列宽">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(@表:缺省列宽,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>2.096cm</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="table-pos">
+ <xsl:value-of select="count(../preceding-sibling::表:工作表)+1"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="表:列">
+ <xsl:call-template name="get-column-style-name">
+ <xsl:with-param name="finishedColumns" select="0"/>
+ <xsl:with-param name="columnCount" select="count(./表:列)"/>
+ <xsl:with-param name="currentCount" select="1"/>
+ <xsl:with-param name="table-pos" select="$table-pos"/>
+ <xsl:with-param name="default-column-width" select="$default-column-width"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="../表:分页符集/表:分页符[@表:列号]">
+ <style:style style:name="{concat('cob',$table-pos)}" style:family="table-column">
+ <xsl:element name="style:table-column-properties">
+ <xsl:attribute name="style:column-width"><xsl:value-of select="$default-column-width"/></xsl:attribute>
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ </xsl:element>
+ </style:style>
+ </xsl:if>
+ <xsl:variable name="default-row-height">
+ <xsl:choose>
+ <xsl:when test="@表:缺省行高">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="concat(@表:缺省行高,'pt')"/>
+ </xsl:call-template>
+ <xsl:text>cm</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>0.503cm</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <style:style style:family="table-row" style:name="{concat('ro', $table-pos)}">
+ <style:table-row-properties style:row-height="{$default-row-height}" style:use-optimal-row-height="false"/>
+ </style:style>
+ <xsl:if test="表:行">
+ <xsl:call-template name="get-row-style-name">
+ <xsl:with-param name="lastrowpos" select="0"/>
+ <xsl:with-param name="row-count" select="count(./表:行)"/>
+ <xsl:with-param name="currentRow" select="1"/>
+ <xsl:with-param name="table-pos" select="$table-pos"/>
+ <xsl:with-param name="default-row-height" select="$default-row-height"/>
+ </xsl:call-template>
+ </xsl:if>
+ <!--RedOffice Comment from Zengjh:UOF0020 2006-06-11 charts-->
+ <xsl:for-each select="//表:图表">
+ <xsl:variable name="chart-current">
+ <xsl:number level="any" count="表:图表" format="1"/>
+ </xsl:variable>
+ <style:style style:family="graphics" style:name="{concat('chart', $chart-current)}">
+ <style:graphic-properties>
+ <xsl:choose>
+ <xsl:when test="@表:随动方式='none'">
+ <xsl:attribute name="draw:move-protect">true</xsl:attribute>
+ <xsl:attribute name="draw:size-protect">true</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@表:随动方式='move'">
+ <xsl:attribute name="draw:size-protect">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </style:graphic-properties>
+ </style:style>
+ </xsl:for-each>
+ <!--RedOffice comment (Zengjh) end charts-->
+ <xsl:if test="../表:分页符集/表:分页符[@行号]">
+ <style:style style:name="{concat('rob',$table-pos)}" style:family="table-row">
+ <xsl:element name="style:table-row-properties">
+ <xsl:attribute name="style:row-height"><xsl:value-of select="$default-row-height"/></xsl:attribute>
+ <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ </xsl:element>
+ </style:style>
+ </xsl:if>
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="concat( 'ta', $table-pos)"/></xsl:attribute>
+ <xsl:attribute name="style:family">table</xsl:attribute>
+ <xsl:attribute name="style:master-page-name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'TAB_',../@表:名称)"/></xsl:call-template></xsl:attribute>
+ <xsl:element name="style:properties">
+ <xsl:choose>
+ <xsl:when test="../@表:隐藏 = 'true'">
+ <xsl:attribute name="table:display">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:display">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="get-column-style-name">
+ <xsl:param name="finishedColumns"/>
+ <xsl:param name="columnCount"/>
+ <xsl:param name="currentCount"/>
+ <xsl:param name="table-pos"/>
+ <xsl:param name="default-column-width"/>
+ <xsl:if test="$currentCount &lt; ($columnCount + 1)">
+ <xsl:variable name="span-value">
+ <xsl:choose>
+ <xsl:when test="./表:列[position() = $currentCount]/@表:跨度">
+ <xsl:value-of select="./表:跨度[position() = $currentCount]/@表:跨度 + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="current-index">
+ <xsl:choose>
+ <xsl:when test="./表:列[position() = $currentCount]/@表:列号">
+ <xsl:value-of select="./表:列[position() = $currentCount]/@表:列号 - 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$finishedColumns"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="column-break">
+ <xsl:choose>
+ <xsl:when test="$span-value = 0">
+ <xsl:if test="../表:分页符集/表:分页符/表:列 = $current-index">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="../表:分页符集/表:分页符[(@表:列号 &gt; $finishedColumns) and (@表:列号 &lt; ($finishedColumns + $span-value))]">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$column-break = 1">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat('cob', $table-pos, '-',$currentCount)"/></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="style:family">table-column</xsl:attribute>
+ <xsl:element name="style:table-column-properties">
+ <xsl:choose>
+ <xsl:when test="./表:列[position() = $currentCount]/@表:列宽">
+ <xsl:attribute name="style:column-width"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:列[position() = $currentCount]/@表:列宽,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:column-width"><xsl:value-of select="$default-column-width"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="./表:列[position() = $currentCount]/@表:列宽 &gt; 0">
+ <xsl:attribute name="style:use-optimal-column-width">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:use-optimal-column-width">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ <style:style style:name="{concat('co', $table-pos, '-',$currentCount)}" style:family="table-column">
+ <xsl:element name="style:table-column-properties">
+ <xsl:choose>
+ <xsl:when test="./表:列[position() = $currentCount]/@表:列宽">
+ <xsl:attribute name="style:column-width"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:列[position() = $currentCount]/@表:列宽,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:column-width"><xsl:value-of select="$default-column-width"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:break-before">auto</xsl:attribute>
+ </xsl:element>
+ </style:style>
+ <xsl:if test="$currentCount &lt; $columnCount">
+ <xsl:call-template name="get-column-style-name">
+ <xsl:with-param name="finishedColumns">
+ <xsl:choose>
+ <xsl:when test="./表:列[position() = $currentCount]/@表:列号">
+ <xsl:choose>
+ <xsl:when test="./表:列[position() = $currentCount]/@表:跨度">
+ <xsl:value-of select="./表:列[position() = $currentCount]/@表:列宽 + ./表:列[position() = $currentCount]/@表:跨度"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./表:列[position() = $currentCount]/@表:列号"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="./表:列[position() = $currentCount]/@表:跨度">
+ <xsl:value-of select="$finishedColumns + ./表:列[position() = $currentCount]/@表:跨度 + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$finishedColumns + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="columnCount" select="$columnCount"/>
+ <xsl:with-param name="currentCount" select="$currentCount + 1"/>
+ <xsl:with-param name="table-pos" select="$table-pos"/>
+ <xsl:with-param name="default-column-width" select="$default-column-width"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="get-row-style-name">
+ <xsl:param name="lastrowpos"/>
+ <xsl:param name="row-count"/>
+ <xsl:param name="currentRow"/>
+ <xsl:param name="table-pos"/>
+ <xsl:param name="default-row-height"/>
+ <xsl:if test="$currentRow &lt; ($row-count + 1)">
+ <xsl:variable name="span-value">
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:行号">
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
+ <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号 - $lastrowpos+ ./表:行[position() = $currentRow]/@表:跨度"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
+ <xsl:value-of select="./表:行[position() = $currentRow]/@表:跨度 + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="current-index">
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:行号">
+ <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号 - 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$lastrowpos"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="row-break">
+ <xsl:choose>
+ <xsl:when test="$span-value = 0">
+ <xsl:if test="../表:分页符集/表:分页符/@表:行号 = $current-index">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="../表:分页符集/表:分页符[(@表:行号 &gt; $lastrowpos) and (@表:行号 &lt; ($lastrowpos + $span-value))]">
+ <xsl:value-of select="1"/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$row-break = 1">
+ <style:style style:name="{concat('rob', $table-pos, '-',$currentRow)}" style:family="table-row">
+ <xsl:element name="style:table-row-properties">
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:行高">
+ <xsl:attribute name="style:row-height"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:行[position() = $currentRow]/@表:行高,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:row-height"><xsl:value-of select="$default-row-height"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:行高 &gt; 0">
+ <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ </xsl:element>
+ </style:style>
+ </xsl:if>
+ <style:style style:name="{concat('ro', $table-pos, '-',$currentRow)}" style:family="table-row">
+ <xsl:element name="style:table-row-properties">
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:行高">
+ <xsl:attribute name="style:row-height"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(./表:行[position() = $currentRow]/@表:行高,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:row-height"><xsl:value-of select="$default-row-height"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:行高 &gt; 0">
+ <xsl:attribute name="style:use-optimal-row-height">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:use-optimal-row-height">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:break-before">auto</xsl:attribute>
+ </xsl:element>
+ </style:style>
+ <xsl:if test="$currentRow &lt; $row-count">
+ <xsl:call-template name="get-row-style-name">
+ <xsl:with-param name="lastrowpos">
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:行号">
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
+ <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号 + ./表:行[position() = $currentRow]/@表:跨度"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="./表:行[position() = $currentRow]/@表:行号"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="./表:行[position() = $currentRow]/@表:跨度">
+ <xsl:value-of select="$lastrowpos + ./表:行[position() = $currentRow]/@表:跨度 + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$lastrowpos + 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="row-count" select="$row-count"/>
+ <xsl:with-param name="currentRow" select="$currentRow + 1"/>
+ <xsl:with-param name="table-pos" select="$table-pos"/>
+ <xsl:with-param name="default-row-height" select="$default-row-height"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="encode-as-nc-name">
+ <xsl:param name="string"/>
+ <xsl:value-of select="translate($string, '. %()/\+', '')"/>
+ </xsl:template>
+ <xsl:key match="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/表:单元格" name="cells" use="@表:式样引用"/>
+ <xsl:template match="表:数字格式">
+ <xsl:variable name="unit-count" select="string-length(@表:格式码) - string-length(translate(@表:格式码,';','')) + 1"/>
+ <xsl:variable name="style-id" select="../@表:标识符"/>
+ <xsl:variable name="number-format-name">
+ <xsl:choose>
+ <xsl:when test="@表:分类名称='fraction' or @表:分类名称='scientific'">number</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@表:分类名称"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="process-number-format">
+ <xsl:with-param name="number-format-name" select="$number-format-name"/>
+ <xsl:with-param name="number-format-unit" select="@表:格式码"/>
+ <xsl:with-param name="style-id" select="concat($style-id,'F')"/>
+ <xsl:with-param name="format-type" select="key('cells', $style-id)/表:数据/@表:数据类型"/>
+ <xsl:with-param name="total-unit" select="$unit-count"/>
+ <xsl:with-param name="current-unit" select="0"/>
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template name="process-number-format">
+ <xsl:param name="number-format-name"/>
+ <xsl:param name="number-format-unit"/>
+ <xsl:param name="style-id"/>
+ <xsl:param name="format-type"/>
+ <xsl:param name="total-unit"/>
+ <xsl:param name="current-unit"/>
+ <xsl:choose>
+ <xsl:when test="$current-unit &lt; ($total-unit -1)">
+ <xsl:variable name="style-name">
+ <xsl:choose>
+ <xsl:when test="contains(substring-before($number-format-unit,';'),'[$')">currency</xsl:when>
+ <xsl:when test="contains(substring-before($number-format-unit,';'),'%')">percentage</xsl:when>
+ <xsl:otherwise>number</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="{concat('number:',$style-name,'-style')}">
+ <xsl:attribute name="style:name"><xsl:value-of select="concat( $style-id, 'P',$current-unit)"/></xsl:attribute>
+ <xsl:attribute name="style:volatile">true</xsl:attribute>
+ <xsl:call-template name="general-number">
+ <xsl:with-param name="number-format-unit" select="substring-before($number-format-unit,';')"/>
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:call-template name="process-number-format">
+ <xsl:with-param name="number-format-name" select="$number-format-name"/>
+ <xsl:with-param name="number-format-unit" select="substring-after($number-format-unit,';')"/>
+ <xsl:with-param name="style-id" select="$style-id"/>
+ <xsl:with-param name="format-type" select="$format-type"/>
+ <xsl:with-param name="total-unit" select="$total-unit"/>
+ <xsl:with-param name="current-unit" select="$current-unit +1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="{concat('number:',$number-format-name,'-style')}">
+ <xsl:attribute name="style:name"><xsl:value-of select="$style-id"/></xsl:attribute>
+ <xsl:call-template name="element-attribute">
+ <xsl:with-param name="number-format-unit" select="string($number-format-unit)"/>
+ </xsl:call-template>
+ <xsl:call-template name="general-number">
+ <xsl:with-param name="number-format-unit" select="string($number-format-unit)"/>
+ </xsl:call-template>
+ <xsl:call-template name="style-map">
+ <xsl:with-param name="number-format-name" select="@表:分类名称"/>
+ <xsl:with-param name="number-format-unit" select="@表:格式码"/>
+ <xsl:with-param name="style-id" select="$style-id"/>
+ <xsl:with-param name="format-type" select="$format-type"/>
+ <xsl:with-param name="total-unit" select="$total-unit"/>
+ <xsl:with-param name="current-unit" select="0"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="style-map">
+ <xsl:param name="number-format-name"/>
+ <xsl:param name="number-format-unit"/>
+ <xsl:param name="style-id"/>
+ <xsl:param name="format-type"/>
+ <xsl:param name="total-unit"/>
+ <xsl:param name="current-unit"/>
+ <xsl:if test="$current-unit &lt; ($total-unit -1)">
+ <xsl:variable name="stylecondition" select="substring-after(substring-before($number-format-unit,']'),'[')"/>
+ <style:map style:condition="{$stylecondition}" style:apply-style-name="{concat( $style-id, 'P',$current-unit)}"/>
+ <xsl:call-template name="style-map">
+ <xsl:with-param name="number-format-name" select="$number-format-name"/>
+ <xsl:with-param name="number-format-unit" select="substring-after($number-format-unit,';')"/>
+ <xsl:with-param name="style-id" select="$style-id"/>
+ <xsl:with-param name="format-type" select="$format-type"/>
+ <xsl:with-param name="total-unit" select="$total-unit"/>
+ <xsl:with-param name="current-unit" select="$current-unit +1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="general-number">
+ <xsl:param name="number-format-unit"/>
+ <xsl:call-template name="number-format-color">
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ </xsl:call-template>
+ <xsl:call-template name="number-format-currency">
+ <xsl:with-param name="number-format-unit" select="$number-format-unit"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="starts-with($number-format-unit,'&quot;')">
+ <number:text>
+ <xsl:value-of select="substring-before(substring-after($number-format-unit,'&quot;'),'&quot;')"/>
+ </number:text>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'@')">
+ <number:text-content/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'-') or starts-with($number-format-unit,'$') or starts-with($number-format-unit,'¥')">
+ <number:text>
+ <xsl:value-of select="substring($number-format-unit,1,1)"/>
+ </number:text>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'YYYY')">
+ <number:year number:style="long"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'YY')">
+ <number:year number:style="rolong"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'MMMM')">
+ <number:month number:style="long" number:textual="true"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'MMM')">
+ <number:month number:style="rolong" number:textual="true"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'DD')">
+ <number:day number:style="long"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'D')">
+ <number:day number:style="rolong"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[HH]')">
+ <number:hours number:style="long"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'HH')">
+ <number:hours number:style="long"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'H')">
+ <number:hours/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'SS.00')">
+ <number:seconds number:style="long" number:decimal-places="2"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'SS')">
+ <number:seconds number:style="long"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'S')">
+ <number:seconds/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'AM/PM')">
+ <number:am-pm/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'NNNN')">
+ <number:day-of-week number:style="long"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'NNN')">
+ <number:day-of-week/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'QQ')">
+ <number:quarter number:style="long"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'Q')">
+ <number:quarter/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'WW')">
+ <number:week-of-year/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'MM')">
+ <xsl:choose>
+ <xsl:when test="starts-with(substring($number-format-unit,3),'S') or (starts-with(substring($number-format-unit,3),'&quot;') and starts-with(substring-after(substring-after($number-format-unit,'&quot;'),'&quot;'),'S'))">
+ <number:minutes number:style="long"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <number:month number:style="long"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'M')">
+ <xsl:choose>
+ <xsl:when test="starts-with(substring($number-format-unit,2),'S') or (starts-with(substring($number-format-unit,2),'&quot;') and starts-with(substring-after(substring-after($number-format-unit,'&quot;'),'&quot;'),'S'))">
+ <number:minutes/>
+ </xsl:when>
+ <xsl:otherwise>
+ <number:month/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'#') or starts-with($number-format-unit,'0')">
+ <xsl:variable name="digits-part">
+ <xsl:choose>
+ <xsl:when test="contains($number-format-unit,'&quot;')">
+ <xsl:value-of select="substring-before($number-format-unit,'&quot;')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$number-format-unit"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="decimal-integer-exponent-fraction">
+ <xsl:with-param name="digits-part" select="$digits-part"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:variable name="unit-length">
+ <xsl:choose>
+ <xsl:when test="starts-with($number-format-unit,'[value()')">
+ <xsl:value-of select="string-length(substring-before($number-format-unit,']')) +2"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[NatNum')">
+ <xsl:value-of select="string-length(substring-before($number-format-unit,']')) +2"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$-804]')">8</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'&quot;')">
+ <xsl:value-of select="string-length(substring-before(substring-after($number-format-unit,'&quot;'),'&quot;')) +3"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'@')">2</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'-') or starts-with($number-format-unit,'$') or starts-with($number-format-unit,'¥')">2</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'YYYY')">5</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'YY')">3</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'MMMM')">5</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'MMM')">4</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'MM')">3</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'M')">2</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'DD')">3</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'D')">2</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[HH]')">5</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'HH')">3</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'H')">2</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'SS.00')">6</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'SS')">3</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'S')">2</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'AM/PM')">6</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'NNNN')">5</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'NNN')">4</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'QQ')">3</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'Q')">2</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'WW')">3</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'#') or starts-with($number-format-unit,'0')">
+ <xsl:choose>
+ <xsl:when test="contains($number-format-unit,'&quot;')">
+ <xsl:value-of select="string-length(substring-before($number-format-unit,'&quot;')) +1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="string-length($number-format-unit) +1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$unit-length &gt;1 and $unit-length &lt;=string-length($number-format-unit)">
+ <xsl:call-template name="general-number">
+ <xsl:with-param name="number-format-unit" select="substring($number-format-unit,$unit-length)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="decimal-integer-exponent-fraction">
+ <xsl:param name="digits-part"/>
+ <xsl:variable name="decimal-digits">
+ <xsl:choose>
+ <xsl:when test="contains($digits-part,'.')">
+ <xsl:choose>
+ <xsl:when test="contains($digits-part,' ')">
+ <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),' '))"/>
+ </xsl:when>
+ <xsl:when test="contains(substring-after($digits-part,'.'),',')">
+ <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),','))"/>
+ </xsl:when>
+ <xsl:when test="contains($digits-part,'E')">
+ <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),'E'))"/>
+ </xsl:when>
+ <xsl:when test="contains($digits-part,'e')">
+ <xsl:value-of select="string-length(substring-before(substring-after($digits-part,'.'),'e'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="string-length(substring-after($digits-part,'.'))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="decimal-replacement">
+ <xsl:choose>
+ <xsl:when test="contains($digits-part,'.')">
+ <xsl:choose>
+ <xsl:when test="contains($digits-part,' ') and contains(substring-before(substring-after($digits-part,'.'),' '),'#')">true</xsl:when>
+ <xsl:when test="contains($digits-part,'E') and contains(substring-before(substring-after($digits-part,'.'),'E'),'#')">true</xsl:when>
+ <xsl:when test="contains($digits-part,'e') and contains(substring-before(substring-after($digits-part,'.'),'e'),'#')">true</xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="contains(substring-after($digits-part,'.'),'#')">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="integer-digits">
+ <xsl:choose>
+ <xsl:when test="contains($digits-part,'.')">
+ <xsl:value-of select="string-length(substring-before($digits-part,'.')) - string-length(translate(substring-before($digits-part,'.'),'0',''))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="string-length($digits-part) - string-length(translate($digits-part,'0',''))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="factor-digits">
+ <xsl:call-template name="display-factor-digits">
+ <xsl:with-param name="digits-part" select="$digits-part"/>
+ <xsl:with-param name="count" select="0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="grouping">
+ <xsl:choose>
+ <xsl:when test="(string-length($digits-part) - string-length(translate($digits-part,',',''))) &gt;$factor-digits">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="exponent-digits">
+ <xsl:choose>
+ <xsl:when test="contains($digits-part,'E')">
+ <xsl:value-of select="string-length(substring-after($digits-part,'E')) -1"/>
+ </xsl:when>
+ <xsl:when test="contains($digits-part,'e')">
+ <xsl:value-of select="string-length(substring-after($digits-part,'e')) -1"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="numerator-digits">
+ <xsl:choose>
+ <xsl:when test="contains($digits-part,' ')">
+ <xsl:value-of select="string-length(substring-before(substring-after($digits-part,' '),'/'))"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="denominator-digits">
+ <xsl:choose>
+ <xsl:when test="contains($digits-part,' ')">
+ <xsl:value-of select="string-length(substring-after(substring-after($digits-part,' '),'/'))"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="number-type">
+ <xsl:choose>
+ <xsl:when test="$exponent-digits &gt;0">number:scientific-number</xsl:when>
+ <xsl:when test="($numerator-digits &gt;0) or ($denominator-digits &gt;0)">number:fraction</xsl:when>
+ <xsl:otherwise>number:number</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="{$number-type}">
+ <xsl:if test="$decimal-digits &gt;=0">
+ <xsl:attribute name="number:decimal-places"><xsl:value-of select="$decimal-digits"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$decimal-replacement='true'">
+ <xsl:attribute name="number:decimal-replacement"/>
+ </xsl:if>
+ <xsl:if test="$integer-digits &gt;=0">
+ <xsl:attribute name="number:min-integer-digits"><xsl:value-of select="$integer-digits"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$grouping='true'">
+ <xsl:attribute name="number:grouping"><xsl:value-of select="$grouping"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$factor-digits &gt;0">
+ <xsl:attribute name="number:display-factor"><xsl:choose><xsl:when test="$factor-digits=1">1000</xsl:when><xsl:when test="$factor-digits=2">1000000</xsl:when><xsl:when test="$factor-digits=3">1000000000</xsl:when><xsl:when test="$factor-digits=4">1000000000000</xsl:when><xsl:when test="$factor-digits=5">1000000000000000</xsl:when><xsl:when test="$factor-digits=6">1000000000000000000</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$exponent-digits &gt;0">
+ <xsl:attribute name="number:min-exponent-digits"><xsl:value-of select="$exponent-digits"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$numerator-digits &gt;0">
+ <xsl:attribute name="number:min-numerator-digits"><xsl:value-of select="$numerator-digits"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$denominator-digits &gt;0">
+ <xsl:attribute name="number:min-denominator-digits"><xsl:value-of select="$denominator-digits"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="number-format-color">
+ <xsl:param name="number-format-unit"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($number-format-unit,'[Black]')">
+ <style:text-properties fo:color="#000000"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Blue]')">
+ <style:text-properties fo:color="#0000ff"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Cyan]')">
+ <style:text-properties fo:color="#00ffff"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Green]')">
+ <style:text-properties fo:color="#00ff00"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Magenta]')">
+ <style:text-properties fo:color="#ff00ff"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Red]')">
+ <style:text-properties fo:color="#ff0000"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[White]')">
+ <style:text-properties fo:color="#ffffff"/>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Yellow]')">
+ <style:text-properties fo:color="#ffff00"/>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:variable name="unit-length">
+ <xsl:choose>
+ <xsl:when test="starts-with($number-format-unit,'[Black]')">8</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Blue]')">7</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Cyan]')">7</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Green]')">8</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Magenta]')">10</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Red]')">6</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[White]')">8</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[Yellow]')">9</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$unit-length &gt;1 and $unit-length &lt;=string-length($number-format-unit)">
+ <xsl:call-template name="general-number">
+ <xsl:with-param name="number-format-unit" select="substring($number-format-unit,$unit-length)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="number-format-currency">
+ <xsl:param name="number-format-unit"/>
+ <xsl:choose>
+ <xsl:when test="starts-with($number-format-unit,'[$¥-804]')">
+ <number:currency-symbol number:language="zh" number:country="CN">¥</number:currency-symbol>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$$-409]')">
+ <number:currency-symbol number:language="en" number:country="US">$</number:currency-symbol>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$$-2C0A]')">
+ <number:currency-symbol number:language="es" number:country="AR">$</number:currency-symbol>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$$-C0C]')">
+ <number:currency-symbol number:language="fr" number:country="CA">$</number:currency-symbol>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$CNY]')">
+ <number:currency-symbol>CNY</number:currency-symbol>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$AFA]')">
+ <number:currency-symbol>AFA</number:currency-symbol>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'CNY')">
+ <number:currency-symbol>CNY</number:currency-symbol>
+ </xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'CCC')">
+ <number:currency-symbol>CCC</number:currency-symbol>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:variable name="unit-length">
+ <xsl:choose>
+ <xsl:when test="starts-with($number-format-unit,'[$¥-804]')">9</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$$-409]')">9</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$$-2C0A]')">10</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$$-C0C]')">9</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$CNY]')">7</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'[$AFA]')">7</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'CNY')">4</xsl:when>
+ <xsl:when test="starts-with($number-format-unit,'CCC')">4</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$unit-length &gt;1 and $unit-length &lt;=string-length($number-format-unit)">
+ <xsl:call-template name="general-number">
+ <xsl:with-param name="number-format-unit" select="substring($number-format-unit,$unit-length)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="display-factor-digits">
+ <xsl:param name="digits-part"/>
+ <xsl:param name="count"/>
+ <xsl:choose>
+ <xsl:when test="not(substring($digits-part,string-length($digits-part),1) =',')">
+ <xsl:value-of select="$count"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="display-factor-digits">
+ <xsl:with-param name="digits-part" select="substring($digits-part,1,string-length($digits-part) -1)"/>
+ <xsl:with-param name="count" select="$count +1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="element-attribute">
+ <xsl:param name="number-format-unit"/>
+ <xsl:if test="contains($number-format-unit,'[HH]')">
+ <xsl:attribute name="number:truncate-on-overflow">false</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="starts-with($number-format-unit,'[NatNum1]')">
+ <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
+ <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="starts-with($number-format-unit,'[NatNum2]')">
+ <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
+ <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="starts-with($number-format-unit,'[NatNum3]')">
+ <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
+ <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="starts-with($number-format-unit,'[NatNum4]')">
+ <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
+ <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="starts-with($number-format-unit,'[NatNum5]')">
+ <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
+ <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="starts-with($number-format-unit,'[NatNum6]')">
+ <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
+ <xsl:attribute name="number:transliteration-style">long</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="starts-with($number-format-unit,'[NatNum7]')">
+ <xsl:attribute name="number:transliteration-format">一</xsl:attribute>
+ <xsl:attribute name="number:transliteration-style">medium</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="starts-with($number-format-unit,'[NatNum8]')">
+ <xsl:attribute name="number:transliteration-format">壹</xsl:attribute>
+ <xsl:attribute name="number:transliteration-style">medium</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="starts-with($number-format-unit,'[NatNum0]')">
+ <xsl:attribute name="number:transliteration-format">1</xsl:attribute>
+ <xsl:attribute name="number:transliteration-style">short</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="contains($number-format-unit,'[$-804]')">
+ <xsl:attribute name="number:transliteration-language">zh</xsl:attribute>
+ <xsl:attribute name="number:transliteration-country">CN</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:key name="pz" match="/uof:UOF/uof:对象集/图:图形" use="@图:标识符"/>
+ <xsl:template match="表:批注" mode="body">
+ <xsl:element name="office:annotation">
+ <xsl:if test="@表:是否显示 = 'true'">
+ <xsl:attribute name="office:display">true</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="uof:锚点/@uof:图形引用"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(uof:锚点/@uof:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(uof:锚点/@uof:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(uof:锚点/@uof:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(uof:锚点/@uof:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:variable name="w">
+ <xsl:value-of select="./uof:锚点/@uof:图形引用"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="key('pz',$w)/图:文本内容/字:句/字:文本串">
+ <text:p>
+ <xsl:for-each select="key('pz',$w)/图:文本内容/字:句">
+ <text:span>
+ <xsl:if test="字:句属性/@字:式样引用">
+ <xsl:attribute name="text:style-name"><xsl:value-of select="字:句属性/@字:式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:value-of select="字:文本串"/>
+ </text:span>
+ </xsl:for-each>
+ </text:p>
+ </xsl:when>
+ </xsl:choose>
+ <!--xsl:if test="图:文本内容/字:段落/字:句/字:文本串">
+ <text:p>
+ <xsl:call-template name="create-comment-data-content">
+ <xsl:with-param name="style-id" select="../@表:式样引用"/>
+ </xsl:call-template>
+ </text:p>
+ </xsl:if-->
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="auto-filter-condition">
+ <xsl:param name="conditon-set"/>
+ <xsl:param name="zone-left-column-num"/>
+ <xsl:if test="$conditon-set">
+ <xsl:variable name="first-condition" select="$conditon-set[1]"/>
+ <xsl:element name="table:filter-condition">
+ <xsl:attribute name="table:field-number"><xsl:value-of select="$first-condition/@表:列号 - $zone-left-column-num"/></xsl:attribute>
+ <xsl:attribute name="office:value"><xsl:choose><xsl:when test="$first-condition/表:普通"><xsl:value-of select="$first-condition/表:普通/@表:值"/></xsl:when><xsl:when test="$first-condition/表:自定义"><xsl:value-of select="$first-condition/表:自定义/表:操作条件/表:值"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:variable name="operator">
+ <xsl:choose>
+ <xsl:when test="$first-condition/表:普通">
+ <xsl:variable name="general" select="$first-condition/表:普通/@表:类型"/>
+ <xsl:choose>
+ <xsl:when test="$general ='topitem'">top values</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$first-condition/表:自定义">
+ <xsl:variable name="operator-text" select="$first-condition/表:自定义/表:操作条件/表:操作码/text()"/>
+ <xsl:choose>
+ <xsl:when test="$operator-text ='less than'">&lt;</xsl:when>
+ <xsl:when test="$operator-text ='greater than'">&gt;</xsl:when>
+ <xsl:when test="$operator-text ='equal to'">
+ <xsl:value-of select="'='"/>
+ </xsl:when>
+ <xsl:when test="$operator-text ='greater than or equal to'">
+ <xsl:value-of select="'&gt;='"/>
+ </xsl:when>
+ <xsl:when test="$operator-text ='less than or equal to'">
+ <xsl:value-of select="'&lt;='"/>
+ </xsl:when>
+ <xsl:when test="$operator-text ='not equal to'">
+ <xsl:value-of select="'!='"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="table:operator"><xsl:value-of select="$operator"/></xsl:attribute>
+ </xsl:element>
+ <xsl:call-template name="auto-filter-condition">
+ <xsl:with-param name="conditon-set" select="$conditon-set[position()!=1]"/>
+ <xsl:with-param name="zone-left-column-num" select="$zone-left-column-num"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="translate-column-char-to-number">
+ <xsl:param name="string"/>
+ <xsl:choose>
+ <xsl:when test="string-length($string)=1">
+ <xsl:call-template name="char-to-number">
+ <xsl:with-param name="char" select="$string"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="tens-place">
+ <xsl:call-template name="char-to-number">
+ <xsl:with-param name="char" select="substring($string,1,1)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="units-place">
+ <xsl:call-template name="char-to-number">
+ <xsl:with-param name="char" select="substring($string,2,1)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$tens-place * 26 + $units-place"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="char-to-number">
+ <xsl:param name="char"/>
+ <xsl:choose>
+ <xsl:when test="$char='A'">1</xsl:when>
+ <xsl:when test="$char='B'">2</xsl:when>
+ <xsl:when test="$char='C'">3</xsl:when>
+ <xsl:when test="$char='D'">4</xsl:when>
+ <xsl:when test="$char='E'">5</xsl:when>
+ <xsl:when test="$char='F'">6</xsl:when>
+ <xsl:when test="$char='G'">7</xsl:when>
+ <xsl:when test="$char='H'">8</xsl:when>
+ <xsl:when test="$char='I'">9</xsl:when>
+ <xsl:when test="$char='J'">10</xsl:when>
+ <xsl:when test="$char='K'">11</xsl:when>
+ <xsl:when test="$char='L'">12</xsl:when>
+ <xsl:when test="$char='M'">13</xsl:when>
+ <xsl:when test="$char='N'">14</xsl:when>
+ <xsl:when test="$char='O'">15</xsl:when>
+ <xsl:when test="$char='P'">16</xsl:when>
+ <xsl:when test="$char='Q'">17</xsl:when>
+ <xsl:when test="$char='R'">18</xsl:when>
+ <xsl:when test="$char='S'">19</xsl:when>
+ <xsl:when test="$char='T'">20</xsl:when>
+ <xsl:when test="$char='U'">21</xsl:when>
+ <xsl:when test="$char='V'">22</xsl:when>
+ <xsl:when test="$char='W'">23</xsl:when>
+ <xsl:when test="$char='X'">24</xsl:when>
+ <xsl:when test="$char='Y'">25</xsl:when>
+ <xsl:when test="$char='Z'">26</xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="translate-expression2">
+ <xsl:param name="expression2"/>
+ <xsl:choose>
+ <xsl:when test="contains($expression2,':')">
+ <xsl:variable name="column-one">
+ <xsl:value-of select="substring(substring-before($expression2,':'),1,1)"/>
+ </xsl:variable>
+ <xsl:variable name="row-one">
+ <xsl:value-of select="substring(substring-before($expression2,':'),2)"/>
+ </xsl:variable>
+ <xsl:variable name="column-two">
+ <xsl:value-of select="substring(substring-after($expression2,':'),1,1)"/>
+ </xsl:variable>
+ <xsl:variable name="row-two">
+ <xsl:value-of select="substring(substring-after($expression2,':'),2)"/>
+ </xsl:variable>
+ <xsl:variable name="column-value1">
+ <xsl:call-template name="character-to-column">
+ <xsl:with-param name="column-value" select="$column-one"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="column-value2">
+ <xsl:call-template name="character-to-column">
+ <xsl:with-param name="column-value" select="$column-two"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat('R',$row-one,'C',$column-value1,':','R',$row-two,'C',$column-value2)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="column-one">
+ <xsl:value-of select="substring($expression2,1,1)"/>
+ </xsl:variable>
+ <xsl:variable name="row-one">
+ <xsl:value-of select="substring($expression2,2)"/>
+ </xsl:variable>
+ <xsl:variable name="column-value1">
+ <xsl:call-template name="character-to-column">
+ <xsl:with-param name="column-value" select="$column-one"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat('R',$row-one,'C',$column-value1)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="character-to-column">
+ <xsl:param name="column-value"/>
+ <xsl:choose>
+ <xsl:when test="$column-value= 'A'">1</xsl:when>
+ <xsl:when test="$column-value= 'B'">2</xsl:when>
+ <xsl:when test="$column-value= 'C'">3</xsl:when>
+ <xsl:when test="$column-value= 'D'">4</xsl:when>
+ <xsl:when test="$column-value= 'E'">5</xsl:when>
+ <xsl:when test="$column-value= 'F'">6</xsl:when>
+ <xsl:when test="$column-value= 'G'">7</xsl:when>
+ <xsl:when test="$column-value= 'H'">8</xsl:when>
+ <xsl:when test="$column-value= 'I'">9</xsl:when>
+ <xsl:when test="$column-value= 'J'">10</xsl:when>
+ <xsl:when test="$column-value= 'K'">11</xsl:when>
+ <xsl:when test="$column-value= 'L'">12</xsl:when>
+ <xsl:when test="$column-value= 'M'">13</xsl:when>
+ <xsl:when test="$column-value= 'N'">14</xsl:when>
+ <xsl:when test="$column-value= 'O'">15</xsl:when>
+ <xsl:when test="$column-value= 'P'">16</xsl:when>
+ <xsl:when test="$column-value= 'Q'">17</xsl:when>
+ <xsl:when test="$column-value= 'R'">18</xsl:when>
+ <xsl:when test="$column-value= 'S'">19</xsl:when>
+ <xsl:when test="$column-value= 'T'">20</xsl:when>
+ <xsl:when test="$column-value= 'U'">21</xsl:when>
+ <xsl:when test="$column-value= 'V'">22</xsl:when>
+ <xsl:when test="$column-value= 'W'">23</xsl:when>
+ <xsl:when test="$column-value= 'X'">24</xsl:when>
+ <xsl:when test="$column-value= 'Y'">25</xsl:when>
+ <xsl:when test="$column-value= 'Z'">26</xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <!--chenjh end 20050611-->
+ <xsl:template name="工作表属性">
+ <!--office:settings-->
+ <xsl:variable name="sheetprop" select="/uof:UOF/uof:电子表格/表:主体/表:工作表"/>
+ <config:config-item-set config:name="ooo:view-settings">
+ <xsl:variable name="ratio" select="15"/>
+ <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/表:单元格/表:数据/字:句/字:修订开始">
+ <config:config-item-set config:name="TrackedChangesViewSettings">
+ <config:config-item config:name="ShowChanges" config:type="boolean">true</config:config-item>
+ <config:config-item config:name="ShowAcceptedChanges" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ShowRejectedChanges" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ShowChangesByDatetime" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ShowChangesByDatetimeMode" config:type="short">0</config:config-item>
+ <config:config-item config:name="ShowChangesByDatetimeFirstDatetime" config:type="datetime">2007-01-17T10:56:46.21</config:config-item>
+ <config:config-item config:name="ShowChangesByDatetimeSecondDatetime" config:type="datetime">2007-01-17T10:56:46.21</config:config-item>
+ <config:config-item config:name="ShowChangesByAuthor" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ShowChangesByAuthorName" config:type="string"/>
+ <config:config-item config:name="ShowChangesByComment" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ShowChangesByCommentText" config:type="string"/>
+ <config:config-item config:name="ShowChangesByRanges" config:type="boolean">false</config:config-item>
+ <config:config-item config:name="ShowChangesByRangesList" config:type="string"/>
+ </config:config-item-set>
+ </xsl:if>
+ <config:config-item-map-indexed config:name="Views">
+ <config:config-item-map-entry>
+ <config:config-item config:name="ViewId" config:type="string">View1</config:config-item>
+ <config:config-item-map-named config:name="Tables">
+ <xsl:for-each select="$sheetprop/表:工作表属性/表:视图">
+ <xsl:element name="config:config-item-map-entry">
+ <xsl:attribute name="config:name"><xsl:value-of select="ancestor::表:工作表/@表:名称"/></xsl:attribute>
+ <xsl:element name="config:config-item">
+ <xsl:attribute name="config:name">HorizontalSplitMode</xsl:attribute>
+ <xsl:attribute name="config:type">short</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="表:冻结 and 表:冻结/@表:列号!=0">2</xsl:when>
+ <xsl:when test="表:冻结 and 表:冻结/@表:列号=0">0</xsl:when>
+ <xsl:when test="表:拆分 and 表:拆分/@表:宽度!=0">1</xsl:when>
+ <xsl:when test="表:拆分 and 表:拆分/@表:宽度=0">0</xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="config:config-item">
+ <xsl:attribute name="config:name">VerticalSplitMode</xsl:attribute>
+ <xsl:attribute name="config:type">short</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="表:冻结 and 表:冻结/@表:行号!=0">2</xsl:when>
+ <xsl:when test="表:冻结 and 表:冻结/@表:行号=0">0</xsl:when>
+ <xsl:when test="表:拆分 and 表:拆分/@表:高度!=0">1</xsl:when>
+ <xsl:when test="表:拆分 and 表:拆分/@表:高度=0">0</xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="config:config-item">
+ <xsl:attribute name="config:name">HorizontalSplitPosition</xsl:attribute>
+ <xsl:attribute name="config:type">int</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="表:冻结 and 表:冻结/@表:列号=0">0</xsl:when>
+ <xsl:when test="表:冻结 and 表:冻结/@表:列号!=0">
+ <xsl:value-of select="表:冻结/@表:列号"/>
+ </xsl:when>
+ <xsl:when test="表:拆分 and 表:拆分/@表:宽度=0">0</xsl:when>
+ <xsl:when test="表:拆分 and 表:拆分/@表:宽度!=0">
+ <xsl:value-of select="表:拆分/@表:宽度"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:element name="config:config-item">
+ <xsl:attribute name="config:name">VerticalSplitPosition</xsl:attribute>
+ <xsl:attribute name="config:type">int</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="表:冻结 and 表:冻结/@表:行号=0">0</xsl:when>
+ <xsl:when test="表:冻结 and 表:冻结/@表:行号!=0">
+ <xsl:value-of select="表:冻结/@表:行号"/>
+ </xsl:when>
+ <xsl:when test="表:拆分 and 表:拆分/@表:高度=0">0</xsl:when>
+ <xsl:when test="表:拆分 and 表:拆分/@表:高度!=0">
+ <xsl:value-of select="表:拆分/@表:高度"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:variable name="position-top">
+ <xsl:choose>
+ <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:最上行">
+ <xsl:value-of select="//表:工作表属性/表:视图/表:最上行"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="position-left">
+ <xsl:choose>
+ <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:最左列">
+ <xsl:value-of select="$sheetprop/表:工作表属性/表:视图/表:最左列"/>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <config:config-item config:name="PositionRight" config:type="int">
+ <xsl:value-of select="$position-left"/>
+ </config:config-item>
+ <config:config-item config:name="PositionBottom" config:type="int">
+ <xsl:value-of select="$position-top"/>
+ </config:config-item>
+ </xsl:element>
+ </xsl:for-each>
+ </config:config-item-map-named>
+ <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:当前视图">
+ <xsl:element name="config:config-item">
+ <xsl:attribute name="config:name">ShowPageBreakPreview</xsl:attribute>
+ <xsl:attribute name="config:type">boolean</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:当前视图/@表:类型='normal'">false</xsl:when>
+ <xsl:otherwise>true</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:网格">
+ <xsl:element name="config:config-item">
+ <xsl:attribute name="config:name">ShowGrid</xsl:attribute>
+ <xsl:attribute name="config:type">boolean</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="$sheetprop/表:工作表属性/表:视图/表:网格/@表:值=1 or $sheetprop/表:工作表属性/表:视图/表:网格/@表:值='true'">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:网格颜色">
+ <xsl:element name="config:config-item">
+ <xsl:attribute name="config:name">GridColor</xsl:attribute>
+ <xsl:attribute name="config:type">long</xsl:attribute>
+ <xsl:call-template name="transform-hex-to-decimal">
+ <xsl:with-param name="number" select="//表:视图/表:网格颜色/text()"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:选中">
+ <xsl:element name="config:config-item">
+ <xsl:attribute name="config:name">ActiveTable</xsl:attribute>
+ <xsl:attribute name="config:type">string</xsl:attribute>
+ <xsl:value-of select="$sheetprop/表:工作表属性/表:视图[表:选中]/ancestor::表:工作表/@表:名称"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:缩放">
+ <config:config-item config:name="ZoomValue" config:type="int">
+ <xsl:value-of select="$sheetprop/表:工作表属性/表:视图/表:缩放/text()"/>
+ </config:config-item>
+ </xsl:if>
+ <xsl:if test="$sheetprop/表:工作表属性/表:视图/表:分页缩放">
+ <config:config-item config:name="PageViewZoomValue" config:type="int">
+ <xsl:value-of select="$sheetprop/表:工作表属性/表:视图/表:分页缩放/text()"/>
+ </config:config-item>
+ </xsl:if>
+ </config:config-item-map-entry>
+ </config:config-item-map-indexed>
+ </config:config-item-set>
+ </xsl:template>
+ <xsl:template name="create-page-master">
+ <xsl:param name="worksheetoptions"/>
+ <xsl:for-each select="$worksheetoptions">
+ <xsl:element name="style:page-layout">
+ <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'pm_', ../@表:名称)"/></xsl:call-template></xsl:attribute>
+ <xsl:element name="style:page-layout-properties">
+ <xsl:if test="表:页面设置/表:纸张/@uof:宽度">
+ <xsl:attribute name="fo:page-width"><xsl:value-of select="concat(表:页面设置/表:纸张/@uof:宽度,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:页面设置/表:纸张/@uof:高度">
+ <xsl:attribute name="fo:page-height"><xsl:value-of select="concat(表:页面设置/表:纸张/@uof:高度,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:页面设置/表:纸张方向">
+ <xsl:attribute name="style:print-orientation"><xsl:value-of select="表:页面设置/表:纸张方向"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:页面设置/表:缩放">
+ <xsl:attribute name="style:scale-to"><xsl:value-of select="concat(表:页面设置/表:缩放,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="/uof:UOF/uof:电子表格/表:主体/表:工作表/@表:背景">
+ <xsl:attribute name="fo:background-color"><xsl:value-of select="/uof:UOF/uof:电子表格/表:主体/表:工作表/@表:背景"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style:first-page-number">continue</xsl:attribute>
+ <xsl:if test="表:页面设置/表:页边距">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(表:页面设置/表:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:页面设置/表:打印/@表:先列后行='true'">
+ <xsl:attribute name="style:print-page-order">ltr</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:页面设置/表:垂直对齐/@表:对齐方式">
+ <xsl:attribute name="style:table-centering">vertical</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:页面设置/表:水平对齐/@表:对齐方式">
+ <xsl:attribute name="style:table-centering">horizontal</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ <xsl:element name="style:header-style">
+ <xsl:element name="style:header-footer-properties">
+ <xsl:attribute name="fo:min-height">0.75cm</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="表:页面设置/表:页眉页脚/@uof:边距">
+ <xsl:attribute name="fo:margin-bottom"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(表:页面设置/表:页眉页脚/@uof:边距,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:margin-bottom">0.25cm</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ <xsl:element name="style:footer-style">
+ <xsl:element name="style:header-footer-properties">
+ <xsl:attribute name="fo:min-height">0.75cm</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="表:页面设置/表:页眉页脚/@uof:边距">
+ <xsl:attribute name="fo:margin-top"><xsl:call-template name="convert2cm"><xsl:with-param name="value" select="concat(表:页面设置/表:页眉页脚/@uof:边距,'pt')"/></xsl:call-template><xsl:text>cm</xsl:text></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:margin-top">0.25cm</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template match="字:文本串">
+ <xsl:value-of select="text()"/>
+ </xsl:template>
+ <xsl:template match="字:换行符">
+ <xsl:element name="text:line-break"/>
+ </xsl:template>
+ <xsl:template match="字:制表符">
+ <xsl:element name="text:tab-stop"/>
+ </xsl:template>
+ <xsl:template match="字:区域开始">
+ <xsl:if test="@字:类型='hyperlink'">
+ <xsl:variable name="superlink" select="//uof:超级链接[@uof:标识符=current()/@字:标识符]"/>
+ <xsl:element name="text:a">
+ <xsl:attribute name="xlink:href"><xsl:value-of select="$superlink/@uof:目标"/></xsl:attribute>
+ <xsl:value-of select="$superlink/@uof:提示"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:空格符">
+ <xsl:element name="text:s">
+ <xsl:if test="@字:个数">
+ <xsl:attribute name="text:c"><xsl:value-of select="@字:个数"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="create-page-header-footer-text-p">
+ <xsl:param name="paragragh-set"/>
+ <xsl:choose>
+ <xsl:when test="$paragragh-set">
+ <xsl:element name="text:p">
+ <xsl:for-each select="$paragragh-set[1]/字:句">
+ <xsl:choose>
+ <xsl:when test="not(字:句属性)">
+ <xsl:apply-templates select="字:文本串 | 字:空格符 | 字:换行符"/>
+ </xsl:when>
+ <xsl:when test="字:句属性">
+ <xsl:element name="text:span">
+ <xsl:attribute name="text:style-name"><xsl:value-of select="//uof:句式样[@字:标识符=current()/字:句属性/@字:式样引用]/@字:名称"/></xsl:attribute>
+ <xsl:apply-templates select="字:空格符 | 字:文本串 | 字:换行符 | 字:制表符"/>
+ </xsl:element>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:element>
+ <xsl:call-template name="create-page-header-footer-text-p">
+ <xsl:with-param name="paragragh-set" select="$paragragh-set[position()!=1]"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <!--Redoffice comment lilliang SC0016 06.02.16 -->
+ <!--新增内容-->
+ <xsl:template match="字:段落">
+ <xsl:element name="text:p">
+ <xsl:choose>
+ <xsl:when test="字:段落属性">
+ <xsl:attribute name="text:style-name">P<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="generate-id(ancestor::字:主体/descendant::字:段落[1]) = generate-id(.)">
+ <!-- create the leading paragraph style name in one section for master page style application, glu -->
+ <xsl:variable name="paragraph-number">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
+ </xsl:variable>
+ <xsl:attribute name="text:style-name">P<xsl:value-of select="number($paragraph-number)"/>_1</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="not(字:段落属性) and (descendant::字:分栏符 or ancestor::字:分节/descendant::字:节属性[字:分栏/@字:栏数 &gt; 1])">
+ <xsl:attribute name="text:style-name">ColumnBreakPara</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:句">
+ <xsl:apply-templates select="字:句/字:文本串"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:template>
+ <!--Redoffice comment liliang end 06.02.16-->
+ <xsl:template name="create-master-styles">
+ <xsl:param name="worksheetoptions"/>
+ <xsl:for-each select="$worksheetoptions">
+ <xsl:element name="style:master-page">
+ <xsl:attribute name="style:name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'TAB_', ../@表:名称)"/></xsl:call-template></xsl:attribute>
+ <!--xsl:attribute name="style:page-layout-name"-->
+ <xsl:attribute name="style:page-layout-name"><xsl:call-template name="encode-as-nc-name"><xsl:with-param name="string" select="concat( 'pm_', ../@表:名称)"/></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="style:display-name"><xsl:value-of select="concat( 'PageStyle_', ../@表:名称)"/></xsl:attribute>
+ <style:header>
+ <xsl:for-each select="表:页面设置/表:页眉页脚">
+ <xsl:variable name="temp" select="@表:位置"/>
+ <xsl:choose>
+ <xsl:when test="contains($temp,'header')">
+ <xsl:if test="字:段落">
+ <xsl:choose>
+ <xsl:when test="@表:位置='headerleft'">
+ <xsl:element name="style:region-left">
+ <xsl:call-template name="create-page-header-footer-text-p">
+ <xsl:with-param name="paragragh-set" select="字:段落"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@表:位置='headercenter'">
+ <xsl:element name="style:region-center">
+ <xsl:call-template name="create-page-header-footer-text-p">
+ <xsl:with-param name="paragragh-set" select="字:段落"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@表:位置='headerright'">
+ <xsl:element name="style:region-right">
+ <xsl:call-template name="create-page-header-footer-text-p">
+ <xsl:with-param name="paragragh-set" select="字:段落"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </style:header>
+ <style:footer>
+ <xsl:for-each select="表:页面设置/表:页眉页脚">
+ <xsl:variable name="temp" select="@表:位置"/>
+ <xsl:choose>
+ <xsl:when test="contains($temp,'footer')">
+ <xsl:if test="字:段落">
+ <xsl:choose>
+ <xsl:when test="@表:位置='footerleft'">
+ <xsl:element name="style:region-left">
+ <xsl:call-template name="create-page-header-footer-text-p">
+ <xsl:with-param name="paragragh-set" select="字:段落"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@表:位置='footercenter'">
+ <xsl:element name="style:region-center">
+ <xsl:call-template name="create-page-header-footer-text-p">
+ <xsl:with-param name="paragragh-set" select="字:段落"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@表:位置='footerright'">
+ <xsl:element name="style:region-right">
+ <xsl:call-template name="create-page-header-footer-text-p">
+ <xsl:with-param name="paragragh-set" select="字:段落"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </style:footer>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <!--xsl:template name="create-page-master">
+ </xsl:template>
+ <xsl:template match="表:页面设置">
+ </xsl:template>
- <xsl:template name="create-master-styles">
- </xsl:template>
+ <xsl:template name="create-master-styles">
+ </xsl:template>
<xsl:template name="表:工作表属性">
</xsl:template-->
- <!--00000000000-->
- <xsl:template match="uof:元数据">
- <office:meta>
- <xsl:if test="uof:创建应用程序">
- <meta:generator>
- <xsl:value-of select="uof:创建应用程序"/>
- </meta:generator>
- </xsl:if>
- <xsl:if test="uof:标题">
- <dc:title>
- <xsl:value-of select="uof:标题"/>
- </dc:title>
- </xsl:if>
- <xsl:if test="uof:摘要">
- <dc:description>
- <xsl:value-of select="uof:摘要"/>
- </dc:description>
- </xsl:if>
- <xsl:if test="uof:主题">
- <dc:subject>
- <xsl:value-of select="uof:主题"/>
- </dc:subject>
- </xsl:if>
- <xsl:if test="uof:作者">
- <meta:initial-creator>
- <xsl:value-of select="uof:作者"/>
- </meta:initial-creator>
- </xsl:if>
- <xsl:if test="uof:创建日期">
- <meta:creation-date>
- <xsl:value-of select="uof:创建日期"/>
- </meta:creation-date>
- </xsl:if>
- <xsl:if test="uof:最后作者">
- <dc:creator>
- <xsl:value-of select="uof:最后作者"/>
- </dc:creator>
- </xsl:if>
- <xsl:if test="uof:编辑时间">
- <meta:editing-duration>
- <xsl:value-of select="uof:编辑时间"/>
- </meta:editing-duration>
- </xsl:if>
- <dc:language/>
- <meta:keyword>
- <xsl:value-of select="uof:关键字集/uof:关键字"/>
- </meta:keyword>
- <xsl:if test="uof:编辑次数">
- <meta:editing-cycles>
- <xsl:value-of select="uof:编辑次数"/>
- </meta:editing-cycles>
- </xsl:if>
- <xsl:if test="uof:分类">
- <meta:user-defined meta:name="Category">
- <xsl:value-of select="uof:分类"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:if test="uof:经理名称">
- <meta:user-defined meta:name="Manager">
- <xsl:value-of select="uof:经理名称"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:if test="uof:公司名称">
- <meta:user-defined meta:name="Company">
- <xsl:value-of select="uof:公司名称"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:apply-templates select="uof:用户自定义元数据集"/>
- </office:meta>
- </xsl:template>
- <xsl:template match="uof:用户自定义元数据集">
- <xsl:for-each select="uof:用户自定义元数据">
- <meta:user-defined meta:name="{@uof:名称}">
- <xsl:value-of select="."/>
- </meta:user-defined>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="parse-range">
- <xsl:param name="range-value"/>
- <xsl:param name="last"/>
- <xsl:variable name="first-pit">
- <xsl:choose>
- <xsl:when test="contains($range-value,',')">
- <xsl:value-of select="substring-before($range-value,',')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$range-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="current">
- <xsl:choose>
- <xsl:when test="contains($first-pit,':')">
- <xsl:variable name="R-start" select="substring-before(substring-after($first-pit,'R'),'C')"/>
- <xsl:variable name="C-start" select="substring-before(substring-after($first-pit,'C'),':')"/>
- <xsl:variable name="second-pit" select="substring-after($first-pit,':')"/>
- <xsl:variable name="R-end" select="substring-before(substring-after($second-pit,'R'),'C')"/>
- <xsl:variable name="C-end" select="substring-after($second-pit,'C')"/>
- <xsl:variable name="the-str">
- <xsl:call-template name="condition-rc-str">
- <xsl:with-param name="r-start" select="$R-start"/>
- <xsl:with-param name="r-end" select="$R-end"/>
- <xsl:with-param name="c-start" select="$C-start"/>
- <xsl:with-param name="c-end" select="$C-end"/>
- <xsl:with-param name="last" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$the-str"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($first-pit,',')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="contains($range-value,',')">
- <xsl:call-template name="parse-range">
- <xsl:with-param name="range-value" select="substring-after($range-value,',')"/>
- <xsl:with-param name="last" select="concat($last,$current)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($last,$current)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="condition-rc-str">
- <!-- dealing the range of row\column -->
- <xsl:param name="r-start"/>
- <xsl:param name="r-end"/>
- <xsl:param name="c-start"/>
- <xsl:param name="c-end"/>
- <xsl:param name="last"/>
- <xsl:variable name="current">
- <xsl:call-template name="condition-c-str">
- <xsl:with-param name="rc-str" select="concat('R',$r-start)"/>
- <xsl:with-param name="start" select="$c-start"/>
- <xsl:with-param name="end" select="$c-end"/>
- <xsl:with-param name="last" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$r-start &lt; $r-end">
- <xsl:call-template name="condition-rc-str">
- <xsl:with-param name="r-start" select="$r-start + 1"/>
- <xsl:with-param name="r-end" select="$r-end"/>
- <xsl:with-param name="c-start" select="$c-start"/>
- <xsl:with-param name="c-end" select="$c-end"/>
- <xsl:with-param name="last" select="concat($last,$current)"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$r-start = $r-end">
- <xsl:value-of select="concat($last,$current)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="condition-c-str">
- <!-- return value for the template condition-rc-str -->
- <xsl:param name="rc-str"/>
- <xsl:param name="start"/>
- <xsl:param name="end"/>
- <xsl:param name="last"/>
- <xsl:variable name="current" select="concat($rc-str,'C',$start,',')"/>
- <xsl:if test="$start &lt; $end">
- <xsl:call-template name="condition-c-str">
- <xsl:with-param name="rc-str" select="$rc-str"/>
- <xsl:with-param name="start" select="$start + 1"/>
- <xsl:with-param name="end" select="$end"/>
- <xsl:with-param name="last" select="concat($last,$current)"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="$start = $end">
- <xsl:value-of select="concat($last,$current)"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="condition-str">
- <xsl:param name="param-str"/>
- <xsl:choose>
- <xsl:when test="contains($param-str,'(')">
- <xsl:call-template name="condition-str">
- <xsl:with-param name="param-str" select="substring-after($param-str,'(')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before($param-str,':')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="encode-as-cell-range-address">
- <xsl:param name="string"/>
- <xsl:value-of select="$string"/>
- </xsl:template>
- <xsl:template name="encode-as-cell-address">
- <xsl:param name="string"/>
- <xsl:value-of select="$string"/>
- </xsl:template>
- <!--chengxiuzhi 111111111111111111111111111111111111111111111111111111111111111-->
- <!-- measure_conversion.xsl Begin-->
- <xsl:param name="dpi" select="111"/>
- <xsl:param name="centimeter-in-mm" select="10"/>
- <xsl:param name="inch-in-mm" select="25.4"/>
- <xsl:param name="didot-point-in-mm" select="0.376065"/>
- <xsl:param name="pica-in-mm" select="4.2333333"/>
- <xsl:param name="point-in-mm" select="0.3527778"/>
- <xsl:param name="twip-in-mm" select="0.017636684"/>
- <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
- <!-- ***** MEASUREMENT CONVERSIONS *****
- PARAM 'value'
- The measure to be converted.
- The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
- directly added to the number.
+ <!--00000000000-->
+ <xsl:template match="uof:元数据">
+ <office:meta>
+ <xsl:if test="uof:创建应用程序">
+ <meta:generator>
+ <xsl:value-of select="uof:创建应用程序"/>
+ </meta:generator>
+ </xsl:if>
+ <xsl:if test="uof:标题">
+ <dc:title>
+ <xsl:value-of select="uof:标题"/>
+ </dc:title>
+ </xsl:if>
+ <xsl:if test="uof:摘要">
+ <dc:description>
+ <xsl:value-of select="uof:摘要"/>
+ </dc:description>
+ </xsl:if>
+ <xsl:if test="uof:主题">
+ <dc:subject>
+ <xsl:value-of select="uof:主题"/>
+ </dc:subject>
+ </xsl:if>
+ <xsl:if test="uof:作者">
+ <meta:initial-creator>
+ <xsl:value-of select="uof:作者"/>
+ </meta:initial-creator>
+ </xsl:if>
+ <xsl:if test="uof:创建日期">
+ <meta:creation-date>
+ <xsl:value-of select="uof:创建日期"/>
+ </meta:creation-date>
+ </xsl:if>
+ <xsl:if test="uof:最后作者">
+ <dc:creator>
+ <xsl:value-of select="uof:最后作者"/>
+ </dc:creator>
+ </xsl:if>
+ <xsl:if test="uof:编辑时间">
+ <meta:editing-duration>
+ <xsl:value-of select="uof:编辑时间"/>
+ </meta:editing-duration>
+ </xsl:if>
+ <dc:language/>
+ <meta:keyword>
+ <xsl:value-of select="uof:关键字集/uof:关键字"/>
+ </meta:keyword>
+ <xsl:if test="uof:编辑次数">
+ <meta:editing-cycles>
+ <xsl:value-of select="uof:编辑次数"/>
+ </meta:editing-cycles>
+ </xsl:if>
+ <xsl:if test="uof:分类">
+ <meta:user-defined meta:name="Category">
+ <xsl:value-of select="uof:分类"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:if test="uof:经理名称">
+ <meta:user-defined meta:name="Manager">
+ <xsl:value-of select="uof:经理名称"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:if test="uof:公司名称">
+ <meta:user-defined meta:name="Company">
+ <xsl:value-of select="uof:公司名称"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:apply-templates select="uof:用户自定义元数据集"/>
+ </office:meta>
+ </xsl:template>
+ <xsl:template match="uof:用户自定义元数据集">
+ <xsl:for-each select="uof:用户自定义元数据">
+ <meta:user-defined meta:name="{@uof:名称}">
+ <xsl:value-of select="."/>
+ </meta:user-defined>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="parse-range">
+ <xsl:param name="range-value"/>
+ <xsl:param name="last"/>
+ <xsl:variable name="first-pit">
+ <xsl:choose>
+ <xsl:when test="contains($range-value,',')">
+ <xsl:value-of select="substring-before($range-value,',')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$range-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="current">
+ <xsl:choose>
+ <xsl:when test="contains($first-pit,':')">
+ <xsl:variable name="R-start" select="substring-before(substring-after($first-pit,'R'),'C')"/>
+ <xsl:variable name="C-start" select="substring-before(substring-after($first-pit,'C'),':')"/>
+ <xsl:variable name="second-pit" select="substring-after($first-pit,':')"/>
+ <xsl:variable name="R-end" select="substring-before(substring-after($second-pit,'R'),'C')"/>
+ <xsl:variable name="C-end" select="substring-after($second-pit,'C')"/>
+ <xsl:variable name="the-str">
+ <xsl:call-template name="condition-rc-str">
+ <xsl:with-param name="r-start" select="$R-start"/>
+ <xsl:with-param name="r-end" select="$R-end"/>
+ <xsl:with-param name="c-start" select="$C-start"/>
+ <xsl:with-param name="c-end" select="$C-end"/>
+ <xsl:with-param name="last" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$the-str"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($first-pit,',')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="contains($range-value,',')">
+ <xsl:call-template name="parse-range">
+ <xsl:with-param name="range-value" select="substring-after($range-value,',')"/>
+ <xsl:with-param name="last" select="concat($last,$current)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($last,$current)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="condition-rc-str">
+ <!-- dealing the range of row\column -->
+ <xsl:param name="r-start"/>
+ <xsl:param name="r-end"/>
+ <xsl:param name="c-start"/>
+ <xsl:param name="c-end"/>
+ <xsl:param name="last"/>
+ <xsl:variable name="current">
+ <xsl:call-template name="condition-c-str">
+ <xsl:with-param name="rc-str" select="concat('R',$r-start)"/>
+ <xsl:with-param name="start" select="$c-start"/>
+ <xsl:with-param name="end" select="$c-end"/>
+ <xsl:with-param name="last" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$r-start &lt; $r-end">
+ <xsl:call-template name="condition-rc-str">
+ <xsl:with-param name="r-start" select="$r-start + 1"/>
+ <xsl:with-param name="r-end" select="$r-end"/>
+ <xsl:with-param name="c-start" select="$c-start"/>
+ <xsl:with-param name="c-end" select="$c-end"/>
+ <xsl:with-param name="last" select="concat($last,$current)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$r-start = $r-end">
+ <xsl:value-of select="concat($last,$current)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="condition-c-str">
+ <!-- return value for the template condition-rc-str -->
+ <xsl:param name="rc-str"/>
+ <xsl:param name="start"/>
+ <xsl:param name="end"/>
+ <xsl:param name="last"/>
+ <xsl:variable name="current" select="concat($rc-str,'C',$start,',')"/>
+ <xsl:if test="$start &lt; $end">
+ <xsl:call-template name="condition-c-str">
+ <xsl:with-param name="rc-str" select="$rc-str"/>
+ <xsl:with-param name="start" select="$start + 1"/>
+ <xsl:with-param name="end" select="$end"/>
+ <xsl:with-param name="last" select="concat($last,$current)"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:if test="$start = $end">
+ <xsl:value-of select="concat($last,$current)"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="condition-str">
+ <xsl:param name="param-str"/>
+ <xsl:choose>
+ <xsl:when test="contains($param-str,'(')">
+ <xsl:call-template name="condition-str">
+ <xsl:with-param name="param-str" select="substring-after($param-str,'(')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before($param-str,':')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="encode-as-cell-range-address">
+ <xsl:param name="string"/>
+ <xsl:value-of select="$string"/>
+ </xsl:template>
+ <xsl:template name="encode-as-cell-address">
+ <xsl:param name="string"/>
+ <xsl:value-of select="$string"/>
+ </xsl:template>
+ <!--chengxiuzhi 111111111111111111111111111111111111111111111111111111111111111-->
+ <!-- measure_conversion.xsl Begin-->
+ <xsl:param name="dpi" select="111"/>
+ <xsl:param name="centimeter-in-mm" select="10"/>
+ <xsl:param name="inch-in-mm" select="25.4"/>
+ <xsl:param name="didot-point-in-mm" select="0.376065"/>
+ <xsl:param name="pica-in-mm" select="4.2333333"/>
+ <xsl:param name="point-in-mm" select="0.3527778"/>
+ <xsl:param name="twip-in-mm" select="0.017636684"/>
+ <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
+ <!-- ***** MEASUREMENT CONVERSIONS *****
+ PARAM 'value'
+ The measure to be converted.
+ The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
+ directly added to the number.
- PARAM 'rounding-factor'
- Is used for the rounding of decimal places.
- The parameter number is the product of 1 and some '10', where
- every zero represents a decimal place.
+ PARAM 'rounding-factor'
+ Is used for the rounding of decimal places.
+ The parameter number is the product of 1 and some '10', where
+ every zero represents a decimal place.
- For example, providing as parameter:
- <xsl:param name="rounding-factor" select="10000" />
- Gives by default four decimal places.
+ For example, providing as parameter:
+ <xsl:param name="rounding-factor" select="10000" />
+ Gives by default four decimal places.
- To round two decimal places, basically the following is done:
- <xsl:value-of select="round(100 * value) div 100"/>
+ To round two decimal places, basically the following is done:
+ <xsl:value-of select="round(100 * value) div 100"/>
- RETURN The converted number, by default rounded to four decimal places.
- In case the input measure could not be matched the same value is
- returned and a warning message is written out.
+ RETURN The converted number, by default rounded to four decimal places.
+ In case the input measure could not be matched the same value is
+ returned and a warning message is written out.
- MEASURE LIST:
- * 1 milimeter (mm), the basic measure
+ MEASURE LIST:
+ * 1 milimeter (mm), the basic measure
- * 1 centimeter (cm) = 10 mm
+ * 1 centimeter (cm) = 10 mm
- * 1 inch (in) = 25.4 mm
- While the English have already seen the light (read: the metric system), the US
- remains loyal to this medieval system.
+ * 1 inch (in) = 25.4 mm
+ While the English have already seen the light (read: the metric system), the US
+ remains loyal to this medieval system.
- * 1 point (pt) = 0.35277777.. mm
- Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
- There are exactly 72 PostScript points in 1 inch.
+ * 1 point (pt) = 0.35277777.. mm
+ Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
+ There are exactly 72 PostScript points in 1 inch.
- * 1 twip = twentieth of a (PostScript) point
- A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
+ * 1 twip = twentieth of a (PostScript) point
+ A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
- * 1 didot point (dpt) = 0.376065 mm
- Didot point after the French typographer Firmin Didot (1764-1836).
+ * 1 didot point (dpt) = 0.376065 mm
+ Didot point after the French typographer Firmin Didot (1764-1836).
- More details under
- http://www.unc.edu/~rowlett/units/dictP.html:
- "A unit of length used by typographers and printers. When printing was done
- from hand-set metal type, one point represented the smallest element of type
- that could be handled, roughly 1/64 inch. Eventually, the point was standardized
- in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
- about 0.35 mm (351.46 micrometers). In continental Europe, typographers
- traditionally used a slightly larger point of 0.014 83 inch (about
- 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
- after the French typographer Firmin Didot (1764-1836). In the U.S.,
- Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
- or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
- of 0.351 459 8035 mm. The German standards agency DIN has proposed that
- all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
+ More details under
+ http://www.unc.edu/~rowlett/units/dictP.html:
+ "A unit of length used by typographers and printers. When printing was done
+ from hand-set metal type, one point represented the smallest element of type
+ that could be handled, roughly 1/64 inch. Eventually, the point was standardized
+ in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
+ about 0.35 mm (351.46 micrometers). In continental Europe, typographers
+ traditionally used a slightly larger point of 0.014 83 inch (about
+ 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
+ after the French typographer Firmin Didot (1764-1836). In the U.S.,
+ Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
+ or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
+ of 0.351 459 8035 mm. The German standards agency DIN has proposed that
+ all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
- * 1 pica = 4.233333 mm
- 1/6 inch or 12 points
+ * 1 pica = 4.233333 mm
+ 1/6 inch or 12 points
- * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
- Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
+ * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
+ Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
- -->
- <!-- changing measure to mm -->
- <xsl:template name="convert2mm">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="substring-before($value, 'mm')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm' ) * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in' ) * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'mm'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to cm -->
- <xsl:template name="convert2cm">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="substring-before($value, 'cm')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to inch (cp. section comment) -->
- <xsl:template name="convert2in">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $inch-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="substring-before($value, 'in')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $inch-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $inch-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $inch-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $inch-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $inch-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'in'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to dpt (cp. section comment) -->
- <xsl:template name="convert2dpt">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $didot-point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $didot-point-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $didot-point-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="substring-before($value, 'dpt')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $didot-point-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $didot-point-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $didot-point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'dpt'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pica (cp. section comment) -->
- <xsl:template name="convert2pica">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $pica-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $pica-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $pica-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $pica-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="substring-before($value, 'pica')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $pica-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $pica-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pica'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pt (cp. section comment) -->
- <xsl:template name="convert2pt">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $point-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="substring-before($value, 'pt')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $point-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $point-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $point-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pt'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pt (cp. section comment) -->
- <xsl:template name="convert2twip">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $twip-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $twip-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $twip-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $twip-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $twip-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="substring-before($value, 'twip')"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $twip-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'twip'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- changing measure to pixel by via parameter provided dpi (dots per inch) standard factor (cp. section comment) -->
- <xsl:template name="convert2px">
- <xsl:param name="value"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round(number(substring-before($value, 'mm')) div $pixel-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'cm')">
- <xsl:value-of select="round(number(substring-before($value, 'cm')) div $pixel-in-mm * $centimeter-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round(number(substring-before($value, 'in')) div $pixel-in-mm * $inch-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round(number(substring-before($value, 'pt')) div $pixel-in-mm * $point-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round(number(substring-before($value, 'dpt')) div $pixel-in-mm * $didot-point-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round(number(substring-before($value, 'pica')) div $pixel-in-mm * $pica-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round(number(substring-before($value, 'twip')) div $pixel-in-mm * $twip-in-mm)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="$value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'px'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- chenjh zhangying-->
- <xsl:template name="create-content-validations">
- <xsl:param name="validation-set"/>
- <xsl:if test="$validation-set">
- <xsl:variable name="first-validation" select="$validation-set[1]"/>
- <xsl:variable name="condition-text">
- <xsl:choose>
- <xsl:when test="$first-validation/表:校验类型/text()='whole number'">
- <xsl:choose>
- <xsl:when test="$first-validation/表:操作码/text()='between' ">
- <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='not between'">
- <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='greater than'">
- <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='less than'">
- <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$first-validation/表:校验类型/text()='decimal'">
- <xsl:choose>
- <xsl:when test="$first-validation/表:操作码/text()='between' ">
- <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='not between'">
- <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='greater than'">
- <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='less than'">
- <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$first-validation/表:校验类型/text()='date'">
- <xsl:choose>
- <xsl:when test="$first-validation/表:操作码/text()='between' ">
- <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='not between'">
- <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='greater than'">
- <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='less than'">
- <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$first-validation/表:校验类型/text()='time'">
- <xsl:choose>
- <xsl:when test="$first-validation/表:操作码/text()='between' ">
- <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='not between'">
- <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='greater than'">
- <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='less than'">
- <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
- <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <!-- add 20060317 -->
- <xsl:when test="$first-validation/表:校验类型/text()='cell range'">
- <xsl:value-of select="concat('oooc:cell-content-is-in-list',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:校验类型/text()='list'">
- <xsl:value-of select="concat('oooc:cell-content-is-in-list',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <!-- add 20060317 end -->
- <xsl:when test="$first-validation/表:校验类型/text()='text length'">
- <xsl:choose>
- <xsl:when test="$first-validation/表:操作码/text()='between' ">
- <xsl:value-of select="concat('oooc:cell-content-text-length-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='not between'">
- <xsl:value-of select="concat('oooc:cell-content-text-length-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='equal to'">
- <xsl:value-of select="concat('oooc:cell-content-text-length()=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
- <xsl:value-of select="concat('oooc:cell-content-text-length()!=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='greater than'">
- <xsl:value-of select="concat('oooc:cell-content-text-length()&gt;',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='less than'">
- <xsl:value-of select="concat('oooc:cell-content-text-length()&lt;',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
- <xsl:value-of select="concat('oooc:cell-content-text-length()&gt;=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
- <xsl:value-of select="concat('oooc:cell-content-text-length()&lt;=',$first-validation/表:第一操作数/text())"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="table:content-validation">
- <xsl:attribute name="table:name"><xsl:value-of select="concat('val',count($first-validation/preceding-sibling::表:数据有效性)+1)"/></xsl:attribute>
- <xsl:attribute name="table:condition"><xsl:value-of select="$condition-text"/></xsl:attribute>
- <xsl:attribute name="table:allow-empty-cell"><xsl:value-of select="$first-validation/表:忽略空格/@表:值"/></xsl:attribute>
- <xsl:attribute name="table:base-cell-address"><xsl:value-of select="translate(substring-after($first-validation/表:区域/text(),':'),'$','')"/></xsl:attribute>
- <xsl:if test="$first-validation/表:输入提示">
- <xsl:element name="table:help-message">
- <xsl:attribute name="table:title"><xsl:value-of select="$first-validation/表:输入提示/@表:标题"/></xsl:attribute>
- <xsl:attribute name="table:display"><xsl:value-of select="$first-validation/表:输入提示/@表:显示"/></xsl:attribute>
- <xsl:element name="text:p">
- <xsl:value-of select="$first-validation/表:输入提示/@表:内容"/>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- <xsl:if test="$first-validation/表:错误提示">
- <xsl:element name="table:error-message">
- <xsl:attribute name="table:title"><xsl:value-of select="$first-validation/表:错误提示/@表:标题"/></xsl:attribute>
- <xsl:attribute name="table:display"><xsl:value-of select="$first-validation/表:错误提示/@表:显示"/></xsl:attribute>
- <xsl:attribute name="table:message-type"><xsl:value-of select="$first-validation/表:错误提示/@表:类型"/></xsl:attribute>
- <xsl:element name="text:p">
- <xsl:value-of select="$first-validation/表:错误提示/@表:内容"/>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:element>
- <xsl:call-template name="create-content-validations">
- <xsl:with-param name="validation-set" select="$validation-set[position()!=1]"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <!--RedOffice Comment from Zengjh:UOF0020 2006-04-26 charts-->
- <xsl:template match="表:图表">
- <xsl:param name="table-name"/>
- <xsl:element name="draw:frame">
- <xsl:attribute name="draw:z-index"><xsl:value-of select="'0'"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(@表:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(@表:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(@表:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(@表:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:variable name="chart-current">
- <xsl:number level="any" count="表:图表" format="1"/>
- </xsl:variable>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="concat('chart', $chart-current)"/></xsl:attribute>
- <xsl:variable name="series-value-start">
- <xsl:for-each select="表:数据源/表:系列[position()='1']">
- <xsl:value-of select="@表:系列值"/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="series-value-end">
- <xsl:for-each select="表:数据源/表:系列[position()=last()]">
- <xsl:value-of select="@表:系列值"/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="series-generate-type">
- <xsl:choose>
- <xsl:when test="表:数据源/@表序号产生">
- <xsl:value-of select="表:数据源/@表序号产生"/>
- </xsl:when>
- <xsl:when test="substring(substring-after($series-value-start,'!'),2,1)=substring(substring-after($series-value-start,':'),2,1)">row</xsl:when>
- <xsl:otherwise>col</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="draw:object">
- <xsl:attribute name="draw:notify-on-update-of-ranges"><xsl:value-of select="表:数据源/@表:数据区域"/></xsl:attribute>
- <office:document 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:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible: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: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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0" office:mimetype="application/vnd.oasis.opendocument.chart">
- <xsl:call-template name="表:元数据">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="@表:类型"/>
- <xsl:with-param name="table-subtype" select="@表:子类型"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- <xsl:call-template name="表:式样集">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="@表:类型"/>
- <xsl:with-param name="table-subtype" select="@表:子类型"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- <xsl:call-template name="表:主体">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="@表:类型"/>
- <xsl:with-param name="table-subtype" select="@表:子类型"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </office:document>
- </xsl:element>
- <xsl:element name="draw:image">
- <office:binary-data>
- <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象/uof:数据"/>
- </office:binary-data>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="表:元数据">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:for-each select="/uof:UOF/uof:元数据">
- <office:meta>
- <meta:generator>OpenOffice.org 1.1.3 (Win32)</meta:generator>
- <xsl:if test="uof:标题">
- <dc:title>
- <xsl:value-of select="uof:标题"/>
- </dc:title>
- </xsl:if>
- <xsl:if test="uof:摘要">
- <dc:description>
- <xsl:value-of select="uof:摘要"/>
- </dc:description>
- </xsl:if>
- <xsl:if test="uof:主题">
- <dc:subject>
- <xsl:value-of select="uof:主题"/>
- </dc:subject>
- </xsl:if>
- <xsl:if test="uof:作者">
- <meta:initial-creator>
- <xsl:value-of select="uof:作者"/>
- </meta:initial-creator>
- </xsl:if>
- <xsl:if test="uof:创建日期">
- <meta:creation-date>
- <xsl:value-of select="uof:创建日期"/>
- </meta:creation-date>
- </xsl:if>
- <xsl:if test="uof:最后作者">
- <dc:creator>
- <xsl:value-of select="uof:最后作者"/>
- </dc:creator>
- </xsl:if>
- <xsl:if test="uof:编辑时间">
- <meta:editing-duration>
- <xsl:value-of select="uof:编辑时间"/>
- </meta:editing-duration>
- </xsl:if>
- <dc:language/>
- <meta:keywords>
- <meta:keyword>
- <xsl:value-of select="uof:关键字集/uof:关键字"/>
- </meta:keyword>
- </meta:keywords>
- <xsl:if test="uof:编辑次数">
- <meta:editing-cycles>
- <xsl:value-of select="uof:编辑次数"/>
- </meta:editing-cycles>
- </xsl:if>
- <xsl:if test="uof:分类">
- <meta:user-defined meta:name="Category">
- <xsl:value-of select="uof:分类"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:if test="uof:经理名称">
- <meta:user-defined meta:name="Manager">
- <xsl:value-of select="uof:经理名称"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:if test="uof:公司名称">
- <meta:user-defined meta:name="Company">
- <xsl:value-of select="uof:公司名称"/>
- </meta:user-defined>
- </xsl:if>
- <xsl:if test="uof:创建应用程序">
- <meta:user-defined meta:name="Version">
- <xsl:value-of select="uof:创建应用程序"/>
- </meta:user-defined>
- </xsl:if>
- </office:meta>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:式样集">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <office:styles>
- <draw:stroke-dash draw:name="Ultrafine_20_Dashed" draw:display-name="Ultrafine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.051cm" draw:dots2="1" draw:dots2-length="0.051cm" draw:distance="0.051cm"/>
- <draw:stroke-dash draw:name="Fine_20_Dashed" draw:display-name="Fine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.508cm" draw:dots2="1" draw:dots2-length="0.508cm" draw:distance="0.508cm"/>
- <draw:stroke-dash draw:name="Ultrafine_20_2_20_Dots_20_3_20_Dashes" draw:display-name="Ultrafine 2 Dots 3 Dashes" draw:style="rect" draw:dots1="2" draw:dots1-length="0.051cm" draw:dots2="3" draw:dots2-length="0.254cm" draw:distance="0.127cm"/>
- <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
- <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
- <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
- <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
- <draw:stroke-dash draw:name="Line_20_with_20_Fine_20_Dots" draw:display-name="Line with Fine Dots" draw:style="rect" draw:dots1="1" draw:dots1-length="2.007cm" draw:dots2="10" draw:distance="0.152cm"/>
- <draw:stroke-dash draw:name="Line_20_Style_20_9" draw:display-name="Line Style 9" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="120%"/>
- <draw:stroke-dash draw:name="_33__20_Dashes_20_3_20_Dots_20__28_var_29_" draw:display-name="3 Dashes 3 Dots (var)" draw:style="rect" draw:dots1="3" draw:dots1-length="197%" draw:dots2="3" draw:distance="100%"/>
- <draw:stroke-dash draw:name="_32__20_Dots_20_1_20_Dash" draw:display-name="2 Dots 1 Dash" draw:style="rect" draw:dots1="2" draw:dots2="1" draw:dots2-length="0.203cm" draw:distance="0.203cm"/>
- <draw:stroke-dash draw:name="Ultrafine_20_Dotted_20__28_var_29_" draw:display-name="Ultrafine Dotted (var)" draw:style="rect" draw:dots1="1" draw:distance="50%"/>
- <draw:stroke-dash draw:name="Dash_20_10" draw:display-name="Dash 10" draw:style="rect" draw:dots1="1" draw:dots1-length="0.02cm" draw:dots2="1" draw:dots2-length="0.02cm" draw:distance="0.02cm"/>
- <xsl:for-each select="//图:图片">
- <xsl:variable name="chart-image-name" select="@图:名称"/>
- <draw:fill-image>
- <xsl:attribute name="draw:name"><xsl:value-of select="@图:名称"/></xsl:attribute>
- <office:binary-data>
- <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$chart-image-name]">
- <xsl:value-of select="uof:数据"/>
- </xsl:for-each>
- </office:binary-data>
- </draw:fill-image>
- </xsl:for-each>
- <xsl:for-each select="//图:图案">
- <xsl:variable name="chart-hatch-name" select="@图:图形引用"/>
- <draw:hatch>
- <xsl:if test="@图:图形引用">
- <xsl:attribute name="draw:name"><xsl:value-of select="$chart-hatch-name"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:类型">
- <xsl:attribute name="draw:style"><xsl:value-of select="@图:类型"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:前景色">
- <xsl:attribute name="draw:color"><xsl:value-of select="@图:前景色"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:距离">
- <xsl:attribute name="draw:distance"><xsl:value-of select="@图:距离"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:旋转度">
- <xsl:attribute name="draw:rotation"><xsl:value-of select="@图:旋转度"/></xsl:attribute>
- </xsl:if>
- </draw:hatch>
- </xsl:for-each>
- <xsl:for-each select="//图:渐变">
- <draw:gradient>
- <xsl:if test="@图:图形引用">
- <xsl:attribute name="draw:name"><xsl:value-of select="@图:图形引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:起始色">
- <xsl:attribute name="draw:start-color"><xsl:value-of select="@图:起始色"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:终止色">
- <xsl:attribute name="draw:end-color"><xsl:value-of select="@图:终止色"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:种子类型">
- <xsl:attribute name="draw:style"><xsl:value-of select="@图:种子类型"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:起始浓度">
- <xsl:attribute name="draw:start-intensity"><xsl:value-of select="@图:起始浓度"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:终止浓度">
- <xsl:attribute name="draw:end-intensity"><xsl:value-of select="@图:终止浓度"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:渐变方向">
- <xsl:attribute name="draw:angle"><xsl:value-of select="@图:渐变方向"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:边界">
- <xsl:attribute name="draw:border"><xsl:value-of select="@图:边界"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:种子X位置">
- <xsl:attribute name="draw:cx"><xsl:value-of select="@图:种子X位置"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@图:种子Y位置">
- <xsl:attribute name="draw:cy"><xsl:value-of select="@图:种子Y位置"/></xsl:attribute>
- </xsl:if>
- </draw:gradient>
- </xsl:for-each>
- </office:styles>
- <office:automatic-styles>
- <xsl:for-each select="node( )">
- <xsl:choose>
- <xsl:when test="name(.)='表:图表区'">
- <xsl:call-template name="表:图表区式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name(.)='表:绘图区'">
- <xsl:call-template name="表:绘图区式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- <xsl:call-template name="表:图表背景墙式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name(.)='表:分类轴'">
- <xsl:call-template name="表:分类轴式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name(.)='表:数值轴'">
- <xsl:call-template name="表:数值轴式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name(.)='表:图例'">
- <xsl:call-template name="表:图例式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name(.)='表:数据表'">
- <xsl:call-template name="表:数据表式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name(.)='表:数据系列集'">
- <xsl:call-template name="表:数据系列集式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name(.)='表:数据点集'">
- <xsl:call-template name="表:数据点集式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name(.)='表:网格线集'">
- <xsl:call-template name="表:网格线集式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name(.)='表:数据源'">
- <xsl:call-template name="表:数据源式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="name(.)='表:标题集'">
- <xsl:call-template name="表:标题集式样">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:for-each>
- </office:automatic-styles>
- </xsl:template>
- <xsl:template name="表:主体">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <office:body>
- <office:chart>
- <chart:chart>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(@表:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(@表:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="chart:class"><xsl:choose><xsl:when test="$table-type='column'">chart:bar</xsl:when><xsl:when test="$table-type='line'">chart:line</xsl:when><xsl:when test="$table-type='pie'"><xsl:choose><xsl:when test="$table-subtype='pie_ring'">chart:ring</xsl:when><xsl:otherwise>chart:circle</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="$table-type"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="chart:style-name">chart-area</xsl:attribute>
- <xsl:for-each select="表:标题集/表:标题[@表:位置='chart']">
- <chart:title chart:style-name="chart-title">
- <text:p>
- <xsl:value-of select="@表:名称"/>
- </text:p>
- </chart:title>
- </xsl:for-each>
- <xsl:call-template name="表:图例区域">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- <xsl:call-template name="表:绘图区域">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- <xsl:call-template name="表:本地表">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </chart:chart>
- </office:chart>
- </office:body>
- </xsl:template>
- <xsl:template name="表:图例区域">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <chart:legend>
- <xsl:attribute name="chart:legend-position"><xsl:choose><xsl:when test="表:图例/@表:位置"><xsl:value-of select="表:图例/@表:位置"/></xsl:when><xsl:otherwise>right</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(表:图例/@表:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(表:图例/@表:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="chart:style-name">legend</xsl:attribute>
- </chart:legend>
- </xsl:template>
- <xsl:template name="表:绘图区域">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <chart:plot-area>
- <xsl:variable name="start-range">
- <xsl:value-of select="concat('.$',substring(substring-after($series-value-start,'!'),1,1),'$',substring-before(substring(substring-after($series-value-start,'!'),2),':'))"/>
- </xsl:variable>
- <xsl:variable name="end-range">
- <xsl:value-of select="concat(':.$',substring(substring-after($series-value-end,':'),1,1),'$',substring(substring-after($series-value-end,':'),2))"/>
- </xsl:variable>
- <xsl:attribute name="chart:style-name">plot-area</xsl:attribute>
- <xsl:attribute name="table:cell-range-address"><xsl:value-of select="concat($table-name,$start-range,$end-range)"/></xsl:attribute>
- <!--xsl:value-of select="表:数据源/@表:数据区域"/-->
- <xsl:attribute name="chart:table-number-list">0</xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(表:绘图区/@表:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(表:绘图区/@表:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(表:绘图区/@表:x坐标,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(表:绘图区/@表:y坐标,$uofUnit)"/></xsl:attribute>
- <xsl:if test="表:分类轴">
- <chart:axis chart:dimension="x" chart:name="primary-x" chart:style-name="category-axis">
- <xsl:for-each select="表:标题集/表:标题[@表:位置='category axis']">
- <chart:title chart:style-name="category-axis-title">
- <text:p>
- <xsl:value-of select="@表:名称"/>
- </text:p>
- </chart:title>
- </xsl:for-each>
- <chart:categories/>
- <xsl:if test="表:网格线集/表:网格线[@表:位置='category axis']">
- <chart:grid chart:style-name="category-axis-grid" chart:class="major"/>
- </xsl:if>
- </chart:axis>
- </xsl:if>
- <xsl:if test="表:数值轴">
- <chart:axis chart:dimension="y" chart:name="primary-y" chart:style-name="value-axis">
- <xsl:for-each select="表:标题集/表:标题[@表:位置='value axis']">
- <chart:title chart:style-name="value-axis-title">
- <text:p>
- <xsl:value-of select="@表:名称"/>
- </text:p>
- </chart:title>
- </xsl:for-each>
- <chart:grid chart:style-name="value-axis-grid" chart:class="major"/>
- </chart:axis>
- </xsl:if>
- <xsl:call-template name="表:数据组">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- <chart:wall>
- <xsl:attribute name="chart:style-name">chart-wall</xsl:attribute>
- </chart:wall>
- <chart:floor>
- <xsl:attribute name="chart:style-name">chart-floor</xsl:attribute>
- </chart:floor>
- </chart:plot-area>
- </xsl:template>
- <xsl:template name="表:本地表">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <table:table table:name="local-table">
- <table:table-header-columns>
- <xsl:call-template name="表:本地表_表头列">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="sum" select="1"/>
- </xsl:call-template>
- </table:table-header-columns>
- <table:table-columns>
- <xsl:variable name="column-sum">
- <xsl:value-of select="count(表:数据源/表:系列)"/>
- </xsl:variable>
- <xsl:call-template name="表:本地表_列">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="column-sum" select="$column-sum"/>
- </xsl:call-template>
- </table:table-columns>
- <table:table-header-rows>
- <xsl:call-template name="表:本地表_表头行">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="row-current" select="1"/>
- <xsl:with-param name="fixed-row-sum" select="'1'"/>
- </xsl:call-template>
- </table:table-header-rows>
- <table:table-rows>
- <xsl:variable name="row-start">
- <xsl:value-of select="substring-before(substring(substring-after($series-value-start,'!'),2),':')"/>
- </xsl:variable>
- <xsl:variable name="row-end">
- <xsl:value-of select="substring(substring-after($series-value-end,':'),2)"/>
- </xsl:variable>
- <xsl:variable name="fixed-row-sum">
- <xsl:value-of select="$row-end -$row-start +1"/>
- </xsl:variable>
- <xsl:call-template name="表:本地表_行">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="row-current" select="'1'"/>
- <xsl:with-param name="fixed-row-sum" select="$fixed-row-sum"/>
- </xsl:call-template>
- </table:table-rows>
- </table:table>
- </xsl:template>
- <xsl:template name="表:本地表_表头列">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:param name="sum"/>
- <xsl:choose>
- <xsl:when test="$sum=0"/>
- <xsl:otherwise>
- <table:table-column/>
- <xsl:call-template name="表:本地表_表头列">
- <xsl:with-param name="sum" select="$sum -1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:本地表_列">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:param name="column-sum"/>
- <xsl:choose>
- <xsl:when test="$column-sum=0"/>
- <xsl:otherwise>
- <table:table-column/>
- <xsl:call-template name="表:本地表_列">
- <xsl:with-param name="column-sum" select="$column-sum -1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:本地表_表头行">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:param name="row-current"/>
- <xsl:param name="fixed-row-sum"/>
- <xsl:choose>
- <xsl:when test="$row-current >$fixed-row-sum"/>
- <xsl:otherwise>
- <table:table-row>
- <xsl:variable name="series-value-current">
- <xsl:for-each select="表:数据源/表:系列[position()=$row-current]">
- <xsl:value-of select="@表:系列值"/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="cell-start">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="cell-end">
- <xsl:choose>
- <xsl:when test="$series-generate-type='row'">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,':'),1,1)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after($series-value-end,'!'),1,1)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="cell-sum">
- <xsl:value-of select="$cell-end -$cell-start +2"/>
- </xsl:variable>
- <xsl:variable name="fixed-cell-sum" select="$cell-sum"/>
- <xsl:call-template name="表:本地表_表头行_单元格">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="series-value-current" select="$series-value-current"/>
- <xsl:with-param name="row-current" select="$row-current"/>
- <xsl:with-param name="cell-sum" select="$cell-sum"/>
- <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
- </xsl:call-template>
- </table:table-row>
- <xsl:call-template name="表:本地表_表头行">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="row-current" select="$row-current +1"/>
- <xsl:with-param name="fixed-row-sum" select="$fixed-row-sum"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:本地表_表头行_单元格">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:param name="series-value-current"/>
- <xsl:param name="row-current"/>
- <xsl:param name="cell-sum"/>
- <xsl:param name="fixed-cell-sum"/>
- <xsl:choose>
- <xsl:when test="$cell-sum=0"/>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$fixed-cell-sum=$cell-sum">
- <table:table-cell>
- <text:p/>
- </table:table-cell>
- </xsl:when>
- <xsl:otherwise>
- <table:table-cell office:value-type="string">
- <xsl:variable name="cell-no">
- <xsl:value-of select="$fixed-cell-sum -$cell-sum +1"/>
- </xsl:variable>
- <xsl:variable name="cell-start">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="char">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="$cell-start +$cell-no -2"/>
- <xsl:with-param name="output-type" select="'CHARS_UPPER_LETTER'"/>
- </xsl:call-template>
- </xsl:variable>
- <text:p>
- <xsl:value-of select="concat('列 ',$char)"/>
- </text:p>
- </table:table-cell>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="表:本地表_表头行_单元格">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="series-value-current" select="$series-value-current"/>
- <xsl:with-param name="row-current" select="$row-current"/>
- <xsl:with-param name="cell-sum" select="$cell-sum -1"/>
- <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:本地表_行">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:param name="row-current"/>
- <xsl:param name="fixed-row-sum"/>
- <xsl:choose>
- <xsl:when test="$row-current >$fixed-row-sum"/>
- <xsl:otherwise>
- <xsl:variable name="series-value-current">
- <xsl:for-each select="表:数据源/表:系列[position()=$row-current]">
- <xsl:value-of select="@表:系列值"/>
- </xsl:for-each>
- </xsl:variable>
- <table:table-row>
- <xsl:variable name="cell-start">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="cell-end">
- <xsl:choose>
- <xsl:when test="$series-generate-type='row'">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,':'),1,1)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after($series-value-end,'!'),1,1)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="cell-sum">
- <xsl:value-of select="$cell-end -$cell-start +2"/>
- </xsl:variable>
- <xsl:variable name="fixed-cell-sum" select="$cell-sum"/>
- <xsl:call-template name="表:本地表_行_单元格">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="series-value-current" select="$series-value-current"/>
- <xsl:with-param name="row-current" select="$row-current"/>
- <xsl:with-param name="cell-sum" select="$cell-sum"/>
- <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
- </xsl:call-template>
- </table:table-row>
- <xsl:call-template name="表:本地表_行">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="row-current" select="$row-current +1"/>
- <xsl:with-param name="fixed-row-sum" select="$fixed-row-sum"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:本地表_行_单元格">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:param name="series-value-current"/>
- <xsl:param name="row-current"/>
- <xsl:param name="cell-sum"/>
- <xsl:param name="fixed-cell-sum"/>
- <xsl:choose>
- <xsl:when test="$cell-sum=0"/>
- <xsl:otherwise>
- <xsl:variable name="cell-start">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="cell-no">
- <xsl:value-of select="$cell-start +$fixed-cell-sum -$cell-sum -1"/>
- </xsl:variable>
- <xsl:variable name="row-start">
- <xsl:value-of select="substring(substring-after($series-value-start,'!'),2,1)"/>
- </xsl:variable>
- <xsl:variable name="row-no">
- <xsl:value-of select="$row-start +$row-current -1"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$fixed-cell-sum=$cell-sum">
- <table:table-cell office:value-type="string">
- <text:p>
- <xsl:value-of select="concat('行 ',$row-no)"/>
- </text:p>
- </table:table-cell>
- </xsl:when>
- <xsl:otherwise>
- <table:table-cell office:value-type="float">
- <xsl:variable name="cell-content">
- <xsl:choose>
- <xsl:when test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/@表:行号">
- <xsl:for-each select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行[@表:行号=$row-no]">
- <xsl:for-each select="表:单元格[@表:列号=$cell-no]">
- <xsl:value-of select="表:数据/字:句/字:文本串"/>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行[position()=$row-no]">
- <xsl:for-each select="表:单元格[position()=$cell-no]">
- <xsl:value-of select="表:数据/字:句/字:文本串"/>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="office:value"><xsl:value-of select="$cell-content"/></xsl:attribute>
- <text:p>
- <xsl:value-of select="$cell-content"/>
- </text:p>
- </table:table-cell>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="表:本地表_行_单元格">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="series-value-current" select="$series-value-current"/>
- <xsl:with-param name="row-current" select="$row-current"/>
- <xsl:with-param name="cell-sum" select="$cell-sum -1"/>
- <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:数据组">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:variable name="input-char-start">
- <xsl:choose>
- <xsl:when test="$series-generate-type='row'">
- <xsl:value-of select="substring(substring-after($series-value-start,'!'),1,1)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring-before(substring(substring-after($series-value-start,'!'),2),':')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="input-char-end">
- <xsl:choose>
- <xsl:when test="$series-generate-type='row'">
- <xsl:value-of select="substring(substring-after($series-value-start,':'),1,1)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring(substring-after($series-value-start,':'),2)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="cell-start">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="$input-char-start"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="cell-end">
- <xsl:call-template name="General-Char-Transition">
- <xsl:with-param name="input-char" select="$input-char-end"/>
- <xsl:with-param name="output-type" select="'ARABIC'"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="fixed-cell-sum">
- <xsl:value-of select="$cell-end -$cell-start +1"/>
- </xsl:variable>
- <xsl:for-each select="表:数据系列集/表:数据系列">
- <chart:series>
- <xsl:attribute name="chart:style-name"><xsl:value-of select="concat('data-series',position())"/></xsl:attribute>
- <xsl:call-template name="表:数据点">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="data-series-current" select="position()"/>
- <xsl:with-param name="cell-current" select="'1'"/>
- <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
- </xsl:call-template>
- </chart:series>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:数据点">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:param name="data-series-current"/>
- <xsl:param name="cell-current"/>
- <xsl:param name="fixed-cell-sum"/>
- <xsl:choose>
- <xsl:when test="$cell-current>$fixed-cell-sum"/>
- <xsl:otherwise>
- <chart:data-point>
- <xsl:attribute name="chart:style-name"><xsl:value-of select="concat('data-point',$data-series-current,$cell-current)"/></xsl:attribute>
- </chart:data-point>
- <xsl:call-template name="表:数据点">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="data-series-current" select="$data-series-current"/>
- <xsl:with-param name="cell-current" select="$cell-current +1"/>
- <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="表:图表区式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <style:style style:name="chart-area" style:family="chart">
- <xsl:for-each select="node()">
- <xsl:choose>
- <xsl:when test="name(.)='表:边框'">
- <style:graphic-properties>
- <xsl:call-template name="uof:边框"/>
- </style:graphic-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:填充'">
- <style:graphic-properties>
- <xsl:call-template name="图:填充类型"/>
- </style:graphic-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:字体'">
- <style:text-properties>
- <xsl:call-template name="字:句属性类型"/>
- </style:text-properties>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </style:style>
- </xsl:template>
- <xsl:template name="表:绘图区式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <style:style style:name="plot-area" style:family="chart">
- <style:chart-properties>
- <xsl:choose>
- <xsl:when test="$table-subtype='bar_stacked' or $table-subtype='column_stacked' or $table-subtype='line_stacked'">
- <xsl:attribute name="chart:stacked">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="$table-subtype='bar_percent' or $table-subtype='column_percent' or $table-subtype='line_percent'">
- <xsl:attribute name="chart:percentage">true</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:attribute name="chart:vertical"><xsl:choose><xsl:when test="$table-type='bar'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="chart:series-source"><xsl:choose><xsl:when test="$series-generate-type='row'">rows</xsl:when><xsl:otherwise>columns</xsl:otherwise></xsl:choose></xsl:attribute>
- </style:chart-properties>
- </style:style>
- </xsl:template>
- <xsl:template name="表:图表背景墙式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <style:style style:name="chart-wall" style:family="chart">
- <style:graphic-properties>
- <xsl:for-each select="node()">
- <xsl:choose>
- <xsl:when test="name(.)='表:边框'">
- <xsl:call-template name="uof:边框"/>
- </xsl:when>
- <xsl:when test="name(.)='表:填充'">
- <xsl:call-template name="图:填充类型"/>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </style:graphic-properties>
- </style:style>
- </xsl:template>
- <xsl:template name="表:分类轴式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <style:style style:name="category-axis" style:family="chart">
- <xsl:call-template name="表:坐标轴类型">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="axis-type" select="'category axis'"/>
- </xsl:call-template>
- </style:style>
- </xsl:template>
- <xsl:template name="表:数值轴式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <style:style style:name="value-axis" style:family="chart">
- <xsl:call-template name="表:坐标轴类型">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="axis-type" select="'value axis'"/>
- </xsl:call-template>
- </style:style>
- </xsl:template>
- <xsl:template name="表:图例式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <style:style style:name="legend" style:family="chart">
- <xsl:for-each select="node()">
- <xsl:choose>
- <xsl:when test="name(.)='表:边框'">
- <style:graphic-properties>
- <xsl:call-template name="uof:边框"/>
- </style:graphic-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:填充'">
- <style:graphic-properties>
- <xsl:call-template name="图:填充类型"/>
- </style:graphic-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:字体'">
- <style:text-properties>
- <xsl:call-template name="字:句属性类型"/>
- </style:text-properties>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </style:style>
- </xsl:template>
- <xsl:template name="表:数据表式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <style:style style:name="data-table" style:family="chart">
- <xsl:for-each select="node()">
- <xsl:choose>
- <xsl:when test="name(.)='表:边框'">
- <style:graphic-properties>
- <xsl:call-template name="uof:边框"/>
- </style:graphic-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:填充'">
- <style:graphic-properties>
- <xsl:call-template name="图:填充类型"/>
- </style:graphic-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:字体'">
- <style:text-properties>
- <xsl:call-template name="字:句属性类型"/>
- </style:text-properties>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </style:style>
- </xsl:template>
- <xsl:template name="表:数据系列集式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:for-each select="表:数据系列">
- <style:style style:family="chart">
- <xsl:variable name="current-position" select="position()"/>
- <xsl:attribute name="style:name"><xsl:value-of select="concat('data-series',$current-position)"/></xsl:attribute>
- <xsl:call-template name="表:数据点类型">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="recall-type" select="'data-series'"/>
- </xsl:call-template>
- </style:style>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:数据点集式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:for-each select="表:数据点">
- <style:style style:family="chart">
- <xsl:attribute name="style:name"><xsl:value-of select="concat('data-point',@表:系列,@表:点)"/></xsl:attribute>
- <xsl:call-template name="表:数据点类型">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- <xsl:with-param name="recall-type" select="'data-point'"/>
- </xsl:call-template>
- </style:style>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:网格线集式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:for-each select="表:网格线">
- <xsl:choose>
- <xsl:when test="@表:位置='category axis'">
- <style:style style:name="category-axis-grid" style:family="chart">
- <style:graphic-properties>
- <xsl:call-template name="uof:边框"/>
- </style:graphic-properties>
- </style:style>
- </xsl:when>
- <xsl:when test="@表:位置='value axis'">
- <style:style style:name="value-axis-grid" style:family="chart">
- <style:graphic-properties>
- <xsl:call-template name="uof:边框"/>
- </style:graphic-properties>
- </style:style>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:数据源式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:for-each select="表:系列">
- <style:style style:family="chart">
- <xsl:variable name="current-position" select="position()"/>
- <xsl:attribute name="style:name"><xsl:value-of select="concat('data-source',$current-position)"/></xsl:attribute>
- </style:style>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:标题集式样">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:for-each select="表:标题">
- <xsl:choose>
- <xsl:when test="@表:位置='chart'">
- <style:style style:name="chart-title" style:family="chart">
- <xsl:call-template name="表:标题类型">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </style:style>
- </xsl:when>
- <xsl:when test="@表:位置='category axis'">
- <style:style style:name="category-axis-title" style:family="chart">
- <xsl:call-template name="表:标题类型">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </style:style>
- </xsl:when>
- <xsl:when test="@表:位置='value axis'">
- <style:style style:name="value-axis-title" style:family="chart">
- <xsl:call-template name="表:标题类型">
- <xsl:with-param name="table-name" select="$table-name"/>
- <xsl:with-param name="table-type" select="$table-type"/>
- <xsl:with-param name="table-subtype" select="$table-subtype"/>
- <xsl:with-param name="series-value-start" select="$series-value-start"/>
- <xsl:with-param name="series-value-end" select="$series-value-end"/>
- <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
- </xsl:call-template>
- </style:style>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:坐标轴类型">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:param name="axis-type"/>
- <style:chart-properties>
- <xsl:choose>
- <xsl:when test="@表:主刻度类型='cross'">
- <xsl:attribute name="chart:tick-marks-major-inner">true</xsl:attribute>
- <xsl:attribute name="chart:tick-marks-major-outer">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="@表:主刻度类型='inside'">
- <xsl:attribute name="chart:tick-marks-major-inner">true</xsl:attribute>
- <xsl:attribute name="chart:tick-marks-major-outer">false</xsl:attribute>
- </xsl:when>
- <xsl:when test="@表:主刻度类型='outside'">
- <xsl:attribute name="chart:tick-marks-major-inner">false</xsl:attribute>
- <xsl:attribute name="chart:tick-marks-major-outer">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@表:次刻度类型='cross'">
- <xsl:attribute name="chart:tick-marks-minor-inner">true</xsl:attribute>
- <xsl:attribute name="chart:tick-marks-minor-outer">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="@表:次刻度类型='inside'">
- <xsl:attribute name="chart:tick-marks-minor-inner">true</xsl:attribute>
- <xsl:attribute name="chart:tick-marks-minor-outer">false</xsl:attribute>
- </xsl:when>
- <xsl:when test="@表:次刻度类型='outside'">
- <xsl:attribute name="chart:tick-marks-minor-inner">false</xsl:attribute>
- <xsl:attribute name="chart:tick-marks-minor-outer">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- <xsl:if test="@表:刻度线标志='next to axis'">
- <xsl:attribute name="chart:display-label">true</xsl:attribute>
- </xsl:if>
- <xsl:for-each select="node()">
- <xsl:choose>
- <xsl:when test="name(.)='表:线型'">
- <xsl:call-template name="uof:线型"/>
- </xsl:when>
- <xsl:when test="name(.)='表:数值'">
- <xsl:attribute name="chart:link-data-style-to-source"><xsl:value-of select="@表:链接到源"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="name(.)='表:刻度'">
- <xsl:call-template name="表:刻度类型"/>
- </xsl:when>
- <xsl:when test="name(.)='表:对齐'">
- <xsl:if test="表:文字方向">
- <xsl:attribute name="fo:direction"><xsl:value-of select="表:文字方向"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:旋转角度">
- <xsl:attribute name="text:rotation-angle"><xsl:value-of select="表:旋转角度"/></xsl:attribute>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </style:chart-properties>
- <xsl:if test="表:字体">
- <xsl:for-each select="表:字体">
- <xsl:element name="style:text-properties">
- <xsl:call-template name="字:句属性类型"/>
- </xsl:element>
- </xsl:for-each>
- </xsl:if>
- </xsl:template>
- <xsl:template name="表:数据点类型">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:param name="recall-type"/>
- <xsl:if test="name(.)='表:数据点'">
- <style:chart-properties>
- <xsl:if test="$table-type='pie' and $table-subtype='pie_offset1' and @表:点='1'">
- <xsl:attribute name="chart:pie-offset">10</xsl:attribute>
- </xsl:if>
- <xsl:if test="$table-type='pie' and $table-subtype='pie_offset2'">
- <xsl:attribute name="chart:pie-offset">10</xsl:attribute>
- </xsl:if>
- </style:chart-properties>
- </xsl:if>
- <xsl:for-each select="node()">
- <xsl:choose>
- <xsl:when test="name(.)='表:边框'">
- <style:graphic-properties>
- <xsl:call-template name="uof:边框"/>
- </style:graphic-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:填充'">
- <style:graphic-properties>
- <xsl:call-template name="图:填充类型"/>
- </style:graphic-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:字体'">
- <style:text-properties>
- <xsl:call-template name="字:句属性类型"/>
- </style:text-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:显示标志'">
- <style:chart-properties>
- <xsl:if test="@表:类别名">
- <xsl:attribute name="chart:data-label-text"><xsl:value-of select="@表:类别名"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@表:数值">
- <xsl:attribute name="chart:data-label-number">value</xsl:attribute>
- </xsl:if>
- <xsl:if test="@表:百分数">
- <xsl:attribute name="chart:data-label-number">percentage</xsl:attribute>
- </xsl:if>
- <xsl:if test="@表:图例标志">
- <xsl:attribute name="chart:data-label-symbol"><xsl:value-of select="@表:图例标志"/></xsl:attribute>
- </xsl:if>
- </style:chart-properties>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="表:标题类型">
- <xsl:param name="table-name"/>
- <xsl:param name="table-type"/>
- <xsl:param name="table-subtype"/>
- <xsl:param name="series-value-start"/>
- <xsl:param name="series-value-end"/>
- <xsl:param name="series-generate-type"/>
- <xsl:for-each select="node()">
- <xsl:choose>
- <xsl:when test="name(.)='表:边框'">
- <style:graphic-properties>
- <xsl:call-template name="uof:边框"/>
- </style:graphic-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:填充'">
- <style:graphic-properties>
- <xsl:call-template name="图:填充类型"/>
- </style:graphic-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:对齐'">
- <style:chart-properties>
- <xsl:call-template name="表:对齐格式类型"/>
- </style:chart-properties>
- </xsl:when>
- <xsl:when test="name(.)='表:字体'">
- <style:text-properties>
- <xsl:call-template name="字:句属性类型"/>
- </style:text-properties>
- </xsl:when>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="uof:边框">
- <xsl:if test="@uof:类型">
- <xsl:variable name="type" select="@uof:类型"/>
- <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="@uof:类型='single'">solid</xsl:when><xsl:when test="@uof:类型='none'">none</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$type='dash'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$type='dot-dash'">Ultrafine_20_2_20_Dots_20_3_20_Dashes</xsl:when><xsl:when test="$type='dashed-heavy'">Fine_20_Dashed</xsl:when><xsl:when test="$type='dotted' ">Fine_20_Dotted</xsl:when><xsl:when test="$type='dash-long-heavy'">Line_20_with_20_Fine_20_Dots</xsl:when><xsl:when test="$type='dash-long'">Fine_20_Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-dot'">_33__20_Dashes_20_3_20_Dots_20__28_var_29_</xsl:when><xsl:when test="$type='dotted-heavy'">Ultrafine_20_Dotted_20__28_var_29_</xsl:when><xsl:when test="$type='thick'">Line_20_Style_20_9</xsl:when><xsl:when test="$type='dot-dot-dash'">_32__20_Dots_20_1_20_Dash</xsl:when><xsl:when test="$type='dash-dot-dot-heavy'">Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-heavy'">Dash_20_10</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="@uof:宽度">
- <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@uof:颜色">
- <xsl:attribute name="svg:stroke-color"><xsl:value-of select="@uof:颜色"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template name="图:填充类型">
- <xsl:if test="图:颜色">
- <xsl:attribute name="draw:fill">solid</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:颜色"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:图片">
- <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
- <xsl:attribute name="draw:fill-image-name"><xsl:value-of select="图:图片/@图:名称"/></xsl:attribute>
- <xsl:if test="not(图:图片/@图:位置='tile')">
- <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="图:图案">
- <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
- <xsl:attribute name="draw:fill-hatch-name"><xsl:value-of select="图:图案/@图:图形引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:渐变">
- <xsl:attribute name="draw:fill">gradient</xsl:attribute>
- <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="图:渐变/@图:图形引用"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template name="uof:线型">
- <xsl:call-template name="uof:边框"/>
- </xsl:template>
- <xsl:template name="字:句属性类型">
- <xsl:apply-templates select="./*"/>
- </xsl:template>
- <xsl:template name="表:刻度类型">
- <xsl:if test="表:最小值">
- <xsl:attribute name="chart:minimum"><xsl:value-of select="表:最小值"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:最大值">
- <xsl:attribute name="chart:maximum"><xsl:value-of select="表:最大值"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:主单位">
- <xsl:attribute name="chart:interval-major"><xsl:value-of select="表:主单位"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:次单位">
- <xsl:attribute name="chart:interval-minor"><xsl:value-of select="表:次单位"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:分类交叉点">
- <xsl:attribute name="chart:origin"><xsl:value-of select="表:分类交叉点"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template name="表:对齐格式类型">
- <xsl:if test="表:文字方向">
- <xsl:attribute name="style:direction"><xsl:value-of select="表:文字方向"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="表:文字旋转角度">
- <xsl:attribute name="style:rotation-angle"><xsl:value-of select="表:文字旋转角度"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:字体">
- <xsl:if test="@字:字号">
- <xsl:attribute name="fo:font-size"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-asian"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-complex"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:相对字号 and self::node( )[not(parent::字:句属性)]">
- <xsl:variable name="stylename" select="parent::node()/@字:基式样引用"/>
- <xsl:variable name="zihao">
- <xsl:for-each select="/uof:UOF/uof:式样集//uof:段落式样[@字:标识符=$stylename]">
- <xsl:value-of select="字:字体/@字:字号"/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="font-size" select="@字:相对字号"/>
- <xsl:attribute name="fo:font-size"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-asian"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-complex"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:颜色">
- <xsl:attribute name="fo:color"><xsl:value-of select="string(@字:颜色)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:中文字体引用">
- <xsl:attribute name="style:font-family-asian"><xsl:value-of select="@字:中文字体引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:西文字体引用">
- <xsl:attribute name="fo:font-family"><xsl:value-of select="@字:西文字体引用"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:斜体">
- <xsl:if test="@字:值='true'">
- <xsl:attribute name="fo:font-style">italic</xsl:attribute>
- <xsl:attribute name="fo:font-style-asian">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:粗体">
- <xsl:if test="@字:值='true'">
- <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:下划线">
- <xsl:choose>
- <xsl:when test="@字:类型 = 'single'">
- <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'double'">
- <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
- <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'thick'">
- <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dotted'">
- <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dotted-heavy'">
- <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash'">
- <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dashed-heavy'">
- <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-long'">
- <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-long-heavy'">
- <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dot-dash'">
- <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-dot-heavy'">
- <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dot-dot-dash'">
- <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-dot-dot-heavy'">
- <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'wave'">
- <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'wavy-heavy'">
- <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'wavy-double'">
- <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
- <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@字:颜色">
- <xsl:attribute name="style:text-underline-color"><xsl:choose><xsl:when test="@字:颜色='auto'">font-color</xsl:when><xsl:otherwise><xsl:value-of select="@字:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:text-underline-color">font-color</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:着重号">
- <xsl:if test="not(@字:类型='none')">
- <xsl:choose>
- <xsl:when test="@字:类型='accent above' ">
- <xsl:attribute name="style:text-emphasize">accent above</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='dot above' ">
- <xsl:attribute name="style:text-emphasize">dot above</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='disc above' ">
- <xsl:attribute name="style:text-emphasize">disc above</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='circle above' ">
- <xsl:attribute name="style:text-emphasize">circle above</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='accent below' ">
- <xsl:attribute name="style:text-emphasize">accent below</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='dot below' ">
- <xsl:attribute name="style:text-emphasize">dot below</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='disc below' ">
- <xsl:attribute name="style:text-emphasize">disc below</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='circle below' ">
- <xsl:attribute name="style:text-emphasize">circle below</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="字:颜色">
- <xsl:attribute name="fo:color"><xsl:value-of select="@字:颜色"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:隐藏文字">
- <xsl:attribute name="text:display"><xsl:value-of select="@字:值"/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:空心">
- <xsl:attribute name="style:text-outline"><xsl:value-of select="@字:值"/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:阴影">
- <xsl:if test="not(@字:值='false')">
- <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:删除线">
- <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
- <xsl:choose>
- <xsl:when test="@字:类型='double'">
- <xsl:attribute name="style:text-line-through-type">double</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='single'">
- <xsl:attribute name="style:text-underline-mode">continuous</xsl:attribute>
- <xsl:attribute name="style:text-line-through-mode">continuous</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='bold'">
- <xsl:attribute name="style:text-line-through-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='带/'">
- <xsl:attribute name="style:text-line-through-text">/</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='带X'">
- <xsl:attribute name="style:text-line-through-text">X</xsl:attribute>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="@字:颜色[not(.='auto')]">
- <xsl:attribute name="fo:color">#<xsl:value-of select="."/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:浮雕">
- <xsl:attribute name="style:font-relief"><xsl:choose><xsl:when test="@字:类型='engrave'">engraved</xsl:when><xsl:when test="@字:类型='emboss'">embossed</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:醒目字体">
- <xsl:choose>
- <xsl:when test="@字:类型='small-caps'">
- <xsl:attribute name="fo:font-variant">small-caps</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='none'">
- <xsl:attribute name="fo:font-variant">normal</xsl:attribute>
- <xsl:attribute name="fo:text-transform">none</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:text-transform"><xsl:choose><xsl:when test="@字:类型='uppercase'">uppercase</xsl:when><xsl:when test="@字:类型='lowercase'">lowercase</xsl:when><xsl:when test="@字:类型='capital'">capitalize</xsl:when></xsl:choose></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:位置">
- <xsl:attribute name="style:text-position"><xsl:value-of select="."/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:缩放">
- <xsl:attribute name="style:text-scale"><xsl:value-of select="."/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:字符间距">
- <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="."/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:调整字间距">
- <xsl:attribute name="style:letter-kerning"><xsl:value-of select="."/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:外框">
- <xsl:attribute name="style:text-outline">true</xsl:attribute>
- </xsl:template>
- <xsl:template match="字:缩放">
- <xsl:attribute name="style:text-scale"><xsl:value-of select="."/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:字符间距[parent::字:句属性]">
- <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="concat( number(.)* $other-to-cm-conversion-factor, $uofUnit)"/></xsl:attribute>
- </xsl:template>
- <xsl:template name="General-Char-Transition">
- <xsl:param name="input-char"/>
- <xsl:param name="output-type"/>
- <xsl:choose>
- <xsl:when test="$input-char='A' or $input-char='a' or $input-char='1' or $input-char='Roman_I' or $input-char='Roman_i' or $input-char='一' or $input-char='壹' or $input-char='甲' or $input-char='子'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">1</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">a</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">A</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">I</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">i</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">1</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">一</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">1</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">壹</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">1</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">甲</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">子</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='B' or $input-char='b' or $input-char='2' or $input-char='Roman_II' or $input-char='Roman_ii' or $input-char='二' or $input-char='贰' or $input-char='乙' or $input-char='丑'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">2</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">b</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">B</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">II</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">ii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">2</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">2</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">2</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">乙</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">丑</xsl:when>
- <xsl:otherwise>2</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='C' or $input-char='c' or $input-char='3' or $input-char='Roman_III' or $input-char='Roman_iii' or $input-char='三' or $input-char='叁' or $input-char='丙' or $input-char='寅'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">3</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">c</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">C</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">III</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">iii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">3</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">三</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">3</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">叁</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">3</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">丙</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">寅</xsl:when>
- <xsl:otherwise>3</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='D' or $input-char='d' or $input-char='4' or $input-char='Roman_IV' or $input-char='Roman_iv' or $input-char='四' or $input-char='肆' or $input-char='丁' or $input-char='卯'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">4</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">d</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">D</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">IV</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">iv</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">4</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">四</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">4</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">肆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">4</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">丁</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">卯</xsl:when>
- <xsl:otherwise>4</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='E' or $input-char='e' or $input-char='5' or $input-char='Roman_V' or $input-char='Roman_v' or $input-char='五' or $input-char='伍' or $input-char='戊' or $input-char='辰'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">5</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">e</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">E</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">V</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">v</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">5</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">五</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">5</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">伍</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">5</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">戊</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">辰</xsl:when>
- <xsl:otherwise>5</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='F' or $input-char='f' or $input-char='6' or $input-char='Roman_VI' or $input-char='Roman_vi' or $input-char='六' or $input-char='陆' or $input-char='己' or $input-char='巳'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">6</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">f</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">F</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">VI</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">vi</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">6</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">六</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">6</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">陆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">6</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">己</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">巳</xsl:when>
- <xsl:otherwise>6</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='G' or $input-char='g' or $input-char='7' or $input-char='7' or $input-char='Roman_VII' or $input-char='Roman_vii' or $input-char='七' or $input-char='柒' or $input-char='庚' or $input-char='午'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">7</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">g</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">G</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">VII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">vii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">7</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">七</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">7</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">柒</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">7</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">庚</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">午</xsl:when>
- <xsl:otherwise>7</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='H' or $input-char='h' or $input-char='8' or $input-char='Roman_VIII' or $input-char='Roman_viii' or $input-char='八' or $input-char='捌' or $input-char='辛' or $input-char='未'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">8</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">h</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">H</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">VIII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">viii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">8</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">八</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">8</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">捌</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">8</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">辛</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">未</xsl:when>
- <xsl:otherwise>8</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='I' or $input-char='i' or $input-char='9' or $input-char='Roman_IX' or $input-char='Roman_ix' or $input-char='九' or $input-char='玖' or $input-char='壬' or $input-char='申'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">9</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">i</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">I</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">IX</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">ix</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">9</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">九</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">9</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">玖</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">9</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">壬</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">申</xsl:when>
- <xsl:otherwise>9</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='J' or $input-char='j' or $input-char='10' or $input-char='Roman_X' or $input-char='Roman_x' or $input-char='十' or $input-char='拾' or $input-char='癸' or $input-char='酉'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">10</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">j</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">J</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">X</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">x</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">10</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">10</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">10</xsl:when>
- <xsl:when test="$output-type='TIAN_GAN_ZH'">癸</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">酉</xsl:when>
- <xsl:otherwise>10</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='K' or $input-char='k' or $input-char='11' or $input-char='Roman_XI' or $input-char='Roman_xi' or $input-char='十一' or $input-char='拾壹' or $input-char='戌'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">11</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">k</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">K</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XI</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xi</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">11</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十一</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">11</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾壹</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">11</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">戌</xsl:when>
- <xsl:otherwise>11</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='L' or $input-char='l' or $input-char='12' or $input-char='Roman_XII' or $input-char='Roman_xii' or $input-char='十二' or $input-char='拾贰' or $input-char='亥'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">12</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">l</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">L</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">12</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十二</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">12</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾贰</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">12</xsl:when>
- <xsl:when test="$output-type='DI_ZI_ZH'">亥</xsl:when>
- <xsl:otherwise>12</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='M' or $input-char='m' or $input-char='13' or $input-char='Roman_XIII' or $input-char='Roman_xiii' or $input-char='十三' or $input-char='拾叁'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">13</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">m</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">M</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XIII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xiii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">13</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十三</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">13</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾叁</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">13</xsl:when>
- <xsl:otherwise>13</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='N' or $input-char='n' or $input-char='14' or $input-char='Roman_XIV' or $input-char='Roman_xiv' or $input-char='十四' or $input-char='拾肆'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">14</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">n</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">N</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XIV</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xiv</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">14</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十四</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">14</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾肆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">14</xsl:when>
- <xsl:otherwise>14</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='O' or $input-char='o' or $input-char='15' or $input-char='Roman_XV' or $input-char='Roman_xv' or $input-char='十五' or $input-char='拾伍'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">15</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">o</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">O</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XV</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xv</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">15</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十五</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">15</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾伍</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">15</xsl:when>
- <xsl:otherwise>15</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='P' or $input-char='p' or $input-char='16' or $input-char='Roman_XVI' or $input-char='Roman_xvi' or $input-char='十六' or $input-char='拾陆'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">16</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">p</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">P</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XVI</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xvi</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">16</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十六</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">16</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾陆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">16</xsl:when>
- <xsl:otherwise>16</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='Q' or $input-char='q' or $input-char='17' or $input-char='Roman_XVII' or $input-char='Roman_xvii' or $input-char='十七' or $input-char='拾柒'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">17</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">q</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Q</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XVII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xvii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">17</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十七</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">17</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾柒</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">17</xsl:when>
- <xsl:otherwise>17</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='R' or $input-char='r' or $input-char='18' or $input-char='Roman_XVIII' or $input-char='Roman_xviii' or $input-char='十八' or $input-char='拾捌'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">18</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">r</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">R</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XVIII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xviii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">18</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十八</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">18</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾捌</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">18</xsl:when>
- <xsl:otherwise>18</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='S' or $input-char='s' or $input-char='19' or $input-char='Roman_XIX' or $input-char='Roman_xix' or $input-char='十九' or $input-char='拾玖'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">19</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">s</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">S</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XIX</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xix</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">19</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十九</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">19</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾玖</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">19</xsl:when>
- <xsl:otherwise>19</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='T' or $input-char='t' or $input-char='20' or $input-char='Roman_XX' or $input-char='Roman_xx' or $input-char='二十' or $input-char='贰拾'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">20</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">t</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">T</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XX</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xx</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">20</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">20</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">20</xsl:when>
- <xsl:otherwise>20</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='U' or $input-char='u' or $input-char='21' or $input-char='Roman_XXI' or $input-char='Roman_xxi' or $input-char='二十一' or $input-char='贰拾壹'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">21</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">u</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">U</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXI</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxi</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">21</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十一</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">21</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾壹</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">21</xsl:when>
- <xsl:otherwise>21</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='V' or $input-char='v' or $input-char='22' or $input-char='Roman_XXII' or $input-char='Roman_xxii' or $input-char='二十二' or $input-char='贰拾贰'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">22</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">v</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">V</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">22</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十二</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">22</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾贰</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">22</xsl:when>
- <xsl:otherwise>22</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='W' or $input-char='w' or $input-char='23' or $input-char='Roman_XXIII' or $input-char='Roman_xxiii' or $input-char='二十三' or $input-char='贰拾叁'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">23</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">w</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">W</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXIII</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxiii</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">23</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十三</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">23</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾叁</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">23</xsl:when>
- <xsl:otherwise>23</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='X' or $input-char='x' or $input-char='24' or $input-char='Roman_XXIV' or $input-char='Roman_xxiv' or $input-char='二十四' or $input-char='贰拾肆'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">24</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">x</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">X</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXIV</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxiv</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">24</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十四</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">24</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾肆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">24</xsl:when>
- <xsl:otherwise>24</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='Y' or $input-char='y' or $input-char='25' or $input-char='Roman_XXV' or $input-char='Roman_xxv' or $input-char='二十五' or $input-char='贰拾伍'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">25</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">y</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Y</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXV</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxv</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">25</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十五</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">25</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾伍</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">25</xsl:when>
- <xsl:otherwise>25</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$input-char='Z' or $input-char='z' or $input-char='26' or $input-char='Roman_XXVI' or $input-char='Roman_xxvi' or $input-char='二十六' or $input-char='贰拾陆'">
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">26</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">z</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Z</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">XXVI</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">xxvi</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">26</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十六</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">26</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾陆</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">26</xsl:when>
- <xsl:otherwise>26</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$output-type='ARABIC'">1</xsl:when>
- <xsl:when test="$output-type='CHARS_LOWER_LETTER'">a</xsl:when>
- <xsl:when test="$output-type='CHARS_UPPER_LETTER'">A</xsl:when>
- <xsl:when test="$output-type='ROMAN_UPPER'">I</xsl:when>
- <xsl:when test="$output-type='ROMAN_LOWER'">i</xsl:when>
- <xsl:when test="$output-type='FULLWIDTH_ARABIC'">1</xsl:when>
- <xsl:when test="$output-type='NUMBER_LOWER_ZH'">一</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">1</xsl:when>
- <xsl:when test="$output-type='NUMBER_UPPER_ZH'">壹</xsl:when>
- <xsl:when test="$output-type='CIRCLE_NUMBER'">1</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!--RedOffice comment (Zengjh) end charts-->
- <!-- 以下模板的作用是将网格线颜色由16进制转换为十进制 -->
- <xsl:template name="transform-hex-to-decimal">
- <xsl:param name="number"/>
- <xsl:variable name="R-color-number">
- <xsl:call-template name="color-hex-to-decimal">
- <xsl:with-param name="chars" select="substring($number,2,2)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="G-color-number">
- <xsl:call-template name="color-hex-to-decimal">
- <xsl:with-param name="chars" select="substring($number,4,2)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="B-color-number">
- <xsl:call-template name="color-hex-to-decimal">
- <xsl:with-param name="chars" select="substring($number,6,2)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$R-color-number * 65536 + $G-color-number * 256 + $B-color-number"/>
- </xsl:template>
- <!-- 以下模板的作用是为R或G或B颜色转换为十进制形式-->
- <xsl:template name="color-hex-to-decimal">
- <xsl:param name="chars"/>
- <xsl:variable name="first-num">
- <xsl:call-template name="hex-to-decimal">
- <xsl:with-param name="char" select="substring($chars,1,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="second-num">
- <xsl:call-template name="hex-to-decimal">
- <xsl:with-param name="char" select="substring($chars,2,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$first-num *16 + $second-num"/>
- </xsl:template>
- <xsl:template name="hex-to-decimal">
- <xsl:param name="char"/>
- <xsl:choose>
- <xsl:when test="$char='0'">0</xsl:when>
- <xsl:when test="$char='1'">1</xsl:when>
- <xsl:when test="$char='2'">2</xsl:when>
- <xsl:when test="$char='3'">3</xsl:when>
- <xsl:when test="$char='4'">4</xsl:when>
- <xsl:when test="$char='5'">5</xsl:when>
- <xsl:when test="$char='6'">6</xsl:when>
- <xsl:when test="$char='7'">7</xsl:when>
- <xsl:when test="$char='8'">8</xsl:when>
- <xsl:when test="$char='9'">9</xsl:when>
- <xsl:when test="$char='a'">10</xsl:when>
- <xsl:when test="$char='b'">11</xsl:when>
- <xsl:when test="$char='c'">12</xsl:when>
- <xsl:when test="$char='d'">13</xsl:when>
- <xsl:when test="$char='e'">14</xsl:when>
- <xsl:when test="$char='f'">15</xsl:when>
- </xsl:choose>
- </xsl:template>
- <!-- end -->
- <!--ro000179 chenjh-->
- <xsl:template name="search-left-top-in-tables">
- <xsl:param name="cellstylename"/>
- <xsl:param name="tableslist"/>
- <xsl:param name="return"/>
- <xsl:choose>
- <xsl:when test="$tableslist and $return=''">
- <xsl:variable name="firsttablerows" select="$tableslist[1]//表:行"/>
- <xsl:variable name="first-left-top">
- <xsl:call-template name="search-left-top-inatable">
- <xsl:with-param name="row-num" select="'1'"/>
- <xsl:with-param name="firsttablerows" select="$firsttablerows"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="return" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="rest-left-top">
- <xsl:call-template name="search-left-top-in-tables">
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="tableslist" select="$tableslist[position()!=1]"/>
- <xsl:with-param name="return" select="$first-left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-left-top!=''">
- <xsl:value-of select="$first-left-top"/>
- </xsl:when>
- <xsl:when test="$rest-left-top!=''">
- <xsl:value-of select="$rest-left-top"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$return"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- 以下模板的作用为在一个table中寻找左上角-->
- <xsl:template name="search-left-top-inatable">
- <xsl:param name="row-num"/>
- <xsl:param name="firsttablerows"/>
- <xsl:param name="cellstylename"/>
- <xsl:param name="return"/>
- <xsl:choose>
- <xsl:when test="$firsttablerows and $return=''">
- <xsl:variable name="firstcells" select="$firsttablerows[1]/表:单元格"/>
- <xsl:variable name="first-left-top">
- <xsl:call-template name="search-left-top-inarow">
- <xsl:with-param name="row-num" select="$row-num"/>
- <xsl:with-param name="firstcells" select="$firstcells"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="return" select="''"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="row-num-p">
- <xsl:choose>
- <xsl:when test="$firsttablerows[1]/@表:跨度">
- <xsl:value-of select="$row-num+ $firsttablerows[1]/@表:跨度"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$row-num+1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="rest-left-top">
- <xsl:call-template name="search-left-top-inatable">
- <xsl:with-param name="row-num" select="$row-num-p"/>
- <xsl:with-param name="firsttablerows" select="$firsttablerows[position()!=1]"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="return" select="$first-left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-left-top!=''">
- <xsl:value-of select="$first-left-top"/>
- </xsl:when>
- <xsl:when test="$rest-left-top !=''">
- <xsl:value-of select="$rest-left-top "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$return"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- 以下模板的作用为在某一行中寻找左上角-->
- <xsl:template name="search-left-top-inarow">
- <xsl:param name="row-num"/>
- <xsl:param name="firstcells"/>
- <xsl:param name="cellstylename"/>
- <xsl:param name="return"/>
- <xsl:choose>
- <xsl:when test="$firstcells and $return=''">
- <xsl:variable name="firstcell" select="$firstcells[1]"/>
- <xsl:variable name="first-left-top">
- <xsl:call-template name="search-left-top-inacell">
- <xsl:with-param name="row-num" select="$row-num"/>
- <xsl:with-param name="cell" select="$firstcell"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="rest-left-top">
- <xsl:call-template name="search-left-top-inarow">
- <xsl:with-param name="row-num" select="$row-num"/>
- <xsl:with-param name="firstcells" select="$firstcells[position()!=1]"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="return" select="$first-left-top"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$first-left-top!=''">
- <xsl:value-of select="$first-left-top"/>
- </xsl:when>
- <xsl:when test="$rest-left-top !=''">
- <xsl:value-of select="$rest-left-top "/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$return"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- 以下的模板的作用为判断某个cell是否为左上角 -->
- <xsl:template name="search-left-top-inacell">
- <xsl:param name="row-num"/>
- <xsl:param name="cell"/>
- <xsl:param name="cellstylename"/>
- <xsl:choose>
- <xsl:when test="$cell/@表:式样引用=$cellstylename">
- <xsl:value-of select="concat($cell/ancestor::表:工作表/@表:名称,'.',$cell/@表:列号,' ',$row-num)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- <!-- <xsl:variable name="style-is-default">
- <xsl:call-template name="is-default-or-not-condition-format">
- <xsl:with-param name="column-num" select="$cell/@表:列号"/>
- <xsl:with-param name="cell" select="$cell"/>
- <xsl:with-param name="preceding-cellstylename" select="''"/>
- <xsl:with-param name="temp-num" select="'0'"/>
- <xsl:with-param name="cellstylename" select="$cellstylename"/>
- <xsl:with-param name="table-collumns" select="$cell/ancestor::表:工作表内容//表:列"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$style-is-default='yes' ">
- <xsl:value-of select="concat($cell/ancestor::表:工作表/@表:名称,'.',$cell/@表:列号,' ',$row-num)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="''"/>
- </xsl:otherwise>
- </xsl:choose> -->
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="translate-left-top">
- <xsl:param name="left-top"/>
- <xsl:if test="$left-top!=''">
- <xsl:variable name="column-number" select="substring-before(substring-after($left-top,'.'),' ')"/>
- <xsl:variable name="column-number1">
- <xsl:value-of select="floor( $column-number div 26 )"/>
- </xsl:variable>
- <xsl:variable name="column-number2">
- <xsl:value-of select="$column-number mod 26"/>
- </xsl:variable>
- <xsl:variable name="column-character1">
- <xsl:call-template name="number-to-character">
- <xsl:with-param name="number" select="$column-number1"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="column-character2">
- <xsl:call-template name="number-to-character">
- <xsl:with-param name="number" select="$column-number2"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="concat(substring-before($left-top,'.'),'.',$column-character1,$column-character2,substring-after($left-top,' '))"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="create-the-condition-format-map">
- <xsl:param name="condition-format-set"/>
- <xsl:param name="current-left-top"/>
- <xsl:if test="$condition-format-set">
- <xsl:choose>
- <xsl:when test="contains($condition-format-set[1]/表:区域/text(),$current-left-top)">
- <xsl:for-each select="$condition-format-set[1]/表:条件">
- <xsl:variable name="condition-text">
- <xsl:choose>
- <xsl:when test="@表:类型='cell value'">
- <xsl:choose>
- <xsl:when test="表:操作码/text()='between' ">
- <xsl:value-of select="concat('cell-content-is-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test=" 表:操作码/text()='not between'">
- <xsl:value-of select="concat('cell-content-is-not-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='equal to'">
- <xsl:value-of select="concat('cell-content()=',表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='not equal to'">
- <xsl:value-of select="concat('cell-content()!=',表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='greater than'">
- <xsl:value-of select="concat('cell-content()&gt;',表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='less than'">
- <xsl:value-of select="concat('cell-content()&lt;',表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='greater than or equal to'">
- <xsl:value-of select="concat('cell-content()&gt;=',表:第一操作数/text())"/>
- </xsl:when>
- <xsl:when test="表:操作码/text()='less than or equal to'">
- <xsl:value-of select="concat('cell-content()&lt;=',表:第一操作数/text())"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="@表:类型='formula'">
- <xsl:value-of select="concat('is-true-formula','(',表:第一操作数/text(),')')"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="style:map">
- <xsl:attribute name="style:condition"><xsl:value-of select="$condition-text"/></xsl:attribute>
- <xsl:attribute name="style:apply-style-name"><xsl:value-of select="//uof:单元格式样[@表:标识符=current()/表:格式/@表:式样引用]/@表:名称"/></xsl:attribute>
- <xsl:attribute name="style:base-cell-address"><xsl:value-of select="substring-after($condition-format-set[1]/表:区域/text(),':')"/></xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="create-the-condition-format-map">
- <xsl:with-param name="condition-format-set" select="$condition-format-set[position()!=1]"/>
- <xsl:with-param name="current-left-top" select="$current-left-top"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <!--ro000179 end-->
+ -->
+ <!-- changing measure to mm -->
+ <xsl:template name="convert2mm">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="substring-before($value, 'mm')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm' ) * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in' ) * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'mm'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to cm -->
+ <xsl:template name="convert2cm">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="substring-before($value, 'cm')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to inch (cp. section comment) -->
+ <xsl:template name="convert2in">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $inch-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="substring-before($value, 'in')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $inch-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $inch-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $inch-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $inch-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $inch-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'in'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to dpt (cp. section comment) -->
+ <xsl:template name="convert2dpt">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $didot-point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $didot-point-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $didot-point-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="substring-before($value, 'dpt')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $didot-point-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $didot-point-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $didot-point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'dpt'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pica (cp. section comment) -->
+ <xsl:template name="convert2pica">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $pica-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $pica-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $pica-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $pica-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="substring-before($value, 'pica')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $pica-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $pica-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pica'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pt (cp. section comment) -->
+ <xsl:template name="convert2pt">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $point-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $point-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="substring-before($value, 'pt')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $point-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $point-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $point-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $point-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'pt'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pt (cp. section comment) -->
+ <xsl:template name="convert2twip">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'cm') div $twip-in-mm * $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $twip-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $twip-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $twip-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $twip-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="substring-before($value, 'twip')"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $twip-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'twip'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- changing measure to pixel by via parameter provided dpi (dots per inch) standard factor (cp. section comment) -->
+ <xsl:template name="convert2px">
+ <xsl:param name="value"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round(number(substring-before($value, 'mm')) div $pixel-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'cm')">
+ <xsl:value-of select="round(number(substring-before($value, 'cm')) div $pixel-in-mm * $centimeter-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round(number(substring-before($value, 'in')) div $pixel-in-mm * $inch-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round(number(substring-before($value, 'pt')) div $pixel-in-mm * $point-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round(number(substring-before($value, 'dpt')) div $pixel-in-mm * $didot-point-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round(number(substring-before($value, 'pica')) div $pixel-in-mm * $pica-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round(number(substring-before($value, 'twip')) div $pixel-in-mm * $twip-in-mm)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="$value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'px'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- chenjh zhangying-->
+ <xsl:template name="create-content-validations">
+ <xsl:param name="validation-set"/>
+ <xsl:if test="$validation-set">
+ <xsl:variable name="first-validation" select="$validation-set[1]"/>
+ <xsl:variable name="condition-text">
+ <xsl:choose>
+ <xsl:when test="$first-validation/表:校验类型/text()='whole number'">
+ <xsl:choose>
+ <xsl:when test="$first-validation/表:操作码/text()='between' ">
+ <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='not between'">
+ <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='greater than'">
+ <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='less than'">
+ <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-whole-number() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:校验类型/text()='decimal'">
+ <xsl:choose>
+ <xsl:when test="$first-validation/表:操作码/text()='between' ">
+ <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='not between'">
+ <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='greater than'">
+ <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='less than'">
+ <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-decimal-number() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:校验类型/text()='date'">
+ <xsl:choose>
+ <xsl:when test="$first-validation/表:操作码/text()='between' ">
+ <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='not between'">
+ <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='greater than'">
+ <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='less than'">
+ <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-date() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:校验类型/text()='time'">
+ <xsl:choose>
+ <xsl:when test="$first-validation/表:操作码/text()='between' ">
+ <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='not between'">
+ <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()!=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='greater than'">
+ <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&gt;',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='less than'">
+ <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&lt;',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&gt;=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-is-time() and cell-content()&lt;=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <!-- add 20060317 -->
+ <xsl:when test="$first-validation/表:校验类型/text()='cell range'">
+ <xsl:value-of select="concat('oooc:cell-content-is-in-list',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:校验类型/text()='list'">
+ <xsl:value-of select="concat('oooc:cell-content-is-in-list',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <!-- add 20060317 end -->
+ <xsl:when test="$first-validation/表:校验类型/text()='text length'">
+ <xsl:choose>
+ <xsl:when test="$first-validation/表:操作码/text()='between' ">
+ <xsl:value-of select="concat('oooc:cell-content-text-length-is-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='not between'">
+ <xsl:value-of select="concat('oooc:cell-content-text-length-is-not-between','(',$first-validation/表:第一操作数/text(),',',$first-validation/表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-text-length()=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='not equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-text-length()!=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='greater than'">
+ <xsl:value-of select="concat('oooc:cell-content-text-length()&gt;',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='less than'">
+ <xsl:value-of select="concat('oooc:cell-content-text-length()&lt;',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='greater than or equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-text-length()&gt;=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="$first-validation/表:操作码/text()='less than or equal to'">
+ <xsl:value-of select="concat('oooc:cell-content-text-length()&lt;=',$first-validation/表:第一操作数/text())"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="table:content-validation">
+ <xsl:attribute name="table:name"><xsl:value-of select="concat('val',count($first-validation/preceding-sibling::表:数据有效性)+1)"/></xsl:attribute>
+ <xsl:attribute name="table:condition"><xsl:value-of select="$condition-text"/></xsl:attribute>
+ <xsl:attribute name="table:allow-empty-cell"><xsl:value-of select="$first-validation/表:忽略空格/@表:值"/></xsl:attribute>
+ <xsl:attribute name="table:base-cell-address"><xsl:value-of select="translate(substring-after($first-validation/表:区域/text(),':'),'$','')"/></xsl:attribute>
+ <xsl:if test="$first-validation/表:输入提示">
+ <xsl:element name="table:help-message">
+ <xsl:attribute name="table:title"><xsl:value-of select="$first-validation/表:输入提示/@表:标题"/></xsl:attribute>
+ <xsl:attribute name="table:display"><xsl:value-of select="$first-validation/表:输入提示/@表:显示"/></xsl:attribute>
+ <xsl:element name="text:p">
+ <xsl:value-of select="$first-validation/表:输入提示/@表:内容"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="$first-validation/表:错误提示">
+ <xsl:element name="table:error-message">
+ <xsl:attribute name="table:title"><xsl:value-of select="$first-validation/表:错误提示/@表:标题"/></xsl:attribute>
+ <xsl:attribute name="table:display"><xsl:value-of select="$first-validation/表:错误提示/@表:显示"/></xsl:attribute>
+ <xsl:attribute name="table:message-type"><xsl:value-of select="$first-validation/表:错误提示/@表:类型"/></xsl:attribute>
+ <xsl:element name="text:p">
+ <xsl:value-of select="$first-validation/表:错误提示/@表:内容"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ <xsl:call-template name="create-content-validations">
+ <xsl:with-param name="validation-set" select="$validation-set[position()!=1]"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <!--RedOffice Comment from Zengjh:UOF0020 2006-04-26 charts-->
+ <xsl:template match="表:图表">
+ <xsl:param name="table-name"/>
+ <xsl:element name="draw:frame">
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="'0'"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(@表:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(@表:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(@表:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(@表:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:variable name="chart-current">
+ <xsl:number level="any" count="表:图表" format="1"/>
+ </xsl:variable>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="concat('chart', $chart-current)"/></xsl:attribute>
+ <xsl:variable name="series-value-start">
+ <xsl:for-each select="表:数据源/表:系列[position()='1']">
+ <xsl:value-of select="@表:系列值"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="series-value-end">
+ <xsl:for-each select="表:数据源/表:系列[position()=last()]">
+ <xsl:value-of select="@表:系列值"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="series-generate-type">
+ <xsl:choose>
+ <xsl:when test="表:数据源/@表序号产生">
+ <xsl:value-of select="表:数据源/@表序号产生"/>
+ </xsl:when>
+ <xsl:when test="substring(substring-after($series-value-start,'!'),2,1)=substring(substring-after($series-value-start,':'),2,1)">row</xsl:when>
+ <xsl:otherwise>col</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="draw:object">
+ <xsl:attribute name="draw:notify-on-update-of-ranges"><xsl:value-of select="表:数据源/@表:数据区域"/></xsl:attribute>
+ <office:document 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:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible: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: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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0" office:mimetype="application/vnd.oasis.opendocument.chart">
+ <xsl:call-template name="表:元数据">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="@表:类型"/>
+ <xsl:with-param name="table-subtype" select="@表:子类型"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ <xsl:call-template name="表:式样集">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="@表:类型"/>
+ <xsl:with-param name="table-subtype" select="@表:子类型"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ <xsl:call-template name="表:主体">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="@表:类型"/>
+ <xsl:with-param name="table-subtype" select="@表:子类型"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </office:document>
+ </xsl:element>
+ <xsl:element name="draw:image">
+ <office:binary-data>
+ <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象/uof:数据"/>
+ </office:binary-data>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="表:元数据">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:for-each select="/uof:UOF/uof:元数据">
+ <office:meta>
+ <meta:generator>OpenOffice.org 1.1.3 (Win32)</meta:generator>
+ <xsl:if test="uof:标题">
+ <dc:title>
+ <xsl:value-of select="uof:标题"/>
+ </dc:title>
+ </xsl:if>
+ <xsl:if test="uof:摘要">
+ <dc:description>
+ <xsl:value-of select="uof:摘要"/>
+ </dc:description>
+ </xsl:if>
+ <xsl:if test="uof:主题">
+ <dc:subject>
+ <xsl:value-of select="uof:主题"/>
+ </dc:subject>
+ </xsl:if>
+ <xsl:if test="uof:作者">
+ <meta:initial-creator>
+ <xsl:value-of select="uof:作者"/>
+ </meta:initial-creator>
+ </xsl:if>
+ <xsl:if test="uof:创建日期">
+ <meta:creation-date>
+ <xsl:value-of select="uof:创建日期"/>
+ </meta:creation-date>
+ </xsl:if>
+ <xsl:if test="uof:最后作者">
+ <dc:creator>
+ <xsl:value-of select="uof:最后作者"/>
+ </dc:creator>
+ </xsl:if>
+ <xsl:if test="uof:编辑时间">
+ <meta:editing-duration>
+ <xsl:value-of select="uof:编辑时间"/>
+ </meta:editing-duration>
+ </xsl:if>
+ <dc:language/>
+ <meta:keywords>
+ <meta:keyword>
+ <xsl:value-of select="uof:关键字集/uof:关键字"/>
+ </meta:keyword>
+ </meta:keywords>
+ <xsl:if test="uof:编辑次数">
+ <meta:editing-cycles>
+ <xsl:value-of select="uof:编辑次数"/>
+ </meta:editing-cycles>
+ </xsl:if>
+ <xsl:if test="uof:分类">
+ <meta:user-defined meta:name="Category">
+ <xsl:value-of select="uof:分类"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:if test="uof:经理名称">
+ <meta:user-defined meta:name="Manager">
+ <xsl:value-of select="uof:经理名称"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:if test="uof:公司名称">
+ <meta:user-defined meta:name="Company">
+ <xsl:value-of select="uof:公司名称"/>
+ </meta:user-defined>
+ </xsl:if>
+ <xsl:if test="uof:创建应用程序">
+ <meta:user-defined meta:name="Version">
+ <xsl:value-of select="uof:创建应用程序"/>
+ </meta:user-defined>
+ </xsl:if>
+ </office:meta>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:式样集">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <office:styles>
+ <draw:stroke-dash draw:name="Ultrafine_20_Dashed" draw:display-name="Ultrafine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.051cm" draw:dots2="1" draw:dots2-length="0.051cm" draw:distance="0.051cm"/>
+ <draw:stroke-dash draw:name="Fine_20_Dashed" draw:display-name="Fine Dashed" draw:style="rect" draw:dots1="1" draw:dots1-length="0.508cm" draw:dots2="1" draw:dots2-length="0.508cm" draw:distance="0.508cm"/>
+ <draw:stroke-dash draw:name="Ultrafine_20_2_20_Dots_20_3_20_Dashes" draw:display-name="Ultrafine 2 Dots 3 Dashes" draw:style="rect" draw:dots1="2" draw:dots1-length="0.051cm" draw:dots2="3" draw:dots2-length="0.254cm" draw:distance="0.127cm"/>
+ <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
+ <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
+ <draw:stroke-dash draw:name="Fine_20_Dashed_20__28_var_29_" draw:display-name="Fine Dashed (var)" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="197%"/>
+ <draw:stroke-dash draw:name="Fine_20_Dotted" draw:display-name="Fine Dotted" draw:style="rect" draw:dots1="1" draw:distance="0.457cm"/>
+ <draw:stroke-dash draw:name="Line_20_with_20_Fine_20_Dots" draw:display-name="Line with Fine Dots" draw:style="rect" draw:dots1="1" draw:dots1-length="2.007cm" draw:dots2="10" draw:distance="0.152cm"/>
+ <draw:stroke-dash draw:name="Line_20_Style_20_9" draw:display-name="Line Style 9" draw:style="rect" draw:dots1="1" draw:dots1-length="197%" draw:distance="120%"/>
+ <draw:stroke-dash draw:name="_33__20_Dashes_20_3_20_Dots_20__28_var_29_" draw:display-name="3 Dashes 3 Dots (var)" draw:style="rect" draw:dots1="3" draw:dots1-length="197%" draw:dots2="3" draw:distance="100%"/>
+ <draw:stroke-dash draw:name="_32__20_Dots_20_1_20_Dash" draw:display-name="2 Dots 1 Dash" draw:style="rect" draw:dots1="2" draw:dots2="1" draw:dots2-length="0.203cm" draw:distance="0.203cm"/>
+ <draw:stroke-dash draw:name="Ultrafine_20_Dotted_20__28_var_29_" draw:display-name="Ultrafine Dotted (var)" draw:style="rect" draw:dots1="1" draw:distance="50%"/>
+ <draw:stroke-dash draw:name="Dash_20_10" draw:display-name="Dash 10" draw:style="rect" draw:dots1="1" draw:dots1-length="0.02cm" draw:dots2="1" draw:dots2-length="0.02cm" draw:distance="0.02cm"/>
+ <xsl:for-each select="//图:图片">
+ <xsl:variable name="chart-image-name" select="@图:名称"/>
+ <draw:fill-image>
+ <xsl:attribute name="draw:name"><xsl:value-of select="@图:名称"/></xsl:attribute>
+ <office:binary-data>
+ <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$chart-image-name]">
+ <xsl:value-of select="uof:数据"/>
+ </xsl:for-each>
+ </office:binary-data>
+ </draw:fill-image>
+ </xsl:for-each>
+ <xsl:for-each select="//图:图案">
+ <xsl:variable name="chart-hatch-name" select="@图:图形引用"/>
+ <draw:hatch>
+ <xsl:if test="@图:图形引用">
+ <xsl:attribute name="draw:name"><xsl:value-of select="$chart-hatch-name"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:类型">
+ <xsl:attribute name="draw:style"><xsl:value-of select="@图:类型"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:前景色">
+ <xsl:attribute name="draw:color"><xsl:value-of select="@图:前景色"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:距离">
+ <xsl:attribute name="draw:distance"><xsl:value-of select="@图:距离"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:旋转度">
+ <xsl:attribute name="draw:rotation"><xsl:value-of select="@图:旋转度"/></xsl:attribute>
+ </xsl:if>
+ </draw:hatch>
+ </xsl:for-each>
+ <xsl:for-each select="//图:渐变">
+ <draw:gradient>
+ <xsl:if test="@图:图形引用">
+ <xsl:attribute name="draw:name"><xsl:value-of select="@图:图形引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:起始色">
+ <xsl:attribute name="draw:start-color"><xsl:value-of select="@图:起始色"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:终止色">
+ <xsl:attribute name="draw:end-color"><xsl:value-of select="@图:终止色"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:种子类型">
+ <xsl:attribute name="draw:style"><xsl:value-of select="@图:种子类型"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:起始浓度">
+ <xsl:attribute name="draw:start-intensity"><xsl:value-of select="@图:起始浓度"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:终止浓度">
+ <xsl:attribute name="draw:end-intensity"><xsl:value-of select="@图:终止浓度"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:渐变方向">
+ <xsl:attribute name="draw:angle"><xsl:value-of select="@图:渐变方向"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:边界">
+ <xsl:attribute name="draw:border"><xsl:value-of select="@图:边界"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:种子X位置">
+ <xsl:attribute name="draw:cx"><xsl:value-of select="@图:种子X位置"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@图:种子Y位置">
+ <xsl:attribute name="draw:cy"><xsl:value-of select="@图:种子Y位置"/></xsl:attribute>
+ </xsl:if>
+ </draw:gradient>
+ </xsl:for-each>
+ </office:styles>
+ <office:automatic-styles>
+ <xsl:for-each select="node( )">
+ <xsl:choose>
+ <xsl:when test="name(.)='表:图表区'">
+ <xsl:call-template name="表:图表区式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name(.)='表:绘图区'">
+ <xsl:call-template name="表:绘图区式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ <xsl:call-template name="表:图表背景墙式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name(.)='表:分类轴'">
+ <xsl:call-template name="表:分类轴式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name(.)='表:数值轴'">
+ <xsl:call-template name="表:数值轴式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name(.)='表:图例'">
+ <xsl:call-template name="表:图例式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name(.)='表:数据表'">
+ <xsl:call-template name="表:数据表式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name(.)='表:数据系列集'">
+ <xsl:call-template name="表:数据系列集式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name(.)='表:数据点集'">
+ <xsl:call-template name="表:数据点集式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name(.)='表:网格线集'">
+ <xsl:call-template name="表:网格线集式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name(.)='表:数据源'">
+ <xsl:call-template name="表:数据源式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="name(.)='表:标题集'">
+ <xsl:call-template name="表:标题集式样">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </office:automatic-styles>
+ </xsl:template>
+ <xsl:template name="表:主体">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <office:body>
+ <office:chart>
+ <chart:chart>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(@表:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(@表:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="chart:class"><xsl:choose><xsl:when test="$table-type='column'">chart:bar</xsl:when><xsl:when test="$table-type='line'">chart:line</xsl:when><xsl:when test="$table-type='pie'"><xsl:choose><xsl:when test="$table-subtype='pie_ring'">chart:ring</xsl:when><xsl:otherwise>chart:circle</xsl:otherwise></xsl:choose></xsl:when><xsl:otherwise><xsl:value-of select="$table-type"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="chart:style-name">chart-area</xsl:attribute>
+ <xsl:for-each select="表:标题集/表:标题[@表:位置='chart']">
+ <chart:title chart:style-name="chart-title">
+ <text:p>
+ <xsl:value-of select="@表:名称"/>
+ </text:p>
+ </chart:title>
+ </xsl:for-each>
+ <xsl:call-template name="表:图例区域">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ <xsl:call-template name="表:绘图区域">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ <xsl:call-template name="表:本地表">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </chart:chart>
+ </office:chart>
+ </office:body>
+ </xsl:template>
+ <xsl:template name="表:图例区域">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <chart:legend>
+ <xsl:attribute name="chart:legend-position"><xsl:choose><xsl:when test="表:图例/@表:位置"><xsl:value-of select="表:图例/@表:位置"/></xsl:when><xsl:otherwise>right</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(表:图例/@表:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(表:图例/@表:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="chart:style-name">legend</xsl:attribute>
+ </chart:legend>
+ </xsl:template>
+ <xsl:template name="表:绘图区域">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <chart:plot-area>
+ <xsl:variable name="start-range">
+ <xsl:value-of select="concat('.$',substring(substring-after($series-value-start,'!'),1,1),'$',substring-before(substring(substring-after($series-value-start,'!'),2),':'))"/>
+ </xsl:variable>
+ <xsl:variable name="end-range">
+ <xsl:value-of select="concat(':.$',substring(substring-after($series-value-end,':'),1,1),'$',substring(substring-after($series-value-end,':'),2))"/>
+ </xsl:variable>
+ <xsl:attribute name="chart:style-name">plot-area</xsl:attribute>
+ <xsl:attribute name="table:cell-range-address"><xsl:value-of select="concat($table-name,$start-range,$end-range)"/></xsl:attribute>
+ <!--xsl:value-of select="表:数据源/@表:数据区域"/-->
+ <xsl:attribute name="chart:table-number-list">0</xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(表:绘图区/@表:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(表:绘图区/@表:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(表:绘图区/@表:x坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(表:绘图区/@表:y坐标,$uofUnit)"/></xsl:attribute>
+ <xsl:if test="表:分类轴">
+ <chart:axis chart:dimension="x" chart:name="primary-x" chart:style-name="category-axis">
+ <xsl:for-each select="表:标题集/表:标题[@表:位置='category axis']">
+ <chart:title chart:style-name="category-axis-title">
+ <text:p>
+ <xsl:value-of select="@表:名称"/>
+ </text:p>
+ </chart:title>
+ </xsl:for-each>
+ <chart:categories/>
+ <xsl:if test="表:网格线集/表:网格线[@表:位置='category axis']">
+ <chart:grid chart:style-name="category-axis-grid" chart:class="major"/>
+ </xsl:if>
+ </chart:axis>
+ </xsl:if>
+ <xsl:if test="表:数值轴">
+ <chart:axis chart:dimension="y" chart:name="primary-y" chart:style-name="value-axis">
+ <xsl:for-each select="表:标题集/表:标题[@表:位置='value axis']">
+ <chart:title chart:style-name="value-axis-title">
+ <text:p>
+ <xsl:value-of select="@表:名称"/>
+ </text:p>
+ </chart:title>
+ </xsl:for-each>
+ <chart:grid chart:style-name="value-axis-grid" chart:class="major"/>
+ </chart:axis>
+ </xsl:if>
+ <xsl:call-template name="表:数据组">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ <chart:wall>
+ <xsl:attribute name="chart:style-name">chart-wall</xsl:attribute>
+ </chart:wall>
+ <chart:floor>
+ <xsl:attribute name="chart:style-name">chart-floor</xsl:attribute>
+ </chart:floor>
+ </chart:plot-area>
+ </xsl:template>
+ <xsl:template name="表:本地表">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <table:table table:name="local-table">
+ <table:table-header-columns>
+ <xsl:call-template name="表:本地表_表头列">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="sum" select="1"/>
+ </xsl:call-template>
+ </table:table-header-columns>
+ <table:table-columns>
+ <xsl:variable name="column-sum">
+ <xsl:value-of select="count(表:数据源/表:系列)"/>
+ </xsl:variable>
+ <xsl:call-template name="表:本地表_列">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="column-sum" select="$column-sum"/>
+ </xsl:call-template>
+ </table:table-columns>
+ <table:table-header-rows>
+ <xsl:call-template name="表:本地表_表头行">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="row-current" select="1"/>
+ <xsl:with-param name="fixed-row-sum" select="'1'"/>
+ </xsl:call-template>
+ </table:table-header-rows>
+ <table:table-rows>
+ <xsl:variable name="row-start">
+ <xsl:value-of select="substring-before(substring(substring-after($series-value-start,'!'),2),':')"/>
+ </xsl:variable>
+ <xsl:variable name="row-end">
+ <xsl:value-of select="substring(substring-after($series-value-end,':'),2)"/>
+ </xsl:variable>
+ <xsl:variable name="fixed-row-sum">
+ <xsl:value-of select="$row-end -$row-start +1"/>
+ </xsl:variable>
+ <xsl:call-template name="表:本地表_行">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="row-current" select="'1'"/>
+ <xsl:with-param name="fixed-row-sum" select="$fixed-row-sum"/>
+ </xsl:call-template>
+ </table:table-rows>
+ </table:table>
+ </xsl:template>
+ <xsl:template name="表:本地表_表头列">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:param name="sum"/>
+ <xsl:choose>
+ <xsl:when test="$sum=0"/>
+ <xsl:otherwise>
+ <table:table-column/>
+ <xsl:call-template name="表:本地表_表头列">
+ <xsl:with-param name="sum" select="$sum -1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:本地表_列">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:param name="column-sum"/>
+ <xsl:choose>
+ <xsl:when test="$column-sum=0"/>
+ <xsl:otherwise>
+ <table:table-column/>
+ <xsl:call-template name="表:本地表_列">
+ <xsl:with-param name="column-sum" select="$column-sum -1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:本地表_表头行">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:param name="row-current"/>
+ <xsl:param name="fixed-row-sum"/>
+ <xsl:choose>
+ <xsl:when test="$row-current >$fixed-row-sum"/>
+ <xsl:otherwise>
+ <table:table-row>
+ <xsl:variable name="series-value-current">
+ <xsl:for-each select="表:数据源/表:系列[position()=$row-current]">
+ <xsl:value-of select="@表:系列值"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="cell-start">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="cell-end">
+ <xsl:choose>
+ <xsl:when test="$series-generate-type='row'">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,':'),1,1)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after($series-value-end,'!'),1,1)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="cell-sum">
+ <xsl:value-of select="$cell-end -$cell-start +2"/>
+ </xsl:variable>
+ <xsl:variable name="fixed-cell-sum" select="$cell-sum"/>
+ <xsl:call-template name="表:本地表_表头行_单元格">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="series-value-current" select="$series-value-current"/>
+ <xsl:with-param name="row-current" select="$row-current"/>
+ <xsl:with-param name="cell-sum" select="$cell-sum"/>
+ <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
+ </xsl:call-template>
+ </table:table-row>
+ <xsl:call-template name="表:本地表_表头行">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="row-current" select="$row-current +1"/>
+ <xsl:with-param name="fixed-row-sum" select="$fixed-row-sum"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:本地表_表头行_单元格">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:param name="series-value-current"/>
+ <xsl:param name="row-current"/>
+ <xsl:param name="cell-sum"/>
+ <xsl:param name="fixed-cell-sum"/>
+ <xsl:choose>
+ <xsl:when test="$cell-sum=0"/>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$fixed-cell-sum=$cell-sum">
+ <table:table-cell>
+ <text:p/>
+ </table:table-cell>
+ </xsl:when>
+ <xsl:otherwise>
+ <table:table-cell office:value-type="string">
+ <xsl:variable name="cell-no">
+ <xsl:value-of select="$fixed-cell-sum -$cell-sum +1"/>
+ </xsl:variable>
+ <xsl:variable name="cell-start">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="char">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="$cell-start +$cell-no -2"/>
+ <xsl:with-param name="output-type" select="'CHARS_UPPER_LETTER'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <text:p>
+ <xsl:value-of select="concat('列 ',$char)"/>
+ </text:p>
+ </table:table-cell>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="表:本地表_表头行_单元格">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="series-value-current" select="$series-value-current"/>
+ <xsl:with-param name="row-current" select="$row-current"/>
+ <xsl:with-param name="cell-sum" select="$cell-sum -1"/>
+ <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:本地表_行">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:param name="row-current"/>
+ <xsl:param name="fixed-row-sum"/>
+ <xsl:choose>
+ <xsl:when test="$row-current >$fixed-row-sum"/>
+ <xsl:otherwise>
+ <xsl:variable name="series-value-current">
+ <xsl:for-each select="表:数据源/表:系列[position()=$row-current]">
+ <xsl:value-of select="@表:系列值"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <table:table-row>
+ <xsl:variable name="cell-start">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="cell-end">
+ <xsl:choose>
+ <xsl:when test="$series-generate-type='row'">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,':'),1,1)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after($series-value-end,'!'),1,1)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="cell-sum">
+ <xsl:value-of select="$cell-end -$cell-start +2"/>
+ </xsl:variable>
+ <xsl:variable name="fixed-cell-sum" select="$cell-sum"/>
+ <xsl:call-template name="表:本地表_行_单元格">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="series-value-current" select="$series-value-current"/>
+ <xsl:with-param name="row-current" select="$row-current"/>
+ <xsl:with-param name="cell-sum" select="$cell-sum"/>
+ <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
+ </xsl:call-template>
+ </table:table-row>
+ <xsl:call-template name="表:本地表_行">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="row-current" select="$row-current +1"/>
+ <xsl:with-param name="fixed-row-sum" select="$fixed-row-sum"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:本地表_行_单元格">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:param name="series-value-current"/>
+ <xsl:param name="row-current"/>
+ <xsl:param name="cell-sum"/>
+ <xsl:param name="fixed-cell-sum"/>
+ <xsl:choose>
+ <xsl:when test="$cell-sum=0"/>
+ <xsl:otherwise>
+ <xsl:variable name="cell-start">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="substring(substring-after($series-value-start,'!'),1,1)"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="cell-no">
+ <xsl:value-of select="$cell-start +$fixed-cell-sum -$cell-sum -1"/>
+ </xsl:variable>
+ <xsl:variable name="row-start">
+ <xsl:value-of select="substring(substring-after($series-value-start,'!'),2,1)"/>
+ </xsl:variable>
+ <xsl:variable name="row-no">
+ <xsl:value-of select="$row-start +$row-current -1"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$fixed-cell-sum=$cell-sum">
+ <table:table-cell office:value-type="string">
+ <text:p>
+ <xsl:value-of select="concat('行 ',$row-no)"/>
+ </text:p>
+ </table:table-cell>
+ </xsl:when>
+ <xsl:otherwise>
+ <table:table-cell office:value-type="float">
+ <xsl:variable name="cell-content">
+ <xsl:choose>
+ <xsl:when test="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行/@表:行号">
+ <xsl:for-each select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行[@表:行号=$row-no]">
+ <xsl:for-each select="表:单元格[@表:列号=$cell-no]">
+ <xsl:value-of select="表:数据/字:句/字:文本串"/>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="/uof:UOF/uof:电子表格/表:主体/表:工作表/表:工作表内容/表:行[position()=$row-no]">
+ <xsl:for-each select="表:单元格[position()=$cell-no]">
+ <xsl:value-of select="表:数据/字:句/字:文本串"/>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="office:value"><xsl:value-of select="$cell-content"/></xsl:attribute>
+ <text:p>
+ <xsl:value-of select="$cell-content"/>
+ </text:p>
+ </table:table-cell>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="表:本地表_行_单元格">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="series-value-current" select="$series-value-current"/>
+ <xsl:with-param name="row-current" select="$row-current"/>
+ <xsl:with-param name="cell-sum" select="$cell-sum -1"/>
+ <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:数据组">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:variable name="input-char-start">
+ <xsl:choose>
+ <xsl:when test="$series-generate-type='row'">
+ <xsl:value-of select="substring(substring-after($series-value-start,'!'),1,1)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring-before(substring(substring-after($series-value-start,'!'),2),':')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="input-char-end">
+ <xsl:choose>
+ <xsl:when test="$series-generate-type='row'">
+ <xsl:value-of select="substring(substring-after($series-value-start,':'),1,1)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring(substring-after($series-value-start,':'),2)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="cell-start">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="$input-char-start"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="cell-end">
+ <xsl:call-template name="General-Char-Transition">
+ <xsl:with-param name="input-char" select="$input-char-end"/>
+ <xsl:with-param name="output-type" select="'ARABIC'"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="fixed-cell-sum">
+ <xsl:value-of select="$cell-end -$cell-start +1"/>
+ </xsl:variable>
+ <xsl:for-each select="表:数据系列集/表:数据系列">
+ <chart:series>
+ <xsl:attribute name="chart:style-name"><xsl:value-of select="concat('data-series',position())"/></xsl:attribute>
+ <xsl:call-template name="表:数据点">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="data-series-current" select="position()"/>
+ <xsl:with-param name="cell-current" select="'1'"/>
+ <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
+ </xsl:call-template>
+ </chart:series>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:数据点">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:param name="data-series-current"/>
+ <xsl:param name="cell-current"/>
+ <xsl:param name="fixed-cell-sum"/>
+ <xsl:choose>
+ <xsl:when test="$cell-current>$fixed-cell-sum"/>
+ <xsl:otherwise>
+ <chart:data-point>
+ <xsl:attribute name="chart:style-name"><xsl:value-of select="concat('data-point',$data-series-current,$cell-current)"/></xsl:attribute>
+ </chart:data-point>
+ <xsl:call-template name="表:数据点">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="data-series-current" select="$data-series-current"/>
+ <xsl:with-param name="cell-current" select="$cell-current +1"/>
+ <xsl:with-param name="fixed-cell-sum" select="$fixed-cell-sum"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="表:图表区式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <style:style style:name="chart-area" style:family="chart">
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="name(.)='表:边框'">
+ <style:graphic-properties>
+ <xsl:call-template name="uof:边框"/>
+ </style:graphic-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:填充'">
+ <style:graphic-properties>
+ <xsl:call-template name="图:填充类型"/>
+ </style:graphic-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:字体'">
+ <style:text-properties>
+ <xsl:call-template name="字:句属性类型"/>
+ </style:text-properties>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </style:style>
+ </xsl:template>
+ <xsl:template name="表:绘图区式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <style:style style:name="plot-area" style:family="chart">
+ <style:chart-properties>
+ <xsl:choose>
+ <xsl:when test="$table-subtype='bar_stacked' or $table-subtype='column_stacked' or $table-subtype='line_stacked'">
+ <xsl:attribute name="chart:stacked">true</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$table-subtype='bar_percent' or $table-subtype='column_percent' or $table-subtype='line_percent'">
+ <xsl:attribute name="chart:percentage">true</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:attribute name="chart:vertical"><xsl:choose><xsl:when test="$table-type='bar'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="chart:series-source"><xsl:choose><xsl:when test="$series-generate-type='row'">rows</xsl:when><xsl:otherwise>columns</xsl:otherwise></xsl:choose></xsl:attribute>
+ </style:chart-properties>
+ </style:style>
+ </xsl:template>
+ <xsl:template name="表:图表背景墙式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <style:style style:name="chart-wall" style:family="chart">
+ <style:graphic-properties>
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="name(.)='表:边框'">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:when>
+ <xsl:when test="name(.)='表:填充'">
+ <xsl:call-template name="图:填充类型"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </style:graphic-properties>
+ </style:style>
+ </xsl:template>
+ <xsl:template name="表:分类轴式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <style:style style:name="category-axis" style:family="chart">
+ <xsl:call-template name="表:坐标轴类型">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="axis-type" select="'category axis'"/>
+ </xsl:call-template>
+ </style:style>
+ </xsl:template>
+ <xsl:template name="表:数值轴式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <style:style style:name="value-axis" style:family="chart">
+ <xsl:call-template name="表:坐标轴类型">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="axis-type" select="'value axis'"/>
+ </xsl:call-template>
+ </style:style>
+ </xsl:template>
+ <xsl:template name="表:图例式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <style:style style:name="legend" style:family="chart">
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="name(.)='表:边框'">
+ <style:graphic-properties>
+ <xsl:call-template name="uof:边框"/>
+ </style:graphic-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:填充'">
+ <style:graphic-properties>
+ <xsl:call-template name="图:填充类型"/>
+ </style:graphic-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:字体'">
+ <style:text-properties>
+ <xsl:call-template name="字:句属性类型"/>
+ </style:text-properties>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </style:style>
+ </xsl:template>
+ <xsl:template name="表:数据表式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <style:style style:name="data-table" style:family="chart">
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="name(.)='表:边框'">
+ <style:graphic-properties>
+ <xsl:call-template name="uof:边框"/>
+ </style:graphic-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:填充'">
+ <style:graphic-properties>
+ <xsl:call-template name="图:填充类型"/>
+ </style:graphic-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:字体'">
+ <style:text-properties>
+ <xsl:call-template name="字:句属性类型"/>
+ </style:text-properties>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </style:style>
+ </xsl:template>
+ <xsl:template name="表:数据系列集式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:for-each select="表:数据系列">
+ <style:style style:family="chart">
+ <xsl:variable name="current-position" select="position()"/>
+ <xsl:attribute name="style:name"><xsl:value-of select="concat('data-series',$current-position)"/></xsl:attribute>
+ <xsl:call-template name="表:数据点类型">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="recall-type" select="'data-series'"/>
+ </xsl:call-template>
+ </style:style>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:数据点集式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:for-each select="表:数据点">
+ <style:style style:family="chart">
+ <xsl:attribute name="style:name"><xsl:value-of select="concat('data-point',@表:系列,@表:点)"/></xsl:attribute>
+ <xsl:call-template name="表:数据点类型">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ <xsl:with-param name="recall-type" select="'data-point'"/>
+ </xsl:call-template>
+ </style:style>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:网格线集式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:for-each select="表:网格线">
+ <xsl:choose>
+ <xsl:when test="@表:位置='category axis'">
+ <style:style style:name="category-axis-grid" style:family="chart">
+ <style:graphic-properties>
+ <xsl:call-template name="uof:边框"/>
+ </style:graphic-properties>
+ </style:style>
+ </xsl:when>
+ <xsl:when test="@表:位置='value axis'">
+ <style:style style:name="value-axis-grid" style:family="chart">
+ <style:graphic-properties>
+ <xsl:call-template name="uof:边框"/>
+ </style:graphic-properties>
+ </style:style>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:数据源式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:for-each select="表:系列">
+ <style:style style:family="chart">
+ <xsl:variable name="current-position" select="position()"/>
+ <xsl:attribute name="style:name"><xsl:value-of select="concat('data-source',$current-position)"/></xsl:attribute>
+ </style:style>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:标题集式样">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:for-each select="表:标题">
+ <xsl:choose>
+ <xsl:when test="@表:位置='chart'">
+ <style:style style:name="chart-title" style:family="chart">
+ <xsl:call-template name="表:标题类型">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </style:style>
+ </xsl:when>
+ <xsl:when test="@表:位置='category axis'">
+ <style:style style:name="category-axis-title" style:family="chart">
+ <xsl:call-template name="表:标题类型">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </style:style>
+ </xsl:when>
+ <xsl:when test="@表:位置='value axis'">
+ <style:style style:name="value-axis-title" style:family="chart">
+ <xsl:call-template name="表:标题类型">
+ <xsl:with-param name="table-name" select="$table-name"/>
+ <xsl:with-param name="table-type" select="$table-type"/>
+ <xsl:with-param name="table-subtype" select="$table-subtype"/>
+ <xsl:with-param name="series-value-start" select="$series-value-start"/>
+ <xsl:with-param name="series-value-end" select="$series-value-end"/>
+ <xsl:with-param name="series-generate-type" select="$series-generate-type"/>
+ </xsl:call-template>
+ </style:style>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:坐标轴类型">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:param name="axis-type"/>
+ <style:chart-properties>
+ <xsl:choose>
+ <xsl:when test="@表:主刻度类型='cross'">
+ <xsl:attribute name="chart:tick-marks-major-inner">true</xsl:attribute>
+ <xsl:attribute name="chart:tick-marks-major-outer">true</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@表:主刻度类型='inside'">
+ <xsl:attribute name="chart:tick-marks-major-inner">true</xsl:attribute>
+ <xsl:attribute name="chart:tick-marks-major-outer">false</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@表:主刻度类型='outside'">
+ <xsl:attribute name="chart:tick-marks-major-inner">false</xsl:attribute>
+ <xsl:attribute name="chart:tick-marks-major-outer">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@表:次刻度类型='cross'">
+ <xsl:attribute name="chart:tick-marks-minor-inner">true</xsl:attribute>
+ <xsl:attribute name="chart:tick-marks-minor-outer">true</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@表:次刻度类型='inside'">
+ <xsl:attribute name="chart:tick-marks-minor-inner">true</xsl:attribute>
+ <xsl:attribute name="chart:tick-marks-minor-outer">false</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@表:次刻度类型='outside'">
+ <xsl:attribute name="chart:tick-marks-minor-inner">false</xsl:attribute>
+ <xsl:attribute name="chart:tick-marks-minor-outer">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ <xsl:if test="@表:刻度线标志='next to axis'">
+ <xsl:attribute name="chart:display-label">true</xsl:attribute>
+ </xsl:if>
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="name(.)='表:线型'">
+ <xsl:call-template name="uof:线型"/>
+ </xsl:when>
+ <xsl:when test="name(.)='表:数值'">
+ <xsl:attribute name="chart:link-data-style-to-source"><xsl:value-of select="@表:链接到源"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="name(.)='表:刻度'">
+ <xsl:call-template name="表:刻度类型"/>
+ </xsl:when>
+ <xsl:when test="name(.)='表:对齐'">
+ <xsl:if test="表:文字方向">
+ <xsl:attribute name="fo:direction"><xsl:value-of select="表:文字方向"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:旋转角度">
+ <xsl:attribute name="text:rotation-angle"><xsl:value-of select="表:旋转角度"/></xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </style:chart-properties>
+ <xsl:if test="表:字体">
+ <xsl:for-each select="表:字体">
+ <xsl:element name="style:text-properties">
+ <xsl:call-template name="字:句属性类型"/>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="表:数据点类型">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:param name="recall-type"/>
+ <xsl:if test="name(.)='表:数据点'">
+ <style:chart-properties>
+ <xsl:if test="$table-type='pie' and $table-subtype='pie_offset1' and @表:点='1'">
+ <xsl:attribute name="chart:pie-offset">10</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$table-type='pie' and $table-subtype='pie_offset2'">
+ <xsl:attribute name="chart:pie-offset">10</xsl:attribute>
+ </xsl:if>
+ </style:chart-properties>
+ </xsl:if>
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="name(.)='表:边框'">
+ <style:graphic-properties>
+ <xsl:call-template name="uof:边框"/>
+ </style:graphic-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:填充'">
+ <style:graphic-properties>
+ <xsl:call-template name="图:填充类型"/>
+ </style:graphic-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:字体'">
+ <style:text-properties>
+ <xsl:call-template name="字:句属性类型"/>
+ </style:text-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:显示标志'">
+ <style:chart-properties>
+ <xsl:if test="@表:类别名">
+ <xsl:attribute name="chart:data-label-text"><xsl:value-of select="@表:类别名"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@表:数值">
+ <xsl:attribute name="chart:data-label-number">value</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@表:百分数">
+ <xsl:attribute name="chart:data-label-number">percentage</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@表:图例标志">
+ <xsl:attribute name="chart:data-label-symbol"><xsl:value-of select="@表:图例标志"/></xsl:attribute>
+ </xsl:if>
+ </style:chart-properties>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="表:标题类型">
+ <xsl:param name="table-name"/>
+ <xsl:param name="table-type"/>
+ <xsl:param name="table-subtype"/>
+ <xsl:param name="series-value-start"/>
+ <xsl:param name="series-value-end"/>
+ <xsl:param name="series-generate-type"/>
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="name(.)='表:边框'">
+ <style:graphic-properties>
+ <xsl:call-template name="uof:边框"/>
+ </style:graphic-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:填充'">
+ <style:graphic-properties>
+ <xsl:call-template name="图:填充类型"/>
+ </style:graphic-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:对齐'">
+ <style:chart-properties>
+ <xsl:call-template name="表:对齐格式类型"/>
+ </style:chart-properties>
+ </xsl:when>
+ <xsl:when test="name(.)='表:字体'">
+ <style:text-properties>
+ <xsl:call-template name="字:句属性类型"/>
+ </style:text-properties>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="uof:边框">
+ <xsl:if test="@uof:类型">
+ <xsl:variable name="type" select="@uof:类型"/>
+ <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="@uof:类型='single'">solid</xsl:when><xsl:when test="@uof:类型='none'">none</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$type='dash'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$type='dot-dash'">Ultrafine_20_2_20_Dots_20_3_20_Dashes</xsl:when><xsl:when test="$type='dashed-heavy'">Fine_20_Dashed</xsl:when><xsl:when test="$type='dotted' ">Fine_20_Dotted</xsl:when><xsl:when test="$type='dash-long-heavy'">Line_20_with_20_Fine_20_Dots</xsl:when><xsl:when test="$type='dash-long'">Fine_20_Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-dot'">_33__20_Dashes_20_3_20_Dots_20__28_var_29_</xsl:when><xsl:when test="$type='dotted-heavy'">Ultrafine_20_Dotted_20__28_var_29_</xsl:when><xsl:when test="$type='thick'">Line_20_Style_20_9</xsl:when><xsl:when test="$type='dot-dot-dash'">_32__20_Dots_20_1_20_Dash</xsl:when><xsl:when test="$type='dash-dot-dot-heavy'">Dashed_20__28_var_29_</xsl:when><xsl:when test="$type='dash-dot-heavy'">Dash_20_10</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@uof:宽度">
+ <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(@uof:宽度,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@uof:颜色">
+ <xsl:attribute name="svg:stroke-color"><xsl:value-of select="@uof:颜色"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="图:填充类型">
+ <xsl:if test="图:颜色">
+ <xsl:attribute name="draw:fill">solid</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:颜色"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:图片">
+ <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
+ <xsl:attribute name="draw:fill-image-name"><xsl:value-of select="图:图片/@图:名称"/></xsl:attribute>
+ <xsl:if test="not(图:图片/@图:位置='tile')">
+ <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="图:图案">
+ <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
+ <xsl:attribute name="draw:fill-hatch-name"><xsl:value-of select="图:图案/@图:图形引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:渐变">
+ <xsl:attribute name="draw:fill">gradient</xsl:attribute>
+ <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="图:渐变/@图:图形引用"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="uof:线型">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:template>
+ <xsl:template name="字:句属性类型">
+ <xsl:apply-templates select="./*"/>
+ </xsl:template>
+ <xsl:template name="表:刻度类型">
+ <xsl:if test="表:最小值">
+ <xsl:attribute name="chart:minimum"><xsl:value-of select="表:最小值"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:最大值">
+ <xsl:attribute name="chart:maximum"><xsl:value-of select="表:最大值"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:主单位">
+ <xsl:attribute name="chart:interval-major"><xsl:value-of select="表:主单位"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:次单位">
+ <xsl:attribute name="chart:interval-minor"><xsl:value-of select="表:次单位"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:分类交叉点">
+ <xsl:attribute name="chart:origin"><xsl:value-of select="表:分类交叉点"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="表:对齐格式类型">
+ <xsl:if test="表:文字方向">
+ <xsl:attribute name="style:direction"><xsl:value-of select="表:文字方向"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="表:文字旋转角度">
+ <xsl:attribute name="style:rotation-angle"><xsl:value-of select="表:文字旋转角度"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:字体">
+ <xsl:if test="@字:字号">
+ <xsl:attribute name="fo:font-size"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-asian"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-complex"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:相对字号 and self::node( )[not(parent::字:句属性)]">
+ <xsl:variable name="stylename" select="parent::node()/@字:基式样引用"/>
+ <xsl:variable name="zihao">
+ <xsl:for-each select="/uof:UOF/uof:式样集//uof:段落式样[@字:标识符=$stylename]">
+ <xsl:value-of select="字:字体/@字:字号"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="font-size" select="@字:相对字号"/>
+ <xsl:attribute name="fo:font-size"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-asian"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-complex"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:颜色">
+ <xsl:attribute name="fo:color"><xsl:value-of select="string(@字:颜色)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:中文字体引用">
+ <xsl:attribute name="style:font-family-asian"><xsl:value-of select="@字:中文字体引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:西文字体引用">
+ <xsl:attribute name="fo:font-family"><xsl:value-of select="@字:西文字体引用"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:斜体">
+ <xsl:if test="@字:值='true'">
+ <xsl:attribute name="fo:font-style">italic</xsl:attribute>
+ <xsl:attribute name="fo:font-style-asian">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:粗体">
+ <xsl:if test="@字:值='true'">
+ <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:下划线">
+ <xsl:choose>
+ <xsl:when test="@字:类型 = 'single'">
+ <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'double'">
+ <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
+ <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'thick'">
+ <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dotted'">
+ <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dotted-heavy'">
+ <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash'">
+ <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dashed-heavy'">
+ <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-long'">
+ <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-long-heavy'">
+ <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dot-dash'">
+ <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-dot-heavy'">
+ <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dot-dot-dash'">
+ <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-dot-dot-heavy'">
+ <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'wave'">
+ <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'wavy-heavy'">
+ <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'wavy-double'">
+ <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
+ <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@字:颜色">
+ <xsl:attribute name="style:text-underline-color"><xsl:choose><xsl:when test="@字:颜色='auto'">font-color</xsl:when><xsl:otherwise><xsl:value-of select="@字:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:text-underline-color">font-color</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:着重号">
+ <xsl:if test="not(@字:类型='none')">
+ <xsl:choose>
+ <xsl:when test="@字:类型='accent above' ">
+ <xsl:attribute name="style:text-emphasize">accent above</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='dot above' ">
+ <xsl:attribute name="style:text-emphasize">dot above</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='disc above' ">
+ <xsl:attribute name="style:text-emphasize">disc above</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='circle above' ">
+ <xsl:attribute name="style:text-emphasize">circle above</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='accent below' ">
+ <xsl:attribute name="style:text-emphasize">accent below</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='dot below' ">
+ <xsl:attribute name="style:text-emphasize">dot below</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='disc below' ">
+ <xsl:attribute name="style:text-emphasize">disc below</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='circle below' ">
+ <xsl:attribute name="style:text-emphasize">circle below</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="字:颜色">
+ <xsl:attribute name="fo:color"><xsl:value-of select="@字:颜色"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:隐藏文字">
+ <xsl:attribute name="text:display"><xsl:value-of select="@字:值"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:空心">
+ <xsl:attribute name="style:text-outline"><xsl:value-of select="@字:值"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:阴影">
+ <xsl:if test="not(@字:值='false')">
+ <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:删除线">
+ <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@字:类型='double'">
+ <xsl:attribute name="style:text-line-through-type">double</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='single'">
+ <xsl:attribute name="style:text-underline-mode">continuous</xsl:attribute>
+ <xsl:attribute name="style:text-line-through-mode">continuous</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='bold'">
+ <xsl:attribute name="style:text-line-through-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='带/'">
+ <xsl:attribute name="style:text-line-through-text">/</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='带X'">
+ <xsl:attribute name="style:text-line-through-text">X</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="@字:颜色[not(.='auto')]">
+ <xsl:attribute name="fo:color">#<xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:浮雕">
+ <xsl:attribute name="style:font-relief"><xsl:choose><xsl:when test="@字:类型='engrave'">engraved</xsl:when><xsl:when test="@字:类型='emboss'">embossed</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:醒目字体">
+ <xsl:choose>
+ <xsl:when test="@字:类型='small-caps'">
+ <xsl:attribute name="fo:font-variant">small-caps</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='none'">
+ <xsl:attribute name="fo:font-variant">normal</xsl:attribute>
+ <xsl:attribute name="fo:text-transform">none</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:text-transform"><xsl:choose><xsl:when test="@字:类型='uppercase'">uppercase</xsl:when><xsl:when test="@字:类型='lowercase'">lowercase</xsl:when><xsl:when test="@字:类型='capital'">capitalize</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:位置">
+ <xsl:attribute name="style:text-position"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:缩放">
+ <xsl:attribute name="style:text-scale"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:字符间距">
+ <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:调整字间距">
+ <xsl:attribute name="style:letter-kerning"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:外框">
+ <xsl:attribute name="style:text-outline">true</xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:缩放">
+ <xsl:attribute name="style:text-scale"><xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:字符间距[parent::字:句属性]">
+ <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="concat( number(.)* $other-to-cm-conversion-factor, $uofUnit)"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template name="General-Char-Transition">
+ <xsl:param name="input-char"/>
+ <xsl:param name="output-type"/>
+ <xsl:choose>
+ <xsl:when test="$input-char='A' or $input-char='a' or $input-char='1' or $input-char='Roman_I' or $input-char='Roman_i' or $input-char='一' or $input-char='壹' or $input-char='甲' or $input-char='子'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">1</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">a</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">A</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">I</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">i</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">1</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">一</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">1</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">壹</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">1</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">甲</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">子</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='B' or $input-char='b' or $input-char='2' or $input-char='Roman_II' or $input-char='Roman_ii' or $input-char='二' or $input-char='贰' or $input-char='乙' or $input-char='丑'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">2</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">b</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">B</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">II</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">ii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">2</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">2</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">2</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">乙</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">丑</xsl:when>
+ <xsl:otherwise>2</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='C' or $input-char='c' or $input-char='3' or $input-char='Roman_III' or $input-char='Roman_iii' or $input-char='三' or $input-char='叁' or $input-char='丙' or $input-char='寅'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">3</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">c</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">C</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">III</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">iii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">3</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">三</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">3</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">叁</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">3</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">丙</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">寅</xsl:when>
+ <xsl:otherwise>3</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='D' or $input-char='d' or $input-char='4' or $input-char='Roman_IV' or $input-char='Roman_iv' or $input-char='四' or $input-char='肆' or $input-char='丁' or $input-char='卯'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">4</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">d</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">D</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">IV</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">iv</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">4</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">四</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">4</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">肆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">4</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">丁</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">卯</xsl:when>
+ <xsl:otherwise>4</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='E' or $input-char='e' or $input-char='5' or $input-char='Roman_V' or $input-char='Roman_v' or $input-char='五' or $input-char='伍' or $input-char='戊' or $input-char='辰'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">5</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">e</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">E</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">V</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">v</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">5</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">五</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">5</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">伍</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">5</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">戊</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">辰</xsl:when>
+ <xsl:otherwise>5</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='F' or $input-char='f' or $input-char='6' or $input-char='Roman_VI' or $input-char='Roman_vi' or $input-char='六' or $input-char='陆' or $input-char='己' or $input-char='巳'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">6</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">f</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">F</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">VI</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">vi</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">6</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">六</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">6</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">陆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">6</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">己</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">巳</xsl:when>
+ <xsl:otherwise>6</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='G' or $input-char='g' or $input-char='7' or $input-char='7' or $input-char='Roman_VII' or $input-char='Roman_vii' or $input-char='七' or $input-char='柒' or $input-char='庚' or $input-char='午'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">7</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">g</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">G</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">VII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">vii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">7</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">七</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">7</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">柒</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">7</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">庚</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">午</xsl:when>
+ <xsl:otherwise>7</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='H' or $input-char='h' or $input-char='8' or $input-char='Roman_VIII' or $input-char='Roman_viii' or $input-char='八' or $input-char='捌' or $input-char='辛' or $input-char='未'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">8</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">h</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">H</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">VIII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">viii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">8</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">八</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">8</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">捌</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">8</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">辛</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">未</xsl:when>
+ <xsl:otherwise>8</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='I' or $input-char='i' or $input-char='9' or $input-char='Roman_IX' or $input-char='Roman_ix' or $input-char='九' or $input-char='玖' or $input-char='壬' or $input-char='申'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">9</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">i</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">I</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">IX</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">ix</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">9</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">九</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">9</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">玖</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">9</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">壬</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">申</xsl:when>
+ <xsl:otherwise>9</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='J' or $input-char='j' or $input-char='10' or $input-char='Roman_X' or $input-char='Roman_x' or $input-char='十' or $input-char='拾' or $input-char='癸' or $input-char='酉'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">10</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">j</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">J</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">X</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">x</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">10</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">10</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">10</xsl:when>
+ <xsl:when test="$output-type='TIAN_GAN_ZH'">癸</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">酉</xsl:when>
+ <xsl:otherwise>10</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='K' or $input-char='k' or $input-char='11' or $input-char='Roman_XI' or $input-char='Roman_xi' or $input-char='十一' or $input-char='拾壹' or $input-char='戌'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">11</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">k</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">K</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XI</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xi</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">11</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十一</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">11</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾壹</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">11</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">戌</xsl:when>
+ <xsl:otherwise>11</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='L' or $input-char='l' or $input-char='12' or $input-char='Roman_XII' or $input-char='Roman_xii' or $input-char='十二' or $input-char='拾贰' or $input-char='亥'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">12</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">l</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">L</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">12</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十二</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">12</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾贰</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">12</xsl:when>
+ <xsl:when test="$output-type='DI_ZI_ZH'">亥</xsl:when>
+ <xsl:otherwise>12</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='M' or $input-char='m' or $input-char='13' or $input-char='Roman_XIII' or $input-char='Roman_xiii' or $input-char='十三' or $input-char='拾叁'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">13</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">m</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">M</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XIII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xiii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">13</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十三</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">13</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾叁</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">13</xsl:when>
+ <xsl:otherwise>13</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='N' or $input-char='n' or $input-char='14' or $input-char='Roman_XIV' or $input-char='Roman_xiv' or $input-char='十四' or $input-char='拾肆'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">14</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">n</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">N</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XIV</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xiv</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">14</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十四</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">14</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾肆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">14</xsl:when>
+ <xsl:otherwise>14</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='O' or $input-char='o' or $input-char='15' or $input-char='Roman_XV' or $input-char='Roman_xv' or $input-char='十五' or $input-char='拾伍'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">15</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">o</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">O</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XV</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xv</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">15</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十五</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">15</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾伍</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">15</xsl:when>
+ <xsl:otherwise>15</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='P' or $input-char='p' or $input-char='16' or $input-char='Roman_XVI' or $input-char='Roman_xvi' or $input-char='十六' or $input-char='拾陆'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">16</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">p</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">P</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XVI</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xvi</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">16</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十六</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">16</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾陆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">16</xsl:when>
+ <xsl:otherwise>16</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='Q' or $input-char='q' or $input-char='17' or $input-char='Roman_XVII' or $input-char='Roman_xvii' or $input-char='十七' or $input-char='拾柒'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">17</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">q</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Q</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XVII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xvii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">17</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十七</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">17</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾柒</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">17</xsl:when>
+ <xsl:otherwise>17</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='R' or $input-char='r' or $input-char='18' or $input-char='Roman_XVIII' or $input-char='Roman_xviii' or $input-char='十八' or $input-char='拾捌'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">18</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">r</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">R</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XVIII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xviii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">18</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十八</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">18</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾捌</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">18</xsl:when>
+ <xsl:otherwise>18</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='S' or $input-char='s' or $input-char='19' or $input-char='Roman_XIX' or $input-char='Roman_xix' or $input-char='十九' or $input-char='拾玖'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">19</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">s</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">S</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XIX</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xix</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">19</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">十九</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">19</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">拾玖</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">19</xsl:when>
+ <xsl:otherwise>19</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='T' or $input-char='t' or $input-char='20' or $input-char='Roman_XX' or $input-char='Roman_xx' or $input-char='二十' or $input-char='贰拾'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">20</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">t</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">T</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XX</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xx</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">20</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">20</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">20</xsl:when>
+ <xsl:otherwise>20</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='U' or $input-char='u' or $input-char='21' or $input-char='Roman_XXI' or $input-char='Roman_xxi' or $input-char='二十一' or $input-char='贰拾壹'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">21</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">u</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">U</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXI</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxi</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">21</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十一</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">21</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾壹</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">21</xsl:when>
+ <xsl:otherwise>21</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='V' or $input-char='v' or $input-char='22' or $input-char='Roman_XXII' or $input-char='Roman_xxii' or $input-char='二十二' or $input-char='贰拾贰'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">22</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">v</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">V</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">22</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十二</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">22</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾贰</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">22</xsl:when>
+ <xsl:otherwise>22</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='W' or $input-char='w' or $input-char='23' or $input-char='Roman_XXIII' or $input-char='Roman_xxiii' or $input-char='二十三' or $input-char='贰拾叁'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">23</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">w</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">W</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXIII</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxiii</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">23</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十三</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">23</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾叁</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">23</xsl:when>
+ <xsl:otherwise>23</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='X' or $input-char='x' or $input-char='24' or $input-char='Roman_XXIV' or $input-char='Roman_xxiv' or $input-char='二十四' or $input-char='贰拾肆'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">24</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">x</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">X</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXIV</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxiv</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">24</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十四</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">24</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾肆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">24</xsl:when>
+ <xsl:otherwise>24</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='Y' or $input-char='y' or $input-char='25' or $input-char='Roman_XXV' or $input-char='Roman_xxv' or $input-char='二十五' or $input-char='贰拾伍'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">25</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">y</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Y</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXV</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxv</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">25</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十五</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">25</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾伍</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">25</xsl:when>
+ <xsl:otherwise>25</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$input-char='Z' or $input-char='z' or $input-char='26' or $input-char='Roman_XXVI' or $input-char='Roman_xxvi' or $input-char='二十六' or $input-char='贰拾陆'">
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">26</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">z</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">Z</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">XXVI</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">xxvi</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">26</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">二十六</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">26</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">贰拾陆</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">26</xsl:when>
+ <xsl:otherwise>26</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$output-type='ARABIC'">1</xsl:when>
+ <xsl:when test="$output-type='CHARS_LOWER_LETTER'">a</xsl:when>
+ <xsl:when test="$output-type='CHARS_UPPER_LETTER'">A</xsl:when>
+ <xsl:when test="$output-type='ROMAN_UPPER'">I</xsl:when>
+ <xsl:when test="$output-type='ROMAN_LOWER'">i</xsl:when>
+ <xsl:when test="$output-type='FULLWIDTH_ARABIC'">1</xsl:when>
+ <xsl:when test="$output-type='NUMBER_LOWER_ZH'">一</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH_TW'">1</xsl:when>
+ <xsl:when test="$output-type='NUMBER_UPPER_ZH'">壹</xsl:when>
+ <xsl:when test="$output-type='CIRCLE_NUMBER'">1</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!--RedOffice comment (Zengjh) end charts-->
+ <!-- 以下模板的作用是将网格线颜色由16进制转换为十进制 -->
+ <xsl:template name="transform-hex-to-decimal">
+ <xsl:param name="number"/>
+ <xsl:variable name="R-color-number">
+ <xsl:call-template name="color-hex-to-decimal">
+ <xsl:with-param name="chars" select="substring($number,2,2)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="G-color-number">
+ <xsl:call-template name="color-hex-to-decimal">
+ <xsl:with-param name="chars" select="substring($number,4,2)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="B-color-number">
+ <xsl:call-template name="color-hex-to-decimal">
+ <xsl:with-param name="chars" select="substring($number,6,2)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$R-color-number * 65536 + $G-color-number * 256 + $B-color-number"/>
+ </xsl:template>
+ <!-- 以下模板的作用是为R或G或B颜色转换为十进制形式-->
+ <xsl:template name="color-hex-to-decimal">
+ <xsl:param name="chars"/>
+ <xsl:variable name="first-num">
+ <xsl:call-template name="hex-to-decimal">
+ <xsl:with-param name="char" select="substring($chars,1,1)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="second-num">
+ <xsl:call-template name="hex-to-decimal">
+ <xsl:with-param name="char" select="substring($chars,2,1)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="$first-num *16 + $second-num"/>
+ </xsl:template>
+ <xsl:template name="hex-to-decimal">
+ <xsl:param name="char"/>
+ <xsl:choose>
+ <xsl:when test="$char='0'">0</xsl:when>
+ <xsl:when test="$char='1'">1</xsl:when>
+ <xsl:when test="$char='2'">2</xsl:when>
+ <xsl:when test="$char='3'">3</xsl:when>
+ <xsl:when test="$char='4'">4</xsl:when>
+ <xsl:when test="$char='5'">5</xsl:when>
+ <xsl:when test="$char='6'">6</xsl:when>
+ <xsl:when test="$char='7'">7</xsl:when>
+ <xsl:when test="$char='8'">8</xsl:when>
+ <xsl:when test="$char='9'">9</xsl:when>
+ <xsl:when test="$char='a'">10</xsl:when>
+ <xsl:when test="$char='b'">11</xsl:when>
+ <xsl:when test="$char='c'">12</xsl:when>
+ <xsl:when test="$char='d'">13</xsl:when>
+ <xsl:when test="$char='e'">14</xsl:when>
+ <xsl:when test="$char='f'">15</xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <!-- end -->
+ <!--ro000179 chenjh-->
+ <xsl:template name="search-left-top-in-tables">
+ <xsl:param name="cellstylename"/>
+ <xsl:param name="tableslist"/>
+ <xsl:param name="return"/>
+ <xsl:choose>
+ <xsl:when test="$tableslist and $return=''">
+ <xsl:variable name="firsttablerows" select="$tableslist[1]//表:行"/>
+ <xsl:variable name="first-left-top">
+ <xsl:call-template name="search-left-top-inatable">
+ <xsl:with-param name="row-num" select="'1'"/>
+ <xsl:with-param name="firsttablerows" select="$firsttablerows"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="return" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="rest-left-top">
+ <xsl:call-template name="search-left-top-in-tables">
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="tableslist" select="$tableslist[position()!=1]"/>
+ <xsl:with-param name="return" select="$first-left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-left-top!=''">
+ <xsl:value-of select="$first-left-top"/>
+ </xsl:when>
+ <xsl:when test="$rest-left-top!=''">
+ <xsl:value-of select="$rest-left-top"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$return"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- 以下模板的作用为在一个table中寻找左上角-->
+ <xsl:template name="search-left-top-inatable">
+ <xsl:param name="row-num"/>
+ <xsl:param name="firsttablerows"/>
+ <xsl:param name="cellstylename"/>
+ <xsl:param name="return"/>
+ <xsl:choose>
+ <xsl:when test="$firsttablerows and $return=''">
+ <xsl:variable name="firstcells" select="$firsttablerows[1]/表:单元格"/>
+ <xsl:variable name="first-left-top">
+ <xsl:call-template name="search-left-top-inarow">
+ <xsl:with-param name="row-num" select="$row-num"/>
+ <xsl:with-param name="firstcells" select="$firstcells"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="return" select="''"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="row-num-p">
+ <xsl:choose>
+ <xsl:when test="$firsttablerows[1]/@表:跨度">
+ <xsl:value-of select="$row-num+ $firsttablerows[1]/@表:跨度"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$row-num+1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="rest-left-top">
+ <xsl:call-template name="search-left-top-inatable">
+ <xsl:with-param name="row-num" select="$row-num-p"/>
+ <xsl:with-param name="firsttablerows" select="$firsttablerows[position()!=1]"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="return" select="$first-left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-left-top!=''">
+ <xsl:value-of select="$first-left-top"/>
+ </xsl:when>
+ <xsl:when test="$rest-left-top !=''">
+ <xsl:value-of select="$rest-left-top "/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$return"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- 以下模板的作用为在某一行中寻找左上角-->
+ <xsl:template name="search-left-top-inarow">
+ <xsl:param name="row-num"/>
+ <xsl:param name="firstcells"/>
+ <xsl:param name="cellstylename"/>
+ <xsl:param name="return"/>
+ <xsl:choose>
+ <xsl:when test="$firstcells and $return=''">
+ <xsl:variable name="firstcell" select="$firstcells[1]"/>
+ <xsl:variable name="first-left-top">
+ <xsl:call-template name="search-left-top-inacell">
+ <xsl:with-param name="row-num" select="$row-num"/>
+ <xsl:with-param name="cell" select="$firstcell"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="rest-left-top">
+ <xsl:call-template name="search-left-top-inarow">
+ <xsl:with-param name="row-num" select="$row-num"/>
+ <xsl:with-param name="firstcells" select="$firstcells[position()!=1]"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="return" select="$first-left-top"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$first-left-top!=''">
+ <xsl:value-of select="$first-left-top"/>
+ </xsl:when>
+ <xsl:when test="$rest-left-top !=''">
+ <xsl:value-of select="$rest-left-top "/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$return"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- 以下的模板的作用为判断某个cell是否为左上角 -->
+ <xsl:template name="search-left-top-inacell">
+ <xsl:param name="row-num"/>
+ <xsl:param name="cell"/>
+ <xsl:param name="cellstylename"/>
+ <xsl:choose>
+ <xsl:when test="$cell/@表:式样引用=$cellstylename">
+ <xsl:value-of select="concat($cell/ancestor::表:工作表/@表:名称,'.',$cell/@表:列号,' ',$row-num)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ <!-- <xsl:variable name="style-is-default">
+ <xsl:call-template name="is-default-or-not-condition-format">
+ <xsl:with-param name="column-num" select="$cell/@表:列号"/>
+ <xsl:with-param name="cell" select="$cell"/>
+ <xsl:with-param name="preceding-cellstylename" select="''"/>
+ <xsl:with-param name="temp-num" select="'0'"/>
+ <xsl:with-param name="cellstylename" select="$cellstylename"/>
+ <xsl:with-param name="table-collumns" select="$cell/ancestor::表:工作表内容//表:列"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$style-is-default='yes' ">
+ <xsl:value-of select="concat($cell/ancestor::表:工作表/@表:名称,'.',$cell/@表:列号,' ',$row-num)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="''"/>
+ </xsl:otherwise>
+ </xsl:choose> -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="translate-left-top">
+ <xsl:param name="left-top"/>
+ <xsl:if test="$left-top!=''">
+ <xsl:variable name="column-number" select="substring-before(substring-after($left-top,'.'),' ')"/>
+ <xsl:variable name="column-number1">
+ <xsl:value-of select="floor( $column-number div 26 )"/>
+ </xsl:variable>
+ <xsl:variable name="column-number2">
+ <xsl:value-of select="$column-number mod 26"/>
+ </xsl:variable>
+ <xsl:variable name="column-character1">
+ <xsl:call-template name="number-to-character">
+ <xsl:with-param name="number" select="$column-number1"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="column-character2">
+ <xsl:call-template name="number-to-character">
+ <xsl:with-param name="number" select="$column-number2"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="concat(substring-before($left-top,'.'),'.',$column-character1,$column-character2,substring-after($left-top,' '))"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="create-the-condition-format-map">
+ <xsl:param name="condition-format-set"/>
+ <xsl:param name="current-left-top"/>
+ <xsl:if test="$condition-format-set">
+ <xsl:choose>
+ <xsl:when test="contains($condition-format-set[1]/表:区域/text(),$current-left-top)">
+ <xsl:for-each select="$condition-format-set[1]/表:条件">
+ <xsl:variable name="condition-text">
+ <xsl:choose>
+ <xsl:when test="@表:类型='cell value'">
+ <xsl:choose>
+ <xsl:when test="表:操作码/text()='between' ">
+ <xsl:value-of select="concat('cell-content-is-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test=" 表:操作码/text()='not between'">
+ <xsl:value-of select="concat('cell-content-is-not-between','(',表:第一操作数/text(),',',表:第二操作数/text(),')')"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='equal to'">
+ <xsl:value-of select="concat('cell-content()=',表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='not equal to'">
+ <xsl:value-of select="concat('cell-content()!=',表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='greater than'">
+ <xsl:value-of select="concat('cell-content()&gt;',表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='less than'">
+ <xsl:value-of select="concat('cell-content()&lt;',表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='greater than or equal to'">
+ <xsl:value-of select="concat('cell-content()&gt;=',表:第一操作数/text())"/>
+ </xsl:when>
+ <xsl:when test="表:操作码/text()='less than or equal to'">
+ <xsl:value-of select="concat('cell-content()&lt;=',表:第一操作数/text())"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="@表:类型='formula'">
+ <xsl:value-of select="concat('is-true-formula','(',表:第一操作数/text(),')')"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="style:map">
+ <xsl:attribute name="style:condition"><xsl:value-of select="$condition-text"/></xsl:attribute>
+ <xsl:attribute name="style:apply-style-name"><xsl:value-of select="//uof:单元格式样[@表:标识符=current()/表:格式/@表:式样引用]/@表:名称"/></xsl:attribute>
+ <xsl:attribute name="style:base-cell-address"><xsl:value-of select="substring-after($condition-format-set[1]/表:区域/text(),':')"/></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="create-the-condition-format-map">
+ <xsl:with-param name="condition-format-set" select="$condition-format-set[position()!=1]"/>
+ <xsl:with-param name="current-left-top" select="$current-left-top"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <!--ro000179 end-->
</xsl:stylesheet>
diff --git a/filter/source/xslt/import/uof/uof2odf_text.xsl b/filter/source/xslt/import/uof/uof2odf_text.xsl
index fe090e9e1a2f..1ced5d0d0a34 100644
--- a/filter/source/xslt/import/uof/uof2odf_text.xsl
+++ b/filter/source/xslt/import/uof/uof2odf_text.xsl
@@ -17,4651 +17,4651 @@
* 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:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:uof="http://schemas.uof.org/cn/2003/uof" xmlns:表="http://schemas.uof.org/cn/2003/uof-spreadsheet" xmlns:演="http://schemas.uof.org/cn/2003/uof-slideshow" xmlns:字="http://schemas.uof.org/cn/2003/uof-wordproc" xmlns:图="http://schemas.uof.org/cn/2003/graph" 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
- <xsl:template match="uof:UOF">
- <office:document 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
- <xsl:apply-templates select="uof:元数据"/>
- <xsl:apply-templates select="uof:文字处理/字:公用处理规则/字:文档设置"/>
- <xsl:apply-templates select="uof:字体集"/>
- <xsl:apply-templates select="uof:式样集"/>
- <xsl:apply-templates select="uof:文字处理"/>
- </office:document>
- </xsl:template>
- <xsl:template match="uof:元数据">
- <xsl:element name="office:meta">
- <meta:generator>UOFText 2004</meta:generator>
- <dc:title>
- <xsl:value-of select="uof:标题"/>
- </dc:title>
- <dc:description>
- <xsl:value-of select="uof:摘要"/>
- </dc:description>
- <dc:subject>
- <xsl:value-of select="uof:主题"/>
- </dc:subject>
- <meta:initial-creator>
- <xsl:value-of select="uof:创建者"/>
- </meta:initial-creator>
- <meta:creation-date>
- <xsl:value-of select="substring-before( uof:创建日期, 'Z')"/>
- </meta:creation-date>
- <dc:creator>
- <xsl:value-of select="uof:最后作者"/>
- </dc:creator>
- <dc:date>
- <xsl:value-of select="substring-before( uof:编辑时间, 'Z')"/>
- </dc:date>
- <meta:printed-by/>
- <meta:print-date/>
- <meta:keywords>
- <meta:keyword>
- <xsl:value-of select="uof:关键字集/uof:关键字"/>
- </meta:keyword>
- </meta:keywords>
- <dc:language/>
- <meta:editing-cycles>
- <xsl:value-of select="uof:编辑次数"/>
- </meta:editing-cycles>
- <meta:editing-duration>
- <xsl:if test="uof:编辑时间">
- <xsl:value-of select="concat('PT', floor(uof:编辑时间 div 60), 'H', uof:编辑时间 mod 60, 'M0S')"/>
- </xsl:if>
- </meta:editing-duration>
- <meta:user-defined meta:name="Category">
- <xsl:value-of select="uof:分类"/>
- </meta:user-defined>
- <meta:user-defined meta:name="Manager">
- <xsl:value-of select="uof:经理名称"/>
- </meta:user-defined>
- <meta:user-defined meta:name="Company">
- <xsl:value-of select="uof:公司名称"/>
- </meta:user-defined>
- <meta:user-defined meta:name="Version">
- <xsl:value-of select="uof:创建应用程序"/>
- </meta:user-defined>
- <xsl:if test="uof:文档模板|child::*[@uof:locID='u0013']">
- <meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:href="{child::*[@uof:locID='u0013']}"/>
- </xsl:if>
- <xsl:if test="uof:用户自定义元数据集/uof:用户自定义元数据|child::*[@uof:locID='u0016']/*[@uof:locID='u0017']">
- <xsl:for-each select="uof:用户自定义元数据集/uof:用户自定义元数据|child::*[@uof:locID='u0016']/*[@uof:locID='u0017']">
- <xsl:element name="meta:user-defined">
- <xsl:attribute name="meta:name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:if>
- <meta:document-statistic>
- <xsl:attribute name="meta:page-count">
- <xsl:choose>
- <xsl:when test="child::*[@uof:locID='u0020']"><xsl:value-of select="uof:页数"/></xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:段落/字:域开始[@字:类型='numpages']">
- <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="fmt">
- <xsl:value-of select="substring-before($date0,' \*')"/>
- </xsl:variable>
- <xsl:if test="$fmt='Arabic'"><xsl:value-of select="following-sibling::字:句/字:文本串"/></xsl:if>
- <xsl:if test="not($fmt='Arabic')">
- <xsl:variable name="content">
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$content='I' or $content='i' or $content='A' or $content='a'">1</xsl:when>
- <xsl:when test="$content='II' or $content='ii' or $content='B' or $content='b'">2</xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:attribute name="meta:paragraph-count"><xsl:if test="child::*[@uof:locID='u0025']"><xsl:value-of select="uof:段落数"/></xsl:if></xsl:attribute>
- <xsl:attribute name="meta:word-count"><xsl:if test="child::*[@uof:locID='u0023']"><xsl:value-of select="uof:中文字符数"/></xsl:if></xsl:attribute>
- <xsl:attribute name="meta:object-count"><xsl:if test="child::*[@uof:locID='u0026']"><xsl:value-of select="uof:对象数"/></xsl:if></xsl:attribute>
- <xsl:attribute name="meta:character-count">
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:段落/字:域开始[@字:类型='numchars']">
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:for-each>
- <xsl:if test="child::*[@uof:locID='u0021']"><xsl:value-of select="uof:字数"/></xsl:if>
- </xsl:attribute>
- </meta:document-statistic>
- <meta:document-statistic/>
- </xsl:element>
- </xsl:template>
- <xsl:variable name="uofUnit">
- <xsl:variable name="uu">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:度量单位"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$uu='cm'">cm</xsl:when>
- <xsl:when test="$uu='mm'">mm</xsl:when>
- <xsl:when test="$uu='pt'">pt</xsl:when>
- <xsl:when test="$uu='inch'">in</xsl:when>
- <xsl:otherwise>cm</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="other-to-cm-conversion-factor">
- <xsl:choose>
- <xsl:when test="$uofUnit='cm'">1</xsl:when>
- <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
- <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
- <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
- <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
- <xsl:otherwise>0.03527</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:template match="uof:式样集">
- <xsl:apply-templates select="uof:字体集"/>
- <xsl:variable name="default_paragraph_style" select="uof:段落式样"/>
- <xsl:variable name="default_character_style" select="uof:句式样"/>
- <xsl:variable name="default_table_style" select="uof:文字表式样"/>
- <office:styles>
- <xsl:if test="uof:段落式样[@字:类型 = 'default']">
- <style:default-style style:family="paragraph">
- <xsl:element name="style:paragraph-properties">
- <xsl:attribute name="style:tab-stop-distance"><xsl:value-of select="concat( number(/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:默认制表位位置),$uofUnit)"/></xsl:attribute>
- </xsl:element>
- <xsl:element name="style:text-properties">
- <xsl:choose>
- <xsl:when test="/uof:UOF/uof:式样集/uof:字体集/uof:默认字体">
- <xsl:attribute name="style:font-name"><xsl:value-of select="/uof:UOF//uof:字体集/uof:默认字体/@uof:ascii"/></xsl:attribute>
- <xsl:attribute name="style:font-name-asian"><xsl:value-of select="/uof:UOF//uof:字体集/uof:默认字体/@uof:fareast"/></xsl:attribute>
- <xsl:attribute name="style:font-name-complex"><xsl:value-of select="/uof:UOF//uof:字体集/uof:默认字体/@uof:cs"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:font-name">Times New Roman</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="uof:UOF/uof:式样集/uof:句式样/字:字体"/>
- <xsl:if test="not(uof:UOF/uof:式样集/uof:句式样/字:字体/@字:字号 or uof:UOF/uof:式样集/uof:句属性/字:字体/@字:字号)">
- <xsl:attribute name="fo:font-size">10pt</xsl:attribute>
- <xsl:attribute name="fo:font-size-asian">10pt</xsl:attribute>
- <xsl:attribute name="fo:font-size-complex">10pt</xsl:attribute>
- </xsl:if>
- </xsl:element>
- </style:default-style>
- </xsl:if>
- <xsl:for-each select="uof:段落式样[@字:类型='auto']">
- <xsl:element name="style:style">
- <xsl:attribute name="style:family">paragraph</xsl:attribute>
- <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
- <xsl:if test="@字:基式样引用">
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:别名">
- <xsl:attribute name="style:display-name"><xsl:value-of select="@字:别名"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="style:paragraph-properties">
+ <xsl:template match="uof:UOF">
+ <office:document 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:html="http://www.w3.org/TR/REC-html40" xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" 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:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:smil="urn:oasis:names:tc:opendocument:xmlns:smil-compatible:1.0" xmlns:anim="urn:oasis:names:tc:opendocument:xmlns:animation:1.0" office:version="1.0">
+ <xsl:apply-templates select="uof:元数据"/>
+ <xsl:apply-templates select="uof:文字处理/字:公用处理规则/字:文档设置"/>
+ <xsl:apply-templates select="uof:字体集"/>
+ <xsl:apply-templates select="uof:式样集"/>
+ <xsl:apply-templates select="uof:文字处理"/>
+ </office:document>
+ </xsl:template>
+ <xsl:template match="uof:元数据">
+ <xsl:element name="office:meta">
+ <meta:generator>UOFText 2004</meta:generator>
+ <dc:title>
+ <xsl:value-of select="uof:标题"/>
+ </dc:title>
+ <dc:description>
+ <xsl:value-of select="uof:摘要"/>
+ </dc:description>
+ <dc:subject>
+ <xsl:value-of select="uof:主题"/>
+ </dc:subject>
+ <meta:initial-creator>
+ <xsl:value-of select="uof:创建者"/>
+ </meta:initial-creator>
+ <meta:creation-date>
+ <xsl:value-of select="substring-before( uof:创建日期, 'Z')"/>
+ </meta:creation-date>
+ <dc:creator>
+ <xsl:value-of select="uof:最后作者"/>
+ </dc:creator>
+ <dc:date>
+ <xsl:value-of select="substring-before( uof:编辑时间, 'Z')"/>
+ </dc:date>
+ <meta:printed-by/>
+ <meta:print-date/>
+ <meta:keywords>
+ <meta:keyword>
+ <xsl:value-of select="uof:关键字集/uof:关键字"/>
+ </meta:keyword>
+ </meta:keywords>
+ <dc:language/>
+ <meta:editing-cycles>
+ <xsl:value-of select="uof:编辑次数"/>
+ </meta:editing-cycles>
+ <meta:editing-duration>
+ <xsl:if test="uof:编辑时间">
+ <xsl:value-of select="concat('PT', floor(uof:编辑时间 div 60), 'H', uof:编辑时间 mod 60, 'M0S')"/>
+ </xsl:if>
+ </meta:editing-duration>
+ <meta:user-defined meta:name="Category">
+ <xsl:value-of select="uof:分类"/>
+ </meta:user-defined>
+ <meta:user-defined meta:name="Manager">
+ <xsl:value-of select="uof:经理名称"/>
+ </meta:user-defined>
+ <meta:user-defined meta:name="Company">
+ <xsl:value-of select="uof:公司名称"/>
+ </meta:user-defined>
+ <meta:user-defined meta:name="Version">
+ <xsl:value-of select="uof:创建应用程序"/>
+ </meta:user-defined>
+ <xsl:if test="uof:文档模板|child::*[@uof:locID='u0013']">
+ <meta:template xlink:type="simple" xlink:actuate="onRequest" xlink:href="{child::*[@uof:locID='u0013']}"/>
+ </xsl:if>
+ <xsl:if test="uof:用户自定义元数据集/uof:用户自定义元数据|child::*[@uof:locID='u0016']/*[@uof:locID='u0017']">
+ <xsl:for-each select="uof:用户自定义元数据集/uof:用户自定义元数据|child::*[@uof:locID='u0016']/*[@uof:locID='u0017']">
+ <xsl:element name="meta:user-defined">
+ <xsl:attribute name="meta:name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:if>
+ <meta:document-statistic>
+ <xsl:attribute name="meta:page-count">
+ <xsl:choose>
+ <xsl:when test="child::*[@uof:locID='u0020']"><xsl:value-of select="uof:页数"/></xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:段落/字:域开始[@字:类型='numpages']">
+ <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="fmt">
+ <xsl:value-of select="substring-before($date0,' \*')"/>
+ </xsl:variable>
+ <xsl:if test="$fmt='Arabic'"><xsl:value-of select="following-sibling::字:句/字:文本串"/></xsl:if>
+ <xsl:if test="not($fmt='Arabic')">
+ <xsl:variable name="content">
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$content='I' or $content='i' or $content='A' or $content='a'">1</xsl:when>
+ <xsl:when test="$content='II' or $content='ii' or $content='B' or $content='b'">2</xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:attribute name="meta:paragraph-count"><xsl:if test="child::*[@uof:locID='u0025']"><xsl:value-of select="uof:段落数"/></xsl:if></xsl:attribute>
+ <xsl:attribute name="meta:word-count"><xsl:if test="child::*[@uof:locID='u0023']"><xsl:value-of select="uof:中文字符数"/></xsl:if></xsl:attribute>
+ <xsl:attribute name="meta:object-count"><xsl:if test="child::*[@uof:locID='u0026']"><xsl:value-of select="uof:对象数"/></xsl:if></xsl:attribute>
+ <xsl:attribute name="meta:character-count">
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:段落/字:域开始[@字:类型='numchars']">
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:for-each>
+ <xsl:if test="child::*[@uof:locID='u0021']"><xsl:value-of select="uof:字数"/></xsl:if>
+ </xsl:attribute>
+ </meta:document-statistic>
+ <meta:document-statistic/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:variable name="uofUnit">
+ <xsl:variable name="uu">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:度量单位"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$uu='cm'">cm</xsl:when>
+ <xsl:when test="$uu='mm'">mm</xsl:when>
+ <xsl:when test="$uu='pt'">pt</xsl:when>
+ <xsl:when test="$uu='inch'">in</xsl:when>
+ <xsl:otherwise>cm</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="other-to-cm-conversion-factor">
+ <xsl:choose>
+ <xsl:when test="$uofUnit='cm'">1</xsl:when>
+ <xsl:when test="$uofUnit='mm'">0.1</xsl:when>
+ <xsl:when test="$uofUnit='pt'">0.03527</xsl:when>
+ <xsl:when test="$uofUnit='inch'">2.54</xsl:when>
+ <xsl:when test="$uofUnit='pica'">0.4233</xsl:when>
+ <xsl:otherwise>0.03527</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:template match="uof:式样集">
+ <xsl:apply-templates select="uof:字体集"/>
+ <xsl:variable name="default_paragraph_style" select="uof:段落式样"/>
+ <xsl:variable name="default_character_style" select="uof:句式样"/>
+ <xsl:variable name="default_table_style" select="uof:文字表式样"/>
+ <office:styles>
+ <xsl:if test="uof:段落式样[@字:类型 = 'default']">
+ <style:default-style style:family="paragraph">
+ <xsl:element name="style:paragraph-properties">
+ <xsl:attribute name="style:tab-stop-distance"><xsl:value-of select="concat( number(/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:默认制表位位置),$uofUnit)"/></xsl:attribute>
+ </xsl:element>
+ <xsl:element name="style:text-properties">
+ <xsl:choose>
+ <xsl:when test="/uof:UOF/uof:式样集/uof:字体集/uof:默认字体">
+ <xsl:attribute name="style:font-name"><xsl:value-of select="/uof:UOF//uof:字体集/uof:默认字体/@uof:ascii"/></xsl:attribute>
+ <xsl:attribute name="style:font-name-asian"><xsl:value-of select="/uof:UOF//uof:字体集/uof:默认字体/@uof:fareast"/></xsl:attribute>
+ <xsl:attribute name="style:font-name-complex"><xsl:value-of select="/uof:UOF//uof:字体集/uof:默认字体/@uof:cs"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:font-name">Times New Roman</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates select="uof:UOF/uof:式样集/uof:句式样/字:字体"/>
+ <xsl:if test="not(uof:UOF/uof:式样集/uof:句式样/字:字体/@字:字号 or uof:UOF/uof:式样集/uof:句属性/字:字体/@字:字号)">
+ <xsl:attribute name="fo:font-size">10pt</xsl:attribute>
+ <xsl:attribute name="fo:font-size-asian">10pt</xsl:attribute>
+ <xsl:attribute name="fo:font-size-complex">10pt</xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </style:default-style>
+ </xsl:if>
+ <xsl:for-each select="uof:段落式样[@字:类型='auto']">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:family">paragraph</xsl:attribute>
+ <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
+ <xsl:if test="@字:基式样引用">
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:别名">
+ <xsl:attribute name="style:display-name"><xsl:value-of select="@字:别名"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="style:paragraph-properties">
<xsl:call-template name="XDParagraphAttr"/>
- <xsl:apply-templates select="*[not(name()='字:大纲级别')]"/>
+ <xsl:apply-templates select="*[not(name()='字:大纲级别')]"/>
<xsl:if test="字:制表位设置">
<xsl:call-template name="ootab"/>
</xsl:if>
- </xsl:element>
- <xsl:element name="style:text-properties">
- <xsl:apply-templates select="字:句属性/*"/>
- </xsl:element>
- <xsl:variable name="biaoshi" select="@字:标识符"/>
- <xsl:for-each select="../uof:句式样">
- <xsl:if test="@字:标识符=$biaoshi">
- <xsl:element name="style:text-properties">
- <xsl:apply-templates select="*"/>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:for-each>
- <xsl:for-each select="uof:句式样[@字:类型='auto']">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="ancestor::字:段落式样">
- <xsl:attribute name="style:family">paragraph</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:family">text</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:element name="style:text-properties">
- <xsl:apply-templates select="*"/>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- <style:style style:name="ColumnBreakPara" style:family="paragraph">
- <style:text-properties fo:break-after="column"/>
- </style:style>
- <xsl:if test="uof:句式样">
- <style:default-style style:family="text"/>
- </xsl:if>
- <style:style style:name="Numbering Symbols" style:family="text"/>
- <style:style style:name="Bullet Symbols" style:family="text">
- <style:text-properties style:font-name="StarSymbol" fo:font-size="9pt" style:font-name-asian="StarSymbol" style:font-size-asian="9pt" style:font-name-complex="StarSymbol" style:font-size-complex="9pt"/>
- </style:style>
- <xsl:apply-templates select="uof:文字表式样" mode="table"/>
- <xsl:apply-templates select="uof:式样"/>
- <xsl:call-template name="脚注设置"/>
- <xsl:call-template name="尾注设置"/>
- <xsl:call-template name="行编号"/>
- </office:styles>
- <xsl:element name="office:automatic-styles">
- <style:style style:name="PageBreak" style:family="paragraph">
- <style:text-properties fo:break-before="page"/>
- </style:style>
- <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体/字:段落/字:句/字:句属性" mode="style"/>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:句">
- <xsl:variable name="stylename1" select="字:句属性/@字:式样引用"/>
- <xsl:element name="style:style">
- <xsl:variable name="stylenum">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
- </xsl:variable>
- <xsl:attribute name="style:name"><xsl:value-of select="concat('T',$stylenum)"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="ancestor::字:段落式样">
- <xsl:attribute name="style:family">paragraph</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:family">text</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
- <xsl:if test="$stylename1=@字:标识符">
- <xsl:choose>
- <xsl:when test="@字:标识符=/uof:UOF/uof:文字处理/字:主体/字:段落/字:句/字:句属性/字:格式修订/@字:修订信息引用">
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- <xsl:element name="style:text-properties">
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
- <xsl:if test="$stylename1=@字:标识符">
- <xsl:apply-templates select="./字:位置" mode="oo"/>
- <xsl:apply-templates select="*[not(name()='字:位置')]"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'date']">
- <xsl:element name="number:date-style">
- <xsl:attribute name="style:name">Date<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'date']"/></xsl:attribute>
- <xsl:call-template name="日期域"/>
- </xsl:element>
- </xsl:for-each>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'createdate']">
- <xsl:element name="number:date-style">
- <xsl:attribute name="style:name">CreateDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createdate']"/></xsl:attribute>
- <xsl:call-template name="日期域"/>
- </xsl:element>
- </xsl:for-each>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'savedate']">
- <xsl:element name="number:date-style">
- <xsl:attribute name="style:name">SaveDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'savedate']"/></xsl:attribute>
- <xsl:call-template name="日期域"/>
- </xsl:element>
- </xsl:for-each>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'time']">
- <xsl:element name="number:date-style">
- <xsl:attribute name="style:name">Time<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'time']"/></xsl:attribute>
- <xsl:call-template name="时间域"/>
- </xsl:element>
- </xsl:for-each>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'edittime']">
- <xsl:element name="number:time-style">
- <xsl:attribute name="style:name">EditTime<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'edittime']"/></xsl:attribute>
- <xsl:call-template name="编辑时间"/>
- </xsl:element>
- </xsl:for-each>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'createtime']">
- <xsl:element name="number:time-style">
- <xsl:attribute name="style:name">CREATETIME<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createtime']"/></xsl:attribute>
- <xsl:call-template name="创建时间"/>
- </xsl:element>
- </xsl:for-each>
- <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:文字表[not(@字:类型='sub-table')]" mode="style"/>
- <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:单元格" mode="style"/>
- <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:行[not(../../@字:类型='sub-table')]" mode="style"/>
- <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:列宽集[not(../../@字:类型='sub-table')]" mode="style"/>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:自动编号信息">
- <xsl:variable name="currlistid" select="@字:编号引用"/>
- <xsl:variable name="currlist" select="."/>
- <xsl:variable name="rootlist" select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符 =$currlistid]"/>
- <xsl:if test="not(ancestor::字:段落/preceding-sibling::字:段落[1]/字:段落属性/字:自动编号信息/@字:编号引用= $currlistid)">
- <xsl:element name="text:list-style">
- <xsl:attribute name="style:name">List<xsl:value-of select="count(preceding::字:自动编号信息)"/></xsl:attribute>
- <xsl:for-each select="$rootlist">
- <xsl:for-each select="字:级别">
- <xsl:choose>
- <xsl:when test="字:项目符号">
- <xsl:call-template name="xiangmufuhao">
- <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="字:图片符号引用">
- <xsl:call-template name="imagefuhao">
- <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="jibianhao">
- <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:节属性">
- <xsl:element name="style:page-layout">
- <xsl:attribute name="style:name">pm<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any"/></xsl:attribute>
- <xsl:if test="字:对称页边距/@字:值='true'">
- <xsl:attribute name="style:page-usage">mirrored</xsl:attribute>
- </xsl:if>
- <xsl:element name="style:page-layout-properties">
- <xsl:if test="字:纸张方向">
- <xsl:attribute name="style:print-orientation"><xsl:choose><xsl:when test="字:纸张方向='portrait'">portrait</xsl:when><xsl:when test="字:纸张方向='landscape'">landscape</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="fo:page-width"><xsl:value-of select="concat(字:纸张/@uof:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:page-height"><xsl:value-of select="concat(字:纸张/@uof:高度,$uofUnit)"/></xsl:attribute>
- <xsl:choose>
- <xsl:when test="字:页边距">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上 ,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="字:装订线/@字:位置='top'">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上 ,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="字:装订线/@字:位置='left' ">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat((字:页边距/@uof:左+ 字:装订线/@字:距边界),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
- <xsl:if test="字:拼页/@字:值='1' or 字:拼页/@字:值='true'">
- <xsl:attribute name="style:page-usage">mirrored</xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="string(字:文字排列方向)='vert-r2l'">
- <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
- </xsl:when>
- <xsl:when test="string(字:文字排列方向)='vert-l2r'">
- <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
- </xsl:when>
- <xsl:when test="string(字:文字排列方向)='hori-l2r'">
- <xsl:attribute name="style:writing-mode">lr-tb</xsl:attribute>
- </xsl:when>
- <xsl:when test="string(字:文字排列方向)='hori-r2l'">
- <xsl:attribute name="style:writing-mode">lr-tb</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:writing-mode">page</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="字:网格设置/@字:网格类型">
- <xsl:attribute name="style:layout-grid-mode"><xsl:choose><xsl:when test="字:网格设置/@字:网格类型='line-char'">both-nosnap</xsl:when><xsl:when test="字:网格设置/@字:网格类型='char'">both</xsl:when><xsl:when test="字:网格设置/@字:网格类型='line'">line</xsl:when><xsl:when test="字:网格设置/@字:网格类型='none'">none</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:网格设置/@字:宽度">
- <xsl:attribute name="style:layout-grid-base-width"><xsl:value-of select="concat(字:网格设置/@字:宽度,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:网格设置/@字:高度">
- <xsl:attribute name="style:layout-grid-base-height"><xsl:value-of select="concat(字:网格设置/@字:高度,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:网格设置/@字:显示网格">
- <xsl:attribute name="style:layout-grid-display"><xsl:value-of select="字:网格设置/@字:显示网格"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:网格设置/@字:打印网格">
- <xsl:attribute name="style:layout-grid-print"><xsl:value-of select="字:网格设置/@字:打印网格"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:稿纸设置/@字:类型">
- <xsl:attribute name="style:layout-grid-mode"><xsl:choose><xsl:when test="字:稿纸设置/@字:类型='draft-paper' ">both</xsl:when><xsl:when test="字:稿纸设置/@字:类型='letter-paper' ">line</xsl:when><xsl:otherwise>both</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:稿纸设置/@字:格式">
- <xsl:choose>
- <xsl:when test="字:稿纸设置/@字:格式='fourth-gear'">
- <xsl:attribute name="style:layout-grid-base-width">0.728cm</xsl:attribute>
- <xsl:attribute name="style:layout-grid-base-height">0.728cm</xsl:attribute>
- <xsl:attribute name="style:layout-grid-ruby-height">0.496cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="字:稿纸设置/@字:格式='third-gear'">
- <xsl:attribute name="style:layout-grid-base-width">0.584cm</xsl:attribute>
- <xsl:attribute name="style:layout-grid-base-height">0.584cm</xsl:attribute>
- <xsl:attribute name="style:layout-grid-ruby-height">0.64cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="字:稿纸设置/@字:格式='second-gear'">
- <xsl:attribute name="style:layout-grid-base-width">0.728cm</xsl:attribute>
- <xsl:attribute name="style:layout-grid-base-height">0.728cm</xsl:attribute>
- <xsl:attribute name="style:layout-grid-ruby-height">0.905cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="字:稿纸设置/@字:格式='first-gear'">
- <xsl:attribute name="style:layout-grid-base-width">0.728cm</xsl:attribute>
- <xsl:attribute name="style:layout-grid-base-height">0.728cm</xsl:attribute>
- <xsl:attribute name="style:layout-grid-ruby-height">1.633cm</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:attribute name="style:layout-grid-display">true</xsl:attribute>
- <xsl:attribute name="style:layout-grid-print">true</xsl:attribute>
- </xsl:if>
- <xsl:if test="字:稿纸设置/@字:颜色">
- <xsl:attribute name="style:layout-grid-color"><xsl:value-of select="字:稿纸设置/@字:颜色"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:边框">
- <xsl:for-each select="字:边框">
- <xsl:call-template name="uof:边框"/>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="字:填充">
- <xsl:for-each select="字:填充">
- <xsl:call-template name="uof:填充"/>
- </xsl:for-each>
- </xsl:if>
- <xsl:apply-templates select="字:填充"/>
- <xsl:attribute name="style:num-format"><xsl:variable name="format"><xsl:value-of select="字:页码设置/@字:格式"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
- <xsl:if test="字:纸张来源/@字:其他页">
- <xsl:attribute name="style:paper-tray-name"><xsl:value-of select="字:纸张来源/@字:其他页"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:分栏/@字:栏数">
- <xsl:apply-templates select="字:分栏"/>
- </xsl:if>
- </xsl:element>
- <xsl:if test="字:页眉位置">
- <style:header-style>
- <xsl:element name="style:header-footer-properties">
- <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:页眉位置/@字:距边界,$uofUnit)"/></xsl:attribute>
- <xsl:variable name="long1" select="字:页眉位置/@字:距边界"/>
- <xsl:variable name="long2" select="字:页眉位置/@字:距版芯"/>
- <xsl:variable name="long" select="$long1 + $long2"/>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat($long,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="style:dynamic-spacing">false</xsl:attribute>
- </xsl:element>
- </style:header-style>
- </xsl:if>
- <xsl:if test="字:页脚位置">
- <style:footer-style>
- <xsl:element name="style:header-footer-properties">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页脚位置/@字:距边界,$uofUnit)"/></xsl:attribute>
- <xsl:variable name="long1" select="字:页脚位置/@字:距边界"/>
- <xsl:variable name="long2" select="字:页脚位置/@字:距版芯"/>
- <xsl:variable name="long" select="$long1 + $long2"/>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat($long,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="style:dynamic-spacing">false</xsl:attribute>
- </xsl:element>
- </style:footer-style>
- </xsl:if>
- </xsl:element>
- <xsl:if test="字:分栏/@字:栏数">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">sect<xsl:value-of select="count(preceding::字:节属性[字:分栏/@字:栏数])"/></xsl:attribute>
- <xsl:attribute name="style:family">section</xsl:attribute>
- <xsl:element name="style:page-layout-properties">
- <xsl:element name="style:columns">
- <xsl:attribute name="fo:column-count"><xsl:value-of select="number(字:分栏/@字:栏数)"/></xsl:attribute>
- <xsl:attribute name="fo:column-gap"><xsl:value-of select="concat(number(字:分栏/@字:分割线宽度),$uofUnit)"/></xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='png' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='jpg' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='gif' or /uof:UOF/uof:对象集/uof:其他对象/@uof:私有类型='图片'">
- <style:style style:name="Graphics" style:family="graphic">
- <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
- </style:style>
- </xsl:if>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形"/>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形/图:文本内容/字:段落/字:句/字:句属性" mode="style"/>
- <xsl:call-template name="duanluoshuxing"/>
- </xsl:element>
- <office:master-styles>
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:节属性">
- <xsl:element name="style:master-page">
- <xsl:variable name="master-page-name">
- <xsl:number count="字:节属性" from="/uof:UOF/uof:文字处理/字:主体" level="any"/>
- </xsl:variable>
- <xsl:attribute name="style:name"><xsl:choose>
- <xsl:when test="../@字:名称"><xsl:value-of select="../@字:名称"/></xsl:when>
- <xsl:otherwise>Standard</xsl:otherwise>
- </xsl:choose></xsl:attribute>
- <xsl:attribute name="style:page-layout-name"><xsl:value-of select="concat('pm', $master-page-name)"/></xsl:attribute>
- <xsl:if test="following::字:节属性">
- <xsl:attribute name="style:next-style-name">Standard<xsl:value-of select="$master-page-name +1"/></xsl:attribute>
- </xsl:if>
- <xsl:for-each select="字:页眉">
- <xsl:if test="字:首页页眉 or 字:奇数页页眉">
- <xsl:element name="style:header">
- <xsl:apply-templates select="字:奇数页页眉/字:段落 | 字:首页页眉/字:段落 | 字:奇数页页眉/字:文字表 | 字:首页页眉/字:文字表"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="字:偶数页页眉">
- <xsl:element name="style:header-left">
- <xsl:apply-templates select="字:偶数页页眉/字:段落 | 字:偶数页页眉/字:文字表"/>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="字:页脚">
- <xsl:if test="字:奇数页页脚 or 字:首页页脚">
- <xsl:element name="style:footer">
- <xsl:apply-templates select="字:奇数页页脚/字:段落 | 字:首页页脚/字:段落 | 字:奇数页页脚/字:文字表 | 字:首页页脚/字:文字表"/>
- </xsl:element>
- </xsl:if>
- <xsl:if test="字:偶数页页脚">
- <xsl:element name="style:footer-left">
- <xsl:apply-templates select="字:偶数页页脚/字:段落 | 字:偶数页页脚/字:文字表"/>
- </xsl:element>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="字:奇偶页页眉页脚不同">
- <xsl:element name="style:header-left">
- </xsl:element>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- </office:master-styles>
- </xsl:template>
- <xsl:template match="字:填充">
- <xsl:choose>
- <xsl:when test="图:颜色">
- <xsl:attribute name="fo:background-color"><xsl:value-of select="图:颜色"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:图案/@图:背景色">
- <xsl:attribute name="style:text-background-color"><xsl:choose><xsl:when test="contains(图:图案/@图:背景色,'#')"><xsl:value-of select="图:图案/@图:背景色"/></xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:图案/@图:前景色">
- <xsl:attribute name="fo:text-background-color"><xsl:choose><xsl:when test="contains(图:图案/@图:前景色,'#')"><xsl:value-of select="图:图案/@图:前景色"/></xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:分栏">
- <xsl:element name="style:columns">
- <xsl:attribute name="fo:column-count"><xsl:value-of select="//字:分栏/@字:栏数"/></xsl:attribute>
- <xsl:variable name="aa">
- <xsl:value-of select="//字:分栏/字:栏[position()=1]/@字:间距"/>
- </xsl:variable>
- <xsl:if test="//字:分栏/@字:等宽='true' ">
- <xsl:attribute name="fo:column-gap"><xsl:value-of select="concat($aa * 2,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="//字:分栏/@字:分隔线宽度">
- <xsl:element name="style:column-sep">
- <xsl:attribute name="style:width"><xsl:value-of select="concat(@字:分隔线宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="style:color"><xsl:value-of select="@字:分隔线颜色"/></xsl:attribute>
- <xsl:attribute name="style:height">100%</xsl:attribute>
- <xsl:attribute name="style:vertical-align">top</xsl:attribute>
- </xsl:element>
- </xsl:if>
- <xsl:for-each select="//字:分栏/字:栏">
- <xsl:element name="style:column">
- <xsl:attribute name="style:rel-width"><xsl:value-of select="@字:宽度"/>*</xsl:attribute>
- <xsl:if test="parent::字:分栏/@字:宽度='true'">
- <xsl:choose>
- <xsl:when test="self::node()[not(preceding-sibling::字:栏)]">
- <xsl:attribute name="fo:start-indent">0cm</xsl:attribute>
- <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="self::node()[not(following-sibling::字:栏)]">
- <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:end-indent">0cm</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="parent::字:分栏/@字:等宽='false'">
- <xsl:variable name="last" select="preceding-sibling::字:栏[1]/@字:间距"/>
- <xsl:choose>
- <xsl:when test="self::node()[not(preceding-sibling::字:栏)]">
- <xsl:attribute name="fo:start-indent">0cm</xsl:attribute>
- <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="self::node()[not(following-sibling::字:栏)]">
- <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat($last,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:end-indent">0cm</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat($last,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template match="uof:文字表式样" mode="table">
- <style:style style:family="table">
- <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
- <xsl:if test="@字:基式样引用">
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
- </xsl:if>
- <style:table-properties>
- <xsl:choose>
- <xsl:when test="字:对齐">
- <xsl:attribute name="table:align"><xsl:value-of select="字:对齐"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:align">margins</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="字:宽度/@字:相对宽度">
- <xsl:variable name="reltblw">
- <xsl:value-of select="concat(number(字:宽度/@字:相对宽度),'%')"/>
- </xsl:variable>
- <xsl:variable name="pagew">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
- </xsl:variable>
- <xsl:variable name="leftm">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
- </xsl:variable>
- <xsl:variable name="rightm">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
- </xsl:variable>
- <xsl:attribute name="style:rel-width"><xsl:value-of select="concat(number(字:宽度/@字:相对宽度) * 100,'%')"/></xsl:attribute>
- <xsl:attribute name="style:width"><xsl:value-of select="concat((number($pagew)-number($leftm)-number($rightm)) * number($reltblw),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="字:宽度/@字:绝对宽度">
- <xsl:attribute name="style:width"><xsl:value-of select="concat(number(字:宽度/@字:绝对宽度),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </style:table-properties>
- </style:style>
- </xsl:template>
- <xsl:template match="字:文字表" mode="style">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/></xsl:attribute>
- <xsl:attribute name="style:family">table</xsl:attribute>
- <xsl:if test="@字:式样引用">
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="name(preceding-sibling::*[1])='字:分节'">
- <xsl:attribute name="style:master-page-name"><xsl:value-of select="preceding-sibling::*[1]/@字:名称"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="style:table-properties">
- <xsl:for-each select="字:文字表属性">
- <xsl:variable name="biaoshi" select="@字:式样引用"/>
- <xsl:choose>
- <xsl:when test="字:对齐 = 'left' or 字:对齐 = 'center' or 字:对齐 = 'right'">
- <xsl:attribute name="table:align"><xsl:value-of select="字:对齐"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:对齐">
- <xsl:attribute name="table:align"><xsl:value-of select="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:对齐"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:align">margins</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="字:左缩进">
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(number(字:左缩进),$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:绕排/@字:值='around'">
- <xsl:if test="字:绕排边距/@字:上">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:绕排边距/@字:上,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:绕排边距/@字:左">
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:绕排边距/@字:左,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:绕排边距/@字:右">
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:绕排边距/@字:右,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:绕排边距/@字:下">
- <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:绕排边距/@字:下,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="@字:式样引用">
- <xsl:variable name="rootStyle" select="@字:式样引用"/>
- <xsl:variable name="rootStyleNode" select="/uof:UOF/uof:式样集/字:文字表式样[@字:基式样引用 = $rootStyle]"/>
- <xsl:variable name="paddingleft">
- <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:左"/>
- </xsl:variable>
- <xsl:variable name="paddingright">
- <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:右"/>
- </xsl:variable>
- <xsl:variable name="paddingtop">
- <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:上"/>
- </xsl:variable>
- <xsl:variable name="paddingbottom">
- <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:下"/>
- </xsl:variable>
- <xsl:if test="$rootStyleNode/字:文字表属性/字:边距/@uof:左">
- <xsl:attribute name="fo:margin-left">-<xsl:value-of select="(number($paddingleft))* $other-to-cm-conversion-factor"/>cm</xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="字:宽度/@字:相对宽度">
- <xsl:variable name="reltblw">
- <xsl:value-of select="字:宽度/@字:相对宽度"/>
- </xsl:variable>
- <xsl:variable name="pagew">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
- </xsl:variable>
- <xsl:variable name="leftm">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
- </xsl:variable>
- <xsl:variable name="rightm">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
- </xsl:variable>
- <xsl:attribute name="style:rel-width"><xsl:value-of select="concat(number(字:宽度/@字:相对宽度) * 100,'%')"/></xsl:attribute>
- <xsl:attribute name="style:width"><xsl:value-of select="concat((number($pagew)-number($leftm)-number($rightm)) * number($reltblw),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="字:宽度/@字:绝对宽度">
- <xsl:attribute name="style:width"><xsl:value-of select="concat(number(字:宽度/@字:绝对宽度),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:相对宽度 or /uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:绝对宽度">
- <xsl:attribute name="style:rel-width"><xsl:value-of select="concat(/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:相对宽度 * 100,'%')"/></xsl:attribute>
- <xsl:attribute name="style:width"><xsl:value-of select="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:绝对宽度"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="pagew">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
- </xsl:variable>
- <xsl:variable name="leftm">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
- </xsl:variable>
- <xsl:variable name="rightm">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
- </xsl:variable>
- <xsl:attribute name="style:width"><xsl:value-of select="concat((number($pagew)-number($leftm)-number($rightm)),$uofUnit)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="tblsize" select="sum(字:列宽集/字:列宽)"/>
- <xsl:if test="(not($tblsize='0')) and not(字:宽度) ">
- <xsl:choose>
- <xsl:when test="字:左缩进">
- <xsl:attribute name="style:width"><xsl:value-of select="concat( number($tblsize - 字:左缩进), $uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:width"><xsl:value-of select="concat( number(sum(字:列宽集/字:列宽) ), $uofUnit)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="字:边框">
- <xsl:for-each select="字:边框">
- <xsl:call-template name="uof:边框"/>
- </xsl:for-each>
- </xsl:if>
- <xsl:for-each select="字:填充">
- <xsl:call-template name="uof:填充"/>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template match="字:列宽集" mode="style">
- <xsl:choose>
- <xsl:when test="not(./字:列宽)">
- <xsl:for-each select="../..">
- <xsl:for-each select="字:行[1]/字:单元格">
- <xsl:element name="style:style">
- <xsl:attribute name="style:family">table-column</xsl:attribute>
- <xsl:attribute name="style:name">Table<xsl:number count="字:文字表" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number value="count(preceding::字:单元格)+1"/></xsl:attribute>
- <xsl:element name="style:table-column-properties">
- <xsl:choose>
- <xsl:when test="字:单元格属性/字:宽度/@字:相对值">
- <xsl:variable name="tblw1">
- <xsl:choose>
- <xsl:when test="../../字:文字表属性/字:宽度/@字:绝对宽度">
- <xsl:value-of select="../../字:文字表属性/字:宽度/@字:绝对宽度"/>
- </xsl:when>
- <xsl:when test="../../字:文字表属性/字:宽度/@字:相对宽度">
- <xsl:variable name="pagew">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
- </xsl:variable>
- <xsl:variable name="leftm">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
- </xsl:variable>
- <xsl:variable name="rightm">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
- </xsl:variable>
- <xsl:variable name="relw">
- <xsl:value-of select="../../字:文字表属性/字:宽度/@字:相对宽度"/>
- </xsl:variable>
- <xsl:value-of select=" ( number($pagew)-number($leftm)-number($rightm))* number($relw) div 100"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="pagew">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
- </xsl:variable>
- <xsl:variable name="leftm">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
- </xsl:variable>
- <xsl:variable name="rightm">
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
- </xsl:variable>
- <xsl:value-of select="(number($pagew)-number($leftm)-number($rightm))"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="style:column-width"><xsl:value-of select="concat(number(number($tblw1)*number(字:单元格属性/字:宽度/@字:相对值) div 100),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="字:单元格属性/字:宽度/@字:绝对值">
- <xsl:attribute name="style:column-width"><xsl:value-of select="concat(number(字:单元格属性/字:宽度/@字:绝对值),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:column-width"><xsl:value-of select="'1cm'"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="字:列宽">
- <xsl:element name="style:style">
- <xsl:attribute name="style:family">table-column</xsl:attribute>
- <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number count="字:列宽" from="/uof:UOF/uof:文字处理/字:主体" level="single" format="1"/></xsl:attribute>
- <xsl:variable name="tableRoot" select="ancestor::字:文字表"/>
- <xsl:element name="style:table-column-properties">
- <xsl:choose>
- <xsl:when test="string(.)">
- <xsl:attribute name="style:column-width"><xsl:value-of select="concat(.,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:column-width"><xsl:value-of select="'1cm'"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:行" mode="style">
- <xsl:element name="style:style">
- <xsl:attribute name="style:family">table-row</xsl:attribute>
- <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/></xsl:attribute>
- <xsl:element name="style:table-row-properties">
- <xsl:for-each select="字:表行属性">
- <xsl:choose>
- <xsl:when test="字:高度/@字:固定值">
- <xsl:attribute name="style:row-height"><xsl:value-of select="concat(number(字:高度/@字:固定值),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="字:高度/@字:最小值">
- <xsl:attribute name="style:min-row-height"><xsl:value-of select="concat(number(字:高度/@字:最小值), $uofUnit )"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:attribute name="fo:keep-together"><xsl:value-of select="字:跨页/@字:值"/></xsl:attribute>
- </xsl:for-each>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template match="字:单元格" mode="style">
- <style:style>
- <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/>C<xsl:number count="字:单元格" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]/字:行" level="any" format="1"/></xsl:attribute>
- <xsl:attribute name="style:family">table-cell</xsl:attribute>
- <xsl:element name="style:table-cell-properties">
- <xsl:for-each select="字:单元格属性">
- <xsl:choose>
- <xsl:when test="字:单元格边距/@字:左">
- <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(number(字:单元格边距/@字:左),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:padding-left"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:左"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="字:单元格边距/@字:右">
- <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(number(字:单元格边距/@字:右),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:padding-right"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:右"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="字:单元格边距/@字:上">
- <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(number(字:单元格边距/@字:上),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:padding-top"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:上"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="字:单元格边距/@字:下">
- <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(number(字:单元格边距/@字:下),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:下"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:variable name="cellbefore">
- <xsl:value-of select="count(ancestor::字:单元格/preceding-sibling::字:单元格)"/>
- </xsl:variable>
- <xsl:variable name="cellafter">
- <xsl:value-of select="count(ancestor::字:单元格/following-sibling::字:单元格)"/>
- </xsl:variable>
- <xsl:variable name="rowbefore">
- <xsl:value-of select="count(ancestor::字:行/preceding-sibling::字:行)"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="字:边框">
- <xsl:for-each select="字:边框">
- <xsl:call-template name="uof:边框"/>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="number($cellafter) &gt; 0">
- <xsl:attribute name="fo:border-right">none</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:border-right">0.002cm solid #000000</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:border-left">0.002cm solid #000000</xsl:attribute>
- <xsl:choose>
- <xsl:when test="number($rowbefore) &gt; 0">
- <xsl:attribute name="fo:border-top">none</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:border-top">0.002cm solid #000000</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:border-bottom">0.002cm solid #000000</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:垂直对齐方式='center' ">middle</xsl:when><xsl:when test="字:垂直对齐方式='bottom' ">bottom</xsl:when><xsl:otherwise>top</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:for-each select="字:填充">
- <xsl:call-template name="uof:填充"/>
- </xsl:for-each>
- </xsl:for-each>
- </xsl:element>
- </style:style>
- </xsl:template>
- <xsl:template match="uof:字体集">
- <xsl:element name="office:font-face-decls">
- <style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="roman" style:font-pitch="variable"/>
- <style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/>
- <style:font-face style:name="Symbol" svg:font-family="Symbol" style:font-family-generic="roman" style:font-pitch="variable" style:font-charset="x-symbol"/>
- <style:font-face style:name="Courier New" svg:font-family="'Courier New'" style:font-family-generic="modern" style:font-pitch="fixed"/>
- <xsl:if test="not(uof:字体声明[@uof:名称='StarSymbol'])">
- <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol" style:font-charset="x-symbol"/>
- </xsl:if>
- <xsl:for-each select="uof:字体声明">
- <xsl:element name="style:font-face">
- <xsl:attribute name="style:name"><xsl:value-of select="@uof:标识符"/></xsl:attribute>
- <xsl:attribute name="svg:font-family"><xsl:value-of select="@uof:名称"/></xsl:attribute>
- <xsl:if test="@uof:字符集 = '02'">
- <xsl:attribute name="style:font-charset">x-symbol</xsl:attribute>
- </xsl:if>
- <xsl:if test="@uof:字体族">
- <xsl:choose>
- <xsl:when test="@uof:字体族 = 'Swiss'">
- <xsl:attribute name="style:font-family-generic">swiss</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='Modern'">
- <xsl:attribute name="style:font-family-generic">modern</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族='Roman'">
- <xsl:attribute name="style:font-family-generic">roman</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='Script'">
- <xsl:attribute name="style:font-family-generic">script</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='Decorative'">
- <xsl:attribute name="style:font-family-generic">decorative</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:字体族 ='System'">
- <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:attribute name="style:font-pitch">12</xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- <xsl:apply-templates select="uof:字体声明"/>
- </xsl:element>
- </xsl:template>
- <xsl:template match="uof:式样">
- <xsl:element name="style:text-properties">
- <xsl:apply-templates select="uof:句式样/*"/>
- <xsl:apply-templates select="uof:段落式样/*"/>
- <xsl:call-template name="paragraph-properties"/>
- </xsl:element>
- </xsl:template>
- <xsl:template match="uof:段落式样"/>
- <xsl:template match="uof:句式样"/>
- <xsl:template match="字:公用处理规则">
- <xsl:apply-templates select="uof:文字处理/字:公用处理规则/字:文档设置"/>
- </xsl:template>
- <xsl:template match="uof:文字处理/字:公用处理规则/字:文档设置">
- <office:settings>
- <config:config-item-set config:name="ooo:view-settings">
- <config:config-item config:name="InBrowseMode" config:type="boolean">
- <xsl:choose>
- <xsl:when test="字:当前视图='web'">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </config:config-item>
- <config:config-item-map-indexed config:name="Views">
- <config:config-item-map-entry>
- <xsl:if test="字:缩放">
- <config:config-item config:name="VisibleRight" config:type="int">1</config:config-item>
- <config:config-item config:name="VisibleBottom" config:type="int">1</config:config-item>
- <xsl:choose>
- <xsl:when test="字:缩放 = 'best-fit'">
- <config:config-item config:name="ZoomType" config:type="short">3</config:config-item>
- </xsl:when>
- <xsl:when test="字:缩放 = 'full-page'">
- <config:config-item config:name="ZoomType" config:type="short">2</config:config-item>
- </xsl:when>
- <xsl:when test="字:缩放 = 'text-fit'">
- <config:config-item config:name="ZoomType" config:type="short">1</config:config-item>
- </xsl:when>
- <xsl:otherwise>
- <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
- </xsl:otherwise>
- </xsl:choose>
- <config:config-item config:name="ZoomFactor" config:type="short">
- <xsl:value-of select="字:缩放"/>
- </config:config-item>
- </xsl:if>
- </config:config-item-map-entry>
- </config:config-item-map-indexed>
- </config:config-item-set>
- <config:config-item-set config:name="configuration-settings">
- <config:config-item-map-indexed config:name="ForbiddenCharacters">
- <config:config-item-map-entry>
- <config:config-item config:name="Language" config:type="string">zh</config:config-item>
- <config:config-item config:name="Country" config:type="string">CN</config:config-item>
- <config:config-item config:name="Variant" config:type="string"/>
- <config:config-item config:name="BeginLine" config:type="string">
- <xsl:choose>
- <xsl:when test="字:标点禁则/字:行首字符 or *[@uof:locID='t0007']/*[@uof:locID='t0008']">
- <xsl:value-of select="*[@uof:locID='t0007']/*[@uof:locID='t0008']"/>
- </xsl:when>
- <xsl:otherwise>:!),.:;?]}_'"、。〉》」』】〕〗〞︰︱︳﹐_﹒﹔﹕﹖﹗﹚﹜﹞!),.:;?|}︴︶︸︺︼︾﹀﹂﹄﹏_~¢々‖_·ˇˉ―--′</xsl:otherwise>
- </xsl:choose>
- </config:config-item>
- <config:config-item config:name="EndLine" config:type="string">
- <xsl:choose>
- <xsl:when test="字:标点禁则/字:行尾字符 or *[@uof:locID='t0007']/*[@uof:locID='t0009']">
- <xsl:value-of select="*[@uof:locID='t0007']/*[@uof:locID='t0009']"/>
- </xsl:when>
- <xsl:otherwise>([{__'"‵〈《「『【〔〖([{£¥〝︵︷︹︻︽︿﹁﹃﹙﹛﹝({</xsl:otherwise>
- </xsl:choose>
- </config:config-item>
- </config:config-item-map-entry>
- </config:config-item-map-indexed>
- </config:config-item-set>
- </office:settings>
- </xsl:template>
- <xsl:template match="uof:文字处理">
- <xsl:element name="office:body">
- <xsl:element name="office:text">
- <xsl:call-template name="GenerateTrackChanges"/>
- <text:sequence-decls>
- <xsl:call-template name="default_sequence_declaration"/>
- </text:sequence-decls>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="default_sequence_declaration">
- <text:sequence-decl text:display-outline-level="0" text:name="Illustration">
- </text:sequence-decl>
- <text:sequence-decl text:display-outline-level="0" text:name="Table">
- </text:sequence-decl>
- <text:sequence-decl text:display-outline-level="0" text:name="Text">
- </text:sequence-decl>
- <text:sequence-decl text:display-outline-level="0" text:name="Drawing">
- </text:sequence-decl>
- <text:sequence-decl text:display-outline-level="0" text:name="AutoNr">
- </text:sequence-decl>
- </xsl:template>
- <xsl:template name="段落" match="字:段落[not((preceding-sibling::字:段落/字:域开始) and (not(preceding-sibling::字:段落/字:域结束)))][not(字:段落属性[字:自动编号信息])]">
- <xsl:if test="字:域开始/@字:类型='caption'">
- <xsl:apply-templates select="字:域代码"/>
- </xsl:if>
- <xsl:if test="字:域开始/@字:类型='REF'">
- <xsl:call-template name="目录域"/>
- </xsl:if>
- <xsl:if test="字:域开始/@字:类型='INDEX'">
- <xsl:call-template name="索引域"/>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="string(parent::node()/@uof:locID)='t0107'">
- <xsl:apply-templates select="字:脚注"/>
- </xsl:when>
- <xsl:when test="string(parent::node()/@uof:locID)='t0108'">
- <xsl:apply-templates select="字:尾注"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="commonParagraph"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:脚注">
- <xsl:element name="text:note">
- <xsl:attribute name="text:note-class">footnote</xsl:attribute>
- <xsl:element name="text:note-citation">
- <xsl:attribute name="text:label"><xsl:value-of select="@字:引文体"/></xsl:attribute>
- <xsl:value-of select="@字:引文体"/>
- </xsl:element>
- <xsl:element name="text:note-body">
- <xsl:for-each select="字:段落">
- <xsl:call-template name="commonParagraph"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template match="字:尾注">
- <xsl:element name="text:note">
- <xsl:attribute name="text:note-class">endnote</xsl:attribute>
- <xsl:element name="text:note-citation">
- <xsl:attribute name="text:label"><xsl:value-of select="@字:引文体"/></xsl:attribute>
- <xsl:value-of select="@字:引文体"/>
- </xsl:element>
- <xsl:element name="text:note-body">
- <xsl:for-each select="字:段落">
- <xsl:call-template name="commonParagraph"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template match="字:锚点">
- <xsl:call-template name="图形解析"/>
- </xsl:template>
- <xsl:key match="/uof:UOF/uof:文字处理/字:主体/字:段落/字:句/字:锚点 | /uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页眉//字:锚点 | /uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页脚//字:锚点" name="rel_graphic_name" use="字:图形/@字:图形引用"/>
- <xsl:template match="图:图形">
- <xsl:variable name="random-name">
- <xsl:value-of select="generate-id()"/>
- </xsl:variable>
- <xsl:variable name="draw-name">
- <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
- </xsl:variable>
- <xsl:call-template name="graphic-fill">
- <xsl:with-param name="draw-name" select="$draw-name"/>
- <xsl:with-param name="gradient-name" select="图:预定义图形/图:属性/图:填充/图:渐变"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变 | 图:预定义图形/图:属性/图:填充/图:颜色 | 图:预定义图形/图:属性/图:填充/图:图片 | 图:预定义图形/图:属性/图:填充/图:位图">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="style:family">graphic</xsl:attribute>
- <xsl:if test="图:文本内容/@图:自动换行='true' or 图:文本内容/@图:自动换行='1'">
- <xsl:attribute name="draw:fit-to-contour">true</xsl:attribute>
- </xsl:if>
- <xsl:element name="style:graphic-properties">
- <xsl:call-template name="process-graphics">
- <xsl:with-param name="draw-name" select="$draw-name"/>
- </xsl:call-template>
- </xsl:element>
- <xsl:if test="图:文本内容/@图:文字排列方向">
- <xsl:choose>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
- <style:paragraph-properties style:writing-mode="tb-rl"/>
- </xsl:when>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
- <style:paragraph-properties style:writing-mode="tb-rl"/>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="style:family">graphic</xsl:attribute>
- <xsl:element name="style:graphic-properties">
- <xsl:if test="@图:其他对象 or key('rel_graphic_name',@图:标识符)/字:锚点属性/字:锚点属性/字:位置/字:垂直/字:相对/@字:相对于">
- <xsl:attribute name="fo:clip">rect(0cm 0cm 0cm 0cm)</xsl:attribute>
- <xsl:attribute name="draw:color-mode">standard</xsl:attribute>
- <xsl:attribute name="draw:luminance">0%</xsl:attribute>
- <xsl:attribute name="draw:contrast">0%</xsl:attribute>
- <xsl:attribute name="draw:gamma">100%</xsl:attribute>
- <xsl:attribute name="draw:red">0%</xsl:attribute>
- <xsl:attribute name="draw:green">0%</xsl:attribute>
- <xsl:attribute name="draw:blue">0%</xsl:attribute>
- <xsl:attribute name="draw:image-opacity">100%</xsl:attribute>
- <xsl:attribute name="style:mirror">none</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="process-graphics"/>
- </xsl:element>
- <xsl:if test="图:文本内容/@图:文字排列方向">
- <xsl:choose>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
- <style:paragraph-properties style:writing-mode="tb-rl"/>
- </xsl:when>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
- <style:paragraph-properties style:writing-mode="tb-rl"/>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="bina_graphic">
- <xsl:param name="refGraphic"/>
- <xsl:element name="office:binary-data">
- <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符 = $refGraphic]">
- <xsl:value-of select="uof:数据"/>
- </xsl:for-each>
- </xsl:element>
- <text:p/>
- </xsl:template>
- <xsl:template name="graphic-fill">
- <xsl:param name="draw-name"/>
- <xsl:param name="gradient-name"/>
- <xsl:if test="图:预定义图形/图:属性/图:填充/图:渐变">
- <xsl:element name="draw:gradient">
- <xsl:attribute name="draw:name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
- <xsl:attribute name="draw:style"><xsl:choose><xsl:when test="$gradient-name/@图:种子类型='linear'"><xsl:value-of select="'linear'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='radar'"><xsl:value-of select="'radial'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='oval'"><xsl:value-of select="'ellipsoid'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='square'"><xsl:value-of select="'square'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='rectangle'"><xsl:value-of select="'rectangular'"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="draw:start-color"><xsl:value-of select="$gradient-name/@图:起始色"/></xsl:attribute>
- <xsl:attribute name="draw:end-color"><xsl:value-of select="$gradient-name/@图:终止色"/></xsl:attribute>
- <xsl:attribute name="draw:start-intensity"><xsl:value-of select="concat($gradient-name/@图:起始浓度,'%')"/></xsl:attribute>
- <xsl:attribute name="draw:end-intensity"><xsl:value-of select="concat($gradient-name/@图:终止浓度,'%')"/></xsl:attribute>
- <xsl:attribute name="draw:angle"><xsl:value-of select="$gradient-name/@图:渐变方向 * 10"/></xsl:attribute>
- <xsl:attribute name="draw:border"><xsl:value-of select="concat($gradient-name/@图:边界,'%')"/></xsl:attribute>
- <xsl:if test="$gradient-name/@图:种子X位置">
- <xsl:attribute name="draw:cx"><xsl:value-of select="concat($gradient-name/@图:种子X位置,'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$gradient-name/@图:种子Y位置">
- <xsl:attribute name="draw:cy"><xsl:value-of select="concat($gradient-name/@图:种子Y位置,'%')"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
- <xsl:element name="draw:marker">
- <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">
- <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
- <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">
- <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
- <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
- <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
- <xsl:element name="draw:marker">
- <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">
- <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
- <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">
- <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
- <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
- <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">
- <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
- <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用 or 图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
- <xsl:element name="draw:fill-image">
- <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:类型"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/></xsl:when></xsl:choose></xsl:when></xsl:choose></xsl:attribute>
- <xsl:call-template name="bina_graphic">
- <xsl:with-param name="refGraphic">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
- <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"/>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称">
- <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用">
- <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
- </xsl:when>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- <xsl:if test="not(图:预定义图形/图:属性/图:线型='single') and not(图:预定义图形/图:属性/图:线型='thick') and 图:预定义图形/图:属性/图:线型">
- <xsl:variable name="line" select="图:预定义图形/图:属性/图:线型"/>
- <xsl:element name="draw:stroke-dash">
- <xsl:choose>
- <xsl:when test="$line='dash-long' or $line='dash-long-heavy'">
- <xsl:attribute name="draw:name">Fine_20_Dashed</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">0.508cm</xsl:attribute>
- <xsl:attribute name="draw:dots2">1</xsl:attribute>
- <xsl:attribute name="draw:dots2-length">0.508cm</xsl:attribute>
- <xsl:attribute name="draw:distance">0.508cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='dot-dot-dash' or $line='dash-dot-dot-heavy'">
- <xsl:attribute name="draw:name">2 Dots 1 Dash</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">2</xsl:attribute>
- <xsl:attribute name="draw:dots2">1</xsl:attribute>
- <xsl:attribute name="draw:dots2-length">0.203cm</xsl:attribute>
- <xsl:attribute name="draw:distance">0.203cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='dash' or $line='dashed-heavy'">
- <xsl:attribute name="draw:name">Ultrafine Dashed</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">0.051cm</xsl:attribute>
- <xsl:attribute name="draw:dots2">1</xsl:attribute>
- <xsl:attribute name="draw:dots2-length">0.051cm</xsl:attribute>
- <xsl:attribute name="draw:distance">0.051cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='dotted' or $line='dotted-heavy'">
- <xsl:attribute name="draw:name">Ultrafine Dotted (var)</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:distance">50%</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='wave' or $line='wavy-heavy'">
- <xsl:attribute name="draw:name">Ultrafine 2 Dots 3 Dashes</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">2</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">0.051cm</xsl:attribute>
- <xsl:attribute name="draw:dots2">3</xsl:attribute>
- <xsl:attribute name="draw:dots2-length">0.254cm</xsl:attribute>
- <xsl:attribute name="draw:distance">0.127cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='dot-dash' or $line='dash-dot-heavy'">
- <xsl:attribute name="draw:name">3 Dashes 3 Dots (var)</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">3</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">197%</xsl:attribute>
- <xsl:attribute name="draw:dots2">3</xsl:attribute>
- <xsl:attribute name="draw:distance">100%</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='double'">
- <xsl:attribute name="draw:name">Line with Fine Dots</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">2.007cm</xsl:attribute>
- <xsl:attribute name="draw:dots2">10</xsl:attribute>
- <xsl:attribute name="draw:distance">0.152cm</xsl:attribute>
- </xsl:when>
- <xsl:when test="$line='wavy-double'">
- <xsl:attribute name="draw:name">Fine Dashed (var)</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">197%</xsl:attribute>
- <xsl:attribute name="draw:distance">197%</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="draw:name">Fine Dashed</xsl:attribute>
- <xsl:attribute name="draw:style">rect</xsl:attribute>
- <xsl:attribute name="draw:dots1">1</xsl:attribute>
- <xsl:attribute name="draw:dots1-length">0.508cm</xsl:attribute>
- <xsl:attribute name="draw:dots2">1</xsl:attribute>
- <xsl:attribute name="draw:dots2-length">0.508cm</xsl:attribute>
- <xsl:attribute name="draw:distance">0.508cm</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="process-graphics">
- <xsl:param name="draw-name"/>
- <xsl:if test="图:预定义图形/图:类别">
- </xsl:if>
- <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:位置/字:垂直">
- <xsl:attribute name="style:vertical-pos"><xsl:choose><xsl:when test="字:绝对">from-top</xsl:when><xsl:when test="字:相对/@字:值='bottom'">bottom</xsl:when><xsl:when test="字:相对/@字:值='center'">middle</xsl:when><xsl:when test="字:相对/@字:值='inside'">below</xsl:when><xsl:otherwise>top</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:vertical-rel"><xsl:choose><xsl:when test="@字:相对于='margin'">paragraph-content</xsl:when><xsl:otherwise><xsl:value-of select="@字:相对于"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:for-each>
- <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:位置/字:水平">
- <xsl:attribute name="style:horizontal-pos"><xsl:choose><xsl:when test="字:绝对">from-left</xsl:when><xsl:otherwise><xsl:value-of select="字:相对/@字:值"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:horizontal-rel"><xsl:choose><xsl:when test="@字:相对于='margin'">paragraph</xsl:when><xsl:when test="@字:相对于='page'">page</xsl:when><xsl:when test="@字:相对于='column'">paragraph</xsl:when><xsl:when test="@字:相对于='char'">char</xsl:when></xsl:choose></xsl:attribute>
- </xsl:for-each>
- <xsl:variable name="wrap_type">
- <xsl:value-of select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:绕排/@字:绕排方式"/>
- </xsl:variable>
- <xsl:variable name="aa">
- <xsl:value-of select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:绕排/@字:绕排顶点"/>
- </xsl:variable>
- <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:绕排/@字:绕排方式">
- <xsl:attribute name="style:wrap"><xsl:choose><xsl:when test="$wrap_type = 'through'">run-through</xsl:when><xsl:when test="$wrap_type = 'tight'">right</xsl:when><xsl:when test="$wrap_type = 'square'">parallel</xsl:when><xsl:when test="$wrap_type = 'top-bottom'">dynamic</xsl:when><xsl:when test="$wrap_type = 'infrontoftext'">run-through</xsl:when><xsl:when test="$wrap_type = 'behindtext'">run-through</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:run-through"><xsl:choose><xsl:when test="$wrap_type = 'behindtext'">background</xsl:when><xsl:otherwise>foreground</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:for-each>
- <xsl:if test="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:边距">
- <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:边距">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(@字:上,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(@字:下,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(@字:右,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(@字:左,$uofUnit)"/></xsl:attribute>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:保护/@字:值='true'">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:名称">
- <xsl:attribute name="style:protect">position size</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:protect">content size position</xsl:attribute>
- <xsl:attribute name="draw:size-protect">true</xsl:attribute>
- <xsl:attribute name="draw:move-protect">true</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:名称">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:名称='椭圆'">
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="not(图:预定义图形/图:属性/图:填充)">
- <xsl:attribute name="draw:fill">none</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称='background-image'">
- <xsl:element name="style:background-image">
- <xsl:element name="office:binary-data">
- <xsl:variable name="biaoshi">
- <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
- </xsl:variable>
- <xsl:value-of select="ancestor::uof:对象集/uof:其他对象[@uof:标识符=$biaoshi]/uof:数据"/>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
- <xsl:attribute name="draw:fill-image-name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/></xsl:when></xsl:choose></xsl:attribute>
- <xsl:if test="not(图:预定义图形/图:属性/图:填充/图:图片/@图:位置='tile')">
- <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案">
- <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:前景色"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:颜色">
- <xsl:attribute name="draw:fill">solid</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
- <xsl:attribute name="fo:background-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
- <xsl:attribute name="draw:fill">gradient</xsl:attribute>
- <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:渐变/@图:起始色"/></xsl:attribute>
- <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="图:预定义图形/图:属性/图:线颜色">
- <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:线型 and not(图:预定义图形/图:属性/图:线型 = 'single') and not(图:预定义图形/图:属性/图:线型 = 'thick')">
- <xsl:variable name="linetype" select="图:预定义图形/图:属性/图:线型"/>
- <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="$linetype='none'">none</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="$linetype='none'">
- <xsl:attribute name="fo:border">none</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$linetype='dot-dot-dash' or $linetype='dash-dot-dot-heavy'">2 Dots 1 Dash</xsl:when><xsl:when test="$linetype='dash' or $linetype='dashed-heavy'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$linetype='dotted' or $linetype='dotted-heavy'">Ultrafine Dotted (var)</xsl:when><xsl:when test="$linetype='double'">Line with Fine Dots</xsl:when><xsl:when test="$linetype='dot-dash' or $linetype='dash-dot-heavy'">3 Dashes 3 Dots (var)</xsl:when><xsl:when test="$linetype='wave' or $linetype='wavy-heavy'">Ultrafine 2 Dots 3 Dashes</xsl:when><xsl:when test="$linetype='wavy-double'">Fine Dashed (var)</xsl:when><xsl:otherwise>Fine Dashed</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:线粗细">
- <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:线粗细,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
- <xsl:attribute name="draw:marker-start"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:前端箭头/图:大小">
- <xsl:attribute name="draw:marker-start-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
- <xsl:attribute name="draw:marker-end"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:后端箭头/图:大小">
- <xsl:attribute name="draw:marker-end-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:宽度">
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:高度">
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度">
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:锁定纵横比">
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:打印对象">
- </xsl:if>
- <xsl:if test="图:预定义图形/图:属性/图:透明度">
- <xsl:attribute name="draw:opacity"><xsl:value-of select="concat((100 - 图:预定义图形/图:属性/图:透明度),'%')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:if test="图:文本内容/@图:上边距">
- <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(图:文本内容/@图:上边距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(图:文本内容/@图:下边距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(图:文本内容/@图:左边距,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(图:文本内容/@图:右边距,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容/@图:文字排列方向">
- <xsl:choose>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
- <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
- </xsl:when>
- <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
- <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="图:文本内容/@图:水平对齐">
- <xsl:attribute name="draw:textarea-horizontal-align"><xsl:value-of select="图:文本内容/@图:水平对齐"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容/@图:垂直对齐">
- <xsl:attribute name="draw:textarea-vertical-align"><xsl:value-of select="图:文本内容/@图:垂直对齐"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容/@图:自动换行">
- <xsl:attribute name="fo:wrap-option"><xsl:choose><xsl:when test="图:文本内容/@图:自动换行='1' or 图:文本内容/@图:自动换行='true'">wrap</xsl:when><xsl:otherwise>no-wrap</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="图:文本内容/@图:大小适应文字='true'">
- <xsl:attribute name="draw:auto-grow-width">true</xsl:attribute>
- <xsl:attribute name="draw:auto-grow-height">true</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="draw:auto-grow-width">false</xsl:attribute>
- <xsl:attribute name="draw:auto-grow-height">false</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="图:控制点">
- </xsl:if>
- </xsl:template>
- <xsl:template name="图形解析">
- <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
- <xsl:variable name="paiban">
- <xsl:value-of select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:名称"/>
- </xsl:variable>
- <xsl:variable name="otherobject">
- <xsl:value-of select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/@图:其他对象"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]">
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='png' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='jpg' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='gif' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:私有类型='图片'">
- <xsl:element name="draw:frame">
- <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::字:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
- <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="jiaodu">
- <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
- </xsl:variable>
- <xsl:variable name="shibie">
- <xsl:value-of select="图:预定义图形/图:生成软件"/>
- </xsl:variable>
- <xsl:variable name="rotate-angle">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
- <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- <xsl:apply-templates select="图:文本内容/字:文字表"/>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据">
- <draw:image>
- <office:binary-data>
- <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据"/>
- </office:binary-data>
- </draw:image>
- </xsl:if>
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
- <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:when>
- <xsl:when test="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/@图:其他对象 and /uof:UOF/uof:对象集/uof:其他对象/@uof:公共类型='jpg'">
- <xsl:variable name="bshi">
- <xsl:value-of select="/uof:UOF/uof:对象集/图:图形/@图:其他对象"/>
- </xsl:variable>
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$bshi]/@uof:公共类型='jpg'">
- <xsl:element name="draw:frame">
- <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::字:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
- <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="jiaodu">
- <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
- </xsl:variable>
- <xsl:variable name="shibie">
- <xsl:value-of select="图:预定义图形/图:生成软件"/>
- </xsl:variable>
- <xsl:variable name="rotate-angle">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
- <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- <xsl:apply-templates select="图:文本内容/字:文字表"/>
- </xsl:if>
- <xsl:variable name="qita">
- <xsl:value-of select="self::node()/@图:其他对象"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$qita]/uof:数据">
- <draw:image>
- <office:binary-data>
- <xsl:value-of select="."/>
- </office:binary-data>
- </draw:image>
- </xsl:for-each>
- </xsl:for-each>
- <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
- <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径"/></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:when>
- <xsl:when test="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:文本内容[@图:文本框='true'] and not($paiban='排版框')">
- <draw:frame text:anchor-type="paragraph">
- <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
- <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="draw:z-index">
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]"><xsl:value-of select="@图:层次"/></xsl:for-each>
- </xsl:attribute>
- <draw:text-box>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:段落"/>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:文字表"/>
- </draw:text-box>
- </draw:frame>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="leibie">
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]">
- <xsl:value-of select="图:预定义图形/图:类别"/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="leibie2">
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]">
- <xsl:value-of select="图:预定义图形/图:名称"/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$leibie='22'">
- <xsl:call-template name="排版框">
- <xsl:with-param name="biaoshi" select="$tuxing1"/>
- <xsl:with-param name="name" select="$leibie2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$leibie='23'">
- <xsl:call-template name="文本框">
- <xsl:with-param name="biaoshi" select="$tuxing1"/>
- <xsl:with-param name="name" select="$leibie2"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$leibie='11'">
- <xsl:call-template name="Rectangle"/>
- </xsl:when>
- <xsl:when test="$leibie='19'">
- <xsl:call-template name="Oval"/>
- </xsl:when>
- <xsl:when test="$leibie='61'">
- <xsl:call-template name="Line"/>
- </xsl:when>
- <xsl:when test="$leibie='62'">
- <xsl:call-template name="Line"/>
- </xsl:when>
- <xsl:when test="$leibie='63'">
- <xsl:call-template name="Line"/>
- </xsl:when>
- <xsl:when test="$leibie='64'">
- <xsl:call-template name="Curve"/>
- </xsl:when>
- <xsl:when test="$leibie='65'">
- <xsl:call-template name="Freeform"/>
- </xsl:when>
- <xsl:when test="$leibie='66'">
- <xsl:call-template name="Scribble"/>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="文本框">
- <xsl:param name="biaoshi"/>
- <xsl:param name="name"/>
- <draw:frame text:anchor-type="paragraph">
- <xsl:attribute name="draw:style-name"><xsl:value-of select="$biaoshi"/></xsl:attribute>
- <xsl:attribute name="draw:name"><xsl:value-of select="$name"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="draw:z-index">
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $biaoshi]">
- <xsl:value-of select="@图:层次"/>
- </xsl:for-each>
- </xsl:attribute>
- <draw:text-box>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:段落"/>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:文字表"/>
- </draw:text-box>
- </draw:frame>
- </xsl:template>
- <xsl:template name="Curve">
- <xsl:element name="draw:path">
- <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]">
- <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
- <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
- <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
- <xsl:attribute name="svg:d"><xsl:value-of select="图:预定义图形/图:关键点坐标/@图:路径"/></xsl:attribute>
- </xsl:for-each>
- <xsl:call-template name="common"/>
- </xsl:element>
- </xsl:template>
- <xsl:template name="common">
- <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="jiaodu">
- <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
- </xsl:variable>
- <xsl:variable name="shibie">
- <xsl:value-of select="图:预定义图形/图:生成软件"/>
- </xsl:variable>
- <xsl:variable name="rotate-angle">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
- <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- <xsl:apply-templates select="图:文本内容/字:文字表"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="common1">
- <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:预定义图形/图:属性/图:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:height"><xsl:value-of select="concat(/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:预定义图形/图:属性/图:高度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="jiaodu">
- <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
- </xsl:variable>
- <xsl:variable name="shibie">
- <xsl:value-of select="图:预定义图形/图:生成软件"/>
- </xsl:variable>
- <xsl:variable name="rotate-angle">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
- <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- <xsl:apply-templates select="图:文本内容/字:文字表"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="Freeform">
- <xsl:element name="draw:polygon">
- <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
- <xsl:variable name="width" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:宽度)*1000"/>
- <xsl:variable name="height" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:高度)*1000"/>
- <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
- <xsl:attribute name="draw:points"><xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:关键点坐标"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="concat(number(图:坐标[1]/@x坐标)*1000,',',number(图:坐标[1]/@y坐标)*1000)"/><xsl:with-param name="point-pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
- <xsl:call-template name="common"/>
- </xsl:element>
- </xsl:template>
- <xsl:template name="drawpoints">
- <xsl:param name="points"/>
- <xsl:param name="point-pos"/>
- <xsl:choose>
- <xsl:when test="图:坐标[$point-pos]">
- <xsl:variable name="points1" select="concat($points,' ',number(图:坐标[$point-pos]/@x坐标)*1000,',',number(图:坐标[$point-pos]/@y坐标)*1000)"/>
- <xsl:call-template name="drawpoints">
- <xsl:with-param name="points" select="$points1"/>
- <xsl:with-param name="point-pos" select="$point-pos+1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$points"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="Scribble">
- <xsl:element name="draw:polyline">
- <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
- <xsl:variable name="width" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:宽度)*1000"/>
- <xsl:variable name="height" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:高度)*1000"/>
- <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
- <xsl:attribute name="draw:points"><xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:关键点坐标"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="concat(number(图:坐标[1]/@x坐标)*1000,',',number(图:坐标[1]/@y坐标)*1000)"/><xsl:with-param name="point-pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
- <xsl:call-template name="common"/>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Oval">
- <xsl:element name="draw:ellipse">
- <xsl:call-template name="common1"/>
- </xsl:element>
- </xsl:template>
- <xsl:template name="排版框">
- <xsl:param name="biaoshi"/>
- <xsl:param name="name"/>
- <draw:frame text:anchor-type="paragraph">
- <xsl:attribute name="draw:style-name"><xsl:value-of select="$biaoshi"/></xsl:attribute>
- <xsl:attribute name="draw:name"><xsl:value-of select="$name"/></xsl:attribute>
- <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
- <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
- <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="draw:z-index">
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $biaoshi]">
- <xsl:value-of select="@图:层次"/>
- </xsl:for-each>
- </xsl:attribute>
- <draw:text-box>
- <xsl:attribute name="fo:min-height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:段落"/>
- <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:文字表"/>
- </draw:text-box>
- </draw:frame>
- </xsl:template>
- <xsl:template name="Rectangle">
- <xsl:element name="draw:rect">
- <xsl:call-template name="common1"/>
- </xsl:element>
- </xsl:template>
- <xsl:template name="Line">
- <xsl:element name="draw:line">
- <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
- <xsl:attribute name="svg:x1"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y1"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:x2"><xsl:value-of select="concat((字:锚点属性/字:位置/字:水平/字:绝对/@字:值 + 字:锚点属性/字:宽度),$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="svg:y2"><xsl:value-of select="concat((字:锚点属性/字:位置/字:垂直/字:绝对/@字:值 + 字:锚点属性/字:高度),$uofUnit)"/></xsl:attribute>
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
- <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
- <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
- <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
- <xsl:variable name="jiaodu">
- <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
- </xsl:variable>
- <xsl:variable name="shibie">
- <xsl:value-of select="图:预定义图形/图:生成软件"/>
- </xsl:variable>
- <xsl:variable name="rotate-angle">
- <xsl:choose>
- <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
- <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="图:文本内容">
- <xsl:apply-templates select="图:文本内容/字:段落"/>
- <xsl:apply-templates select="图:文本内容/字:文字表"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template name="processPageBreaks">
- <xsl:variable name="pageBreak" select="字:句/字:分页符"/>
- <xsl:call-template name="createSubParagraph">
- <xsl:with-param name="list" select="$pageBreak[1]/preceding-sibling::字:句"/>
- <xsl:with-param name="pageBreak"/>
- <xsl:with-param name="needsPageBreak">false</xsl:with-param>
- </xsl:call-template>
- <xsl:for-each select="$pageBreak">
- <xsl:call-template name="createSubParagraph">
- <xsl:with-param name="list" select="./following-sibling::字:句[preceding::字:句/字:分页符 = '.']"/>
- <xsl:with-param name="pageBreak" select="."/>
- <xsl:with-param name="needsPageBreak">true</xsl:with-param>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="createSubParagraph">
- <xsl:param name="list"/>
- <xsl:param name="pageBreak"/>
- <xsl:param name="needsPageBreak"/>
- <xsl:if test="(count($list) &gt; 0) or ($needsPageBreak ='true') ">
- <xsl:element name="text:p">
- <xsl:choose>
- <xsl:when test="$needsPageBreak = 'true'">
- <xsl:choose>
- <xsl:when test="ancestor::字:段落/字:段落属性">
- <xsl:attribute name="text:style-name">P<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落属性"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="text:style-name">PageBreak</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="$pageBreak">
- <xsl:apply-templates select="$pageBreak"/>
- </xsl:if>
- <xsl:apply-templates select="$list"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:句/字:区域开始[@字:类型='bookmark']">
- <xsl:variable name="biaoshi">
- <xsl:value-of select="@字:标识符"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="not(@字:名称)">
- <text:bookmark-start text:name="{/uof:UOF/uof:书签集/uof:书签[uof:文本位置/@字:区域引用=$biaoshi]/@uof:名称}"/>
- </xsl:when>
- <xsl:otherwise>
- <text:bookmark-start text:name="{@字:名称}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:句/字:区域结束[preceding::字:区域开始[1]/@字:类型='bookmark']">
- <xsl:variable name="biaoshi">
- <xsl:value-of select="@字:标识符引用"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="not(@字:名称)">
- <text:bookmark-end text:name="{/uof:UOF/uof:书签集/uof:书签[uof:文本位置/@字:区域引用=$biaoshi]/@uof:名称}"/>
- </xsl:when>
- <xsl:otherwise>
- <text:bookmark-end text:name="{@字:名称}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:区域开始[@字:类型='annotation']">
- <text:bookmark-start text:name="{@字:标识符}"/>
- </xsl:template>
- <xsl:template match="字:区域结束[preceding::字:区域开始[1]/@字:类型='annotation']">
- <text:bookmark-end text:name="{@字:标识符引用}"/>
- </xsl:template>
- <xsl:template match="字:区域开始[@字:类型='user-data']">
- <text:alphabetical-index-mark-start text:id="{@字:标识符}" text:string-value-phonetic="{@字:名称}"/>
- </xsl:template>
- <xsl:template match="字:区域结束[preceding::字:区域开始[1]/@字:类型='user-data']">
- <text:alphabetical-index-mark-end text:id="{@字:标识符引用}"/>
- </xsl:template>
- <xsl:template match="字:段落/字:域开始">
- <xsl:choose>
- <xsl:when test="@字:类型='createdate'">
- <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
- <xsl:element name="text:creation-date">
- <xsl:attribute name="style:data-style-name">CreateDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createdate']"/></xsl:attribute>
- <xsl:attribute name="text:date-value"><xsl:value-of select="$datestr"/></xsl:attribute>
- <xsl:value-of select="$datestr"/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@字:类型='savedate'">
- <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
- <xsl:element name="text:date">
- <xsl:attribute name="style:data-style-name">SaveDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'savedate']"/></xsl:attribute>
- <xsl:attribute name="text:date-value"><xsl:value-of select="$datestr"/></xsl:attribute>
- <xsl:attribute name="text:fixed">true</xsl:attribute>
- <xsl:value-of select="$datestr"/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@字:类型='date'">
- <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
- <xsl:element name="text:date">
- <xsl:attribute name="style:data-style-name">Date<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'date']"/></xsl:attribute>
- <xsl:attribute name="text:date-value"><xsl:value-of select="$datestr"/></xsl:attribute>
- <xsl:value-of select="$datestr"/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@字:类型='time'">
- <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
- <xsl:element name="text:time">
- <xsl:attribute name="style:data-style-name">Time<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'time']"/></xsl:attribute>
- <xsl:attribute name="text:time-value"><xsl:value-of select="$datestr"/></xsl:attribute>
- <xsl:value-of select="$datestr"/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@字:类型='edittime'">
- <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
- <xsl:element name="text:editing-duration">
- <xsl:attribute name="style:data-style-name">EditTime<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'edittime']"/></xsl:attribute>
- <xsl:value-of select="$datestr"/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@字:类型='createtime'">
- <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
- <xsl:element name="text:creation-time">
- <xsl:attribute name="style:data-style-name">CREATETIME<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createtime']"/></xsl:attribute>
- <xsl:value-of select="$datestr"/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="@字:类型='page'">
- <xsl:call-template name="页码域"/>
- </xsl:when>
- <xsl:when test="@字:类型='numpages'">
- <xsl:call-template name="页数域"/>
- </xsl:when>
- <xsl:when test="@字:类型='author'">
- <xsl:call-template name="作者域"/>
- </xsl:when>
- <xsl:when test="@字:类型='username'">
- <xsl:call-template name="用户域"/>
- </xsl:when>
- <xsl:when test="@字:类型='userinitials'">
- <xsl:call-template name="缩写域"/>
- </xsl:when>
- <xsl:when test="@字:类型='title'">
- <xsl:call-template name="标题域"/>
- </xsl:when>
- <xsl:when test="@字:类型='subject'">
- <xsl:call-template name="主题域"/>
- </xsl:when>
- <xsl:when test="@字:类型='numchars'">
- <xsl:call-template name="字符数"/>
- </xsl:when>
- <xsl:when test="@字:类型='filename'">
- <xsl:call-template name="文件名"/>
- </xsl:when>
- <xsl:when test="@字:类型='edittime'">
- <xsl:call-template name="编辑时间"/>
- </xsl:when>
- <xsl:when test="@字:类型='creation-time'">
- <xsl:call-template name="创建时间"/>
- </xsl:when>
- <xsl:when test="@字:类型='seq'">
- <xsl:call-template name="题注"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="commonParagraph">
- <xsl:choose>
- <xsl:when test="字:段落属性/字:大纲级别">
- <xsl:element name="text:h">
- <xsl:call-template name="commonParagraphAttributes"/>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:when>
- <xsl:when test="not (字:域开始/@字:类型='ref') and not(字:域开始/@字:类型='index')">
- <xsl:element name="text:p">
- <xsl:call-template name="commonParagraphAttributes"/>
- <xsl:apply-templates/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="commonParagraphAttributes">
- <xsl:choose>
- <xsl:when test="字:段落属性">
- <xsl:variable name="pp">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
- </xsl:variable>
- <xsl:variable name="aa">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:域结束]"/>
- </xsl:variable>
- <xsl:variable name="stylename" select="字:段落属性/@字:式样引用"/>
- <xsl:choose>
- <xsl:when test="preceding-sibling::字:段落/字:域结束">
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$pp+$aa)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="contains($stylename,'Heading')">
- <xsl:attribute name="text:style-name"><xsl:value-of select="$stylename"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$pp)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="字:段落属性/字:大纲级别">
- <xsl:attribute name="text:outline-level"><xsl:value-of select="字:段落属性/字:大纲级别"/></xsl:attribute>
- </xsl:if>
- </xsl:when>
- <xsl:when test="generate-id(ancestor::字:主体/descendant::字:段落[1]) = generate-id(.)">
- <xsl:variable name="paragraph-number">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
- </xsl:variable>
- <xsl:attribute name="text:style-name">P<xsl:value-of select="number($paragraph-number)"/>_1</xsl:attribute>
- </xsl:when>
- <xsl:when test="not(字:段落属性) and (descendant::字:分栏符 or ancestor::字:分节/descendant::字:节属性[字:分栏/@字:栏数 &gt; 1])">
- <xsl:attribute name="text:style-name">ColumnBreakPara</xsl:attribute>
- </xsl:when>
- <xsl:when test="字:句">
- <xsl:apply-templates select="字:文本串"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:段落属性"/>
- <xsl:template match="字:句/字:句属性"/>
- <xsl:template match="字:句属性" mode="style">
- <xsl:if test="not(@字:式样引用)">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">T<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句属性" format="1"/></xsl:attribute>
- <xsl:attribute name="style:family">text</xsl:attribute>
- <xsl:if test="@字:式样引用">
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
- </xsl:if>
- <xsl:element name="style:text-properties">
- <xsl:apply-templates select="./*"/>
- </xsl:element>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:句/字:文本串">
- <xsl:choose>
- <xsl:when test="string(.) = ' ' ">
- <xsl:element name="text:s"/>
- </xsl:when>
- <xsl:when test="contains(.,' ')">
- <xsl:call-template name="replace-spaces">
- <xsl:with-param name="curr-string" select="."/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="replace-spaces">
- <xsl:param name="curr-string"/>
- <xsl:if test="contains($curr-string,' ')">
- <xsl:value-of select="substring-before($curr-string,' ')"/>
- <text:s text:c="2"/>
- <xsl:variable name="next-string" select="substring-after($curr-string,' ')"/>
- <xsl:choose>
- <xsl:when test="contains($next-string, ' ')">
- <xsl:call-template name="replace-spaces">
- <xsl:with-param name="curr-string" select="$next-string"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$next-string"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:空格符[parent::字:句]">
- <xsl:element name="text:s">
- <xsl:attribute name="text:c"><xsl:value-of select="@字:个数"/></xsl:attribute>
- </xsl:element>
- </xsl:template>
- <xsl:template match="字:制表符[parent::字:句]">
- <xsl:element name="text:tab"/>
- </xsl:template>
- <xsl:template match="字:句">
- <xsl:if test="name(following-sibling::*[1])!='字:域结束'">
- <xsl:if test="字:换行符">
- <xsl:element name="text:line-break"/>
- </xsl:if>
- <xsl:variable name="currently-node" select="./字:锚点"/>
- <xsl:choose>
- <xsl:when test="字:句属性//字:隐藏文字/@字:值='true'">
- <text:hidden-text text:is-hidden="true" text:string-value="{.}"/>
- </xsl:when>
- <xsl:when test="字:区域开始[@字:类型='hyperlink']">
- <xsl:element name="text:a">
- <xsl:attribute name="xlink:type">simple</xsl:attribute>
- <xsl:variable name="hyperDest" select="字:区域开始/@字:标识符"/>
- <xsl:attribute name="xlink:href"><xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接"><xsl:if test="@uof:链源=$hyperDest"><xsl:if test="@uof:提示"><xsl:attribute name="office:name"><xsl:value-of select="@uof:提示"/></xsl:attribute></xsl:if><xsl:if test="@uof:目标"><xsl:variable name="bsh" select="@uof:目标"/><xsl:choose><xsl:when test="contains($bsh,'\')"><xsl:value-of select="concat('/',translate($bsh,'\','/'))"/></xsl:when><xsl:otherwise><xsl:value-of select="$bsh"/></xsl:otherwise></xsl:choose></xsl:if><xsl:if test="@uof:书签"><xsl:variable name="bookmarkDest" select="@uof:书签"/><xsl:choose><xsl:when test="/uof:UOF/uof:书签集/uof:书签"><xsl:for-each select="/uof:UOF/uof:书签集/uof:书签"><xsl:if test="@uof:名称=$bookmarkDest"><xsl:value-of select="concat('#',@uof:名称)"/></xsl:if></xsl:for-each></xsl:when><xsl:otherwise><xsl:value-of select="concat('#',$bookmarkDest)"/></xsl:otherwise></xsl:choose></xsl:if></xsl:if></xsl:for-each></xsl:attribute>
- <xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接">
- <xsl:if test="@uof:链源=$hyperDest">
- <xsl:if test="@uof:提示">
- <xsl:attribute name="office:name"><xsl:value-of select="@uof:提示"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- <xsl:choose>
- <xsl:when test="./字:文本串">
- <xsl:apply-templates select="字:文本串"/>
- </xsl:when>
- <xsl:when test="following-sibling::字:句/字:文本串">
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:when>
- </xsl:choose>
- </xsl:element>
- </xsl:when>
- <xsl:when test="字:区域结束 and preceding::字:区域开始[1]/@字:类型='bookmark' and not(self::node()/字:区域开始)">
- <xsl:variable name="aa">
- <xsl:value-of select="字:区域结束/@字:标识符引用"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="preceding::字:区域开始[1]/@字:类型='bookmark' and not(preceding::字:区域开始[1]/@字:名称)">
- <text:bookmark-end text:name="{/uof:UOF/uof:书签集/uof:书签[uof:文本位置/@字:区域引用=$aa]/@uof:名称}"/>
- </xsl:when>
- <xsl:when test="preceding::字:区域开始[1]/@字:类型='bookmark'">
- <text:bookmark-end text:name="{preceding::字:区域开始[1]/@字:名称}"/>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="preceding-sibling::字:句[position()=1]/字:区域开始[@字:类型='hyperlink'] and not(preceding-sibling::字:句[position()=1]/字:区域结束)"/>
- <xsl:when test="(preceding-sibling::字:句) or (字:句属性)or(字:区域开始)">
- <xsl:element name="text:span">
- <xsl:choose>
- <xsl:when test="字:区域开始[@字:类型='annotation']">
- <xsl:variable name="ref_comment">
- <xsl:value-of select="字:区域开始/@字:标识符"/>
- </xsl:variable>
- <xsl:apply-templates/>
- <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:公用处理规则/字:批注集/字:批注[@字:区域引用 = $ref_comment]"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="stylenum">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
- </xsl:variable>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat('T',$stylenum)"/></xsl:attribute>
- <xsl:apply-templates select="*[not(name()='字:引文符号')]"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="字:文本串|字:锚点|字:空格符|字:换行符|字:制表符|字:区域开始|字:区域结束|字:脚注|字:尾注"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
- <xsl:template match="node()[name() = '字:位置']">
- <xsl:attribute name="style:text-position"><xsl:variable name="val"><xsl:value-of select="."/></xsl:variable><xsl:choose><xsl:when test="$val='sub' or $val='super'"><xsl:value-of select="concat($val,' 58%')"/></xsl:when><xsl:when test="contains($val,'sub ') or contains($val,'super ')"><xsl:value-of select="concat($val,'%')"/></xsl:when><xsl:when test="not(contains($val,' '))"><xsl:value-of select="concat($val,'% 100%')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(substring-before($val,' '),'% ',substring-after($val,' '),'%' )"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:批注">
- <office:annotation office:display="true">
- <xsl:variable name="name" select="@字:作者"/>
- <dc:creator>
- <xsl:value-of select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$name]/@字:姓名"/>
- </dc:creator>
- <dc:date>
- <xsl:value-of select="@字:日期"/>
- </dc:date>
- <xsl:apply-templates select="字:段落"/>
- </office:annotation>
- </xsl:template>
- <xsl:template match="字:字体">
- <xsl:if test="@字:字号">
- <xsl:attribute name="fo:font-size"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-asian"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-complex"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:相对字号 and self::node( )[not(parent::字:句属性)]">
- <xsl:variable name="stylename" select="parent::node()/@字:基式样引用"/>
- <xsl:variable name="zihao">
- <xsl:for-each select="/uof:UOF/uof:式样集//uof:段落式样[@字:标识符=$stylename]">
- <xsl:value-of select="字:字体/@字:字号"/>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="font-size" select="@字:相对字号"/>
- <xsl:attribute name="fo:font-size"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-asian"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
- <xsl:attribute name="style:font-size-complex"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:颜色">
- <xsl:attribute name="fo:color"><xsl:value-of select="@字:颜色"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:中文字体引用">
- <xsl:attribute name="style:font-name-asian"><xsl:value-of select="@字:中文字体引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:西文字体引用">
- <xsl:variable name="xiwen" select="@字:西文字体引用"/>
- <xsl:attribute name="style:font-name"><xsl:value-of select="translate($xiwen,'_',' ')"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:斜体">
- <xsl:if test="@字:值='true'">
- <xsl:attribute name="fo:font-style">italic</xsl:attribute>
- <xsl:attribute name="fo:font-style-asian">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
- <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:粗体">
- <xsl:if test="@字:值='true'or @字:值='1'">
- <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
- <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:下划线">
- <xsl:choose>
- <xsl:when test="@字:类型 = 'single'">
- <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'double'">
- <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
- <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'thick'">
- <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dotted'">
- <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dotted-heavy'">
- <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash'">
- <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dashed-heavy'">
- <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-long'">
- <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-long-heavy'">
- <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dot-dash'">
- <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-dot-heavy'">
- <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dot-dot-dash'">
- <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'dash-dot-dot-heavy'">
- <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'wave'">
- <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'wavy-heavy'">
- <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'wavy-double'">
- <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
- <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
- <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@字:颜色">
- <xsl:attribute name="style:text-underline-color"><xsl:choose><xsl:when test="@字:颜色='auto'">font-color</xsl:when><xsl:otherwise><xsl:value-of select="@字:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:text-underline-color">font-color</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:着重号">
- <xsl:if test="not(@字:类型='none')">
- <xsl:choose>
- <xsl:when test="@字:类型='dot'">
- <xsl:attribute name="style:text-emphasize">dot below</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='accent above' ">
- <xsl:attribute name="style:text-emphasize">accent above</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='dot above' ">
- <xsl:attribute name="style:text-emphasize">dot above</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='disc above' ">
- <xsl:attribute name="style:text-emphasize">disc above</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='circle above' ">
- <xsl:attribute name="style:text-emphasize">circle above</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='accent below' ">
- <xsl:attribute name="style:text-emphasize">accent below</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='dot below' ">
- <xsl:attribute name="style:text-emphasize">dot below</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='disc below' ">
- <xsl:attribute name="style:text-emphasize">disc below</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='circle below' ">
- <xsl:attribute name="style:text-emphasize">circle below</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>none</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="字:颜色">
- <xsl:attribute name="fo:color"><xsl:value-of select="@字:颜色"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:隐藏文字">
- <xsl:attribute name="text:display"><xsl:value-of select="@字:值"/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:空心">
- <xsl:attribute name="style:text-outline"><xsl:value-of select="@字:值"/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:阴影">
- <xsl:if test="not(@字:值='false')">
- <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:闪动的">
- <xsl:attribute name="style:text-blinking"><xsl:value-of select="@字:闪动的"/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:删除线">
- <xsl:choose>
- <xsl:when test="@字:类型 = 'single' ">
- <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'double' ">
- <xsl:attribute name="style:text-line-through-type">double</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'bold' ">
- <xsl:attribute name="style:text-line-through-width">bold</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = 'xl' ">
- <xsl:attribute name="style:text-line-through-text">X</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型 = '/l' ">
- <xsl:attribute name="style:text-line-through-text">/</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:text-crossing-out">none</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:突出显示">
- <xsl:attribute name="fo:background-color">
- <xsl:choose>
- <xsl:when test="@字:颜色='auto'">transparent</xsl:when>
- <xsl:otherwise><xsl:value-of select="@字:颜色"/></xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:template>
- <xsl:template match="@字:颜色[not(.='auto')]">
- <xsl:attribute name="fo:color">#<xsl:value-of select="."/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:浮雕">
- <xsl:attribute name="style:font-relief"><xsl:choose><xsl:when test="@字:类型='engrave'">engraved</xsl:when><xsl:when test="@字:类型='emboss'">embossed</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:醒目字体">
- <xsl:choose>
- <xsl:when test="@字:类型='small-caps'">
- <xsl:attribute name="fo:font-variant">small-caps</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:类型='none'">
- <xsl:attribute name="fo:font-variant">normal</xsl:attribute>
- <xsl:attribute name="fo:text-transform">none</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:text-transform"><xsl:choose><xsl:when test="@字:类型='uppercase'">uppercase</xsl:when><xsl:when test="@字:类型='lowercase'">lowercase</xsl:when><xsl:when test="@字:类型='capital'">capitalize</xsl:when></xsl:choose></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:位置" mode="oo">
- <xsl:attribute name="style:text-position"><xsl:variable name="val"><xsl:value-of select="."/></xsl:variable><xsl:choose><xsl:when test="$val='sub' or $val='super'"><xsl:value-of select="concat($val,' 58%')"/></xsl:when><xsl:when test="contains($val,'sub ') or contains($val,'super ')"><xsl:value-of select="concat($val,'%')"/></xsl:when><xsl:when test="not(contains($val,' '))"><xsl:value-of select="concat($val,'% 100%')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(substring-before($val,' '),'% ',substring-after($val,' '),'%' )"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:缩放">
- <xsl:attribute name="style:text-scale"><xsl:value-of select="."/>%</xsl:attribute>
- </xsl:template>
- <xsl:template match="字:字符间距">
- <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="."/>cm</xsl:attribute>
- </xsl:template>
- <xsl:template match="字:调整字间距">
- <xsl:variable name="tt" select="字:调整字间距"/>
- <xsl:attribute name="style:letter-kerning"><xsl:choose><xsl:when test="$tt='1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:外框">
- <xsl:attribute name="style:text-outline">true</xsl:attribute>
- </xsl:template>
- <xsl:template match="字:字符间距[parent::字:句属性]">
- <xsl:variable name="aa">
- <xsl:value-of select="."/>
- </xsl:variable>
- <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="concat( $aa, $uofUnit)"/></xsl:attribute>
- </xsl:template>
- <xsl:template match="字:分节">
- <xsl:if test="字:节属性/字:脚注设置">
- <xsl:call-template name="脚注设置"/>
- </xsl:if>
- <xsl:if test="字:节属性/字:尾注设置">
- <xsl:call-template name="尾注设置"/>
- </xsl:if>
- <xsl:if test="字:节属性/字:行号设置">
- <xsl:call-template name="行编号"/>
- </xsl:if>
- </xsl:template>
- <xsl:template name="行编号">
- <xsl:element name="text:linenumbering-configuration">
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:行号设置">
- <xsl:choose>
- <xsl:when test="@字:使用行号='false'">
- <xsl:attribute name="text:number-lines">false</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="text:style-name">Line numbering</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="@字:编号方式">
- <xsl:choose>
- <xsl:when test="@字:编号方式='section'">
- <xsl:attribute name="text:count-in-floating-frames">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="@字:编号方式='page'">
- <xsl:attribute name="text:restart-on-page">true</xsl:attribute>
- </xsl:when>
- <xsl:when test="字:编号方式='continuous'">
- <xsl:attribute name="text:count-empty-lines">true</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="@字:起始编号">
- <xsl:attribute name="style:num-format"><xsl:value-of select="@字:起始编号"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:距边界">
- <xsl:attribute name="text:offset"><xsl:value-of select="concat(@字:距边界,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="@字:行号间隔">
- <xsl:attribute name="text:increment"><xsl:value-of select="@字:行号间隔"/></xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template name="脚注设置">
- <xsl:element name="text:notes-configuration">
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:脚注设置">
- <xsl:attribute name="text:note-class">footnote</xsl:attribute>
- <xsl:attribute name="text:master-page-name">Footnote</xsl:attribute>
- <xsl:attribute name="text:footnotes-position"><xsl:choose><xsl:when test="@字:位置='page-bottom'">page</xsl:when><xsl:when test="@字:位置='below-text'">document</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="text:start-numbering-at"><xsl:choose><xsl:when test="@字:编号方式='continuous'">document</xsl:when><xsl:when test="@字:编号方式='section'">chapter</xsl:when><xsl:when test="@字:编号方式='page'">page</xsl:when></xsl:choose></xsl:attribute>
- <xsl:attribute name="text:start-value"><xsl:value-of select="@字:起始编号 - 1"/></xsl:attribute>
- <xsl:attribute name="style:num-format"><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="@字:格式"/></xsl:call-template></xsl:attribute>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template name="尾注设置">
- <xsl:element name="text:notes-configuration">
- <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:尾注设置">
- <xsl:attribute name="text:note-class">endnote</xsl:attribute>
- <xsl:attribute name="text:master-page-name">Endnote</xsl:attribute>
- <xsl:attribute name="style:num-format"><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="@字:格式"/></xsl:call-template></xsl:attribute>
- <xsl:attribute name="text:start-value"><xsl:value-of select="@字:起始编号 - 1"/></xsl:attribute>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template name="paragraph-properties">
- <xsl:choose>
- <xsl:when test="descendant::字:页边距[@uof:左]">
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="number((descendant::字:页边距/@uof:左)) * $other-to-cm-conversion-factor"/>cm</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:margin-left">0cm</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="descendant::字:页边距[@uof:右]">
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="number((descendant::字:页边距/@uof:右)) * $other-to-cm-conversion-factor"/>cm</xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:margin-right">0cm</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:text-indent">0cm</xsl:attribute>
- <xsl:call-template name="bidi"/>
- </xsl:template>
- <xsl:template name="bidi">
- </xsl:template>
- <xsl:template match="字:文字表">
- <xsl:choose>
- <xsl:when test="@字:类型 = 'sub-table'">
- <xsl:element name="table:table">
- <xsl:attribute name="table:is-sub-table">true</xsl:attribute>
- <xsl:apply-templates select="字:文字表属性">
- <xsl:with-param name="sub-table" select="@字:类型"/>
- </xsl:apply-templates>
- <xsl:if test="字:行[position()=1]/字:表行属性/字:表头行/@字:值='true'">
- <xsl:element name="table:table-header-rows">
- <xsl:for-each select="字:行">
- <xsl:if test="字:表行属性/字:表头行/@字:值='true'">
- <xsl:apply-templates select="."/>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:for-each select="字:行[not(字:表行属性/字:表头行) or (字:表行属性/字:表头行/@字:值='false')]">
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="table:table">
- <xsl:if test="字:文字表属性">
- <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="not(字:文字表属性/字:列宽集/字:列宽)">
- <xsl:for-each select="字:行[1]/字:单元格">
- <xsl:element name="table:table-column">
- <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number value="count(preceding::字:单元格)+1"/></xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:if>
- <xsl:apply-templates select="字:文字表属性"/>
- <xsl:if test="字:行[position()=1]/字:表行属性/字:表头行/@字:值='true'">
- <xsl:element name="table:table-header-rows">
- <xsl:for-each select="字:行">
- <xsl:if test="字:表行属性/字:表头行/@字:值='true'">
- <xsl:apply-templates select="."/>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- <xsl:for-each select="字:行[not(字:表行属性/字:表头行) or (字:表行属性/字:表头行/@字:值='false')]">
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:文字表属性">
- <xsl:param name="sub-table"/>
- <xsl:apply-templates select="字:列宽集">
- <xsl:with-param name="sub-table" select="$sub-table"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="字:列宽集">
- <xsl:param name="sub-table"/>
- <xsl:apply-templates select="字:列宽">
- <xsl:with-param name="sub-table" select="$sub-table"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="字:列宽">
- <xsl:param name="sub-table"/>
- <xsl:element name="table:table-column">
- <xsl:choose>
- <xsl:when test="$sub-table='sub-table'">
- <xsl:variable name="subtable-leikuan" select="."/>
- <xsl:variable name="weizi">
- <xsl:for-each select="ancestor::*[name()='字:文字表' and not(@字:类型='sub-table')]/字:文字表属性/字:列宽集/字:列宽">
- <xsl:variable name="yyyyy" select="."/>
- <xsl:if test="substring(string($yyyyy),1,string-length(string($yyyyy))-1)=substring(string($subtable-leikuan),1,string-length(string($subtable-leikuan))-1)">
- <xsl:value-of select="concat(position(),';')"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="xxxxx">
- <xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>
- </xsl:variable>
- <xsl:attribute name="table:style-name"><xsl:value-of select="concat('Table',$xxxxx,'.C',substring-before($weizi,';'))"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number count="字:列宽" from="/uof:UOF/uof:文字处理/字:主体" level="single" format="1"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:template>
- <xsl:template match="字:行">
- <xsl:element name="table:table-row">
- <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/></xsl:attribute>
- <xsl:for-each select="node()">
- <xsl:choose>
- <xsl:when test="name()='字:单元格'">
- <xsl:call-template name="字:单元格"/>
- </xsl:when>
- <xsl:when test="name()='字:单元格覆盖'">
+ </xsl:element>
+ <xsl:element name="style:text-properties">
+ <xsl:apply-templates select="字:句属性/*"/>
+ </xsl:element>
+ <xsl:variable name="biaoshi" select="@字:标识符"/>
+ <xsl:for-each select="../uof:句式样">
+ <xsl:if test="@字:标识符=$biaoshi">
+ <xsl:element name="style:text-properties">
+ <xsl:apply-templates select="*"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="uof:句式样[@字:类型='auto']">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="ancestor::字:段落式样">
+ <xsl:attribute name="style:family">paragraph</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:family">text</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:element name="style:text-properties">
+ <xsl:apply-templates select="*"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ <style:style style:name="ColumnBreakPara" style:family="paragraph">
+ <style:text-properties fo:break-after="column"/>
+ </style:style>
+ <xsl:if test="uof:句式样">
+ <style:default-style style:family="text"/>
+ </xsl:if>
+ <style:style style:name="Numbering Symbols" style:family="text"/>
+ <style:style style:name="Bullet Symbols" style:family="text">
+ <style:text-properties style:font-name="StarSymbol" fo:font-size="9pt" style:font-name-asian="StarSymbol" style:font-size-asian="9pt" style:font-name-complex="StarSymbol" style:font-size-complex="9pt"/>
+ </style:style>
+ <xsl:apply-templates select="uof:文字表式样" mode="table"/>
+ <xsl:apply-templates select="uof:式样"/>
+ <xsl:call-template name="脚注设置"/>
+ <xsl:call-template name="尾注设置"/>
+ <xsl:call-template name="行编号"/>
+ </office:styles>
+ <xsl:element name="office:automatic-styles">
+ <style:style style:name="PageBreak" style:family="paragraph">
+ <style:text-properties fo:break-before="page"/>
+ </style:style>
+ <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体/字:段落/字:句/字:句属性" mode="style"/>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:句">
+ <xsl:variable name="stylename1" select="字:句属性/@字:式样引用"/>
+ <xsl:element name="style:style">
+ <xsl:variable name="stylenum">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
+ </xsl:variable>
+ <xsl:attribute name="style:name"><xsl:value-of select="concat('T',$stylenum)"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="ancestor::字:段落式样">
+ <xsl:attribute name="style:family">paragraph</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:family">text</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
+ <xsl:if test="$stylename1=@字:标识符">
+ <xsl:choose>
+ <xsl:when test="@字:标识符=/uof:UOF/uof:文字处理/字:主体/字:段落/字:句/字:句属性/字:格式修订/@字:修订信息引用">
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:element name="style:text-properties">
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
+ <xsl:if test="$stylename1=@字:标识符">
+ <xsl:apply-templates select="./字:位置" mode="oo"/>
+ <xsl:apply-templates select="*[not(name()='字:位置')]"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'date']">
+ <xsl:element name="number:date-style">
+ <xsl:attribute name="style:name">Date<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'date']"/></xsl:attribute>
+ <xsl:call-template name="日期域"/>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'createdate']">
+ <xsl:element name="number:date-style">
+ <xsl:attribute name="style:name">CreateDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createdate']"/></xsl:attribute>
+ <xsl:call-template name="日期域"/>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'savedate']">
+ <xsl:element name="number:date-style">
+ <xsl:attribute name="style:name">SaveDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'savedate']"/></xsl:attribute>
+ <xsl:call-template name="日期域"/>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'time']">
+ <xsl:element name="number:date-style">
+ <xsl:attribute name="style:name">Time<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'time']"/></xsl:attribute>
+ <xsl:call-template name="时间域"/>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'edittime']">
+ <xsl:element name="number:time-style">
+ <xsl:attribute name="style:name">EditTime<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'edittime']"/></xsl:attribute>
+ <xsl:call-template name="编辑时间"/>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:域开始[@字:类型 = 'createtime']">
+ <xsl:element name="number:time-style">
+ <xsl:attribute name="style:name">CREATETIME<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createtime']"/></xsl:attribute>
+ <xsl:call-template name="创建时间"/>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:文字表[not(@字:类型='sub-table')]" mode="style"/>
+ <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:单元格" mode="style"/>
+ <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:行[not(../../@字:类型='sub-table')]" mode="style"/>
+ <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:主体//字:列宽集[not(../../@字:类型='sub-table')]" mode="style"/>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:自动编号信息">
+ <xsl:variable name="currlistid" select="@字:编号引用"/>
+ <xsl:variable name="currlist" select="."/>
+ <xsl:variable name="rootlist" select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号[@字:标识符 =$currlistid]"/>
+ <xsl:if test="not(ancestor::字:段落/preceding-sibling::字:段落[1]/字:段落属性/字:自动编号信息/@字:编号引用= $currlistid)">
+ <xsl:element name="text:list-style">
+ <xsl:attribute name="style:name">List<xsl:value-of select="count(preceding::字:自动编号信息)"/></xsl:attribute>
+ <xsl:for-each select="$rootlist">
+ <xsl:for-each select="字:级别">
+ <xsl:choose>
+ <xsl:when test="字:项目符号">
+ <xsl:call-template name="xiangmufuhao">
+ <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="字:图片符号引用">
+ <xsl:call-template name="imagefuhao">
+ <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="jibianhao">
+ <xsl:with-param name="biaoshifu" select="../@字:标识符"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:节属性">
+ <xsl:element name="style:page-layout">
+ <xsl:attribute name="style:name">pm<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any"/></xsl:attribute>
+ <xsl:if test="字:对称页边距/@字:值='true'">
+ <xsl:attribute name="style:page-usage">mirrored</xsl:attribute>
+ </xsl:if>
+ <xsl:element name="style:page-layout-properties">
+ <xsl:if test="字:纸张方向">
+ <xsl:attribute name="style:print-orientation"><xsl:choose><xsl:when test="字:纸张方向='portrait'">portrait</xsl:when><xsl:when test="字:纸张方向='landscape'">landscape</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="fo:page-width"><xsl:value-of select="concat(字:纸张/@uof:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:page-height"><xsl:value-of select="concat(字:纸张/@uof:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="字:页边距">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上 ,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:装订线/@字:位置='top'">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上 ,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:装订线/@字:位置='left' ">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat((字:页边距/@uof:左+ 字:装订线/@字:距边界),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页边距/@uof:上,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:页边距/@uof:左,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:页边距/@uof:右,$uofUnit)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:页边距/@uof:下,$uofUnit)"/></xsl:attribute>
+ <xsl:if test="字:拼页/@字:值='1' or 字:拼页/@字:值='true'">
+ <xsl:attribute name="style:page-usage">mirrored</xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="string(字:文字排列方向)='vert-r2l'">
+ <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="string(字:文字排列方向)='vert-l2r'">
+ <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="string(字:文字排列方向)='hori-l2r'">
+ <xsl:attribute name="style:writing-mode">lr-tb</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="string(字:文字排列方向)='hori-r2l'">
+ <xsl:attribute name="style:writing-mode">lr-tb</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:writing-mode">page</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="字:网格设置/@字:网格类型">
+ <xsl:attribute name="style:layout-grid-mode"><xsl:choose><xsl:when test="字:网格设置/@字:网格类型='line-char'">both-nosnap</xsl:when><xsl:when test="字:网格设置/@字:网格类型='char'">both</xsl:when><xsl:when test="字:网格设置/@字:网格类型='line'">line</xsl:when><xsl:when test="字:网格设置/@字:网格类型='none'">none</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:网格设置/@字:宽度">
+ <xsl:attribute name="style:layout-grid-base-width"><xsl:value-of select="concat(字:网格设置/@字:宽度,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:网格设置/@字:高度">
+ <xsl:attribute name="style:layout-grid-base-height"><xsl:value-of select="concat(字:网格设置/@字:高度,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:网格设置/@字:显示网格">
+ <xsl:attribute name="style:layout-grid-display"><xsl:value-of select="字:网格设置/@字:显示网格"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:网格设置/@字:打印网格">
+ <xsl:attribute name="style:layout-grid-print"><xsl:value-of select="字:网格设置/@字:打印网格"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:稿纸设置/@字:类型">
+ <xsl:attribute name="style:layout-grid-mode"><xsl:choose><xsl:when test="字:稿纸设置/@字:类型='draft-paper' ">both</xsl:when><xsl:when test="字:稿纸设置/@字:类型='letter-paper' ">line</xsl:when><xsl:otherwise>both</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:稿纸设置/@字:格式">
+ <xsl:choose>
+ <xsl:when test="字:稿纸设置/@字:格式='fourth-gear'">
+ <xsl:attribute name="style:layout-grid-base-width">0.728cm</xsl:attribute>
+ <xsl:attribute name="style:layout-grid-base-height">0.728cm</xsl:attribute>
+ <xsl:attribute name="style:layout-grid-ruby-height">0.496cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:稿纸设置/@字:格式='third-gear'">
+ <xsl:attribute name="style:layout-grid-base-width">0.584cm</xsl:attribute>
+ <xsl:attribute name="style:layout-grid-base-height">0.584cm</xsl:attribute>
+ <xsl:attribute name="style:layout-grid-ruby-height">0.64cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:稿纸设置/@字:格式='second-gear'">
+ <xsl:attribute name="style:layout-grid-base-width">0.728cm</xsl:attribute>
+ <xsl:attribute name="style:layout-grid-base-height">0.728cm</xsl:attribute>
+ <xsl:attribute name="style:layout-grid-ruby-height">0.905cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:稿纸设置/@字:格式='first-gear'">
+ <xsl:attribute name="style:layout-grid-base-width">0.728cm</xsl:attribute>
+ <xsl:attribute name="style:layout-grid-base-height">0.728cm</xsl:attribute>
+ <xsl:attribute name="style:layout-grid-ruby-height">1.633cm</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:attribute name="style:layout-grid-display">true</xsl:attribute>
+ <xsl:attribute name="style:layout-grid-print">true</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:稿纸设置/@字:颜色">
+ <xsl:attribute name="style:layout-grid-color"><xsl:value-of select="字:稿纸设置/@字:颜色"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:边框">
+ <xsl:for-each select="字:边框">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="字:填充">
+ <xsl:for-each select="字:填充">
+ <xsl:call-template name="uof:填充"/>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:apply-templates select="字:填充"/>
+ <xsl:attribute name="style:num-format"><xsl:variable name="format"><xsl:value-of select="字:页码设置/@字:格式"/></xsl:variable><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="$format"/></xsl:call-template></xsl:attribute>
+ <xsl:if test="字:纸张来源/@字:其他页">
+ <xsl:attribute name="style:paper-tray-name"><xsl:value-of select="字:纸张来源/@字:其他页"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:分栏/@字:栏数">
+ <xsl:apply-templates select="字:分栏"/>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test="字:页眉位置">
+ <style:header-style>
+ <xsl:element name="style:header-footer-properties">
+ <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:页眉位置/@字:距边界,$uofUnit)"/></xsl:attribute>
+ <xsl:variable name="long1" select="字:页眉位置/@字:距边界"/>
+ <xsl:variable name="long2" select="字:页眉位置/@字:距版芯"/>
+ <xsl:variable name="long" select="$long1 + $long2"/>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat($long,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="style:dynamic-spacing">false</xsl:attribute>
+ </xsl:element>
+ </style:header-style>
+ </xsl:if>
+ <xsl:if test="字:页脚位置">
+ <style:footer-style>
+ <xsl:element name="style:header-footer-properties">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:页脚位置/@字:距边界,$uofUnit)"/></xsl:attribute>
+ <xsl:variable name="long1" select="字:页脚位置/@字:距边界"/>
+ <xsl:variable name="long2" select="字:页脚位置/@字:距版芯"/>
+ <xsl:variable name="long" select="$long1 + $long2"/>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat($long,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="style:dynamic-spacing">false</xsl:attribute>
+ </xsl:element>
+ </style:footer-style>
+ </xsl:if>
+ </xsl:element>
+ <xsl:if test="字:分栏/@字:栏数">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">sect<xsl:value-of select="count(preceding::字:节属性[字:分栏/@字:栏数])"/></xsl:attribute>
+ <xsl:attribute name="style:family">section</xsl:attribute>
+ <xsl:element name="style:page-layout-properties">
+ <xsl:element name="style:columns">
+ <xsl:attribute name="fo:column-count"><xsl:value-of select="number(字:分栏/@字:栏数)"/></xsl:attribute>
+ <xsl:attribute name="fo:column-gap"><xsl:value-of select="concat(number(字:分栏/@字:分割线宽度),$uofUnit)"/></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='png' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='jpg' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象/@uof:公有类型='gif' or /uof:UOF/uof:对象集/uof:其他对象/@uof:私有类型='图片'">
+ <style:style style:name="Graphics" style:family="graphic">
+ <style:graphic-properties text:anchor-type="paragraph" svg:x="0cm" svg:y="0cm" style:wrap="none" style:vertical-pos="top" style:vertical-rel="paragraph" style:horizontal-pos="center" style:horizontal-rel="paragraph"/>
+ </style:style>
+ </xsl:if>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形"/>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形/图:文本内容/字:段落/字:句/字:句属性" mode="style"/>
+ <xsl:call-template name="duanluoshuxing"/>
+ </xsl:element>
+ <office:master-styles>
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体//字:节属性">
+ <xsl:element name="style:master-page">
+ <xsl:variable name="master-page-name">
+ <xsl:number count="字:节属性" from="/uof:UOF/uof:文字处理/字:主体" level="any"/>
+ </xsl:variable>
+ <xsl:attribute name="style:name"><xsl:choose>
+ <xsl:when test="../@字:名称"><xsl:value-of select="../@字:名称"/></xsl:when>
+ <xsl:otherwise>Standard</xsl:otherwise>
+ </xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:page-layout-name"><xsl:value-of select="concat('pm', $master-page-name)"/></xsl:attribute>
+ <xsl:if test="following::字:节属性">
+ <xsl:attribute name="style:next-style-name">Standard<xsl:value-of select="$master-page-name +1"/></xsl:attribute>
+ </xsl:if>
+ <xsl:for-each select="字:页眉">
+ <xsl:if test="字:首页页眉 or 字:奇数页页眉">
+ <xsl:element name="style:header">
+ <xsl:apply-templates select="字:奇数页页眉/字:段落 | 字:首页页眉/字:段落 | 字:奇数页页眉/字:文字表 | 字:首页页眉/字:文字表"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="字:偶数页页眉">
+ <xsl:element name="style:header-left">
+ <xsl:apply-templates select="字:偶数页页眉/字:段落 | 字:偶数页页眉/字:文字表"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="字:页脚">
+ <xsl:if test="字:奇数页页脚 or 字:首页页脚">
+ <xsl:element name="style:footer">
+ <xsl:apply-templates select="字:奇数页页脚/字:段落 | 字:首页页脚/字:段落 | 字:奇数页页脚/字:文字表 | 字:首页页脚/字:文字表"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="字:偶数页页脚">
+ <xsl:element name="style:footer-left">
+ <xsl:apply-templates select="字:偶数页页脚/字:段落 | 字:偶数页页脚/字:文字表"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="字:奇偶页页眉页脚不同">
+ <xsl:element name="style:header-left">
+ </xsl:element>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ </office:master-styles>
+ </xsl:template>
+ <xsl:template match="字:填充">
+ <xsl:choose>
+ <xsl:when test="图:颜色">
+ <xsl:attribute name="fo:background-color"><xsl:value-of select="图:颜色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:图案/@图:背景色">
+ <xsl:attribute name="style:text-background-color"><xsl:choose><xsl:when test="contains(图:图案/@图:背景色,'#')"><xsl:value-of select="图:图案/@图:背景色"/></xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:图案/@图:前景色">
+ <xsl:attribute name="fo:text-background-color"><xsl:choose><xsl:when test="contains(图:图案/@图:前景色,'#')"><xsl:value-of select="图:图案/@图:前景色"/></xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:分栏">
+ <xsl:element name="style:columns">
+ <xsl:attribute name="fo:column-count"><xsl:value-of select="//字:分栏/@字:栏数"/></xsl:attribute>
+ <xsl:variable name="aa">
+ <xsl:value-of select="//字:分栏/字:栏[position()=1]/@字:间距"/>
+ </xsl:variable>
+ <xsl:if test="//字:分栏/@字:等宽='true' ">
+ <xsl:attribute name="fo:column-gap"><xsl:value-of select="concat($aa * 2,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//字:分栏/@字:分隔线宽度">
+ <xsl:element name="style:column-sep">
+ <xsl:attribute name="style:width"><xsl:value-of select="concat(@字:分隔线宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="style:color"><xsl:value-of select="@字:分隔线颜色"/></xsl:attribute>
+ <xsl:attribute name="style:height">100%</xsl:attribute>
+ <xsl:attribute name="style:vertical-align">top</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ <xsl:for-each select="//字:分栏/字:栏">
+ <xsl:element name="style:column">
+ <xsl:attribute name="style:rel-width"><xsl:value-of select="@字:宽度"/>*</xsl:attribute>
+ <xsl:if test="parent::字:分栏/@字:宽度='true'">
+ <xsl:choose>
+ <xsl:when test="self::node()[not(preceding-sibling::字:栏)]">
+ <xsl:attribute name="fo:start-indent">0cm</xsl:attribute>
+ <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="self::node()[not(following-sibling::字:栏)]">
+ <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:end-indent">0cm</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="parent::字:分栏/@字:等宽='false'">
+ <xsl:variable name="last" select="preceding-sibling::字:栏[1]/@字:间距"/>
+ <xsl:choose>
+ <xsl:when test="self::node()[not(preceding-sibling::字:栏)]">
+ <xsl:attribute name="fo:start-indent">0cm</xsl:attribute>
+ <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="self::node()[not(following-sibling::字:栏)]">
+ <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat($last,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:end-indent">0cm</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:start-indent"><xsl:value-of select="concat($last,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:end-indent"><xsl:value-of select="concat(@字:间距,$uofUnit)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="uof:文字表式样" mode="table">
+ <style:style style:family="table">
+ <xsl:attribute name="style:name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
+ <xsl:if test="@字:基式样引用">
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
+ </xsl:if>
+ <style:table-properties>
+ <xsl:choose>
+ <xsl:when test="字:对齐">
+ <xsl:attribute name="table:align"><xsl:value-of select="字:对齐"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:align">margins</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="字:宽度/@字:相对宽度">
+ <xsl:variable name="reltblw">
+ <xsl:value-of select="concat(number(字:宽度/@字:相对宽度),'%')"/>
+ </xsl:variable>
+ <xsl:variable name="pagew">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
+ </xsl:variable>
+ <xsl:variable name="leftm">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
+ </xsl:variable>
+ <xsl:variable name="rightm">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
+ </xsl:variable>
+ <xsl:attribute name="style:rel-width"><xsl:value-of select="concat(number(字:宽度/@字:相对宽度) * 100,'%')"/></xsl:attribute>
+ <xsl:attribute name="style:width"><xsl:value-of select="concat((number($pagew)-number($leftm)-number($rightm)) * number($reltblw),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:宽度/@字:绝对宽度">
+ <xsl:attribute name="style:width"><xsl:value-of select="concat(number(字:宽度/@字:绝对宽度),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </style:table-properties>
+ </style:style>
+ </xsl:template>
+ <xsl:template match="字:文字表" mode="style">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/></xsl:attribute>
+ <xsl:attribute name="style:family">table</xsl:attribute>
+ <xsl:if test="@字:式样引用">
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="name(preceding-sibling::*[1])='字:分节'">
+ <xsl:attribute name="style:master-page-name"><xsl:value-of select="preceding-sibling::*[1]/@字:名称"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="style:table-properties">
+ <xsl:for-each select="字:文字表属性">
+ <xsl:variable name="biaoshi" select="@字:式样引用"/>
+ <xsl:choose>
+ <xsl:when test="字:对齐 = 'left' or 字:对齐 = 'center' or 字:对齐 = 'right'">
+ <xsl:attribute name="table:align"><xsl:value-of select="字:对齐"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:对齐">
+ <xsl:attribute name="table:align"><xsl:value-of select="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:对齐"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:align">margins</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="字:左缩进">
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(number(字:左缩进),$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:绕排/@字:值='around'">
+ <xsl:if test="字:绕排边距/@字:上">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:绕排边距/@字:上,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:绕排边距/@字:左">
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:绕排边距/@字:左,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:绕排边距/@字:右">
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:绕排边距/@字:右,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:绕排边距/@字:下">
+ <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:绕排边距/@字:下,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="@字:式样引用">
+ <xsl:variable name="rootStyle" select="@字:式样引用"/>
+ <xsl:variable name="rootStyleNode" select="/uof:UOF/uof:式样集/字:文字表式样[@字:基式样引用 = $rootStyle]"/>
+ <xsl:variable name="paddingleft">
+ <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:左"/>
+ </xsl:variable>
+ <xsl:variable name="paddingright">
+ <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:右"/>
+ </xsl:variable>
+ <xsl:variable name="paddingtop">
+ <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:上"/>
+ </xsl:variable>
+ <xsl:variable name="paddingbottom">
+ <xsl:value-of select="$rootStyleNode/字:文字表属性/字:边距/@uof:下"/>
+ </xsl:variable>
+ <xsl:if test="$rootStyleNode/字:文字表属性/字:边距/@uof:左">
+ <xsl:attribute name="fo:margin-left">-<xsl:value-of select="(number($paddingleft))* $other-to-cm-conversion-factor"/>cm</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="字:宽度/@字:相对宽度">
+ <xsl:variable name="reltblw">
+ <xsl:value-of select="字:宽度/@字:相对宽度"/>
+ </xsl:variable>
+ <xsl:variable name="pagew">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
+ </xsl:variable>
+ <xsl:variable name="leftm">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
+ </xsl:variable>
+ <xsl:variable name="rightm">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
+ </xsl:variable>
+ <xsl:attribute name="style:rel-width"><xsl:value-of select="concat(number(字:宽度/@字:相对宽度) * 100,'%')"/></xsl:attribute>
+ <xsl:attribute name="style:width"><xsl:value-of select="concat((number($pagew)-number($leftm)-number($rightm)) * number($reltblw),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:宽度/@字:绝对宽度">
+ <xsl:attribute name="style:width"><xsl:value-of select="concat(number(字:宽度/@字:绝对宽度),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:相对宽度 or /uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:绝对宽度">
+ <xsl:attribute name="style:rel-width"><xsl:value-of select="concat(/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:相对宽度 * 100,'%')"/></xsl:attribute>
+ <xsl:attribute name="style:width"><xsl:value-of select="/uof:UOF/uof:式样集/uof:文字表式样[@字:标识符=$biaoshi]/字:宽度/@字:绝对宽度"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="pagew">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
+ </xsl:variable>
+ <xsl:variable name="leftm">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
+ </xsl:variable>
+ <xsl:variable name="rightm">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
+ </xsl:variable>
+ <xsl:attribute name="style:width"><xsl:value-of select="concat((number($pagew)-number($leftm)-number($rightm)),$uofUnit)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:variable name="tblsize" select="sum(字:列宽集/字:列宽)"/>
+ <xsl:if test="(not($tblsize='0')) and not(字:宽度) ">
+ <xsl:choose>
+ <xsl:when test="字:左缩进">
+ <xsl:attribute name="style:width"><xsl:value-of select="concat( number($tblsize - 字:左缩进), $uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:width"><xsl:value-of select="concat( number(sum(字:列宽集/字:列宽) ), $uofUnit)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="字:边框">
+ <xsl:for-each select="字:边框">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:for-each select="字:填充">
+ <xsl:call-template name="uof:填充"/>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="字:列宽集" mode="style">
+ <xsl:choose>
+ <xsl:when test="not(./字:列宽)">
+ <xsl:for-each select="../..">
+ <xsl:for-each select="字:行[1]/字:单元格">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:family">table-column</xsl:attribute>
+ <xsl:attribute name="style:name">Table<xsl:number count="字:文字表" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number value="count(preceding::字:单元格)+1"/></xsl:attribute>
+ <xsl:element name="style:table-column-properties">
+ <xsl:choose>
+ <xsl:when test="字:单元格属性/字:宽度/@字:相对值">
+ <xsl:variable name="tblw1">
+ <xsl:choose>
+ <xsl:when test="../../字:文字表属性/字:宽度/@字:绝对宽度">
+ <xsl:value-of select="../../字:文字表属性/字:宽度/@字:绝对宽度"/>
+ </xsl:when>
+ <xsl:when test="../../字:文字表属性/字:宽度/@字:相对宽度">
+ <xsl:variable name="pagew">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
+ </xsl:variable>
+ <xsl:variable name="leftm">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
+ </xsl:variable>
+ <xsl:variable name="rightm">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
+ </xsl:variable>
+ <xsl:variable name="relw">
+ <xsl:value-of select="../../字:文字表属性/字:宽度/@字:相对宽度"/>
+ </xsl:variable>
+ <xsl:value-of select=" ( number($pagew)-number($leftm)-number($rightm))* number($relw) div 100"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="pagew">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:纸张/@uof:宽度"/>
+ </xsl:variable>
+ <xsl:variable name="leftm">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:左"/>
+ </xsl:variable>
+ <xsl:variable name="rightm">
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页边距/@uof:右"/>
+ </xsl:variable>
+ <xsl:value-of select="(number($pagew)-number($leftm)-number($rightm))"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="style:column-width"><xsl:value-of select="concat(number(number($tblw1)*number(字:单元格属性/字:宽度/@字:相对值) div 100),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:单元格属性/字:宽度/@字:绝对值">
+ <xsl:attribute name="style:column-width"><xsl:value-of select="concat(number(字:单元格属性/字:宽度/@字:绝对值),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:column-width"><xsl:value-of select="'1cm'"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="字:列宽">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:family">table-column</xsl:attribute>
+ <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number count="字:列宽" from="/uof:UOF/uof:文字处理/字:主体" level="single" format="1"/></xsl:attribute>
+ <xsl:variable name="tableRoot" select="ancestor::字:文字表"/>
+ <xsl:element name="style:table-column-properties">
+ <xsl:choose>
+ <xsl:when test="string(.)">
+ <xsl:attribute name="style:column-width"><xsl:value-of select="concat(.,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:column-width"><xsl:value-of select="'1cm'"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:行" mode="style">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:family">table-row</xsl:attribute>
+ <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/></xsl:attribute>
+ <xsl:element name="style:table-row-properties">
+ <xsl:for-each select="字:表行属性">
+ <xsl:choose>
+ <xsl:when test="字:高度/@字:固定值">
+ <xsl:attribute name="style:row-height"><xsl:value-of select="concat(number(字:高度/@字:固定值),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:高度/@字:最小值">
+ <xsl:attribute name="style:min-row-height"><xsl:value-of select="concat(number(字:高度/@字:最小值), $uofUnit )"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:attribute name="fo:keep-together"><xsl:value-of select="字:跨页/@字:值"/></xsl:attribute>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="字:单元格" mode="style">
+ <style:style>
+ <xsl:attribute name="style:name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/>C<xsl:number count="字:单元格" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]/字:行" level="any" format="1"/></xsl:attribute>
+ <xsl:attribute name="style:family">table-cell</xsl:attribute>
+ <xsl:element name="style:table-cell-properties">
+ <xsl:for-each select="字:单元格属性">
+ <xsl:choose>
+ <xsl:when test="字:单元格边距/@字:左">
+ <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(number(字:单元格边距/@字:左),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:padding-left"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:左"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="字:单元格边距/@字:右">
+ <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(number(字:单元格边距/@字:右),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:padding-right"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:右"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="字:单元格边距/@字:上">
+ <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(number(字:单元格边距/@字:上),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:padding-top"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:上"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="字:单元格边距/@字:下">
+ <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(number(字:单元格边距/@字:下),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="../../../../字:文字表属性/字:默认单元格边距/@字:下"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:variable name="cellbefore">
+ <xsl:value-of select="count(ancestor::字:单元格/preceding-sibling::字:单元格)"/>
+ </xsl:variable>
+ <xsl:variable name="cellafter">
+ <xsl:value-of select="count(ancestor::字:单元格/following-sibling::字:单元格)"/>
+ </xsl:variable>
+ <xsl:variable name="rowbefore">
+ <xsl:value-of select="count(ancestor::字:行/preceding-sibling::字:行)"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="字:边框">
+ <xsl:for-each select="字:边框">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="number($cellafter) &gt; 0">
+ <xsl:attribute name="fo:border-right">none</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:border-right">0.002cm solid #000000</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:border-left">0.002cm solid #000000</xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="number($rowbefore) &gt; 0">
+ <xsl:attribute name="fo:border-top">none</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:border-top">0.002cm solid #000000</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:border-bottom">0.002cm solid #000000</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:垂直对齐方式='center' ">middle</xsl:when><xsl:when test="字:垂直对齐方式='bottom' ">bottom</xsl:when><xsl:otherwise>top</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:for-each select="字:填充">
+ <xsl:call-template name="uof:填充"/>
+ </xsl:for-each>
+ </xsl:for-each>
+ </xsl:element>
+ </style:style>
+ </xsl:template>
+ <xsl:template match="uof:字体集">
+ <xsl:element name="office:font-face-decls">
+ <style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Times New Roman" svg:font-family="'Times New Roman'" style:font-family-generic="roman" style:font-pitch="variable"/>
+ <style:font-face style:name="Symbol" svg:font-family="Symbol" style:font-family-generic="roman" style:font-pitch="variable" style:font-charset="x-symbol"/>
+ <style:font-face style:name="Courier New" svg:font-family="'Courier New'" style:font-family-generic="modern" style:font-pitch="fixed"/>
+ <xsl:if test="not(uof:字体声明[@uof:名称='StarSymbol'])">
+ <style:font-face style:name="StarSymbol" svg:font-family="StarSymbol" style:font-charset="x-symbol"/>
+ </xsl:if>
+ <xsl:for-each select="uof:字体声明">
+ <xsl:element name="style:font-face">
+ <xsl:attribute name="style:name"><xsl:value-of select="@uof:标识符"/></xsl:attribute>
+ <xsl:attribute name="svg:font-family"><xsl:value-of select="@uof:名称"/></xsl:attribute>
+ <xsl:if test="@uof:字符集 = '02'">
+ <xsl:attribute name="style:font-charset">x-symbol</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@uof:字体族">
+ <xsl:choose>
+ <xsl:when test="@uof:字体族 = 'Swiss'">
+ <xsl:attribute name="style:font-family-generic">swiss</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='Modern'">
+ <xsl:attribute name="style:font-family-generic">modern</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族='Roman'">
+ <xsl:attribute name="style:font-family-generic">roman</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='Script'">
+ <xsl:attribute name="style:font-family-generic">script</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='Decorative'">
+ <xsl:attribute name="style:font-family-generic">decorative</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:字体族 ='System'">
+ <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:font-family-generic">system</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:attribute name="style:font-pitch">12</xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ <xsl:apply-templates select="uof:字体声明"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="uof:式样">
+ <xsl:element name="style:text-properties">
+ <xsl:apply-templates select="uof:句式样/*"/>
+ <xsl:apply-templates select="uof:段落式样/*"/>
+ <xsl:call-template name="paragraph-properties"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="uof:段落式样"/>
+ <xsl:template match="uof:句式样"/>
+ <xsl:template match="字:公用处理规则">
+ <xsl:apply-templates select="uof:文字处理/字:公用处理规则/字:文档设置"/>
+ </xsl:template>
+ <xsl:template match="uof:文字处理/字:公用处理规则/字:文档设置">
+ <office:settings>
+ <config:config-item-set config:name="ooo:view-settings">
+ <config:config-item config:name="InBrowseMode" config:type="boolean">
+ <xsl:choose>
+ <xsl:when test="字:当前视图='web'">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </config:config-item>
+ <config:config-item-map-indexed config:name="Views">
+ <config:config-item-map-entry>
+ <xsl:if test="字:缩放">
+ <config:config-item config:name="VisibleRight" config:type="int">1</config:config-item>
+ <config:config-item config:name="VisibleBottom" config:type="int">1</config:config-item>
+ <xsl:choose>
+ <xsl:when test="字:缩放 = 'best-fit'">
+ <config:config-item config:name="ZoomType" config:type="short">3</config:config-item>
+ </xsl:when>
+ <xsl:when test="字:缩放 = 'full-page'">
+ <config:config-item config:name="ZoomType" config:type="short">2</config:config-item>
+ </xsl:when>
+ <xsl:when test="字:缩放 = 'text-fit'">
+ <config:config-item config:name="ZoomType" config:type="short">1</config:config-item>
+ </xsl:when>
+ <xsl:otherwise>
+ <config:config-item config:name="ZoomType" config:type="short">0</config:config-item>
+ </xsl:otherwise>
+ </xsl:choose>
+ <config:config-item config:name="ZoomFactor" config:type="short">
+ <xsl:value-of select="字:缩放"/>
+ </config:config-item>
+ </xsl:if>
+ </config:config-item-map-entry>
+ </config:config-item-map-indexed>
+ </config:config-item-set>
+ <config:config-item-set config:name="configuration-settings">
+ <config:config-item-map-indexed config:name="ForbiddenCharacters">
+ <config:config-item-map-entry>
+ <config:config-item config:name="Language" config:type="string">zh</config:config-item>
+ <config:config-item config:name="Country" config:type="string">CN</config:config-item>
+ <config:config-item config:name="Variant" config:type="string"/>
+ <config:config-item config:name="BeginLine" config:type="string">
+ <xsl:choose>
+ <xsl:when test="字:标点禁则/字:行首字符 or *[@uof:locID='t0007']/*[@uof:locID='t0008']">
+ <xsl:value-of select="*[@uof:locID='t0007']/*[@uof:locID='t0008']"/>
+ </xsl:when>
+ <xsl:otherwise>:!),.:;?]}_'"、。〉》」』】〕〗〞︰︱︳﹐_﹒﹔﹕﹖﹗﹚﹜﹞!),.:;?|}︴︶︸︺︼︾﹀﹂﹄﹏_~¢々‖_·ˇˉ―--′</xsl:otherwise>
+ </xsl:choose>
+ </config:config-item>
+ <config:config-item config:name="EndLine" config:type="string">
+ <xsl:choose>
+ <xsl:when test="字:标点禁则/字:行尾字符 or *[@uof:locID='t0007']/*[@uof:locID='t0009']">
+ <xsl:value-of select="*[@uof:locID='t0007']/*[@uof:locID='t0009']"/>
+ </xsl:when>
+ <xsl:otherwise>([{__'"‵〈《「『【〔〖([{£¥〝︵︷︹︻︽︿﹁﹃﹙﹛﹝({</xsl:otherwise>
+ </xsl:choose>
+ </config:config-item>
+ </config:config-item-map-entry>
+ </config:config-item-map-indexed>
+ </config:config-item-set>
+ </office:settings>
+ </xsl:template>
+ <xsl:template match="uof:文字处理">
+ <xsl:element name="office:body">
+ <xsl:element name="office:text">
+ <xsl:call-template name="GenerateTrackChanges"/>
+ <text:sequence-decls>
+ <xsl:call-template name="default_sequence_declaration"/>
+ </text:sequence-decls>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="default_sequence_declaration">
+ <text:sequence-decl text:display-outline-level="0" text:name="Illustration">
+ </text:sequence-decl>
+ <text:sequence-decl text:display-outline-level="0" text:name="Table">
+ </text:sequence-decl>
+ <text:sequence-decl text:display-outline-level="0" text:name="Text">
+ </text:sequence-decl>
+ <text:sequence-decl text:display-outline-level="0" text:name="Drawing">
+ </text:sequence-decl>
+ <text:sequence-decl text:display-outline-level="0" text:name="AutoNr">
+ </text:sequence-decl>
+ </xsl:template>
+ <xsl:template name="段落" match="字:段落[not((preceding-sibling::字:段落/字:域开始) and (not(preceding-sibling::字:段落/字:域结束)))][not(字:段落属性[字:自动编号信息])]">
+ <xsl:if test="字:域开始/@字:类型='caption'">
+ <xsl:apply-templates select="字:域代码"/>
+ </xsl:if>
+ <xsl:if test="字:域开始/@字:类型='REF'">
+ <xsl:call-template name="目录域"/>
+ </xsl:if>
+ <xsl:if test="字:域开始/@字:类型='INDEX'">
+ <xsl:call-template name="索引域"/>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="string(parent::node()/@uof:locID)='t0107'">
+ <xsl:apply-templates select="字:脚注"/>
+ </xsl:when>
+ <xsl:when test="string(parent::node()/@uof:locID)='t0108'">
+ <xsl:apply-templates select="字:尾注"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="commonParagraph"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:脚注">
+ <xsl:element name="text:note">
+ <xsl:attribute name="text:note-class">footnote</xsl:attribute>
+ <xsl:element name="text:note-citation">
+ <xsl:attribute name="text:label"><xsl:value-of select="@字:引文体"/></xsl:attribute>
+ <xsl:value-of select="@字:引文体"/>
+ </xsl:element>
+ <xsl:element name="text:note-body">
+ <xsl:for-each select="字:段落">
+ <xsl:call-template name="commonParagraph"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="字:尾注">
+ <xsl:element name="text:note">
+ <xsl:attribute name="text:note-class">endnote</xsl:attribute>
+ <xsl:element name="text:note-citation">
+ <xsl:attribute name="text:label"><xsl:value-of select="@字:引文体"/></xsl:attribute>
+ <xsl:value-of select="@字:引文体"/>
+ </xsl:element>
+ <xsl:element name="text:note-body">
+ <xsl:for-each select="字:段落">
+ <xsl:call-template name="commonParagraph"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="字:锚点">
+ <xsl:call-template name="图形解析"/>
+ </xsl:template>
+ <xsl:key match="/uof:UOF/uof:文字处理/字:主体/字:段落/字:句/字:锚点 | /uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页眉//字:锚点 | /uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:页脚//字:锚点" name="rel_graphic_name" use="字:图形/@字:图形引用"/>
+ <xsl:template match="图:图形">
+ <xsl:variable name="random-name">
+ <xsl:value-of select="generate-id()"/>
+ </xsl:variable>
+ <xsl:variable name="draw-name">
+ <xsl:value-of select="substring($random-name,string-length($random-name)-1)"/>
+ </xsl:variable>
+ <xsl:call-template name="graphic-fill">
+ <xsl:with-param name="draw-name" select="$draw-name"/>
+ <xsl:with-param name="gradient-name" select="图:预定义图形/图:属性/图:填充/图:渐变"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变 | 图:预定义图形/图:属性/图:填充/图:颜色 | 图:预定义图形/图:属性/图:填充/图:图片 | 图:预定义图形/图:属性/图:填充/图:位图">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:family">graphic</xsl:attribute>
+ <xsl:if test="图:文本内容/@图:自动换行='true' or 图:文本内容/@图:自动换行='1'">
+ <xsl:attribute name="draw:fit-to-contour">true</xsl:attribute>
+ </xsl:if>
+ <xsl:element name="style:graphic-properties">
+ <xsl:call-template name="process-graphics">
+ <xsl:with-param name="draw-name" select="$draw-name"/>
+ </xsl:call-template>
+ </xsl:element>
+ <xsl:if test="图:文本内容/@图:文字排列方向">
+ <xsl:choose>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
+ <style:paragraph-properties style:writing-mode="tb-rl"/>
+ </xsl:when>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
+ <style:paragraph-properties style:writing-mode="tb-rl"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:family">graphic</xsl:attribute>
+ <xsl:element name="style:graphic-properties">
+ <xsl:if test="@图:其他对象 or key('rel_graphic_name',@图:标识符)/字:锚点属性/字:锚点属性/字:位置/字:垂直/字:相对/@字:相对于">
+ <xsl:attribute name="fo:clip">rect(0cm 0cm 0cm 0cm)</xsl:attribute>
+ <xsl:attribute name="draw:color-mode">standard</xsl:attribute>
+ <xsl:attribute name="draw:luminance">0%</xsl:attribute>
+ <xsl:attribute name="draw:contrast">0%</xsl:attribute>
+ <xsl:attribute name="draw:gamma">100%</xsl:attribute>
+ <xsl:attribute name="draw:red">0%</xsl:attribute>
+ <xsl:attribute name="draw:green">0%</xsl:attribute>
+ <xsl:attribute name="draw:blue">0%</xsl:attribute>
+ <xsl:attribute name="draw:image-opacity">100%</xsl:attribute>
+ <xsl:attribute name="style:mirror">none</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="process-graphics"/>
+ </xsl:element>
+ <xsl:if test="图:文本内容/@图:文字排列方向">
+ <xsl:choose>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
+ <style:paragraph-properties style:writing-mode="tb-rl"/>
+ </xsl:when>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
+ <style:paragraph-properties style:writing-mode="tb-rl"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="bina_graphic">
+ <xsl:param name="refGraphic"/>
+ <xsl:element name="office:binary-data">
+ <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符 = $refGraphic]">
+ <xsl:value-of select="uof:数据"/>
+ </xsl:for-each>
+ </xsl:element>
+ <text:p/>
+ </xsl:template>
+ <xsl:template name="graphic-fill">
+ <xsl:param name="draw-name"/>
+ <xsl:param name="gradient-name"/>
+ <xsl:if test="图:预定义图形/图:属性/图:填充/图:渐变">
+ <xsl:element name="draw:gradient">
+ <xsl:attribute name="draw:name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
+ <xsl:attribute name="draw:style"><xsl:choose><xsl:when test="$gradient-name/@图:种子类型='linear'"><xsl:value-of select="'linear'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='radar'"><xsl:value-of select="'radial'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='oval'"><xsl:value-of select="'ellipsoid'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='square'"><xsl:value-of select="'square'"/></xsl:when><xsl:when test="$gradient-name/@图:种子类型='rectangle'"><xsl:value-of select="'rectangular'"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="draw:start-color"><xsl:value-of select="$gradient-name/@图:起始色"/></xsl:attribute>
+ <xsl:attribute name="draw:end-color"><xsl:value-of select="$gradient-name/@图:终止色"/></xsl:attribute>
+ <xsl:attribute name="draw:start-intensity"><xsl:value-of select="concat($gradient-name/@图:起始浓度,'%')"/></xsl:attribute>
+ <xsl:attribute name="draw:end-intensity"><xsl:value-of select="concat($gradient-name/@图:终止浓度,'%')"/></xsl:attribute>
+ <xsl:attribute name="draw:angle"><xsl:value-of select="$gradient-name/@图:渐变方向 * 10"/></xsl:attribute>
+ <xsl:attribute name="draw:border"><xsl:value-of select="concat($gradient-name/@图:边界,'%')"/></xsl:attribute>
+ <xsl:if test="$gradient-name/@图:种子X位置">
+ <xsl:attribute name="draw:cx"><xsl:value-of select="concat($gradient-name/@图:种子X位置,'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$gradient-name/@图:种子Y位置">
+ <xsl:attribute name="draw:cy"><xsl:value-of select="concat($gradient-name/@图:种子Y位置,'%')"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
+ <xsl:element name="draw:marker">
+ <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">
+ <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
+ <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">
+ <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
+ <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
+ <xsl:element name="draw:marker">
+ <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">
+ <xsl:attribute name="svg:viewBox">0 0 20 30</xsl:attribute>
+ <xsl:attribute name="svg:d">m10 0-10 30h20z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">
+ <xsl:attribute name="svg:viewBox">0 0 1122 2243</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 2108v17 17l12 42 30 34 38 21 43 4 29-8 30-21 25-26 13-34 343-1532 339 1520 13 42 29 34 39 21 42 4 42-12 34-30 21-42v-39-12l-4 4-440-1998-9-42-25-39-38-25-43-8-42 8-38 25-26 39-8 42z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1580</xsl:attribute>
+ <xsl:attribute name="svg:d">m1013 1491 118 89-567-1580-564 1580 114-85 136-68 148-46 161-17 161 13 153 46z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m462 1118-102-29-102-51-93-72-72-93-51-102-29-102-13-105 13-102 29-106 51-102 72-89 93-72 102-50 102-34 106-9 101 9 106 34 98 50 93 72 72 89 51 102 29 106 13 102-13 105-29 102-51 102-72 93-93 72-98 51-106 29-101 13z</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">
+ <xsl:attribute name="svg:viewBox">0 0 1131 1131</xsl:attribute>
+ <xsl:attribute name="svg:d">m0 564 564 567 567-567-567-564z</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用 or 图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
+ <xsl:element name="draw:fill-image">
+ <xsl:attribute name="draw:name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:类型"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/></xsl:when></xsl:choose></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:call-template name="bina_graphic">
+ <xsl:with-param name="refGraphic">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用">
+ <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:图形引用"/>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称">
+ <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用">
+ <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ <xsl:if test="not(图:预定义图形/图:属性/图:线型='single') and not(图:预定义图形/图:属性/图:线型='thick') and 图:预定义图形/图:属性/图:线型">
+ <xsl:variable name="line" select="图:预定义图形/图:属性/图:线型"/>
+ <xsl:element name="draw:stroke-dash">
+ <xsl:choose>
+ <xsl:when test="$line='dash-long' or $line='dash-long-heavy'">
+ <xsl:attribute name="draw:name">Fine_20_Dashed</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">0.508cm</xsl:attribute>
+ <xsl:attribute name="draw:dots2">1</xsl:attribute>
+ <xsl:attribute name="draw:dots2-length">0.508cm</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.508cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='dot-dot-dash' or $line='dash-dot-dot-heavy'">
+ <xsl:attribute name="draw:name">2 Dots 1 Dash</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">2</xsl:attribute>
+ <xsl:attribute name="draw:dots2">1</xsl:attribute>
+ <xsl:attribute name="draw:dots2-length">0.203cm</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.203cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='dash' or $line='dashed-heavy'">
+ <xsl:attribute name="draw:name">Ultrafine Dashed</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">0.051cm</xsl:attribute>
+ <xsl:attribute name="draw:dots2">1</xsl:attribute>
+ <xsl:attribute name="draw:dots2-length">0.051cm</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.051cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='dotted' or $line='dotted-heavy'">
+ <xsl:attribute name="draw:name">Ultrafine Dotted (var)</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:distance">50%</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='wave' or $line='wavy-heavy'">
+ <xsl:attribute name="draw:name">Ultrafine 2 Dots 3 Dashes</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">2</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">0.051cm</xsl:attribute>
+ <xsl:attribute name="draw:dots2">3</xsl:attribute>
+ <xsl:attribute name="draw:dots2-length">0.254cm</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.127cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='dot-dash' or $line='dash-dot-heavy'">
+ <xsl:attribute name="draw:name">3 Dashes 3 Dots (var)</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">3</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">197%</xsl:attribute>
+ <xsl:attribute name="draw:dots2">3</xsl:attribute>
+ <xsl:attribute name="draw:distance">100%</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='double'">
+ <xsl:attribute name="draw:name">Line with Fine Dots</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">2.007cm</xsl:attribute>
+ <xsl:attribute name="draw:dots2">10</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.152cm</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$line='wavy-double'">
+ <xsl:attribute name="draw:name">Fine Dashed (var)</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">197%</xsl:attribute>
+ <xsl:attribute name="draw:distance">197%</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="draw:name">Fine Dashed</xsl:attribute>
+ <xsl:attribute name="draw:style">rect</xsl:attribute>
+ <xsl:attribute name="draw:dots1">1</xsl:attribute>
+ <xsl:attribute name="draw:dots1-length">0.508cm</xsl:attribute>
+ <xsl:attribute name="draw:dots2">1</xsl:attribute>
+ <xsl:attribute name="draw:dots2-length">0.508cm</xsl:attribute>
+ <xsl:attribute name="draw:distance">0.508cm</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="process-graphics">
+ <xsl:param name="draw-name"/>
+ <xsl:if test="图:预定义图形/图:类别">
+ </xsl:if>
+ <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:位置/字:垂直">
+ <xsl:attribute name="style:vertical-pos"><xsl:choose><xsl:when test="字:绝对">from-top</xsl:when><xsl:when test="字:相对/@字:值='bottom'">bottom</xsl:when><xsl:when test="字:相对/@字:值='center'">middle</xsl:when><xsl:when test="字:相对/@字:值='inside'">below</xsl:when><xsl:otherwise>top</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:vertical-rel"><xsl:choose><xsl:when test="@字:相对于='margin'">paragraph-content</xsl:when><xsl:otherwise><xsl:value-of select="@字:相对于"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:for-each>
+ <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:位置/字:水平">
+ <xsl:attribute name="style:horizontal-pos"><xsl:choose><xsl:when test="字:绝对">from-left</xsl:when><xsl:otherwise><xsl:value-of select="字:相对/@字:值"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:horizontal-rel"><xsl:choose><xsl:when test="@字:相对于='margin'">paragraph</xsl:when><xsl:when test="@字:相对于='page'">page</xsl:when><xsl:when test="@字:相对于='column'">paragraph</xsl:when><xsl:when test="@字:相对于='char'">char</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:for-each>
+ <xsl:variable name="wrap_type">
+ <xsl:value-of select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:绕排/@字:绕排方式"/>
+ </xsl:variable>
+ <xsl:variable name="aa">
+ <xsl:value-of select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:绕排/@字:绕排顶点"/>
+ </xsl:variable>
+ <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:绕排/@字:绕排方式">
+ <xsl:attribute name="style:wrap"><xsl:choose><xsl:when test="$wrap_type = 'through'">run-through</xsl:when><xsl:when test="$wrap_type = 'tight'">right</xsl:when><xsl:when test="$wrap_type = 'square'">parallel</xsl:when><xsl:when test="$wrap_type = 'top-bottom'">dynamic</xsl:when><xsl:when test="$wrap_type = 'infrontoftext'">run-through</xsl:when><xsl:when test="$wrap_type = 'behindtext'">run-through</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:run-through"><xsl:choose><xsl:when test="$wrap_type = 'behindtext'">background</xsl:when><xsl:otherwise>foreground</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:for-each>
+ <xsl:if test="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:边距">
+ <xsl:for-each select="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:边距">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(@字:上,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(@字:下,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(@字:右,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(@字:左,$uofUnit)"/></xsl:attribute>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="key('rel_graphic_name',@图:标识符)/字:锚点属性/字:保护/@字:值='true'">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:名称">
+ <xsl:attribute name="style:protect">position size</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:protect">content size position</xsl:attribute>
+ <xsl:attribute name="draw:size-protect">true</xsl:attribute>
+ <xsl:attribute name="draw:move-protect">true</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:名称">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:名称='椭圆'">
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="not(图:预定义图形/图:属性/图:填充)">
+ <xsl:attribute name="draw:fill">none</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称='background-image'">
+ <xsl:element name="style:background-image">
+ <xsl:element name="office:binary-data">
+ <xsl:variable name="biaoshi">
+ <xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/>
+ </xsl:variable>
+ <xsl:value-of select="ancestor::uof:对象集/uof:其他对象[@uof:标识符=$biaoshi]/uof:数据"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
+ <xsl:attribute name="draw:fill-image-name"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:名称"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图片/@图:图形引用"/></xsl:when></xsl:choose></xsl:attribute>
+ <xsl:if test="not(图:预定义图形/图:属性/图:填充/图:图片/@图:位置='tile')">
+ <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='center'">no-repeat</xsl:when><xsl:when test="图:预定义图形/图:属性/图:填充/图:图片/@图:位置='stretch'">stretch</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:图案">
+ <xsl:attribute name="draw:fill">bitmap</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:图案/@图:前景色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:颜色">
+ <xsl:attribute name="draw:fill">solid</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
+ <xsl:attribute name="fo:background-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:颜色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:预定义图形/图:属性/图:填充/图:渐变">
+ <xsl:attribute name="draw:fill">gradient</xsl:attribute>
+ <xsl:attribute name="draw:fill-color"><xsl:value-of select="图:预定义图形/图:属性/图:填充/图:渐变/@图:起始色"/></xsl:attribute>
+ <xsl:attribute name="draw:fill-gradient-name"><xsl:value-of select="concat('Gradient ',$draw-name)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="图:预定义图形/图:属性/图:线颜色">
+ <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:线型 and not(图:预定义图形/图:属性/图:线型 = 'single') and not(图:预定义图形/图:属性/图:线型 = 'thick')">
+ <xsl:variable name="linetype" select="图:预定义图形/图:属性/图:线型"/>
+ <xsl:attribute name="draw:stroke"><xsl:choose><xsl:when test="$linetype='none'">none</xsl:when><xsl:otherwise>dash</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="$linetype='none'">
+ <xsl:attribute name="fo:border">none</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="draw:stroke-dash"><xsl:choose><xsl:when test="$linetype='dot-dot-dash' or $linetype='dash-dot-dot-heavy'">2 Dots 1 Dash</xsl:when><xsl:when test="$linetype='dash' or $linetype='dashed-heavy'">Ultrafine_20_Dashed</xsl:when><xsl:when test="$linetype='dotted' or $linetype='dotted-heavy'">Ultrafine Dotted (var)</xsl:when><xsl:when test="$linetype='double'">Line with Fine Dots</xsl:when><xsl:when test="$linetype='dot-dash' or $linetype='dash-dot-heavy'">3 Dashes 3 Dots (var)</xsl:when><xsl:when test="$linetype='wave' or $linetype='wavy-heavy'">Ultrafine 2 Dots 3 Dashes</xsl:when><xsl:when test="$linetype='wavy-double'">Fine Dashed (var)</xsl:when><xsl:otherwise>Fine Dashed</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:线粗细">
+ <xsl:attribute name="svg:stroke-width"><xsl:value-of select="concat(图:预定义图形/图:属性/图:线粗细,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:前端箭头">
+ <xsl:attribute name="draw:marker-start"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:前端箭头/图:大小">
+ <xsl:attribute name="draw:marker-start-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:前端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:后端箭头">
+ <xsl:attribute name="draw:marker-end"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='normal'">Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='open'">Line Arrow</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='stealth'">Arrow concave</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='oval'">Circle</xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:式样='diamond'">Square 45</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:后端箭头/图:大小">
+ <xsl:attribute name="draw:marker-end-width"><xsl:choose><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '1'"><xsl:value-of select="concat('0.05',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '2'"><xsl:value-of select="concat('0.10',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '3'"><xsl:value-of select="concat('0.15',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '4'"><xsl:value-of select="concat('0.20',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '5'"><xsl:value-of select="concat('0.25',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '6'"><xsl:value-of select="concat('0.30',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '7'"><xsl:value-of select="concat('0.35',$uofUnit)"/></xsl:when><xsl:when test="图:预定义图形/图:属性/图:后端箭头/图:大小 = '8'"><xsl:value-of select="concat('0.40',$uofUnit)"/></xsl:when><xsl:otherwise><xsl:value-of select="concat('0.45',$uofUnit)"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:宽度">
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:高度">
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度">
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:锁定纵横比">
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:打印对象">
+ </xsl:if>
+ <xsl:if test="图:预定义图形/图:属性/图:透明度">
+ <xsl:attribute name="draw:opacity"><xsl:value-of select="concat((100 - 图:预定义图形/图:属性/图:透明度),'%')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:if test="图:文本内容/@图:上边距">
+ <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(图:文本内容/@图:上边距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(图:文本内容/@图:下边距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(图:文本内容/@图:左边距,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(图:文本内容/@图:右边距,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容/@图:文字排列方向">
+ <xsl:choose>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-l2r'">
+ <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:文本内容/@图:文字排列方向='vert-r2l'">
+ <xsl:attribute name="style:writing-mode">tb-rl</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="图:文本内容/@图:水平对齐">
+ <xsl:attribute name="draw:textarea-horizontal-align"><xsl:value-of select="图:文本内容/@图:水平对齐"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容/@图:垂直对齐">
+ <xsl:attribute name="draw:textarea-vertical-align"><xsl:value-of select="图:文本内容/@图:垂直对齐"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容/@图:自动换行">
+ <xsl:attribute name="fo:wrap-option"><xsl:choose><xsl:when test="图:文本内容/@图:自动换行='1' or 图:文本内容/@图:自动换行='true'">wrap</xsl:when><xsl:otherwise>no-wrap</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="图:文本内容/@图:大小适应文字='true'">
+ <xsl:attribute name="draw:auto-grow-width">true</xsl:attribute>
+ <xsl:attribute name="draw:auto-grow-height">true</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="draw:auto-grow-width">false</xsl:attribute>
+ <xsl:attribute name="draw:auto-grow-height">false</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="图:控制点">
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="图形解析">
+ <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
+ <xsl:variable name="paiban">
+ <xsl:value-of select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:名称"/>
+ </xsl:variable>
+ <xsl:variable name="otherobject">
+ <xsl:value-of select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/@图:其他对象"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]">
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='png' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='jpg' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='bmp' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:公共类型='gif' or /uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/@uof:私有类型='图片'">
+ <xsl:element name="draw:frame">
+ <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::字:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
+ <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="jiaodu">
+ <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
+ </xsl:variable>
+ <xsl:variable name="shibie">
+ <xsl:value-of select="图:预定义图形/图:生成软件"/>
+ </xsl:variable>
+ <xsl:variable name="rotate-angle">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
+ <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ <xsl:apply-templates select="图:文本内容/字:文字表"/>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据">
+ <draw:image>
+ <office:binary-data>
+ <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:数据"/>
+ </office:binary-data>
+ </draw:image>
+ </xsl:if>
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
+ <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/@图:其他对象 and /uof:UOF/uof:对象集/uof:其他对象/@uof:公共类型='jpg'">
+ <xsl:variable name="bshi">
+ <xsl:value-of select="/uof:UOF/uof:对象集/图:图形/@图:其他对象"/>
+ </xsl:variable>
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$bshi]/@uof:公共类型='jpg'">
+ <xsl:element name="draw:frame">
+ <xsl:attribute name="draw:name"><xsl:variable name="pos"><xsl:value-of select="count(preceding::字:锚点)"/></xsl:variable><xsl:value-of select="concat('图形',$pos)"/></xsl:attribute>
+ <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="jiaodu">
+ <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
+ </xsl:variable>
+ <xsl:variable name="shibie">
+ <xsl:value-of select="图:预定义图形/图:生成软件"/>
+ </xsl:variable>
+ <xsl:variable name="rotate-angle">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
+ <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ <xsl:apply-templates select="图:文本内容/字:文字表"/>
+ </xsl:if>
+ <xsl:variable name="qita">
+ <xsl:value-of select="self::node()/@图:其他对象"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$qita]/uof:数据">
+ <draw:image>
+ <office:binary-data>
+ <xsl:value-of select="."/>
+ </office:binary-data>
+ </draw:image>
+ </xsl:for-each>
+ </xsl:for-each>
+ <xsl:if test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径">
+ <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$tuxing1]/uof:路径"/></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:文本内容[@图:文本框='true'] and not($paiban='排版框')">
+ <draw:frame text:anchor-type="paragraph">
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="$tuxing1"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="draw:z-index">
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]"><xsl:value-of select="@图:层次"/></xsl:for-each>
+ </xsl:attribute>
+ <draw:text-box>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:段落"/>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:文本内容/字:文字表"/>
+ </draw:text-box>
+ </draw:frame>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="leibie">
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]">
+ <xsl:value-of select="图:预定义图形/图:类别"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="leibie2">
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]">
+ <xsl:value-of select="图:预定义图形/图:名称"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$leibie='22'">
+ <xsl:call-template name="排版框">
+ <xsl:with-param name="biaoshi" select="$tuxing1"/>
+ <xsl:with-param name="name" select="$leibie2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$leibie='23'">
+ <xsl:call-template name="文本框">
+ <xsl:with-param name="biaoshi" select="$tuxing1"/>
+ <xsl:with-param name="name" select="$leibie2"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$leibie='11'">
+ <xsl:call-template name="Rectangle"/>
+ </xsl:when>
+ <xsl:when test="$leibie='19'">
+ <xsl:call-template name="Oval"/>
+ </xsl:when>
+ <xsl:when test="$leibie='61'">
+ <xsl:call-template name="Line"/>
+ </xsl:when>
+ <xsl:when test="$leibie='62'">
+ <xsl:call-template name="Line"/>
+ </xsl:when>
+ <xsl:when test="$leibie='63'">
+ <xsl:call-template name="Line"/>
+ </xsl:when>
+ <xsl:when test="$leibie='64'">
+ <xsl:call-template name="Curve"/>
+ </xsl:when>
+ <xsl:when test="$leibie='65'">
+ <xsl:call-template name="Freeform"/>
+ </xsl:when>
+ <xsl:when test="$leibie='66'">
+ <xsl:call-template name="Scribble"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="文本框">
+ <xsl:param name="biaoshi"/>
+ <xsl:param name="name"/>
+ <draw:frame text:anchor-type="paragraph">
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="$biaoshi"/></xsl:attribute>
+ <xsl:attribute name="draw:name"><xsl:value-of select="$name"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="draw:z-index">
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $biaoshi]">
+ <xsl:value-of select="@图:层次"/>
+ </xsl:for-each>
+ </xsl:attribute>
+ <draw:text-box>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:段落"/>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:文字表"/>
+ </draw:text-box>
+ </draw:frame>
+ </xsl:template>
+ <xsl:template name="Curve">
+ <xsl:element name="draw:path">
+ <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]">
+ <xsl:variable name="width" select="number(图:预定义图形/图:属性/图:宽度)*1000"/>
+ <xsl:variable name="height" select="number(图:预定义图形/图:属性/图:高度)*1000"/>
+ <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
+ <xsl:attribute name="svg:d"><xsl:value-of select="图:预定义图形/图:关键点坐标/@图:路径"/></xsl:attribute>
+ </xsl:for-each>
+ <xsl:call-template name="common"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="common">
+ <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="jiaodu">
+ <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
+ </xsl:variable>
+ <xsl:variable name="shibie">
+ <xsl:value-of select="图:预定义图形/图:生成软件"/>
+ </xsl:variable>
+ <xsl:variable name="rotate-angle">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
+ <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ <xsl:apply-templates select="图:文本内容/字:文字表"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="common1">
+ <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:预定义图形/图:属性/图:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:height"><xsl:value-of select="concat(/uof:UOF/uof:对象集/图:图形[@图:标识符=$tuxing1]/图:预定义图形/图:属性/图:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="text:anchor-type"><xsl:choose><xsl:when test="@字:类型='inline'">as-char</xsl:when><xsl:otherwise>paragraph</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="jiaodu">
+ <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
+ </xsl:variable>
+ <xsl:variable name="shibie">
+ <xsl:value-of select="图:预定义图形/图:生成软件"/>
+ </xsl:variable>
+ <xsl:variable name="rotate-angle">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
+ <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ <xsl:apply-templates select="图:文本内容/字:文字表"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="Freeform">
+ <xsl:element name="draw:polygon">
+ <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
+ <xsl:variable name="width" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:宽度)*1000"/>
+ <xsl:variable name="height" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:高度)*1000"/>
+ <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
+ <xsl:attribute name="draw:points"><xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:关键点坐标"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="concat(number(图:坐标[1]/@x坐标)*1000,',',number(图:坐标[1]/@y坐标)*1000)"/><xsl:with-param name="point-pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
+ <xsl:call-template name="common"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="drawpoints">
+ <xsl:param name="points"/>
+ <xsl:param name="point-pos"/>
+ <xsl:choose>
+ <xsl:when test="图:坐标[$point-pos]">
+ <xsl:variable name="points1" select="concat($points,' ',number(图:坐标[$point-pos]/@x坐标)*1000,',',number(图:坐标[$point-pos]/@y坐标)*1000)"/>
+ <xsl:call-template name="drawpoints">
+ <xsl:with-param name="points" select="$points1"/>
+ <xsl:with-param name="point-pos" select="$point-pos+1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$points"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="Scribble">
+ <xsl:element name="draw:polyline">
+ <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
+ <xsl:variable name="width" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:宽度)*1000"/>
+ <xsl:variable name="height" select="number(/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:属性/图:高度)*1000"/>
+ <xsl:attribute name="svg:viewBox"><xsl:value-of select="concat('0 0 ',$width, ' ',$height)"/></xsl:attribute>
+ <xsl:attribute name="draw:points"><xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]/图:预定义图形/图:关键点坐标"><xsl:call-template name="drawpoints"><xsl:with-param name="points" select="concat(number(图:坐标[1]/@x坐标)*1000,',',number(图:坐标[1]/@y坐标)*1000)"/><xsl:with-param name="point-pos" select="2"/></xsl:call-template></xsl:for-each></xsl:attribute>
+ <xsl:call-template name="common"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Oval">
+ <xsl:element name="draw:ellipse">
+ <xsl:call-template name="common1"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="排版框">
+ <xsl:param name="biaoshi"/>
+ <xsl:param name="name"/>
+ <draw:frame text:anchor-type="paragraph">
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="$biaoshi"/></xsl:attribute>
+ <xsl:attribute name="draw:name"><xsl:value-of select="$name"/></xsl:attribute>
+ <xsl:attribute name="svg:width"><xsl:value-of select="concat(字:锚点属性/字:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:if test="字:锚点属性/字:位置/字:水平/字:绝对">
+ <xsl:attribute name="svg:x"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:锚点属性/字:位置/字:垂直/字:绝对">
+ <xsl:attribute name="svg:y"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="draw:z-index">
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $biaoshi]">
+ <xsl:value-of select="@图:层次"/>
+ </xsl:for-each>
+ </xsl:attribute>
+ <draw:text-box>
+ <xsl:attribute name="fo:min-height"><xsl:value-of select="concat(字:锚点属性/字:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:段落"/>
+ <xsl:apply-templates select="/uof:UOF/uof:对象集/图:图形[@图:标识符=$biaoshi]/图:文本内容/字:文字表"/>
+ </draw:text-box>
+ </draw:frame>
+ </xsl:template>
+ <xsl:template name="Rectangle">
+ <xsl:element name="draw:rect">
+ <xsl:call-template name="common1"/>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="Line">
+ <xsl:element name="draw:line">
+ <xsl:variable name="tuxing1" select="字:图形/@字:图形引用"/>
+ <xsl:attribute name="svg:x1"><xsl:value-of select="concat(字:锚点属性/字:位置/字:水平/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y1"><xsl:value-of select="concat(字:锚点属性/字:位置/字:垂直/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:x2"><xsl:value-of select="concat((字:锚点属性/字:位置/字:水平/字:绝对/@字:值 + 字:锚点属性/字:宽度),$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="svg:y2"><xsl:value-of select="concat((字:锚点属性/字:位置/字:垂直/字:绝对/@字:值 + 字:锚点属性/字:高度),$uofUnit)"/></xsl:attribute>
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形[@图:标识符 = $tuxing1]">
+ <xsl:attribute name="text:anchor-type">paragraph</xsl:attribute>
+ <xsl:attribute name="draw:style-name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="draw:z-index"><xsl:value-of select="@图:层次"/></xsl:attribute>
+ <xsl:if test="图:预定义图形/图:属性/图:旋转角度 and not(图:预定义图形/图:属性/图:旋转角度='0.0')">
+ <xsl:variable name="jiaodu">
+ <xsl:value-of select="图:预定义图形/图:属性/图:旋转角度"/>
+ </xsl:variable>
+ <xsl:variable name="shibie">
+ <xsl:value-of select="图:预定义图形/图:生成软件"/>
+ </xsl:variable>
+ <xsl:variable name="rotate-angle">
+ <xsl:choose>
+ <xsl:when test="图:预定义图形/图:生成软件 and not($shibie='PNG')">
+ <xsl:value-of select="((360 - $jiaodu) * 2 * 3.14159265 ) div 360"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="(图:预定义图形/图:属性/图:旋转角度 * 2 * 3.14159265 ) div 360"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:attribute name="draw:transform"><xsl:value-of select="concat('rotate (',$rotate-angle,') translate (-0.0194027777777778cm 3.317875cm)')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="图:文本内容">
+ <xsl:apply-templates select="图:文本内容/字:段落"/>
+ <xsl:apply-templates select="图:文本内容/字:文字表"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="processPageBreaks">
+ <xsl:variable name="pageBreak" select="字:句/字:分页符"/>
+ <xsl:call-template name="createSubParagraph">
+ <xsl:with-param name="list" select="$pageBreak[1]/preceding-sibling::字:句"/>
+ <xsl:with-param name="pageBreak"/>
+ <xsl:with-param name="needsPageBreak">false</xsl:with-param>
+ </xsl:call-template>
+ <xsl:for-each select="$pageBreak">
+ <xsl:call-template name="createSubParagraph">
+ <xsl:with-param name="list" select="./following-sibling::字:句[preceding::字:句/字:分页符 = '.']"/>
+ <xsl:with-param name="pageBreak" select="."/>
+ <xsl:with-param name="needsPageBreak">true</xsl:with-param>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="createSubParagraph">
+ <xsl:param name="list"/>
+ <xsl:param name="pageBreak"/>
+ <xsl:param name="needsPageBreak"/>
+ <xsl:if test="(count($list) &gt; 0) or ($needsPageBreak ='true') ">
+ <xsl:element name="text:p">
+ <xsl:choose>
+ <xsl:when test="$needsPageBreak = 'true'">
+ <xsl:choose>
+ <xsl:when test="ancestor::字:段落/字:段落属性">
+ <xsl:attribute name="text:style-name">P<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落属性"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="text:style-name">PageBreak</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="$pageBreak">
+ <xsl:apply-templates select="$pageBreak"/>
+ </xsl:if>
+ <xsl:apply-templates select="$list"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:句/字:区域开始[@字:类型='bookmark']">
+ <xsl:variable name="biaoshi">
+ <xsl:value-of select="@字:标识符"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="not(@字:名称)">
+ <text:bookmark-start text:name="{/uof:UOF/uof:书签集/uof:书签[uof:文本位置/@字:区域引用=$biaoshi]/@uof:名称}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <text:bookmark-start text:name="{@字:名称}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:句/字:区域结束[preceding::字:区域开始[1]/@字:类型='bookmark']">
+ <xsl:variable name="biaoshi">
+ <xsl:value-of select="@字:标识符引用"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="not(@字:名称)">
+ <text:bookmark-end text:name="{/uof:UOF/uof:书签集/uof:书签[uof:文本位置/@字:区域引用=$biaoshi]/@uof:名称}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <text:bookmark-end text:name="{@字:名称}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:区域开始[@字:类型='annotation']">
+ <text:bookmark-start text:name="{@字:标识符}"/>
+ </xsl:template>
+ <xsl:template match="字:区域结束[preceding::字:区域开始[1]/@字:类型='annotation']">
+ <text:bookmark-end text:name="{@字:标识符引用}"/>
+ </xsl:template>
+ <xsl:template match="字:区域开始[@字:类型='user-data']">
+ <text:alphabetical-index-mark-start text:id="{@字:标识符}" text:string-value-phonetic="{@字:名称}"/>
+ </xsl:template>
+ <xsl:template match="字:区域结束[preceding::字:区域开始[1]/@字:类型='user-data']">
+ <text:alphabetical-index-mark-end text:id="{@字:标识符引用}"/>
+ </xsl:template>
+ <xsl:template match="字:段落/字:域开始">
+ <xsl:choose>
+ <xsl:when test="@字:类型='createdate'">
+ <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
+ <xsl:element name="text:creation-date">
+ <xsl:attribute name="style:data-style-name">CreateDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createdate']"/></xsl:attribute>
+ <xsl:attribute name="text:date-value"><xsl:value-of select="$datestr"/></xsl:attribute>
+ <xsl:value-of select="$datestr"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@字:类型='savedate'">
+ <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
+ <xsl:element name="text:date">
+ <xsl:attribute name="style:data-style-name">SaveDate<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'savedate']"/></xsl:attribute>
+ <xsl:attribute name="text:date-value"><xsl:value-of select="$datestr"/></xsl:attribute>
+ <xsl:attribute name="text:fixed">true</xsl:attribute>
+ <xsl:value-of select="$datestr"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@字:类型='date'">
+ <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
+ <xsl:element name="text:date">
+ <xsl:attribute name="style:data-style-name">Date<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'date']"/></xsl:attribute>
+ <xsl:attribute name="text:date-value"><xsl:value-of select="$datestr"/></xsl:attribute>
+ <xsl:value-of select="$datestr"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@字:类型='time'">
+ <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
+ <xsl:element name="text:time">
+ <xsl:attribute name="style:data-style-name">Time<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'time']"/></xsl:attribute>
+ <xsl:attribute name="text:time-value"><xsl:value-of select="$datestr"/></xsl:attribute>
+ <xsl:value-of select="$datestr"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@字:类型='edittime'">
+ <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
+ <xsl:element name="text:editing-duration">
+ <xsl:attribute name="style:data-style-name">EditTime<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'edittime']"/></xsl:attribute>
+ <xsl:value-of select="$datestr"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@字:类型='createtime'">
+ <xsl:variable name="datestr" select="../字:句[preceding-sibling::字:域代码]/字:文本串"/>
+ <xsl:element name="text:creation-time">
+ <xsl:attribute name="style:data-style-name">CREATETIME<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落/字:域开始[@字:类型 = 'createtime']"/></xsl:attribute>
+ <xsl:value-of select="$datestr"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="@字:类型='page'">
+ <xsl:call-template name="页码域"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='numpages'">
+ <xsl:call-template name="页数域"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='author'">
+ <xsl:call-template name="作者域"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='username'">
+ <xsl:call-template name="用户域"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='userinitials'">
+ <xsl:call-template name="缩写域"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='title'">
+ <xsl:call-template name="标题域"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='subject'">
+ <xsl:call-template name="主题域"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='numchars'">
+ <xsl:call-template name="字符数"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='filename'">
+ <xsl:call-template name="文件名"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='edittime'">
+ <xsl:call-template name="编辑时间"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='creation-time'">
+ <xsl:call-template name="创建时间"/>
+ </xsl:when>
+ <xsl:when test="@字:类型='seq'">
+ <xsl:call-template name="题注"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="commonParagraph">
+ <xsl:choose>
+ <xsl:when test="字:段落属性/字:大纲级别">
+ <xsl:element name="text:h">
+ <xsl:call-template name="commonParagraphAttributes"/>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="not (字:域开始/@字:类型='ref') and not(字:域开始/@字:类型='index')">
+ <xsl:element name="text:p">
+ <xsl:call-template name="commonParagraphAttributes"/>
+ <xsl:apply-templates/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="commonParagraphAttributes">
+ <xsl:choose>
+ <xsl:when test="字:段落属性">
+ <xsl:variable name="pp">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
+ </xsl:variable>
+ <xsl:variable name="aa">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:域结束]"/>
+ </xsl:variable>
+ <xsl:variable name="stylename" select="字:段落属性/@字:式样引用"/>
+ <xsl:choose>
+ <xsl:when test="preceding-sibling::字:段落/字:域结束">
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$pp+$aa)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains($stylename,'Heading')">
+ <xsl:attribute name="text:style-name"><xsl:value-of select="$stylename"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$pp)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="字:段落属性/字:大纲级别">
+ <xsl:attribute name="text:outline-level"><xsl:value-of select="字:段落属性/字:大纲级别"/></xsl:attribute>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="generate-id(ancestor::字:主体/descendant::字:段落[1]) = generate-id(.)">
+ <xsl:variable name="paragraph-number">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
+ </xsl:variable>
+ <xsl:attribute name="text:style-name">P<xsl:value-of select="number($paragraph-number)"/>_1</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="not(字:段落属性) and (descendant::字:分栏符 or ancestor::字:分节/descendant::字:节属性[字:分栏/@字:栏数 &gt; 1])">
+ <xsl:attribute name="text:style-name">ColumnBreakPara</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:句">
+ <xsl:apply-templates select="字:文本串"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:段落属性"/>
+ <xsl:template match="字:句/字:句属性"/>
+ <xsl:template match="字:句属性" mode="style">
+ <xsl:if test="not(@字:式样引用)">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">T<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句属性" format="1"/></xsl:attribute>
+ <xsl:attribute name="style:family">text</xsl:attribute>
+ <xsl:if test="@字:式样引用">
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:式样引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="style:text-properties">
+ <xsl:apply-templates select="./*"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:句/字:文本串">
+ <xsl:choose>
+ <xsl:when test="string(.) = ' ' ">
+ <xsl:element name="text:s"/>
+ </xsl:when>
+ <xsl:when test="contains(.,' ')">
+ <xsl:call-template name="replace-spaces">
+ <xsl:with-param name="curr-string" select="."/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="replace-spaces">
+ <xsl:param name="curr-string"/>
+ <xsl:if test="contains($curr-string,' ')">
+ <xsl:value-of select="substring-before($curr-string,' ')"/>
+ <text:s text:c="2"/>
+ <xsl:variable name="next-string" select="substring-after($curr-string,' ')"/>
+ <xsl:choose>
+ <xsl:when test="contains($next-string, ' ')">
+ <xsl:call-template name="replace-spaces">
+ <xsl:with-param name="curr-string" select="$next-string"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$next-string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:空格符[parent::字:句]">
+ <xsl:element name="text:s">
+ <xsl:attribute name="text:c"><xsl:value-of select="@字:个数"/></xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="字:制表符[parent::字:句]">
+ <xsl:element name="text:tab"/>
+ </xsl:template>
+ <xsl:template match="字:句">
+ <xsl:if test="name(following-sibling::*[1])!='字:域结束'">
+ <xsl:if test="字:换行符">
+ <xsl:element name="text:line-break"/>
+ </xsl:if>
+ <xsl:variable name="currently-node" select="./字:锚点"/>
+ <xsl:choose>
+ <xsl:when test="字:句属性//字:隐藏文字/@字:值='true'">
+ <text:hidden-text text:is-hidden="true" text:string-value="{.}"/>
+ </xsl:when>
+ <xsl:when test="字:区域开始[@字:类型='hyperlink']">
+ <xsl:element name="text:a">
+ <xsl:attribute name="xlink:type">simple</xsl:attribute>
+ <xsl:variable name="hyperDest" select="字:区域开始/@字:标识符"/>
+ <xsl:attribute name="xlink:href"><xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接"><xsl:if test="@uof:链源=$hyperDest"><xsl:if test="@uof:提示"><xsl:attribute name="office:name"><xsl:value-of select="@uof:提示"/></xsl:attribute></xsl:if><xsl:if test="@uof:目标"><xsl:variable name="bsh" select="@uof:目标"/><xsl:choose><xsl:when test="contains($bsh,'\')"><xsl:value-of select="concat('/',translate($bsh,'\','/'))"/></xsl:when><xsl:otherwise><xsl:value-of select="$bsh"/></xsl:otherwise></xsl:choose></xsl:if><xsl:if test="@uof:书签"><xsl:variable name="bookmarkDest" select="@uof:书签"/><xsl:choose><xsl:when test="/uof:UOF/uof:书签集/uof:书签"><xsl:for-each select="/uof:UOF/uof:书签集/uof:书签"><xsl:if test="@uof:名称=$bookmarkDest"><xsl:value-of select="concat('#',@uof:名称)"/></xsl:if></xsl:for-each></xsl:when><xsl:otherwise><xsl:value-of select="concat('#',$bookmarkDest)"/></xsl:otherwise></xsl:choose></xsl:if></xsl:if></xsl:for-each></xsl:attribute>
+ <xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接">
+ <xsl:if test="@uof:链源=$hyperDest">
+ <xsl:if test="@uof:提示">
+ <xsl:attribute name="office:name"><xsl:value-of select="@uof:提示"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="./字:文本串">
+ <xsl:apply-templates select="字:文本串"/>
+ </xsl:when>
+ <xsl:when test="following-sibling::字:句/字:文本串">
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="字:区域结束 and preceding::字:区域开始[1]/@字:类型='bookmark' and not(self::node()/字:区域开始)">
+ <xsl:variable name="aa">
+ <xsl:value-of select="字:区域结束/@字:标识符引用"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="preceding::字:区域开始[1]/@字:类型='bookmark' and not(preceding::字:区域开始[1]/@字:名称)">
+ <text:bookmark-end text:name="{/uof:UOF/uof:书签集/uof:书签[uof:文本位置/@字:区域引用=$aa]/@uof:名称}"/>
+ </xsl:when>
+ <xsl:when test="preceding::字:区域开始[1]/@字:类型='bookmark'">
+ <text:bookmark-end text:name="{preceding::字:区域开始[1]/@字:名称}"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="preceding-sibling::字:句[position()=1]/字:区域开始[@字:类型='hyperlink'] and not(preceding-sibling::字:句[position()=1]/字:区域结束)"/>
+ <xsl:when test="(preceding-sibling::字:句) or (字:句属性)or(字:区域开始)">
+ <xsl:element name="text:span">
+ <xsl:choose>
+ <xsl:when test="字:区域开始[@字:类型='annotation']">
+ <xsl:variable name="ref_comment">
+ <xsl:value-of select="字:区域开始/@字:标识符"/>
+ </xsl:variable>
+ <xsl:apply-templates/>
+ <xsl:apply-templates select="/uof:UOF/uof:文字处理/字:公用处理规则/字:批注集/字:批注[@字:区域引用 = $ref_comment]"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="stylenum">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
+ </xsl:variable>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat('T',$stylenum)"/></xsl:attribute>
+ <xsl:apply-templates select="*[not(name()='字:引文符号')]"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="字:文本串|字:锚点|字:空格符|字:换行符|字:制表符|字:区域开始|字:区域结束|字:脚注|字:尾注"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="node()[name() = '字:位置']">
+ <xsl:attribute name="style:text-position"><xsl:variable name="val"><xsl:value-of select="."/></xsl:variable><xsl:choose><xsl:when test="$val='sub' or $val='super'"><xsl:value-of select="concat($val,' 58%')"/></xsl:when><xsl:when test="contains($val,'sub ') or contains($val,'super ')"><xsl:value-of select="concat($val,'%')"/></xsl:when><xsl:when test="not(contains($val,' '))"><xsl:value-of select="concat($val,'% 100%')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(substring-before($val,' '),'% ',substring-after($val,' '),'%' )"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:批注">
+ <office:annotation office:display="true">
+ <xsl:variable name="name" select="@字:作者"/>
+ <dc:creator>
+ <xsl:value-of select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$name]/@字:姓名"/>
+ </dc:creator>
+ <dc:date>
+ <xsl:value-of select="@字:日期"/>
+ </dc:date>
+ <xsl:apply-templates select="字:段落"/>
+ </office:annotation>
+ </xsl:template>
+ <xsl:template match="字:字体">
+ <xsl:if test="@字:字号">
+ <xsl:attribute name="fo:font-size"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-asian"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-complex"><xsl:value-of select="@字:字号"/>pt</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:相对字号 and self::node( )[not(parent::字:句属性)]">
+ <xsl:variable name="stylename" select="parent::node()/@字:基式样引用"/>
+ <xsl:variable name="zihao">
+ <xsl:for-each select="/uof:UOF/uof:式样集//uof:段落式样[@字:标识符=$stylename]">
+ <xsl:value-of select="字:字体/@字:字号"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="font-size" select="@字:相对字号"/>
+ <xsl:attribute name="fo:font-size"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-asian"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
+ <xsl:attribute name="style:font-size-complex"><xsl:value-of select="($zihao * $font-size div 100)"/>pt</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:颜色">
+ <xsl:attribute name="fo:color"><xsl:value-of select="@字:颜色"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:中文字体引用">
+ <xsl:attribute name="style:font-name-asian"><xsl:value-of select="@字:中文字体引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:西文字体引用">
+ <xsl:variable name="xiwen" select="@字:西文字体引用"/>
+ <xsl:attribute name="style:font-name"><xsl:value-of select="translate($xiwen,'_',' ')"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:斜体">
+ <xsl:if test="@字:值='true'">
+ <xsl:attribute name="fo:font-style">italic</xsl:attribute>
+ <xsl:attribute name="fo:font-style-asian">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-asian">italic</xsl:attribute>
+ <xsl:attribute name="style:font-style-complex">italic</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:粗体">
+ <xsl:if test="@字:值='true'or @字:值='1'">
+ <xsl:attribute name="fo:font-weight">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-asian">bold</xsl:attribute>
+ <xsl:attribute name="style:font-weight-complex">bold</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:下划线">
+ <xsl:choose>
+ <xsl:when test="@字:类型 = 'single'">
+ <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'double'">
+ <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
+ <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'thick'">
+ <xsl:attribute name="style:text-underline-style">solid</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dotted'">
+ <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dotted-heavy'">
+ <xsl:attribute name="style:text-underline-style">dotted</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash'">
+ <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dashed-heavy'">
+ <xsl:attribute name="style:text-underline-style">dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-long'">
+ <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-long-heavy'">
+ <xsl:attribute name="style:text-underline-style">long-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dot-dash'">
+ <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-dot-heavy'">
+ <xsl:attribute name="style:text-underline-style">dot-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dot-dot-dash'">
+ <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'dash-dot-dot-heavy'">
+ <xsl:attribute name="style:text-underline-style">dot-dot-dash</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'wave'">
+ <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'wavy-heavy'">
+ <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'wavy-double'">
+ <xsl:attribute name="style:text-underline-style">wave</xsl:attribute>
+ <xsl:attribute name="style:text-underline-type">double</xsl:attribute>
+ <xsl:attribute name="style:text-underline-width">auto</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@字:颜色">
+ <xsl:attribute name="style:text-underline-color"><xsl:choose><xsl:when test="@字:颜色='auto'">font-color</xsl:when><xsl:otherwise><xsl:value-of select="@字:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:text-underline-color">font-color</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:着重号">
+ <xsl:if test="not(@字:类型='none')">
+ <xsl:choose>
+ <xsl:when test="@字:类型='dot'">
+ <xsl:attribute name="style:text-emphasize">dot below</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='accent above' ">
+ <xsl:attribute name="style:text-emphasize">accent above</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='dot above' ">
+ <xsl:attribute name="style:text-emphasize">dot above</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='disc above' ">
+ <xsl:attribute name="style:text-emphasize">disc above</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='circle above' ">
+ <xsl:attribute name="style:text-emphasize">circle above</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='accent below' ">
+ <xsl:attribute name="style:text-emphasize">accent below</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='dot below' ">
+ <xsl:attribute name="style:text-emphasize">dot below</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='disc below' ">
+ <xsl:attribute name="style:text-emphasize">disc below</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='circle below' ">
+ <xsl:attribute name="style:text-emphasize">circle below</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>none</xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="字:颜色">
+ <xsl:attribute name="fo:color"><xsl:value-of select="@字:颜色"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:隐藏文字">
+ <xsl:attribute name="text:display"><xsl:value-of select="@字:值"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:空心">
+ <xsl:attribute name="style:text-outline"><xsl:value-of select="@字:值"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:阴影">
+ <xsl:if test="not(@字:值='false')">
+ <xsl:attribute name="fo:text-shadow">1pt 1pt</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:闪动的">
+ <xsl:attribute name="style:text-blinking"><xsl:value-of select="@字:闪动的"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:删除线">
+ <xsl:choose>
+ <xsl:when test="@字:类型 = 'single' ">
+ <xsl:attribute name="style:text-line-through-style">solid</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'double' ">
+ <xsl:attribute name="style:text-line-through-type">double</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'bold' ">
+ <xsl:attribute name="style:text-line-through-width">bold</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = 'xl' ">
+ <xsl:attribute name="style:text-line-through-text">X</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型 = '/l' ">
+ <xsl:attribute name="style:text-line-through-text">/</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:text-crossing-out">none</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:突出显示">
+ <xsl:attribute name="fo:background-color">
+ <xsl:choose>
+ <xsl:when test="@字:颜色='auto'">transparent</xsl:when>
+ <xsl:otherwise><xsl:value-of select="@字:颜色"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:template>
+ <xsl:template match="@字:颜色[not(.='auto')]">
+ <xsl:attribute name="fo:color">#<xsl:value-of select="."/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:浮雕">
+ <xsl:attribute name="style:font-relief"><xsl:choose><xsl:when test="@字:类型='engrave'">engraved</xsl:when><xsl:when test="@字:类型='emboss'">embossed</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:醒目字体">
+ <xsl:choose>
+ <xsl:when test="@字:类型='small-caps'">
+ <xsl:attribute name="fo:font-variant">small-caps</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:类型='none'">
+ <xsl:attribute name="fo:font-variant">normal</xsl:attribute>
+ <xsl:attribute name="fo:text-transform">none</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:text-transform"><xsl:choose><xsl:when test="@字:类型='uppercase'">uppercase</xsl:when><xsl:when test="@字:类型='lowercase'">lowercase</xsl:when><xsl:when test="@字:类型='capital'">capitalize</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:位置" mode="oo">
+ <xsl:attribute name="style:text-position"><xsl:variable name="val"><xsl:value-of select="."/></xsl:variable><xsl:choose><xsl:when test="$val='sub' or $val='super'"><xsl:value-of select="concat($val,' 58%')"/></xsl:when><xsl:when test="contains($val,'sub ') or contains($val,'super ')"><xsl:value-of select="concat($val,'%')"/></xsl:when><xsl:when test="not(contains($val,' '))"><xsl:value-of select="concat($val,'% 100%')"/></xsl:when><xsl:otherwise><xsl:value-of select="concat(substring-before($val,' '),'% ',substring-after($val,' '),'%' )"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:缩放">
+ <xsl:attribute name="style:text-scale"><xsl:value-of select="."/>%</xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:字符间距">
+ <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="."/>cm</xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:调整字间距">
+ <xsl:variable name="tt" select="字:调整字间距"/>
+ <xsl:attribute name="style:letter-kerning"><xsl:choose><xsl:when test="$tt='1'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:外框">
+ <xsl:attribute name="style:text-outline">true</xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:字符间距[parent::字:句属性]">
+ <xsl:variable name="aa">
+ <xsl:value-of select="."/>
+ </xsl:variable>
+ <xsl:attribute name="fo:letter-spacing"><xsl:value-of select="concat( $aa, $uofUnit)"/></xsl:attribute>
+ </xsl:template>
+ <xsl:template match="字:分节">
+ <xsl:if test="字:节属性/字:脚注设置">
+ <xsl:call-template name="脚注设置"/>
+ </xsl:if>
+ <xsl:if test="字:节属性/字:尾注设置">
+ <xsl:call-template name="尾注设置"/>
+ </xsl:if>
+ <xsl:if test="字:节属性/字:行号设置">
+ <xsl:call-template name="行编号"/>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="行编号">
+ <xsl:element name="text:linenumbering-configuration">
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:行号设置">
+ <xsl:choose>
+ <xsl:when test="@字:使用行号='false'">
+ <xsl:attribute name="text:number-lines">false</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="text:style-name">Line numbering</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="@字:编号方式">
+ <xsl:choose>
+ <xsl:when test="@字:编号方式='section'">
+ <xsl:attribute name="text:count-in-floating-frames">true</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@字:编号方式='page'">
+ <xsl:attribute name="text:restart-on-page">true</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="字:编号方式='continuous'">
+ <xsl:attribute name="text:count-empty-lines">true</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="@字:起始编号">
+ <xsl:attribute name="style:num-format"><xsl:value-of select="@字:起始编号"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:距边界">
+ <xsl:attribute name="text:offset"><xsl:value-of select="concat(@字:距边界,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="@字:行号间隔">
+ <xsl:attribute name="text:increment"><xsl:value-of select="@字:行号间隔"/></xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="脚注设置">
+ <xsl:element name="text:notes-configuration">
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:脚注设置">
+ <xsl:attribute name="text:note-class">footnote</xsl:attribute>
+ <xsl:attribute name="text:master-page-name">Footnote</xsl:attribute>
+ <xsl:attribute name="text:footnotes-position"><xsl:choose><xsl:when test="@字:位置='page-bottom'">page</xsl:when><xsl:when test="@字:位置='below-text'">document</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="text:start-numbering-at"><xsl:choose><xsl:when test="@字:编号方式='continuous'">document</xsl:when><xsl:when test="@字:编号方式='section'">chapter</xsl:when><xsl:when test="@字:编号方式='page'">page</xsl:when></xsl:choose></xsl:attribute>
+ <xsl:attribute name="text:start-value"><xsl:value-of select="@字:起始编号 - 1"/></xsl:attribute>
+ <xsl:attribute name="style:num-format"><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="@字:格式"/></xsl:call-template></xsl:attribute>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="尾注设置">
+ <xsl:element name="text:notes-configuration">
+ <xsl:for-each select="/uof:UOF/uof:文字处理/字:主体/字:分节/字:节属性/字:尾注设置">
+ <xsl:attribute name="text:note-class">endnote</xsl:attribute>
+ <xsl:attribute name="text:master-page-name">Endnote</xsl:attribute>
+ <xsl:attribute name="style:num-format"><xsl:call-template name="oo数字格式"><xsl:with-param name="oo_format" select="@字:格式"/></xsl:call-template></xsl:attribute>
+ <xsl:attribute name="text:start-value"><xsl:value-of select="@字:起始编号 - 1"/></xsl:attribute>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="paragraph-properties">
+ <xsl:choose>
+ <xsl:when test="descendant::字:页边距[@uof:左]">
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="number((descendant::字:页边距/@uof:左)) * $other-to-cm-conversion-factor"/>cm</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:margin-left">0cm</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="descendant::字:页边距[@uof:右]">
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="number((descendant::字:页边距/@uof:右)) * $other-to-cm-conversion-factor"/>cm</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:margin-right">0cm</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:text-indent">0cm</xsl:attribute>
+ <xsl:call-template name="bidi"/>
+ </xsl:template>
+ <xsl:template name="bidi">
+ </xsl:template>
+ <xsl:template match="字:文字表">
+ <xsl:choose>
+ <xsl:when test="@字:类型 = 'sub-table'">
+ <xsl:element name="table:table">
+ <xsl:attribute name="table:is-sub-table">true</xsl:attribute>
+ <xsl:apply-templates select="字:文字表属性">
+ <xsl:with-param name="sub-table" select="@字:类型"/>
+ </xsl:apply-templates>
+ <xsl:if test="字:行[position()=1]/字:表行属性/字:表头行/@字:值='true'">
+ <xsl:element name="table:table-header-rows">
+ <xsl:for-each select="字:行">
+ <xsl:if test="字:表行属性/字:表头行/@字:值='true'">
+ <xsl:apply-templates select="."/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:for-each select="字:行[not(字:表行属性/字:表头行) or (字:表行属性/字:表头行/@字:值='false')]">
+ <xsl:apply-templates select="."/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="table:table">
+ <xsl:if test="字:文字表属性">
+ <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="not(字:文字表属性/字:列宽集/字:列宽)">
+ <xsl:for-each select="字:行[1]/字:单元格">
+ <xsl:element name="table:table-column">
+ <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number value="count(preceding::字:单元格)+1"/></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:apply-templates select="字:文字表属性"/>
+ <xsl:if test="字:行[position()=1]/字:表行属性/字:表头行/@字:值='true'">
+ <xsl:element name="table:table-header-rows">
+ <xsl:for-each select="字:行">
+ <xsl:if test="字:表行属性/字:表头行/@字:值='true'">
+ <xsl:apply-templates select="."/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ <xsl:for-each select="字:行[not(字:表行属性/字:表头行) or (字:表行属性/字:表头行/@字:值='false')]">
+ <xsl:apply-templates select="."/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:文字表属性">
+ <xsl:param name="sub-table"/>
+ <xsl:apply-templates select="字:列宽集">
+ <xsl:with-param name="sub-table" select="$sub-table"/>
+ </xsl:apply-templates>
+ </xsl:template>
+ <xsl:template match="字:列宽集">
+ <xsl:param name="sub-table"/>
+ <xsl:apply-templates select="字:列宽">
+ <xsl:with-param name="sub-table" select="$sub-table"/>
+ </xsl:apply-templates>
+ </xsl:template>
+ <xsl:template match="字:列宽">
+ <xsl:param name="sub-table"/>
+ <xsl:element name="table:table-column">
+ <xsl:choose>
+ <xsl:when test="$sub-table='sub-table'">
+ <xsl:variable name="subtable-leikuan" select="."/>
+ <xsl:variable name="weizi">
+ <xsl:for-each select="ancestor::*[name()='字:文字表' and not(@字:类型='sub-table')]/字:文字表属性/字:列宽集/字:列宽">
+ <xsl:variable name="yyyyy" select="."/>
+ <xsl:if test="substring(string($yyyyy),1,string-length(string($yyyyy))-1)=substring(string($subtable-leikuan),1,string-length(string($subtable-leikuan))-1)">
+ <xsl:value-of select="concat(position(),';')"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="xxxxx">
+ <xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>
+ </xsl:variable>
+ <xsl:attribute name="table:style-name"><xsl:value-of select="concat('Table',$xxxxx,'.C',substring-before($weizi,';'))"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.C<xsl:number count="字:列宽" from="/uof:UOF/uof:文字处理/字:主体" level="single" format="1"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="字:行">
+ <xsl:element name="table:table-row">
+ <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/></xsl:attribute>
+ <xsl:for-each select="node()">
+ <xsl:choose>
+ <xsl:when test="name()='字:单元格'">
+ <xsl:call-template name="字:单元格"/>
+ </xsl:when>
+ <xsl:when test="name()='字:单元格覆盖'">
+
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="字:单元格">
+ <xsl:element name="table:table-cell">
+ <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/>C<xsl:number count="字:单元格" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]/字:行" level="any" format="1"/></xsl:attribute>
+ <xsl:if test="字:单元格属性">
+ <xsl:apply-templates select="字:单元格属性"/>
+ </xsl:if>
+ <xsl:for-each select="node( )">
+ <xsl:choose>
+ <xsl:when test="name( )='字:段落'">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:when test="name( )='字:文字表'">
+ <xsl:apply-templates select="."/>
+ </xsl:when>
+ <xsl:otherwise>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="字:单元格属性/字:边框">
+ <xsl:apply-templates/>
+ </xsl:template>
+ <xsl:template match="字:对齐[parent::字:文字表属性]">
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template name="字:单元格">
- <xsl:element name="table:table-cell">
- <xsl:attribute name="table:style-name">Table<xsl:number count="字:文字表[not (@字:类型='sub-table')]" from="/uof:UOF/uof:文字处理/字:主体" level="any" format="1"/>.R<xsl:number count="字:行" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]" level="any" format="1"/>C<xsl:number count="字:单元格" from="/uof:UOF/uof:文字处理/字:主体/字:文字表[not (@字:类型='sub-table')]/字:行" level="any" format="1"/></xsl:attribute>
- <xsl:if test="字:单元格属性">
- <xsl:apply-templates select="字:单元格属性"/>
- </xsl:if>
- <xsl:for-each select="node( )">
- <xsl:choose>
- <xsl:when test="name( )='字:段落'">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:when test="name( )='字:文字表'">
- <xsl:apply-templates select="."/>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template match="字:单元格属性/字:边框">
- <xsl:apply-templates/>
- </xsl:template>
- <xsl:template match="字:对齐[parent::字:文字表属性]">
-
- </xsl:template>
- <xsl:template match="uof:上">
- <xsl:choose>
- <xsl:when test="@uof:宽度='nil' ">
- <xsl:attribute name="fo:border-top">none</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:宽度 and @uof:颜色">
- <xsl:attribute name="fo:border-top"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:宽度">
- <xsl:attribute name="fo:border-top"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="uof:下">
- <xsl:choose>
- <xsl:when test="@uof:宽度='nil' ">
- <xsl:attribute name="fo:border-bottom">none</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:宽度 and @uof:颜色">
- <xsl:attribute name="fo:border-bottom"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:宽度">
- <xsl:attribute name="fo:border-bottom"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="uof:左">
- <xsl:choose>
- <xsl:when test="@uof:宽度='nil'">
- <xsl:attribute name="fo:border-left">none</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:宽度 and @uof:颜色">
- <xsl:attribute name="fo:border-left"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:宽度">
- <xsl:attribute name="fo:border-left"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="uof:右">
- <xsl:choose>
- <xsl:when test="@uof:宽度='nil' ">
- <xsl:attribute name="fo:border-right">none</xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:宽度 and @uof:颜色">
- <xsl:attribute name="fo:border-right"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="@uof:宽度">
- <xsl:attribute name="fo:border-right"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:文字表属性/字:边框">
- <xsl:apply-templates/>
- </xsl:template>
- <xsl:template match="字:单元格属性/字:边框">
- <xsl:call-template name="uof:边框"/>
- </xsl:template>
- <xsl:template match="字:左缩进">
- </xsl:template>
- <xsl:template match="字:单元格属性">
- <xsl:if test="字:跨列/@字:值">
- <xsl:attribute name="table:number-columns-spanned"><xsl:value-of select="字:跨列/@字:值"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template name="编号风格">
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="concat('P',@字:标识符)"/></xsl:attribute>
- <xsl:attribute name="style:family">paragraph</xsl:attribute>
- <xsl:attribute name="style:parent-style-name">Standard</xsl:attribute>
- <xsl:attribute name="style:list-style-name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
- <xsl:element name="style:text-properties">
- <xsl:attribute name="fo:margin-left">0cm</xsl:attribute>
- <xsl:attribute name="fo:margin-right">0cm</xsl:attribute>
- <xsl:attribute name="fo:color"><xsl:value-of select="字:级别/字:符号字体/字:字体/字:颜色"/></xsl:attribute>
- <xsl:attribute name="fo:text-indent"/>
- <xsl:attribute name="style:auto-text-indent">false</xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="编号格式">
- <xsl:attribute name="style:num-format"><xsl:choose><xsl:when test="string(字:编号格式)='lower-letter'">a</xsl:when><xsl:when test="string(字:编号格式)='upper-letter'">A</xsl:when><xsl:when test="string(字:编号格式)='lower-roman'">i</xsl:when><xsl:when test="string(字:编号格式)='upper-roman'">I</xsl:when><xsl:when test="string(字:编号格式)='decimal-enclosed-circle'">①, ②, ③, ...</xsl:when><xsl:when test="string(字:编号格式)='ideograph-traditional'">甲, 乙, 丙, ...</xsl:when><xsl:when test="string(字:编号格式)='ideograph-zodiac'">子, 丑, 寅, ...</xsl:when><xsl:when test="string(字:编号格式)='chinese-counting'">一, 二, 三, ...</xsl:when><xsl:when test="string(字:编号格式)='chinese-legal-simplified'">壹, 贰, 叁, ...</xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:template>
- <xsl:template name="图形style">
- <xsl:for-each select="/uof:UOF/uof:对象集/图:图形">
- <xsl:element name="style:style">
- <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
- <xsl:attribute name="style:family">graphic</xsl:attribute>
- <xsl:attribute name="style:parent-style-name">Graphics</xsl:attribute>
- <xsl:element name="style:text-properties">
- <xsl:attribute name="svg:stroke-width"><xsl:value-of select="图:预定义图形/图:属性/图:线粗细"/></xsl:attribute>
- <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
- <xsl:attribute name="draw:stroke-dash"><xsl:value-of select="图:预定义图形/图:属性/图:线型"/></xsl:attribute>
- <xsl:attribute name="draw:marker-start"><xsl:value-of select="图:预定义图形/图:属性/图:前端箭头/图:式样"/></xsl:attribute>
- <xsl:attribute name="draw:marker-end"><xsl:value-of select="图:预定义图形/图:属性/图:后端箭头/图:式样"/></xsl:attribute>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="duanluoshuxing">
- <xsl:for-each select="/uof:UOF/uof:文字处理//字:段落">
- <xsl:choose>
- <xsl:when test="count(字:句)&lt;=1">
- <xsl:call-template name="单个或者没有句"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="多个句"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:template>
- <xsl:template name="单个或者没有句">
- <xsl:variable name="stylename" select="字:段落属性/@字:式样引用"/>
- <xsl:element name="style:style">
- <xsl:attribute name="style:name">P<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落"/></xsl:attribute>
- <xsl:attribute name="style:family">paragraph</xsl:attribute>
- <xsl:if test="name(preceding-sibling::*[1])='字:分节'">
- <xsl:attribute name="style:master-page-name"><xsl:value-of select="preceding-sibling::字:分节[1]/@字:名称"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/@字:式样引用">
- <xsl:variable name="duanluoyinyong">
- <xsl:value-of select="字:段落属性/@字:式样引用"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF//uof:段落式样">
- <xsl:if test="$duanluoyinyong=@字:标识符">
- <xsl:if test="@字:基式样引用">
- <xsl:choose>
- <xsl:when test="@字:标识符=/uof:UOF/uof:文字处理/字:主体/字:段落/字:段落属性/字:格式修订/@字:修订信息引用">
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
- <xsl:variable name="aa">
- <xsl:value-of select="@字:基式样引用"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF//uof:段落式样">
- <xsl:if test="$aa=@字:标识符">
- <xsl:attribute name="style:display-name"><xsl:choose><xsl:when test="@字:别名"><xsl:value-of select="@字:别名"/></xsl:when><xsl:otherwise><xsl:value-of select="@字:名称"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:element name="style:paragraph-properties">
- <xsl:if test="字:对齐">
- <xsl:if test="字:对齐/@字:文字对齐">
- <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:对齐/@字:文字对齐='base'">baseline</xsl:when><xsl:when test="字:对齐/@字:文字对齐='center'">middle</xsl:when><xsl:otherwise><xsl:value-of select="字:对齐/@字:文字对齐"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:对齐/@字:水平对齐">
- <xsl:attribute name="fo:text-align"><xsl:choose><xsl:when test="字:对齐/@字:水平对齐='left'">start</xsl:when><xsl:when test="字:对齐/@字:水平对齐='right'">end</xsl:when><xsl:when test="字:对齐/@字:水平对齐='center'">center</xsl:when><xsl:otherwise>justify</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="字:对齐/@字:水平对齐='distributed'">
- <xsl:attribute name="fo:text-align-last">justify</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style:justify-single-word">false</xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:call-template name="ParagraphAttr"/>
+ </xsl:template>
+ <xsl:template match="uof:上">
+ <xsl:choose>
+ <xsl:when test="@uof:宽度='nil' ">
+ <xsl:attribute name="fo:border-top">none</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:宽度 and @uof:颜色">
+ <xsl:attribute name="fo:border-top"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:宽度">
+ <xsl:attribute name="fo:border-top"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="uof:下">
+ <xsl:choose>
+ <xsl:when test="@uof:宽度='nil' ">
+ <xsl:attribute name="fo:border-bottom">none</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:宽度 and @uof:颜色">
+ <xsl:attribute name="fo:border-bottom"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:宽度">
+ <xsl:attribute name="fo:border-bottom"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="uof:左">
+ <xsl:choose>
+ <xsl:when test="@uof:宽度='nil'">
+ <xsl:attribute name="fo:border-left">none</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:宽度 and @uof:颜色">
+ <xsl:attribute name="fo:border-left"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:宽度">
+ <xsl:attribute name="fo:border-left"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="uof:右">
+ <xsl:choose>
+ <xsl:when test="@uof:宽度='nil' ">
+ <xsl:attribute name="fo:border-right">none</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:宽度 and @uof:颜色">
+ <xsl:attribute name="fo:border-right"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/><xsl:text> </xsl:text><xsl:choose><xsl:when test="@uof:颜色 ='auto'"><xsl:text>solid #000000</xsl:text></xsl:when><xsl:otherwise><xsl:text>solid </xsl:text><xsl:value-of select="@uof:颜色"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="@uof:宽度">
+ <xsl:attribute name="fo:border-right"><xsl:value-of select="concat(number(@uof:宽度),$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:文字表属性/字:边框">
+ <xsl:apply-templates/>
+ </xsl:template>
+ <xsl:template match="字:单元格属性/字:边框">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:template>
+ <xsl:template match="字:左缩进">
+ </xsl:template>
+ <xsl:template match="字:单元格属性">
+ <xsl:if test="字:跨列/@字:值">
+ <xsl:attribute name="table:number-columns-spanned"><xsl:value-of select="字:跨列/@字:值"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="编号风格">
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="concat('P',@字:标识符)"/></xsl:attribute>
+ <xsl:attribute name="style:family">paragraph</xsl:attribute>
+ <xsl:attribute name="style:parent-style-name">Standard</xsl:attribute>
+ <xsl:attribute name="style:list-style-name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
+ <xsl:element name="style:text-properties">
+ <xsl:attribute name="fo:margin-left">0cm</xsl:attribute>
+ <xsl:attribute name="fo:margin-right">0cm</xsl:attribute>
+ <xsl:attribute name="fo:color"><xsl:value-of select="字:级别/字:符号字体/字:字体/字:颜色"/></xsl:attribute>
+ <xsl:attribute name="fo:text-indent"/>
+ <xsl:attribute name="style:auto-text-indent">false</xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="编号格式">
+ <xsl:attribute name="style:num-format"><xsl:choose><xsl:when test="string(字:编号格式)='lower-letter'">a</xsl:when><xsl:when test="string(字:编号格式)='upper-letter'">A</xsl:when><xsl:when test="string(字:编号格式)='lower-roman'">i</xsl:when><xsl:when test="string(字:编号格式)='upper-roman'">I</xsl:when><xsl:when test="string(字:编号格式)='decimal-enclosed-circle'">①, ②, ③, ...</xsl:when><xsl:when test="string(字:编号格式)='ideograph-traditional'">甲, 乙, 丙, ...</xsl:when><xsl:when test="string(字:编号格式)='ideograph-zodiac'">子, 丑, 寅, ...</xsl:when><xsl:when test="string(字:编号格式)='chinese-counting'">一, 二, 三, ...</xsl:when><xsl:when test="string(字:编号格式)='chinese-legal-simplified'">壹, 贰, 叁, ...</xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:template>
+ <xsl:template name="图形style">
+ <xsl:for-each select="/uof:UOF/uof:对象集/图:图形">
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name"><xsl:value-of select="@图:标识符"/></xsl:attribute>
+ <xsl:attribute name="style:family">graphic</xsl:attribute>
+ <xsl:attribute name="style:parent-style-name">Graphics</xsl:attribute>
+ <xsl:element name="style:text-properties">
+ <xsl:attribute name="svg:stroke-width"><xsl:value-of select="图:预定义图形/图:属性/图:线粗细"/></xsl:attribute>
+ <xsl:attribute name="svg:stroke-color"><xsl:value-of select="图:预定义图形/图:属性/图:线颜色"/></xsl:attribute>
+ <xsl:attribute name="draw:stroke-dash"><xsl:value-of select="图:预定义图形/图:属性/图:线型"/></xsl:attribute>
+ <xsl:attribute name="draw:marker-start"><xsl:value-of select="图:预定义图形/图:属性/图:前端箭头/图:式样"/></xsl:attribute>
+ <xsl:attribute name="draw:marker-end"><xsl:value-of select="图:预定义图形/图:属性/图:后端箭头/图:式样"/></xsl:attribute>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="duanluoshuxing">
+ <xsl:for-each select="/uof:UOF/uof:文字处理//字:段落">
+ <xsl:choose>
+ <xsl:when test="count(字:句)&lt;=1">
+ <xsl:call-template name="单个或者没有句"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="多个句"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:template>
+ <xsl:template name="单个或者没有句">
+ <xsl:variable name="stylename" select="字:段落属性/@字:式样引用"/>
+ <xsl:element name="style:style">
+ <xsl:attribute name="style:name">P<xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落"/></xsl:attribute>
+ <xsl:attribute name="style:family">paragraph</xsl:attribute>
+ <xsl:if test="name(preceding-sibling::*[1])='字:分节'">
+ <xsl:attribute name="style:master-page-name"><xsl:value-of select="preceding-sibling::字:分节[1]/@字:名称"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/@字:式样引用">
+ <xsl:variable name="duanluoyinyong">
+ <xsl:value-of select="字:段落属性/@字:式样引用"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF//uof:段落式样">
+ <xsl:if test="$duanluoyinyong=@字:标识符">
+ <xsl:if test="@字:基式样引用">
+ <xsl:choose>
+ <xsl:when test="@字:标识符=/uof:UOF/uof:文字处理/字:主体/字:段落/字:段落属性/字:格式修订/@字:修订信息引用">
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:标识符"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style:parent-style-name"><xsl:value-of select="@字:基式样引用"/></xsl:attribute>
+ <xsl:variable name="aa">
+ <xsl:value-of select="@字:基式样引用"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF//uof:段落式样">
+ <xsl:if test="$aa=@字:标识符">
+ <xsl:attribute name="style:display-name"><xsl:choose><xsl:when test="@字:别名"><xsl:value-of select="@字:别名"/></xsl:when><xsl:otherwise><xsl:value-of select="@字:名称"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:element name="style:paragraph-properties">
+ <xsl:if test="字:对齐">
+ <xsl:if test="字:对齐/@字:文字对齐">
+ <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:对齐/@字:文字对齐='base'">baseline</xsl:when><xsl:when test="字:对齐/@字:文字对齐='center'">middle</xsl:when><xsl:otherwise><xsl:value-of select="字:对齐/@字:文字对齐"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:对齐/@字:水平对齐">
+ <xsl:attribute name="fo:text-align"><xsl:choose><xsl:when test="字:对齐/@字:水平对齐='left'">start</xsl:when><xsl:when test="字:对齐/@字:水平对齐='right'">end</xsl:when><xsl:when test="字:对齐/@字:水平对齐='center'">center</xsl:when><xsl:otherwise>justify</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="字:对齐/@字:水平对齐='distributed'">
+ <xsl:attribute name="fo:text-align-last">justify</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style:justify-single-word">false</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:call-template name="ParagraphAttr"/>
<xsl:if test="字:段落属性/字:制表位设置">
<xsl:call-template name="ootab"/>
</xsl:if>
- </xsl:element>
- <xsl:if test="字:句属性">
- <xsl:variable name="bsh">
- <xsl:value-of select="字:句属性/@字:式样引用"/>
- </xsl:variable>
- <xsl:element name="style:text-properties">
- <xsl:for-each select="/uof:UOF//uof:句式样">
- <xsl:if test="$bsh=@字:标识符">
- <xsl:apply-templates select="./*"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:element>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="字:边框">
- <xsl:call-template name="uof:边框"/>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:if>
- <xsl:element name="style:text-properties">
- <xsl:if test="字:句/字:句属性/字:字体">
- <xsl:variable name="ziti">
- <xsl:value-of select="字:句/字:句属性/字:字体/@字:中文字体引用"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:字体集/uof:字体声明">
- <xsl:if test="@uof:标识符=$ziti">
- <xsl:attribute name="style:font-name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
- <xsl:attribute name="style:font-name-asian"><xsl:value-of select="@uof:名称"/></xsl:attribute>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="字:句/字:句属性/字:字体/@字:字号">
- <xsl:attribute name="fo:font-size"><xsl:value-of select="字:句/字:句属性/字:字体/@字:字号"/></xsl:attribute>
- <xsl:attribute name="style:font-size-asian"><xsl:value-of select="字:句/字:句属性/字:字体/@字:字号"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="字:段落属性/字:句属性">
- <xsl:for-each select="字:段落属性/字:句属性">
- <xsl:apply-templates select="./*"/>
- </xsl:for-each>
- </xsl:if>
- <xsl:apply-templates select="字:句/字:句属性/字:浮雕 | 字:句/字:句属性/字:边框 | 字:句/字:句属性/字:缩放 | 字:句/字:句属性/字:阴影 | 字:句/字:句属性/字:删除线 | 字:句/字:句属性/字:下划线 | 字:句/字:填充"/>
- <xsl:call-template name="ParagraphAttr"/>
+ </xsl:element>
+ <xsl:if test="字:句属性">
+ <xsl:variable name="bsh">
+ <xsl:value-of select="字:句属性/@字:式样引用"/>
+ </xsl:variable>
+ <xsl:element name="style:text-properties">
+ <xsl:for-each select="/uof:UOF//uof:句式样">
+ <xsl:if test="$bsh=@字:标识符">
+ <xsl:apply-templates select="./*"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="字:边框">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:element name="style:text-properties">
+ <xsl:if test="字:句/字:句属性/字:字体">
+ <xsl:variable name="ziti">
+ <xsl:value-of select="字:句/字:句属性/字:字体/@字:中文字体引用"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:字体集/uof:字体声明">
+ <xsl:if test="@uof:标识符=$ziti">
+ <xsl:attribute name="style:font-name"><xsl:value-of select="@uof:名称"/></xsl:attribute>
+ <xsl:attribute name="style:font-name-asian"><xsl:value-of select="@uof:名称"/></xsl:attribute>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:if test="字:句/字:句属性/字:字体/@字:字号">
+ <xsl:attribute name="fo:font-size"><xsl:value-of select="字:句/字:句属性/字:字体/@字:字号"/></xsl:attribute>
+ <xsl:attribute name="style:font-size-asian"><xsl:value-of select="字:句/字:句属性/字:字体/@字:字号"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:句属性">
+ <xsl:for-each select="字:段落属性/字:句属性">
+ <xsl:apply-templates select="./*"/>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:apply-templates select="字:句/字:句属性/字:浮雕 | 字:句/字:句属性/字:边框 | 字:句/字:句属性/字:缩放 | 字:句/字:句属性/字:阴影 | 字:句/字:句属性/字:删除线 | 字:句/字:句属性/字:下划线 | 字:句/字:填充"/>
+ <xsl:call-template name="ParagraphAttr"/>
<xsl:if test="字:段落属性/字:制表位设置">
<xsl:call-template name="ootab"/>
- </xsl:if>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样[@字:标识符=$stylename]">
- <xsl:apply-templates select="./*"/>
- </xsl:for-each>
- </xsl:element>
- <style:paragraph-properties>
- <xsl:if test="字:句/字:分栏符">
- <xsl:attribute name="fo:break-before">column</xsl:attribute>
- </xsl:if>
- <xsl:if test="字:句/字:分页符">
- <xsl:attribute name="fo:break-before">page</xsl:attribute>
- </xsl:if>
- <xsl:call-template name="ParagraphAttr"/>
+ </xsl:if>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样[@字:标识符=$stylename]">
+ <xsl:apply-templates select="./*"/>
+ </xsl:for-each>
+ </xsl:element>
+ <style:paragraph-properties>
+ <xsl:if test="字:句/字:分栏符">
+ <xsl:attribute name="fo:break-before">column</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:句/字:分页符">
+ <xsl:attribute name="fo:break-before">page</xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="ParagraphAttr"/>
<xsl:if test="字:段落属性/字:制表位设置">
<xsl:call-template name="ootab"/>
</xsl:if>
- </style:paragraph-properties>
- </xsl:element>
- </xsl:template>
- <xsl:template name="ParagraphAttr">
- <xsl:apply-templates select="字:段落属性/字:填充"/>
- <xsl:if test="字:段落属性/字:对齐">
- <xsl:if test="字:段落属性/字:对齐/@字:文字对齐">
- <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:段落属性/字:对齐/@字:文字对齐='base'">baseline</xsl:when><xsl:when test="字:段落属性/字:对齐/@字:文字对齐='center'">middle</xsl:when><xsl:otherwise><xsl:value-of select="字:段落属性/字:对齐/@字:文字对齐"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:对齐/@字:水平对齐">
- <xsl:attribute name="fo:text-align"><xsl:choose><xsl:when test="字:段落属性/字:对齐/@字:水平对齐='left'">start</xsl:when><xsl:when test="字:段落属性/字:对齐/@字:水平对齐='right'">end</xsl:when><xsl:when test="字:段落属性/字:对齐/@字:水平对齐='center'">center</xsl:when><xsl:otherwise>justify</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="字:段落属性/字:对齐/@字:水平对齐='distributed'">
- <xsl:attribute name="fo:text-align-last">justify</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style:justify-single-word">false</xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="字:段落属性/字:缩进">
- <xsl:variable name="a1">
- <xsl:value-of select="字:段落属性/字:缩进/字:左/字:相对/@字:值"/>
- </xsl:variable>
- <xsl:variable name="a2">
- <xsl:value-of select="字:段落属性/字:缩进/字:右/字:相对/@字:值"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="字:段落属性/字:缩进/字:左/字:相对 or 字:段落属性/字:缩进/字:右/字:相对">
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat($a1 * 0.37,'cm')"/></xsl:attribute>
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat($a2 * 0.37,'cm')"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:段落属性/字:缩进/字:左/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:段落属性/字:缩进/字:右/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:attribute name="fo:text-indent"><xsl:value-of select="concat(字:段落属性/字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进">
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进/字:左/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进/字:右/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:text-indent"><xsl:value-of select="concat(ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- <xsl:if test="字:段落属性/字:行距">
- <xsl:variable name="type">
- <xsl:value-of select="字:段落属性/字:行距/@字:类型"/>
- </xsl:variable>
- <xsl:variable name="val">
- <xsl:value-of select="字:段落属性/字:行距/@字:值"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$type='fixed'">
- <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$type='multi-lines'">
- <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val * 100,'%')"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$type='at-least'">
- <xsl:attribute name="style:line-height-at-least"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$type='line-space'">
- <xsl:attribute name="style:line-spacing"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="字:段落属性/字:段间距">
- <xsl:if test="字:段落属性/字:段间距/字:段前距/字:绝对值/@字:值">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:段落属性/字:段间距/字:段前距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:段间距/字:段后距/字:绝对值/@字:值">
- <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:段落属性/字:段间距/字:段后距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:variable name="aa">
- <xsl:value-of select="字:段落属性/字:段间距/字:段前距/字:相对值/@字:值"/>
- </xsl:variable>
- <xsl:variable name="bb">
- <xsl:value-of select="字:段落属性/字:段间距/字:段后距/字:相对值/@字:值"/>
- </xsl:variable>
- <xsl:if test="字:段落属性/字:段间距/字:段前距/字:相对值/@字:值">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat($aa * 15.6,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:段间距/字:段后距/字:相对值/@字:值">
- <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat($bb * 15.6,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="字:段落属性/字:孤行控制">
- <xsl:attribute name="fo:widows"><xsl:value-of select="字:段落属性/字:孤行控制"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:寡行控制">
- <xsl:attribute name="fo:orphans"><xsl:value-of select="字:段落属性/字:寡行控制"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:段中不分页">
- <xsl:attribute name="fo:keep-together"><xsl:choose><xsl:when test="字:段落属性/字:段中不分页/@字:值='1' or 字:段落属性/字:段中不分页/@字:值='true'">always</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:与下段同页">
- <xsl:attribute name="fo:keep-with-next"><xsl:choose><xsl:when test="字:段落属性/字:与下段同页/@字:值='1' or 字:段落属性/字:与下段同页/@字:值='true'">always</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:for-each select="字:段落属性/字:边框">
- <xsl:call-template name="uof:边框"/>
- </xsl:for-each>
- <xsl:for-each select="字:段落属性/字:填充">
- <xsl:call-template name="uof:填充"/>
- </xsl:for-each>
- <xsl:if test="字:段落属性/字:对齐网格">
- <xsl:attribute name="style:snap-to-layout-grid"><xsl:choose><xsl:when test="字:段落属性/字:对齐网格/@字:值='1' or 字:段落属性/字:对齐网格/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:取消断字">
- <xsl:attribute name="fo:hyphenation-ladder-count">no-limit</xsl:attribute>
- <xsl:attribute name="fo:hyphenation-remain-char-count">2</xsl:attribute>
- <xsl:attribute name="fo:hyphenation-push-char-count">2</xsl:attribute>
- <xsl:attribute name="fo:hyphenate"><xsl:choose><xsl:when test="字:段落属性/字:取消断字/@字:值='1' or 字:段落属性/字:取消断字/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:取消行号">
- <xsl:attribute name="text:number-lines"><xsl:choose><xsl:when test="字:段落属性/字:取消行号/@字:值='1' or 字:段落属性/字:取消行号/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:行首尾标点控制">
- <xsl:attribute name="style:punctuation-wrap"><xsl:choose><xsl:when test="字:段落属性/字:行首尾标点控制/@字:值='1' or 字:段落属性/字:行首尾标点控制/@字:值='true'">hanging</xsl:when><xsl:otherwise>simple</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:是否行首标点压缩/@字:值='true'">
- <xsl:attribute name="style:punctuation-compress">false</xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:中文习惯首尾字符">
- <xsl:attribute name="style:line-break"><xsl:choose><xsl:when test="字:段落属性/字:中文习惯首尾字符/@字:值='1' or 字:段落属性/字:中文习惯首尾字符/@字:值='true'">strict</xsl:when><xsl:otherwise>normal</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:自动调整中英文字符间距 or 字:段落属性/字:自动调整中文与数字间距">
- <xsl:attribute name="style:text-autospace"><xsl:choose><xsl:when test="字:段落属性/字:自动调整中英文字符间距/@字:值='1' or 字:段落属性/字:自动调整中文与数字间距/@字:值='1'or 字:段落属性/字:自动调整中英文字符间距/@字:值='true' or 字:段落属性/字:自动调整中文与数字间距/@字:值='true'">ideograph-alpha</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:首字下沉">
- <xsl:element name="style:drop-cap">
- <xsl:if test="字:段落属性/字:首字下沉/@字:行数">
- <xsl:attribute name="style:lines"><xsl:value-of select="字:段落属性/字:首字下沉/@字:行数"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:首字下沉/@字:间距">
- <xsl:attribute name="style:distance"><xsl:value-of select="concat(字:段落属性/字:首字下沉/@字:间距,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:首字下沉/@字:字体引用">
- <xsl:attribute name="style:style-name"><xsl:value-of select="translate(字:段落属性/字:首字下沉/@字:字体引用,'_',' ')"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段落属性/字:首字下沉/@字:字符数">
- <xsl:attribute name="style:length"><xsl:choose><xsl:when test="字:段落属性/字:首字下沉/@字:字符数='1'">word</xsl:when><xsl:otherwise><xsl:value-of select="字:段落属性/字:首字下沉/@字:字符数"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="XDParagraphAttr">
- <xsl:apply-templates select="字:填充"/>
- <xsl:if test="字:对齐">
- <xsl:if test="字:对齐/@字:文字对齐">
- <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:对齐/@字:文字对齐='base'">baseline</xsl:when><xsl:when test="字:对齐/@字:文字对齐='center'">middle</xsl:when><xsl:otherwise><xsl:value-of select="字:对齐/@字:文字对齐"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:对齐/@字:水平对齐">
- <xsl:attribute name="fo:text-align"><xsl:choose><xsl:when test="字:对齐/@字:水平对齐='left'">start</xsl:when><xsl:when test="字:对齐/@字:水平对齐='right'">end</xsl:when><xsl:when test="字:对齐/@字:水平对齐='center'">center</xsl:when><xsl:otherwise>justify</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="字:对齐/@字:水平对齐='distributed'">
- <xsl:attribute name="fo:text-align-last">justify</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style:justify-single-word">false</xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="字:缩进">
- <xsl:if test="字:缩进/字:左/字:绝对/@字:值">
- <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:缩进/字:左/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:缩进/字:右/字:绝对/@字:值">
- <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:缩进/字:右/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:缩进/字:首行/字:绝对/@字:值">
- <xsl:attribute name="fo:text-indent"><xsl:value-of select="concat(字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="字:行距">
- <xsl:variable name="type">
- <xsl:value-of select="字:行距/@字:类型"/>
- </xsl:variable>
- <xsl:variable name="val">
- <xsl:value-of select="字:行距/@字:值"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$type='fixed'">
- <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$type='multi-lines'">
- <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val * 100,'%')"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$type='at-least'">
- <xsl:attribute name="style:line-height-at-least"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="$type='line-space'">
- <xsl:attribute name="style:line-spacing"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="字:段间距">
- <xsl:if test="字:段间距/字:段前距/字:绝对值/@字:值">
- <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:段间距/字:段前距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段间距/字:段后距/字:绝对值/@字:值">
- <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:段间距/字:段后距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="字:孤行控制">
- <xsl:attribute name="fo:orphans"><xsl:value-of select="字:孤行控制"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:寡行控制">
- <xsl:attribute name="fo:widows"><xsl:value-of select="字:寡行控制"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:段中不分页">
- <xsl:attribute name="fo:keep-together"><xsl:choose><xsl:when test="字:段中不分页/@字:值='1' or 字:段中不分页/@字:值='true'">always</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:与下段同页">
- <xsl:attribute name="fo:keep-with-next"><xsl:choose><xsl:when test="字:与下段同页/@字:值='1' or 字:与下段同页/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:for-each select="字:边框">
- <xsl:call-template name="uof:边框"/>
- </xsl:for-each>
- <xsl:for-each select="字:填充">
- <xsl:call-template name="uof:填充"/>
- </xsl:for-each>
- <xsl:if test="字:对齐网格">
- <xsl:attribute name="style:snap-to-layout-grid"><xsl:choose><xsl:when test="字:对齐网格/@字:值='1' or 字:对齐网格/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:取消断字">
- <xsl:attribute name="fo:hyphenation-ladder-count">no-limit</xsl:attribute>
- <xsl:attribute name="fo:hyphenation-remain-char-count">2</xsl:attribute>
- <xsl:attribute name="fo:hyphenation-push-char-count">2</xsl:attribute>
- <xsl:attribute name="fo:hyphenate"><xsl:choose><xsl:when test="字:取消断字/@字:值='1' or 字:取消断字/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:取消行号">
- <xsl:attribute name="text:number-lines"><xsl:choose><xsl:when test="字:取消行号/@字:值='1' or 字:取消行号/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:行首尾标点控制">
- <xsl:attribute name="style:punctuation-wrap"><xsl:choose><xsl:when test="字:行首尾标点控制/@字:值='1' or 字:行首尾标点控制/@字:值='true'">hanging</xsl:when><xsl:otherwise>simple</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:是否行首标点压缩/@字:值='true'">
- <xsl:attribute name="style:punctuation-compress">false</xsl:attribute>
- </xsl:if>
- <xsl:if test="字:中文习惯首尾字符">
- <xsl:attribute name="style:line-break"><xsl:choose><xsl:when test="字:中文习惯首尾字符/@字:值='1' or 字:中文习惯首尾字符/@字:值='true'">strict</xsl:when><xsl:otherwise>normal</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:自动调整中英文字符间距 or 字:自动调整中文与数字间距">
- <xsl:attribute name="style:text-autospace"><xsl:choose><xsl:when test="字:自动调整中英文字符间距/@字:值='1' or 字:自动调整中文与数字间距/@字:值='1'or 字:自动调整中英文字符间距/@字:值='true' or 字:自动调整中文与数字间距/@字:值='true'">ideograph-alpha</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:首字下沉">
- <xsl:element name="style:drop-cap">
- <xsl:if test="字:首字下沉/@字:行数">
- <xsl:attribute name="style:lines"><xsl:value-of select="字:首字下沉/@字:行数"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:首字下沉/@字:间距">
- <xsl:attribute name="style:distance"><xsl:value-of select="concat(字:首字下沉/@字:间距,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:首字下沉/@字:字体引用">
- <xsl:attribute name="style:style-name"><xsl:value-of select="字:首字下沉/@字:字体引用"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:首字下沉/@字:字符数">
- <xsl:attribute name="style:length"><xsl:choose><xsl:when test="字:首字下沉/@字:字符数='1'">word</xsl:when><xsl:otherwise><xsl:value-of select="字:首字下沉/@字:字符数"/></xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="多个句">
- <xsl:call-template name="单个或者没有句"/>
- </xsl:template>
- <xsl:template name="jibianhao">
- <xsl:param name="biaoshifu"/>
- <xsl:element name="text:list-level-style-number">
- <xsl:variable name="currlevel" select="number(@字:级别值) + 1"/>
- <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
- <xsl:attribute name="text:style-name">Numbering Symbols</xsl:attribute>
- <xsl:if test="@字:尾随字符">
- <xsl:attribute name="style:num-suffix"><xsl:choose><xsl:when test="@字:尾随字符='space'"><xsl:value-of select="' ' "/></xsl:when><xsl:when test="@字:尾随字符='tab'"><xsl:value-of select="' '"/></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:符号字体">
- <xsl:variable name="Font-ID">
- <xsl:value-of select="字:符号字体/@字:式样引用"/>
- </xsl:variable>
- <xsl:attribute name="text:style-name"><xsl:value-of select="$Font-ID"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:起始编号">
- <xsl:attribute name="text:start-value"><xsl:value-of select="字:起始编号"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:正规格式">
- <xsl:attribute name="text:num-regular-exp"><xsl:value-of select="字:正规格式/@值"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="text:display-levels"><xsl:value-of select="string-length(字:编号格式表示) - string-length(translate(字:编号格式表示,'%','') )"/></xsl:attribute>
- <xsl:if test="字:编号格式">
- <xsl:call-template name="编号格式"/>
- </xsl:if>
- <xsl:if test="字:编号格式表示">
- <xsl:variable name="last" select="substring-after(字:编号格式表示,concat('%',$currlevel))"/>
- <xsl:variable name="first">
- <xsl:variable name="aa" select="substring-before(字:编号格式表示,concat('%',$currlevel))"/>
- <xsl:choose>
- <xsl:when test="not(substring-after($aa,'%'))">
- <xsl:value-of select="$aa"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="$first!=''">
- <xsl:attribute name="style:num-prefix"><xsl:value-of select="$first"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="$last!=''">
- <xsl:attribute name="style:num-suffix"><xsl:value-of select="$last"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="bianhaogeshi">
- <xsl:with-param name="biaoshi">
- <xsl:value-of select="字:编号格式表示"/>
- </xsl:with-param>
- <xsl:with-param name="jibie">
- <xsl:value-of select="1"/>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:if>
- <xsl:element name="style:text-properties">
- <xsl:call-template name="suojinleixing"/>
- <xsl:if test="@字:编号对齐方式">
- <xsl:attribute name="fo:text-align"><xsl:variable name="aa"><xsl:value-of select="@字:编号对齐方式"/></xsl:variable><xsl:choose><xsl:when test="$aa='center' ">center</xsl:when><xsl:when test="$aa='right' ">end</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:if test="字:符号字体">
- <xsl:if test="字:符号字体/@字:式样引用">
- <xsl:variable name="Font-ID">
- <xsl:value-of select="字:符号字体/@字:式样引用"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
- <xsl:if test="@字:标识符=$Font-ID">
- <xsl:if test="字:字体/@字:中文字体引用">
- <xsl:attribute name="fo:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:if>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="bianhaogeshi">
- <xsl:param name="biaoshi"/>
- <xsl:param name="jibie"/>
- <xsl:variable name="bb">
- <xsl:value-of select="substring-after($biaoshi,'%')"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="substring-after($bb,'%')">
- <xsl:call-template name="bianhaogeshi">
- <xsl:with-param name="biaoshi" select="$bb"/>
- <xsl:with-param name="jibie" select="$jibie +1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="not($jibie=1)">
- <xsl:attribute name="text:display-levels"><xsl:value-of select="$jibie"/></xsl:attribute>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="xiangmufuhao">
- <xsl:param name="biaoshifu"/>
- <xsl:variable name="currlevel" select="number(@字:级别值) + 1"/>
- <xsl:element name="text:list-level-style-bullet">
- <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
- <xsl:attribute name="text:style-name"><xsl:value-of select="../@字:名称"/></xsl:attribute>
- <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,'%1')"/></xsl:attribute>
- <xsl:attribute name="text:bullet-char"><xsl:value-of select="字:项目符号"/></xsl:attribute>
- <xsl:element name="style:text-properties">
- <xsl:if test="字:符号字体">
- <xsl:variable name="Font-ID">
- <xsl:value-of select="字:符号字体/@字:式样引用"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
- <xsl:if test="@字:标识符=$Font-ID">
- <xsl:if test="字:字体/@字:中文字体引用">
- <xsl:attribute name="svg:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="字:项目符号">
- <xsl:attribute name="fo:font-family"><xsl:value-of select="'WingDings'"/></xsl:attribute>
- </xsl:if>
- <xsl:call-template name="suojinleixing"/>
- <xsl:if test="@字:编号对齐方式">
- <xsl:attribute name="fo:text-align"><xsl:variable name="aa"><xsl:value-of select="@字:编号对齐方式"/></xsl:variable><xsl:choose><xsl:when test="$aa='center' ">center</xsl:when><xsl:when test="$aa='right' ">end</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="imagefuhao">
- <xsl:param name="biaoshifu"/>
- <xsl:variable name="currlevel" select="number(@字:级别值) + 1"/>
- <xsl:element name="text:list-level-style-image" style:vertical-pos="middle" style:vertical-rel="line" fo:width="0.265cm" fo:height="0.265cm">
- <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat( $biaoshifu,$currlevel)"/></xsl:attribute>
- <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,'%1')"/></xsl:attribute>
- <xsl:if test="字:图片符号引用">
- <xsl:variable name="gid">
- <xsl:value-of select="字:图片符号引用"/>
- </xsl:variable>
- <xsl:element name="office:binary-data">
- <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据"/>
- </xsl:element>
- </xsl:if>
- <xsl:element name="style:list-level-properties">
- <xsl:attribute name="style:vertical-pos">middle</xsl:attribute>
- <xsl:attribute name="style:vertical-rel">line</xsl:attribute>
- <xsl:attribute name="fo:width"><xsl:value-of select="concat(字:图片符号引用/@字:宽度,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="fo:height"><xsl:value-of select="concat(字:图片符号引用/@字:高度,$uofUnit)"/></xsl:attribute>
- <xsl:if test="字:符号字体">
- <xsl:variable name="Font-ID">
- <xsl:value-of select="字:符号字体/@字:式样引用"/>
- </xsl:variable>
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
- <xsl:if test="@字:标识符=$Font-ID">
- <xsl:if test="字:字体/@字:中文字体引用">
- <xsl:attribute name="svg:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:if>
- <xsl:call-template name="suojinleixing"/>
- <xsl:if test="@字:编号对齐方式">
- <xsl:attribute name="fo:text-align"><xsl:variable name="aa"><xsl:value-of select="@字:编号对齐方式"/></xsl:variable><xsl:choose><xsl:when test="$aa='center' ">center</xsl:when><xsl:when test="$aa='right' ">end</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="ootab">
- <xsl:element name="style:tab-stops">
- <xsl:for-each select="字:段落属性/字:制表位设置/字:制表位 | 字:制表位设置/字:制表位">
- <xsl:element name="style:tab-stop">
- <xsl:attribute name="style:position"><xsl:value-of select="concat(@字:位置,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="style:type"><xsl:choose><xsl:when test="@字:类型='decimal'">char</xsl:when><xsl:when test="@字:类型='left' or @字:类型='right' or @字:类型='center'"><xsl:value-of select="@字:类型"/></xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute>
- <xsl:if test="@字:制表位字符">
- <xsl:attribute name="style:leader-text"><xsl:value-of select="@字:制表位字符"/></xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style:leader-style"><xsl:value-of select="@字:前导符"/></xsl:attribute>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
- <xsl:template match="字:段落[字:段落属性[字:自动编号信息]]">
- <xsl:call-template name="编号解析">
- </xsl:call-template>
- </xsl:template>
- <xsl:template name="编号解析">
- <xsl:variable name="bianhao">
- <xsl:value-of select="字:段落属性/字:自动编号信息/@字:编号引用"/>
- </xsl:variable>
- <xsl:variable name="bianhaojibie">
- <xsl:value-of select="字:段落属性/字:自动编号信息/@字:编号级别"/>
- </xsl:variable>
- <xsl:variable name="isxiangmuorisimage">
- <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号">
- <xsl:choose>
- <xsl:when test="$bianhao=@字:标识符">
- <xsl:choose>
- <xsl:when test="字:级别[@字:级别值= (number($bianhaojibie))]/字:项目符号">true</xsl:when>
- <xsl:when test="字:级别[@字:级别值= (number($bianhaojibie))]/字:图片符号引用">true</xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>false</xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$isxiangmuorisimage='true'">
- <xsl:call-template name="无序"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="有序"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="有序">
- <xsl:variable name="currlistid" select="字:段落属性/字:自动编号信息/@字:编号引用"/>
- <xsl:variable name="currlistlvl" select="字:段落属性/字:自动编号信息/@字:编号级别 + 1"/>
- <xsl:variable name="firstoccur" select="/descendant::字:段落属性[字:自动编号信息/@字:编号引用 = $currlistid][1]"/>
- <xsl:element name="text:list">
- <xsl:attribute name="text:style-name">List<xsl:value-of select="count($firstoccur/preceding::字:自动编号信息)"/></xsl:attribute>
- <xsl:attribute name="text:continue-numbering"><xsl:choose><xsl:when test="字:段落属性/字:自动编号信息/@字:重新编号='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:if test="字:段落属性/字:自动编号信息/@字:重新编号">
- <xsl:attribute name="text:continue-numbering"><xsl:choose><xsl:when test="字:段落属性/字:自动编号信息/@字:重新编号='1'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:element name="text:list-item">
- <xsl:call-template name="ordered-levels">
- <xsl:with-param name="level" select="$currlistlvl - 1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="ordered-levels">
- <xsl:param name="level"/>
- <xsl:choose>
- <xsl:when test="$level = '0'">
- <xsl:call-template name="commonParagraph"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="text:list">
- <xsl:element name="text:list-item">
- <xsl:call-template name="ordered-levels">
- <xsl:with-param name="level" select="$level - 1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="无序">
- <xsl:variable name="currlistid" select="字:段落属性/字:自动编号信息/@字:编号引用"/>
- <xsl:variable name="currlistlvl" select="字:段落属性/字:自动编号信息/@字:编号级别 + 1"/>
- <xsl:variable name="firstoccur" select="/descendant::字:段落属性[字:自动编号信息/@字:编号引用 = $currlistid][1]"/>
- <xsl:element name="text:list">
- <xsl:attribute name="text:style-name">List<xsl:value-of select="count($firstoccur/preceding::字:自动编号信息)"/></xsl:attribute>
- <xsl:element name="text:list-item">
- <xsl:call-template name="unordered-levels">
- <xsl:with-param name="level" select="$currlistlvl - 1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:template>
- <xsl:template name="unordered-levels">
- <xsl:param name="level"/>
- <xsl:choose>
- <xsl:when test="$level = '0'">
- <xsl:call-template name="commonParagraph"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="text:list">
- <xsl:element name="text:list-item">
- <xsl:call-template name="unordered-levels">
- <xsl:with-param name="level" select="$level - 1"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- measure_conversion.xsl Begin-->
- <xsl:param name="dpi" select="111"/>
- <xsl:param name="centimeter-in-mm" select="10"/>
- <xsl:param name="inch-in-mm" select="25.4"/>
- <xsl:param name="didot-point-in-mm" select="0.376065"/>
- <xsl:param name="pica-in-mm" select="4.2333333"/>
- <xsl:param name="point-in-mm" select="0.3527778"/>
- <xsl:param name="twip-in-mm" select="0.017636684"/>
- <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
- <!-- ***** MEASUREMENT CONVERSIONS *****
- PARAM 'value'
- The measure to be converted.
- The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
- directly added to the number.
+ </style:paragraph-properties>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="ParagraphAttr">
+ <xsl:apply-templates select="字:段落属性/字:填充"/>
+ <xsl:if test="字:段落属性/字:对齐">
+ <xsl:if test="字:段落属性/字:对齐/@字:文字对齐">
+ <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:段落属性/字:对齐/@字:文字对齐='base'">baseline</xsl:when><xsl:when test="字:段落属性/字:对齐/@字:文字对齐='center'">middle</xsl:when><xsl:otherwise><xsl:value-of select="字:段落属性/字:对齐/@字:文字对齐"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:对齐/@字:水平对齐">
+ <xsl:attribute name="fo:text-align"><xsl:choose><xsl:when test="字:段落属性/字:对齐/@字:水平对齐='left'">start</xsl:when><xsl:when test="字:段落属性/字:对齐/@字:水平对齐='right'">end</xsl:when><xsl:when test="字:段落属性/字:对齐/@字:水平对齐='center'">center</xsl:when><xsl:otherwise>justify</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="字:段落属性/字:对齐/@字:水平对齐='distributed'">
+ <xsl:attribute name="fo:text-align-last">justify</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style:justify-single-word">false</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="字:段落属性/字:缩进">
+ <xsl:variable name="a1">
+ <xsl:value-of select="字:段落属性/字:缩进/字:左/字:相对/@字:值"/>
+ </xsl:variable>
+ <xsl:variable name="a2">
+ <xsl:value-of select="字:段落属性/字:缩进/字:右/字:相对/@字:值"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="字:段落属性/字:缩进/字:左/字:相对 or 字:段落属性/字:缩进/字:右/字:相对">
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat($a1 * 0.37,'cm')"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat($a2 * 0.37,'cm')"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:段落属性/字:缩进/字:左/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:段落属性/字:缩进/字:右/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:attribute name="fo:text-indent"><xsl:value-of select="concat(字:段落属性/字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进">
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进/字:左/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进/字:右/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:text-indent"><xsl:value-of select="concat(ancestor::uof:UOF/uof:式样集/uof:自动编号集/字:自动编号/字:级别[following-sibling::字:级别[position()=1]/@字:级别值='1']/字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ <xsl:if test="字:段落属性/字:行距">
+ <xsl:variable name="type">
+ <xsl:value-of select="字:段落属性/字:行距/@字:类型"/>
+ </xsl:variable>
+ <xsl:variable name="val">
+ <xsl:value-of select="字:段落属性/字:行距/@字:值"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$type='fixed'">
+ <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$type='multi-lines'">
+ <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val * 100,'%')"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$type='at-least'">
+ <xsl:attribute name="style:line-height-at-least"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$type='line-space'">
+ <xsl:attribute name="style:line-spacing"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:段间距">
+ <xsl:if test="字:段落属性/字:段间距/字:段前距/字:绝对值/@字:值">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:段落属性/字:段间距/字:段前距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:段间距/字:段后距/字:绝对值/@字:值">
+ <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:段落属性/字:段间距/字:段后距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:variable name="aa">
+ <xsl:value-of select="字:段落属性/字:段间距/字:段前距/字:相对值/@字:值"/>
+ </xsl:variable>
+ <xsl:variable name="bb">
+ <xsl:value-of select="字:段落属性/字:段间距/字:段后距/字:相对值/@字:值"/>
+ </xsl:variable>
+ <xsl:if test="字:段落属性/字:段间距/字:段前距/字:相对值/@字:值">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat($aa * 15.6,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:段间距/字:段后距/字:相对值/@字:值">
+ <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat($bb * 15.6,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:孤行控制">
+ <xsl:attribute name="fo:widows"><xsl:value-of select="字:段落属性/字:孤行控制"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:寡行控制">
+ <xsl:attribute name="fo:orphans"><xsl:value-of select="字:段落属性/字:寡行控制"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:段中不分页">
+ <xsl:attribute name="fo:keep-together"><xsl:choose><xsl:when test="字:段落属性/字:段中不分页/@字:值='1' or 字:段落属性/字:段中不分页/@字:值='true'">always</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:与下段同页">
+ <xsl:attribute name="fo:keep-with-next"><xsl:choose><xsl:when test="字:段落属性/字:与下段同页/@字:值='1' or 字:段落属性/字:与下段同页/@字:值='true'">always</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:for-each select="字:段落属性/字:边框">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:for-each>
+ <xsl:for-each select="字:段落属性/字:填充">
+ <xsl:call-template name="uof:填充"/>
+ </xsl:for-each>
+ <xsl:if test="字:段落属性/字:对齐网格">
+ <xsl:attribute name="style:snap-to-layout-grid"><xsl:choose><xsl:when test="字:段落属性/字:对齐网格/@字:值='1' or 字:段落属性/字:对齐网格/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:取消断字">
+ <xsl:attribute name="fo:hyphenation-ladder-count">no-limit</xsl:attribute>
+ <xsl:attribute name="fo:hyphenation-remain-char-count">2</xsl:attribute>
+ <xsl:attribute name="fo:hyphenation-push-char-count">2</xsl:attribute>
+ <xsl:attribute name="fo:hyphenate"><xsl:choose><xsl:when test="字:段落属性/字:取消断字/@字:值='1' or 字:段落属性/字:取消断字/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:取消行号">
+ <xsl:attribute name="text:number-lines"><xsl:choose><xsl:when test="字:段落属性/字:取消行号/@字:值='1' or 字:段落属性/字:取消行号/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:行首尾标点控制">
+ <xsl:attribute name="style:punctuation-wrap"><xsl:choose><xsl:when test="字:段落属性/字:行首尾标点控制/@字:值='1' or 字:段落属性/字:行首尾标点控制/@字:值='true'">hanging</xsl:when><xsl:otherwise>simple</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:是否行首标点压缩/@字:值='true'">
+ <xsl:attribute name="style:punctuation-compress">false</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:中文习惯首尾字符">
+ <xsl:attribute name="style:line-break"><xsl:choose><xsl:when test="字:段落属性/字:中文习惯首尾字符/@字:值='1' or 字:段落属性/字:中文习惯首尾字符/@字:值='true'">strict</xsl:when><xsl:otherwise>normal</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:自动调整中英文字符间距 or 字:段落属性/字:自动调整中文与数字间距">
+ <xsl:attribute name="style:text-autospace"><xsl:choose><xsl:when test="字:段落属性/字:自动调整中英文字符间距/@字:值='1' or 字:段落属性/字:自动调整中文与数字间距/@字:值='1'or 字:段落属性/字:自动调整中英文字符间距/@字:值='true' or 字:段落属性/字:自动调整中文与数字间距/@字:值='true'">ideograph-alpha</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:首字下沉">
+ <xsl:element name="style:drop-cap">
+ <xsl:if test="字:段落属性/字:首字下沉/@字:行数">
+ <xsl:attribute name="style:lines"><xsl:value-of select="字:段落属性/字:首字下沉/@字:行数"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:首字下沉/@字:间距">
+ <xsl:attribute name="style:distance"><xsl:value-of select="concat(字:段落属性/字:首字下沉/@字:间距,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:首字下沉/@字:字体引用">
+ <xsl:attribute name="style:style-name"><xsl:value-of select="translate(字:段落属性/字:首字下沉/@字:字体引用,'_',' ')"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段落属性/字:首字下沉/@字:字符数">
+ <xsl:attribute name="style:length"><xsl:choose><xsl:when test="字:段落属性/字:首字下沉/@字:字符数='1'">word</xsl:when><xsl:otherwise><xsl:value-of select="字:段落属性/字:首字下沉/@字:字符数"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="XDParagraphAttr">
+ <xsl:apply-templates select="字:填充"/>
+ <xsl:if test="字:对齐">
+ <xsl:if test="字:对齐/@字:文字对齐">
+ <xsl:attribute name="style:vertical-align"><xsl:choose><xsl:when test="字:对齐/@字:文字对齐='base'">baseline</xsl:when><xsl:when test="字:对齐/@字:文字对齐='center'">middle</xsl:when><xsl:otherwise><xsl:value-of select="字:对齐/@字:文字对齐"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:对齐/@字:水平对齐">
+ <xsl:attribute name="fo:text-align"><xsl:choose><xsl:when test="字:对齐/@字:水平对齐='left'">start</xsl:when><xsl:when test="字:对齐/@字:水平对齐='right'">end</xsl:when><xsl:when test="字:对齐/@字:水平对齐='center'">center</xsl:when><xsl:otherwise>justify</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="字:对齐/@字:水平对齐='distributed'">
+ <xsl:attribute name="fo:text-align-last">justify</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style:justify-single-word">false</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="字:缩进">
+ <xsl:if test="字:缩进/字:左/字:绝对/@字:值">
+ <xsl:attribute name="fo:margin-left"><xsl:value-of select="concat(字:缩进/字:左/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:缩进/字:右/字:绝对/@字:值">
+ <xsl:attribute name="fo:margin-right"><xsl:value-of select="concat(字:缩进/字:右/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:缩进/字:首行/字:绝对/@字:值">
+ <xsl:attribute name="fo:text-indent"><xsl:value-of select="concat(字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="字:行距">
+ <xsl:variable name="type">
+ <xsl:value-of select="字:行距/@字:类型"/>
+ </xsl:variable>
+ <xsl:variable name="val">
+ <xsl:value-of select="字:行距/@字:值"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$type='fixed'">
+ <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$type='multi-lines'">
+ <xsl:attribute name="fo:line-height"><xsl:value-of select="concat($val * 100,'%')"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$type='at-least'">
+ <xsl:attribute name="style:line-height-at-least"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="$type='line-space'">
+ <xsl:attribute name="style:line-spacing"><xsl:value-of select="concat($val,$uofUnit)"/></xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="字:段间距">
+ <xsl:if test="字:段间距/字:段前距/字:绝对值/@字:值">
+ <xsl:attribute name="fo:margin-top"><xsl:value-of select="concat(字:段间距/字:段前距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段间距/字:段后距/字:绝对值/@字:值">
+ <xsl:attribute name="fo:margin-bottom"><xsl:value-of select="concat(字:段间距/字:段后距/字:绝对值/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="字:孤行控制">
+ <xsl:attribute name="fo:orphans"><xsl:value-of select="字:孤行控制"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:寡行控制">
+ <xsl:attribute name="fo:widows"><xsl:value-of select="字:寡行控制"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:段中不分页">
+ <xsl:attribute name="fo:keep-together"><xsl:choose><xsl:when test="字:段中不分页/@字:值='1' or 字:段中不分页/@字:值='true'">always</xsl:when><xsl:otherwise>auto</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:与下段同页">
+ <xsl:attribute name="fo:keep-with-next"><xsl:choose><xsl:when test="字:与下段同页/@字:值='1' or 字:与下段同页/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:for-each select="字:边框">
+ <xsl:call-template name="uof:边框"/>
+ </xsl:for-each>
+ <xsl:for-each select="字:填充">
+ <xsl:call-template name="uof:填充"/>
+ </xsl:for-each>
+ <xsl:if test="字:对齐网格">
+ <xsl:attribute name="style:snap-to-layout-grid"><xsl:choose><xsl:when test="字:对齐网格/@字:值='1' or 字:对齐网格/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:取消断字">
+ <xsl:attribute name="fo:hyphenation-ladder-count">no-limit</xsl:attribute>
+ <xsl:attribute name="fo:hyphenation-remain-char-count">2</xsl:attribute>
+ <xsl:attribute name="fo:hyphenation-push-char-count">2</xsl:attribute>
+ <xsl:attribute name="fo:hyphenate"><xsl:choose><xsl:when test="字:取消断字/@字:值='1' or 字:取消断字/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:取消行号">
+ <xsl:attribute name="text:number-lines"><xsl:choose><xsl:when test="字:取消行号/@字:值='1' or 字:取消行号/@字:值='true'">true</xsl:when><xsl:otherwise>false</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:行首尾标点控制">
+ <xsl:attribute name="style:punctuation-wrap"><xsl:choose><xsl:when test="字:行首尾标点控制/@字:值='1' or 字:行首尾标点控制/@字:值='true'">hanging</xsl:when><xsl:otherwise>simple</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:是否行首标点压缩/@字:值='true'">
+ <xsl:attribute name="style:punctuation-compress">false</xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:中文习惯首尾字符">
+ <xsl:attribute name="style:line-break"><xsl:choose><xsl:when test="字:中文习惯首尾字符/@字:值='1' or 字:中文习惯首尾字符/@字:值='true'">strict</xsl:when><xsl:otherwise>normal</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:自动调整中英文字符间距 or 字:自动调整中文与数字间距">
+ <xsl:attribute name="style:text-autospace"><xsl:choose><xsl:when test="字:自动调整中英文字符间距/@字:值='1' or 字:自动调整中文与数字间距/@字:值='1'or 字:自动调整中英文字符间距/@字:值='true' or 字:自动调整中文与数字间距/@字:值='true'">ideograph-alpha</xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:首字下沉">
+ <xsl:element name="style:drop-cap">
+ <xsl:if test="字:首字下沉/@字:行数">
+ <xsl:attribute name="style:lines"><xsl:value-of select="字:首字下沉/@字:行数"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:首字下沉/@字:间距">
+ <xsl:attribute name="style:distance"><xsl:value-of select="concat(字:首字下沉/@字:间距,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:首字下沉/@字:字体引用">
+ <xsl:attribute name="style:style-name"><xsl:value-of select="字:首字下沉/@字:字体引用"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:首字下沉/@字:字符数">
+ <xsl:attribute name="style:length"><xsl:choose><xsl:when test="字:首字下沉/@字:字符数='1'">word</xsl:when><xsl:otherwise><xsl:value-of select="字:首字下沉/@字:字符数"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="多个句">
+ <xsl:call-template name="单个或者没有句"/>
+ </xsl:template>
+ <xsl:template name="jibianhao">
+ <xsl:param name="biaoshifu"/>
+ <xsl:element name="text:list-level-style-number">
+ <xsl:variable name="currlevel" select="number(@字:级别值) + 1"/>
+ <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
+ <xsl:attribute name="text:style-name">Numbering Symbols</xsl:attribute>
+ <xsl:if test="@字:尾随字符">
+ <xsl:attribute name="style:num-suffix"><xsl:choose><xsl:when test="@字:尾随字符='space'"><xsl:value-of select="' ' "/></xsl:when><xsl:when test="@字:尾随字符='tab'"><xsl:value-of select="' '"/></xsl:when><xsl:otherwise>none</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:符号字体">
+ <xsl:variable name="Font-ID">
+ <xsl:value-of select="字:符号字体/@字:式样引用"/>
+ </xsl:variable>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="$Font-ID"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:起始编号">
+ <xsl:attribute name="text:start-value"><xsl:value-of select="字:起始编号"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:正规格式">
+ <xsl:attribute name="text:num-regular-exp"><xsl:value-of select="字:正规格式/@值"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="text:display-levels"><xsl:value-of select="string-length(字:编号格式表示) - string-length(translate(字:编号格式表示,'%','') )"/></xsl:attribute>
+ <xsl:if test="字:编号格式">
+ <xsl:call-template name="编号格式"/>
+ </xsl:if>
+ <xsl:if test="字:编号格式表示">
+ <xsl:variable name="last" select="substring-after(字:编号格式表示,concat('%',$currlevel))"/>
+ <xsl:variable name="first">
+ <xsl:variable name="aa" select="substring-before(字:编号格式表示,concat('%',$currlevel))"/>
+ <xsl:choose>
+ <xsl:when test="not(substring-after($aa,'%'))">
+ <xsl:value-of select="$aa"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$first!=''">
+ <xsl:attribute name="style:num-prefix"><xsl:value-of select="$first"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$last!=''">
+ <xsl:attribute name="style:num-suffix"><xsl:value-of select="$last"/></xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="bianhaogeshi">
+ <xsl:with-param name="biaoshi">
+ <xsl:value-of select="字:编号格式表示"/>
+ </xsl:with-param>
+ <xsl:with-param name="jibie">
+ <xsl:value-of select="1"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:element name="style:text-properties">
+ <xsl:call-template name="suojinleixing"/>
+ <xsl:if test="@字:编号对齐方式">
+ <xsl:attribute name="fo:text-align"><xsl:variable name="aa"><xsl:value-of select="@字:编号对齐方式"/></xsl:variable><xsl:choose><xsl:when test="$aa='center' ">center</xsl:when><xsl:when test="$aa='right' ">end</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="字:符号字体">
+ <xsl:if test="字:符号字体/@字:式样引用">
+ <xsl:variable name="Font-ID">
+ <xsl:value-of select="字:符号字体/@字:式样引用"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
+ <xsl:if test="@字:标识符=$Font-ID">
+ <xsl:if test="字:字体/@字:中文字体引用">
+ <xsl:attribute name="fo:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:if>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="bianhaogeshi">
+ <xsl:param name="biaoshi"/>
+ <xsl:param name="jibie"/>
+ <xsl:variable name="bb">
+ <xsl:value-of select="substring-after($biaoshi,'%')"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="substring-after($bb,'%')">
+ <xsl:call-template name="bianhaogeshi">
+ <xsl:with-param name="biaoshi" select="$bb"/>
+ <xsl:with-param name="jibie" select="$jibie +1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="not($jibie=1)">
+ <xsl:attribute name="text:display-levels"><xsl:value-of select="$jibie"/></xsl:attribute>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="xiangmufuhao">
+ <xsl:param name="biaoshifu"/>
+ <xsl:variable name="currlevel" select="number(@字:级别值) + 1"/>
+ <xsl:element name="text:list-level-style-bullet">
+ <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="../@字:名称"/></xsl:attribute>
+ <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,'%1')"/></xsl:attribute>
+ <xsl:attribute name="text:bullet-char"><xsl:value-of select="字:项目符号"/></xsl:attribute>
+ <xsl:element name="style:text-properties">
+ <xsl:if test="字:符号字体">
+ <xsl:variable name="Font-ID">
+ <xsl:value-of select="字:符号字体/@字:式样引用"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
+ <xsl:if test="@字:标识符=$Font-ID">
+ <xsl:if test="字:字体/@字:中文字体引用">
+ <xsl:attribute name="svg:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="字:项目符号">
+ <xsl:attribute name="fo:font-family"><xsl:value-of select="'WingDings'"/></xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="suojinleixing"/>
+ <xsl:if test="@字:编号对齐方式">
+ <xsl:attribute name="fo:text-align"><xsl:variable name="aa"><xsl:value-of select="@字:编号对齐方式"/></xsl:variable><xsl:choose><xsl:when test="$aa='center' ">center</xsl:when><xsl:when test="$aa='right' ">end</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="imagefuhao">
+ <xsl:param name="biaoshifu"/>
+ <xsl:variable name="currlevel" select="number(@字:级别值) + 1"/>
+ <xsl:element name="text:list-level-style-image" style:vertical-pos="middle" style:vertical-rel="line" fo:width="0.265cm" fo:height="0.265cm">
+ <xsl:attribute name="text:level"><xsl:value-of select="$currlevel"/></xsl:attribute>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat( $biaoshifu,$currlevel)"/></xsl:attribute>
+ <xsl:attribute name="style:num-suffix"><xsl:value-of select="substring-after(字:编号格式表示,'%1')"/></xsl:attribute>
+ <xsl:if test="字:图片符号引用">
+ <xsl:variable name="gid">
+ <xsl:value-of select="字:图片符号引用"/>
+ </xsl:variable>
+ <xsl:element name="office:binary-data">
+ <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据"/>
+ </xsl:element>
+ </xsl:if>
+ <xsl:element name="style:list-level-properties">
+ <xsl:attribute name="style:vertical-pos">middle</xsl:attribute>
+ <xsl:attribute name="style:vertical-rel">line</xsl:attribute>
+ <xsl:attribute name="fo:width"><xsl:value-of select="concat(字:图片符号引用/@字:宽度,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="fo:height"><xsl:value-of select="concat(字:图片符号引用/@字:高度,$uofUnit)"/></xsl:attribute>
+ <xsl:if test="字:符号字体">
+ <xsl:variable name="Font-ID">
+ <xsl:value-of select="字:符号字体/@字:式样引用"/>
+ </xsl:variable>
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:句式样">
+ <xsl:if test="@字:标识符=$Font-ID">
+ <xsl:if test="字:字体/@字:中文字体引用">
+ <xsl:attribute name="svg:font-family"><xsl:value-of select="字:字体/@字:中文字体引用"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:call-template name="suojinleixing"/>
+ <xsl:if test="@字:编号对齐方式">
+ <xsl:attribute name="fo:text-align"><xsl:variable name="aa"><xsl:value-of select="@字:编号对齐方式"/></xsl:variable><xsl:choose><xsl:when test="$aa='center' ">center</xsl:when><xsl:when test="$aa='right' ">end</xsl:when><xsl:otherwise>left</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="ootab">
+ <xsl:element name="style:tab-stops">
+ <xsl:for-each select="字:段落属性/字:制表位设置/字:制表位 | 字:制表位设置/字:制表位">
+ <xsl:element name="style:tab-stop">
+ <xsl:attribute name="style:position"><xsl:value-of select="concat(@字:位置,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="style:type"><xsl:choose><xsl:when test="@字:类型='decimal'">char</xsl:when><xsl:when test="@字:类型='left' or @字:类型='right' or @字:类型='center'"><xsl:value-of select="@字:类型"/></xsl:when><xsl:otherwise/></xsl:choose></xsl:attribute>
+ <xsl:if test="@字:制表位字符">
+ <xsl:attribute name="style:leader-text"><xsl:value-of select="@字:制表位字符"/></xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style:leader-style"><xsl:value-of select="@字:前导符"/></xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template match="字:段落[字:段落属性[字:自动编号信息]]">
+ <xsl:call-template name="编号解析">
+ </xsl:call-template>
+ </xsl:template>
+ <xsl:template name="编号解析">
+ <xsl:variable name="bianhao">
+ <xsl:value-of select="字:段落属性/字:自动编号信息/@字:编号引用"/>
+ </xsl:variable>
+ <xsl:variable name="bianhaojibie">
+ <xsl:value-of select="字:段落属性/字:自动编号信息/@字:编号级别"/>
+ </xsl:variable>
+ <xsl:variable name="isxiangmuorisimage">
+ <xsl:for-each select="/uof:UOF/uof:式样集/uof:自动编号集/字:自动编号">
+ <xsl:choose>
+ <xsl:when test="$bianhao=@字:标识符">
+ <xsl:choose>
+ <xsl:when test="字:级别[@字:级别值= (number($bianhaojibie))]/字:项目符号">true</xsl:when>
+ <xsl:when test="字:级别[@字:级别值= (number($bianhaojibie))]/字:图片符号引用">true</xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>false</xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$isxiangmuorisimage='true'">
+ <xsl:call-template name="无序"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="有序"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="有序">
+ <xsl:variable name="currlistid" select="字:段落属性/字:自动编号信息/@字:编号引用"/>
+ <xsl:variable name="currlistlvl" select="字:段落属性/字:自动编号信息/@字:编号级别 + 1"/>
+ <xsl:variable name="firstoccur" select="/descendant::字:段落属性[字:自动编号信息/@字:编号引用 = $currlistid][1]"/>
+ <xsl:element name="text:list">
+ <xsl:attribute name="text:style-name">List<xsl:value-of select="count($firstoccur/preceding::字:自动编号信息)"/></xsl:attribute>
+ <xsl:attribute name="text:continue-numbering"><xsl:choose><xsl:when test="字:段落属性/字:自动编号信息/@字:重新编号='false'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:if test="字:段落属性/字:自动编号信息/@字:重新编号">
+ <xsl:attribute name="text:continue-numbering"><xsl:choose><xsl:when test="字:段落属性/字:自动编号信息/@字:重新编号='1'">false</xsl:when><xsl:otherwise>true</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:element name="text:list-item">
+ <xsl:call-template name="ordered-levels">
+ <xsl:with-param name="level" select="$currlistlvl - 1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="ordered-levels">
+ <xsl:param name="level"/>
+ <xsl:choose>
+ <xsl:when test="$level = '0'">
+ <xsl:call-template name="commonParagraph"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="text:list">
+ <xsl:element name="text:list-item">
+ <xsl:call-template name="ordered-levels">
+ <xsl:with-param name="level" select="$level - 1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="无序">
+ <xsl:variable name="currlistid" select="字:段落属性/字:自动编号信息/@字:编号引用"/>
+ <xsl:variable name="currlistlvl" select="字:段落属性/字:自动编号信息/@字:编号级别 + 1"/>
+ <xsl:variable name="firstoccur" select="/descendant::字:段落属性[字:自动编号信息/@字:编号引用 = $currlistid][1]"/>
+ <xsl:element name="text:list">
+ <xsl:attribute name="text:style-name">List<xsl:value-of select="count($firstoccur/preceding::字:自动编号信息)"/></xsl:attribute>
+ <xsl:element name="text:list-item">
+ <xsl:call-template name="unordered-levels">
+ <xsl:with-param name="level" select="$currlistlvl - 1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="unordered-levels">
+ <xsl:param name="level"/>
+ <xsl:choose>
+ <xsl:when test="$level = '0'">
+ <xsl:call-template name="commonParagraph"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="text:list">
+ <xsl:element name="text:list-item">
+ <xsl:call-template name="unordered-levels">
+ <xsl:with-param name="level" select="$level - 1"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <!-- measure_conversion.xsl Begin-->
+ <xsl:param name="dpi" select="111"/>
+ <xsl:param name="centimeter-in-mm" select="10"/>
+ <xsl:param name="inch-in-mm" select="25.4"/>
+ <xsl:param name="didot-point-in-mm" select="0.376065"/>
+ <xsl:param name="pica-in-mm" select="4.2333333"/>
+ <xsl:param name="point-in-mm" select="0.3527778"/>
+ <xsl:param name="twip-in-mm" select="0.017636684"/>
+ <xsl:param name="pixel-in-mm" select="$inch-in-mm div $dpi"/>
+ <!-- ***** MEASUREMENT CONVERSIONS *****
+ PARAM 'value'
+ The measure to be converted.
+ The current measure is judged by a substring (e.g. 'mm', 'cm', 'in', 'pica'...)
+ directly added to the number.
+
+ PARAM 'rounding-factor'
+ Is used for the rounding of decimal places.
+ The parameter number is the product of 1 and some '10', where
+ every zero represents a decimal place.
+
+ For example, providing as parameter:
+ <xsl:param name="rounding-factor" select="10000" />
+ Gives by default four decimal places.
+
+ To round two decimal places, basically the following is done:
+ <xsl:value-of select="round(100 * value) div 100"/>
- PARAM 'rounding-factor'
- Is used for the rounding of decimal places.
- The parameter number is the product of 1 and some '10', where
- every zero represents a decimal place.
+ RETURN The converted number, by default rounded to four decimal places.
+ In case the input measure could not be matched the same value is
+ returned and a warning message is written out.
- For example, providing as parameter:
- <xsl:param name="rounding-factor" select="10000" />
- Gives by default four decimal places.
- To round two decimal places, basically the following is done:
- <xsl:value-of select="round(100 * value) div 100"/>
- RETURN The converted number, by default rounded to four decimal places.
- In case the input measure could not be matched the same value is
- returned and a warning message is written out.
+ MEASURE LIST:
+ * 1 milimeter (mm), the basic measure
+ * 1 centimeter (cm) = 10 mm
+ * 1 inch (in) = 25.4 mm
+ While the English have already seen the light (read: the metric system), the US
+ remains loyal to this medieval system.
- MEASURE LIST:
- * 1 milimeter (mm), the basic measure
+ * 1 point (pt) = 0.35277777.. mm
+ Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
+ There are exactly 72 PostScript points in 1 inch.
- * 1 centimeter (cm) = 10 mm
+ * 1 twip = twentieth of a (PostScript) point
+ A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
- * 1 inch (in) = 25.4 mm
- While the English have already seen the light (read: the metric system), the US
- remains loyal to this medieval system.
+ * 1 didot point (dpt) = 0.376065 mm
+ Didot point after the French typographer Firmin Didot (1764-1836).
- * 1 point (pt) = 0.35277777.. mm
- Sometimes called PostScript point (ppt), as when Adobe created PostScript, they added their own system of points.
- There are exactly 72 PostScript points in 1 inch.
+ More details under
+ http://www.unc.edu/~rowlett/units/dictP.html:
+ "A unit of length used by typographers and printers. When printing was done
+ from hand-set metal type, one point represented the smallest element of type
+ that could be handled, roughly 1/64 inch. Eventually, the point was standardized
+ in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
+ about 0.35 mm (351.46 micrometers). In continental Europe, typographers
+ traditionally used a slightly larger point of 0.014 83 inch (about
+ 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
+ after the French typographer Firmin Didot (1764-1836). In the U.S.,
+ Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
+ or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
+ of 0.351 459 8035 mm. The German standards agency DIN has proposed that
+ all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
- * 1 twip = twentieth of a (PostScript) point
- A twip (twentieth of a point) is a 1/20th of a PostScript point, a traditional measure in printing.
+ * 1 pica = 4.233333 mm
+ 1/6 inch or 12 points
- * 1 didot point (dpt) = 0.376065 mm
- Didot point after the French typographer Firmin Didot (1764-1836).
+ * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
+ Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
- More details under
- http://www.unc.edu/~rowlett/units/dictP.html:
- "A unit of length used by typographers and printers. When printing was done
- from hand-set metal type, one point represented the smallest element of type
- that could be handled, roughly 1/64 inch. Eventually, the point was standardized
- in Britain and America as exactly 1/72.27 = 0.013 837 inch, which is
- about 0.35 mm (351.46 micrometers). In continental Europe, typographers
- traditionally used a slightly larger point of 0.014 83 inch (about
- 1/72 pouce, 0.377 mm, or roughly 1/67 English inch), called a Didot point
- after the French typographer Firmin Didot (1764-1836). In the U.S.,
- Adobe software defines the point to be exactly 1/72 inch (0.013 888 9 inch
- or 0.352 777 8 millimeters) and TeX software uses a slightly smaller point
- of 0.351 459 8035 mm. The German standards agency DIN has proposed that
- all these units be replaced by multiples of 0.25 millimeters (1/101.6 inch).
- * 1 pica = 4.233333 mm
- 1/6 inch or 12 points
+ -->
+ <!-- changing measure to mm -->
+ <xsl:template name="convert2cm">
+ <xsl:param name="value"/>
+ <xsl:param name="rounding-factor" select="10000"/>
+ <xsl:choose>
+ <xsl:when test="contains($value, 'mm')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, $uofUnit)">
+ <xsl:value-of select="substring-before($value, $uofUnit)"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'in')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'dpt')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'pica')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'twip')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:when test="contains($value, 'px')">
+ <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="uof:通用边框">
+ <xsl:param name="lineType"/>
+ <xsl:param name="width"/>
+ <xsl:param name="color"/>
+ <xsl:choose>
+ <xsl:when test="$lineType='none'">none</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$width"/>
+ <xsl:choose>
+ <xsl:when test="$lineType='single'">solid </xsl:when>
+ <xsl:when test="$lineType='double'">double </xsl:when>
+ <xsl:otherwise>solid </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="$color='auto' or $color='none' or $color=''">#808080</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$color"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="uof:边框">
+ <xsl:if test="uof:上">
+ <xsl:variable name="type" select="uof:上/@uof:类型"/>
+ <xsl:variable name="size" select="concat(uof:上/@uof:宽度,$uofUnit,' ')"/>
+ <xsl:variable name="clr" select="uof:上/@uof:颜色"/>
+ <xsl:attribute name="fo:border-top"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
+ <xsl:if test="uof:上/@uof:线宽度">
+ <xsl:attribute name="style:border-line-width-top"><xsl:value-of select="uof:上/@uof:线宽度"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="uof:下">
+ <xsl:variable name="type" select="uof:下/@uof:类型"/>
+ <xsl:variable name="size" select="concat(uof:下/@uof:宽度,$uofUnit,' ')"/>
+ <xsl:variable name="clr" select="uof:下/@uof:颜色"/>
+ <xsl:attribute name="fo:border-bottom"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
+ <xsl:if test="uof:下/@uof:线宽度">
+ <xsl:attribute name="style:border-line-width-bottom"><xsl:value-of select="uof:下/@uof:线宽度"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="uof:左">
+ <xsl:variable name="type" select="uof:左/@uof:类型"/>
+ <xsl:variable name="size" select="concat(uof:左/@uof:宽度,$uofUnit,' ')"/>
+ <xsl:variable name="clr" select="uof:左/@uof:颜色"/>
+ <xsl:attribute name="fo:border-left"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
+ <xsl:if test="uof:左/@uof:线宽度">
+ <xsl:attribute name="style:border-line-width-left"><xsl:value-of select="uof:左/@uof:线宽度"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="uof:右">
+ <xsl:variable name="type" select="uof:右/@uof:类型"/>
+ <xsl:variable name="size" select="concat(uof:右/@uof:宽度,$uofUnit,' ')"/>
+ <xsl:variable name="clr" select="uof:右/@uof:颜色"/>
+ <xsl:attribute name="fo:border-right"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
+ <xsl:if test="uof:右/@uof:线宽度">
+ <xsl:attribute name="style:border-line-width-right"><xsl:value-of select="uof:右/@uof:线宽度"/></xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="uof:上/@uof:阴影='true'or uof:上/@uof:阴影='1'">
+ <xsl:if test="uof:左/@uof:阴影='true'or uof:左/@uof:阴影='1'">
+ <xsl:attribute name="style:shadow">#808080 -0.18cm -0.18cm</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="uof:上/@uof:阴影='true'or uof:上/@uof:阴影='1'">
+ <xsl:if test="uof:右/@uof:阴影='true'or uof:右/@uof:阴影='1'">
+ <xsl:attribute name="style:shadow">#808080 0.18cm -0.18cm</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="uof:下/@uof:阴影='true'or uof:下/@uof:阴影='1'">
+ <xsl:if test="uof:左/@uof:阴影='true'or uof:左/@uof:阴影='1'">
+ <xsl:attribute name="style:shadow">#808080 -0.18cm 0.18cm</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="uof:下/@uof:阴影='true'or uof:下/@uof:阴影='1'">
+ <xsl:if test="uof:右/@uof:阴影='true'or uof:右/@uof:阴影='1'">
+ <xsl:attribute name="style:shadow">#808080 0.18cm 0.18cm</xsl:attribute>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="uof:上/@uof:边距">
+ <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(uof:上/@uof:边距,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="uof:下/@uof:边距">
+ <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(uof:下/@uof:边距,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="uof:左/@uof:边距">
+ <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(uof:左/@uof:边距,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="uof:右/@uof:边距">
+ <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(uof:右/@uof:边距,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="uof:填充">
+ <xsl:choose>
+ <xsl:when test="图:颜色">
+ <xsl:attribute name="fo:background-color"><xsl:choose><xsl:when test="图:颜色"><xsl:value-of select="图:颜色"/></xsl:when><xsl:otherwise>transparent</xsl:otherwise></xsl:choose></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains(图:图案/@图:前景色,'#')">
+ <xsl:attribute name="fo:text-background-color"><xsl:value-of select="图:图案/@图:前景色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:when test="图:图案/@图:背景色">
+ <xsl:attribute name="fo:background-color"><xsl:value-of select="图:图案/@图:背景色"/></xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ <xsl:if test="图:图片">
+ <xsl:element name="style:background-image">
+ <xsl:variable name="gid">
+ <xsl:value-of select="图:图片/@图:图形引用"/>
+ </xsl:variable>
+ <xsl:if test="图:图片/@图:位置 and not(图:图片/@图:位置='tile')">
+ <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:图片/@图:位置='stretch'">stretch</xsl:when><xsl:when test="图:图片/@图:位置='center'">no-repeat</xsl:when></xsl:choose></xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据">
+ <xsl:element name="office:binary-data">
+ <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:路径"/></xsl:attribute>
+ <xsl:attribute name="xlink:type">simple</xsl:attribute>
+ <xsl:attribute name="xlink:actuate">onLoad</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="日期域">
+ <xsl:if test="following-sibling::字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
+ <xsl:variable name="datestr">
+ <xsl:choose>
+ <xsl:when test="contains($date0,'\*')">
+ <xsl:value-of select="string(substring-before($date0,'\*'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$date0"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:call-template name="zydate">
+ <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="zydate">
+ <xsl:param name="str1"/>
+ <xsl:choose>
+ <xsl:when test="substring($str1,1,5)='am/pm'">
+ <xsl:variable name="str1-before" select="substring($str1,1,5)"/>
+ <xsl:variable name="str1-after" select="substring($str1,6)"/>
+ <number:am-pm/>
+ <xsl:if test="not($str1-after)=''">
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ </xsl:if>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zytime">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+
+ <xsl:choose>
+ <xsl:when test="substring($str1,1,4)='yyyy'">
+ <xsl:variable name="str1-before" select="substring($str1,1,4)"/>
+ <xsl:variable name="str1-after" select="substring($str1,5)"/>
+ <number:year number:style="long"/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zydate">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="substring($str1,1,1)=substring($str1,2,1) and substring($str1,2,1) !=substring($str1,3,1) ">
+ <xsl:variable name="str1-before" select="substring($str1,1,2)"/>
+ <xsl:variable name="str1-after" select="substring($str1,3)"/>
+ <xsl:if test="substring($str1,1,1)='y'">
+ <number:year/>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='M'">
+ <number:month number:style="long"/>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='d'">
+ <number:day number:style="long"/>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='h'">
+ <number:hours number:style="long"/>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='m'">
+ <number:minutes number:style="long"/>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='s'">
+ <number:seconds number:style="long"/>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='W'">
+ <number:week-of-year number:style="long"/>
+ </xsl:if>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zydate">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="substring($str1,1,1)='M'or substring($str1,1,1)='d'or substring($str1,1,1)='h'or substring($str1,1,1)='m'or substring($str1,1,1)='s'">
+ <xsl:variable name="str1-after" select="substring($str1,2)"/>
+ <xsl:variable name="str1-before" select="substring($str1,1,1)"/>
+ <xsl:if test="substring($str1,1,1)='M'">
+ <number:month/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='d'">
+ <number:day/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='h'">
+ <number:hours/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='m'">
+ <number:minutes/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='s'">
+ <number:seconds/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ </xsl:if>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zydate">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="contains(substring($str1,1,3),'Q' )">
+ <xsl:choose>
+ <xsl:when test="substring($str1,1,1)='Q'">
+ <xsl:variable name="str1-before" select="substring($str1,1,2)"/>
+ <xsl:variable name="str1-after" select="substring($str1,3)"/>
+ <number:quarter/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zydate">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="str1-before" select="substring($str1,1,5)"/>
+ <xsl:variable name="str1-after" select="substring($str1,6)"/>
+ <number:quarter number:style="long"/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zydate">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="contains(substring(normalize-space($str1),1,3),'W' )">
+ <xsl:variable name="str1-before" select="substring(normalize-space($str1),1,3)"/>
+ <xsl:variable name="str1-after" select="substring(normalize-space($str1),4)"/>
+ <number:day-of-week number:style="long"/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zydate">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="contains(substring($str1,1,3),'NN' ) and substring($str1,1,1)!='NN' ">
+ <xsl:variable name="str1-before" select="substring($str1,1,3)"/>
+ <xsl:variable name="str1-after" select="substring($str1,4)"/>
+ <number:text>第</number:text>
+ <number:week-of-year/>
+ <number:text>周</number:text>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zydate">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="时间域">
+ <xsl:if test="following-sibling::字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
+ <xsl:variable name="datestr" select="$date0"/>
+ <xsl:call-template name="zytime">
+ <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="zytime">
+ <xsl:param name="str1"/>
+ <xsl:choose>
+ <xsl:when test="substring($str1,1,5)='am/pm'">
+ <xsl:variable name="str1-before" select="substring($str1,1,5)"/>
+ <xsl:variable name="str1-after" select="substring($str1,6)"/>
+ <number:am-pm/>
+ <xsl:if test="not($str1-after)=''">
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ </xsl:if>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zytime">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="substring($str1,1,1)=substring($str1,2,1) and substring($str1,2,1) !=substring($str1,3,1) ">
+ <xsl:variable name="str1-before" select="substring($str1,1,2)"/>
+ <xsl:variable name="str1-after" select="substring($str1,3)"/>
+ <xsl:if test="substring($str1,1,1)='H' or substring($str1,1,1)='h'">
+ <number:hours number:style="long"/>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='M' or substring($str1,1,1)='m'">
+ <number:minutes number:style="long"/>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='S' or substring($str1,1,1)='s'">
+ <number:seconds number:style="long"/>
+ </xsl:if>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zytime">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="substring($str1,1,1)='H'or substring($str1,1,1)='M'or substring($str1,1,1)='S'or substring($str1,1,1)='h' or substring($str1,1,1)='m' or substring($str1,1,1)='s'">
+ <xsl:variable name="str1-after" select="substring($str1,2)"/>
+ <xsl:variable name="str1-before" select="substring($str1,1,1)"/>
+ <xsl:if test="substring($str1,1,1)='H' or substring($str1,1,1)='h'">
+ <number:hours/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='M' or substring($str1,1,1)='m'">
+ <number:minutes/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ </xsl:if>
+ <xsl:if test="substring($str1,1,1)='S' or substring($str1,1,1)='s'">
+ <number:seconds/>
+ <number:text>
+ <xsl:value-of select="substring($str1-after,1,1)"/>
+ </number:text>
+ </xsl:if>
+ <xsl:if test="string-length($str1-after)&gt;1">
+ <xsl:call-template name="zytime">
+ <xsl:with-param name="str1" select="substring($str1-after,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="oo数字格式域开关">
+ <xsl:param name="oo_format"/>
+ <xsl:choose>
+ <xsl:when test="$oo_format='Arabic'">1</xsl:when>
+ <xsl:when test="$oo_format='ROMAN'">I</xsl:when>
+ <xsl:when test="$oo_format='roman'">i</xsl:when>
+ <xsl:when test="$oo_format='ALPHABETIC'">A</xsl:when>
+ <xsl:when test="$oo_format='alphabetic'">a</xsl:when>
+ <xsl:when test="$oo_format='GB1'">1, 2, 3, ...</xsl:when>
+ <xsl:when test="$oo_format='GB3'">①, ②, ③, ...</xsl:when>
+ <xsl:when test="$oo_format='CHINESENUM3'">一, 二, 三, ...</xsl:when>
+ <xsl:when test="$oo_format='CHINESENUM2'">壹, 贰, 叁, ...</xsl:when>
+ <xsl:when test="$oo_format='ZODIAC1'">甲, 乙, 丙, ...</xsl:when>
+ <xsl:when test="$oo_format='ZODIAC2'">子, 丑, 寅, ...</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="题注">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串 or 字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="aa" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,'\f ')"/>
+ <xsl:variable name="ooow" select="substring-after($aa,'ooow:') "/>
+ <xsl:variable name="as" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="ad">
+ <xsl:value-of select="substring-after($as,'SEQ ') "/>
+ </xsl:variable>
+ <xsl:variable name="num">
+ <xsl:value-of select="substring-after(substring-before(../字:域代码/字:段落/字:句/字:文本串,' \f'),'\* ')"/>
+ </xsl:variable>
+ <xsl:variable name="fmt">
+ <xsl:call-template name="oo数字格式域开关">
+ <xsl:with-param name="oo_format" select="$num"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:element name="text:sequence">
+ <xsl:attribute name="text:name"><xsl:choose><xsl:when test="$ad='表格'">Table</xsl:when><xsl:when test="$ad='图表'">Drawing</xsl:when><xsl:otherwise><xsl:value-of select="$ad"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="text:formula"><xsl:choose><xsl:when test="contains($aa,'ooow:')"><xsl:value-of select="$ooow"/></xsl:when><xsl:when test="contains($as,'表格')"><xsl:value-of select="concat('Table','+',$fmt)"/></xsl:when><xsl:when test="contains($as,'图表')"><xsl:value-of select="concat('Drawing','+',$fmt)"/></xsl:when><xsl:otherwise><xsl:value-of select="$aa"/></xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="页码域">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串 or 字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
+ <xsl:variable name="fmt">
+ <xsl:call-template name="oo数字格式域开关">
+ <xsl:with-param name="oo_format" select="$date0"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:element name="text:page-number">
+ <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
+ <xsl:attribute name="text:select-page">current</xsl:attribute>
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="页数域">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
+ <xsl:variable name="fmt">
+ <xsl:call-template name="oo数字格式域开关">
+ <xsl:with-param name="oo_format" select="substring-before($date0,' \*')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:element name="text:page-count">
+ <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="作者域">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
+ <xsl:element name="text:initial-creator">
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="用户域">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
+ <xsl:element name="text:author-name">
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="缩写域">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
+ <xsl:element name="text:author-initials">
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="标题域">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
+ <xsl:element name="text:title">
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="主题域">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
+ <xsl:element name="text:subject">
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="文件名">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:element name="text:file-name">
+ <xsl:variable name="string">
+ <xsl:value-of select="../字:域代码/字:段落/字:句/字:文本串"/>
+ </xsl:variable>
+ <xsl:attribute name="text:display"><xsl:choose><xsl:when test="contains($string,' \p')">full</xsl:when><xsl:otherwise>name-and-extension</xsl:otherwise></xsl:choose></xsl:attribute>
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="编辑时间">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
+ <xsl:variable name="datestr" select="$date0"/>
+ <xsl:call-template name="zytime">
+ <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="创建时间">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
+ <xsl:variable name="datestr" select="$date0"/>
+ <xsl:call-template name="zytime">
+ <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template name="字符数">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
+ <xsl:variable name="fmt">
+ <xsl:call-template name="oo数字格式域开关">
+ <xsl:with-param name="oo_format" select="substring-before($date0,' \#')"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:element name="text:character-count">
+ <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+ <xsl:key name="mulu" match="/uof:UOF/uof:式样集/uof:段落式样" use="@字:标识符"/>
+ <xsl:template name="索引域">
+ <xsl:element name="text:alphabetical-index">
+ <xsl:variable name="stylenum">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
+ </xsl:variable>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
+ <xsl:variable name="aanum">
+ <xsl:number value="0" format="1"/>
+ </xsl:variable>
+ <xsl:attribute name="text:name"><xsl:value-of select="concat('索引目录',$aanum + 1)"/></xsl:attribute>
+ <text:alphabetical-index-source text:main-entry-style-name="Main_index_entry" text:sort-algorithm="pinyin" fo:language="zh" fo:country="CN">
+ <text:index-title-template text:style-name="Index_20_Heading">索引目录</text:index-title-template>
+ <text:alphabetical-index-entry-template text:outline-level="separator" text:style-name="Index_Separator">
+ <text:index-entry-text/>
+ </text:alphabetical-index-entry-template>
+ <text:alphabetical-index-entry-template text:outline-level="1" text:style-name="Index_20_1">
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ </text:alphabetical-index-entry-template>
+ <text:alphabetical-index-entry-template text:outline-level="2" text:style-name="Index_20_2">
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ </text:alphabetical-index-entry-template>
+ <text:alphabetical-index-entry-template text:outline-level="3" text:style-name="Index_20_3">
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ </text:alphabetical-index-entry-template>
+ </text:alphabetical-index-source>
+ <text:index-body>
+ <text:index-title>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
+ <xsl:attribute name="text:name"><xsl:value-of select="concat('索引目录',$aanum + 1,'_Head')"/></xsl:attribute>
+ <xsl:for-each select="字:域代码/字:段落[position()=2]">
+ <text:p text:style-name="Index_20_Heading">
+ <xsl:apply-templates select=".//字:文本串"/>
+ </text:p>
+ </xsl:for-each>
+ </text:index-title>
+ <xsl:if test="字:域开始/@字:类型='INDEX'">
+ <xsl:for-each select="字:域代码/字:段落[position()>2]">
+ <xsl:element name="text:p">
+ <xsl:variable name="aa">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
+ </xsl:variable>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$aa + 1)"/></xsl:attribute>
+ <xsl:for-each select="字:句">
+ <xsl:apply-templates select="self::node()/*"/>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:if>
+ </text:index-body>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="目录域">
+ <xsl:element name="text:table-of-content">
+ <xsl:variable name="stylenum">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
+ </xsl:variable>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
+ <xsl:variable name="aanum">
+ <xsl:number value="0" format="1"/>
+ </xsl:variable>
+ <xsl:attribute name="text:name"><xsl:value-of select="concat('内容目录',$aanum + 1)"/></xsl:attribute>
+ <text:table-of-content-source text:outline-level="10">
+ <text:index-title-template text:style-name="Contents_20_Heading">内容目录</text:index-title-template>
+ <text:table-of-content-entry-template text:outline-level="1" text:style-name="Contents 1">
+ <text:index-entry-link-start text:style-name="Index_20_Link"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>
+ <text:table-of-content-entry-template text:outline-level="2" text:style-name="Contents 2">
+ <text:index-entry-link-start text:style-name="Index_20_Link"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>
+ <text:table-of-content-entry-template text:outline-level="3" text:style-name="Contents 3">
+ <text:index-entry-link-start text:style-name="Index_20_Link"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>
+ <text:table-of-content-entry-template text:outline-level="4" text:style-name="Contents 4">
+ <text:index-entry-link-start text:style-name="Index_20_Link"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>
+ <text:table-of-content-entry-template text:outline-level="5" text:style-name="Contents 5">
+ <text:index-entry-link-start text:style-name="Index_20_Link"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>
+ <text:table-of-content-entry-template text:outline-level="6" text:style-name="Contents 6">
+ <text:index-entry-link-start text:style-name="Index_20_Link"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>
+ <text:table-of-content-entry-template text:outline-level="7" text:style-name="Contents 7">
+ <text:index-entry-link-start text:style-name="Index_20_Link"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>
+ <text:table-of-content-entry-template text:outline-level="8" text:style-name="Contents 8">
+ <text:index-entry-link-start text:style-name="Index_20_Link"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>
+ <text:table-of-content-entry-template text:outline-level="9" text:style-name="Contents 9">
+ <text:index-entry-link-start text:style-name="Index_20_Link"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>
+ <text:table-of-content-entry-template text:outline-level="10" text:style-name="Contents 10">
+ <text:index-entry-link-start text:style-name="Index_20_Link"/>
+ <text:index-entry-chapter/>
+ <text:index-entry-text/>
+ <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
+ <text:index-entry-page-number/>
+ <text:index-entry-link-end/>
+ </text:table-of-content-entry-template>
+ </text:table-of-content-source>
+ <text:index-body>
+ <text:index-title>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
+ <xsl:attribute name="text:name"><xsl:value-of select="concat('内容目录',$aanum + 1,'_Head')"/></xsl:attribute>
+ <xsl:for-each select="字:域代码/字:段落[position()=2]">
+ <text:p text:style-name="Contents_20_Heading">
+ <xsl:apply-templates select=".//字:文本串"/>
+ </text:p>
+ </xsl:for-each>
+ </text:index-title>
+ <xsl:if test="字:域开始/@字:类型='REF'">
+ <xsl:for-each select="字:域代码/字:段落[position()>2]">
+ <xsl:element name="text:p">
+ <xsl:variable name="aa">
+ <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
+ </xsl:variable>
+ <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$aa + 1)"/></xsl:attribute>
+ <xsl:element name="text:a">
+ <xsl:attribute name="xlink:type">simple</xsl:attribute>
+ <xsl:attribute name="text:style-name">Index Link</xsl:attribute>
+ <xsl:attribute name="text:visited-style-name">Index Link</xsl:attribute>
+ <xsl:variable name="hyperDest" select="./字:句/字:区域开始/@字:标识符"/>
+ <xsl:attribute name="xlink:href"><xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接"><xsl:if test="@uof:链源=$hyperDest"><xsl:value-of select="concat('#',@uof:书签)"/></xsl:if></xsl:for-each></xsl:attribute>
+ <xsl:apply-templates select="字:句/*"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:if>
+ </text:index-body>
+ </xsl:element>
+ </xsl:template>
+ <xsl:template name="suojinleixing">
+ <xsl:if test="字:缩进/字:首行/字:绝对/@字:值 and 字:缩进/字:左/字:绝对/@字:值">
+ <xsl:attribute name="text:min-label-width"><xsl:value-of select="concat(0 - 字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ <xsl:attribute name="text:space-before"><xsl:value-of select="concat(字:缩进/字:左/字:绝对/@字:值 + 字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="字:修订开始[@字:类型='insert']">
+ <xsl:choose>
+ <xsl:when test="./@字:标识符">
+ <text:change-start text:change-id="{@字:标识符}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <text:change-start text:change-id="{@字:修订信息引用}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:修订结束[preceding::字:修订开始[1]/@字:类型='insert']">
+ <text:change-end>
+ <xsl:attribute name="text:change-id"><xsl:value-of select="@字:开始标识引用"/></xsl:attribute>
+ </text:change-end>
+ </xsl:template>
+ <xsl:template match="字:修订开始[@字:类型='delete']">
+ <xsl:choose>
+ <xsl:when test="./@字:标识符">
+ <text:change-start text:change-id="{@字:标识符}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <text:change-start text:change-id="{@字:修订信息引用}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:修订结束[preceding::字:修订开始[1]/@字:类型='delete']">
+ <text:change-end>
+ <xsl:attribute name="text:change-id"><xsl:value-of select="@字:开始标识引用"/></xsl:attribute>
+ </text:change-end>
+ </xsl:template>
+ <xsl:template match="字:修订开始[@字:类型='format']">
+ <xsl:choose>
+ <xsl:when test="./@字:标识符">
+ <text:change-start text:change-id="{@字:标识符}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <text:change-start text:change-id="{@字:修订信息引用}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="字:修订结束[preceding::字:修订开始[1]/@字:类型='format']">
+ <text:change-end>
+ <xsl:attribute name="text:change-id"><xsl:value-of select="@字:开始标识引用"/></xsl:attribute>
+ </text:change-end>
+ </xsl:template>
+ <xsl:template name="GenerateTrackChanges">
+ <text:tracked-changes>
+ <xsl:if test="/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:修订">
+ <xsl:attribute name="text:track-changes"><xsl:value-of select="/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:修订/@字:值"/></xsl:attribute>
+ </xsl:if>
+ <xsl:if test="//字:段落/字:修订开始[@字:类型='insert']">
+ <xsl:for-each select="//字:段落/字:修订开始[@字:类型='insert']">
+ <xsl:variable name="id" select="@字:标识符"/>
+ <xsl:variable name="aid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:作者"/>
+ <xsl:variable name="sid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$aid]/@字:姓名"/>
+ <xsl:variable name="bid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:日期"/>
+ <text:changed-region text:id="{$id}">
+ <xsl:choose>
+ <xsl:when test="name()='字:修订开始'">
+ <xsl:choose>
+ <xsl:when test="not(name(following-sibling::node()[1])='字:修订结束')">
+ <text:insertion>
+ <office:change-info>
+ <dc:creator>
+ <xsl:value-of select="$sid"/>
+ </dc:creator>
+ <dc:date>
+ <xsl:value-of select="$bid"/>
+ </dc:date>
+ </office:change-info>
+ </text:insertion>
+ </xsl:when>
+ <xsl:otherwise>
+ <text:format-change>
+ <office:change-info>
+ <dc:creator>
+ <xsl:value-of select="$sid"/>
+ </dc:creator>
+ <dc:date>
+ <xsl:value-of select="$bid"/>
+ </dc:date>
+ </office:change-info>
+ </text:format-change>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </text:changed-region>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="//字:段落/字:修订开始[@字:类型='insert']">
+ <xsl:for-each select="//字:段落/字:修订开始[@字:类型='delete']">
+ <xsl:variable name="id" select="@字:标识符"/>
+ <xsl:variable name="aid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:作者"/>
+ <xsl:variable name="sid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$aid]/@字:姓名"/>
+ <xsl:variable name="bid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:日期"/>
+ <text:changed-region text:id="{$id}">
+ <xsl:choose>
+ <xsl:when test="name()='字:修订开始'">
+ <xsl:choose>
+ <xsl:when test="not(name(following-sibling::node()[1])='字:修订结束')">
+ <text:deletion>
+ <office:change-info>
+ <dc:creator>
+ <xsl:value-of select="$sid"/>
+ </dc:creator>
+ <dc:date>
+ <xsl:value-of select="$bid"/>
+ </dc:date>
+ </office:change-info>
+ </text:deletion>
+ </xsl:when>
+ <xsl:otherwise>
+ <text:format-change>
+ <office:change-info>
+ <dc:creator>
+ <xsl:value-of select="$sid"/>
+ </dc:creator>
+ <dc:date>
+ <xsl:value-of select="$bid"/>
+ </dc:date>
+ </office:change-info>
+ </text:format-change>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </text:changed-region>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:if test="//字:段落/字:修订开始[@字:类型='format']">
+ <xsl:for-each select="//字:段落/字:修订开始[@字:类型='format']">
+ <xsl:variable name="id" select="@字:标识符"/>
+ <xsl:variable name="aid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:作者"/>
+ <xsl:variable name="sid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$aid]/@字:姓名"/>
+ <xsl:variable name="bid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:日期"/>
+ <text:changed-region text:id="{$id}">
+ <xsl:choose>
+ <xsl:when test="name()='字:修订开始'">
+ <xsl:choose>
+ <xsl:when test="not(name(following-sibling::node()[1])='字:修订结束')">
+ <text:format-change>
+ <office:change-info>
+ <dc:creator>
+ <xsl:value-of select="$sid"/>
+ </dc:creator>
+ <dc:date>
+ <xsl:value-of select="$bid"/>
+ </dc:date>
+ </office:change-info>
+ </text:format-change>
+ </xsl:when>
+ <xsl:otherwise>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </text:changed-region>
+ </xsl:for-each>
+ </xsl:if>
- * 1 pixel (px) = 0.26458333.. mm (relative to 'DPI', here: 96 dpi)
- Most pictures have the 96 dpi resolution, but the dpi variable may vary by stylesheet parameter
+ </text:tracked-changes>
+ </xsl:template>
+ <xsl:template name="oo数字格式">
+ <xsl:param name="oo_format"/>
+ <xsl:choose>
+ <xsl:when test="$oo_format='decimal'">1</xsl:when>
+ <xsl:when test="$oo_format='upper-roman'">I</xsl:when>
+ <xsl:when test="$oo_format='lower-roman'">i</xsl:when>
+ <xsl:when test="$oo_format='upper-letter'">A</xsl:when>
+ <xsl:when test="$oo_format='lower-letter'">a</xsl:when>
+ <xsl:when test="$oo_format='decimal-full-width'">1, 2, 3, ...</xsl:when>
+ <xsl:when test="$oo_format='decimal-enclosed-circle'">①, ②, ③, ...</xsl:when>
+ <xsl:when test="$oo_format='chinese-counting'">一, 二, 三, ...</xsl:when>
+ <xsl:when test="$oo_format='chinese-legal-simplified'">壹, 贰, 叁, ...</xsl:when>
+ <xsl:when test="$oo_format='ideograph-traditional'">甲, 乙, 丙, ...</xsl:when>
+ <xsl:when test="$oo_format='ideograph-zodiac'">子, 丑, 寅, ...</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template name="章节域">
+ <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
+ <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
+ <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
+ <xsl:variable name="fmt">
+ <xsl:choose>
+ <xsl:when test="substring-before($date0,' \*')='Arabic'">
+ <xsl:call-template name="oo数字格式域开关">
+ <xsl:with-param name="oo_format" select="substring-before($date0,' \*')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
- -->
- <!-- changing measure to mm -->
- <xsl:template name="convert2cm">
- <xsl:param name="value"/>
- <xsl:param name="rounding-factor" select="10000"/>
- <xsl:choose>
- <xsl:when test="contains($value, 'mm')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'mm') div $centimeter-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, $uofUnit)">
- <xsl:value-of select="substring-before($value, $uofUnit)"/>
- </xsl:when>
- <xsl:when test="contains($value, 'in')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'in') div $centimeter-in-mm * $inch-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pt') div $centimeter-in-mm * $point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'dpt')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'dpt') div $centimeter-in-mm * $didot-point-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'pica')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'pica') div $centimeter-in-mm * $pica-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'twip')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'twip') div $centimeter-in-mm * $twip-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:when test="contains($value, 'px')">
- <xsl:value-of select="round($rounding-factor * number(substring-before($value, 'px') div $centimeter-in-mm * $pixel-in-mm)) div $rounding-factor"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>measure_conversion.xsl: Find no conversion for <xsl:value-of select="$value"/> to 'cm'!</xsl:message>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="uof:通用边框">
- <xsl:param name="lineType"/>
- <xsl:param name="width"/>
- <xsl:param name="color"/>
- <xsl:choose>
- <xsl:when test="$lineType='none'">none</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$width"/>
- <xsl:choose>
- <xsl:when test="$lineType='single'">solid </xsl:when>
- <xsl:when test="$lineType='double'">double </xsl:when>
- <xsl:otherwise>solid </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="$color='auto' or $color='none' or $color=''">#808080</xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$color"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="uof:边框">
- <xsl:if test="uof:上">
- <xsl:variable name="type" select="uof:上/@uof:类型"/>
- <xsl:variable name="size" select="concat(uof:上/@uof:宽度,$uofUnit,' ')"/>
- <xsl:variable name="clr" select="uof:上/@uof:颜色"/>
- <xsl:attribute name="fo:border-top"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
- <xsl:if test="uof:上/@uof:线宽度">
- <xsl:attribute name="style:border-line-width-top"><xsl:value-of select="uof:上/@uof:线宽度"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="uof:下">
- <xsl:variable name="type" select="uof:下/@uof:类型"/>
- <xsl:variable name="size" select="concat(uof:下/@uof:宽度,$uofUnit,' ')"/>
- <xsl:variable name="clr" select="uof:下/@uof:颜色"/>
- <xsl:attribute name="fo:border-bottom"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
- <xsl:if test="uof:下/@uof:线宽度">
- <xsl:attribute name="style:border-line-width-bottom"><xsl:value-of select="uof:下/@uof:线宽度"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="uof:左">
- <xsl:variable name="type" select="uof:左/@uof:类型"/>
- <xsl:variable name="size" select="concat(uof:左/@uof:宽度,$uofUnit,' ')"/>
- <xsl:variable name="clr" select="uof:左/@uof:颜色"/>
- <xsl:attribute name="fo:border-left"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
- <xsl:if test="uof:左/@uof:线宽度">
- <xsl:attribute name="style:border-line-width-left"><xsl:value-of select="uof:左/@uof:线宽度"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="uof:右">
- <xsl:variable name="type" select="uof:右/@uof:类型"/>
- <xsl:variable name="size" select="concat(uof:右/@uof:宽度,$uofUnit,' ')"/>
- <xsl:variable name="clr" select="uof:右/@uof:颜色"/>
- <xsl:attribute name="fo:border-right"><xsl:call-template name="uof:通用边框"><xsl:with-param name="lineType" select="$type"/><xsl:with-param name="width" select="$size"/><xsl:with-param name="color" select="$clr"/></xsl:call-template></xsl:attribute>
- <xsl:if test="uof:右/@uof:线宽度">
- <xsl:attribute name="style:border-line-width-right"><xsl:value-of select="uof:右/@uof:线宽度"/></xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="uof:上/@uof:阴影='true'or uof:上/@uof:阴影='1'">
- <xsl:if test="uof:左/@uof:阴影='true'or uof:左/@uof:阴影='1'">
- <xsl:attribute name="style:shadow">#808080 -0.18cm -0.18cm</xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="uof:上/@uof:阴影='true'or uof:上/@uof:阴影='1'">
- <xsl:if test="uof:右/@uof:阴影='true'or uof:右/@uof:阴影='1'">
- <xsl:attribute name="style:shadow">#808080 0.18cm -0.18cm</xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="uof:下/@uof:阴影='true'or uof:下/@uof:阴影='1'">
- <xsl:if test="uof:左/@uof:阴影='true'or uof:左/@uof:阴影='1'">
- <xsl:attribute name="style:shadow">#808080 -0.18cm 0.18cm</xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="uof:下/@uof:阴影='true'or uof:下/@uof:阴影='1'">
- <xsl:if test="uof:右/@uof:阴影='true'or uof:右/@uof:阴影='1'">
- <xsl:attribute name="style:shadow">#808080 0.18cm 0.18cm</xsl:attribute>
- </xsl:if>
- </xsl:if>
- <xsl:if test="uof:上/@uof:边距">
- <xsl:attribute name="fo:padding-top"><xsl:value-of select="concat(uof:上/@uof:边距,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="uof:下/@uof:边距">
- <xsl:attribute name="fo:padding-bottom"><xsl:value-of select="concat(uof:下/@uof:边距,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="uof:左/@uof:边距">
- <xsl:attribute name="fo:padding-left"><xsl:value-of select="concat(uof:左/@uof:边距,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="uof:右/@uof:边距">
- <xsl:attribute name="fo:padding-right"><xsl:value-of select="concat(uof:右/@uof:边距,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template name="uof:填充">
- <xsl:choose>
- <xsl:when test="图:颜色">
- <xsl:attribute name="fo:background-color"><xsl:choose><xsl:when test="图:颜色"><xsl:value-of select="图:颜色"/></xsl:when><xsl:otherwise>transparent</xsl:otherwise></xsl:choose></xsl:attribute>
- </xsl:when>
- <xsl:when test="contains(图:图案/@图:前景色,'#')">
- <xsl:attribute name="fo:text-background-color"><xsl:value-of select="图:图案/@图:前景色"/></xsl:attribute>
- </xsl:when>
- <xsl:when test="图:图案/@图:背景色">
- <xsl:attribute name="fo:background-color"><xsl:value-of select="图:图案/@图:背景色"/></xsl:attribute>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- <xsl:if test="图:图片">
- <xsl:element name="style:background-image">
- <xsl:variable name="gid">
- <xsl:value-of select="图:图片/@图:图形引用"/>
- </xsl:variable>
- <xsl:if test="图:图片/@图:位置 and not(图:图片/@图:位置='tile')">
- <xsl:attribute name="style:repeat"><xsl:choose><xsl:when test="图:图片/@图:位置='stretch'">stretch</xsl:when><xsl:when test="图:图片/@图:位置='center'">no-repeat</xsl:when></xsl:choose></xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据">
- <xsl:element name="office:binary-data">
- <xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:数据"/>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="xlink:href"><xsl:value-of select="/uof:UOF/uof:对象集/uof:其他对象[@uof:标识符=$gid]/uof:路径"/></xsl:attribute>
- <xsl:attribute name="xlink:type">simple</xsl:attribute>
- <xsl:attribute name="xlink:actuate">onLoad</xsl:attribute>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="日期域">
- <xsl:if test="following-sibling::字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
- <xsl:variable name="datestr">
- <xsl:choose>
- <xsl:when test="contains($date0,'\*')">
- <xsl:value-of select="string(substring-before($date0,'\*'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$date0"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:call-template name="zydate">
- <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="zydate">
- <xsl:param name="str1"/>
- <xsl:choose>
- <xsl:when test="substring($str1,1,5)='am/pm'">
- <xsl:variable name="str1-before" select="substring($str1,1,5)"/>
- <xsl:variable name="str1-after" select="substring($str1,6)"/>
- <number:am-pm/>
- <xsl:if test="not($str1-after)=''">
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- </xsl:if>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zytime">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
-
- <xsl:choose>
- <xsl:when test="substring($str1,1,4)='yyyy'">
- <xsl:variable name="str1-before" select="substring($str1,1,4)"/>
- <xsl:variable name="str1-after" select="substring($str1,5)"/>
- <number:year number:style="long"/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zydate">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="substring($str1,1,1)=substring($str1,2,1) and substring($str1,2,1) !=substring($str1,3,1) ">
- <xsl:variable name="str1-before" select="substring($str1,1,2)"/>
- <xsl:variable name="str1-after" select="substring($str1,3)"/>
- <xsl:if test="substring($str1,1,1)='y'">
- <number:year/>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='M'">
- <number:month number:style="long"/>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='d'">
- <number:day number:style="long"/>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='h'">
- <number:hours number:style="long"/>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='m'">
- <number:minutes number:style="long"/>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='s'">
- <number:seconds number:style="long"/>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='W'">
- <number:week-of-year number:style="long"/>
- </xsl:if>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zydate">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="substring($str1,1,1)='M'or substring($str1,1,1)='d'or substring($str1,1,1)='h'or substring($str1,1,1)='m'or substring($str1,1,1)='s'">
- <xsl:variable name="str1-after" select="substring($str1,2)"/>
- <xsl:variable name="str1-before" select="substring($str1,1,1)"/>
- <xsl:if test="substring($str1,1,1)='M'">
- <number:month/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='d'">
- <number:day/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='h'">
- <number:hours/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='m'">
- <number:minutes/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='s'">
- <number:seconds/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- </xsl:if>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zydate">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- <xsl:if test="contains(substring($str1,1,3),'Q' )">
- <xsl:choose>
- <xsl:when test="substring($str1,1,1)='Q'">
- <xsl:variable name="str1-before" select="substring($str1,1,2)"/>
- <xsl:variable name="str1-after" select="substring($str1,3)"/>
- <number:quarter/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zydate">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="str1-before" select="substring($str1,1,5)"/>
- <xsl:variable name="str1-after" select="substring($str1,6)"/>
- <number:quarter number:style="long"/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zydate">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="contains(substring(normalize-space($str1),1,3),'W' )">
- <xsl:variable name="str1-before" select="substring(normalize-space($str1),1,3)"/>
- <xsl:variable name="str1-after" select="substring(normalize-space($str1),4)"/>
- <number:day-of-week number:style="long"/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zydate">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- <xsl:if test="contains(substring($str1,1,3),'NN' ) and substring($str1,1,1)!='NN' ">
- <xsl:variable name="str1-before" select="substring($str1,1,3)"/>
- <xsl:variable name="str1-after" select="substring($str1,4)"/>
- <number:text>第</number:text>
- <number:week-of-year/>
- <number:text>周</number:text>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zydate">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="时间域">
- <xsl:if test="following-sibling::字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
- <xsl:variable name="datestr" select="$date0"/>
- <xsl:call-template name="zytime">
- <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="zytime">
- <xsl:param name="str1"/>
- <xsl:choose>
- <xsl:when test="substring($str1,1,5)='am/pm'">
- <xsl:variable name="str1-before" select="substring($str1,1,5)"/>
- <xsl:variable name="str1-after" select="substring($str1,6)"/>
- <number:am-pm/>
- <xsl:if test="not($str1-after)=''">
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- </xsl:if>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zytime">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="substring($str1,1,1)=substring($str1,2,1) and substring($str1,2,1) !=substring($str1,3,1) ">
- <xsl:variable name="str1-before" select="substring($str1,1,2)"/>
- <xsl:variable name="str1-after" select="substring($str1,3)"/>
- <xsl:if test="substring($str1,1,1)='H' or substring($str1,1,1)='h'">
- <number:hours number:style="long"/>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='M' or substring($str1,1,1)='m'">
- <number:minutes number:style="long"/>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='S' or substring($str1,1,1)='s'">
- <number:seconds number:style="long"/>
- </xsl:if>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zytime">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="substring($str1,1,1)='H'or substring($str1,1,1)='M'or substring($str1,1,1)='S'or substring($str1,1,1)='h' or substring($str1,1,1)='m' or substring($str1,1,1)='s'">
- <xsl:variable name="str1-after" select="substring($str1,2)"/>
- <xsl:variable name="str1-before" select="substring($str1,1,1)"/>
- <xsl:if test="substring($str1,1,1)='H' or substring($str1,1,1)='h'">
- <number:hours/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='M' or substring($str1,1,1)='m'">
- <number:minutes/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- </xsl:if>
- <xsl:if test="substring($str1,1,1)='S' or substring($str1,1,1)='s'">
- <number:seconds/>
- <number:text>
- <xsl:value-of select="substring($str1-after,1,1)"/>
- </number:text>
- </xsl:if>
- <xsl:if test="string-length($str1-after)&gt;1">
- <xsl:call-template name="zytime">
- <xsl:with-param name="str1" select="substring($str1-after,2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="oo数字格式域开关">
- <xsl:param name="oo_format"/>
- <xsl:choose>
- <xsl:when test="$oo_format='Arabic'">1</xsl:when>
- <xsl:when test="$oo_format='ROMAN'">I</xsl:when>
- <xsl:when test="$oo_format='roman'">i</xsl:when>
- <xsl:when test="$oo_format='ALPHABETIC'">A</xsl:when>
- <xsl:when test="$oo_format='alphabetic'">a</xsl:when>
- <xsl:when test="$oo_format='GB1'">1, 2, 3, ...</xsl:when>
- <xsl:when test="$oo_format='GB3'">①, ②, ③, ...</xsl:when>
- <xsl:when test="$oo_format='CHINESENUM3'">一, 二, 三, ...</xsl:when>
- <xsl:when test="$oo_format='CHINESENUM2'">壹, 贰, 叁, ...</xsl:when>
- <xsl:when test="$oo_format='ZODIAC1'">甲, 乙, 丙, ...</xsl:when>
- <xsl:when test="$oo_format='ZODIAC2'">子, 丑, 寅, ...</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="题注">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串 or 字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="aa" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,'\f ')"/>
- <xsl:variable name="ooow" select="substring-after($aa,'ooow:') "/>
- <xsl:variable name="as" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="ad">
- <xsl:value-of select="substring-after($as,'SEQ ') "/>
- </xsl:variable>
- <xsl:variable name="num">
- <xsl:value-of select="substring-after(substring-before(../字:域代码/字:段落/字:句/字:文本串,' \f'),'\* ')"/>
- </xsl:variable>
- <xsl:variable name="fmt">
- <xsl:call-template name="oo数字格式域开关">
- <xsl:with-param name="oo_format" select="$num"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:element name="text:sequence">
- <xsl:attribute name="text:name"><xsl:choose><xsl:when test="$ad='表格'">Table</xsl:when><xsl:when test="$ad='图表'">Drawing</xsl:when><xsl:otherwise><xsl:value-of select="$ad"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="text:formula"><xsl:choose><xsl:when test="contains($aa,'ooow:')"><xsl:value-of select="$ooow"/></xsl:when><xsl:when test="contains($as,'表格')"><xsl:value-of select="concat('Table','+',$fmt)"/></xsl:when><xsl:when test="contains($as,'图表')"><xsl:value-of select="concat('Drawing','+',$fmt)"/></xsl:when><xsl:otherwise><xsl:value-of select="$aa"/></xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="页码域">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串 or 字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
- <xsl:variable name="fmt">
- <xsl:call-template name="oo数字格式域开关">
- <xsl:with-param name="oo_format" select="$date0"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:element name="text:page-number">
- <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
- <xsl:attribute name="text:select-page">current</xsl:attribute>
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="页数域">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
- <xsl:variable name="fmt">
- <xsl:call-template name="oo数字格式域开关">
- <xsl:with-param name="oo_format" select="substring-before($date0,' \*')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:element name="text:page-count">
- <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="作者域">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
- <xsl:element name="text:initial-creator">
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="用户域">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
- <xsl:element name="text:author-name">
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="缩写域">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
- <xsl:element name="text:author-initials">
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="标题域">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
- <xsl:element name="text:title">
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="主题域">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
- <xsl:element name="text:subject">
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="文件名">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:element name="text:file-name">
- <xsl:variable name="string">
- <xsl:value-of select="../字:域代码/字:段落/字:句/字:文本串"/>
- </xsl:variable>
- <xsl:attribute name="text:display"><xsl:choose><xsl:when test="contains($string,' \p')">full</xsl:when><xsl:otherwise>name-and-extension</xsl:otherwise></xsl:choose></xsl:attribute>
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:template name="编辑时间">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
- <xsl:variable name="datestr" select="$date0"/>
- <xsl:call-template name="zytime">
- <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="创建时间">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(following-sibling::字:域代码/字:段落/字:句/字:文本串,'\@ ')"/>
- <xsl:variable name="datestr" select="$date0"/>
- <xsl:call-template name="zytime">
- <xsl:with-param name="str1" select="substring($datestr,2,string-length($datestr)-2)"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
- <xsl:template name="字符数">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
- <xsl:variable name="fmt">
- <xsl:call-template name="oo数字格式域开关">
- <xsl:with-param name="oo_format" select="substring-before($date0,' \#')"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:element name="text:character-count">
- <xsl:attribute name="style:num-format"><xsl:value-of select="$fmt"/></xsl:attribute>
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
- <xsl:key name="mulu" match="/uof:UOF/uof:式样集/uof:段落式样" use="@字:标识符"/>
- <xsl:template name="索引域">
- <xsl:element name="text:alphabetical-index">
- <xsl:variable name="stylenum">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
- </xsl:variable>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
- <xsl:variable name="aanum">
- <xsl:number value="0" format="1"/>
- </xsl:variable>
- <xsl:attribute name="text:name"><xsl:value-of select="concat('索引目录',$aanum + 1)"/></xsl:attribute>
- <text:alphabetical-index-source text:main-entry-style-name="Main_index_entry" text:sort-algorithm="pinyin" fo:language="zh" fo:country="CN">
- <text:index-title-template text:style-name="Index_20_Heading">索引目录</text:index-title-template>
- <text:alphabetical-index-entry-template text:outline-level="separator" text:style-name="Index_Separator">
- <text:index-entry-text/>
- </text:alphabetical-index-entry-template>
- <text:alphabetical-index-entry-template text:outline-level="1" text:style-name="Index_20_1">
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- </text:alphabetical-index-entry-template>
- <text:alphabetical-index-entry-template text:outline-level="2" text:style-name="Index_20_2">
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- </text:alphabetical-index-entry-template>
- <text:alphabetical-index-entry-template text:outline-level="3" text:style-name="Index_20_3">
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- </text:alphabetical-index-entry-template>
- </text:alphabetical-index-source>
- <text:index-body>
- <text:index-title>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
- <xsl:attribute name="text:name"><xsl:value-of select="concat('索引目录',$aanum + 1,'_Head')"/></xsl:attribute>
- <xsl:for-each select="字:域代码/字:段落[position()=2]">
- <text:p text:style-name="Index_20_Heading">
- <xsl:apply-templates select=".//字:文本串"/>
- </text:p>
- </xsl:for-each>
- </text:index-title>
- <xsl:if test="字:域开始/@字:类型='INDEX'">
- <xsl:for-each select="字:域代码/字:段落[position()>2]">
- <xsl:element name="text:p">
- <xsl:variable name="aa">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
- </xsl:variable>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$aa + 1)"/></xsl:attribute>
- <xsl:for-each select="字:句">
- <xsl:apply-templates select="self::node()/*"/>
- </xsl:for-each>
- </xsl:element>
- </xsl:for-each>
- </xsl:if>
- </text:index-body>
- </xsl:element>
- </xsl:template>
- <xsl:template name="目录域">
- <xsl:element name="text:table-of-content">
- <xsl:variable name="stylenum">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:句" format="1"/>
- </xsl:variable>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
- <xsl:variable name="aanum">
- <xsl:number value="0" format="1"/>
- </xsl:variable>
- <xsl:attribute name="text:name"><xsl:value-of select="concat('内容目录',$aanum + 1)"/></xsl:attribute>
- <text:table-of-content-source text:outline-level="10">
- <text:index-title-template text:style-name="Contents_20_Heading">内容目录</text:index-title-template>
- <text:table-of-content-entry-template text:outline-level="1" text:style-name="Contents 1">
- <text:index-entry-link-start text:style-name="Index_20_Link"/>
- <text:index-entry-chapter/>
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- <text:index-entry-link-end/>
- </text:table-of-content-entry-template>
- <text:table-of-content-entry-template text:outline-level="2" text:style-name="Contents 2">
- <text:index-entry-link-start text:style-name="Index_20_Link"/>
- <text:index-entry-chapter/>
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- <text:index-entry-link-end/>
- </text:table-of-content-entry-template>
- <text:table-of-content-entry-template text:outline-level="3" text:style-name="Contents 3">
- <text:index-entry-link-start text:style-name="Index_20_Link"/>
- <text:index-entry-chapter/>
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- <text:index-entry-link-end/>
- </text:table-of-content-entry-template>
- <text:table-of-content-entry-template text:outline-level="4" text:style-name="Contents 4">
- <text:index-entry-link-start text:style-name="Index_20_Link"/>
- <text:index-entry-chapter/>
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- <text:index-entry-link-end/>
- </text:table-of-content-entry-template>
- <text:table-of-content-entry-template text:outline-level="5" text:style-name="Contents 5">
- <text:index-entry-link-start text:style-name="Index_20_Link"/>
- <text:index-entry-chapter/>
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- <text:index-entry-link-end/>
- </text:table-of-content-entry-template>
- <text:table-of-content-entry-template text:outline-level="6" text:style-name="Contents 6">
- <text:index-entry-link-start text:style-name="Index_20_Link"/>
- <text:index-entry-chapter/>
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- <text:index-entry-link-end/>
- </text:table-of-content-entry-template>
- <text:table-of-content-entry-template text:outline-level="7" text:style-name="Contents 7">
- <text:index-entry-link-start text:style-name="Index_20_Link"/>
- <text:index-entry-chapter/>
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- <text:index-entry-link-end/>
- </text:table-of-content-entry-template>
- <text:table-of-content-entry-template text:outline-level="8" text:style-name="Contents 8">
- <text:index-entry-link-start text:style-name="Index_20_Link"/>
- <text:index-entry-chapter/>
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- <text:index-entry-link-end/>
- </text:table-of-content-entry-template>
- <text:table-of-content-entry-template text:outline-level="9" text:style-name="Contents 9">
- <text:index-entry-link-start text:style-name="Index_20_Link"/>
- <text:index-entry-chapter/>
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- <text:index-entry-link-end/>
- </text:table-of-content-entry-template>
- <text:table-of-content-entry-template text:outline-level="10" text:style-name="Contents 10">
- <text:index-entry-link-start text:style-name="Index_20_Link"/>
- <text:index-entry-chapter/>
- <text:index-entry-text/>
- <text:index-entry-tab-stop style:type="right" style:leader-char="."/>
- <text:index-entry-page-number/>
- <text:index-entry-link-end/>
- </text:table-of-content-entry-template>
- </text:table-of-content-source>
- <text:index-body>
- <text:index-title>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat('Sect',$stylenum)"/></xsl:attribute>
- <xsl:attribute name="text:name"><xsl:value-of select="concat('内容目录',$aanum + 1,'_Head')"/></xsl:attribute>
- <xsl:for-each select="字:域代码/字:段落[position()=2]">
- <text:p text:style-name="Contents_20_Heading">
- <xsl:apply-templates select=".//字:文本串"/>
- </text:p>
- </xsl:for-each>
- </text:index-title>
- <xsl:if test="字:域开始/@字:类型='REF'">
- <xsl:for-each select="字:域代码/字:段落[position()>2]">
- <xsl:element name="text:p">
- <xsl:variable name="aa">
- <xsl:number from="/uof:UOF/uof:文字处理/字:主体" level="any" count="字:段落[字:段落属性]"/>
- </xsl:variable>
- <xsl:attribute name="text:style-name"><xsl:value-of select="concat('P',$aa + 1)"/></xsl:attribute>
- <xsl:element name="text:a">
- <xsl:attribute name="xlink:type">simple</xsl:attribute>
- <xsl:attribute name="text:style-name">Index Link</xsl:attribute>
- <xsl:attribute name="text:visited-style-name">Index Link</xsl:attribute>
- <xsl:variable name="hyperDest" select="./字:句/字:区域开始/@字:标识符"/>
- <xsl:attribute name="xlink:href"><xsl:for-each select="/uof:UOF/uof:链接集/uof:超级链接"><xsl:if test="@uof:链源=$hyperDest"><xsl:value-of select="concat('#',@uof:书签)"/></xsl:if></xsl:for-each></xsl:attribute>
- <xsl:apply-templates select="字:句/*"/>
- </xsl:element>
- </xsl:element>
- </xsl:for-each>
- </xsl:if>
- </text:index-body>
- </xsl:element>
- </xsl:template>
- <xsl:template name="suojinleixing">
- <xsl:if test="字:缩进/字:首行/字:绝对/@字:值 and 字:缩进/字:左/字:绝对/@字:值">
- <xsl:attribute name="text:min-label-width"><xsl:value-of select="concat(0 - 字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- <xsl:attribute name="text:space-before"><xsl:value-of select="concat(字:缩进/字:左/字:绝对/@字:值 + 字:缩进/字:首行/字:绝对/@字:值,$uofUnit)"/></xsl:attribute>
- </xsl:if>
- </xsl:template>
- <xsl:template match="字:修订开始[@字:类型='insert']">
- <xsl:choose>
- <xsl:when test="./@字:标识符">
- <text:change-start text:change-id="{@字:标识符}"/>
- </xsl:when>
- <xsl:otherwise>
- <text:change-start text:change-id="{@字:修订信息引用}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:修订结束[preceding::字:修订开始[1]/@字:类型='insert']">
- <text:change-end>
- <xsl:attribute name="text:change-id"><xsl:value-of select="@字:开始标识引用"/></xsl:attribute>
- </text:change-end>
- </xsl:template>
- <xsl:template match="字:修订开始[@字:类型='delete']">
- <xsl:choose>
- <xsl:when test="./@字:标识符">
- <text:change-start text:change-id="{@字:标识符}"/>
- </xsl:when>
- <xsl:otherwise>
- <text:change-start text:change-id="{@字:修订信息引用}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:修订结束[preceding::字:修订开始[1]/@字:类型='delete']">
- <text:change-end>
- <xsl:attribute name="text:change-id"><xsl:value-of select="@字:开始标识引用"/></xsl:attribute>
- </text:change-end>
- </xsl:template>
- <xsl:template match="字:修订开始[@字:类型='format']">
- <xsl:choose>
- <xsl:when test="./@字:标识符">
- <text:change-start text:change-id="{@字:标识符}"/>
- </xsl:when>
- <xsl:otherwise>
- <text:change-start text:change-id="{@字:修订信息引用}"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="字:修订结束[preceding::字:修订开始[1]/@字:类型='format']">
- <text:change-end>
- <xsl:attribute name="text:change-id"><xsl:value-of select="@字:开始标识引用"/></xsl:attribute>
- </text:change-end>
- </xsl:template>
- <xsl:template name="GenerateTrackChanges">
- <text:tracked-changes>
- <xsl:if test="/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:修订">
- <xsl:attribute name="text:track-changes"><xsl:value-of select="/uof:UOF/uof:文字处理/字:公用处理规则/字:文档设置/字:修订/@字:值"/></xsl:attribute>
- </xsl:if>
- <xsl:if test="//字:段落/字:修订开始[@字:类型='insert']">
- <xsl:for-each select="//字:段落/字:修订开始[@字:类型='insert']">
- <xsl:variable name="id" select="@字:标识符"/>
- <xsl:variable name="aid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:作者"/>
- <xsl:variable name="sid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$aid]/@字:姓名"/>
- <xsl:variable name="bid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:日期"/>
- <text:changed-region text:id="{$id}">
- <xsl:choose>
- <xsl:when test="name()='字:修订开始'">
- <xsl:choose>
- <xsl:when test="not(name(following-sibling::node()[1])='字:修订结束')">
- <text:insertion>
- <office:change-info>
- <dc:creator>
- <xsl:value-of select="$sid"/>
- </dc:creator>
- <dc:date>
- <xsl:value-of select="$bid"/>
- </dc:date>
- </office:change-info>
- </text:insertion>
- </xsl:when>
- <xsl:otherwise>
- <text:format-change>
- <office:change-info>
- <dc:creator>
- <xsl:value-of select="$sid"/>
- </dc:creator>
- <dc:date>
- <xsl:value-of select="$bid"/>
- </dc:date>
- </office:change-info>
- </text:format-change>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </text:changed-region>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="//字:段落/字:修订开始[@字:类型='insert']">
- <xsl:for-each select="//字:段落/字:修订开始[@字:类型='delete']">
- <xsl:variable name="id" select="@字:标识符"/>
- <xsl:variable name="aid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:作者"/>
- <xsl:variable name="sid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$aid]/@字:姓名"/>
- <xsl:variable name="bid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:日期"/>
- <text:changed-region text:id="{$id}">
- <xsl:choose>
- <xsl:when test="name()='字:修订开始'">
- <xsl:choose>
- <xsl:when test="not(name(following-sibling::node()[1])='字:修订结束')">
- <text:deletion>
- <office:change-info>
- <dc:creator>
- <xsl:value-of select="$sid"/>
- </dc:creator>
- <dc:date>
- <xsl:value-of select="$bid"/>
- </dc:date>
- </office:change-info>
- </text:deletion>
- </xsl:when>
- <xsl:otherwise>
- <text:format-change>
- <office:change-info>
- <dc:creator>
- <xsl:value-of select="$sid"/>
- </dc:creator>
- <dc:date>
- <xsl:value-of select="$bid"/>
- </dc:date>
- </office:change-info>
- </text:format-change>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </text:changed-region>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="//字:段落/字:修订开始[@字:类型='format']">
- <xsl:for-each select="//字:段落/字:修订开始[@字:类型='format']">
- <xsl:variable name="id" select="@字:标识符"/>
- <xsl:variable name="aid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:作者"/>
- <xsl:variable name="sid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:用户集/字:用户[@字:标识符=$aid]/@字:姓名"/>
- <xsl:variable name="bid" select="/uof:UOF/uof:文字处理/字:公用处理规则/字:修订信息集/字:修订信息[@字:标识符=$id]/@字:日期"/>
- <text:changed-region text:id="{$id}">
- <xsl:choose>
- <xsl:when test="name()='字:修订开始'">
- <xsl:choose>
- <xsl:when test="not(name(following-sibling::node()[1])='字:修订结束')">
- <text:format-change>
- <office:change-info>
- <dc:creator>
- <xsl:value-of select="$sid"/>
- </dc:creator>
- <dc:date>
- <xsl:value-of select="$bid"/>
- </dc:date>
- </office:change-info>
- </text:format-change>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
- </text:changed-region>
- </xsl:for-each>
- </xsl:if>
-
- </text:tracked-changes>
-
- </xsl:template>
- <xsl:template name="oo数字格式">
- <xsl:param name="oo_format"/>
- <xsl:choose>
- <xsl:when test="$oo_format='decimal'">1</xsl:when>
- <xsl:when test="$oo_format='upper-roman'">I</xsl:when>
- <xsl:when test="$oo_format='lower-roman'">i</xsl:when>
- <xsl:when test="$oo_format='upper-letter'">A</xsl:when>
- <xsl:when test="$oo_format='lower-letter'">a</xsl:when>
- <xsl:when test="$oo_format='decimal-full-width'">1, 2, 3, ...</xsl:when>
- <xsl:when test="$oo_format='decimal-enclosed-circle'">①, ②, ③, ...</xsl:when>
- <xsl:when test="$oo_format='chinese-counting'">一, 二, 三, ...</xsl:when>
- <xsl:when test="$oo_format='chinese-legal-simplified'">壹, 贰, 叁, ...</xsl:when>
- <xsl:when test="$oo_format='ideograph-traditional'">甲, 乙, 丙, ...</xsl:when>
- <xsl:when test="$oo_format='ideograph-zodiac'">子, 丑, 寅, ...</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="章节域">
- <xsl:if test="../字:域代码/字:段落/字:句/字:文本串">
- <xsl:variable name="date0" select="substring-after(../字:域代码/字:段落/字:句/字:文本串,' \* ')"/>
- <xsl:variable name="datestr" select="substring-before(../字:域代码/字:段落/字:句/字:文本串,'\* ')"/>
- <xsl:variable name="fmt">
- <xsl:choose>
- <xsl:when test="substring-before($date0,' \*')='Arabic'">
- <xsl:call-template name="oo数字格式域开关">
- <xsl:with-param name="oo_format" select="substring-before($date0,' \*')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:element name="text:chapter">
- <xsl:attribute name="text:display">name</xsl:attribute>
- <xsl:attribute name="text:outline-level"><xsl:value-of select="$fmt"/></xsl:attribute>
- <xsl:value-of select="following-sibling::字:句/字:文本串"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
+ <xsl:element name="text:chapter">
+ <xsl:attribute name="text:display">name</xsl:attribute>
+ <xsl:attribute name="text:outline-level"><xsl:value-of select="$fmt"/></xsl:attribute>
+ <xsl:value-of select="following-sibling::字:句/字:文本串"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/import/wordml/wordml2ooo.xsl b/filter/source/xslt/import/wordml/wordml2ooo.xsl
index be19109eef26..972a54ecc603 100644
--- a/filter/source/xslt/import/wordml/wordml2ooo.xsl
+++ b/filter/source/xslt/import/wordml/wordml2ooo.xsl
@@ -59,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"/>
@@ -208,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>
diff --git a/filter/source/xslt/import/wordml/wordml2ooo_draw.xsl b/filter/source/xslt/import/wordml/wordml2ooo_draw.xsl
index 7fe2da59b120..fcff21e7e614 100644
--- a/filter/source/xslt/import/wordml/wordml2ooo_draw.xsl
+++ b/filter/source/xslt/import/wordml/wordml2ooo_draw.xsl
@@ -19,7 +19,7 @@
<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: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">
@@ -205,9 +205,9 @@
<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-->
</xsl:if>
@@ -584,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>
@@ -1513,7 +1513,7 @@
</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 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.
@@ -1632,13 +1632,13 @@
<xsl:apply-templates select="w:binData[@w:name='oledata.mso']" mode="oledata.mso"/>
</xsl:template>
<xsl:template match="w:binData" mode="oledata.mso">
- <xsl:variable name="tmp" select="ole:insertByName('oledata.mso', translate(text(),'&#10;&#13;&#32;','' ) )"/>
+ <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:value-of select="translate(ole:getByName(@ObjectID),'&#13;','')"/>
+ <xsl:value-of select="translate(ole:getByName(@ObjectID),'&#13;','')"/>
</xsl:element>
</draw:object-ole>
</xsl:template>
@@ -1738,9 +1738,9 @@
</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
<xsl:variable name="adjust-x" select="substring-before(@adj,',')"/>
@@ -1751,17 +1751,17 @@
<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,','))">-->
+ <!--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="@adj"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:if>-->
<xsl:variable name="viewbox">
<xsl:value-of select="'0 0'"/>
<xsl:value-of select="' '"/>
@@ -1864,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><- -->
+ <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.-->
+ 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' ">
@@ -1887,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,' ')"/>
diff --git a/filter/source/xslt/import/wordml/wordml2ooo_field.xsl b/filter/source/xslt/import/wordml/wordml2ooo_field.xsl
index dece47c2351b..0fae0efa4ccd 100644
--- a/filter/source/xslt/import/wordml/wordml2ooo_field.xsl
+++ b/filter/source/xslt/import/wordml/wordml2ooo_field.xsl
@@ -225,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>
@@ -531,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>
@@ -671,15 +671,15 @@
</xsl:template>
<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">
@@ -1271,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>
@@ -1297,7 +1297,7 @@
<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:when test="contains($input_MS_num_format, 'hebrew2' ) ">
<xsl:text>א, ב, ג, ...</xsl:text>
</xsl:when>
<xsl:when test="contains($input_MS_num_format, 'ArabicAlpha' ) ">
@@ -1333,15 +1333,15 @@
</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 style -->
<xsl:template name="default_date_style">
@@ -1510,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">
@@ -1566,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">
diff --git a/filter/source/xslt/import/wordml/wordml2ooo_path.xsl b/filter/source/xslt/import/wordml/wordml2ooo_path.xsl
index b4f0aaa4ac45..253599155eb4 100644
--- a/filter/source/xslt/import/wordml/wordml2ooo_path.xsl
+++ b/filter/source/xslt/import/wordml/wordml2ooo_path.xsl
@@ -580,11 +580,11 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
- <!--
+ <!--
**Template vmlpath2enhancedpath**
- The template is responsible for converting the vml-path to enhanced-path, because the svg:path
+ The template is responsible 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 mapping to
+ 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">
@@ -758,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 , ':') "/>
@@ -976,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 ' ) "/>
@@ -1488,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 implicitly 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"/>
diff --git a/filter/source/xslt/import/wordml/wordml2ooo_props.xsl b/filter/source/xslt/import/wordml/wordml2ooo_props.xsl
index 86e7b0a511d6..85a4555fe870 100644
--- a/filter/source/xslt/import/wordml/wordml2ooo_props.xsl
+++ b/filter/source/xslt/import/wordml/wordml2ooo_props.xsl
@@ -104,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')"/>
@@ -112,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>
@@ -127,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 >
diff --git a/filter/source/xslt/import/wordml/wordml2ooo_table.xsl b/filter/source/xslt/import/wordml/wordml2ooo_table.xsl
index ee18f4a885e2..83a9004e4ddd 100644
--- a/filter/source/xslt/import/wordml/wordml2ooo_table.xsl
+++ b/filter/source/xslt/import/wordml/wordml2ooo_table.xsl
@@ -170,9 +170,9 @@
<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>
diff --git a/filter/source/xslt/import/wordml/wordml2ooo_text.xsl b/filter/source/xslt/import/wordml/wordml2ooo_text.xsl
index 766cb9313889..e2b94b3ec51f 100644
--- a/filter/source/xslt/import/wordml/wordml2ooo_text.xsl
+++ b/filter/source/xslt/import/wordml/wordml2ooo_text.xsl
@@ -511,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>
@@ -788,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>
diff --git a/filter/source/xslt/odf2xhtml/export/common/body.xsl b/filter/source/xslt/odf2xhtml/export/common/body.xsl
index 05b78a5ed43e..6ef28bc68e0d 100644
--- a/filter/source/xslt/odf2xhtml/export/common/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/body.xsl
@@ -1,428 +1,427 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * 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:java="http://xml.apache.org/xslt/java" xmlns:urlencoder="http://www.jclark.com/xt/java/java.net.URLEncoder" 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 java urlencoder">
-
-
- <xsl:include href="table_of_content.xsl"/>
-
-
- <!-- ****************** -->
- <!-- *** Whitespace *** -->
- <!-- ****************** -->
-
- <xsl:template match="text:s">
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="@text:c"/>
- </xsl:call-template>
- </xsl:template>
-
-
- <!--write the number of 'whitespaces' -->
- <xsl:template name="write-breakable-whitespace">
- <xsl:param name="whitespaces"/>
-
- <!--write two space chars as the normal white space character will be stripped
- and the other is able to break -->
- <xsl:text>&#160;</xsl:text>
- <xsl:if test="$whitespaces >= 2">
- <xsl:call-template name="write-breakable-whitespace-2">
- <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
-
- <!--write the number of 'whitespaces' -->
- <xsl:template name="write-breakable-whitespace-2">
- <xsl:param name="whitespaces"/>
- <!--write two space chars as the normal white space character will be stripped
- and the other is able to break -->
- <xsl:text> </xsl:text>
- <xsl:if test="$whitespaces >= 2">
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <!-- currentSolution: 8 non-breakable-spaces instead of a TAB is an approximation.
- Sometimes less spaces than 8 might be needed and the output might be more difficult to read-->
- <xsl:template match="text:tab">
- <xsl:param name="globalData"/>
-
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="8"/>
- </xsl:call-template>
- </xsl:template>
-
-
-
- <!-- *************** -->
- <!-- *** Textbox *** -->
- <!-- *************** -->
-
- <!-- ID / NAME of text-box -->
- <xsl:template match="@draw:name">
- <xsl:attribute name="id">
- <xsl:choose>
- <xsl:when test="number(substring(.,1,1))">
- <!-- Heuristic: If the first character is a number a 'a_' will be set
- as prefix, as id have to be of type NMTOKEN -->
- <xsl:value-of select="concat('a_',translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:template>
-
-
- <xsl:template match="text:line-break">
- <xsl:param name="listIndent"/>
-
- <xsl:element namespace="{$namespace}" name="br"/>
-
- <!-- line breaks in lists need an indent similar to the list label -->
- <xsl:if test="$listIndent">
- <xsl:element namespace="{$namespace}" name="span">
- <xsl:attribute name="style">margin-left:<xsl:value-of select="$listIndent"/>cm</xsl:attribute>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
-
- <!-- currently there have to be an explicit call of the style attribute nodes, maybe the attributes nodes have no priority only order relevant-->
- <xsl:template name="apply-styles-and-content">
- <xsl:param name="globalData"/>
- <xsl:param name="footnotePrefix" />
- <xsl:apply-templates select="@*">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- <!-- the footnote symbol is the prefix for a footnote in the footer -->
- <xsl:copy-of select="$footnotePrefix"/>
- <xsl:apply-templates select="node()">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
- <!-- ******************* -->
- <!-- *** References *** -->
- <!-- ******************* -->
-
- <xsl:template match="text:reference-ref | text:sequence-ref | text:bookmark-ref">
- <xsl:param name="globalData"/>
- <xsl:if test="*|text()">
- <xsl:element namespace="{$namespace}" name="a">
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text>
- <xsl:choose>
- <xsl:when test="number(substring(@text:ref-name,1,1))">
- <!-- Heuristic: If the first character is a number a 'a_' will be set
- as prefix, as id have to be of type NMTOKEN -->
- <xsl:value-of select="concat('a_',translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
-
- <xsl:apply-templates select="@* | node()">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
-
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="@text:name">
- <xsl:attribute name="id">
- <xsl:choose>
- <xsl:when test="number(substring(.,1,1))">
- <!-- Heuristic: If the first character is a number a 'a_' will be set
- as prefix, as id have to be of type NMTOKEN -->
- <xsl:value-of select="concat('a_',translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:template>
-
- <xsl:template match="text:sequence">
- <xsl:param name="globalData"/>
-
- <xsl:element namespace="{$namespace}" name="a">
- <xsl:apply-templates select="@*" />
- <xsl:attribute name="id">
- <xsl:choose>
- <xsl:when test="number(substring(@text:ref-name,1,1))">
- <!-- Heuristic: If the first character is a number a 'a_' will be set
- as prefix, as id have to be of type NMTOKEN -->
- <xsl:value-of select="concat('a_',translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:element>
-
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="text:reference-mark">
- <xsl:param name="globalData"/>
-
- <xsl:element namespace="{$namespace}" name="a">
- <xsl:apply-templates select="@*" />
- <xsl:attribute name="id">
- <xsl:choose>
- <xsl:when test="number(substring(@text:name,1,1))">
- <!-- Heuristic: If the first character is a number a 'a_' will be set
- as prefix, as id have to be of type NMTOKEN -->
- <xsl:value-of select="concat('a_',translate(@text:name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="translate(@text:name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- </xsl:element>
-
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
- <xsl:template match="text:reference-mark-start">
- <xsl:param name="globalData"/>
-
- <xsl:element namespace="{$namespace}" name="a">
- <xsl:apply-templates select="@*" />
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="text:bibliography-mark">
- <xsl:param name="globalData"/>
-
- <xsl:element namespace="{$namespace}" name="a">
- <xsl:apply-templates select="@* | node()">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
-
- <!-- @text:title exist only in text:bibliography-mark -->
- <xsl:template match="@text:title">
- <xsl:attribute name="title">
- <xsl:value-of select="."/>
- </xsl:attribute>
- </xsl:template>
-
- <!-- @text:url exist only in text:bibliography-mark -->
- <xsl:template match="@text:url">
- <xsl:attribute name="href">
- <xsl:value-of select="."/>
- </xsl:attribute>
- </xsl:template>
-
- <xsl:template match="text:user-defined">
- <xsl:apply-templates/>
- </xsl:template>
-
-
- <xsl:template match="office:annotation">
- <xsl:element name="span">
- <xsl:attribute name="title">annotation</xsl:attribute>
- <xsl:attribute name="class">annotation_style_by_filter</xsl:attribute>
- <xsl:apply-templates select="@*" />
- <br/>
- <xsl:text>[ANNOTATION:</xsl:text>
- <br/>
- <xsl:apply-templates select="*" mode="annotation"/>
- <xsl:text>]</xsl:text>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="text:p" mode="annotation">
- <br/>
- <xsl:element name="span">
- <xsl:text>NOTE: '</xsl:text>
- <xsl:apply-templates />
- <xsl:text>'</xsl:text>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="dc:creator" mode="annotation">
- <br/>
- <xsl:element name="span">
- <xsl:attribute name="title">dc:creator</xsl:attribute>
- <xsl:text>BY '</xsl:text>
- <xsl:apply-templates />
- <xsl:text>'</xsl:text>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="dc:date" mode="annotation">
- <br/>
- <xsl:element name="span">
- <xsl:attribute name="title">dc:date</xsl:attribute>
- <xsl:text>ON '</xsl:text>
- <xsl:apply-templates />
- <xsl:text>'</xsl:text>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="meta:date-string" mode="annotation">
- <br/>
- <xsl:element name="span">
- <xsl:attribute name="title">meta-date-string</xsl:attribute>
- <xsl:text>META DATE '</xsl:text>
- <xsl:apply-templates />
- <xsl:text>'</xsl:text>
- </xsl:element>
- </xsl:template>
-
-
- <!-- *************** -->
- <!-- *** HELPER *** -->
- <!-- *************** -->
-
-
- <xsl:template name="create-href">
- <xsl:param name="href"/>
- <xsl:param name="mimetype"/>
-
- <xsl:choose>
- <!-- internal OOo URL used in content tables -->
- <xsl:when test="contains($href, '%7Coutline') or contains($href, '|outline')">
- <!-- the simple workaround for content tables in a single document is to create create an anchor from every heading element
- work-around downside: Multiple identical headings won't refer always to the first.
- -->
- <xsl:text>#</xsl:text>
- <xsl:variable name="title">
- <xsl:apply-templates mode="concatenate"/>
- </xsl:variable>
-
- <xsl:value-of select="concat('a_', translate(normalize-space($title), '.,;: %()[]/\+', '_____________'))"/>
- </xsl:when>
- <xsl:when test="self::draw:image[office:binary-data]">
- <xsl:choose>
- <xsl:when test="$mimetype">
- <xsl:text>data:</xsl:text><xsl:value-of select="$mimetype"/><xsl:text>;base64,</xsl:text><xsl:value-of select="office:binary-data"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>data:image/*;base64,</xsl:text><xsl:value-of select="office:binary-data"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <!-- in case of packed open office document -->
- <xsl:when test="starts-with($sourceBaseURL, 'jar:') or $isPackageFormat">
- <xsl:choose>
- <!-- for images relative to open office document -->
- <xsl:when test="starts-with($href, '../')">
- <!-- creating an absolute http URL to the packed image file (removing the '.')-->
- <xsl:value-of select="concat(substring-after(substring-before($sourceBaseURL, '!'), 'jar:'), '/', $href, $optionalURLSuffix)"/>
- </xsl:when>
- <!-- for absolute URLs & absolute paths -->
- <xsl:when test="contains($href, ':') or starts-with($href, '/')">
- <xsl:value-of select="concat($href, $optionalURLSuffix)"/>
- </xsl:when>
- <!-- for images jared in open office document -->
- <xsl:otherwise>
- <xsl:value-of select="concat($sourceBaseURL, $href, $optionalURLSuffix)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <!-- for absolute URLs & Paths -->
- <xsl:when test="contains($href, ':') or starts-with($href, '/')">
- <xsl:value-of select="concat($href, $optionalURLSuffix)"/>
- </xsl:when>
- <!-- for relative URLs -->
- <xsl:when test="starts-with($href, '#')">
- <!-- intra document ref -->
- <xsl:value-of select="$href"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="concat($sourceBaseURL, $href, $optionalURLSuffix)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
- <xsl:template match="text()" mode="concatenate">
- <xsl:value-of select="."/>
- </xsl:template>
- <xsl:template match="*" mode="concatenate">
- <xsl:apply-templates mode="concatenate"/>
- </xsl:template>
-
-
- <!-- ******************** -->
- <!-- *** Common Rules *** -->
- <!-- ******************** -->
-
- <!-- ignore / neglect the following elements -->
- <xsl:template match="draw:custom-shape | draw:g | office:forms | text:alphabetical-index-mark | text:alphabetical-index-mark-end | text:alphabetical-index-mark-start | text:bibliography-source | text:number | text:reference-mark-end | text:sequence-decls | text:soft-page-break | text:table-of-content-source | text:tracked-changes | text:user-field-decls"/>
-
- <!-- default template used by purpose-->
- <xsl:template match="text:bibliography | text:change-end | text:change-start">
- <xsl:param name="globalData"/>
-
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- default template for not recognized elements -->
- <xsl:template match="*">
- <xsl:param name="globalData"/>
- <xsl:message>Using default element rule for ODF element '<xsl:value-of select="name()"/>'.</xsl:message>
-
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="@*"/>
-
- <!-- allowing all matched text nodes -->
- <xsl:template match="text()">
- <xsl:value-of select="."/>
- </xsl:template>
-
-</xsl:stylesheet>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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:java="http://xml.apache.org/xslt/java" xmlns:urlencoder="http://www.jclark.com/xt/java/java.net.URLEncoder" 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 java urlencoder">
+
+
+ <xsl:include href="table_of_content.xsl"/>
+
+
+ <!-- ****************** -->
+ <!-- *** Whitespace *** -->
+ <!-- ****************** -->
+
+ <xsl:template match="text:s">
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="@text:c"/>
+ </xsl:call-template>
+ </xsl:template>
+
+
+ <!--write the number of 'whitespaces' -->
+ <xsl:template name="write-breakable-whitespace">
+ <xsl:param name="whitespaces"/>
+
+ <!--write two space chars as the normal white space character will be stripped
+ and the other is able to break -->
+ <xsl:text>&#160;</xsl:text>
+ <xsl:if test="$whitespaces >= 2">
+ <xsl:call-template name="write-breakable-whitespace-2">
+ <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+
+ <!--write the number of 'whitespaces' -->
+ <xsl:template name="write-breakable-whitespace-2">
+ <xsl:param name="whitespaces"/>
+ <!--write two space chars as the normal white space character will be stripped
+ and the other is able to break -->
+ <xsl:text> </xsl:text>
+ <xsl:if test="$whitespaces >= 2">
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- currentSolution: 8 non-breakable-spaces instead of a TAB is an approximation.
+ Sometimes less spaces than 8 might be needed and the output might be more difficult to read-->
+ <xsl:template match="text:tab">
+ <xsl:param name="globalData"/>
+
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="8"/>
+ </xsl:call-template>
+ </xsl:template>
+
+
+
+ <!-- *************** -->
+ <!-- *** Textbox *** -->
+ <!-- *************** -->
+
+ <!-- ID / NAME of text-box -->
+ <xsl:template match="@draw:name">
+ <xsl:attribute name="id">
+ <xsl:choose>
+ <xsl:when test="number(substring(.,1,1))">
+ <!-- Heuristic: If the first character is a number a 'a_' will be set
+ as prefix, as id have to be of type NMTOKEN -->
+ <xsl:value-of select="concat('a_',translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:template>
+
+
+ <xsl:template match="text:line-break">
+ <xsl:param name="listIndent"/>
+
+ <xsl:element namespace="{$namespace}" name="br"/>
+
+ <!-- line breaks in lists need an indent similar to the list label -->
+ <xsl:if test="$listIndent">
+ <xsl:element namespace="{$namespace}" name="span">
+ <xsl:attribute name="style">margin-left:<xsl:value-of select="$listIndent"/>cm</xsl:attribute>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+
+ <!-- currently there have to be an explicit call of the style attribute nodes, maybe the attributes nodes have no priority only order relevant-->
+ <xsl:template name="apply-styles-and-content">
+ <xsl:param name="globalData"/>
+ <xsl:param name="footnotePrefix" />
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ <!-- the footnote symbol is the prefix for a footnote in the footer -->
+ <xsl:copy-of select="$footnotePrefix"/>
+ <xsl:apply-templates select="node()">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+
+ <!-- ******************* -->
+ <!-- *** References *** -->
+ <!-- ******************* -->
+
+ <xsl:template match="text:reference-ref | text:sequence-ref | text:bookmark-ref">
+ <xsl:param name="globalData"/>
+ <xsl:if test="*|text()">
+ <xsl:element namespace="{$namespace}" name="a">
+ <xsl:attribute name="href">
+ <xsl:text>#</xsl:text>
+ <xsl:choose>
+ <xsl:when test="number(substring(@text:ref-name,1,1))">
+ <!-- Heuristic: If the first character is a number a 'a_' will be set
+ as prefix, as id have to be of type NMTOKEN -->
+ <xsl:value-of select="concat('a_',translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <xsl:apply-templates select="@* | node()">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="@text:name">
+ <xsl:attribute name="id">
+ <xsl:choose>
+ <xsl:when test="number(substring(.,1,1))">
+ <!-- Heuristic: If the first character is a number a 'a_' will be set
+ as prefix, as id have to be of type NMTOKEN -->
+ <xsl:value-of select="concat('a_',translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate(., '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:template>
+
+ <xsl:template match="text:sequence">
+ <xsl:param name="globalData"/>
+
+ <xsl:element namespace="{$namespace}" name="a">
+ <xsl:apply-templates select="@*" />
+ <xsl:attribute name="id">
+ <xsl:choose>
+ <xsl:when test="number(substring(@text:ref-name,1,1))">
+ <!-- Heuristic: If the first character is a number a 'a_' will be set
+ as prefix, as id have to be of type NMTOKEN -->
+ <xsl:value-of select="concat('a_',translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate(@text:ref-name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:element>
+
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="text:reference-mark">
+ <xsl:param name="globalData"/>
+
+ <xsl:element namespace="{$namespace}" name="a">
+ <xsl:apply-templates select="@*" />
+ <xsl:attribute name="id">
+ <xsl:choose>
+ <xsl:when test="number(substring(@text:name,1,1))">
+ <!-- Heuristic: If the first character is a number a 'a_' will be set
+ as prefix, as id have to be of type NMTOKEN -->
+ <xsl:value-of select="concat('a_',translate(@text:name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________'))"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="translate(@text:name, '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </xsl:element>
+
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+
+ <xsl:template match="text:reference-mark-start">
+ <xsl:param name="globalData"/>
+
+ <xsl:element namespace="{$namespace}" name="a">
+ <xsl:apply-templates select="@*" />
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="text:bibliography-mark">
+ <xsl:param name="globalData"/>
+
+ <xsl:element namespace="{$namespace}" name="a">
+ <xsl:apply-templates select="@* | node()">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- @text:title exist only in text:bibliography-mark -->
+ <xsl:template match="@text:title">
+ <xsl:attribute name="title">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <!-- @text:url exist only in text:bibliography-mark -->
+ <xsl:template match="@text:url">
+ <xsl:attribute name="href">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <xsl:template match="text:user-defined">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="office:annotation">
+ <xsl:element name="span">
+ <xsl:attribute name="title">annotation</xsl:attribute>
+ <xsl:attribute name="class">annotation_style_by_filter</xsl:attribute>
+ <xsl:apply-templates select="@*" />
+ <br/>
+ <xsl:text>[ANNOTATION:</xsl:text>
+ <br/>
+ <xsl:apply-templates select="*" mode="annotation"/>
+ <xsl:text>]</xsl:text>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="text:p" mode="annotation">
+ <br/>
+ <xsl:element name="span">
+ <xsl:text>NOTE: '</xsl:text>
+ <xsl:apply-templates />
+ <xsl:text>'</xsl:text>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="dc:creator" mode="annotation">
+ <br/>
+ <xsl:element name="span">
+ <xsl:attribute name="title">dc:creator</xsl:attribute>
+ <xsl:text>BY '</xsl:text>
+ <xsl:apply-templates />
+ <xsl:text>'</xsl:text>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="dc:date" mode="annotation">
+ <br/>
+ <xsl:element name="span">
+ <xsl:attribute name="title">dc:date</xsl:attribute>
+ <xsl:text>ON '</xsl:text>
+ <xsl:apply-templates />
+ <xsl:text>'</xsl:text>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="meta:date-string" mode="annotation">
+ <br/>
+ <xsl:element name="span">
+ <xsl:attribute name="title">meta-date-string</xsl:attribute>
+ <xsl:text>META DATE '</xsl:text>
+ <xsl:apply-templates />
+ <xsl:text>'</xsl:text>
+ </xsl:element>
+ </xsl:template>
+
+
+ <!-- *************** -->
+ <!-- *** HELPER *** -->
+ <!-- *************** -->
+
+
+ <xsl:template name="create-href">
+ <xsl:param name="href"/>
+ <xsl:param name="mimetype"/>
+
+ <xsl:choose>
+ <!-- internal OOo URL used in content tables -->
+ <xsl:when test="contains($href, '%7Coutline') or contains($href, '|outline')">
+ <!-- the simple workaround for content tables in a single document is to create create an anchor from every heading element
+ work-around downside: Multiple identical headings won't refer always to the first.
+ -->
+ <xsl:text>#</xsl:text>
+ <xsl:variable name="title">
+ <xsl:apply-templates mode="concatenate"/>
+ </xsl:variable>
+
+ <xsl:value-of select="concat('a_', translate(normalize-space($title), '.,;: %()[]/\+', '_____________'))"/>
+ </xsl:when>
+ <xsl:when test="self::draw:image[office:binary-data]">
+ <xsl:choose>
+ <xsl:when test="$mimetype">
+ <xsl:text>data:</xsl:text><xsl:value-of select="$mimetype"/><xsl:text>;base64,</xsl:text><xsl:value-of select="office:binary-data"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>data:image/*;base64,</xsl:text><xsl:value-of select="office:binary-data"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <!-- in case of packed open office document -->
+ <xsl:when test="starts-with($sourceBaseURL, 'jar:') or $isPackageFormat">
+ <xsl:choose>
+ <!-- for images relative to open office document -->
+ <xsl:when test="starts-with($href, '../')">
+ <!-- creating an absolute http URL to the packed image file (removing the '.')-->
+ <xsl:value-of select="concat(substring-after(substring-before($sourceBaseURL, '!'), 'jar:'), '/', $href, $optionalURLSuffix)"/>
+ </xsl:when>
+ <!-- for absolute URLs & absolute paths -->
+ <xsl:when test="contains($href, ':') or starts-with($href, '/')">
+ <xsl:value-of select="concat($href, $optionalURLSuffix)"/>
+ </xsl:when>
+ <!-- for images jared in open office document -->
+ <xsl:otherwise>
+ <xsl:value-of select="concat($sourceBaseURL, $href, $optionalURLSuffix)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <!-- for absolute URLs & Paths -->
+ <xsl:when test="contains($href, ':') or starts-with($href, '/')">
+ <xsl:value-of select="concat($href, $optionalURLSuffix)"/>
+ </xsl:when>
+ <!-- for relative URLs -->
+ <xsl:when test="starts-with($href, '#')">
+ <!-- intra document ref -->
+ <xsl:value-of select="$href"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat($sourceBaseURL, $href, $optionalURLSuffix)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+
+ <xsl:template match="text()" mode="concatenate">
+ <xsl:value-of select="."/>
+ </xsl:template>
+ <xsl:template match="*" mode="concatenate">
+ <xsl:apply-templates mode="concatenate"/>
+ </xsl:template>
+
+
+ <!-- ******************** -->
+ <!-- *** Common Rules *** -->
+ <!-- ******************** -->
+
+ <!-- ignore / neglect the following elements -->
+ <xsl:template match="draw:custom-shape | draw:g | office:forms | text:alphabetical-index-mark | text:alphabetical-index-mark-end | text:alphabetical-index-mark-start | text:bibliography-source | text:number | text:reference-mark-end | text:sequence-decls | text:soft-page-break | text:table-of-content-source | text:tracked-changes | text:user-field-decls"/>
+
+ <!-- default template used by purpose-->
+ <xsl:template match="text:bibliography | text:change-end | text:change-start">
+ <xsl:param name="globalData"/>
+
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <!-- default template for not recognized elements -->
+ <xsl:template match="*">
+ <xsl:param name="globalData"/>
+ <xsl:message>Using default element rule for ODF element '<xsl:value-of select="name()"/>'.</xsl:message>
+
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="@*"/>
+
+ <!-- allowing all matched text nodes -->
+ <xsl:template match="text()">
+ <xsl:value-of select="."/>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/common/styles/style_collector.xsl b/filter/source/xslt/odf2xhtml/export/common/styles/style_collector.xsl
index 80ad51e63324..87c8744d2a0e 100644
--- a/filter/source/xslt/odf2xhtml/export/common/styles/style_collector.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/styles/style_collector.xsl
@@ -17,649 +17,649 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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">
-
-
-
- <!-- ***************************************** -->
- <!-- *** Gathering office style properties *** -->
- <!-- ***************************************** -->
-
- <!-- REASON FOR STYLESHEET:
- In the OpenOffice documents styles are represented by a hierarchy.
- (e.g. most styles are inherited from a default style).
- Many other languages (as XHTML/CSS) do not support inherited styles.
- The style inheritance have to be made flat/absolute for each style.
-
- A further reason was, that the earlier style collection mechanism
- had problems with CSS inline, which do not inherit from XML office defaults
- nor font:family defaults as the style header does
- (cp. stylesheet 'style_collector.xsl' and the 'write-default-styles' template)
-
- RESULT OF STYLESHEET:
- All styles will be returned in a variable containing styles with their inherited *:
-
- <all-styles>
- <style style:family="foo" style:name="x1">
- <* fo:padding-left="0cm" fo:margin-right="0cm" />
- </style>
- <style style:family="muh" style:name="x2" >
- <* fo:padding-left="3cm" ... />
- </style>
- ...
-
- </all-styles>
- -->
-
-
- <xsl:template name="collect-global-odf-properties">
- <!-- to access the variable as a node-set by XPATH expressions, it is necessary to convert it
- from a result-tree-fragment (RTF) to a node set by a in a XSLT 1.0 non standarized function -->
- <xsl:variable name="globalDataRTF">
- <xsl:call-template name="collect-document-links-RTF" />
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="collect-style-properties">
- <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="collect-style-properties">
- <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="collect-style-properties">
- <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-
- <xsl:template name="collect-style-properties">
- <xsl:param name="globalData" />
-
- <!-- Add the input file references to the new collected style properties -->
- <xsl:variable name="globalDataRTF">
- <xsl:copy-of select="$globalData" />
- <xsl:call-template name="collect-style-properties-RTF">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="map-odf-style-properties">
- <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="map-odf-style-properties">
- <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="map-odf-style-properties">
- <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="collect-document-links-RTF">
- <!-- works for zipped office files, unzipped office files as for flat filter single office file format as well -->
- <xsl:variable name="documentLinksRTF">
- <xsl:choose>
- <xsl:when test="office:document-content">
- <xsl:element name="styles-file" namespace="">
- <xsl:copy-of select="document(concat($sourceBaseURL, 'styles.xml'), .)" />
- </xsl:element>
- <xsl:element name="meta-file" namespace="">
- <xsl:copy-of select="document(concat($sourceBaseURL, 'meta.xml'), .)" />
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="styles-file" namespace="">
- <xsl:copy-of select="/" />
- </xsl:element>
- <xsl:element name="meta-file" namespace="">
- <xsl:copy-of select="/" />
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="collect-document-links">
- <xsl:with-param name="documentLinks" select="common:node-set($documentLinksRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="collect-document-links">
- <xsl:with-param name="documentLinks" select="xalan:nodeset($documentLinksRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="collect-document-links">
- <xsl:with-param name="documentLinks" select="xt:node-set($documentLinksRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
-
- <xsl:template name="collect-document-links">
- <xsl:param name="documentLinks" />
-
- <xsl:element name="styles-file" namespace="">
- <xsl:copy-of select="$documentLinks/styles-file/*" />
- </xsl:element>
-
- <xsl:element name="meta-file" namespace="">
- <xsl:copy-of select="$documentLinks/meta-file/*" />
- </xsl:element>
-
- <xsl:copy-of select="$documentLinks/styles-file/*/office:styles" />
- <xsl:copy-of select="$documentLinks/styles-file/*/office:font-face-decls" />
-
- <!-- office:automatic-styles may be contained in two files (i.e. content.xml and styles.xml).
- Wild card necessary as top level element differs from flat office files ("SampleName.fsxw") -->
- <xsl:copy-of select="/*/office:automatic-styles" />
-
- </xsl:template>
-
-
- <xsl:template name="collect-style-properties-RTF">
- <xsl:param name="globalData" />
-
- <!--** DEFAULT STYLES: First adding some office defaults unwritten in XML -->
- <xsl:variable name="defaultOfficeStyle-RTF">
- <xsl:element name="style" namespace="">
- <xsl:element name="style:properties" />
- </xsl:element>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="collect-properties-defaults">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="common:node-set($defaultOfficeStyle-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="collect-properties-defaults">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="xalan:nodeset($defaultOfficeStyle-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="collect-properties-defaults">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="xt:node-set($defaultOfficeStyle-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: 'Nodeset'</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="collect-properties-defaults">
- <xsl:param name="globalData" />
- <xsl:param name="defaultOfficeStyle" />
-
- <!--** DEFAULT STYLES: Adding the default styles of a style:family, by adding each office:styles/style:default-style element **-->
- <xsl:variable name="defaultFamilyStyles-RTF">
- <xsl:for-each select="$globalData/office:styles/style:default-style">
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="@style:family" />
- <xsl:call-template name="create-inherited-style-properties">
- <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
- </xsl:call-template>
- </xsl:element>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="collect-properties">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
- <xsl:with-param name="defaultFamilyStyles" select="common:node-set($defaultFamilyStyles-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="collect-properties">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
- <xsl:with-param name="defaultFamilyStyles" select="xalan:nodeset($defaultFamilyStyles-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="collect-properties">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
- <xsl:with-param name="defaultFamilyStyles" select="xt:node-set($defaultFamilyStyles-RTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="collect-properties">
- <xsl:param name="globalData" />
- <xsl:param name="defaultOfficeStyle" />
- <xsl:param name="defaultFamilyStyles" />
-
- <!--** traversee all style trees - branch after branch - collecting style properties **-->
- <xsl:element name="all-doc-styles" namespace="">
-
- <!-- Background Information:
-
- There are two different types of styles in the Office:
- 1) The office:styles from the user pre-defined style templates
- 2) The automatic:styles, which are created whenever a user uses explicit style formatting.
-
- The office:styles only have parent styles in the office:styles,
- but automatic:styles may inherit from both office:styles and themself.
- -->
-
- <!--** traversee all office:styles trees beginning with the top-level styles **-->
- <xsl:for-each select="$globalData/office:styles/style:style[not(@style:parent-style-name)]">
- <!-- Looking for parents from style:family
- <xsl:for-each select="$globalData/office:styles/style:style[@style:family=current()/@style:family][not(@style:parent-style-name)]"> -->
- <xsl:choose>
- <xsl:when test="$defaultFamilyStyles/style[@style:family=current()/@style:family]">
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$defaultFamilyStyles/style[@style:family=current()/@style:family]/*" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <!--** creates a style element with style:name and style:family attribute and
- an element representing the absolute style properties style:property ** -->
- </xsl:for-each>
-
- <!--** traversee all office:automatic-styles trees beginning with the top-level styles **-->
- <xsl:for-each select="$globalData/office:automatic-styles/style:style[not(@style:parent-style-name)]">
- <!--** creates a style element with style:name and style:family attribute and
- an element representing the absolute style properties style:property ** -->
- <xsl:choose>
- <xsl:when test="$defaultFamilyStyles/style[@style:family=current()/@style:family]">
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$defaultFamilyStyles/style[@style:family=current()/@style:family]/*" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:for-each>
-
- </xsl:element>
- <!-- debug output in case only styles should be given out (regression test) -->
- <xsl:if test="$onlyStyleOutputEnabled">
- <xsl:element name="defaultOfficeStyle" namespace="">
- <xsl:copy-of select="$defaultOfficeStyle" />
- </xsl:element>
- <xsl:element name="defaultFamilyStyles" namespace="">
- <xsl:copy-of select="$defaultFamilyStyles" />
- </xsl:element>
- </xsl:if>
-
- </xsl:template>
-
-
- <xsl:template name="inherit-style-for-self-and-children">
- <xsl:param name="globalData" />
- <xsl:param name="inheritedStyleProperties" />
- <xsl:param name="searchOnlyInAutomaticStyles" />
-
- <!--** create an absolute style by inherting properties from the given parent properties **-->
- <xsl:variable name="newStyleProperties-RTF">
- <xsl:call-template name="create-inherited-style-properties">
- <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:variable name="newStyleProperties" select="common:node-set($newStyleProperties-RTF)" />
-
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="@style:family" />
- <xsl:copy-of select="@style:name" />
- <xsl:copy-of select="$newStyleProperties" />
- </xsl:element>
-
- <xsl:choose>
- <xsl:when test="$searchOnlyInAutomaticStyles">
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!--** for all automatic-children of the current office:styles **-->
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:variable name="newStyleProperties" select="xalan:nodeset($newStyleProperties-RTF)" />
-
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="@style:family" />
- <xsl:copy-of select="@style:name" />
- <xsl:copy-of select="$newStyleProperties" />
- </xsl:element>
-
- <xsl:choose>
- <xsl:when test="$searchOnlyInAutomaticStyles">
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!--** for all automatic-children of the current office:styles **-->
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:variable name="newStyleProperties" select="xt:node-set($newStyleProperties-RTF)" />
-
- <xsl:element name="style" namespace="">
- <xsl:copy-of select="@style:family" />
- <xsl:copy-of select="@style:name" />
- <xsl:copy-of select="$newStyleProperties" />
- </xsl:element>
-
- <xsl:choose>
- <xsl:when test="$searchOnlyInAutomaticStyles">
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!--** for all automatic-children of the current office:styles **-->
- <xsl:call-template name="get-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
- <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="get-children">
- <xsl:param name="globalData" />
- <xsl:param name="searchOnlyInAutomaticStyles" />
- <xsl:param name="inheritedStyleProperties" select="*" />
+ 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">
+
+
+
+ <!-- ***************************************** -->
+ <!-- *** Gathering office style properties *** -->
+ <!-- ***************************************** -->
+
+ <!-- REASON FOR STYLESHEET:
+ In the OpenOffice documents styles are represented by a hierarchy.
+ (e.g. most styles are inherited from a default style).
+ Many other languages (as XHTML/CSS) do not support inherited styles.
+ The style inheritance have to be made flat/absolute for each style.
+
+ A further reason was, that the earlier style collection mechanism
+ had problems with CSS inline, which do not inherit from XML office defaults
+ nor font:family defaults as the style header does
+ (cp. stylesheet 'style_collector.xsl' and the 'write-default-styles' template)
+
+ RESULT OF STYLESHEET:
+ All styles will be returned in a variable containing styles with their inherited *:
+
+ <all-styles>
+ <style style:family="foo" style:name="x1">
+ <* fo:padding-left="0cm" fo:margin-right="0cm" />
+ </style>
+ <style style:family="muh" style:name="x2" >
+ <* fo:padding-left="3cm" ... />
+ </style>
+ ...
+
+ </all-styles>
+ -->
+
+
+ <xsl:template name="collect-global-odf-properties">
+ <!-- to access the variable as a node-set by XPATH expressions, it is necessary to convert it
+ from a result-tree-fragment (RTF) to a node set by a in a XSLT 1.0 non standarized function -->
+ <xsl:variable name="globalDataRTF">
+ <xsl:call-template name="collect-document-links-RTF" />
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="collect-style-properties">
+ <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="collect-style-properties">
+ <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="collect-style-properties">
+ <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+
+ <xsl:template name="collect-style-properties">
+ <xsl:param name="globalData" />
+
+ <!-- Add the input file references to the new collected style properties -->
+ <xsl:variable name="globalDataRTF">
+ <xsl:copy-of select="$globalData" />
+ <xsl:call-template name="collect-style-properties-RTF">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="map-odf-style-properties">
+ <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="map-odf-style-properties">
+ <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="map-odf-style-properties">
+ <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="collect-document-links-RTF">
+ <!-- works for zipped office files, unzipped office files as for flat filter single office file format as well -->
+ <xsl:variable name="documentLinksRTF">
+ <xsl:choose>
+ <xsl:when test="office:document-content">
+ <xsl:element name="styles-file" namespace="">
+ <xsl:copy-of select="document(concat($sourceBaseURL, 'styles.xml'), .)" />
+ </xsl:element>
+ <xsl:element name="meta-file" namespace="">
+ <xsl:copy-of select="document(concat($sourceBaseURL, 'meta.xml'), .)" />
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="styles-file" namespace="">
+ <xsl:copy-of select="/" />
+ </xsl:element>
+ <xsl:element name="meta-file" namespace="">
+ <xsl:copy-of select="/" />
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="collect-document-links">
+ <xsl:with-param name="documentLinks" select="common:node-set($documentLinksRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="collect-document-links">
+ <xsl:with-param name="documentLinks" select="xalan:nodeset($documentLinksRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="collect-document-links">
+ <xsl:with-param name="documentLinks" select="xt:node-set($documentLinksRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+
+
+ <xsl:template name="collect-document-links">
+ <xsl:param name="documentLinks" />
+
+ <xsl:element name="styles-file" namespace="">
+ <xsl:copy-of select="$documentLinks/styles-file/*" />
+ </xsl:element>
+
+ <xsl:element name="meta-file" namespace="">
+ <xsl:copy-of select="$documentLinks/meta-file/*" />
+ </xsl:element>
+
+ <xsl:copy-of select="$documentLinks/styles-file/*/office:styles" />
+ <xsl:copy-of select="$documentLinks/styles-file/*/office:font-face-decls" />
+
+ <!-- office:automatic-styles may be contained in two files (i.e. content.xml and styles.xml).
+ Wild card necessary as top level element differs from flat office files ("SampleName.fsxw") -->
+ <xsl:copy-of select="/*/office:automatic-styles" />
+
+ </xsl:template>
+
+
+ <xsl:template name="collect-style-properties-RTF">
+ <xsl:param name="globalData" />
+
+ <!--** DEFAULT STYLES: First adding some office defaults unwritten in XML -->
+ <xsl:variable name="defaultOfficeStyle-RTF">
+ <xsl:element name="style" namespace="">
+ <xsl:element name="style:properties" />
+ </xsl:element>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="collect-properties-defaults">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="common:node-set($defaultOfficeStyle-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="collect-properties-defaults">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="xalan:nodeset($defaultOfficeStyle-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="collect-properties-defaults">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="xt:node-set($defaultOfficeStyle-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: 'Nodeset'</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="collect-properties-defaults">
+ <xsl:param name="globalData" />
+ <xsl:param name="defaultOfficeStyle" />
+
+ <!--** DEFAULT STYLES: Adding the default styles of a style:family, by adding each office:styles/style:default-style element **-->
+ <xsl:variable name="defaultFamilyStyles-RTF">
+ <xsl:for-each select="$globalData/office:styles/style:default-style">
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="@style:family" />
+ <xsl:call-template name="create-inherited-style-properties">
+ <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="collect-properties">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
+ <xsl:with-param name="defaultFamilyStyles" select="common:node-set($defaultFamilyStyles-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="collect-properties">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
+ <xsl:with-param name="defaultFamilyStyles" select="xalan:nodeset($defaultFamilyStyles-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="collect-properties">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="defaultOfficeStyle" select="$defaultOfficeStyle" />
+ <xsl:with-param name="defaultFamilyStyles" select="xt:node-set($defaultFamilyStyles-RTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="collect-properties">
+ <xsl:param name="globalData" />
+ <xsl:param name="defaultOfficeStyle" />
+ <xsl:param name="defaultFamilyStyles" />
+
+ <!--** traversee all style trees - branch after branch - collecting style properties **-->
+ <xsl:element name="all-doc-styles" namespace="">
+
+ <!-- Background Information:
+
+ There are two different types of styles in the Office:
+ 1) The office:styles from the user pre-defined style templates
+ 2) The automatic:styles, which are created whenever a user uses explicit style formatting.
+
+ The office:styles only have parent styles in the office:styles,
+ but automatic:styles may inherit from both office:styles and themself.
+ -->
+
+ <!--** traversee all office:styles trees beginning with the top-level styles **-->
+ <xsl:for-each select="$globalData/office:styles/style:style[not(@style:parent-style-name)]">
+ <!-- Looking for parents from style:family
+ <xsl:for-each select="$globalData/office:styles/style:style[@style:family=current()/@style:family][not(@style:parent-style-name)]"> -->
+ <xsl:choose>
+ <xsl:when test="$defaultFamilyStyles/style[@style:family=current()/@style:family]">
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$defaultFamilyStyles/style[@style:family=current()/@style:family]/*" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!--** creates a style element with style:name and style:family attribute and
+ an element representing the absolute style properties style:property ** -->
+ </xsl:for-each>
+
+ <!--** traversee all office:automatic-styles trees beginning with the top-level styles **-->
+ <xsl:for-each select="$globalData/office:automatic-styles/style:style[not(@style:parent-style-name)]">
+ <!--** creates a style element with style:name and style:family attribute and
+ an element representing the absolute style properties style:property ** -->
+ <xsl:choose>
+ <xsl:when test="$defaultFamilyStyles/style[@style:family=current()/@style:family]">
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$defaultFamilyStyles/style[@style:family=current()/@style:family]/*" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$defaultOfficeStyle/style/*" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:for-each>
+
+ </xsl:element>
+ <!-- debug output in case only styles should be given out (regression test) -->
+ <xsl:if test="$onlyStyleOutputEnabled">
+ <xsl:element name="defaultOfficeStyle" namespace="">
+ <xsl:copy-of select="$defaultOfficeStyle" />
+ </xsl:element>
+ <xsl:element name="defaultFamilyStyles" namespace="">
+ <xsl:copy-of select="$defaultFamilyStyles" />
+ </xsl:element>
+ </xsl:if>
+
+ </xsl:template>
+
+
+ <xsl:template name="inherit-style-for-self-and-children">
+ <xsl:param name="globalData" />
+ <xsl:param name="inheritedStyleProperties" />
+ <xsl:param name="searchOnlyInAutomaticStyles" />
+
+ <!--** create an absolute style by inherting properties from the given parent properties **-->
+ <xsl:variable name="newStyleProperties-RTF">
+ <xsl:call-template name="create-inherited-style-properties">
+ <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:variable name="newStyleProperties" select="common:node-set($newStyleProperties-RTF)" />
+
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="@style:family" />
+ <xsl:copy-of select="@style:name" />
+ <xsl:copy-of select="$newStyleProperties" />
+ </xsl:element>
+
+ <xsl:choose>
+ <xsl:when test="$searchOnlyInAutomaticStyles">
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!--** for all automatic-children of the current office:styles **-->
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:variable name="newStyleProperties" select="xalan:nodeset($newStyleProperties-RTF)" />
+
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="@style:family" />
+ <xsl:copy-of select="@style:name" />
+ <xsl:copy-of select="$newStyleProperties" />
+ </xsl:element>
+
+ <xsl:choose>
+ <xsl:when test="$searchOnlyInAutomaticStyles">
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!--** for all automatic-children of the current office:styles **-->
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:variable name="newStyleProperties" select="xt:node-set($newStyleProperties-RTF)" />
+
+ <xsl:element name="style" namespace="">
+ <xsl:copy-of select="@style:family" />
+ <xsl:copy-of select="@style:name" />
+ <xsl:copy-of select="$newStyleProperties" />
+ </xsl:element>
+
+ <xsl:choose>
+ <xsl:when test="$searchOnlyInAutomaticStyles">
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="true()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!--** for all automatic-children of the current office:styles **-->
+ <xsl:call-template name="get-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="false()" />
+ <xsl:with-param name="inheritedStyleProperties" select="$newStyleProperties/*" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="get-children">
+ <xsl:param name="globalData" />
+ <xsl:param name="searchOnlyInAutomaticStyles" />
+ <xsl:param name="inheritedStyleProperties" select="*" />
<!-- QUESTION: Parent style is only unique by name and family, but what about cross family inheritance? -->
- <!-- For each child style (that is every style which has the given parentStyleName as style:parent-style-name and the same style:family -->
- <xsl:variable name="parentStyleFamily" select="@style:family" />
- <xsl:variable name="parentStyleName" select="@style:name" />
- <xsl:if test="not($searchOnlyInAutomaticStyles)">
- <xsl:for-each select="$globalData/office:styles/style:style[@style:family=$parentStyleFamily and @style:parent-style-name=$parentStyleName]">
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="$searchOnlyInAutomaticStyles" />
- </xsl:call-template>
- </xsl:for-each>
- </xsl:if>
- <xsl:for-each select="$globalData/office:automatic-styles/style:style[@style:family=$parentStyleFamily and @style:parent-style-name=$parentStyleName]">
- <xsl:call-template name="inherit-style-for-self-and-children">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
- <xsl:with-param name="searchOnlyInAutomaticStyles" select="$searchOnlyInAutomaticStyles" />
- </xsl:call-template>
- </xsl:for-each>
- </xsl:template>
-
-
- <xsl:template name="create-inherited-style-properties">
- <xsl:param name="inheritedStyleProperties" />
-
- <xsl:element name="style:properties">
- <!-- Writing all inherited style properties -->
- <xsl:for-each select="$inheritedStyleProperties/@*">
- <xsl:sort select="name()" />
- <xsl:copy-of select="." />
- </xsl:for-each>
-
- <!--All current attributes will override already inserted attributes of the same name
- XSLT Spec: "Adding an attribute to an element replaces any existing attribute of that element with the same expanded-name." -->
- <xsl:for-each select="*/@*[name() != 'style:font-size-rel']">
- <xsl:copy-of select="." />
- </xsl:for-each>
-
- <xsl:if test="*/@style:font-size-rel">
+ <!-- For each child style (that is every style which has the given parentStyleName as style:parent-style-name and the same style:family -->
+ <xsl:variable name="parentStyleFamily" select="@style:family" />
+ <xsl:variable name="parentStyleName" select="@style:name" />
+ <xsl:if test="not($searchOnlyInAutomaticStyles)">
+ <xsl:for-each select="$globalData/office:styles/style:style[@style:family=$parentStyleFamily and @style:parent-style-name=$parentStyleName]">
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="$searchOnlyInAutomaticStyles" />
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:if>
+ <xsl:for-each select="$globalData/office:automatic-styles/style:style[@style:family=$parentStyleFamily and @style:parent-style-name=$parentStyleName]">
+ <xsl:call-template name="inherit-style-for-self-and-children">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="inheritedStyleProperties" select="$inheritedStyleProperties" />
+ <xsl:with-param name="searchOnlyInAutomaticStyles" select="$searchOnlyInAutomaticStyles" />
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+
+
+ <xsl:template name="create-inherited-style-properties">
+ <xsl:param name="inheritedStyleProperties" />
+
+ <xsl:element name="style:properties">
+ <!-- Writing all inherited style properties -->
+ <xsl:for-each select="$inheritedStyleProperties/@*">
+ <xsl:sort select="name()" />
+ <xsl:copy-of select="." />
+ </xsl:for-each>
+
+ <!--All current attributes will override already inserted attributes of the same name
+ XSLT Spec: "Adding an attribute to an element replaces any existing attribute of that element with the same expanded-name." -->
+ <xsl:for-each select="*/@*[name() != 'style:font-size-rel']">
+ <xsl:copy-of select="." />
+ </xsl:for-each>
+
+ <xsl:if test="*/@style:font-size-rel">
<!--
- The intheritedStyleProperties should include a absolute Font Size, but
- <style:properties
- xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
- xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
- style:font-name="Courier New"
- fo:language="en"
- fo:country="US"
- style:font-name-asian=Courier New"
- style:font-name-complex="Courier New"/>
+ The intheritedStyleProperties should include a absolute Font Size, but
+ <style:properties
+ xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0"
+ xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+ style:font-name="Courier New"
+ fo:language="en"
+ fo:country="US"
+ style:font-name-asian=Courier New"
+ style:font-name-complex="Courier New"/>
-->
- <xsl:variable name="fontSizeAbsolute">
- <xsl:call-template name="convert2pt">
- <xsl:with-param name="value" select="$inheritedStyleProperties/@fo:font-size" />
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:variable name="fontSizeRelative">
- <xsl:call-template name="convert2pt">
- <xsl:with-param name="value" select="*/@style:font-size-rel" />
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:attribute name="fo:font-size">
- <xsl:value-of select="$fontSizeAbsolute + $fontSizeRelative"/>
- <xsl:text>pt</xsl:text>
- </xsl:attribute>
- </xsl:if>
-
- <!-- providing tabulator indentation -->
- <xsl:copy-of select="$inheritedStyleProperties/style:tab-stops"/>
- <xsl:copy-of select="*/style:tab-stops"/>
- </xsl:element>
- </xsl:template>
+ <xsl:variable name="fontSizeAbsolute">
+ <xsl:call-template name="convert2pt">
+ <xsl:with-param name="value" select="$inheritedStyleProperties/@fo:font-size" />
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:variable name="fontSizeRelative">
+ <xsl:call-template name="convert2pt">
+ <xsl:with-param name="value" select="*/@style:font-size-rel" />
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:attribute name="fo:font-size">
+ <xsl:value-of select="$fontSizeAbsolute + $fontSizeRelative"/>
+ <xsl:text>pt</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+
+ <!-- providing tabulator indentation -->
+ <xsl:copy-of select="$inheritedStyleProperties/style:tab-stops"/>
+ <xsl:copy-of select="*/style:tab-stops"/>
+ </xsl:element>
+ </xsl:template>
<!-- debugging & testing purpose -->
- <xsl:template name="write-collected-styles">
- <xsl:param name="globalData" />
-
- <xsl:message>&lt;all-doc-styles&gt;</xsl:message>
- <xsl:for-each select="$globalData/all-doc-styles/style">
- <xsl:message>&lt;style</xsl:message>
- <xsl:message>style:family="<xsl:value-of select="current()/@style:family" />"&gt;</xsl:message>
- <xsl:message>style:name="<xsl:value-of select="current()/@style:name" />" </xsl:message>
- <xsl:message> &lt;*</xsl:message>
- <xsl:for-each select="*/@*">
- <xsl:message>
- <xsl:text></xsl:text>
- <xsl:value-of select="name()" />="<xsl:value-of select="." />"</xsl:message>
- </xsl:for-each>
- <xsl:message>/&gt;</xsl:message>
- <xsl:message>&lt;/style&gt;</xsl:message>
- </xsl:for-each>
- <xsl:message>&lt;/all-doc-styles&gt;</xsl:message>
- </xsl:template>
-
- <xsl:template name="map-odf-style-properties">
- <xsl:param name="globalData" />
-
- <xsl:choose>
- <!--+++++ DEBUG STYLE OUTPUT FOR REGRESSION TEST +++++-->
- <!-- create styles file from the style variable (testing switch) -->
- <xsl:when test="$onlyStyleOutputEnabled">
-
- <xsl:element name="debug-output" namespace="">
- <xsl:copy-of select="$globalData" />
- <xsl:call-template name="map-odf-properties">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
-
- <!-- create XHTML file -->
- <xsl:otherwise>
- <!-- to access the variable like a node-set it is necessary to convert it
- from a result-tree-fragment (RTF) to a node set using the James Clark extension -->
- <xsl:variable name="globalDataRTF">
- <!-- raw properties still needed for table width attribute creation -->
- <xsl:copy-of select="$globalData" />
- <xsl:call-template name="map-odf-properties">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:call-template>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="start-main">
- <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="start-main">
- <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="start-main">
- <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- REASON FOR TEMPLATE:
- The OpenOffice style properities gathered in the variable 'globalData' have to be mapped to the CSS style format
- -->
- <xsl:template name="map-odf-properties">
- <xsl:param name="globalData" />
- <xsl:element name="all-styles" namespace="">
- <xsl:for-each select="$globalData/all-doc-styles/style">
- <xsl:sort select="@style:family" />
- <xsl:sort select="@style:name" />
-
- <xsl:call-template name="writeUsedStyles">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="style" select="."/>
- </xsl:call-template>
- </xsl:for-each>
- </xsl:element>
- </xsl:template>
-
- <xsl:key name="elementUsingStyle" match="*" use="@text:style-name | @draw:style-name | @draw:text-style-name | @table:style-name | @table:default-cell-style-name"/>
- <xsl:key name="listLabelStyleInStyles" match="/*/office:styles/text:list-style/* |
- /*/office:styles/style:graphic-properties/text:list-style/*" use="@text:style-name"/>
+ <xsl:template name="write-collected-styles">
+ <xsl:param name="globalData" />
+
+ <xsl:message>&lt;all-doc-styles&gt;</xsl:message>
+ <xsl:for-each select="$globalData/all-doc-styles/style">
+ <xsl:message>&lt;style</xsl:message>
+ <xsl:message>style:family="<xsl:value-of select="current()/@style:family" />"&gt;</xsl:message>
+ <xsl:message>style:name="<xsl:value-of select="current()/@style:name" />" </xsl:message>
+ <xsl:message> &lt;*</xsl:message>
+ <xsl:for-each select="*/@*">
+ <xsl:message>
+ <xsl:text></xsl:text>
+ <xsl:value-of select="name()" />="<xsl:value-of select="." />"</xsl:message>
+ </xsl:for-each>
+ <xsl:message>/&gt;</xsl:message>
+ <xsl:message>&lt;/style&gt;</xsl:message>
+ </xsl:for-each>
+ <xsl:message>&lt;/all-doc-styles&gt;</xsl:message>
+ </xsl:template>
+
+ <xsl:template name="map-odf-style-properties">
+ <xsl:param name="globalData" />
+
+ <xsl:choose>
+ <!--+++++ DEBUG STYLE OUTPUT FOR REGRESSION TEST +++++-->
+ <!-- create styles file from the style variable (testing switch) -->
+ <xsl:when test="$onlyStyleOutputEnabled">
+
+ <xsl:element name="debug-output" namespace="">
+ <xsl:copy-of select="$globalData" />
+ <xsl:call-template name="map-odf-properties">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+
+ <!-- create XHTML file -->
+ <xsl:otherwise>
+ <!-- to access the variable like a node-set it is necessary to convert it
+ from a result-tree-fragment (RTF) to a node set using the James Clark extension -->
+ <xsl:variable name="globalDataRTF">
+ <!-- raw properties still needed for table width attribute creation -->
+ <xsl:copy-of select="$globalData" />
+ <xsl:call-template name="map-odf-properties">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:call-template>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="start-main">
+ <xsl:with-param name="globalData" select="common:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="start-main">
+ <xsl:with-param name="globalData" select="xalan:nodeset($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="start-main">
+ <xsl:with-param name="globalData" select="xt:node-set($globalDataRTF)" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- REASON FOR TEMPLATE:
+ The OpenOffice style properities gathered in the variable 'globalData' have to be mapped to the CSS style format
+ -->
+ <xsl:template name="map-odf-properties">
+ <xsl:param name="globalData" />
+ <xsl:element name="all-styles" namespace="">
+ <xsl:for-each select="$globalData/all-doc-styles/style">
+ <xsl:sort select="@style:family" />
+ <xsl:sort select="@style:name" />
+
+ <xsl:call-template name="writeUsedStyles">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="style" select="."/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:key name="elementUsingStyle" match="*" use="@text:style-name | @draw:style-name | @draw:text-style-name | @table:style-name | @table:default-cell-style-name"/>
+ <xsl:key name="listLabelStyleInStyles" match="/*/office:styles/text:list-style/* |
+ /*/office:styles/style:graphic-properties/text:list-style/*" use="@text:style-name"/>
<xsl:key name="listLabelStyleInContent" match="/*/office:automatic-styles/text:list-style/* | /*/office:automatic-styles/style:graphic-properties/text:list-style/*" use="@text:style-name"/>
- <xsl:variable name="documentRoot" select="/" />
+ <xsl:variable name="documentRoot" select="/" />
<xsl:template name="writeUsedStyles">
<xsl:param name="globalData" />
<xsl:param name="style"/>
-
- <!-- for-each changes the key environment from the previously globalData back to the document root -->
+
+ <!-- for-each changes the key environment from the previously globalData back to the document root -->
<xsl:for-each select="$documentRoot">
<!-- only styles, which are used in the content are written as CSS styles -->
<xsl:choose>
@@ -679,7 +679,7 @@
<xsl:with-param name="globalData" select="$globalData" />
<xsl:with-param name="style" select="$style" />
</xsl:call-template>
- </xsl:if>
+ </xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="document($stylesFileURL)">
@@ -697,40 +697,40 @@
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
- </xsl:template>
-
- <xsl:template name="writeUsedStyles2">
- <xsl:param name="globalData" />
- <xsl:param name="style"/>
+ </xsl:template>
+
+ <xsl:template name="writeUsedStyles2">
+ <xsl:param name="globalData" />
+ <xsl:param name="style"/>
<xsl:choose>
<xsl:when test="
$style/@style:family='paragraph'
- and((
- (
+ and((
+ (
$style/*/@fo:border-top
- or $style/*/@fo:border-bottom
- or $style/*/@fo:border
- )
- and
- (
- not($style/*/@style:join-border)
- or $style/*/@style:join-border = 'true'
- )
+ or $style/*/@fo:border-bottom
+ or $style/*/@fo:border
+ )
+ and
+ (
+ not($style/*/@style:join-border)
+ or $style/*/@style:join-border = 'true'
+ )
)
- or
+ or
(
- (
+ (
$style/*/@fo:margin-top
- or $style/*/@fo:margin-bottom
- or $style/*/@fo:margin
- )
+ or $style/*/@fo:margin-bottom
+ or $style/*/@fo:margin
+ )
+ and
+ ( $style/*/@fo:background-color
and
- ( $style/*/@fo:background-color
- and
not($style/*/fo:background-color='transparent')
- )
+ )
)
- )">
+ )">
<xsl:element name="style" namespace="">
<xsl:copy-of select="$style/@style:family" />
<xsl:attribute name="style:name"><xsl:value-of select="concat($style/@style:name, '_borderStart')" /></xsl:attribute>
@@ -740,7 +740,7 @@
</xsl:apply-templates>
<xsl:apply-templates mode="paragraphMerge" select="$style/*/@*[name() = 'fo:margin-bottom' or name() = 'fo:margin']">
<xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
+ </xsl:apply-templates>
<xsl:text> border-bottom-style:none; </xsl:text>
</xsl:element>
</xsl:element>
@@ -754,7 +754,7 @@
</xsl:apply-templates>
<xsl:apply-templates mode="paragraphMerge" select="$style/*/@*[name() = 'fo:margin-top' or name() = 'fo:margin-bottom' or name() = 'fo:margin']">
<xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
+ </xsl:apply-templates>
<xsl:text> border-top-style:none; border-bottom-style:none; </xsl:text>
</xsl:element>
</xsl:element>
@@ -767,7 +767,7 @@
</xsl:apply-templates>
<xsl:apply-templates mode="paragraphMerge" select="$style/*/@*[name() = 'fo:margin-top' or name() = 'fo:margin']">
<xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
+ </xsl:apply-templates>
<xsl:text> border-top-style:none;</xsl:text>
</xsl:element>
</xsl:element>
@@ -799,23 +799,23 @@
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
- </xsl:template>
- <!-- workaround AOOO#119401 suspicious property fo:margin="100%" in paragraph style -->
- <xsl:template match="@fo:margin[string(.) = '100%']" mode="paragraphMerge"/>
-
- <xsl:template mode="paragraphMerge" match="@fo:margin | @fo:margin-top | @fo:margin-bottom | @fo:margin-left | @fo:margin-right">
- <xsl:text>padding</xsl:text>
+ </xsl:template>
+ <!-- workaround AOOO#119401 suspicious property fo:margin="100%" in paragraph style -->
+ <xsl:template match="@fo:margin[string(.) = '100%']" mode="paragraphMerge"/>
+
+ <xsl:template mode="paragraphMerge" match="@fo:margin | @fo:margin-top | @fo:margin-bottom | @fo:margin-left | @fo:margin-right">
+ <xsl:text>padding</xsl:text>
<xsl:value-of select="substring-after(name(), 'fo:margin')"/>
- <xsl:text>:</xsl:text>
- <!-- Map once erroneusly used inch shortage 'inch' to CSS shortage 'in' -->
- <xsl:choose>
- <xsl:when test="contains(., 'inch')">
- <xsl:value-of select="substring-before(.,'ch')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>; </xsl:text>
- </xsl:template>
+ <xsl:text>:</xsl:text>
+ <!-- Map once erroneusly used inch shortage 'inch' to CSS shortage 'in' -->
+ <xsl:choose>
+ <xsl:when test="contains(., 'inch')">
+ <xsl:value-of select="substring-before(.,'ch')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>; </xsl:text>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
index d8d5b0e6a846..791a2bcd391b 100644
--- a/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/styles/style_mapping_css.xsl
@@ -17,100 +17,100 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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">
- <!-- *** Properties with a 'fo:' prefix *** -->
- <xsl:template match="@fo:background-color">
- <xsl:text>background-color:</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>; </xsl:text>
- </xsl:template>
+ <!-- *** Properties with a 'fo:' prefix *** -->
+ <xsl:template match="@fo:background-color">
+ <xsl:text>background-color:</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>; </xsl:text>
+ </xsl:template>
- <xsl:template match="@fo:border | @fo:border-top | @fo:border-bottom | @fo:border-left | @fo:border-right">
- <xsl:variable name="borderType" select="substring-after(name(), ':')"/>
- <xsl:choose>
- <xsl:when test=". = 'none'">
- <xsl:value-of select="$borderType"/>
- <xsl:text>-style:none; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="borderWidth" select="substring-before(., ' ')"/>
- <xsl:variable name="borderStyle" select="substring-before(substring-after(., ' '), ' ')"/>
- <xsl:variable name="borderColor" select="substring-after(substring-after(., ' '), ' ')"/>
+ <xsl:template match="@fo:border | @fo:border-top | @fo:border-bottom | @fo:border-left | @fo:border-right">
+ <xsl:variable name="borderType" select="substring-after(name(), ':')"/>
+ <xsl:choose>
+ <xsl:when test=". = 'none'">
+ <xsl:value-of select="$borderType"/>
+ <xsl:text>-style:none; </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="borderWidth" select="substring-before(., ' ')"/>
+ <xsl:variable name="borderStyle" select="substring-before(substring-after(., ' '), ' ')"/>
+ <xsl:variable name="borderColor" select="substring-after(substring-after(., ' '), ' ')"/>
- <!-- More information at template 'round-up-border-width' -->
- <xsl:variable name="borderWidthFixed">
- <xsl:call-template name="round-up-border-width">
- <xsl:with-param name="borderWidth" select="$borderWidth"/>
- <xsl:with-param name="multiplier">
- <xsl:choose>
- <xsl:when test="$borderStyle = 'double'">3</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
+ <!-- More information at template 'round-up-border-width' -->
+ <xsl:variable name="borderWidthFixed">
+ <xsl:call-template name="round-up-border-width">
+ <xsl:with-param name="borderWidth" select="$borderWidth"/>
+ <xsl:with-param name="multiplier">
+ <xsl:choose>
+ <xsl:when test="$borderStyle = 'double'">3</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
- <xsl:value-of select="$borderType"/>
- <xsl:text>-width:</xsl:text>
- <xsl:choose>
- <xsl:when test="$borderWidth = '0.05pt'">thin</xsl:when>
- <xsl:otherwise><xsl:value-of select="$borderWidthFixed"/></xsl:otherwise>
- </xsl:choose>
- <xsl:text>; </xsl:text>
- <xsl:value-of select="$borderType"/>
- <xsl:text>-style:</xsl:text>
- <xsl:value-of select="$borderStyle"/>
- <xsl:text>; </xsl:text>
- <xsl:value-of select="$borderType"/>
- <xsl:text>-color:</xsl:text>
- <xsl:value-of select="$borderColor"/>
- <xsl:text>; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:value-of select="$borderType"/>
+ <xsl:text>-width:</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$borderWidth = '0.05pt'">thin</xsl:when>
+ <xsl:otherwise><xsl:value-of select="$borderWidthFixed"/></xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>; </xsl:text>
+ <xsl:value-of select="$borderType"/>
+ <xsl:text>-style:</xsl:text>
+ <xsl:value-of select="$borderStyle"/>
+ <xsl:text>; </xsl:text>
+ <xsl:value-of select="$borderType"/>
+ <xsl:text>-color:</xsl:text>
+ <xsl:value-of select="$borderColor"/>
+ <xsl:text>; </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <!-- NOTE: Still there have to be placed a <br clear='all' /> to disable the flow!!!!-->
- <xsl:template match="@fo:clear">
- <xsl:text>clear:both; </xsl:text>
- </xsl:template>
+ <!-- NOTE: Still there have to be placed a <br clear='all' /> to disable the flow!!!!-->
+ <xsl:template match="@fo:clear">
+ <xsl:text>clear:both; </xsl:text>
+ </xsl:template>
- <!-- text-shadow is a CSS2 feature and yet not common used in user-agents -->
- <xsl:template match="@fo:color |@svg:font-family |@fo:font-size |@fo:font-style |@fo:font-weight |@fo:text-indent |@fo:text-shadow |@text:display">
- <xsl:value-of select="substring-after(name(), ':')"/>
- <xsl:text>:</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>; </xsl:text>
- </xsl:template>
+ <!-- text-shadow is a CSS2 feature and yet not common used in user-agents -->
+ <xsl:template match="@fo:color |@svg:font-family |@fo:font-size |@fo:font-style |@fo:font-weight |@fo:text-indent |@fo:text-shadow |@text:display">
+ <xsl:value-of select="substring-after(name(), ':')"/>
+ <xsl:text>:</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>; </xsl:text>
+ </xsl:template>
- <!-- workaround AOOO#119401 suspicious property fo:margin="100%" in paragraph style -->
- <xsl:template match="@fo:margin[string(.) = '100%']"/>
+ <!-- workaround AOOO#119401 suspicious property fo:margin="100%" in paragraph style -->
+ <xsl:template match="@fo:margin[string(.) = '100%']"/>
- <!-- Maps fo:margin as well fo:margin-top, fo:margin-bottom, fo:padding-left, fo:margin-right -->
- <!-- Maps fo:padding as well fo:padding-top, fo:padding-bottom, fo:padding-left, fo:padding-right -->
- <xsl:template match="@fo:letter-spacing | @fo:line-height | @fo:width |@fo:margin | @fo:margin-top | @fo:margin-bottom | @fo:margin-left | @fo:margin-right | @fo:padding | @fo:padding-top | @fo:padding-bottom | @fo:padding-left | @fo:padding-right">
- <xsl:value-of select="local-name(.)"/>
- <xsl:text>:</xsl:text>
- <!-- Map once erroneusly used inch shortage 'inch' to CSS shortage 'in' -->
- <xsl:choose>
- <xsl:when test="contains(., 'inch')">
- <xsl:value-of select="substring-before(.,'ch')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>; </xsl:text>
- </xsl:template>
+ <!-- Maps fo:margin as well fo:margin-top, fo:margin-bottom, fo:padding-left, fo:margin-right -->
+ <!-- Maps fo:padding as well fo:padding-top, fo:padding-bottom, fo:padding-left, fo:padding-right -->
+ <xsl:template match="@fo:letter-spacing | @fo:line-height | @fo:width |@fo:margin | @fo:margin-top | @fo:margin-bottom | @fo:margin-left | @fo:margin-right | @fo:padding | @fo:padding-top | @fo:padding-bottom | @fo:padding-left | @fo:padding-right">
+ <xsl:value-of select="local-name(.)"/>
+ <xsl:text>:</xsl:text>
+ <!-- Map once erroneusly used inch shortage 'inch' to CSS shortage 'in' -->
+ <xsl:choose>
+ <xsl:when test="contains(., 'inch')">
+ <xsl:value-of select="substring-before(.,'ch')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>; </xsl:text>
+ </xsl:template>
- <xsl:template match="@fo:text-align">
- <!-- 'important' is necessary as table cell value alignment is decided by runtime over the valuetype
- Otherwise a table cell style-class would always be outnumbered by the run-time alignment value -->
- <xsl:choose>
- <xsl:when test="contains(., 'start')">
+ <xsl:template match="@fo:text-align">
+ <!-- 'important' is necessary as table cell value alignment is decided by runtime over the valuetype
+ Otherwise a table cell style-class would always be outnumbered by the run-time alignment value -->
+ <xsl:choose>
+ <xsl:when test="contains(., 'start')">
<xsl:choose>
<xsl:when test="parent::*/@style:writing-mode and contains(parent::*/@style:writing-mode, 'rl')">
<xsl:text>text-align:right ! important; </xsl:text>
@@ -119,8 +119,8 @@
<xsl:text>text-align:left ! important; </xsl:text>
</xsl:otherwise>
</xsl:choose>
- </xsl:when>
- <xsl:when test="contains(., 'end')">
+ </xsl:when>
+ <xsl:when test="contains(., 'end')">
<xsl:choose>
<xsl:when test="parent::*/@style:writing-mode and contains(parent::*/@style:writing-mode, 'rl')">
<xsl:text>text-align:left ! important;</xsl:text>
@@ -129,230 +129,230 @@
<xsl:text>text-align:right ! important; </xsl:text>
</xsl:otherwise>
</xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>text-align:</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text> ! important; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>text-align:</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text> ! important; </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template match="@style:vertical-align">
- <xsl:choose>
- <xsl:when test="contains(., 'bottom')">
- <xsl:text>vertical-align:bottom; </xsl:text>
- </xsl:when>
- <xsl:when test="contains(., 'middle')">
- <xsl:text>vertical-align:middle; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>vertical-align:top; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:template match="@style:vertical-align">
+ <xsl:choose>
+ <xsl:when test="contains(., 'bottom')">
+ <xsl:text>vertical-align:bottom; </xsl:text>
+ </xsl:when>
+ <xsl:when test="contains(., 'middle')">
+ <xsl:text>vertical-align:middle; </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>vertical-align:top; </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
<!-- *** Properties with a 'style:' prefix *** -->
- <!-- NOTE: Can 'inside' | 'from-inside' better be handled:
- <!ATTLIST * style:horizontal-pos (from-left|left|center|right|from-inside|inside|outside)#IMPLIED>-->
- <xsl:template match="@style:horizontal-pos">
- <xsl:choose>
- <xsl:when test=".='left'">
- <xsl:text>text-align:left; </xsl:text>
- </xsl:when>
- <xsl:when test=". = 'right'">
- <xsl:text>text-align:right; </xsl:text>
- </xsl:when>
- <xsl:when test=".='center'">
- <xsl:text>text-align:center; </xsl:text>
- </xsl:when>
- <!-- NOTE: currently other values are not used.
- If the property value is from-left or from-inside,
- the svg:x attribute associated with the frame element specifies
- the horizontal position of the frame.
- Otherwise the svg:x attribute is ignored for text documents.
- -->
- </xsl:choose>
- </xsl:template>
+ <!-- NOTE: Can 'inside' | 'from-inside' better be handled:
+ <!ATTLIST * style:horizontal-pos (from-left|left|center|right|from-inside|inside|outside)#IMPLIED>-->
+ <xsl:template match="@style:horizontal-pos">
+ <xsl:choose>
+ <xsl:when test=".='left'">
+ <xsl:text>text-align:left; </xsl:text>
+ </xsl:when>
+ <xsl:when test=". = 'right'">
+ <xsl:text>text-align:right; </xsl:text>
+ </xsl:when>
+ <xsl:when test=".='center'">
+ <xsl:text>text-align:center; </xsl:text>
+ </xsl:when>
+ <!-- NOTE: currently other values are not used.
+ If the property value is from-left or from-inside,
+ the svg:x attribute associated with the frame element specifies
+ the horizontal position of the frame.
+ Otherwise the svg:x attribute is ignored for text documents.
+ -->
+ </xsl:choose>
+ </xsl:template>
- <xsl:template match="@style:column-width">
- <xsl:text>width:</xsl:text>
- <xsl:choose>
- <!-- changing the distance measure: inch to in -->
- <xsl:when test="contains(., 'inch')">
- <xsl:value-of select="substring-before(.,'ch')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>; </xsl:text>
- </xsl:template>
+ <xsl:template match="@style:column-width">
+ <xsl:text>width:</xsl:text>
+ <xsl:choose>
+ <!-- changing the distance measure: inch to in -->
+ <xsl:when test="contains(., 'inch')">
+ <xsl:value-of select="substring-before(.,'ch')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>; </xsl:text>
+ </xsl:template>
- <xsl:template match="@style:text-underline-style">
- <xsl:text>text-decoration:</xsl:text>
- <xsl:choose>
- <!-- changing the distance measure: inch to in -->
- <xsl:when test=".='none'">
- <xsl:text>none ! important</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>underline</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>; </xsl:text>
- </xsl:template>
+ <xsl:template match="@style:text-underline-style">
+ <xsl:text>text-decoration:</xsl:text>
+ <xsl:choose>
+ <!-- changing the distance measure: inch to in -->
+ <xsl:when test=".='none'">
+ <xsl:text>none ! important</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>underline</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>; </xsl:text>
+ </xsl:template>
- <xsl:template match="@style:font-name">
- <xsl:param name="globalData" />
+ <xsl:template match="@style:font-name">
+ <xsl:param name="globalData" />
- <xsl:text>font-family:</xsl:text>
- <xsl:variable name="content" select="."/>
- <xsl:variable name="quote">'</xsl:variable>
- <xsl:variable name="fontName" select="$globalData/office:font-face-decls/style:font-face[@style:name=$content]/@svg:font-family" />
- <xsl:value-of select="translate($fontName, $quote, '')"/>
- <xsl:text>; </xsl:text>
- </xsl:template>
+ <xsl:text>font-family:</xsl:text>
+ <xsl:variable name="content" select="."/>
+ <xsl:variable name="quote">'</xsl:variable>
+ <xsl:variable name="fontName" select="$globalData/office:font-face-decls/style:font-face[@style:name=$content]/@svg:font-family" />
+ <xsl:value-of select="translate($fontName, $quote, '')"/>
+ <xsl:text>; </xsl:text>
+ </xsl:template>
- <xsl:template match="@style:row-height">
- <xsl:text>height:</xsl:text>
- <xsl:choose>
- <!-- changing the distance measure: inch to in -->
- <xsl:when test="contains(., 'inch')">
- <xsl:value-of select="substring-before(.,'ch')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>; </xsl:text>
- </xsl:template>
+ <xsl:template match="@style:row-height">
+ <xsl:text>height:</xsl:text>
+ <xsl:choose>
+ <!-- changing the distance measure: inch to in -->
+ <xsl:when test="contains(., 'inch')">
+ <xsl:value-of select="substring-before(.,'ch')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>; </xsl:text>
+ </xsl:template>
- <xsl:template match="@svg:strikethrough-position">
- <xsl:if test="not(.='none')">
- <xsl:text>text-decoration:line-through; </xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template match="@style:text-position">
- <xsl:if test="contains(., 'sub')">
- <xsl:text>vertical-align:sub; </xsl:text>
- <xsl:if test="contains(., '%')">
- <xsl:text>font-size:</xsl:text>
- <xsl:value-of select="substring-after(., 'sub ')"/>
- <xsl:text>;</xsl:text>
- </xsl:if>
- </xsl:if>
- <xsl:if test="contains(., 'super')">
- <xsl:text>vertical-align:super; </xsl:text>
- <xsl:if test="contains(., '%')">
- <xsl:text>font-size:</xsl:text>
- <xsl:value-of select="substring-after(., 'super ')"/>
- <xsl:text>;</xsl:text>
- </xsl:if>
- </xsl:if>
- </xsl:template>
+ <xsl:template match="@svg:strikethrough-position">
+ <xsl:if test="not(.='none')">
+ <xsl:text>text-decoration:line-through; </xsl:text>
+ </xsl:if>
+ </xsl:template>
+ <xsl:template match="@style:text-position">
+ <xsl:if test="contains(., 'sub')">
+ <xsl:text>vertical-align:sub; </xsl:text>
+ <xsl:if test="contains(., '%')">
+ <xsl:text>font-size:</xsl:text>
+ <xsl:value-of select="substring-after(., 'sub ')"/>
+ <xsl:text>;</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="contains(., 'super')">
+ <xsl:text>vertical-align:super; </xsl:text>
+ <xsl:if test="contains(., '%')">
+ <xsl:text>font-size:</xsl:text>
+ <xsl:value-of select="substring-after(., 'super ')"/>
+ <xsl:text>;</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
- <xsl:template match="@style:vertical-pos">
- <xsl:choose>
- <xsl:when test=".='from-top'">
- <xsl:text>vertical-align:top; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>vertical-align:</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:template match="@style:vertical-pos">
+ <xsl:choose>
+ <xsl:when test=".='from-top'">
+ <xsl:text>vertical-align:top; </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>vertical-align:</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>; </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template match="@style:width">
- <xsl:text>width:</xsl:text>
- <xsl:choose>
- <!-- changing the distance measure: inch to in -->
- <xsl:when test="contains(., 'inch')">
- <xsl:value-of select="substring-before(.,'ch')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="."/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>; </xsl:text>
- </xsl:template>
- <xsl:template match="@style:wrap">
- <xsl:choose>
- <xsl:when test=".='left'">
- <xsl:text>float:right; </xsl:text>
- </xsl:when>
- <xsl:when test=".='right'">
- <xsl:text>float:left; </xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="@style:writing-mode">
+ <xsl:template match="@style:width">
+ <xsl:text>width:</xsl:text>
+ <xsl:choose>
+ <!-- changing the distance measure: inch to in -->
+ <xsl:when test="contains(., 'inch')">
+ <xsl:value-of select="substring-before(.,'ch')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>; </xsl:text>
+ </xsl:template>
+ <xsl:template match="@style:wrap">
+ <xsl:choose>
+ <xsl:when test=".='left'">
+ <xsl:text>float:right; </xsl:text>
+ </xsl:when>
+ <xsl:when test=".='right'">
+ <xsl:text>float:left; </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+ <xsl:template match="@style:writing-mode">
<xsl:text>writing-mode:</xsl:text>
<xsl:value-of select="."/>
<xsl:text>; </xsl:text>
- </xsl:template>
+ </xsl:template>
<!-- *** Properties with a no 'fo:' or 'style:' prefix *** -->
- <xsl:template match="@table:align">
- <xsl:choose>
- <xsl:when test=".='left'">
- <xsl:if test="not(../@fo:margin-left)">margin-left:0px; </xsl:if>
- <xsl:text>margin-right:auto;</xsl:text></xsl:when>
- <xsl:when test=".='right'">
- <xsl:text>margin-left:auto</xsl:text>
- <xsl:if test="not(../@fo:margin-right)">
- ; margin-right: 0px;
- </xsl:if>
- </xsl:when>
- <xsl:when test=".='center'">
- margin-left:auto;margin-right:auto;
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>float:none; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:template match="@table:align">
+ <xsl:choose>
+ <xsl:when test=".='left'">
+ <xsl:if test="not(../@fo:margin-left)">margin-left:0px; </xsl:if>
+ <xsl:text>margin-right:auto;</xsl:text></xsl:when>
+ <xsl:when test=".='right'">
+ <xsl:text>margin-left:auto</xsl:text>
+ <xsl:if test="not(../@fo:margin-right)">
+ ; margin-right: 0px;
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test=".='center'">
+ margin-left:auto;margin-right:auto;
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>float:none; </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template match="style:background-image">
- <xsl:text>background-image:url(</xsl:text>
- <xsl:value-of select="@xlink:href"/>
- <xsl:text>); </xsl:text>
- <xsl:choose>
- <xsl:when test="@style:repeat = 'repeat'">
- <xsl:text>background-repeat:repeat; </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>background-repeat:no-repeat; </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:template match="style:background-image">
+ <xsl:text>background-image:url(</xsl:text>
+ <xsl:value-of select="@xlink:href"/>
+ <xsl:text>); </xsl:text>
+ <xsl:choose>
+ <xsl:when test="@style:repeat = 'repeat'">
+ <xsl:text>background-repeat:repeat; </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>background-repeat:no-repeat; </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <!-- Changing border width measure to cm and enlarging border-width to the Mozilla browser(1.7)
- visible minimum width
- - 0.0133cm for solid style
- - 0.0399cm for double style
- as there are three border lines painted -->
- <xsl:decimal-format name = "unifiedFormat" decimal-separator = "." />
- <xsl:template name="round-up-border-width">
- <xsl:param name="borderWidth"/>
- <xsl:param name="multiplier"/>
+ <!-- Changing border width measure to cm and enlarging border-width to the Mozilla browser(1.7)
+ visible minimum width
+ - 0.0133cm for solid style
+ - 0.0399cm for double style
+ as there are three border lines painted -->
+ <xsl:decimal-format name = "unifiedFormat" decimal-separator = "." />
+ <xsl:template name="round-up-border-width">
+ <xsl:param name="borderWidth"/>
+ <xsl:param name="multiplier"/>
- <xsl:variable name="borderWidthByCentimeter">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="$borderWidth"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="minimalBorderWidth" select="0.0133 * $multiplier"/>
- <xsl:choose>
- <xsl:when test="number($borderWidthByCentimeter) &lt; $minimalBorderWidth">
- <xsl:value-of select="format-number($minimalBorderWidth,'0.######','unifiedFormat')"/>
- <xsl:text>cm</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="format-number($borderWidthByCentimeter,'0.######','unifiedFormat')"/>
- <xsl:text>cm</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:variable name="borderWidthByCentimeter">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="$borderWidth"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="minimalBorderWidth" select="0.0133 * $multiplier"/>
+ <xsl:choose>
+ <xsl:when test="number($borderWidthByCentimeter) &lt; $minimalBorderWidth">
+ <xsl:value-of select="format-number($minimalBorderWidth,'0.######','unifiedFormat')"/>
+ <xsl:text>cm</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="format-number($borderWidthByCentimeter,'0.######','unifiedFormat')"/>
+ <xsl:text>cm</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/common/table/table.xsl b/filter/source/xslt/odf2xhtml/export/common/table/table.xsl
index 249ab0469035..18053e199fbf 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table/table.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table/table.xsl
@@ -17,139 +17,139 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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">
-
-
- <!-- 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'" />
-
- <!-- ******************* -->
- <!-- *** main table *** -->
- <!-- ******************* -->
-
-
- <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>
-
-
-
- <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' attribute 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>
-
-
- <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: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>
+ 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" />
+
+ <xsl:param name="tableElement" select="'table'" />
+
+ <!-- ******************* -->
+ <!-- *** main table *** -->
+ <!-- ******************* -->
+
+
+ <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>
+
+
+
+ <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' attribute 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>
+
+
+ <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: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:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/common/table/table_cells.xsl b/filter/source/xslt/odf2xhtml/export/common/table/table_cells.xsl
index 6edec6fb1cff..53a649f357e9 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table/table_cells.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table/table_cells.xsl
@@ -17,254 +17,254 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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">
- <!-- *********************************** -->
- <!-- *** write repeating table cells *** -->
- <!-- *********************************** -->
+ <!-- *********************************** -->
+ <!-- *** write repeating table cells *** -->
+ <!-- *********************************** -->
- <!-- matching cells to give out -> covered table cells are not written out -->
- <xsl:template match="table:table-cell">
- <xsl:param name="globalData" />
- <!-- position of the current input cell to get the correct column style (hidden are also counted)-->
- <xsl:param name="allTableColumns" />
- <xsl:param name="maxRowLength" />
- <xsl:param name="tableDataType" />
+ <!-- matching cells to give out -> covered table cells are not written out -->
+ <xsl:template match="table:table-cell">
+ <xsl:param name="globalData" />
+ <!-- position of the current input cell to get the correct column style (hidden are also counted)-->
+ <xsl:param name="allTableColumns" />
+ <xsl:param name="maxRowLength" />
+ <xsl:param name="tableDataType" />
- <!-- The column position of the current cell has to be determined
- to get the adequate column styles during later cell creation,
- or hiding the cell when @table:visibility is not set to 'visible'.
+ <!-- The column position of the current cell has to be determined
+ to get the adequate column styles during later cell creation,
+ or hiding the cell when @table:visibility is not set to 'visible'.
- The position is archieved by adding up all table:number-columns-repeated of the preceding cells.
- Step1: creating '$precedingCells/quantity/@table:number-columns-repeated').
- Step2: sum(xxx:nodeset($precedingCells)/quantity) + 1 -->
- <xsl:variable name="precedingCells">
- <xsl:for-each select="preceding-sibling::*">
- <xsl:choose>
- <!-- maybe a parser is used, which reads the DTD files (e.g. Xerces),
- then '1' is the default for 'table:number-columns-repeated' -->
- <xsl:when test="not(@table:number-columns-repeated and @table:number-columns-repeated > 1)">
- <xsl:element name="quantity" namespace="">
- <xsl:text>1</xsl:text>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="quantity" namespace="">
- <xsl:value-of select="@table:number-columns-repeated" />
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:variable>
+ The position is archieved by adding up all table:number-columns-repeated of the preceding cells.
+ Step1: creating '$precedingCells/quantity/@table:number-columns-repeated').
+ Step2: sum(xxx:nodeset($precedingCells)/quantity) + 1 -->
+ <xsl:variable name="precedingCells">
+ <xsl:for-each select="preceding-sibling::*">
+ <xsl:choose>
+ <!-- maybe a parser is used, which reads the DTD files (e.g. Xerces),
+ then '1' is the default for 'table:number-columns-repeated' -->
+ <xsl:when test="not(@table:number-columns-repeated and @table:number-columns-repeated > 1)">
+ <xsl:element name="quantity" namespace="">
+ <xsl:text>1</xsl:text>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="quantity" namespace="">
+ <xsl:value-of select="@table:number-columns-repeated" />
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:variable>
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="create-table-cell">
- <!-- position of the current input cell to get the correct column style (hidden are also counted)-->
- <xsl:with-param name="allTableColumns" select="$allTableColumns" />
- <xsl:with-param name="maxRowLength" select="$maxRowLength" />
- <xsl:with-param name="precedingColumns" select="sum(common:node-set($precedingCells)/*)" />
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="tableDataType" select="$tableDataType" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="create-table-cell">
- <!-- position of the current input cell to get the correct column style (hidden are also counted)-->
- <xsl:with-param name="allTableColumns" select="$allTableColumns" />
- <xsl:with-param name="maxRowLength" select="$maxRowLength" />
- <xsl:with-param name="precedingColumns" select="sum(xalan:nodeset($precedingCells)/*)" />
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="tableDataType" select="$tableDataType" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="create-table-cell">
- <!-- position of the current input cell to get the correct column style (hidden are also counted)-->
- <xsl:with-param name="allTableColumns" select="$allTableColumns" />
- <xsl:with-param name="maxRowLength" select="$maxRowLength" />
- <xsl:with-param name="precedingColumns" select="sum(xt:node-set($precedingCells)/*)" />
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="tableDataType" select="$tableDataType" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="create-table-cell">
+ <!-- position of the current input cell to get the correct column style (hidden are also counted)-->
+ <xsl:with-param name="allTableColumns" select="$allTableColumns" />
+ <xsl:with-param name="maxRowLength" select="$maxRowLength" />
+ <xsl:with-param name="precedingColumns" select="sum(common:node-set($precedingCells)/*)" />
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="tableDataType" select="$tableDataType" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="create-table-cell">
+ <!-- position of the current input cell to get the correct column style (hidden are also counted)-->
+ <xsl:with-param name="allTableColumns" select="$allTableColumns" />
+ <xsl:with-param name="maxRowLength" select="$maxRowLength" />
+ <xsl:with-param name="precedingColumns" select="sum(xalan:nodeset($precedingCells)/*)" />
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="tableDataType" select="$tableDataType" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="create-table-cell">
+ <!-- position of the current input cell to get the correct column style (hidden are also counted)-->
+ <xsl:with-param name="allTableColumns" select="$allTableColumns" />
+ <xsl:with-param name="maxRowLength" select="$maxRowLength" />
+ <xsl:with-param name="precedingColumns" select="sum(xt:node-set($precedingCells)/*)" />
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="tableDataType" select="$tableDataType" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <!-- current node is a table:table-cell -->
- <xsl:template name="create-table-cell">
- <!-- position of the current input cell to get the correct column style (hidden are also counted)-->
- <xsl:param name="allTableColumns" />
- <xsl:param name="globalData" />
- <xsl:param name="maxRowLength" />
- <xsl:param name="precedingColumns" select="0" />
- <xsl:param name="tableDataType" />
+ <!-- current node is a table:table-cell -->
+ <xsl:template name="create-table-cell">
+ <!-- position of the current input cell to get the correct column style (hidden are also counted)-->
+ <xsl:param name="allTableColumns" />
+ <xsl:param name="globalData" />
+ <xsl:param name="maxRowLength" />
+ <xsl:param name="precedingColumns" select="0" />
+ <xsl:param name="tableDataType" />
- <xsl:variable name="columnPosition" select="$precedingColumns + 1" />
+ <xsl:variable name="columnPosition" select="$precedingColumns + 1" />
- <xsl:if test="$debugEnabled">
- <xsl:message>
- <xsl:text>
- table:table-cell #</xsl:text>
- <xsl:value-of select="$columnPosition" />
- <xsl:text> has been entered with node value: </xsl:text>
- <xsl:value-of select="." />
- <xsl:text>
- table:number-columns-repeated: </xsl:text>
- <xsl:value-of select="@table:number-columns-repeated" />
- <xsl:text>
- maxRowLength: </xsl:text>
- <xsl:value-of select="$maxRowLength" />
- </xsl:message>
- </xsl:if>
+ <xsl:if test="$debugEnabled">
+ <xsl:message>
+ <xsl:text>
+ table:table-cell #</xsl:text>
+ <xsl:value-of select="$columnPosition" />
+ <xsl:text> has been entered with node value: </xsl:text>
+ <xsl:value-of select="." />
+ <xsl:text>
+ table:number-columns-repeated: </xsl:text>
+ <xsl:value-of select="@table:number-columns-repeated" />
+ <xsl:text>
+ maxRowLength: </xsl:text>
+ <xsl:value-of select="$maxRowLength" />
+ </xsl:message>
+ </xsl:if>
- <!-- only non hidden column will be given out -->
- <xsl:variable name="currentTableColumn" select="$allTableColumns/table:table-column[position() = $columnPosition]" />
- <xsl:if test="$currentTableColumn[not(@table:visibility = 'collapse' or @table:visibility = 'filter')]">
- <xsl:choose>
- <!-- if parser reads DTD the default is set to '1' -->
- <xsl:when test="@table:number-columns-repeated > 1">
- <!-- writes multiple entries of a cell -->
- <xsl:call-template name="repeat-write-cell">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="allTableColumns" select="$allTableColumns" />
- <xsl:with-param name="columnPosition" select="$columnPosition" />
- <xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
- <xsl:with-param name="maxRowLength" select="$maxRowLength" />
- <xsl:with-param name="numberColumnsRepeated" select="@table:number-columns-repeated" />
- <xsl:with-param name="tableDataType" select="$tableDataType" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- writes an entry of a cell -->
- <xsl:call-template name="write-cell">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="allTableColumns" select="$allTableColumns" />
- <xsl:with-param name="columnPosition" select="$columnPosition" />
- <xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
- <xsl:with-param name="maxRowLength" select="$maxRowLength" />
- <xsl:with-param name="tableDataType" select="$tableDataType" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
+ <!-- only non hidden column will be given out -->
+ <xsl:variable name="currentTableColumn" select="$allTableColumns/table:table-column[position() = $columnPosition]" />
+ <xsl:if test="$currentTableColumn[not(@table:visibility = 'collapse' or @table:visibility = 'filter')]">
+ <xsl:choose>
+ <!-- if parser reads DTD the default is set to '1' -->
+ <xsl:when test="@table:number-columns-repeated > 1">
+ <!-- writes multiple entries of a cell -->
+ <xsl:call-template name="repeat-write-cell">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="allTableColumns" select="$allTableColumns" />
+ <xsl:with-param name="columnPosition" select="$columnPosition" />
+ <xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
+ <xsl:with-param name="maxRowLength" select="$maxRowLength" />
+ <xsl:with-param name="numberColumnsRepeated" select="@table:number-columns-repeated" />
+ <xsl:with-param name="tableDataType" select="$tableDataType" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- writes an entry of a cell -->
+ <xsl:call-template name="write-cell">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="allTableColumns" select="$allTableColumns" />
+ <xsl:with-param name="columnPosition" select="$columnPosition" />
+ <xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
+ <xsl:with-param name="maxRowLength" select="$maxRowLength" />
+ <xsl:with-param name="tableDataType" select="$tableDataType" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
- <xsl:template name="repeat-write-cell">
- <xsl:param name="globalData" />
- <xsl:param name="allTableColumns" />
- <xsl:param name="columnPosition" />
- <xsl:param name="currentTableColumn" />
- <xsl:param name="maxRowLength" />
- <xsl:param name="numberColumnsRepeated" />
- <xsl:param name="tableDataType" />
+ <xsl:template name="repeat-write-cell">
+ <xsl:param name="globalData" />
+ <xsl:param name="allTableColumns" />
+ <xsl:param name="columnPosition" />
+ <xsl:param name="currentTableColumn" />
+ <xsl:param name="maxRowLength" />
+ <xsl:param name="numberColumnsRepeated" />
+ <xsl:param name="tableDataType" />
- <xsl:choose>
- <!-- This is the current workaround for the flood of cells, simulation background by repeating cell -->
- <xsl:when test="$numberColumnsRepeated > 1 and $maxRowLength > $columnPosition">
+ <xsl:choose>
+ <!-- This is the current workaround for the flood of cells, simulation background by repeating cell -->
+ <xsl:when test="$numberColumnsRepeated > 1 and $maxRowLength > $columnPosition">
- <!-- writes an entry of a cell -->
- <xsl:call-template name="write-cell">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="allTableColumns" select="$allTableColumns" />
- <xsl:with-param name="columnPosition" select="$columnPosition" />
- <xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
- <xsl:with-param name="tableDataType" select="$tableDataType" />
- </xsl:call-template>
- <!-- repeat calling this method until all elements written out -->
- <xsl:if test="$debugEnabled">
- <xsl:message>+++++++++ cell repetition +++++++++</xsl:message>
- </xsl:if>
- <xsl:call-template name="repeat-write-cell">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="allTableColumns" select="$allTableColumns" />
- <xsl:with-param name="columnPosition" select="$columnPosition + 1" />
- <xsl:with-param name="currentTableColumn" select="$allTableColumns/table:table-column[position() = ($columnPosition + 1)]" />
- <xsl:with-param name="maxRowLength" select="$maxRowLength" />
- <xsl:with-param name="numberColumnsRepeated" select="$numberColumnsRepeated - 1" />
- <xsl:with-param name="tableDataType" select="$tableDataType" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- This is the current workaround for the flood of cells, simulation background by repeating cell -->
- <!-- When the maxRowLength is reached a last entry of a cell is written -->
- <xsl:call-template name="write-cell">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="allTableColumns" select="$allTableColumns" />
- <xsl:with-param name="columnPosition" select="$columnPosition" />
- <xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
- <xsl:with-param name="tableDataType" select="$tableDataType" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <!-- writes an entry of a cell -->
+ <xsl:call-template name="write-cell">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="allTableColumns" select="$allTableColumns" />
+ <xsl:with-param name="columnPosition" select="$columnPosition" />
+ <xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
+ <xsl:with-param name="tableDataType" select="$tableDataType" />
+ </xsl:call-template>
+ <!-- repeat calling this method until all elements written out -->
+ <xsl:if test="$debugEnabled">
+ <xsl:message>+++++++++ cell repetition +++++++++</xsl:message>
+ </xsl:if>
+ <xsl:call-template name="repeat-write-cell">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="allTableColumns" select="$allTableColumns" />
+ <xsl:with-param name="columnPosition" select="$columnPosition + 1" />
+ <xsl:with-param name="currentTableColumn" select="$allTableColumns/table:table-column[position() = ($columnPosition + 1)]" />
+ <xsl:with-param name="maxRowLength" select="$maxRowLength" />
+ <xsl:with-param name="numberColumnsRepeated" select="$numberColumnsRepeated - 1" />
+ <xsl:with-param name="tableDataType" select="$tableDataType" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- This is the current workaround for the flood of cells, simulation background by repeating cell -->
+ <!-- When the maxRowLength is reached a last entry of a cell is written -->
+ <xsl:call-template name="write-cell">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="allTableColumns" select="$allTableColumns" />
+ <xsl:with-param name="columnPosition" select="$columnPosition" />
+ <xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
+ <xsl:with-param name="tableDataType" select="$tableDataType" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template name="write-cell">
- <xsl:param name="globalData" />
- <xsl:param name="allTableColumns" />
- <xsl:param name="columnPosition" />
- <xsl:param name="currentTableColumn" />
- <xsl:param name="tableDataType" />
+ <xsl:template name="write-cell">
+ <xsl:param name="globalData" />
+ <xsl:param name="allTableColumns" />
+ <xsl:param name="columnPosition" />
+ <xsl:param name="currentTableColumn" />
+ <xsl:param name="tableDataType" />
- <!-- a non hidden column will be give out -->
- <xsl:choose>
- <xsl:when test="$currentTableColumn[not(@table:visibility = 'collapse' or @table:visibility = 'filter')]">
- <xsl:call-template name="create-table-cell-content">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="allTableColumns" select="$allTableColumns" />
- <xsl:with-param name="columnPosition" select="$columnPosition" />
- <xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
- <xsl:with-param name="tableDataType" select="$tableDataType" />
- </xsl:call-template>
- </xsl:when>
- <!-- a hidden column -->
- <xsl:otherwise>
- <xsl:if test="$debugEnabled">
- <xsl:message>table column is hidden!</xsl:message>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <!-- a non hidden column will be give out -->
+ <xsl:choose>
+ <xsl:when test="$currentTableColumn[not(@table:visibility = 'collapse' or @table:visibility = 'filter')]">
+ <xsl:call-template name="create-table-cell-content">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="allTableColumns" select="$allTableColumns" />
+ <xsl:with-param name="columnPosition" select="$columnPosition" />
+ <xsl:with-param name="currentTableColumn" select="$currentTableColumn" />
+ <xsl:with-param name="tableDataType" select="$tableDataType" />
+ </xsl:call-template>
+ </xsl:when>
+ <!-- a hidden column -->
+ <xsl:otherwise>
+ <xsl:if test="$debugEnabled">
+ <xsl:message>table column is hidden!</xsl:message>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/common/table/table_columns.xsl b/filter/source/xslt/odf2xhtml/export/common/table/table_columns.xsl
index 352bf4f24710..f83302fa0b54 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table/table_columns.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table/table_columns.xsl
@@ -17,218 +17,216 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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">
-
- <xsl:param name="tableColumnElement" select="'col'" />
-
- <!-- ******************************************** -->
- <!-- *** 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" />
-
- <!-- 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>
-
- <!-- 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: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>
-
- <!-- 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" />
-
- <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 &gt; 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" />
-
-
- <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" />
-
- <!-- 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-->
+ 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'" />
+
+ <!-- ******************************************** -->
+ <!-- *** 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" />
+
+ <!-- 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>
+
+ <!-- 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: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>
+
+ <!-- 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" />
+
+ <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 &gt; 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" />
+
+
+ <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" />
+
+ <!-- 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-->
</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl b/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl
index 3677352aba15..2d6cd7285037 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table/table_rows.xsl
@@ -17,187 +17,187 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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">
-
-
- <xsl:param name="rowElement" select="'tr'" />
-
- <!-- ********************************** -->
- <!-- *** 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" />
-
- <!-- 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>
-
- <!-- 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 &gt; 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: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>
-
-
- <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>
-
- <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: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:element>
- </xsl:template>
-
-
- <!-- **************************** -->
- <!-- *** HELPER: table styles *** -->
- <!-- **************************** -->
-
- <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>
+ 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'" />
+
+ <!-- ********************************** -->
+ <!-- *** 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" />
+
+ <!-- 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>
+
+ <!-- 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 &gt; 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: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>
+
+
+ <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>
+
+ <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: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:element>
+ </xsl:template>
+
+
+ <!-- **************************** -->
+ <!-- *** HELPER: table styles *** -->
+ <!-- **************************** -->
+
+ <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:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl b/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
index 1f70abc18ed1..c5982a1d6dd0 100644
--- a/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
+++ b/filter/source/xslt/odf2xhtml/export/common/table_of_content.xsl
@@ -17,267 +17,267 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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:java="http://xml.apache.org/xslt/java" xmlns:sxg="http://www.jclark.com/xt/java/org.openoffice.xslt.OOoMasterDocument" xmlns:common="http://exslt.org/common" xmlns:xt="http://www.jclark.com/xt" 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 java sxg xt common xalan">
- <!-- ****************************** -->
- <!-- *** Table of Content *** -->
- <!-- ****************************** -->
-
- <xsl:param name="currentChildContentRef" />
- <xsl:param name="contentTableHeadings" />
- <xsl:param name="contentTableURL" />
- <xsl:template match="text:table-of-content">
- <xsl:param name="globalData"/>
-
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
- <xsl:template match="text:index-body">
- <xsl:param name="globalData"/>
-
- <xsl:choose>
- <xsl:when test="parent::table-of-content and */text:tab[1] or */*/text:tab[1]">
- <xsl:call-template name="createIndexBodyTable">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="text:index-title" mode="content-table">
- <xsl:param name="globalData"/>
-
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template name="createIndexBodyTable">
- <xsl:param name="globalData"/>
- <xsl:variable name="allStyleTabStops-RTF">
- <xsl:element name="style:tab-stops">
- <xsl:call-template name="get-tab-stops">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="styleName" select="current()/@text:style-name"/>
-
- <!--
- Currently only the style of text:index-body is recognized, but not of a paragraph child containing the text:tab element!
- <xsl:with-param name="styleName" select="descendant-or-self::*/@text:style-name"/>
-
- The column width needs to be tabstop plus fo:margin-left paragraph-properties
- -->
- </xsl:call-template>
- </xsl:element>
- </xsl:variable>
- <xsl:element namespace="{$namespace}" name="table">
-
- <xsl:attribute name="border">0</xsl:attribute>
- <xsl:attribute name="cellspacing">0</xsl:attribute>
- <xsl:attribute name="cellpadding">0</xsl:attribute>
- <xsl:if test="parent::*/@text:style-name">
- <!-- parent as index:body has no style -->
- <xsl:variable name="value" select="$globalData/all-doc-styles/style[@style:name = current()/parent::*/@text:style-name]/*/@style:rel-width"/>
- <xsl:if test="$value">
- <xsl:attribute name="width">
- <xsl:value-of select="$value"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="class">
- <xsl:value-of select="translate(parent::*/@text:style-name, '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
- </xsl:if>
-
- <xsl:element namespace="{$namespace}" name="colgroup">
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="create-col-element">
- <xsl:with-param name="lastNodePosition" select="count(common:node-set($allStyleTabStops-RTF)/style:tab-stops/style:tab-stop)"/>
- <xsl:with-param name="allStyleTabStops" select="common:node-set($allStyleTabStops-RTF)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="create-col-element">
- <xsl:with-param name="lastNodePosition" select="count(xalan:nodeset($allStyleTabStops-RTF)/style:tab-stops/style:tab-stop)"/>
- <xsl:with-param name="allStyleTabStops" select="xalan:nodeset($allStyleTabStops-RTF)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="create-col-element">
- <xsl:with-param name="lastNodePosition" select="count(xt:node-set($allStyleTabStops-RTF)/style:tab-stops/style:tab-stop)"/>
- <xsl:with-param name="allStyleTabStops" select="xt:node-set($allStyleTabStops-RTF)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
-
- <!-- add table data -->
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:apply-templates mode="content-table">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="allStyleTabStops" select="common:node-set($allStyleTabStops-RTF)"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:apply-templates mode="content-table">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="allStyleTabStops" select="xalan:nodeset($allStyleTabStops-RTF)"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:apply-templates mode="content-table">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="allStyleTabStops" select="xt:node-set($allStyleTabStops-RTF)"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:element>
- </xsl:template>
-
-
- <!-- ************************************************ -->
- <!-- *** Create Table for Content Table Paragraph *** -->
- <!-- ************************************************ -->
-
- <!-- Usually the paragraph in a content-table are ordered by tab-stops, which can not be displayed correctly by XHTML/CSS
- Therefore they will be simulated by a table -->
- <xsl:template match="text:p" mode="content-table">
- <xsl:param name="globalData"/>
- <xsl:param name="allStyleTabStops"/>
-
- <!-- all elements before the first tabStop -->
- <xsl:variable name="testNo-RTF">
- <xsl:apply-templates select="node()" mode="cell-content"/>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:variable name="tabNodePositions" select="common:node-set($testNo-RTF)"/>
- <xsl:element namespace="{$namespace}" name="tr">
- <xsl:call-template name="create-td-elements">
- <xsl:with-param name="lastNodePosition" select="count($allStyleTabStops/style:tab-stops/style:tab-stop)"/>
- <xsl:with-param name="position" select="1"/>
- <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
- <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:variable name="tabNodePositions" select="xalan:nodeset($testNo-RTF)"/>
- <xsl:element namespace="{$namespace}" name="tr">
- <xsl:call-template name="create-td-elements">
- <xsl:with-param name="lastNodePosition" select="count($allStyleTabStops/style:tab-stops/style:tab-stop)"/>
- <xsl:with-param name="position" select="1"/>
- <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
- <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:variable name="tabNodePositions" select="xt:node-set($testNo-RTF)"/>
- <xsl:element namespace="{$namespace}" name="tr">
- <xsl:call-template name="create-td-elements">
- <xsl:with-param name="lastNodePosition" select="count($allStyleTabStops/style:tab-stops/style:tab-stop)"/>
- <xsl:with-param name="position" select="1"/>
- <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
- <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- Gathering all style:tab-stops from a style-hierarchy as siblings -->
- <xsl:template name="get-tab-stops">
- <xsl:param name="globalData"/>
- <xsl:param name="styleName"/>
- <xsl:variable name="tabStyle" select="key('styles', $styleName)"/>
-
- <xsl:if test="$tabStyle/*/style:tab-stops/style:tab-stop/@style:position">
- <xsl:for-each select="$tabStyle/*/style:tab-stops/style:tab-stop">
- <xsl:copy-of select="."/>
- </xsl:for-each>
- </xsl:if>
-
- <xsl:if test="$tabStyle/@style:parent-style-name">
- <xsl:call-template name="get-tab-stops">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="styleName" select="$tabStyle/@style:parent-style-name"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="create-col-element">
- <xsl:param name="lastNodePosition"/>
- <xsl:param name="allStyleTabStops"/>
-
- <xsl:for-each select="$allStyleTabStops/style:tab-stops/style:tab-stop">
- <xsl:element namespace="{$namespace}" name="col">
- <xsl:attribute name="style">
- <xsl:text>width: </xsl:text>
- <xsl:choose>
- <xsl:when test="contains(@style:position, 'cm')">
- <xsl:call-template name="create-cell-width">
- <xsl:with-param name="width" select="number(substring-before(@style:position,'cm'))"/>
- <xsl:with-param name="unit" select="'cm'"/>
- <xsl:with-param name="position" select="position() - 1"/>
- <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains(@style:position, 'in')">
- <xsl:call-template name="create-cell-width">
- <xsl:with-param name="width" select="number(substring-before(@style:position,'in'))"/>
- <xsl:with-param name="unit" select="'in'"/>
- <xsl:with-param name="position" select="position() - 1"/>
- <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains(@style:position, 'ch')">
- <xsl:call-template name="create-cell-width">
- <xsl:with-param name="width" select="number(substring-before(@style:position,'ch'))"/>
- <xsl:with-param name="unit" select="'ch'"/>
- <xsl:with-param name="position" select="position() - 1"/>
- <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains(@style:position, 'pt')">
- <xsl:call-template name="create-cell-width">
- <xsl:with-param name="width" select="number(substring-before(@style:position,'pt'))"/>
- <xsl:with-param name="unit" select="'pt'"/>
- <xsl:with-param name="position" select="position() - 1"/>
- <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
- </xsl:call-template>
- </xsl:when>
- </xsl:choose>
-
- </xsl:attribute>
- </xsl:element>
- </xsl:for-each>
-
- </xsl:template>
+ <!-- ****************************** -->
+ <!-- *** Table of Content *** -->
+ <!-- ****************************** -->
+
+ <xsl:param name="currentChildContentRef" />
+ <xsl:param name="contentTableHeadings" />
+ <xsl:param name="contentTableURL" />
+ <xsl:template match="text:table-of-content">
+ <xsl:param name="globalData"/>
+
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+
+ <xsl:template match="text:index-body">
+ <xsl:param name="globalData"/>
+
+ <xsl:choose>
+ <xsl:when test="parent::table-of-content and */text:tab[1] or */*/text:tab[1]">
+ <xsl:call-template name="createIndexBodyTable">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="text:index-title" mode="content-table">
+ <xsl:param name="globalData"/>
+
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template name="createIndexBodyTable">
+ <xsl:param name="globalData"/>
+ <xsl:variable name="allStyleTabStops-RTF">
+ <xsl:element name="style:tab-stops">
+ <xsl:call-template name="get-tab-stops">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="styleName" select="current()/@text:style-name"/>
+
+ <!--
+ Currently only the style of text:index-body is recognized, but not of a paragraph child containing the text:tab element!
+ <xsl:with-param name="styleName" select="descendant-or-self::*/@text:style-name"/>
+
+ The column width needs to be tabstop plus fo:margin-left paragraph-properties
+ -->
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:variable>
+ <xsl:element namespace="{$namespace}" name="table">
+
+ <xsl:attribute name="border">0</xsl:attribute>
+ <xsl:attribute name="cellspacing">0</xsl:attribute>
+ <xsl:attribute name="cellpadding">0</xsl:attribute>
+ <xsl:if test="parent::*/@text:style-name">
+ <!-- parent as index:body has no style -->
+ <xsl:variable name="value" select="$globalData/all-doc-styles/style[@style:name = current()/parent::*/@text:style-name]/*/@style:rel-width"/>
+ <xsl:if test="$value">
+ <xsl:attribute name="width">
+ <xsl:value-of select="$value"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate(parent::*/@text:style-name, '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+ </xsl:if>
+
+ <xsl:element namespace="{$namespace}" name="colgroup">
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="create-col-element">
+ <xsl:with-param name="lastNodePosition" select="count(common:node-set($allStyleTabStops-RTF)/style:tab-stops/style:tab-stop)"/>
+ <xsl:with-param name="allStyleTabStops" select="common:node-set($allStyleTabStops-RTF)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="create-col-element">
+ <xsl:with-param name="lastNodePosition" select="count(xalan:nodeset($allStyleTabStops-RTF)/style:tab-stops/style:tab-stop)"/>
+ <xsl:with-param name="allStyleTabStops" select="xalan:nodeset($allStyleTabStops-RTF)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="create-col-element">
+ <xsl:with-param name="lastNodePosition" select="count(xt:node-set($allStyleTabStops-RTF)/style:tab-stops/style:tab-stop)"/>
+ <xsl:with-param name="allStyleTabStops" select="xt:node-set($allStyleTabStops-RTF)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+
+ <!-- add table data -->
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:apply-templates mode="content-table">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="allStyleTabStops" select="common:node-set($allStyleTabStops-RTF)"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:apply-templates mode="content-table">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="allStyleTabStops" select="xalan:nodeset($allStyleTabStops-RTF)"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:apply-templates mode="content-table">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="allStyleTabStops" select="xt:node-set($allStyleTabStops-RTF)"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:element>
+ </xsl:template>
+
+
+ <!-- ************************************************ -->
+ <!-- *** Create Table for Content Table Paragraph *** -->
+ <!-- ************************************************ -->
+
+ <!-- Usually the paragraph in a content-table are ordered by tab-stops, which can not be displayed correctly by XHTML/CSS
+ Therefore they will be simulated by a table -->
+ <xsl:template match="text:p" mode="content-table">
+ <xsl:param name="globalData"/>
+ <xsl:param name="allStyleTabStops"/>
+
+ <!-- all elements before the first tabStop -->
+ <xsl:variable name="testNo-RTF">
+ <xsl:apply-templates select="node()" mode="cell-content"/>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:variable name="tabNodePositions" select="common:node-set($testNo-RTF)"/>
+ <xsl:element namespace="{$namespace}" name="tr">
+ <xsl:call-template name="create-td-elements">
+ <xsl:with-param name="lastNodePosition" select="count($allStyleTabStops/style:tab-stops/style:tab-stop)"/>
+ <xsl:with-param name="position" select="1"/>
+ <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
+ <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:variable name="tabNodePositions" select="xalan:nodeset($testNo-RTF)"/>
+ <xsl:element namespace="{$namespace}" name="tr">
+ <xsl:call-template name="create-td-elements">
+ <xsl:with-param name="lastNodePosition" select="count($allStyleTabStops/style:tab-stops/style:tab-stop)"/>
+ <xsl:with-param name="position" select="1"/>
+ <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
+ <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:variable name="tabNodePositions" select="xt:node-set($testNo-RTF)"/>
+ <xsl:element namespace="{$namespace}" name="tr">
+ <xsl:call-template name="create-td-elements">
+ <xsl:with-param name="lastNodePosition" select="count($allStyleTabStops/style:tab-stops/style:tab-stop)"/>
+ <xsl:with-param name="position" select="1"/>
+ <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
+ <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Function not found: nodeset</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Gathering all style:tab-stops from a style-hierarchy as siblings -->
+ <xsl:template name="get-tab-stops">
+ <xsl:param name="globalData"/>
+ <xsl:param name="styleName"/>
+ <xsl:variable name="tabStyle" select="key('styles', $styleName)"/>
+
+ <xsl:if test="$tabStyle/*/style:tab-stops/style:tab-stop/@style:position">
+ <xsl:for-each select="$tabStyle/*/style:tab-stops/style:tab-stop">
+ <xsl:copy-of select="."/>
+ </xsl:for-each>
+ </xsl:if>
+
+ <xsl:if test="$tabStyle/@style:parent-style-name">
+ <xsl:call-template name="get-tab-stops">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="styleName" select="$tabStyle/@style:parent-style-name"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="create-col-element">
+ <xsl:param name="lastNodePosition"/>
+ <xsl:param name="allStyleTabStops"/>
+
+ <xsl:for-each select="$allStyleTabStops/style:tab-stops/style:tab-stop">
+ <xsl:element namespace="{$namespace}" name="col">
+ <xsl:attribute name="style">
+ <xsl:text>width: </xsl:text>
+ <xsl:choose>
+ <xsl:when test="contains(@style:position, 'cm')">
+ <xsl:call-template name="create-cell-width">
+ <xsl:with-param name="width" select="number(substring-before(@style:position,'cm'))"/>
+ <xsl:with-param name="unit" select="'cm'"/>
+ <xsl:with-param name="position" select="position() - 1"/>
+ <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains(@style:position, 'in')">
+ <xsl:call-template name="create-cell-width">
+ <xsl:with-param name="width" select="number(substring-before(@style:position,'in'))"/>
+ <xsl:with-param name="unit" select="'in'"/>
+ <xsl:with-param name="position" select="position() - 1"/>
+ <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains(@style:position, 'ch')">
+ <xsl:call-template name="create-cell-width">
+ <xsl:with-param name="width" select="number(substring-before(@style:position,'ch'))"/>
+ <xsl:with-param name="unit" select="'ch'"/>
+ <xsl:with-param name="position" select="position() - 1"/>
+ <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="contains(@style:position, 'pt')">
+ <xsl:call-template name="create-cell-width">
+ <xsl:with-param name="width" select="number(substring-before(@style:position,'pt'))"/>
+ <xsl:with-param name="unit" select="'pt'"/>
+ <xsl:with-param name="position" select="position() - 1"/>
+ <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
+ </xsl:call-template>
+ </xsl:when>
+ </xsl:choose>
+
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:for-each>
+
+ </xsl:template>
<!--
Scenarios tabstops
@@ -301,279 +301,279 @@ Scenarios unmatched:
Not happens in our master document case. Also the algorithm below would have to be expanded (cp. scenario 5).
-->
- <xsl:template name="create-td-elements">
- <xsl:param name="globalData"/>
- <xsl:param name="lastNodePosition"/>
- <xsl:param name="position"/>
- <xsl:param name="allStyleTabStops"/>
- <xsl:param name="tabNodePositions"/>
-
- <xsl:variable name="currentTabStop" select="$allStyleTabStops/style:tab-stops/style:tab-stop[$position]"/>
- <xsl:variable name="earlierTabStop" select="$allStyleTabStops/style:tab-stops/style:tab-stop[$position - 1]"/>
- <xsl:choose>
- <xsl:when test="not($currentTabStop/@style:position) and not($earlierTabStop/@style:position)">
- <!-- in case no TAB STOP is being set -->
- <xsl:element namespace="{$namespace}" name="td">
- <xsl:element namespace="{$namespace}" name="p">
- <xsl:if test="$position = 1">
- <xsl:attribute name="class">
- <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates mode="content-table">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$currentTabStop/@style:type = 'right'">
- <xsl:choose>
- <xsl:when test="$earlierTabStop/@style:type = 'right'">
- <!--
- 2) style:type is 'right' and earlier tabStop is right
- -> following text-nodes, will be put into a right aligned TD -->
- <xsl:element namespace="{$namespace}" name="td">
- <xsl:attribute name="style">
- <xsl:text>align: right</xsl:text>
- </xsl:attribute>
- <xsl:element namespace="{$namespace}" name="p">
- <xsl:if test="$position = 1">
- <xsl:attribute name="class">
- <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:call-template name="grab-cell-content-before-tab-stop">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="endingTabStopPosition" select="$position + 1"/>
- <xsl:with-param name="lastNodePosition" select="$lastNodePosition"/>
- <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element namespace="{$namespace}" name="td">
- <xsl:element namespace="{$namespace}" name="p">
- <xsl:if test="$position = 1">
- <xsl:attribute name="class">
- <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:call-template name="grab-cell-content-before-tab-stop">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="endingTabStopPosition" select="$position"/>
- <xsl:with-param name="lastNodePosition" select="$lastNodePosition"/>
- <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$earlierTabStop/@style:type = 'right'"></xsl:when>
- <xsl:otherwise>
- <!--
- 3) style:type is 'non-right' and earlier tabStop 'non-right' as well
- -> put the preceding tab stops into a TD (left aligned is default) -->
- <xsl:element namespace="{$namespace}" name="p">
- <xsl:if test="$position = 1">
- <xsl:attribute name="class">
- <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:element namespace="{$namespace}" name="td">
- <xsl:call-template name="grab-cell-content-before-tab-stop">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="endingTabStopPosition" select="$position"/>
- <xsl:with-param name="lastNodePosition" select="$lastNodePosition"/>
- <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
-
- <xsl:if test="$position != $lastNodePosition">
- <xsl:call-template name="create-td-elements">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="lastNodePosition" select="$lastNodePosition"/>
- <xsl:with-param name="position" select="$position + 1"/>
- <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
- <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="grab-cell-content-before-tab-stop">
- <xsl:param name="globalData"/>
- <xsl:param name="endingTabStopPosition"/>
- <xsl:param name="tabNodePositions"/>
- <xsl:param name="lastNodePosition"/>
-
- <xsl:choose>
- <xsl:when test="$endingTabStopPosition = 1">
- <xsl:apply-templates mode="content-table" select="node()[position() &lt; $tabNodePositions/tab-stop-node-position[$endingTabStopPosition]]">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="$endingTabStopPosition > $lastNodePosition">
- <xsl:apply-templates mode="content-table" select="node()[position() > $tabNodePositions/tab-stop-node-position[$endingTabStopPosition - 1]]">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="nodesOfNextColumn" select="node()[position() &lt; $tabNodePositions/tab-stop-node-position[$endingTabStopPosition]][position() &gt; $tabNodePositions/tab-stop-node-position[$endingTabStopPosition - 1]]"/>
- <xsl:choose>
- <xsl:when test="$nodesOfNextColumn != ''">
- <xsl:apply-templates mode="content-table" select="$nodesOfNextColumn">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode="content-table">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- As the span width will be mapped to column width, the preceding span widths have to be subtracted -->
- <xsl:template name="create-cell-width">
- <xsl:param name="width"/>
- <xsl:param name="unit"/>
- <xsl:param name="position"/>
- <xsl:param name="allStyleTabStops"/>
-
- <xsl:choose>
- <!-- beyond second width -->
- <xsl:when test="$position > 1">
- <xsl:call-template name="create-cell-width">
- <xsl:with-param name="width" select="$width - number(substring-before($allStyleTabStops/style:tab-stops/style:tab-stop[$position]/@style:position,$unit))"/>
- <xsl:with-param name="unit" select="$unit"/>
- <xsl:with-param name="position" select="$position - 1"/>
- <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
- </xsl:call-template>
- </xsl:when>
- <!-- second width -->
- <xsl:when test="$position = 1">
- <xsl:value-of select="concat($width - number(substring-before($allStyleTabStops/style:tab-stops/style:tab-stop[$position]/@style:position,$unit)), $unit)"/>
- </xsl:when>
- <!-- first width -->
- <xsl:otherwise>
- <xsl:value-of select="concat($width, $unit)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- ************************************** -->
- <!-- CREATION OF A CONTENT TABLE LINK -->
- <!-- ************************************** -->
-
- <xsl:key name="bookmark" match="text:bookmark | text:bookmark-start" use="@text:name"/>
-
- <!-- content table link -->
- <xsl:template match="text:a" mode="content-table">
- <xsl:param name="globalData"/>
-
- <xsl:variable name="name" select="substring(@xlink:href,2)"/>
-
- <xsl:variable name="text">
- <xsl:choose>
- <!-- heuristic assumption that first in a content table row, there is numbering (if at all) and than the text,
- furthermore that a tab will separate the to be neglected page number -->
- <xsl:when test="text:tab">
- <xsl:call-template name="write-text-without-line-numbers">
- <xsl:with-param name="textCount" select="count(text())"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="text()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- REFERENCE HANDLING - HREF -->
- <xsl:element namespace="{$namespace}" name="a">
- <xsl:attribute name="href">
- <xsl:text>#</xsl:text>
- <xsl:choose>
- <xsl:when test="key('bookmark',$name)">
- <xsl:value-of select="$name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select='concat("a_", translate(normalize-space($text), "&#xA;&amp;&lt;&gt;.,;: %()[]/\+", "_______________________________"))'/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:value-of select="$text"/>
- </xsl:element>
- </xsl:template>
-
- <!-- Heuristic: write out text separated by elements, leaving the last number out (mostly text number) -->
- <xsl:template name="write-text-without-line-numbers">
- <xsl:param name="textCount"/>
- <xsl:param name="textNodeNumber" select="1"/>
-
- <xsl:choose>
- <xsl:when test="$textCount &gt; $textNodeNumber">
- <xsl:value-of select="text()[$textNodeNumber]"/>
- <xsl:call-template name="write-text-without-line-numbers">
- <xsl:with-param name="textCount" select="$textCount"/>
- <xsl:with-param name="textNodeNumber" select="$textNodeNumber + 1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="not(number(text()[$textNodeNumber]) &gt; -1)">
- <xsl:value-of select="text()[$textNodeNumber]"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:template>
-
- <xsl:template match="text:s" mode="content-table">
- <xsl:call-template name="write-breakable-whitespace">
- <xsl:with-param name="whitespaces" select="@text:c"/>
- </xsl:call-template>
- </xsl:template>
-
- <!-- ******************** -->
- <!-- *** Common Rules *** -->
- <!-- ******************** -->
-
- <xsl:template match="*" mode="content-table">
- <xsl:param name="globalData"/>
-
- <xsl:apply-templates select=".">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="*" mode="cell-content">
- <xsl:if test="name() = 'text:tab' or *[name() = 'text:tab']">
- <xsl:element name="tab-stop-node-position" namespace="">
- <xsl:value-of select="position()"/>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
- <xsl:template match="text()" mode="content-table">
- <!-- Heuristic to remove page numbers (useless in HTML) in the content table
- usually after a tab -->
- <xsl:if test="name(preceding-sibling::*[1]) != 'text:tab' and not(number() &gt; -1)">
- <xsl:value-of select="."/>
- </xsl:if>
- </xsl:template>
+ <xsl:template name="create-td-elements">
+ <xsl:param name="globalData"/>
+ <xsl:param name="lastNodePosition"/>
+ <xsl:param name="position"/>
+ <xsl:param name="allStyleTabStops"/>
+ <xsl:param name="tabNodePositions"/>
+
+ <xsl:variable name="currentTabStop" select="$allStyleTabStops/style:tab-stops/style:tab-stop[$position]"/>
+ <xsl:variable name="earlierTabStop" select="$allStyleTabStops/style:tab-stops/style:tab-stop[$position - 1]"/>
+ <xsl:choose>
+ <xsl:when test="not($currentTabStop/@style:position) and not($earlierTabStop/@style:position)">
+ <!-- in case no TAB STOP is being set -->
+ <xsl:element namespace="{$namespace}" name="td">
+ <xsl:element namespace="{$namespace}" name="p">
+ <xsl:if test="$position = 1">
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates mode="content-table">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$currentTabStop/@style:type = 'right'">
+ <xsl:choose>
+ <xsl:when test="$earlierTabStop/@style:type = 'right'">
+ <!--
+ 2) style:type is 'right' and earlier tabStop is right
+ -> following text-nodes, will be put into a right aligned TD -->
+ <xsl:element namespace="{$namespace}" name="td">
+ <xsl:attribute name="style">
+ <xsl:text>align: right</xsl:text>
+ </xsl:attribute>
+ <xsl:element namespace="{$namespace}" name="p">
+ <xsl:if test="$position = 1">
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="grab-cell-content-before-tab-stop">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="endingTabStopPosition" select="$position + 1"/>
+ <xsl:with-param name="lastNodePosition" select="$lastNodePosition"/>
+ <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element namespace="{$namespace}" name="td">
+ <xsl:element namespace="{$namespace}" name="p">
+ <xsl:if test="$position = 1">
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:call-template name="grab-cell-content-before-tab-stop">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="endingTabStopPosition" select="$position"/>
+ <xsl:with-param name="lastNodePosition" select="$lastNodePosition"/>
+ <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$earlierTabStop/@style:type = 'right'"></xsl:when>
+ <xsl:otherwise>
+ <!--
+ 3) style:type is 'non-right' and earlier tabStop 'non-right' as well
+ -> put the preceding tab stops into a TD (left aligned is default) -->
+ <xsl:element namespace="{$namespace}" name="p">
+ <xsl:if test="$position = 1">
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:element namespace="{$namespace}" name="td">
+ <xsl:call-template name="grab-cell-content-before-tab-stop">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="endingTabStopPosition" select="$position"/>
+ <xsl:with-param name="lastNodePosition" select="$lastNodePosition"/>
+ <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <xsl:if test="$position != $lastNodePosition">
+ <xsl:call-template name="create-td-elements">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="lastNodePosition" select="$lastNodePosition"/>
+ <xsl:with-param name="position" select="$position + 1"/>
+ <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
+ <xsl:with-param name="tabNodePositions" select="$tabNodePositions"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="grab-cell-content-before-tab-stop">
+ <xsl:param name="globalData"/>
+ <xsl:param name="endingTabStopPosition"/>
+ <xsl:param name="tabNodePositions"/>
+ <xsl:param name="lastNodePosition"/>
+
+ <xsl:choose>
+ <xsl:when test="$endingTabStopPosition = 1">
+ <xsl:apply-templates mode="content-table" select="node()[position() &lt; $tabNodePositions/tab-stop-node-position[$endingTabStopPosition]]">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="$endingTabStopPosition > $lastNodePosition">
+ <xsl:apply-templates mode="content-table" select="node()[position() > $tabNodePositions/tab-stop-node-position[$endingTabStopPosition - 1]]">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="nodesOfNextColumn" select="node()[position() &lt; $tabNodePositions/tab-stop-node-position[$endingTabStopPosition]][position() &gt; $tabNodePositions/tab-stop-node-position[$endingTabStopPosition - 1]]"/>
+ <xsl:choose>
+ <xsl:when test="$nodesOfNextColumn != ''">
+ <xsl:apply-templates mode="content-table" select="$nodesOfNextColumn">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates mode="content-table">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- As the span width will be mapped to column width, the preceding span widths have to be subtracted -->
+ <xsl:template name="create-cell-width">
+ <xsl:param name="width"/>
+ <xsl:param name="unit"/>
+ <xsl:param name="position"/>
+ <xsl:param name="allStyleTabStops"/>
+
+ <xsl:choose>
+ <!-- beyond second width -->
+ <xsl:when test="$position > 1">
+ <xsl:call-template name="create-cell-width">
+ <xsl:with-param name="width" select="$width - number(substring-before($allStyleTabStops/style:tab-stops/style:tab-stop[$position]/@style:position,$unit))"/>
+ <xsl:with-param name="unit" select="$unit"/>
+ <xsl:with-param name="position" select="$position - 1"/>
+ <xsl:with-param name="allStyleTabStops" select="$allStyleTabStops"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- second width -->
+ <xsl:when test="$position = 1">
+ <xsl:value-of select="concat($width - number(substring-before($allStyleTabStops/style:tab-stops/style:tab-stop[$position]/@style:position,$unit)), $unit)"/>
+ </xsl:when>
+ <!-- first width -->
+ <xsl:otherwise>
+ <xsl:value-of select="concat($width, $unit)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- ************************************** -->
+ <!-- CREATION OF A CONTENT TABLE LINK -->
+ <!-- ************************************** -->
+
+ <xsl:key name="bookmark" match="text:bookmark | text:bookmark-start" use="@text:name"/>
+
+ <!-- content table link -->
+ <xsl:template match="text:a" mode="content-table">
+ <xsl:param name="globalData"/>
+
+ <xsl:variable name="name" select="substring(@xlink:href,2)"/>
+
+ <xsl:variable name="text">
+ <xsl:choose>
+ <!-- heuristic assumption that first in a content table row, there is numbering (if at all) and than the text,
+ furthermore that a tab will separate the to be neglected page number -->
+ <xsl:when test="text:tab">
+ <xsl:call-template name="write-text-without-line-numbers">
+ <xsl:with-param name="textCount" select="count(text())"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="text()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- REFERENCE HANDLING - HREF -->
+ <xsl:element namespace="{$namespace}" name="a">
+ <xsl:attribute name="href">
+ <xsl:text>#</xsl:text>
+ <xsl:choose>
+ <xsl:when test="key('bookmark',$name)">
+ <xsl:value-of select="$name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select='concat("a_", translate(normalize-space($text), "&#xA;&amp;&lt;&gt;.,;: %()[]/\+", "_______________________________"))'/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:value-of select="$text"/>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- Heuristic: write out text separated by elements, leaving the last number out (mostly text number) -->
+ <xsl:template name="write-text-without-line-numbers">
+ <xsl:param name="textCount"/>
+ <xsl:param name="textNodeNumber" select="1"/>
+
+ <xsl:choose>
+ <xsl:when test="$textCount &gt; $textNodeNumber">
+ <xsl:value-of select="text()[$textNodeNumber]"/>
+ <xsl:call-template name="write-text-without-line-numbers">
+ <xsl:with-param name="textCount" select="$textCount"/>
+ <xsl:with-param name="textNodeNumber" select="$textNodeNumber + 1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="not(number(text()[$textNodeNumber]) &gt; -1)">
+ <xsl:value-of select="text()[$textNodeNumber]"/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:template>
+
+ <xsl:template match="text:s" mode="content-table">
+ <xsl:call-template name="write-breakable-whitespace">
+ <xsl:with-param name="whitespaces" select="@text:c"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************** -->
+ <!-- *** Common Rules *** -->
+ <!-- ******************** -->
+
+ <xsl:template match="*" mode="content-table">
+ <xsl:param name="globalData"/>
+
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="*" mode="cell-content">
+ <xsl:if test="name() = 'text:tab' or *[name() = 'text:tab']">
+ <xsl:element name="tab-stop-node-position" namespace="">
+ <xsl:value-of select="position()"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="text()" mode="content-table">
+ <!-- Heuristic to remove page numbers (useless in HTML) in the content table
+ usually after a tab -->
+ <xsl:if test="name(preceding-sibling::*[1]) != 'text:tab' and not(number() &gt; -1)">
+ <xsl:value-of select="."/>
+ </xsl:if>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
index 5571629c67aa..c73a0a68cf69 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/body.xsl
@@ -17,2979 +17,2979 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" 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="http://www.w3.org/1999/xhtml">
- <!--+++++ 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"/>
-
- <!-- common office body element handling -->
- <xsl:import href="../common/body.xsl"/>
-
- <!-- common table handling -->
- <xsl:import href="../common/table/table.xsl"/>
-
- <!-- xhtml table handling -->
- <xsl:include href="table.xsl"/>
-
- <!-- Useful in case of 'style:map', conditional formatting, where a style references to another -->
- <xsl:key name="styles" match="/*/office:styles/style:style | /*/office:automatic-styles/style:style" use="@style:name"/>
-
-
- <!-- ************ -->
- <!-- *** body *** -->
- <!-- ************ -->
-
- <xsl:key match="style:style/@style:master-page-name" name="masterPage" use="'count'"/>
- <xsl:key match="style:master-page" name="masterPageElements" use="@style:name"/>
- <xsl:key match="style:page-layout" name="pageLayoutElements" use="@style:name"/>
- <xsl:key name="writingModeStyles" match="/*/office:styles/style:style/style:paragraph-properties/@style:writing-mode | /*/office:automatic-styles/style:style/style:paragraph-properties/@style:writing-mode" use="'test'"/>
- <xsl:template name="create-body">
- <xsl:param name="globalData"/>
- <xsl:call-template name="create-body.collect-page-properties">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:template>
-
- <xsl:template name="create-body.collect-page-properties">
- <xsl:param name="globalData"/>
-
- <!-- approximation to find the correct master page style (with page dimensions) -->
- <xsl:variable name="masterPageNames">
- <!-- Loop over every style:style containing a @style:master-page-name attribute -->
- <xsl:for-each select="key('masterPage','count')">
- <!-- Check if this style is being used in the body -->
- <xsl:if test="key('elementUsingStyle', ../@style:name)">
- <!-- Check every master-page-name if it is not empty and return as ';' separated list -->
- <xsl:if test="string-length(../@style:master-page-name) &gt; 0">
- <xsl:value-of select="../@style:master-page-name"/>;
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name -->
- <xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/>
- <xsl:variable name="pagePropertiesRTF">
- <xsl:choose>
- <xsl:when test="not($pageLayoutName) or $pageLayoutName = ''">
- <xsl:copy-of select="$globalData/styles-file/*/office:automatic-styles/style:page-layout[1]/style:page-layout-properties"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- Find the according style:page-layout and store the properties in a variable -->
- <xsl:copy-of select="key('pageLayoutElements', $pageLayoutName)/style:page-layout-properties"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="create-body.create">
- <xsl:with-param name="globalData" select="common:node-set($globalData)"/>
- <xsl:with-param name="pageProperties" select="common:node-set($pagePropertiesRTF)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="create-body.create">
- <xsl:with-param name="globalData" select="xalan:nodeset($globalData)"/>
- <xsl:with-param name="pageProperties" select="xalan:nodeset($pagePropertiesRTF)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="create-body.create">
- <xsl:with-param name="globalData" select="xt:node-set($globalData)"/>
- <xsl:with-param name="pageProperties" select="xt:node-set($pagePropertiesRTF)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="create-body.create">
- <xsl:param name="globalData"/>
- <xsl:param name="pageProperties"/>
-
- <xsl:element name="body">
- <!-- direction of text flow -->
- <xsl:variable name="writingMode" select="$pageProperties/style:page-layout-properties/@style:writing-mode"/>
- <xsl:choose>
- <xsl:when test="$writingMode">
- <xsl:choose>
- <xsl:when test="contains($writingMode, 'lr')">
- <xsl:attribute name="dir">ltr</xsl:attribute>
- </xsl:when>
- <xsl:when test="contains($writingMode, 'rl')">
- <xsl:attribute name="dir">rtl</xsl:attribute>
- </xsl:when>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- As CSS writing-mode is not implemented by all browsers, a heuristic is done -->
- <xsl:variable name="writingModeTest" select="key('writingModeStyles', 'test')"/>
- <xsl:if test="contains($writingModeTest, 'rl')">
- <xsl:attribute name="dir">rtl</xsl:attribute>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <!-- adapt page size -->
- <xsl:variable name="pageWidth" select="$pageProperties/style:page-layout-properties/@fo:page-width"/>
-
- <!-- multiple backgroundimages for different page styles (never used in html) -->
- <xsl:variable name="backgroundImage" select="$pageProperties/style:page-layout-properties/style:background-image"/>
- <!-- page margins & background image -->
- <xsl:if test="$pageWidth or $pageProperties/style:page-layout-properties/@fo:* or $backgroundImage/@xlink:href">
- <xsl:attribute name="style">
- <xsl:if test="$pageWidth">
- <xsl:text>max-width:</xsl:text>
- <xsl:value-of select="$pageWidth"/>
- <xsl:text>;</xsl:text>
- </xsl:if>
- <xsl:if test="$pageProperties/style:page-layout-properties/@fo:* or $backgroundImage/@xlink:href">
- <xsl:apply-templates select="$pageProperties/style:page-layout-properties/@fo:*"/>
- <xsl:if test="$backgroundImage/@xlink:href">
- <xsl:text>background-image:url(</xsl:text>
- <xsl:call-template name="create-href">
- <xsl:with-param name="href" select="$backgroundImage/@xlink:href"/>
- </xsl:call-template>
- <xsl:text>);</xsl:text>
-
- <xsl:if test="$backgroundImage/@style:repeat">
- <xsl:choose>
- <xsl:when test="$backgroundImage/@style:repeat = 'no-repeat'">
- <xsl:text>background-repeat:no-repeat;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>background-repeat:repeat;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="$backgroundImage/@style:position">
- <xsl:text>background-position:</xsl:text>
- <xsl:value-of select="$backgroundImage/@style:position"/>
- <xsl:text>;</xsl:text>
- </xsl:if>
- </xsl:if>
- </xsl:if>
- </xsl:attribute>
- </xsl:if>
- <!-- processing the content of the OpenDocument content file -->
- <xsl:apply-templates select="/*/office:body/*">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
-
- </xsl:element>
- </xsl:template>
-
- <!-- processing the content of the OpenDocument content file -->
- <xsl:template match="office:body/*">
- <xsl:param name="globalData"/>
-
- <!-- not using of 'apply-styles-and-content' as the content table information migth have been added to 'globalData' variable -->
- <xsl:apply-templates select="@text:style-name | @draw:style-name | @draw:text-style-name | @table:style-name"><!-- | @presentation:style-name -->
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
-
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
-
- <!-- writing the footer- and endnotes beyond the body -->
- <xsl:call-template name="write-text-nodes">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:template>
-
- <!-- ******************************* -->
- <!-- *** User Field Declarations *** -->
- <!-- ******************************* -->
-
- <xsl:template match="text:user-field-get | text:user-field-input">
- <xsl:param name="globalData"/>
-
- <xsl:value-of select="."/>
- </xsl:template>
-
- <xsl:template match="text:conditional-text">
- <xsl:param name="globalData"/>
-
- <xsl:value-of select="."/>
- </xsl:template>
-
- <!-- ODF text fields -->
- <xsl:template match="text:author-initials | text:author-name | text:chapter | text:character-count | text:creation-date | text:creation-time | text:creator | text:date | text:description | text:editing-cycles | text:editing-duration | text:file-name | text:image-count | text:initial-creator | text:keywords | text:modification-date | text:modification-time | text:object-count | text:page-continuation | text:page-count | text:page-number | text:paragraph-count | text:print-date | text:print-time | text:printed-by | text:sender-city | text:sender-company | text:sender-country | text:sender-email | text:sender-fax | text:sender-firstname | text:sender-initials | text:sender-lastname | text:sender-phone-private | text:sender-phone-work | text:sender-position | text:sender-postal-code | text:sender-state-or-province | text:sender-street | text:sender-title | text:sheet-name | text:subject | text:table-count | text:time | text:title | text:user-defined | text:word-count">
- <xsl:param name="globalData"/>
-
- <xsl:element name="span">
- <xsl:attribute name="title">
- <xsl:value-of select="local-name()"/>
- </xsl:attribute>
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
-
-
-
- <!-- *************** -->
- <!-- *** Textbox *** -->
- <!-- *************** -->
-
- <xsl:template match="draw:text-box">
- <xsl:param name="globalData"/>
-
- <xsl:comment>Next 'div' was a 'draw:text-box'.</xsl:comment>
- <xsl:element name="div">
- <xsl:variable name="dimension">
- <xsl:apply-templates select="@fo:min-width"/>
- <xsl:apply-templates select="@fo:max-width"/>
- <xsl:apply-templates select="@fo:min-height"/>
- <xsl:apply-templates select="@fo:max-height"/>
- </xsl:variable>
- <xsl:if test="$dimension">
- <xsl:attribute name="style">
- <xsl:value-of select="$dimension"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="@draw:name">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
-
- <xsl:apply-templates select="node()">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="@fo:min-width">
- <xsl:text>min-width:</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>;</xsl:text>
- </xsl:template>
- <xsl:template match="@fo:max-width">
- <xsl:text>max-width:</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>;</xsl:text>
- </xsl:template>
- <xsl:template match="@fo:min-height">
- <xsl:text>min-height:</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>;</xsl:text>
- </xsl:template>
- <xsl:template match="@fo:max-height">
- <xsl:text>max-height:</xsl:text>
- <xsl:value-of select="."/>
- <xsl:text>;</xsl:text>
- </xsl:template>
-
-
- <!-- inline style helper for the 'div' boxes -->
- <xsl:template name="svg:height">
- <xsl:text>height:</xsl:text>
- <xsl:choose>
- <!-- changing the distance measure: inch to in -->
- <xsl:when test="contains(@svg:height, 'inch')">
- <xsl:value-of select="substring-before(@svg:height, 'ch')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@svg:height"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>;</xsl:text>
- </xsl:template>
-
- <!-- inline style helper for the 'div' boxes -->
- <xsl:template name="svg:width">
- <xsl:text>width:</xsl:text>
- <xsl:choose>
- <!-- changing the distance measure: inch to in -->
- <xsl:when test="contains(@svg:width, 'inch')">
- <xsl:value-of select="substring-before(@svg:width, 'ch')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@svg:width"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>;</xsl:text>
- </xsl:template>
-
-
-
- <!-- ****************** -->
- <!-- *** Paragraphs *** -->
- <!-- ****************** -->
-
- <xsl:template match="text:p | draw:page">
- <xsl:param name="globalData"/>
- <!-- The footnote symbol is the prefix for a footnote in the footer -->
- <xsl:param name="footnotePrefix"/>
- <!-- 1) In ODF sometimes the followig children are nested
- <text:p>
- <draw:frame>
- <draw:text-box>
- <text:p>
- Which results in a paragraphs (the last text:p) having a paragraph as its anchestor.
- In HTML a 'p' can only have inline documents (no other 'p' as children'),
- a 'div' will be given for the ancestors instead.
- 2) ODF images are embedded in a paragraph, but CSS is not able to express a horizontal alignment for an HTML image (text:align is only valid for block elements).
- A surrounding 'div' element taking over the image style solves that problem, but the div is invalid as child of a paragraph
- Therefore the paragraph has to be exchanged with a HTML div element
- -->
- <!-- 2DO page alignment fix - PART1 -->
- <xsl:variable name="childText"><xsl:apply-templates mode="getAllTextChildren"/></xsl:variable>
- <xsl:choose>
- <xsl:when test="name() = 'text:p' and not(*) and (normalize-space($childText) = '')">
- <!-- WorkAround: Test if the empty paragraph was added after an image, which OOO often does -->
- <xsl:variable name="isFollowingImage">
- <xsl:call-template name="follows-empty-paragraphs-and-image">
- <xsl:with-param name="precedingElement" select="preceding-sibling::node()[1]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$isFollowingImage = 'no'">
- <xsl:call-template name="create-paragraph">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="footnotePrefix" select="$footnotePrefix" />
- </xsl:call-template>
- </xsl:if>
-
- </xsl:when>
- <xsl:when test="draw:frame and ((normalize-space($childText) != '') or (((count(*) - count(text:soft-page-break)) &gt; 1)))">
- <!-- If there is a 'draw:frame' child with text (not being whitespace alone) and more than the draw:frame alone and
- not the draw:frame and a soft-page-break alone (which is quite often) -->
-
- <!-- If there is a frame within the text:p or draw:page, its siblings are surrounded as well by a div and are floating (CSS float) -->
- <!-- But it makes no sense to create floating if the frame is alone or only together with a soft-page-break not usable for HTML -->
- <!-- The paragraph is written as DIV as there might be nested paragraphs (see above choose block) -->
- <xsl:choose>
- <xsl:when test="name() = 'text:p'">
- <xsl:comment>Next 'div' was a 'text:p'.</xsl:comment>
- </xsl:when>
- <xsl:otherwise>
- <xsl:comment>Next 'div' was a 'draw:page'.</xsl:comment>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:element name="div">
- <xsl:apply-templates select="@*">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- <!-- the footnote symbol is the prefix for a footnote in the footer -->
- <xsl:copy-of select="$footnotePrefix"/>
- <!-- start floating of frame (and siblings) -->
- <xsl:apply-templates select="node()[1]" mode="frameFloating">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="previousFrameWidths" select="0"/>
- <xsl:with-param name="previousFrameHeights" select="0"/>
- <!-- 2DO for me (Svante) - Not used, uncertain 4now..
- <xsl:with-param name="pageMarginLeft">
- <xsl:call-template name="getPageMarginLeft"/>
- </xsl:with-param>-->
- </xsl:apply-templates>
- </xsl:element>
- <!-- after the last draw:frame sibling the CSS float is disabled
- &#160; is an unbreakable whitespace to give content to the element and force a browser not to ignore the element -->
- <div style="clear:both; line-height:0; width:0; height:0; margin:0; padding:0;">&#160;</div>
- </xsl:when>
- <xsl:when test="text:tab and not(ancestor::text:index-body)">
- <!-- If there is a tabulator (ie. text:tab) within a paragraph, a heuristic for ODF tabulators creates a
- span for every text:tab embracing the following text nodes aligning them according to the tabulator.
- A line break or another text:tab starts a new text:span, line break even the tab counter for the line.
- -->
- <xsl:element name="p">
- <xsl:apply-templates select="@*">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- <!-- start with first child of the paragraph -->
- <xsl:variable name="firstChildNode" select="node()[1]" />
- <xsl:apply-templates select="$firstChildNode" mode="tabHandling">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="tabStops" select="$globalData/all-doc-styles/style[@style:name = current()/@text:style-name]/*/style:tab-stops"/>
- <xsl:with-param name="parentMarginLeft">
- <!-- Styles of first paragraph in list item, including ancestor styles (inheritance) -->
- <xsl:variable name="paragraphName" select="@text:style-name" />
- <xsl:variable name="imageParagraphStyle" select="$globalData/all-styles/style[@style:name = $paragraphName]/final-properties"/>
- <!-- Only the left margin of the first paragraph of a list item will be added to the margin of the complete list (all levels)-->
+ <!--+++++ 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"/>
+
+ <!-- common office body element handling -->
+ <xsl:import href="../common/body.xsl"/>
+
+ <!-- common table handling -->
+ <xsl:import href="../common/table/table.xsl"/>
+
+ <!-- xhtml table handling -->
+ <xsl:include href="table.xsl"/>
+
+ <!-- Useful in case of 'style:map', conditional formatting, where a style references to another -->
+ <xsl:key name="styles" match="/*/office:styles/style:style | /*/office:automatic-styles/style:style" use="@style:name"/>
+
+
+ <!-- ************ -->
+ <!-- *** body *** -->
+ <!-- ************ -->
+
+ <xsl:key match="style:style/@style:master-page-name" name="masterPage" use="'count'"/>
+ <xsl:key match="style:master-page" name="masterPageElements" use="@style:name"/>
+ <xsl:key match="style:page-layout" name="pageLayoutElements" use="@style:name"/>
+ <xsl:key name="writingModeStyles" match="/*/office:styles/style:style/style:paragraph-properties/@style:writing-mode | /*/office:automatic-styles/style:style/style:paragraph-properties/@style:writing-mode" use="'test'"/>
+ <xsl:template name="create-body">
+ <xsl:param name="globalData"/>
+ <xsl:call-template name="create-body.collect-page-properties">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="create-body.collect-page-properties">
+ <xsl:param name="globalData"/>
+
+ <!-- approximation to find the correct master page style (with page dimensions) -->
+ <xsl:variable name="masterPageNames">
+ <!-- Loop over every style:style containing a @style:master-page-name attribute -->
+ <xsl:for-each select="key('masterPage','count')">
+ <!-- Check if this style is being used in the body -->
+ <xsl:if test="key('elementUsingStyle', ../@style:name)">
+ <!-- Check every master-page-name if it is not empty and return as ';' separated list -->
+ <xsl:if test="string-length(../@style:master-page-name) &gt; 0">
+ <xsl:value-of select="../@style:master-page-name"/>;
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name -->
+ <xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/>
+ <xsl:variable name="pagePropertiesRTF">
+ <xsl:choose>
+ <xsl:when test="not($pageLayoutName) or $pageLayoutName = ''">
+ <xsl:copy-of select="$globalData/styles-file/*/office:automatic-styles/style:page-layout[1]/style:page-layout-properties"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Find the according style:page-layout and store the properties in a variable -->
+ <xsl:copy-of select="key('pageLayoutElements', $pageLayoutName)/style:page-layout-properties"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="create-body.create">
+ <xsl:with-param name="globalData" select="common:node-set($globalData)"/>
+ <xsl:with-param name="pageProperties" select="common:node-set($pagePropertiesRTF)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="create-body.create">
+ <xsl:with-param name="globalData" select="xalan:nodeset($globalData)"/>
+ <xsl:with-param name="pageProperties" select="xalan:nodeset($pagePropertiesRTF)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="create-body.create">
+ <xsl:with-param name="globalData" select="xt:node-set($globalData)"/>
+ <xsl:with-param name="pageProperties" select="xt:node-set($pagePropertiesRTF)"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="create-body.create">
+ <xsl:param name="globalData"/>
+ <xsl:param name="pageProperties"/>
+
+ <xsl:element name="body">
+ <!-- direction of text flow -->
+ <xsl:variable name="writingMode" select="$pageProperties/style:page-layout-properties/@style:writing-mode"/>
+ <xsl:choose>
+ <xsl:when test="$writingMode">
+ <xsl:choose>
+ <xsl:when test="contains($writingMode, 'lr')">
+ <xsl:attribute name="dir">ltr</xsl:attribute>
+ </xsl:when>
+ <xsl:when test="contains($writingMode, 'rl')">
+ <xsl:attribute name="dir">rtl</xsl:attribute>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- As CSS writing-mode is not implemented by all browsers, a heuristic is done -->
+ <xsl:variable name="writingModeTest" select="key('writingModeStyles', 'test')"/>
+ <xsl:if test="contains($writingModeTest, 'rl')">
+ <xsl:attribute name="dir">rtl</xsl:attribute>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ <!-- adapt page size -->
+ <xsl:variable name="pageWidth" select="$pageProperties/style:page-layout-properties/@fo:page-width"/>
+
+ <!-- multiple backgroundimages for different page styles (never used in html) -->
+ <xsl:variable name="backgroundImage" select="$pageProperties/style:page-layout-properties/style:background-image"/>
+ <!-- page margins & background image -->
+ <xsl:if test="$pageWidth or $pageProperties/style:page-layout-properties/@fo:* or $backgroundImage/@xlink:href">
+ <xsl:attribute name="style">
+ <xsl:if test="$pageWidth">
+ <xsl:text>max-width:</xsl:text>
+ <xsl:value-of select="$pageWidth"/>
+ <xsl:text>;</xsl:text>
+ </xsl:if>
+ <xsl:if test="$pageProperties/style:page-layout-properties/@fo:* or $backgroundImage/@xlink:href">
+ <xsl:apply-templates select="$pageProperties/style:page-layout-properties/@fo:*"/>
+ <xsl:if test="$backgroundImage/@xlink:href">
+ <xsl:text>background-image:url(</xsl:text>
+ <xsl:call-template name="create-href">
+ <xsl:with-param name="href" select="$backgroundImage/@xlink:href"/>
+ </xsl:call-template>
+ <xsl:text>);</xsl:text>
+
+ <xsl:if test="$backgroundImage/@style:repeat">
+ <xsl:choose>
+ <xsl:when test="$backgroundImage/@style:repeat = 'no-repeat'">
+ <xsl:text>background-repeat:no-repeat;</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>background-repeat:repeat;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ <xsl:if test="$backgroundImage/@style:position">
+ <xsl:text>background-position:</xsl:text>
+ <xsl:value-of select="$backgroundImage/@style:position"/>
+ <xsl:text>;</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:if>
+ <!-- processing the content of the OpenDocument content file -->
+ <xsl:apply-templates select="/*/office:body/*">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+
+ </xsl:element>
+ </xsl:template>
+
+ <!-- processing the content of the OpenDocument content file -->
+ <xsl:template match="office:body/*">
+ <xsl:param name="globalData"/>
+
+ <!-- not using of 'apply-styles-and-content' as the content table information migth have been added to 'globalData' variable -->
+ <xsl:apply-templates select="@text:style-name | @draw:style-name | @draw:text-style-name | @table:style-name"><!-- | @presentation:style-name -->
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+
+ <!-- writing the footer- and endnotes beyond the body -->
+ <xsl:call-template name="write-text-nodes">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ******************************* -->
+ <!-- *** User Field Declarations *** -->
+ <!-- ******************************* -->
+
+ <xsl:template match="text:user-field-get | text:user-field-input">
+ <xsl:param name="globalData"/>
+
+ <xsl:value-of select="."/>
+ </xsl:template>
+
+ <xsl:template match="text:conditional-text">
+ <xsl:param name="globalData"/>
+
+ <xsl:value-of select="."/>
+ </xsl:template>
+
+ <!-- ODF text fields -->
+ <xsl:template match="text:author-initials | text:author-name | text:chapter | text:character-count | text:creation-date | text:creation-time | text:creator | text:date | text:description | text:editing-cycles | text:editing-duration | text:file-name | text:image-count | text:initial-creator | text:keywords | text:modification-date | text:modification-time | text:object-count | text:page-continuation | text:page-count | text:page-number | text:paragraph-count | text:print-date | text:print-time | text:printed-by | text:sender-city | text:sender-company | text:sender-country | text:sender-email | text:sender-fax | text:sender-firstname | text:sender-initials | text:sender-lastname | text:sender-phone-private | text:sender-phone-work | text:sender-position | text:sender-postal-code | text:sender-state-or-province | text:sender-street | text:sender-title | text:sheet-name | text:subject | text:table-count | text:time | text:title | text:user-defined | text:word-count">
+ <xsl:param name="globalData"/>
+
+ <xsl:element name="span">
+ <xsl:attribute name="title">
+ <xsl:value-of select="local-name()"/>
+ </xsl:attribute>
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:template>
+
+
+
+ <!-- *************** -->
+ <!-- *** Textbox *** -->
+ <!-- *************** -->
+
+ <xsl:template match="draw:text-box">
+ <xsl:param name="globalData"/>
+
+ <xsl:comment>Next 'div' was a 'draw:text-box'.</xsl:comment>
+ <xsl:element name="div">
+ <xsl:variable name="dimension">
+ <xsl:apply-templates select="@fo:min-width"/>
+ <xsl:apply-templates select="@fo:max-width"/>
+ <xsl:apply-templates select="@fo:min-height"/>
+ <xsl:apply-templates select="@fo:max-height"/>
+ </xsl:variable>
+ <xsl:if test="$dimension">
+ <xsl:attribute name="style">
+ <xsl:value-of select="$dimension"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="@draw:name">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+
+ <xsl:apply-templates select="node()">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="@fo:min-width">
+ <xsl:text>min-width:</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>;</xsl:text>
+ </xsl:template>
+ <xsl:template match="@fo:max-width">
+ <xsl:text>max-width:</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>;</xsl:text>
+ </xsl:template>
+ <xsl:template match="@fo:min-height">
+ <xsl:text>min-height:</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>;</xsl:text>
+ </xsl:template>
+ <xsl:template match="@fo:max-height">
+ <xsl:text>max-height:</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>;</xsl:text>
+ </xsl:template>
+
+
+ <!-- inline style helper for the 'div' boxes -->
+ <xsl:template name="svg:height">
+ <xsl:text>height:</xsl:text>
+ <xsl:choose>
+ <!-- changing the distance measure: inch to in -->
+ <xsl:when test="contains(@svg:height, 'inch')">
+ <xsl:value-of select="substring-before(@svg:height, 'ch')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@svg:height"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>;</xsl:text>
+ </xsl:template>
+
+ <!-- inline style helper for the 'div' boxes -->
+ <xsl:template name="svg:width">
+ <xsl:text>width:</xsl:text>
+ <xsl:choose>
+ <!-- changing the distance measure: inch to in -->
+ <xsl:when test="contains(@svg:width, 'inch')">
+ <xsl:value-of select="substring-before(@svg:width, 'ch')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@svg:width"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>;</xsl:text>
+ </xsl:template>
+
+
+
+ <!-- ****************** -->
+ <!-- *** Paragraphs *** -->
+ <!-- ****************** -->
+
+ <xsl:template match="text:p | draw:page">
+ <xsl:param name="globalData"/>
+ <!-- The footnote symbol is the prefix for a footnote in the footer -->
+ <xsl:param name="footnotePrefix"/>
+ <!-- 1) In ODF sometimes the followig children are nested
+ <text:p>
+ <draw:frame>
+ <draw:text-box>
+ <text:p>
+ Which results in a paragraphs (the last text:p) having a paragraph as its anchestor.
+ In HTML a 'p' can only have inline documents (no other 'p' as children'),
+ a 'div' will be given for the ancestors instead.
+ 2) ODF images are embedded in a paragraph, but CSS is not able to express a horizontal alignment for an HTML image (text:align is only valid for block elements).
+ A surrounding 'div' element taking over the image style solves that problem, but the div is invalid as child of a paragraph
+ Therefore the paragraph has to be exchanged with a HTML div element
+ -->
+ <!-- 2DO page alignment fix - PART1 -->
+ <xsl:variable name="childText"><xsl:apply-templates mode="getAllTextChildren"/></xsl:variable>
+ <xsl:choose>
+ <xsl:when test="name() = 'text:p' and not(*) and (normalize-space($childText) = '')">
+ <!-- WorkAround: Test if the empty paragraph was added after an image, which OOO often does -->
+ <xsl:variable name="isFollowingImage">
+ <xsl:call-template name="follows-empty-paragraphs-and-image">
+ <xsl:with-param name="precedingElement" select="preceding-sibling::node()[1]"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$isFollowingImage = 'no'">
+ <xsl:call-template name="create-paragraph">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="footnotePrefix" select="$footnotePrefix" />
+ </xsl:call-template>
+ </xsl:if>
+
+ </xsl:when>
+ <xsl:when test="draw:frame and ((normalize-space($childText) != '') or (((count(*) - count(text:soft-page-break)) &gt; 1)))">
+ <!-- If there is a 'draw:frame' child with text (not being whitespace alone) and more than the draw:frame alone and
+ not the draw:frame and a soft-page-break alone (which is quite often) -->
+
+ <!-- If there is a frame within the text:p or draw:page, its siblings are surrounded as well by a div and are floating (CSS float) -->
+ <!-- But it makes no sense to create floating if the frame is alone or only together with a soft-page-break not usable for HTML -->
+ <!-- The paragraph is written as DIV as there might be nested paragraphs (see above choose block) -->
+ <xsl:choose>
+ <xsl:when test="name() = 'text:p'">
+ <xsl:comment>Next 'div' was a 'text:p'.</xsl:comment>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:comment>Next 'div' was a 'draw:page'.</xsl:comment>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:element name="div">
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ <!-- the footnote symbol is the prefix for a footnote in the footer -->
+ <xsl:copy-of select="$footnotePrefix"/>
+ <!-- start floating of frame (and siblings) -->
+ <xsl:apply-templates select="node()[1]" mode="frameFloating">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="previousFrameWidths" select="0"/>
+ <xsl:with-param name="previousFrameHeights" select="0"/>
+ <!-- 2DO for me (Svante) - Not used, uncertain 4now..
+ <xsl:with-param name="pageMarginLeft">
+ <xsl:call-template name="getPageMarginLeft"/>
+ </xsl:with-param>-->
+ </xsl:apply-templates>
+ </xsl:element>
+ <!-- after the last draw:frame sibling the CSS float is disabled
+ &#160; is an unbreakable whitespace to give content to the element and force a browser not to ignore the element -->
+ <div style="clear:both; line-height:0; width:0; height:0; margin:0; padding:0;">&#160;</div>
+ </xsl:when>
+ <xsl:when test="text:tab and not(ancestor::text:index-body)">
+ <!-- If there is a tabulator (ie. text:tab) within a paragraph, a heuristic for ODF tabulators creates a
+ span for every text:tab embracing the following text nodes aligning them according to the tabulator.
+ A line break or another text:tab starts a new text:span, line break even the tab counter for the line.
+ -->
+ <xsl:element name="p">
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ <!-- start with first child of the paragraph -->
+ <xsl:variable name="firstChildNode" select="node()[1]" />
+ <xsl:apply-templates select="$firstChildNode" mode="tabHandling">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="tabStops" select="$globalData/all-doc-styles/style[@style:name = current()/@text:style-name]/*/style:tab-stops"/>
+ <xsl:with-param name="parentMarginLeft">
+ <!-- Styles of first paragraph in list item, including ancestor styles (inheritance) -->
+ <xsl:variable name="paragraphName" select="@text:style-name" />
+ <xsl:variable name="imageParagraphStyle" select="$globalData/all-styles/style[@style:name = $paragraphName]/final-properties"/>
+ <!-- Only the left margin of the first paragraph of a list item will be added to the margin of the complete list (all levels)-->
<!-- 2DO: left-margin in order with bidirectional -->
- <xsl:choose>
- <xsl:when test="contains($imageParagraphStyle, 'margin-left:')">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="normalize-space(substring-before(substring-after($imageParagraphStyle, 'margin-left:'), ';'))"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="pageMarginLeft">
- <xsl:call-template name="getPageMarginLeft"/>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:when>
- <xsl:when test="text:tab and text:a and ancestor::text:index-body">
- <xsl:element name="p">
- <xsl:apply-templates select="attribute::* | child::text:a">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- </xsl:element>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <!-- !!Check if paragraph is empty!!
- OOo writes out empty paragraphs layouted behind an image (= draw:image within draw:frame)
- those have to be neglected in HTML -->
- <xsl:when test="name() = 'text:p' and not($childText) and not(*)">
- <xsl:variable name="isFollowingImage">
- <xsl:call-template name="follows-empty-paragraphs-and-image">
- <xsl:with-param name="precedingElement" select="preceding-sibling::node()[1]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:if test="$isFollowingImage = 'no'">
- <xsl:call-template name="create-paragraph">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="footnotePrefix" select="$footnotePrefix" />
- </xsl:call-template>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="create-paragraph">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="footnotePrefix" select="$footnotePrefix" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- Return the text -->
- <xsl:template match="text()" mode="getAllTextChildren">
- <xsl:value-of select="."/>
- </xsl:template>
-
- <!-- A span will be created for every text:tab embracing the following text nodes.
- A line break or another text:tab starts a new text:span -->
- <xsl:template match="* | text()" mode="tabHandling">
- <xsl:param name="globalData"/>
- <xsl:param name="tabStops"/>
- <!-- there can be multiple tabs in one line, tabNo guesses the one to apply. By default the first i.e. "1" -->
- <xsl:param name="tabCount" select="0"/>
- <xsl:param name="parentMarginLeft" />
- <xsl:param name="pageMarginLeft" />
+ <xsl:choose>
+ <xsl:when test="contains($imageParagraphStyle, 'margin-left:')">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="normalize-space(substring-before(substring-after($imageParagraphStyle, 'margin-left:'), ';'))"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="pageMarginLeft">
+ <xsl:call-template name="getPageMarginLeft"/>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:when>
+ <xsl:when test="text:tab and text:a and ancestor::text:index-body">
+ <xsl:element name="p">
+ <xsl:apply-templates select="attribute::* | child::text:a">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <!-- !!Check if paragraph is empty!!
+ OOo writes out empty paragraphs layouted behind an image (= draw:image within draw:frame)
+ those have to be neglected in HTML -->
+ <xsl:when test="name() = 'text:p' and not($childText) and not(*)">
+ <xsl:variable name="isFollowingImage">
+ <xsl:call-template name="follows-empty-paragraphs-and-image">
+ <xsl:with-param name="precedingElement" select="preceding-sibling::node()[1]"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$isFollowingImage = 'no'">
+ <xsl:call-template name="create-paragraph">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="footnotePrefix" select="$footnotePrefix" />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="create-paragraph">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="footnotePrefix" select="$footnotePrefix" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Return the text -->
+ <xsl:template match="text()" mode="getAllTextChildren">
+ <xsl:value-of select="."/>
+ </xsl:template>
+
+ <!-- A span will be created for every text:tab embracing the following text nodes.
+ A line break or another text:tab starts a new text:span -->
+ <xsl:template match="* | text()" mode="tabHandling">
+ <xsl:param name="globalData"/>
+ <xsl:param name="tabStops"/>
+ <!-- there can be multiple tabs in one line, tabNo guesses the one to apply. By default the first i.e. "1" -->
+ <xsl:param name="tabCount" select="0"/>
+ <xsl:param name="parentMarginLeft" />
+ <xsl:param name="pageMarginLeft" />
<!-- 2DO: EXCHANGE FOLLOWING SIBLING BY VARIABLE -->
- <xsl:variable name="followingSiblingNode" select="following-sibling::node()[1]"/>
-
-
- <!--
- Every tabulator indents its following content, encapuslated in a span
- element.
-
- This template have two modes:
-
- 1) Before the first tabulator it will match as usually paragraph content
- to HTML.
- 2) After the first paragraph it will always triggers two recursions.
- One embraces the following content of a paragraph element into a span.
- (tabContentHandling)
- The other calls this template and will now ignore anything else than
- TAB and LINE-BREAK.
-
-
- The tabulators and linebreaks are being iterated, one by one to keep track of the tab number
- -->
-
-
- <xsl:choose>
- <xsl:when test="name() = 'text:tab'">
- <!-- every frame sibling have to be incapuslated within a div with left indent -->
- <xsl:element name="span">
- <xsl:choose>
- <xsl:when test="count($tabStops/style:tab-stop) &gt; 0 and count($tabStops/style:tab-stop) &lt; 3">
- <!-- only allow the heuristic when the style has less than 3 TABS -->
- <!-- ignore heuristics if no TABS are defined -->
- <xsl:attribute name="style">
- <xsl:call-template name="createTabIndent">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="tabStops" select="$tabStops"/>
- <xsl:with-param name="tabCount" select="$tabCount + 1"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
- <xsl:with-param name="pageMarginLeft" select="$pageMarginLeft"/>
- </xsl:call-template>
- </xsl:attribute>
- </xsl:when>
- <xsl:otherwise>
- <!-- if there are more than 3 TABS in the style, create a none-breakable-space as whitespace -->
- <xsl:text>&#160;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="following-sibling::node()[1]" mode="tabContentHandling">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:element>
- <xsl:apply-templates select="following-sibling::node()[1]" mode="tabHandling">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="tabStops" select="$tabStops"/>
- <xsl:with-param name="tabCount" select="$tabCount + 1"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
- <xsl:with-param name="pageMarginLeft" select="$pageMarginLeft"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="name() = 'text:line-break'">
- <!-- A line-break resets the tabCount to '0' -->
- <br/>
- <xsl:apply-templates select="following-sibling::node()[1]" mode="tabHandling">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="tabStops" select="$tabStops"/>
- <xsl:with-param name="tabCount" select="0"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
- <xsl:with-param name="pageMarginLeft" select="$pageMarginLeft"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <!-- only before the first tab all content is written out -->
- <xsl:if test="$tabCount = 0">
- <xsl:apply-templates select=".">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:apply-templates select="following-sibling::node()[1]" mode="tabHandling">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="tabStops" select="$tabStops"/>
- <xsl:with-param name="tabCount" select="$tabCount"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
- <xsl:with-param name="pageMarginLeft" select="$pageMarginLeft"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- This recursion creates the content of a tab (i.e. following siblings
- till next TAB or LINE BREAK) and ends with the next
- TAB, LINE-BREAK or with the end of the paragraph.
- -->
- <xsl:template match="* | text()" mode="tabContentHandling">
- <xsl:param name="globalData"/>
-
- <xsl:if test="(name() != 'text:tab') and (name() != 'text:line-break')">
- <!-- Write out content -->
- <xsl:apply-templates select=".">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- <!-- Apply for the next node -->
- <xsl:apply-templates select="following-sibling::node()[1]" mode="tabContentHandling">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="createTabIndent">
- <xsl:param name="globalData"/>
- <xsl:param name="tabStops"/>
- <xsl:param name="tabCount"/>
- <xsl:param name="parentMarginLeft" />
- <xsl:param name="pageMarginLeft" />
-
- <xsl:text>position:absolute;left:</xsl:text>
- <xsl:variable name="tabPosition">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="$tabStops/style:tab-stop[$tabCount]/@style:position"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="tabIndent">
- <xsl:choose>
- <xsl:when test="$tabStops/style:tab-stop[$tabCount]/@style:type = 'center'">
- <!-- in case of style:type 'center' the text is even before the tab stop,
- centered around the beginning. As I see currently no way in mapping this,
- therefore I do some HEURISTIC (minus -2.5cm) -->
- <xsl:value-of select="$tabPosition + $parentMarginLeft + $pageMarginLeft - 2.5"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$tabPosition + $parentMarginLeft + $pageMarginLeft"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!--<xsl:message>TAB: tabCount=
- <xsl:value-of select="$tabCount"/>, tabPosition=
- <xsl:value-of select="$tabPosition"/>, tabIndent=
- <xsl:value-of select="$tabIndent"/>
- </xsl:message>-->
- <xsl:choose>
- <xsl:when test="$tabIndent='NaN'">
- <xsl:variable name="tabPositionTmp">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="$tabStops/style:tab-stop[last()]/@style:position"/>
- </xsl:call-template>
- </xsl:variable>
- <!-- Heuristic: for every tab that is more than specified give a further 1 cm -->
- <xsl:value-of select="$parentMarginLeft + $tabPositionTmp + count($tabStops/style:tab-stop) - $tabCount"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$tabIndent"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>cm;</xsl:text>
- <xsl:apply-templates select="$tabStops/style:tab-stop[$tabCount]/@style:type"/>
- </xsl:template>
-
- <!-- OOo writes out empty paragraphs layouted behind an image,
- those have to be neglected in HTML
- This method checks if an empty paragraph is of that kind! -->
- <xsl:template name="follows-empty-paragraphs-and-image">
- <xsl:param name="precedingElement" />
- <xsl:param name="elementToCheck" select="1"/>
- <xsl:choose>
- <!-- OOo writes out empty paragraphs layouted behind the image,
- those have to be neglected in HTML
- <xsl:when test="name() = 'text:p' and (normalize-space($childText) = '')"> -->
- <!-- WorkAround: Test if the empty paragraph was added after an image, which OOO often does -->
- <xsl:when test="(name($precedingElement) = 'text:p' and not($precedingElement/text()) and not($precedingElement/*))">
- <xsl:call-template name="follows-empty-paragraphs-and-image">
- <xsl:with-param name="precedingElement" select="preceding-sibling::*[$elementToCheck]"/>
- <xsl:with-param name="elementToCheck" select="$elementToCheck +1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$precedingElement/draw:frame">yes</xsl:when>
- <xsl:otherwise>no</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="create-paragraph">
- <xsl:param name="globalData"/>
- <!-- the footnote symbol is the prefix for a footnote in the footer -->
- <xsl:param name="footnotePrefix"/>
-
- <!-- xhtml:p may only contain inline elements.
- If there is one frame beyond, div must be used! -->
- <xsl:variable name="elementName">
- <xsl:choose>
- <xsl:when test="descendant::draw:frame[1] or descendant::text:p[1]">div</xsl:when>
- <xsl:otherwise>p</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:element name="{$elementName}">
- <xsl:choose>
- <!-- in ODF borders of paragraphs will be merged by default. Merging means the adjactend paragraphs are building a unit,
- where only the first and the last will have a border to the surrounding (top / bottom border)
- <xsl:variable name="precedingParagraphStyle" select="preceding-sibling::*[1][name() = 'text:p']/@text:style-name"/>
- <xsl:variable name="followingParagraphStyle" select="following-sibling::*[1][name() = 'text:p']/@text:style-name"/>
- -->
- <xsl:when test="$globalData/all-styles/style[@style:name = current()/@text:style-name]/@mergedBorders">
- <xsl:variable name="precedingParagraphStyle" select="preceding-sibling::*[1][name() = 'text:p']/@text:style-name"/>
- <xsl:variable name="followingParagraphStyle" select="following-sibling::*[1][name() = 'text:p']/@text:style-name"/>
- <xsl:choose>
- <xsl:when test="$precedingParagraphStyle or $followingParagraphStyle">
- <xsl:variable name="isPrecedingBorderParagraph" select="$globalData/all-styles/style[@style:name = $precedingParagraphStyle]/@mergedBorders"/>
- <xsl:variable name="isFollowingBorderParagraph" select="$globalData/all-styles/style[@style:name = $followingParagraphStyle]/@mergedBorders"/>
- <xsl:choose>
- <xsl:when test="not($isPrecedingBorderParagraph) and $isFollowingBorderParagraph">
- <xsl:attribute name="class">
- <xsl:value-of select="concat(translate(@text:style-name, '.,;: %()[]/\+', '_____________'), '_borderStart')"/>
- </xsl:attribute>
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="$isPrecedingBorderParagraph and not($isFollowingBorderParagraph)">
- <xsl:attribute name="class">
- <xsl:value-of select="concat(translate(@text:style-name, '.,;: %()[]/\+', '_____________'), '_borderEnd')"/>
- </xsl:attribute>
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="class">
- <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="write-paragraph">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="write-paragraph">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="footnotePrefix" select="$footnotePrefix" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:template>
-
- <xsl:template name="write-paragraph">
- <xsl:param name="globalData"/>
- <!-- the footnote symbol is the prefix for a footnote in the footer -->
- <xsl:param name="footnotePrefix" />
-
- <!-- empty paragraph tags does not provoke an carridge return,
- therefore an non breakable space (&nbsp) 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:with-param name="footnotePrefix" select="$footnotePrefix" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="apply-styles-and-content">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="footnotePrefix" select="$footnotePrefix" />
- </xsl:call-template>
- <xsl:text>&#160;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="style:tab-stop/@style:type">
- <xsl:text>text-align:</xsl:text>
- <xsl:choose>
- <xsl:when test=". = 'left'">left</xsl:when>
- <xsl:when test=". = 'right'">right</xsl:when>
- <xsl:when test=". = 'center'">center</xsl:when>
- <xsl:otherwise>justify</xsl:otherwise>
- </xsl:choose>
- <xsl:text>;</xsl:text>
- </xsl:template>
-
- <!-- As soon a frame is within a paragraph (text:p) or page:frame, every child element is floating (CSS) and worked out in sequence.
- Accumulating prior frame width and adding parent's left margin -->
- <!-- Matching all elements and text beyond a paragraph/text:page which are sibling of a draw:frame -->
- <xsl:template match="* | text()" mode="frameFloating">
- <xsl:param name="globalData"/>
- <xsl:param name="previousFrameWidths" select="0"/>
- <xsl:param name="previousFrameHeights" select="0" />
- <!-- it becomes true for siblings after a draw:frame -->
- <xsl:param name="createDiv" select="false()"/>
- <xsl:param name="noDivBefore" select="true()"/>
- <xsl:param name="leftPosition" />
- <xsl:param name="parentMarginLeft" />
- <xsl:param name="frameAlignedToParagraphWithSvgY" />
-
- <xsl:choose>
- <xsl:when test="name() = 'draw:frame'">
- <xsl:copy-of select="$frameAlignedToParagraphWithSvgY"/>
-
- <!-- if the first node is a draw:frame create a div -->
- <xsl:call-template name="createDrawFrame">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
- <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
- </xsl:call-template>
- <!-- next elements will be called after the creation with the new indent (plus width of frame) -->
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="nextSiblingIsFrame" select="name(following-sibling::node()[1]) = 'draw:frame'"/>
- <xsl:choose>
- <xsl:when test="$createDiv and normalize-space(.) != ''">
- <!-- every following frame sibling till the next draw:frame
- have to be incapuslated within a div with left indent.
- To be moved altogether according the indent (usually right) -->
- <xsl:comment>Next 'div' added for floating.</xsl:comment>
- <xsl:element name="div">
- <xsl:attribute name="style">
- <xsl:text>position:relative; left:</xsl:text>
- <xsl:value-of select="$leftPosition"/>
- <xsl:text>cm;</xsl:text>
- </xsl:attribute>
- <xsl:apply-templates select=".">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- <!-- if it is a frame sibling it will be NOT incapuslated within the div (as already within one) -->
- <xsl:if test="not($nextSiblingIsFrame)">
- <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
- <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="false()"/>
- <xsl:with-param name="noDivBefore" select="$noDivBefore"/>
- <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:element>
- <xsl:copy-of select="$frameAlignedToParagraphWithSvgY"/>
-
- <!-- Other draw:frame will be created outside of the div element -->
- <xsl:apply-templates select="following-sibling::draw:frame[1]" mode="frameFloating">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
- <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="not($createDiv)">
- <xsl:apply-templates select=".">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
- </xsl:apply-templates>
- <xsl:if test="not($nextSiblingIsFrame) or $noDivBefore">
- <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
- <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="false()"/>
- <xsl:with-param name="noDivBefore" select="$noDivBefore"/>
- <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- A XML node other than text or element (e.g. comment) should not stop the recursion -->
- <xsl:template match="comment()" mode="frameFloating">
- <xsl:param name="globalData"/>
- <xsl:param name="previousFrameWidths" select="0"/>
- <xsl:param name="previousFrameHeights" select="0" />
- <!-- it becomes true for siblings after a draw:frame -->
- <xsl:param name="createDiv" select="false()"/>
- <xsl:param name="noDivBefore" select="true()"/>
- <xsl:param name="leftPosition" />
- <xsl:param name="parentMarginLeft" />
- <xsl:param name="frameAlignedToParagraphWithSvgY" />
-
- <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="$createDiv"/>
- <xsl:with-param name="noDivBefore" select="$noDivBefore"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
-
- <!-- As draw:frame may occur within more elements than in text:p and draw:page -->
- <xsl:template match="draw:frame">
- <xsl:param name="globalData"/>
- <xsl:param name="previousFrameWidths" select="0"/>
- <xsl:param name="previousFrameHeights" select="0" />
-
- <xsl:call-template name="createDrawFrame">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
- <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
- </xsl:call-template>
- <!-- after the last draw:frame sibling the CSS float is disabled -->
- <xsl:if test="@text:anchor-type!='as-char'">
- <div style="clear:both; line-height:0; width:0; height:0; margin:0; padding:0;">&#160;</div>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="getPageMarginLeft">
- <!-- approximation to find the correct master page style (with page dimensions) -->
- <xsl:variable name="masterPageNames">
- <!-- Loop over every style:style containing a @style:master-page-name attribute -->
- <xsl:for-each select="key('masterPage','count')">
- <!-- Check if this style is being used in the body -->
- <xsl:if test="key('elementUsingStyle', ../@style:name)">
- <!-- Check every master-page-name if it is not empty and return as ';' separated list -->
- <xsl:if test="string-length(../@style:master-page-name) &gt; 0">
- <xsl:value-of select="../@style:master-page-name"/>;
- </xsl:if>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name -->
- <xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/>
- <!-- Find the according style:page-layout and store the properties in a variable -->
- <xsl:variable name="pageMarginLeftAttr" select="key('pageLayoutElements', $pageLayoutName)/style:page-layout-properties/@fo:margin-left"/>
- <xsl:choose>
- <xsl:when test="$pageMarginLeftAttr">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="$pageMarginLeftAttr"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- Elements and text aside of a draw:frame are floating, here a div is being created.
- Either for a draw:frame or for text and other elements floating aside -->
- <xsl:template name="createDrawFrame">
- <xsl:param name="globalData"/>
- <xsl:param name="previousFrameWidths" select="0"/>
- <xsl:param name="previousFrameHeights" select="0" />
- <xsl:param name="parentMarginLeft"/>
-
- <xsl:variable name="parentMarginLeftNew">
- <xsl:choose>
- <xsl:when test="string-length(normalize-space($parentMarginLeft)) &lt; 1">
- <!-- Styles of first paragraph in list item, including ancestor styles (inheritance) -->
- <xsl:variable name="paragraphName" select="parent::*/@text:style-name" />
- <xsl:variable name="imageParagraphStyle" select="$globalData/all-styles/style[@style:name = $paragraphName]/final-properties"/>
- <!-- Only the left margin of the first paragraph of a list item will be added to the margin of the complete list (all levels)-->
- <xsl:choose>
- <xsl:when test="contains($imageParagraphStyle, 'margin-left:')">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="normalize-space(substring-before(substring-after($imageParagraphStyle, 'margin-left:'), ';'))"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$parentMarginLeft"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="svgWidth">
- <xsl:choose>
- <xsl:when test="@svg:width">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="@svg:width"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="svgX">
- <xsl:choose>
- <xsl:when test="@svg:x">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="@svg:x"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="leftPosition" select="$svgX - $parentMarginLeftNew - $previousFrameWidths"/>
- <xsl:variable name="svgY">
- <xsl:choose>
- <xsl:when test="@svg:y">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="@svg:y"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- if the frame is anchored on a paragraph -->
- <xsl:if test="@text:anchor-type='paragraph'">
- <xsl:comment>Next 'div' is emulating the top hight of a draw:frame.</xsl:comment>
- <!-- When the svg:y is set relative to the paragraph content, the best way to emulate a positive height,
- is to add an invisbile division inbetween with a height.
- Often text will flow into this 'gap', which is handled separately!
- -->
- <xsl:if test="$svgY &gt; 0">
- <xsl:element name="div">
- <xsl:attribute name="style">
- <xsl:text>height:</xsl:text>
- <xsl:value-of select="$svgY"/>
- <xsl:text>cm;</xsl:text>
- </xsl:attribute>
- <xsl:text>&#160;</xsl:text>
- </xsl:element>
- </xsl:if>
- </xsl:if>
-
-
- <!--
- <xsl:variable name="followingSibling" select="following-sibling::node()[1]"/>
- <xsl:choose>
- HEURISTIC: if the frame is anchored on a paragraph and the above gab is big enough to hold a text line,
- move it behind the text
- <xsl:when test="@text:anchor-type='paragraph' and
- (
- ($svgY &gt; 0.5) or
- ($svgX &gt; 4)
- ) and normalize-space($followingSibling) != ''">
- <xsl:apply-templates select="$followingSibling" mode="frameFloating">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeftNew"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="true()"/>
- <xsl:with-param name="noDivBefore" select="false()"/>
- <xsl:with-param name="frameAlignedToParagraphWithSvgY">
- <xsl:call-template name="createDrawFrame2">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
- <xsl:with-param name="parentMarginLeftNew" select="$parentMarginLeftNew"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="svgY" select="$svgY"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>-->
- <xsl:call-template name="createDrawFrame2">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
- <xsl:with-param name="parentMarginLeftNew" select="$parentMarginLeftNew"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="svgY" select="$svgY"/>
- </xsl:call-template>
- <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
- <xsl:with-param name="parentMarginLeft" select="$parentMarginLeftNew"/>
- <xsl:with-param name="leftPosition" select="$leftPosition"/>
- <xsl:with-param name="createDiv" select="true()"/>
- <xsl:with-param name="noDivBefore" select="false()"/>
- </xsl:apply-templates>
- <!--
-
- </xsl:otherwise>
- </xsl:choose> -->
- </xsl:template>
-
- <xsl:template name="createDrawFrame2">
- <xsl:param name="globalData"/>
- <xsl:param name="previousFrameWidths" />
- <xsl:param name="parentMarginLeftNew"/>
- <xsl:param name="leftPosition" />
- <xsl:param name="svgY" />
-
- <xsl:variable name="elem-name">
- <xsl:choose>
- <xsl:when test="@text:anchor-type='as-char'">span</xsl:when>
- <xsl:otherwise>div</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:comment>Next '
- <xsl:value-of select="$elem-name"/>' is a draw:frame.
- </xsl:comment>
- <xsl:element name="{$elem-name}">
- <xsl:choose>
- <xsl:when test="draw:object/math:math">
- <!-- draw:frame elements contain many data that are not
- relevant for mathematical formulas and that may
- cause incorrect rendering. Let's ignore the
- replacement image and keep only the id attribute.
- See fdo#66645 -->
- <xsl:apply-templates select="@draw:name"/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="draw:object[1]"/>
- <!-- TODO: do not always add a space after the formula,
- for example when it is followed by a comma, period,
- dash etc This will probably require using regexp
- features like xsl:analyze-string -->
- <xsl:text> </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="style">
- <xsl:call-template name="widthAndHeight"/>
- <xsl:text> padding:0; </xsl:text>
- <xsl:if test="@text:anchor-type!='as-char'">
- <!-- all images float (CSS float reltaive) with a left position calculated by svg:x - parentMarginLeft - previousFrameWidths -->
- <xsl:text> float:left; position:relative; left:</xsl:text>
- <xsl:value-of select="$leftPosition"/>
- <xsl:text>cm; </xsl:text>
- <!-- if the frame is anchored on a char -->
- <xsl:if test="@text:anchor-type='char'">
- <xsl:text>top:</xsl:text>
- <xsl:value-of select="$svgY"/>
- <xsl:text>cm; </xsl:text>
- </xsl:if>
- </xsl:if>
- </xsl:attribute>
- <xsl:apply-templates select="@*">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="node()">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="svg:desc"/>
-
- <xsl:template name="widthAndHeight">
- <xsl:if test="@svg:height | @svg:width">
- <xsl:choose>
- <xsl:when test="not(@svg:width)">
- <xsl:call-template name="svg:height"/>
- </xsl:when>
- <xsl:when test="not(@svg:height)">
- <xsl:call-template name="svg:width"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="svg:height"/>
- <xsl:call-template name="svg:width"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
-
- <!-- ***************** -->
- <!-- *** Text Span *** -->
- <!-- ***************** -->
-
- <xsl:template match="text:span">
- <xsl:param name="globalData"/>
-
- <xsl:choose>
- <xsl:when test="draw:frame">
- <!-- sometimes an ODF image is anchored as character and the
- image frame appears within a span (which is not valid for HTML)
- Heuristic: Neglecting the span assuming no text content aside
- of frame within span -->
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:element name="span">
- <xsl:call-template name="apply-styles-and-content">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
-
- <!-- **************** -->
- <!-- *** Headings *** -->
- <!-- **************** -->
-
- <xsl:template match="text:h">
- <xsl:param name="globalData"/>
-
- <!-- no creation of empty headings (without text content) -->
- <xsl:if test="text() or descendant::text()">
- <!-- The URL linking of an table-of-content is due to a bug (cp. bug id# 102311) not mapped as URL in the XML.
- Linking of the table-of-content can therefore only be archieved by a work-around in HTML -->
- <xsl:call-template name="create-heading">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:template>
-
- <!-- default matching for header elements -->
- <xsl:template name="create-heading">
- <xsl:param name="globalData"/>
-
- <xsl:variable name="headingLevel">
- <xsl:choose>
- <xsl:when test="@text:outline-level &lt; 6">
- <xsl:value-of select="@text:outline-level"/>
- </xsl:when>
- <xsl:otherwise>6</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="headertyp" select="concat('h', $headingLevel)"/>
- <xsl:element name="{$headertyp}">
- <!-- outline style 'text:min-label-width' is interpreted as a CSS 'margin-right' attribute
- NOTE: Should be handled as CSS style in style header -->
- <xsl:variable name="min-label" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/*/@text:min-label-width"/>
- <xsl:attribute name="class">
- <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
-
- <xsl:call-template name="create-heading-anchor">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
-
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:element>
-
- </xsl:template>
-
- <xsl:template name="create-heading-anchor">
- <xsl:param name="globalData"/>
-
- <!-- writing out a heading number if desired.-->
- <!-- if a corresponding 'text:outline-style' exist or is not empty -->
- <xsl:choose>
- <xsl:when test="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@style:num-format != '' and not(@text:is-list-header='true')">
-
- <!-- Every heading element will get an unique anchor for its file, from its hiearchy level and name:
- For example: The heading title 'My favorite heading' might get <a name="1_2_2_My_favorite_heading" /> -->
- <!-- creating an anchor for referencing the heading (e.g. from content table) -->
- <xsl:variable name="headingNumber">
- <xsl:call-template name="get-heading-number">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="create-heading-anchor2">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="headingNumber" select="$headingNumber"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="create-heading-anchor2">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <xsl:template name="get-heading-number">
- <xsl:param name="globalData"/>
-
- <!-- write number prefix -->
- <xsl:value-of select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@style:num-prefix"/>
- <xsl:call-template name="write-heading-number">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- <!-- write number suffix -->
- <xsl:value-of select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@style:num-suffix"/>
- </xsl:template>
-
- <!-- creating an anchor for referencing the heading -->
- <xsl:template name="create-heading-anchor2">
- <xsl:param name="globalData"/>
- <xsl:param name="headingNumber" />
-
- <xsl:variable name="title">
- <xsl:apply-templates mode="concatenate"/>
- </xsl:variable>
- <!-- REFERENCE HANDLING - ANCHOR -->
- <xsl:element namespace="{$namespace}" name="a">
- <xsl:attribute name="id">
- <xsl:value-of select="translate(concat('a_',normalize-space($headingNumber), '_', normalize-space($title)), '&#xA;&amp;&lt;&gt;–.,;: %()[]/\+', '____________________________')" disable-output-escaping="yes"/>
- </xsl:attribute>
-
- <xsl:element name="span">
- <!-- Convert the "label-followed-by" to margins. According to ODF, possible values are: 'listtab', 'space', and 'nothing'.
- 'space' seems not to be written out by LO, and for 'nothing' we obviously need do nothing.
- NOTE: Should be handled as CSS style in style header -->
- <xsl:variable name="currentOutlineLevel" select="@text:outline-level"/>
- <xsl:variable name="labelFollowedBy" select="$globalData//office:document/office:styles/text:outline-style/text:outline-level-style[@text:level = $currentOutlineLevel]/style:list-level-properties[@text:list-level-position-and-space-mode='label-alignment']/style:list-level-label-alignment/@text:label-followed-by"/>
-
- <!-- Add some margin, but only if there is a number preceding the heading. -->
- <xsl:if test="$labelFollowedBy='listtab' and $headingNumber != ''">
- <xsl:attribute name="class">
- <xsl:text>heading_numbering</xsl:text>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select="$headingNumber"/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
- <xsl:template name="write-heading-number">
- <xsl:param name="globalData"/>
-
- <!-- By default heading start with '1', the parameter 'textStartValue' will only be set, if the attribute @text:start-value exist -->
- <xsl:choose>
- <xsl:when test="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@text:start-value">
- <xsl:call-template name="calc-heading-number">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="outlineLevel" select="@text:outline-level"/>
- <xsl:with-param name="textStartValue" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@text:start-value"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="calc-heading-number">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="outlineLevel" select="@text:outline-level"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!--
- Find the correct heading no., which is the sum of 'text:start-value'
- and preceding siblings of 'text:h' with the same 'text:outline-level' (until a text:outline-level with lower value is found).
- If the 'text:start-value is not set the default value of '1' has to be taken.
- If a heading number is found (e.g. text:outline-level='3') all heading numbers
- for the higher levels have to be written out -->
- <xsl:template name="calc-heading-number">
- <xsl:param name="globalData"/>
- <xsl:param name="outlineLevel"/><!-- text level of the heading -->
- <xsl:param name="iOutlineLevel" select="1"/><!-- iterator, counts from 1 to the text level of the heading -->
- <xsl:param name="textStartValue" select="1"/><!-- text level to start with, default is '1' -->
-
- <xsl:choose>
- <!-- iText levels counts up from '1' to outlineLevel
- Which means writing a heading number from left to right -->
- <xsl:when test="$iOutlineLevel &lt; $outlineLevel">
-
- <!-- Write preceding heading numbers -->
- <xsl:if test="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = ($iOutlineLevel)]/@style:num-format != ''">
- <xsl:call-template name="writeNumber">
- <xsl:with-param name="numberDigit">
- <xsl:call-template name="calc-heading-digit">
- <xsl:with-param name="value" select="0"/>
- <xsl:with-param name="currentoutlineLevel" select="$iOutlineLevel"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="numberFormat" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = ($iOutlineLevel)]/@style:num-format"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = ($iOutlineLevel + 1)]/@text:start-value">
- <xsl:call-template name="calc-heading-number">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="outlineLevel" select="$outlineLevel"/>
- <xsl:with-param name="iOutlineLevel" select="$iOutlineLevel + 1"/>
- <xsl:with-param name="textStartValue" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = ($iOutlineLevel + 1)]/@text:start-value"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="calc-heading-number">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="outlineLevel" select="$outlineLevel"/>
- <xsl:with-param name="iOutlineLevel" select="$iOutlineLevel + 1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <!-- Write preceding heading numbers -->
- <xsl:call-template name="writeNumber">
- <xsl:with-param name="numberDigit">
- <xsl:call-template name="calc-heading-digit">
- <xsl:with-param name="value" select="$textStartValue"/>
- <xsl:with-param name="currentoutlineLevel" select="$iOutlineLevel"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="numberFormat" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = $iOutlineLevel]/@style:num-format"/>
- <xsl:with-param name="last" select="true()"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="writeNumber">
- <xsl:param name="numberDigit"/>
- <xsl:param name="numberFormat"/>
- <xsl:param name="last"/>
-
- <xsl:choose>
- <xsl:when test="not($numberFormat)">
- <xsl:number value="$numberDigit" format="1."/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$last">
- <xsl:number value="$numberDigit" format="{$numberFormat}"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:number value="$numberDigit" format="{$numberFormat}."/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="calc-heading-digit">
- <xsl:param name="value"/>
- <xsl:param name="currentoutlineLevel"/>
- <xsl:param name="i" select="1"/>
-
- <xsl:variable name="precedingoutlineLevel" select="preceding-sibling::text:h[$i]/@text:outline-level"/>
- <!-- tdf#107696: if text:h has attribute "is-list-header" with "true" value, it mustn't be counted for numbering -->
- <xsl:variable name="precedingoutlineLevel-is-list-header" select="preceding-sibling::text:h[$i][@text:is-list-header='true']/@text:outline-level"/>
- <xsl:choose>
- <xsl:when test="($currentoutlineLevel = $precedingoutlineLevel) and (not($precedingoutlineLevel-is-list-header)) ">
- <xsl:call-template name="calc-heading-digit">
- <xsl:with-param name="value" select="$value + 1"/>
- <xsl:with-param name="currentoutlineLevel" select="$currentoutlineLevel"/>
- <xsl:with-param name="i" select="$i + 1"/>
- </xsl:call-template>
- </xsl:when>
- <!-- tdf#107696: case text:h has attribute "is-list-header" with "true" value, we don't increment value -->
- <xsl:when test="($currentoutlineLevel = $precedingoutlineLevel) and ($precedingoutlineLevel-is-list-header) ">
- <xsl:call-template name="calc-heading-digit">
- <xsl:with-param name="value" select="$value"/>
- <xsl:with-param name="currentoutlineLevel" select="$currentoutlineLevel"/>
- <xsl:with-param name="i" select="$i + 1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="$currentoutlineLevel &lt; $precedingoutlineLevel">
- <xsl:call-template name="calc-heading-digit">
- <xsl:with-param name="value" select="$value"/>
- <xsl:with-param name="currentoutlineLevel" select="$currentoutlineLevel"/>
- <xsl:with-param name="i" select="$i + 1"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- Neglect Annotations -->
- <xsl:template match="office:annotation" mode="concatenate"/>
-
- <!-- Match text:placeholder child nodes (e.g. text) -->
- <xsl:template match="text:placeholder">
- <xsl:param name="globalData"/>
-
- <xsl:call-template name="apply-styles-and-content">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:template>
-
- <!-- ************* -->
- <!-- *** Link *** -->
- <!-- ************* -->
-
- <xsl:template match="text:a | draw:a">
- <xsl:param name="globalData"/>
-
- <xsl:call-template name="create-common-anchor-link">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:template>
-
-
- <xsl:template name="create-common-anchor-link">
- <xsl:param name="globalData"/>
-
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:call-template name="create-href">
- <xsl:with-param name="href" select="@xlink:href"/>
- </xsl:call-template>
- </xsl:attribute>
- <xsl:call-template name="apply-styles-and-content">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
-
-
-
- <!-- ******************* -->
- <!-- *** Image Link *** -->
- <!-- ******************* -->
-
- <!-- currently suggesting that all draw:object-ole elements are images -->
- <xsl:template match="draw:image | draw:object-ole">
- <xsl:param name="globalData"/>
-
- <xsl:choose>
- <xsl:when test="ancestor::text:p or parent::text:span or parent::text:h or parent::draw:a or parent::text:a or text:ruby-base">
- <!-- XHTML does not allow the mapped elements to contain paragraphs -->
- <xsl:call-template name="create-image-element">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- images are embedded in a paragraph, but are in CSS not able to express a horizontal alignment for themself.
- A 'div' element taking over the image style would solve that problem, but is invalid as child of a paragraph -->
- <xsl:element name="p">
- <xsl:apply-templates select="@draw:style-name">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
-
- <xsl:call-template name="create-image-element">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="create-image-element">
- <xsl:param name="globalData"/>
-
- <xsl:element name="img">
- <xsl:if test="../@svg:width or ../@svg:height">
- <xsl:attribute name="style">
- <xsl:if test="../@svg:height">
- <xsl:text>height:</xsl:text>
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="../@svg:height"/>
- </xsl:call-template>
- <xsl:text>cm;</xsl:text>
- </xsl:if>
- <xsl:if test="../@svg:width">
- <xsl:text>width:</xsl:text>
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="../@svg:width"/>
- </xsl:call-template>
- <xsl:text>cm;</xsl:text>
- </xsl:if>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="alt">
- <xsl:choose>
- <xsl:when test="../svg:title">
- <xsl:value-of select="../svg:title"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>
- Accessibility Warning:
- No alternate text ('svg:title' element) set for
- image '
- <xsl:value-of select="@xlink:href"/>'!
- </xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
-
- <xsl:attribute name="src">
- <xsl:call-template name="create-href">
- <xsl:with-param name="href" select="@xlink:href"/>
- <xsl:with-param name="mimetype" select="@loext:mime-type"/>
- </xsl:call-template>
- </xsl:attribute>
-
- <!-- style interpretation only, as no subelements are allowed for img in XHTML -->
- <xsl:apply-templates select="@draw:style-name">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
-
- <!-- ************ -->
- <!-- *** list *** -->
- <!-- ************ -->
- <!--
- Due to the requirements below the ODF list functionality is not handled by CSS, but the list labels calculated and written by XSLT.
-
- REQUIREMENTS:
- =============
-
- A)
- One significant difference between XHTML and Office List elements is that a list without text nodes but only further list children
- would not show a list symbol in the Office, but in the browser from XHTML.
-
- B)
- Since OASIS Open Document XML (implemented in OOo2.0) only one parent type exists for list items
- the 'text:list' element. The XHTML element 'ol', 'ul' will be chosen upon the list style type.
-
- C)
- An Office list may be spread over the whole document. Linked by their style and text:continue-numbering='true'.
-
- D)
- An Office list can use characters or images as list label.
-
- E)
- An Office list can have a prefix and suffix around the list label.
-
- F)
- An Office list style may have the attribute consecutive numbering, which resolves in a list counting for all levels
-
- G)
- An Office list may (re)start on any arbitrary value by using @text:start-value on the text:list-item
-
- INDENTATION:
- ============
-
- The indent of a list label is not only calculated by using the text:space-before of the list level (listLevelStyle), but
- as well taking the left margin of the first paragraph (or heading) of the list into account as loy match="" name="" use=""/>ng it is not negative.
-
- | MARGIN LEFT | LABEL |
-
- | text:space-before (listlevelstyle) | text:min-label-width |
- | + fo:left-margin (firstParagraph) | |
-
- Further details beyond text:list-list..
- -->
- <xsl:key name="listStyles" match=" /*/office:styles/text:list-style | /*/office:automatic-styles/text:list-style | /*/office:styles/style:graphic-properties/text:list-style | /*/office:automatic-styles/style:graphic-properties/text:list-style | /*/office:styles/text:list-style | /*/office:automatic-styles/text:list-style | /*/office:styles/style:graphic-properties/text:list-style | /*/office:automatic-styles/style:graphic-properties/text:list-style" use="@style:name"/>
-
- <!--
- A text list may only have text:list-item and text:list-header as children.
- -->
- <xsl:template match="text:list">
- <xsl:param name="globalData"/>
- <xsl:param name="isListNumberingReset"/>
- <xsl:param name="isNextLevelNumberingReset"/>
- <xsl:param name="listLevel" select="1"/>
- <xsl:param name="listRestart" select="false()"/>
- <xsl:param name="itemLabel" select="''"/>
- <xsl:param name="listStyle"/>
- <xsl:param name="listStyleName" select="@text:style-name"/>
-
- <!-- To choose list type - get the list style, with the same 'text:style-name' and same 'text:level' >-->
- <xsl:variable name="listStyleRTF">
- <xsl:variable name="listStyleInContentFile" select="key('listStyles', $listStyleName)"/>
- <xsl:choose>
- <xsl:when test="$listStyleInContentFile">
- <xsl:copy-of select="$listStyleInContentFile"/>
- </xsl:when>
- <xsl:when test="$globalData/office:styles/text:list-style[@style:name = $listStyleName]">
- <xsl:copy-of select="$globalData/office:styles/text:list-style[@style:name = $listStyleName]"/>
- </xsl:when>
- <xsl:when test="$globalData/office:styles/style:graphic-properties/text:list-style[@style:name = $listStyleName]">
- <xsl:copy-of select="$globalData/office:styles/style:graphic-properties/text:list-style[@style:name = $listStyleName]"/>
- </xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:choose>
- <xsl:when test="function-available('common:node-set')">
- <xsl:call-template name="create-list-type">
- <xsl:with-param name="listStyle" select="common:node-set($listStyleRTF)" />
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listRestart" select="$listRestart"/>
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="listStyleName" select="$listStyleName" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xalan:nodeset')">
- <xsl:call-template name="create-list-type">
- <xsl:with-param name="listStyle" select="xalan:nodeset($listStyleRTF)" />
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listRestart" select="$listRestart"/>
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="listStyleName" select="$listStyleName" />
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="function-available('xt:node-set')">
- <xsl:call-template name="create-list-type">
- <xsl:with-param name="listStyle" select="xt:node-set($listStyleRTF)" />
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listRestart" select="$listRestart"/>
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="listStyleName" select="$listStyleName" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="create-list-type">
- <xsl:param name="globalData"/>
- <xsl:param name="isListNumberingReset"/>
- <xsl:param name="isNextLevelNumberingReset"/>
- <xsl:param name="listLevel" />
- <xsl:param name="listRestart" />
- <xsl:param name="itemLabel"/>
- <xsl:param name="listStyle"/>
- <xsl:param name="listStyleName" />
-
- <!-- $globalData/styles-file/*/office:styles/ -->
- <xsl:variable name="listLevelStyle" select="$listStyle/*/*[@text:level = number($listLevel)]"/>
- <xsl:variable name="listIndent">
- <xsl:call-template name="getListIndent">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="firstPara" select="*[1]/*[name() = 'text:p' or name() = 'text:h'][1]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="isEmptyList" select="not(*[1]/*[name() = 'text:h' or name() = 'text:p' or name() = 'text:name'])"/>
- <xsl:variable name="listType">
- <xsl:choose>
- <!-- ordered list -->
- <xsl:when test="name($listLevelStyle) = 'text:list-level-style-number'">
- <xsl:text>ol</xsl:text>
- </xsl:when>
- <!-- unordered list (bullet or image) -->
- <xsl:otherwise>
- <xsl:text>ul</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:element name="{$listType}">
- <xsl:apply-templates select="*[1]" mode="listItemSibling">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
- <xsl:with-param name="isListNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset">
- <xsl:choose>
- <xsl:when test="$isListNumberingReset">
- <xsl:value-of select="true()"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- A list is empty if a text:list does not have a text:list-header or text:list-item (wildcard as only those can exist beyond a text:list), which contains a text:h or text:p -->
- <xsl:value-of select="not($isEmptyList)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="listIndent" select="$listIndent"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listRestart">
- <xsl:choose>
- <xsl:when test="$listRestart">
- <xsl:value-of select="$listRestart"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- descendants restart their list numbering, when an ancestor is not empty -->
- <xsl:value-of select="not($isEmptyList)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="minLabelDist">
- <xsl:choose>
- <xsl:when test="$listLevelStyle/*/@text:min-label-distance">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="$listLevelStyle/*/@text:min-label-distance"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="minLabelWidth">
- <xsl:choose>
- <xsl:when test="$listLevelStyle/*/@text:min-label-width">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="$listLevelStyle/*/@text:min-label-width"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:apply-templates>
- </xsl:element>
- </xsl:template>
-
- <!-- See comment before text:list template -->
- <xsl:template name="getListIndent">
- <xsl:param name="globalData"/>
- <xsl:param name="listLevelStyle"/>
- <!-- The first paragraph of the list item (heading is special paragraph in ODF) -->
- <xsl:param name="firstPara" />
-
- <!-- Styles of first paragraph in list item, including ancestor styles (inheritance) -->
- <xsl:variable name="firstParaStyles" select="$globalData/all-styles/style[@style:name = $firstPara/@text:style-name]/final-properties"/>
-
- <!-- Only the left margin of the first paragraph of a list item will be added to the margin of the complete list (all levels)-->
- <xsl:variable name="firstParaLeftMargin">
- <xsl:choose>
- <xsl:when test="contains($firstParaStyles, 'margin-left:')">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="normalize-space(substring-before(substring-after($firstParaStyles, 'margin-left:'), ';'))"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="spaceBefore">
- <xsl:choose>
- <xsl:when test="$listLevelStyle/*/@text:space-before">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="$listLevelStyle/*/@text:space-before"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>0</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Only if the left-margin of the first paragraph is positive the sum
- text:space-before and fo:left-margin is taken as list indent -->
- <xsl:choose>
- <xsl:when test="$firstParaLeftMargin &gt; 0">
- <xsl:value-of select="$firstParaLeftMargin + $spaceBefore"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$spaceBefore"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <!-- ****************** -->
- <!-- *** list item *** -->
- <!-- ****************** -->
+ <xsl:variable name="followingSiblingNode" select="following-sibling::node()[1]"/>
+
+
+ <!--
+ Every tabulator indents its following content, encapuslated in a span
+ element.
+
+ This template have two modes:
+
+ 1) Before the first tabulator it will match as usually paragraph content
+ to HTML.
+ 2) After the first paragraph it will always triggers two recursions.
+ One embraces the following content of a paragraph element into a span.
+ (tabContentHandling)
+ The other calls this template and will now ignore anything else than
+ TAB and LINE-BREAK.
+
+
+ The tabulators and linebreaks are being iterated, one by one to keep track of the tab number
+ -->
+
+
+ <xsl:choose>
+ <xsl:when test="name() = 'text:tab'">
+ <!-- every frame sibling have to be incapuslated within a div with left indent -->
+ <xsl:element name="span">
+ <xsl:choose>
+ <xsl:when test="count($tabStops/style:tab-stop) &gt; 0 and count($tabStops/style:tab-stop) &lt; 3">
+ <!-- only allow the heuristic when the style has less than 3 TABS -->
+ <!-- ignore heuristics if no TABS are defined -->
+ <xsl:attribute name="style">
+ <xsl:call-template name="createTabIndent">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="tabStops" select="$tabStops"/>
+ <xsl:with-param name="tabCount" select="$tabCount + 1"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ <xsl:with-param name="pageMarginLeft" select="$pageMarginLeft"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- if there are more than 3 TABS in the style, create a none-breakable-space as whitespace -->
+ <xsl:text>&#160;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="tabContentHandling">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="tabHandling">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="tabStops" select="$tabStops"/>
+ <xsl:with-param name="tabCount" select="$tabCount + 1"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ <xsl:with-param name="pageMarginLeft" select="$pageMarginLeft"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="name() = 'text:line-break'">
+ <!-- A line-break resets the tabCount to '0' -->
+ <br/>
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="tabHandling">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="tabStops" select="$tabStops"/>
+ <xsl:with-param name="tabCount" select="0"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ <xsl:with-param name="pageMarginLeft" select="$pageMarginLeft"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- only before the first tab all content is written out -->
+ <xsl:if test="$tabCount = 0">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="tabHandling">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="tabStops" select="$tabStops"/>
+ <xsl:with-param name="tabCount" select="$tabCount"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ <xsl:with-param name="pageMarginLeft" select="$pageMarginLeft"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ This recursion creates the content of a tab (i.e. following siblings
+ till next TAB or LINE BREAK) and ends with the next
+ TAB, LINE-BREAK or with the end of the paragraph.
+ -->
+ <xsl:template match="* | text()" mode="tabContentHandling">
+ <xsl:param name="globalData"/>
+
+ <xsl:if test="(name() != 'text:tab') and (name() != 'text:line-break')">
+ <!-- Write out content -->
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ <!-- Apply for the next node -->
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="tabContentHandling">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="createTabIndent">
+ <xsl:param name="globalData"/>
+ <xsl:param name="tabStops"/>
+ <xsl:param name="tabCount"/>
+ <xsl:param name="parentMarginLeft" />
+ <xsl:param name="pageMarginLeft" />
+
+ <xsl:text>position:absolute;left:</xsl:text>
+ <xsl:variable name="tabPosition">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="$tabStops/style:tab-stop[$tabCount]/@style:position"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="tabIndent">
+ <xsl:choose>
+ <xsl:when test="$tabStops/style:tab-stop[$tabCount]/@style:type = 'center'">
+ <!-- in case of style:type 'center' the text is even before the tab stop,
+ centered around the beginning. As I see currently no way in mapping this,
+ therefore I do some HEURISTIC (minus -2.5cm) -->
+ <xsl:value-of select="$tabPosition + $parentMarginLeft + $pageMarginLeft - 2.5"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$tabPosition + $parentMarginLeft + $pageMarginLeft"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!--<xsl:message>TAB: tabCount=
+ <xsl:value-of select="$tabCount"/>, tabPosition=
+ <xsl:value-of select="$tabPosition"/>, tabIndent=
+ <xsl:value-of select="$tabIndent"/>
+ </xsl:message>-->
+ <xsl:choose>
+ <xsl:when test="$tabIndent='NaN'">
+ <xsl:variable name="tabPositionTmp">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="$tabStops/style:tab-stop[last()]/@style:position"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <!-- Heuristic: for every tab that is more than specified give a further 1 cm -->
+ <xsl:value-of select="$parentMarginLeft + $tabPositionTmp + count($tabStops/style:tab-stop) - $tabCount"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$tabIndent"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>cm;</xsl:text>
+ <xsl:apply-templates select="$tabStops/style:tab-stop[$tabCount]/@style:type"/>
+ </xsl:template>
+
+ <!-- OOo writes out empty paragraphs layouted behind an image,
+ those have to be neglected in HTML
+ This method checks if an empty paragraph is of that kind! -->
+ <xsl:template name="follows-empty-paragraphs-and-image">
+ <xsl:param name="precedingElement" />
+ <xsl:param name="elementToCheck" select="1"/>
+ <xsl:choose>
+ <!-- OOo writes out empty paragraphs layouted behind the image,
+ those have to be neglected in HTML
+ <xsl:when test="name() = 'text:p' and (normalize-space($childText) = '')"> -->
+ <!-- WorkAround: Test if the empty paragraph was added after an image, which OOO often does -->
+ <xsl:when test="(name($precedingElement) = 'text:p' and not($precedingElement/text()) and not($precedingElement/*))">
+ <xsl:call-template name="follows-empty-paragraphs-and-image">
+ <xsl:with-param name="precedingElement" select="preceding-sibling::*[$elementToCheck]"/>
+ <xsl:with-param name="elementToCheck" select="$elementToCheck +1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$precedingElement/draw:frame">yes</xsl:when>
+ <xsl:otherwise>no</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="create-paragraph">
+ <xsl:param name="globalData"/>
+ <!-- the footnote symbol is the prefix for a footnote in the footer -->
+ <xsl:param name="footnotePrefix"/>
+
+ <!-- xhtml:p may only contain inline elements.
+ If there is one frame beyond, div must be used! -->
+ <xsl:variable name="elementName">
+ <xsl:choose>
+ <xsl:when test="descendant::draw:frame[1] or descendant::text:p[1]">div</xsl:when>
+ <xsl:otherwise>p</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:element name="{$elementName}">
+ <xsl:choose>
+ <!-- in ODF borders of paragraphs will be merged by default. Merging means the adjactend paragraphs are building a unit,
+ where only the first and the last will have a border to the surrounding (top / bottom border)
+ <xsl:variable name="precedingParagraphStyle" select="preceding-sibling::*[1][name() = 'text:p']/@text:style-name"/>
+ <xsl:variable name="followingParagraphStyle" select="following-sibling::*[1][name() = 'text:p']/@text:style-name"/>
+ -->
+ <xsl:when test="$globalData/all-styles/style[@style:name = current()/@text:style-name]/@mergedBorders">
+ <xsl:variable name="precedingParagraphStyle" select="preceding-sibling::*[1][name() = 'text:p']/@text:style-name"/>
+ <xsl:variable name="followingParagraphStyle" select="following-sibling::*[1][name() = 'text:p']/@text:style-name"/>
+ <xsl:choose>
+ <xsl:when test="$precedingParagraphStyle or $followingParagraphStyle">
+ <xsl:variable name="isPrecedingBorderParagraph" select="$globalData/all-styles/style[@style:name = $precedingParagraphStyle]/@mergedBorders"/>
+ <xsl:variable name="isFollowingBorderParagraph" select="$globalData/all-styles/style[@style:name = $followingParagraphStyle]/@mergedBorders"/>
+ <xsl:choose>
+ <xsl:when test="not($isPrecedingBorderParagraph) and $isFollowingBorderParagraph">
+ <xsl:attribute name="class">
+ <xsl:value-of select="concat(translate(@text:style-name, '.,;: %()[]/\+', '_____________'), '_borderStart')"/>
+ </xsl:attribute>
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="$isPrecedingBorderParagraph and not($isFollowingBorderParagraph)">
+ <xsl:attribute name="class">
+ <xsl:value-of select="concat(translate(@text:style-name, '.,;: %()[]/\+', '_____________'), '_borderEnd')"/>
+ </xsl:attribute>
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="write-paragraph">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="write-paragraph">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="footnotePrefix" select="$footnotePrefix" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="write-paragraph">
+ <xsl:param name="globalData"/>
+ <!-- the footnote symbol is the prefix for a footnote in the footer -->
+ <xsl:param name="footnotePrefix" />
+
+ <!-- empty paragraph tags does not provoke an carridge return,
+ therefore an non breakable space (&nbsp) 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:with-param name="footnotePrefix" select="$footnotePrefix" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="apply-styles-and-content">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="footnotePrefix" select="$footnotePrefix" />
+ </xsl:call-template>
+ <xsl:text>&#160;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="style:tab-stop/@style:type">
+ <xsl:text>text-align:</xsl:text>
+ <xsl:choose>
+ <xsl:when test=". = 'left'">left</xsl:when>
+ <xsl:when test=". = 'right'">right</xsl:when>
+ <xsl:when test=". = 'center'">center</xsl:when>
+ <xsl:otherwise>justify</xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>;</xsl:text>
+ </xsl:template>
+
+ <!-- As soon a frame is within a paragraph (text:p) or page:frame, every child element is floating (CSS) and worked out in sequence.
+ Accumulating prior frame width and adding parent's left margin -->
+ <!-- Matching all elements and text beyond a paragraph/text:page which are sibling of a draw:frame -->
+ <xsl:template match="* | text()" mode="frameFloating">
+ <xsl:param name="globalData"/>
+ <xsl:param name="previousFrameWidths" select="0"/>
+ <xsl:param name="previousFrameHeights" select="0" />
+ <!-- it becomes true for siblings after a draw:frame -->
+ <xsl:param name="createDiv" select="false()"/>
+ <xsl:param name="noDivBefore" select="true()"/>
+ <xsl:param name="leftPosition" />
+ <xsl:param name="parentMarginLeft" />
+ <xsl:param name="frameAlignedToParagraphWithSvgY" />
+
+ <xsl:choose>
+ <xsl:when test="name() = 'draw:frame'">
+ <xsl:copy-of select="$frameAlignedToParagraphWithSvgY"/>
+
+ <!-- if the first node is a draw:frame create a div -->
+ <xsl:call-template name="createDrawFrame">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
+ <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ </xsl:call-template>
+ <!-- next elements will be called after the creation with the new indent (plus width of frame) -->
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="nextSiblingIsFrame" select="name(following-sibling::node()[1]) = 'draw:frame'"/>
+ <xsl:choose>
+ <xsl:when test="$createDiv and normalize-space(.) != ''">
+ <!-- every following frame sibling till the next draw:frame
+ have to be incapuslated within a div with left indent.
+ To be moved altogether according the indent (usually right) -->
+ <xsl:comment>Next 'div' added for floating.</xsl:comment>
+ <xsl:element name="div">
+ <xsl:attribute name="style">
+ <xsl:text>position:relative; left:</xsl:text>
+ <xsl:value-of select="$leftPosition"/>
+ <xsl:text>cm;</xsl:text>
+ </xsl:attribute>
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ <!-- if it is a frame sibling it will be NOT incapuslated within the div (as already within one) -->
+ <xsl:if test="not($nextSiblingIsFrame)">
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
+ <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="createDiv" select="false()"/>
+ <xsl:with-param name="noDivBefore" select="$noDivBefore"/>
+ <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:element>
+ <xsl:copy-of select="$frameAlignedToParagraphWithSvgY"/>
+
+ <!-- Other draw:frame will be created outside of the div element -->
+ <xsl:apply-templates select="following-sibling::draw:frame[1]" mode="frameFloating">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
+ <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:when test="not($createDiv)">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
+ </xsl:apply-templates>
+ <xsl:if test="not($nextSiblingIsFrame) or $noDivBefore">
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
+ <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="createDiv" select="false()"/>
+ <xsl:with-param name="noDivBefore" select="$noDivBefore"/>
+ <xsl:with-param name="frameAlignedToParagraphWithSvgY" select="$frameAlignedToParagraphWithSvgY"/>
+ </xsl:apply-templates>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- A XML node other than text or element (e.g. comment) should not stop the recursion -->
+ <xsl:template match="comment()" mode="frameFloating">
+ <xsl:param name="globalData"/>
+ <xsl:param name="previousFrameWidths" select="0"/>
+ <xsl:param name="previousFrameHeights" select="0" />
+ <!-- it becomes true for siblings after a draw:frame -->
+ <xsl:param name="createDiv" select="false()"/>
+ <xsl:param name="noDivBefore" select="true()"/>
+ <xsl:param name="leftPosition" />
+ <xsl:param name="parentMarginLeft" />
+ <xsl:param name="frameAlignedToParagraphWithSvgY" />
+
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeft"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="createDiv" select="$createDiv"/>
+ <xsl:with-param name="noDivBefore" select="$noDivBefore"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+
+
+ <!-- As draw:frame may occur within more elements than in text:p and draw:page -->
+ <xsl:template match="draw:frame">
+ <xsl:param name="globalData"/>
+ <xsl:param name="previousFrameWidths" select="0"/>
+ <xsl:param name="previousFrameHeights" select="0" />
+
+ <xsl:call-template name="createDrawFrame">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths"/>
+ <xsl:with-param name="previousFrameHeights" select="$previousFrameHeights"/>
+ </xsl:call-template>
+ <!-- after the last draw:frame sibling the CSS float is disabled -->
+ <xsl:if test="@text:anchor-type!='as-char'">
+ <div style="clear:both; line-height:0; width:0; height:0; margin:0; padding:0;">&#160;</div>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="getPageMarginLeft">
+ <!-- approximation to find the correct master page style (with page dimensions) -->
+ <xsl:variable name="masterPageNames">
+ <!-- Loop over every style:style containing a @style:master-page-name attribute -->
+ <xsl:for-each select="key('masterPage','count')">
+ <!-- Check if this style is being used in the body -->
+ <xsl:if test="key('elementUsingStyle', ../@style:name)">
+ <!-- Check every master-page-name if it is not empty and return as ';' separated list -->
+ <xsl:if test="string-length(../@style:master-page-name) &gt; 0">
+ <xsl:value-of select="../@style:master-page-name"/>;
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name -->
+ <xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/>
+ <!-- Find the according style:page-layout and store the properties in a variable -->
+ <xsl:variable name="pageMarginLeftAttr" select="key('pageLayoutElements', $pageLayoutName)/style:page-layout-properties/@fo:margin-left"/>
+ <xsl:choose>
+ <xsl:when test="$pageMarginLeftAttr">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="$pageMarginLeftAttr"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Elements and text aside of a draw:frame are floating, here a div is being created.
+ Either for a draw:frame or for text and other elements floating aside -->
+ <xsl:template name="createDrawFrame">
+ <xsl:param name="globalData"/>
+ <xsl:param name="previousFrameWidths" select="0"/>
+ <xsl:param name="previousFrameHeights" select="0" />
+ <xsl:param name="parentMarginLeft"/>
+
+ <xsl:variable name="parentMarginLeftNew">
+ <xsl:choose>
+ <xsl:when test="string-length(normalize-space($parentMarginLeft)) &lt; 1">
+ <!-- Styles of first paragraph in list item, including ancestor styles (inheritance) -->
+ <xsl:variable name="paragraphName" select="parent::*/@text:style-name" />
+ <xsl:variable name="imageParagraphStyle" select="$globalData/all-styles/style[@style:name = $paragraphName]/final-properties"/>
+ <!-- Only the left margin of the first paragraph of a list item will be added to the margin of the complete list (all levels)-->
+ <xsl:choose>
+ <xsl:when test="contains($imageParagraphStyle, 'margin-left:')">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="normalize-space(substring-before(substring-after($imageParagraphStyle, 'margin-left:'), ';'))"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$parentMarginLeft"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="svgWidth">
+ <xsl:choose>
+ <xsl:when test="@svg:width">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="@svg:width"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="svgX">
+ <xsl:choose>
+ <xsl:when test="@svg:x">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="@svg:x"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="leftPosition" select="$svgX - $parentMarginLeftNew - $previousFrameWidths"/>
+ <xsl:variable name="svgY">
+ <xsl:choose>
+ <xsl:when test="@svg:y">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="@svg:y"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- if the frame is anchored on a paragraph -->
+ <xsl:if test="@text:anchor-type='paragraph'">
+ <xsl:comment>Next 'div' is emulating the top hight of a draw:frame.</xsl:comment>
+ <!-- When the svg:y is set relative to the paragraph content, the best way to emulate a positive height,
+ is to add an invisbile division inbetween with a height.
+ Often text will flow into this 'gap', which is handled separately!
+ -->
+ <xsl:if test="$svgY &gt; 0">
+ <xsl:element name="div">
+ <xsl:attribute name="style">
+ <xsl:text>height:</xsl:text>
+ <xsl:value-of select="$svgY"/>
+ <xsl:text>cm;</xsl:text>
+ </xsl:attribute>
+ <xsl:text>&#160;</xsl:text>
+ </xsl:element>
+ </xsl:if>
+ </xsl:if>
+
+
+ <!--
+ <xsl:variable name="followingSibling" select="following-sibling::node()[1]"/>
+ <xsl:choose>
+ HEURISTIC: if the frame is anchored on a paragraph and the above gab is big enough to hold a text line,
+ move it behind the text
+ <xsl:when test="@text:anchor-type='paragraph' and
+ (
+ ($svgY &gt; 0.5) or
+ ($svgX &gt; 4)
+ ) and normalize-space($followingSibling) != ''">
+ <xsl:apply-templates select="$followingSibling" mode="frameFloating">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeftNew"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="createDiv" select="true()"/>
+ <xsl:with-param name="noDivBefore" select="false()"/>
+ <xsl:with-param name="frameAlignedToParagraphWithSvgY">
+ <xsl:call-template name="createDrawFrame2">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
+ <xsl:with-param name="parentMarginLeftNew" select="$parentMarginLeftNew"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="svgY" select="$svgY"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>-->
+ <xsl:call-template name="createDrawFrame2">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
+ <xsl:with-param name="parentMarginLeftNew" select="$parentMarginLeftNew"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="svgY" select="$svgY"/>
+ </xsl:call-template>
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="frameFloating">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="previousFrameWidths" select="$previousFrameWidths + $svgWidth"/>
+ <xsl:with-param name="parentMarginLeft" select="$parentMarginLeftNew"/>
+ <xsl:with-param name="leftPosition" select="$leftPosition"/>
+ <xsl:with-param name="createDiv" select="true()"/>
+ <xsl:with-param name="noDivBefore" select="false()"/>
+ </xsl:apply-templates>
+ <!--
+
+ </xsl:otherwise>
+ </xsl:choose> -->
+ </xsl:template>
+
+ <xsl:template name="createDrawFrame2">
+ <xsl:param name="globalData"/>
+ <xsl:param name="previousFrameWidths" />
+ <xsl:param name="parentMarginLeftNew"/>
+ <xsl:param name="leftPosition" />
+ <xsl:param name="svgY" />
+
+ <xsl:variable name="elem-name">
+ <xsl:choose>
+ <xsl:when test="@text:anchor-type='as-char'">span</xsl:when>
+ <xsl:otherwise>div</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:comment>Next '
+ <xsl:value-of select="$elem-name"/>' is a draw:frame.
+ </xsl:comment>
+ <xsl:element name="{$elem-name}">
+ <xsl:choose>
+ <xsl:when test="draw:object/math:math">
+ <!-- draw:frame elements contain many data that are not
+ relevant for mathematical formulas and that may
+ cause incorrect rendering. Let's ignore the
+ replacement image and keep only the id attribute.
+ See fdo#66645 -->
+ <xsl:apply-templates select="@draw:name"/>
+ <xsl:text> </xsl:text>
+ <xsl:apply-templates select="draw:object[1]"/>
+ <!-- TODO: do not always add a space after the formula,
+ for example when it is followed by a comma, period,
+ dash etc This will probably require using regexp
+ features like xsl:analyze-string -->
+ <xsl:text> </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="style">
+ <xsl:call-template name="widthAndHeight"/>
+ <xsl:text> padding:0; </xsl:text>
+ <xsl:if test="@text:anchor-type!='as-char'">
+ <!-- all images float (CSS float reltaive) with a left position calculated by svg:x - parentMarginLeft - previousFrameWidths -->
+ <xsl:text> float:left; position:relative; left:</xsl:text>
+ <xsl:value-of select="$leftPosition"/>
+ <xsl:text>cm; </xsl:text>
+ <!-- if the frame is anchored on a char -->
+ <xsl:if test="@text:anchor-type='char'">
+ <xsl:text>top:</xsl:text>
+ <xsl:value-of select="$svgY"/>
+ <xsl:text>cm; </xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:apply-templates select="@*">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="node()">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="svg:desc"/>
+
+ <xsl:template name="widthAndHeight">
+ <xsl:if test="@svg:height | @svg:width">
+ <xsl:choose>
+ <xsl:when test="not(@svg:width)">
+ <xsl:call-template name="svg:height"/>
+ </xsl:when>
+ <xsl:when test="not(@svg:height)">
+ <xsl:call-template name="svg:width"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="svg:height"/>
+ <xsl:call-template name="svg:width"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- ***************** -->
+ <!-- *** Text Span *** -->
+ <!-- ***************** -->
+
+ <xsl:template match="text:span">
+ <xsl:param name="globalData"/>
+
+ <xsl:choose>
+ <xsl:when test="draw:frame">
+ <!-- sometimes an ODF image is anchored as character and the
+ image frame appears within a span (which is not valid for HTML)
+ Heuristic: Neglecting the span assuming no text content aside
+ of frame within span -->
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:element name="span">
+ <xsl:call-template name="apply-styles-and-content">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+
+ <!-- **************** -->
+ <!-- *** Headings *** -->
+ <!-- **************** -->
+
+ <xsl:template match="text:h">
+ <xsl:param name="globalData"/>
+
+ <!-- no creation of empty headings (without text content) -->
+ <xsl:if test="text() or descendant::text()">
+ <!-- The URL linking of an table-of-content is due to a bug (cp. bug id# 102311) not mapped as URL in the XML.
+ Linking of the table-of-content can therefore only be archieved by a work-around in HTML -->
+ <xsl:call-template name="create-heading">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <!-- default matching for header elements -->
+ <xsl:template name="create-heading">
+ <xsl:param name="globalData"/>
+
+ <xsl:variable name="headingLevel">
+ <xsl:choose>
+ <xsl:when test="@text:outline-level &lt; 6">
+ <xsl:value-of select="@text:outline-level"/>
+ </xsl:when>
+ <xsl:otherwise>6</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="headertyp" select="concat('h', $headingLevel)"/>
+ <xsl:element name="{$headertyp}">
+ <!-- outline style 'text:min-label-width' is interpreted as a CSS 'margin-right' attribute
+ NOTE: Should be handled as CSS style in style header -->
+ <xsl:variable name="min-label" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/*/@text:min-label-width"/>
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate(@text:style-name, '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+
+ <xsl:call-template name="create-heading-anchor">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:element>
+
+ </xsl:template>
+
+ <xsl:template name="create-heading-anchor">
+ <xsl:param name="globalData"/>
+
+ <!-- writing out a heading number if desired.-->
+ <!-- if a corresponding 'text:outline-style' exist or is not empty -->
+ <xsl:choose>
+ <xsl:when test="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@style:num-format != '' and not(@text:is-list-header='true')">
+
+ <!-- Every heading element will get an unique anchor for its file, from its hiearchy level and name:
+ For example: The heading title 'My favorite heading' might get <a name="1_2_2_My_favorite_heading" /> -->
+ <!-- creating an anchor for referencing the heading (e.g. from content table) -->
+ <xsl:variable name="headingNumber">
+ <xsl:call-template name="get-heading-number">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="create-heading-anchor2">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="headingNumber" select="$headingNumber"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="create-heading-anchor2">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <xsl:template name="get-heading-number">
+ <xsl:param name="globalData"/>
+
+ <!-- write number prefix -->
+ <xsl:value-of select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@style:num-prefix"/>
+ <xsl:call-template name="write-heading-number">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ <!-- write number suffix -->
+ <xsl:value-of select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@style:num-suffix"/>
+ </xsl:template>
+
+ <!-- creating an anchor for referencing the heading -->
+ <xsl:template name="create-heading-anchor2">
+ <xsl:param name="globalData"/>
+ <xsl:param name="headingNumber" />
+
+ <xsl:variable name="title">
+ <xsl:apply-templates mode="concatenate"/>
+ </xsl:variable>
+ <!-- REFERENCE HANDLING - ANCHOR -->
+ <xsl:element namespace="{$namespace}" name="a">
+ <xsl:attribute name="id">
+ <xsl:value-of select="translate(concat('a_',normalize-space($headingNumber), '_', normalize-space($title)), '&#xA;&amp;&lt;&gt;–.,;: %()[]/\+', '____________________________')" disable-output-escaping="yes"/>
+ </xsl:attribute>
+
+ <xsl:element name="span">
+ <!-- Convert the "label-followed-by" to margins. According to ODF, possible values are: 'listtab', 'space', and 'nothing'.
+ 'space' seems not to be written out by LO, and for 'nothing' we obviously need do nothing.
+ NOTE: Should be handled as CSS style in style header -->
+ <xsl:variable name="currentOutlineLevel" select="@text:outline-level"/>
+ <xsl:variable name="labelFollowedBy" select="$globalData//office:document/office:styles/text:outline-style/text:outline-level-style[@text:level = $currentOutlineLevel]/style:list-level-properties[@text:list-level-position-and-space-mode='label-alignment']/style:list-level-label-alignment/@text:label-followed-by"/>
+
+ <!-- Add some margin, but only if there is a number preceding the heading. -->
+ <xsl:if test="$labelFollowedBy='listtab' and $headingNumber != ''">
+ <xsl:attribute name="class">
+ <xsl:text>heading_numbering</xsl:text>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="$headingNumber"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="write-heading-number">
+ <xsl:param name="globalData"/>
+
+ <!-- By default heading start with '1', the parameter 'textStartValue' will only be set, if the attribute @text:start-value exist -->
+ <xsl:choose>
+ <xsl:when test="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@text:start-value">
+ <xsl:call-template name="calc-heading-number">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="outlineLevel" select="@text:outline-level"/>
+ <xsl:with-param name="textStartValue" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = current()/@text:outline-level]/@text:start-value"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="calc-heading-number">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="outlineLevel" select="@text:outline-level"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ Find the correct heading no., which is the sum of 'text:start-value'
+ and preceding siblings of 'text:h' with the same 'text:outline-level' (until a text:outline-level with lower value is found).
+ If the 'text:start-value is not set the default value of '1' has to be taken.
+ If a heading number is found (e.g. text:outline-level='3') all heading numbers
+ for the higher levels have to be written out -->
+ <xsl:template name="calc-heading-number">
+ <xsl:param name="globalData"/>
+ <xsl:param name="outlineLevel"/><!-- text level of the heading -->
+ <xsl:param name="iOutlineLevel" select="1"/><!-- iterator, counts from 1 to the text level of the heading -->
+ <xsl:param name="textStartValue" select="1"/><!-- text level to start with, default is '1' -->
+
+ <xsl:choose>
+ <!-- iText levels counts up from '1' to outlineLevel
+ Which means writing a heading number from left to right -->
+ <xsl:when test="$iOutlineLevel &lt; $outlineLevel">
+
+ <!-- Write preceding heading numbers -->
+ <xsl:if test="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = ($iOutlineLevel)]/@style:num-format != ''">
+ <xsl:call-template name="writeNumber">
+ <xsl:with-param name="numberDigit">
+ <xsl:call-template name="calc-heading-digit">
+ <xsl:with-param name="value" select="0"/>
+ <xsl:with-param name="currentoutlineLevel" select="$iOutlineLevel"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="numberFormat" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = ($iOutlineLevel)]/@style:num-format"/>
+ </xsl:call-template>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = ($iOutlineLevel + 1)]/@text:start-value">
+ <xsl:call-template name="calc-heading-number">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="outlineLevel" select="$outlineLevel"/>
+ <xsl:with-param name="iOutlineLevel" select="$iOutlineLevel + 1"/>
+ <xsl:with-param name="textStartValue" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = ($iOutlineLevel + 1)]/@text:start-value"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="calc-heading-number">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="outlineLevel" select="$outlineLevel"/>
+ <xsl:with-param name="iOutlineLevel" select="$iOutlineLevel + 1"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Write preceding heading numbers -->
+ <xsl:call-template name="writeNumber">
+ <xsl:with-param name="numberDigit">
+ <xsl:call-template name="calc-heading-digit">
+ <xsl:with-param name="value" select="$textStartValue"/>
+ <xsl:with-param name="currentoutlineLevel" select="$iOutlineLevel"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ <xsl:with-param name="numberFormat" select="$globalData/office:styles/text:outline-style/text:outline-level-style[@text:level = $iOutlineLevel]/@style:num-format"/>
+ <xsl:with-param name="last" select="true()"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="writeNumber">
+ <xsl:param name="numberDigit"/>
+ <xsl:param name="numberFormat"/>
+ <xsl:param name="last"/>
+
+ <xsl:choose>
+ <xsl:when test="not($numberFormat)">
+ <xsl:number value="$numberDigit" format="1."/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$last">
+ <xsl:number value="$numberDigit" format="{$numberFormat}"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:number value="$numberDigit" format="{$numberFormat}."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="calc-heading-digit">
+ <xsl:param name="value"/>
+ <xsl:param name="currentoutlineLevel"/>
+ <xsl:param name="i" select="1"/>
+
+ <xsl:variable name="precedingoutlineLevel" select="preceding-sibling::text:h[$i]/@text:outline-level"/>
+ <!-- tdf#107696: if text:h has attribute "is-list-header" with "true" value, it mustn't be counted for numbering -->
+ <xsl:variable name="precedingoutlineLevel-is-list-header" select="preceding-sibling::text:h[$i][@text:is-list-header='true']/@text:outline-level"/>
+ <xsl:choose>
+ <xsl:when test="($currentoutlineLevel = $precedingoutlineLevel) and (not($precedingoutlineLevel-is-list-header)) ">
+ <xsl:call-template name="calc-heading-digit">
+ <xsl:with-param name="value" select="$value + 1"/>
+ <xsl:with-param name="currentoutlineLevel" select="$currentoutlineLevel"/>
+ <xsl:with-param name="i" select="$i + 1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <!-- tdf#107696: case text:h has attribute "is-list-header" with "true" value, we don't increment value -->
+ <xsl:when test="($currentoutlineLevel = $precedingoutlineLevel) and ($precedingoutlineLevel-is-list-header) ">
+ <xsl:call-template name="calc-heading-digit">
+ <xsl:with-param name="value" select="$value"/>
+ <xsl:with-param name="currentoutlineLevel" select="$currentoutlineLevel"/>
+ <xsl:with-param name="i" select="$i + 1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="$currentoutlineLevel &lt; $precedingoutlineLevel">
+ <xsl:call-template name="calc-heading-digit">
+ <xsl:with-param name="value" select="$value"/>
+ <xsl:with-param name="currentoutlineLevel" select="$currentoutlineLevel"/>
+ <xsl:with-param name="i" select="$i + 1"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- Neglect Annotations -->
+ <xsl:template match="office:annotation" mode="concatenate"/>
+
+ <!-- Match text:placeholder child nodes (e.g. text) -->
+ <xsl:template match="text:placeholder">
+ <xsl:param name="globalData"/>
+
+ <xsl:call-template name="apply-styles-and-content">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- ************* -->
+ <!-- *** Link *** -->
+ <!-- ************* -->
+
+ <xsl:template match="text:a | draw:a">
+ <xsl:param name="globalData"/>
+
+ <xsl:call-template name="create-common-anchor-link">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:template>
+
+
+ <xsl:template name="create-common-anchor-link">
+ <xsl:param name="globalData"/>
+
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:call-template name="create-href">
+ <xsl:with-param name="href" select="@xlink:href"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ <xsl:call-template name="apply-styles-and-content">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+
+
+
+ <!-- ******************* -->
+ <!-- *** Image Link *** -->
+ <!-- ******************* -->
+
+ <!-- currently suggesting that all draw:object-ole elements are images -->
+ <xsl:template match="draw:image | draw:object-ole">
+ <xsl:param name="globalData"/>
+
+ <xsl:choose>
+ <xsl:when test="ancestor::text:p or parent::text:span or parent::text:h or parent::draw:a or parent::text:a or text:ruby-base">
+ <!-- XHTML does not allow the mapped elements to contain paragraphs -->
+ <xsl:call-template name="create-image-element">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- images are embedded in a paragraph, but are in CSS not able to express a horizontal alignment for themself.
+ A 'div' element taking over the image style would solve that problem, but is invalid as child of a paragraph -->
+ <xsl:element name="p">
+ <xsl:apply-templates select="@draw:style-name">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+
+ <xsl:call-template name="create-image-element">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="create-image-element">
+ <xsl:param name="globalData"/>
+
+ <xsl:element name="img">
+ <xsl:if test="../@svg:width or ../@svg:height">
+ <xsl:attribute name="style">
+ <xsl:if test="../@svg:height">
+ <xsl:text>height:</xsl:text>
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="../@svg:height"/>
+ </xsl:call-template>
+ <xsl:text>cm;</xsl:text>
+ </xsl:if>
+ <xsl:if test="../@svg:width">
+ <xsl:text>width:</xsl:text>
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="../@svg:width"/>
+ </xsl:call-template>
+ <xsl:text>cm;</xsl:text>
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="alt">
+ <xsl:choose>
+ <xsl:when test="../svg:title">
+ <xsl:value-of select="../svg:title"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message>
+ Accessibility Warning:
+ No alternate text ('svg:title' element) set for
+ image '
+ <xsl:value-of select="@xlink:href"/>'!
+ </xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+
+ <xsl:attribute name="src">
+ <xsl:call-template name="create-href">
+ <xsl:with-param name="href" select="@xlink:href"/>
+ <xsl:with-param name="mimetype" select="@loext:mime-type"/>
+ </xsl:call-template>
+ </xsl:attribute>
+
+ <!-- style interpretation only, as no subelements are allowed for img in XHTML -->
+ <xsl:apply-templates select="@draw:style-name">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- ************ -->
+ <!-- *** list *** -->
+ <!-- ************ -->
+ <!--
+ Due to the requirements below the ODF list functionality is not handled by CSS, but the list labels calculated and written by XSLT.
+
+ REQUIREMENTS:
+ =============
+
+ A)
+ One significant difference between XHTML and Office List elements is that a list without text nodes but only further list children
+ would not show a list symbol in the Office, but in the browser from XHTML.
+
+ B)
+ Since OASIS Open Document XML (implemented in OOo2.0) only one parent type exists for list items
+ the 'text:list' element. The XHTML element 'ol', 'ul' will be chosen upon the list style type.
+
+ C)
+ An Office list may be spread over the whole document. Linked by their style and text:continue-numbering='true'.
+
+ D)
+ An Office list can use characters or images as list label.
+
+ E)
+ An Office list can have a prefix and suffix around the list label.
+
+ F)
+ An Office list style may have the attribute consecutive numbering, which resolves in a list counting for all levels
+
+ G)
+ An Office list may (re)start on any arbitrary value by using @text:start-value on the text:list-item
+
+ INDENTATION:
+ ============
+
+ The indent of a list label is not only calculated by using the text:space-before of the list level (listLevelStyle), but
+ as well taking the left margin of the first paragraph (or heading) of the list into account as loy match="" name="" use=""/>ng it is not negative.
+
+ | MARGIN LEFT | LABEL |
+
+ | text:space-before (listlevelstyle) | text:min-label-width |
+ | + fo:left-margin (firstParagraph) | |
+
+ Further details beyond text:list-list..
+ -->
+ <xsl:key name="listStyles" match=" /*/office:styles/text:list-style | /*/office:automatic-styles/text:list-style | /*/office:styles/style:graphic-properties/text:list-style | /*/office:automatic-styles/style:graphic-properties/text:list-style | /*/office:styles/text:list-style | /*/office:automatic-styles/text:list-style | /*/office:styles/style:graphic-properties/text:list-style | /*/office:automatic-styles/style:graphic-properties/text:list-style" use="@style:name"/>
+
+ <!--
+ A text list may only have text:list-item and text:list-header as children.
+ -->
+ <xsl:template match="text:list">
+ <xsl:param name="globalData"/>
+ <xsl:param name="isListNumberingReset"/>
+ <xsl:param name="isNextLevelNumberingReset"/>
+ <xsl:param name="listLevel" select="1"/>
+ <xsl:param name="listRestart" select="false()"/>
+ <xsl:param name="itemLabel" select="''"/>
+ <xsl:param name="listStyle"/>
+ <xsl:param name="listStyleName" select="@text:style-name"/>
+
+ <!-- To choose list type - get the list style, with the same 'text:style-name' and same 'text:level' >-->
+ <xsl:variable name="listStyleRTF">
+ <xsl:variable name="listStyleInContentFile" select="key('listStyles', $listStyleName)"/>
+ <xsl:choose>
+ <xsl:when test="$listStyleInContentFile">
+ <xsl:copy-of select="$listStyleInContentFile"/>
+ </xsl:when>
+ <xsl:when test="$globalData/office:styles/text:list-style[@style:name = $listStyleName]">
+ <xsl:copy-of select="$globalData/office:styles/text:list-style[@style:name = $listStyleName]"/>
+ </xsl:when>
+ <xsl:when test="$globalData/office:styles/style:graphic-properties/text:list-style[@style:name = $listStyleName]">
+ <xsl:copy-of select="$globalData/office:styles/style:graphic-properties/text:list-style[@style:name = $listStyleName]"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:choose>
+ <xsl:when test="function-available('common:node-set')">
+ <xsl:call-template name="create-list-type">
+ <xsl:with-param name="listStyle" select="common:node-set($listStyleRTF)" />
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listRestart" select="$listRestart"/>
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xalan:nodeset')">
+ <xsl:call-template name="create-list-type">
+ <xsl:with-param name="listStyle" select="xalan:nodeset($listStyleRTF)" />
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listRestart" select="$listRestart"/>
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:when test="function-available('xt:node-set')">
+ <xsl:call-template name="create-list-type">
+ <xsl:with-param name="listStyle" select="xt:node-set($listStyleRTF)" />
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listRestart" select="$listRestart"/>
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">The required node-set function was not found!</xsl:message>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="create-list-type">
+ <xsl:param name="globalData"/>
+ <xsl:param name="isListNumberingReset"/>
+ <xsl:param name="isNextLevelNumberingReset"/>
+ <xsl:param name="listLevel" />
+ <xsl:param name="listRestart" />
+ <xsl:param name="itemLabel"/>
+ <xsl:param name="listStyle"/>
+ <xsl:param name="listStyleName" />
+
+ <!-- $globalData/styles-file/*/office:styles/ -->
+ <xsl:variable name="listLevelStyle" select="$listStyle/*/*[@text:level = number($listLevel)]"/>
+ <xsl:variable name="listIndent">
+ <xsl:call-template name="getListIndent">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="firstPara" select="*[1]/*[name() = 'text:p' or name() = 'text:h'][1]"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:variable name="isEmptyList" select="not(*[1]/*[name() = 'text:h' or name() = 'text:p' or name() = 'text:name'])"/>
+ <xsl:variable name="listType">
+ <xsl:choose>
+ <!-- ordered list -->
+ <xsl:when test="name($listLevelStyle) = 'text:list-level-style-number'">
+ <xsl:text>ol</xsl:text>
+ </xsl:when>
+ <!-- unordered list (bullet or image) -->
+ <xsl:otherwise>
+ <xsl:text>ul</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:element name="{$listType}">
+ <xsl:apply-templates select="*[1]" mode="listItemSibling">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
+ <xsl:with-param name="isListNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset">
+ <xsl:choose>
+ <xsl:when test="$isListNumberingReset">
+ <xsl:value-of select="true()"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- A list is empty if a text:list does not have a text:list-header or text:list-item (wildcard as only those can exist beyond a text:list), which contains a text:h or text:p -->
+ <xsl:value-of select="not($isEmptyList)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="listIndent" select="$listIndent"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listRestart">
+ <xsl:choose>
+ <xsl:when test="$listRestart">
+ <xsl:value-of select="$listRestart"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- descendants restart their list numbering, when an ancestor is not empty -->
+ <xsl:value-of select="not($isEmptyList)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="minLabelDist">
+ <xsl:choose>
+ <xsl:when test="$listLevelStyle/*/@text:min-label-distance">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="$listLevelStyle/*/@text:min-label-distance"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="minLabelWidth">
+ <xsl:choose>
+ <xsl:when test="$listLevelStyle/*/@text:min-label-width">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="$listLevelStyle/*/@text:min-label-width"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ </xsl:element>
+ </xsl:template>
+
+ <!-- See comment before text:list template -->
+ <xsl:template name="getListIndent">
+ <xsl:param name="globalData"/>
+ <xsl:param name="listLevelStyle"/>
+ <!-- The first paragraph of the list item (heading is special paragraph in ODF) -->
+ <xsl:param name="firstPara" />
+
+ <!-- Styles of first paragraph in list item, including ancestor styles (inheritance) -->
+ <xsl:variable name="firstParaStyles" select="$globalData/all-styles/style[@style:name = $firstPara/@text:style-name]/final-properties"/>
+
+ <!-- Only the left margin of the first paragraph of a list item will be added to the margin of the complete list (all levels)-->
+ <xsl:variable name="firstParaLeftMargin">
+ <xsl:choose>
+ <xsl:when test="contains($firstParaStyles, 'margin-left:')">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="normalize-space(substring-before(substring-after($firstParaStyles, 'margin-left:'), ';'))"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="spaceBefore">
+ <xsl:choose>
+ <xsl:when test="$listLevelStyle/*/@text:space-before">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="$listLevelStyle/*/@text:space-before"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>0</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Only if the left-margin of the first paragraph is positive the sum
+ text:space-before and fo:left-margin is taken as list indent -->
+ <xsl:choose>
+ <xsl:when test="$firstParaLeftMargin &gt; 0">
+ <xsl:value-of select="$firstParaLeftMargin + $spaceBefore"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$spaceBefore"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!-- ****************** -->
+ <!-- *** list item *** -->
+ <!-- ****************** -->
<!--
- Left margin of the complete list:
- The space between left page and the list symbol (left-margin) is in the Office implemented by
- the sum of three values:
- 1) 'text:space-before', which is part of the 'text:list-style' element.
- 2) 'margin:left' from the style of the first child (e.g. paragraph).
- 3) 'fo:text-indent' the indent of the first line of some child (e.g. paragraph) (applied by CSS class style)
+ Left margin of the complete list:
+ The space between left page and the list symbol (left-margin) is in the Office implemented by
+ the sum of three values:
+ 1) 'text:space-before', which is part of the 'text:list-style' element.
+ 2) 'margin:left' from the style of the first child (e.g. paragraph).
+ 3) 'fo:text-indent' the indent of the first line of some child (e.g. paragraph) (applied by CSS class style)
- Possible list children:
- <!ELEMENT text:list-item (text:p|text:h|text:list)+>
+ Possible list children:
+ <!ELEMENT text:list-item (text:p|text:h|text:list)+>
- In the Office the list label before the text depends on two attributes:
- - 'text:min-label-width': the distance between list label and all text of the list item.
- - 'text:min-label-distance': the distance between list label and text of the first line,
- only used, when text does not fit in text:min-label-width (ignored)
+ In the Office the list label before the text depends on two attributes:
+ - 'text:min-label-width': the distance between list label and all text of the list item.
+ - 'text:min-label-distance': the distance between list label and text of the first line,
+ only used, when text does not fit in text:min-label-width (ignored)
-->
- <xsl:template match="text:list-item | text:list-header" mode="listItemSibling">
- <xsl:param name="globalData"/>
- <xsl:param name="firstitemLabelWidth"/>
- <xsl:param name="isEmptyList" select="not(*[name() = 'text:h' or name() = 'text:p' or name() = 'text:name'])"/>
- <xsl:param name="isListNumberingReset"/>
- <xsl:param name="isNextLevelNumberingReset"/>
- <xsl:param name="itemNumber"/>
- <xsl:param name="itemLabel"/>
- <xsl:param name="listLevel"/>
- <xsl:param name="listLevelStyle"/>
- <xsl:param name="listRestart"/>
- <xsl:param name="listStyle"/>
- <xsl:param name="listStyleName"/>
- <xsl:param name="minLabelDist"/>
- <xsl:param name="minLabelWidth"/>
- <xsl:param name="listIndent" />
-
- <!-- The text:list-header shall not be labeled. According to ODF specification (sect. 4.3.2):
- "The <text:list-header> element represents a list header and is a special kind of list item. It
- contains one or more paragraphs that are displayed before a list. The paragraphs are formatted
- like list items but they do not have a preceding number or bullet." -->
- <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
-
- <xsl:variable name="listIndentNew">
- <xsl:choose>
- <xsl:when test="$listIndent">
- <xsl:value-of select="$listIndent"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="getListIndent">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="firstPara" select="*[name() = 'text:p' or name() = 'text:h'][1]" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="itemNumberNew">
- <xsl:if test="$listStyle/text:list-style/text:list-level-style-number">
- <xsl:choose>
- <xsl:when test="$isListHeader">0</xsl:when>
- <xsl:when test="$isEmptyList">
- <!-- An empty list item (no text:h/text:p as child), will not count as item and does not increment the count. -->
- <xsl:variable name="tempItemNumber">
- <xsl:choose>
- <!-- siblings will be incremented by one -->
- <xsl:when test="$itemNumber">
- <xsl:if test="not($isListHeader)">
- <xsl:value-of select="$itemNumber + 1"/>
- </xsl:if>
- </xsl:when>
- <!-- if a higher list level had content the numbering starts with 1 -->
- <xsl:when test="$isListNumberingReset and $listLevel &gt; 1">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="getItemNumber">
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:choose>
- <!-- in case the empty list-item is the first list-item in document -->
- <xsl:when test="$tempItemNumber = 1">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$tempItemNumber - 1"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="@text:start-value">
- <xsl:value-of select="@text:start-value"/>
- </xsl:when>
- <!-- text:start-value from list level style will only be taken on the first list-item of a list -->
- <xsl:when test="$listLevelStyle/@text:start-value and count(preceding-sibling::text:list-item) = 0">
- <xsl:value-of select="$listLevelStyle/@text:start-value"/>
- </xsl:when>
- <!-- siblings will be incremented by one -->
- <xsl:when test="$itemNumber">
- <xsl:value-of select="$itemNumber + 1"/>
- </xsl:when>
- <!-- if a higher list level had content the numbering starts with 1 -->
- <xsl:when test="$isListNumberingReset and $listLevel &gt; 1">
- <xsl:value-of select="1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="getItemNumber">
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:variable>
- <xsl:variable name="itemLabelNew">
- <xsl:if test="$listStyle/text:list-style/text:list-level-style-number">
- <!--
- A numbered label (e.g. 2.C.III) is created for every text:list-item/header.
- Above list levels are listed in the label, if the list-style requires this. Levels are separated by a '.'
- Formatation is dependent for every list level depth.
- The label is passed from anchestor text:list-item/header and if requrired truncated.
- The prefix/suffix (as well list level dependent) comes before and after the complete label (after truncation)
- -->
- <!-- Numbered label will be generated -->
- <xsl:call-template name="createItemLabel">
- <xsl:with-param name="itemNumber" select="$itemNumberNew"/>
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="listLevelsToDisplay">
- <xsl:variable name="display" select="$listLevelStyle/@text:display-levels"/>
- <xsl:choose>
- <xsl:when test="$display">
- <xsl:value-of select="$display"/>
- </xsl:when>
- <xsl:when test="$isListHeader">0</xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- </xsl:call-template>
- </xsl:if>
- </xsl:variable>
- <xsl:element name="li">
- <xsl:choose>
- <xsl:when test="$isEmptyList or $isListHeader">
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="itemLabel" select="$itemLabelNew"/>
- <xsl:with-param name="listLevel" select="$listLevel + 1"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <!-- Possible following children are text:h, text:p, list:text, text:soft-page-break -->
- <xsl:apply-templates mode="list-item-children" select="*[1]">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isListHeader or $isNextLevelNumberingReset"/>
- <!-- The new created label is given to the children -->
- <xsl:with-param name="itemLabel" select="$itemLabelNew"/>
- <xsl:with-param name="listLabelElement">
- <xsl:choose>
- <xsl:when test="name() = 'text:list-header'"/>
- <xsl:otherwise>
- <xsl:variable name="listLabelWidth">
- <xsl:choose>
- <xsl:when test="$minLabelWidth &gt; $minLabelDist">
- <xsl:value-of select="$minLabelWidth"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$minLabelDist &gt; 0">
- <xsl:value-of select="$minLabelDist"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="listLevelLabelAlignment" select="$listLevelStyle/style:list-level-properties/style:list-level-label-alignment"/>
- <xsl:variable name="listLevelTextIndent">
- <xsl:call-template name="convert2cm">
- <xsl:with-param name="value" select="string($listLevelLabelAlignment/@fo:text-indent)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="-$listLevelTextIndent"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Numbering is being done by this transformation creating a HTML span representing the number label
- The html:span represents the list item/header label (e.g. 1.A.III)
- As the html:span is usually a inline element is formatted by CSS as block element to use width upon it,
- to disable the caridge return float:left is used and later neglected -->
- <xsl:element name="span">
- <xsl:if test="$listLevelStyle/@text:style-name">
- <xsl:attribute name="class">
- <xsl:value-of select="$listLevelStyle/@text:style-name"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style">
- <xsl:text>display:block;float:</xsl:text>
- <!-- 2DO: Svante - copy this functionality for other used margin:left (in western country 'left') -->
- <xsl:call-template name="getOppositeWritingDirection">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="paraStyleName" select="descendant-or-self::*/@text:style-name"/>
- </xsl:call-template>
- <xsl:text>;min-width:</xsl:text>
- <xsl:value-of select="$listLabelWidth"/>
- <xsl:text>cm;</xsl:text>
- </xsl:attribute>
- <xsl:variable name="labelContent">
- <xsl:choose>
- <xsl:when test="text:number">
- <xsl:apply-templates select="text:number" mode="listnumber"/>
- </xsl:when>
- <xsl:when test="name($listLevelStyle) = 'text:list-level-style-bullet'">
- <xsl:value-of select="$listLevelStyle/@style:num-prefix"/>
- <xsl:value-of select="$listLevelStyle/@text:bullet-char"/>
- <xsl:value-of select="$listLevelStyle/@style:num-suffix"/>
- </xsl:when>
- <xsl:when test="name($listLevelStyle) = 'text:list-level-style-number'">
- <xsl:value-of select="$listLevelStyle/@style:num-prefix"/>
- <xsl:value-of select="$itemLabelNew"/>
- <xsl:value-of select="$listLevelStyle/@style:num-suffix"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- Listing with image as bullets, taken from the list style's href -->
- <xsl:value-of select="$listLevelStyle/@xlink:href"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <!-- Some browsers have problem with stand-alone elements (e.g. <span/>)
- Therefore a comment is being inserted into an empty label -->
- <xsl:choose>
- <xsl:when test="$labelContent != ''">
- <xsl:value-of select="$labelContent"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:comment>&#160;</xsl:comment>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="listLabelEmptyElement">
- <xsl:variable name="listLabelWidth">
- <xsl:choose>
- <xsl:when test="$minLabelWidth &gt; $minLabelDist">
- <xsl:value-of select="$minLabelWidth"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$minLabelDist"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="span">
- <xsl:if test="$listLevelStyle/@text:style-name">
- <xsl:attribute name="class">
- <xsl:value-of select="$listLevelStyle/@text:style-name"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style">
- <xsl:text>display:block;float:</xsl:text>
- <xsl:call-template name="getOppositeWritingDirection">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="paraStyleName" select="descendant-or-self::*/@text:style-name"/>
- </xsl:call-template>
- <xsl:text>;min-width:</xsl:text>
- <xsl:value-of select="$listLabelWidth"/>
- <xsl:text>cm</xsl:text>
- </xsl:attribute>
- <xsl:comment>&#160;</xsl:comment>
- </xsl:element>
- </xsl:with-param>
- <xsl:with-param name="listLevel" select="$listLevel + 1"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listRestart" select="$listRestart"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="listIndent" select="$listIndentNew"/>
- <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
- <xsl:apply-templates select="following-sibling::*[1]" mode="listItemSibling">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="itemNumber" select="$itemNumberNew"/>
- <xsl:with-param name="listIndent">
- <xsl:choose>
- <xsl:when test="not($isEmptyList)">
- <xsl:value-of select="$listIndentNew"/>
- </xsl:when>
- </xsl:choose>
- </xsl:with-param>
- <!-- Receives the same parent label -->
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="minLabelDist" select="$minLabelDist"/>
- <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template name="getOppositeWritingDirection">
- <xsl:param name="globalData"/>
- <xsl:param name="paraStyleName"/>
-
- <xsl:variable name="imageParagraphStyle" select="$globalData/all-styles/style[@style:name = $paraStyleName]/final-properties"/>
-
- <xsl:choose>
- <xsl:when test="contains($imageParagraphStyle, 'writing-mode:')">
- <xsl:choose>
- <xsl:when test="contains(substring-before(substring-after($imageParagraphStyle, 'writing-mode:'), ';'), 'rl')">right</xsl:when>
- <xsl:otherwise>left</xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>left</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="text:number" mode="listnumber">
- <xsl:apply-templates/>
- </xsl:template>
-
- <xsl:template match="text:number" mode="list-item-children">
- <xsl:param name="globalData"/>
- <xsl:param name="listLabelElement"/>
- <xsl:param name="listLabelEmptyElement"/>
- <xsl:param name="isEmptyList"/>
- <xsl:param name="isListNumberingReset"/>
- <xsl:param name="isNextLevelNumberingReset"/>
- <xsl:param name="itemLabel"/>
- <xsl:param name="itemNumber"/>
- <xsl:param name="listIndent"/>
- <xsl:param name="listLevel"/>
- <xsl:param name="listLevelStyle" />
- <xsl:param name="listRestart"/>
- <xsl:param name="listStyle"/>
- <xsl:param name="listStyleName"/>
- <xsl:param name="minLabelWidth"/>
-
- <xsl:apply-templates mode="list-item-children" select="following-sibling::*[1]">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="listLabelElement" select="$listLabelElement"/>
- <xsl:with-param name="listLabelEmptyElement" select="$listLabelEmptyElement"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listRestart" select="$listRestart"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="listIndent" select="$listIndent"/>
- <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- Each key element holds the set of all text:list-item/text:list-header of a certain level and a certain style -->
- <xsl:key name="getListItemsByLevelAndStyle" use="concat(count(ancestor::text:list), ancestor::text:list/@text:style-name)" match="text:list-item | text:list-header"/>
- <!-- Each key element holds the set of all text:list-item/text:list-header of a certain style -->
- <xsl:key name="getListItemsByStyle" use="ancestor::text:list/@text:style-name" match="text:list-item | text:list-header"/>
-
-
- <!-- The Numbering start value (or offset from regular counteing) is used at the first item of offset,
- but have to be reused on following items with no text:start-value -->
- <xsl:template name="getItemNumber">
- <xsl:param name="listLevel"/>
- <xsl:param name="listLevelStyle"/>
- <xsl:param name="listStyleName"/>
- <xsl:param name="listStyle"/>
-
- <xsl:call-template name="countListItemTillStartValue">
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="preceding::text:list-item[generate-id(key('getListItemsByLevelAndStyle', concat($listLevel, $listStyleName))) = generate-id(key('getListItemsByLevelAndStyle', concat(count(ancestor::text:list), ancestor::text:list/@text:style-name)))]"/>
-
- <xsl:with-param name="precedingListItemsOfSameStyle" select="preceding::text:list-item[generate-id(key('getListItemsByStyle', $listStyleName)) = generate-id(key('getListItemsByStyle', ancestor::text:list/@text:style-name))]"/>
- </xsl:call-template>
- </xsl:template>
-
- <!-- When there is a text:start-value the last have to be found and added to the number -->
- <xsl:template name="countListItemTillStartValue">
- <xsl:param name="IteratorSameLevelAndStyle" select="1"/>
- <xsl:param name="IteratorSameStyle" select="1"/>
- <xsl:param name="itemNumber" select="1"/>
- <xsl:param name="listLevel"/>
- <xsl:param name="listLevelStyle"/>
- <xsl:param name="listStyle"/>
- <xsl:param name="listStyleName"/>
- <xsl:param name="precedingListItemsOfSameLevelAndStyle" />
- <xsl:param name="precedingListItemsOfSameLevelAndStyleCount" select="count($precedingListItemsOfSameLevelAndStyle)"/>
- <xsl:param name="precedingListItemsOfSameStyle" />
- <xsl:param name="precedingListItemsOfSameStyleCount" select="count($precedingListItemsOfSameStyle)"/>
- <!-- E.g.: If a list level 2 number is searched, a level 3 with content found with only a level 1 parent with content,
- the level 3 gets a 'pseudoLevel' -->
- <xsl:param name="pseudoLevel" select="0" />
-
- <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
- <xsl:variable name="isEmptyList" select="not(*[name() = 'text:h' or name() = 'text:p'])"/>
-
- <!-- set the next of preceding list items. Starting from the current to the next previous text:list-item -->
- <xsl:variable name="precedingListItemOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle[$precedingListItemsOfSameLevelAndStyleCount - $IteratorSameLevelAndStyle + 1]"/>
- <xsl:variable name="precedingListItemOfSameStyle" select="$precedingListItemsOfSameStyle[$precedingListItemsOfSameStyleCount - $IteratorSameStyle + 1]"/>
- <xsl:choose>
- <xsl:when test="($precedingListItemOfSameStyle and $precedingListItemOfSameLevelAndStyle) or ($precedingListItemOfSameStyle and $listStyle/text:list-style/@text:consecutive-numbering)">
- <xsl:for-each select="$precedingListItemOfSameStyle">
- <xsl:choose>
- <!-- if it is a higher list level element -->
- <xsl:when test="$listStyle/text:list-style/@text:consecutive-numbering">
-
- <xsl:call-template name="countListItem">
- <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle" />
- <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
- <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
- <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
- <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- NOT CONSECUTIVE NUMBERING -->
- <xsl:variable name="currentListLevel" select="count(ancestor::text:list)"/>
- <xsl:choose>
- <!-- IF IT IS A HIGHER LIST LEVEL ELEMENT -->
- <xsl:when test="$currentListLevel &lt; $listLevel">
- <xsl:choose>
- <!-- if it has content the counting is ended -->
- <xsl:when test="*[name() = 'text:h' or name() = 'text:p'] or $isListHeader">
- <!-- 2DO: Perhaps the children still have to be processed -->
- <xsl:value-of select="$itemNumber + $pseudoLevel"/>
- </xsl:when>
- <xsl:otherwise>
- <!-- if it is empty the counting continues -->
- <xsl:call-template name="countListItemTillStartValue">
- <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle" />
- <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
- <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
- <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
- <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <!-- IF IT IS A LIST LEVEL ELEMENT OF THE COUNTING LEVEL -->
- <xsl:when test="$currentListLevel = $listLevel">
- <xsl:call-template name="countListItem">
- <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle" />
- <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
- <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
- <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
- <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- list item below the current level does not count -->
- <xsl:call-template name="countListItemTillStartValue">
- <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle" />
- <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
- <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
- <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
- <xsl:with-param name="pseudoLevel">
- <xsl:choose>
- <!-- empty list item does not count -->
- <xsl:when test="not(*[name() = 'text:h' or name() = 'text:p']) or $isListHeader">
- <xsl:value-of select="$pseudoLevel"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$itemNumber"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="countListItem">
- <xsl:param name="IteratorSameLevelAndStyle"/>
- <xsl:param name="IteratorSameStyle"/>
- <xsl:param name="itemNumber"/>
- <xsl:param name="listLevel"/>
- <xsl:param name="listLevelStyle"/>
- <xsl:param name="listStyle"/>
- <xsl:param name="listStyleName"/>
- <xsl:param name="precedingListItemsOfSameLevelAndStyle"/>
- <xsl:param name="precedingListItemsOfSameLevelAndStyleCount"/>
- <xsl:param name="precedingListItemsOfSameStyle"/>
- <xsl:param name="precedingListItemsOfSameStyleCount"/>
- <xsl:param name="pseudoLevel" />
-
- <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
- <xsl:variable name="isEmptyList" select="not(*[name() = 'text:h' or name() = 'text:p'])"/>
-
- <xsl:choose>
- <xsl:when test="@text:start-value">
- <xsl:choose>
- <xsl:when test="$isEmptyList or $isListHeader">
- <!-- empty list item does not count. neither does list header -->
- <xsl:call-template name="countListItemTillStartValue">
- <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
- <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
- <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
- <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
- <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$itemNumber + @text:start-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$listLevelStyle/@text:start-value">
- <xsl:choose>
- <xsl:when test="$isEmptyList or $isListHeader">
- <!-- empty list item does not count. neither does list header -->
- <xsl:call-template name="countListItemTillStartValue">
- <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
- <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
- <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
- <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
- <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$itemNumber + $listLevelStyle/@text:start-value"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <xsl:when test="$isEmptyList or $isListHeader">
- <!-- empty list item does not count. neither does list header -->
- <xsl:call-template name="countListItemTillStartValue">
- <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
- <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
- <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
- <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
- <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <!-- count on till you find a start-value or the end is reached -->
- <xsl:call-template name="countListItemTillStartValue">
- <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
- <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
- <xsl:with-param name="itemNumber" select="$itemNumber + 1"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
- <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
- <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
- <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
- <xsl:with-param name="pseudoLevel" select="0" />
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
-
- <!-- Creates the list label containing the number, which is separated by '.' between the levels.
- Depending on the levels to display (listLevelsToDisplay) -->
- <xsl:template name="createItemLabel">
- <xsl:param name="itemLabel" select="''"/>
- <xsl:param name="itemNumber" />
- <xsl:param name="listLevel" />
- <xsl:param name="listLevelStyle" />
- <xsl:param name="listLevelsToDisplay" />
-
- <xsl:choose>
- <xsl:when test="$listLevelsToDisplay &lt; $listLevel">
- <xsl:call-template name="truncLabel">
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="itemNumber" select="$itemNumber" />
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle" />
- <xsl:with-param name="listLevelsToDisplay" select="$listLevelsToDisplay"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="numberedSymbol">
- <xsl:comment>&#160;</xsl:comment>
- <!-- only give out a number when number format is not empty -->
- <xsl:if test="$listLevelStyle/@style:num-format != ''">
- <xsl:number value="$itemNumber" format="{$listLevelStyle/@style:num-format}"/>
- </xsl:if>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$listLevelsToDisplay != 1">
- <xsl:value-of select="concat($itemLabel, '.' , $numberedSymbol)"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$numberedSymbol"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="truncLabel">
- <xsl:param name="itemLabel" />
- <xsl:param name="itemNumber" />
- <xsl:param name="listLevel" />
- <xsl:param name="listLevelStyle" />
- <xsl:param name="listLevelsToDisplay" />
- <xsl:param name="listStyle" />
- <xsl:param name="listStyleName" />
-
- <xsl:call-template name="createItemLabel">
- <xsl:with-param name="itemLabel">
- <xsl:if test="contains($itemLabel, '.')">
- <xsl:value-of select="substring-after($itemLabel, '.')"/>
- </xsl:if>
- </xsl:with-param>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLevel" select="$listLevel - 1"/>
- <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
- <xsl:with-param name="listLevelsToDisplay" select="$listLevelsToDisplay"/>
- </xsl:call-template>
- </xsl:template>
-
-
- <xsl:template match="text:p" mode="list-item-children">
- <xsl:param name="globalData"/>
- <xsl:param name="listLabelElement"/>
- <xsl:param name="listLabelEmptyElement"/>
- <xsl:param name="isEmptyList"/>
- <xsl:param name="isListNumberingReset"/>
- <xsl:param name="isNextLevelNumberingReset"/>
- <xsl:param name="itemLabel"/>
- <xsl:param name="itemNumber"/>
- <xsl:param name="listIndent"/>
- <xsl:param name="listLevel"/>
- <xsl:param name="listRestart"/>
- <xsl:param name="listStyle"/>
- <xsl:param name="listStyleName"/>
- <xsl:param name="minLabelWidth"/>
-
- <!-- 2DO page alignment fix - PART1 -->
-
- <!-- xhtml:p may only contain inline elements.
- If there is one frame beyond, div must be used! -->
- <xsl:variable name="elementName">
- <xsl:choose>
- <xsl:when test="descendant::draw:frame[1] or descendant::text:p[1]">div</xsl:when>
- <xsl:otherwise>p</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:element name="{$elementName}">
- <xsl:call-template name="create-list-style">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="listIndent" select="$listIndent"/>
- <xsl:with-param name="styleName" select="@text:style-name"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="$listLabelElement">
- <xsl:copy-of select="$listLabelElement"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$listLabelEmptyElement"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="listIndent" select="$minLabelWidth"/>
- </xsl:apply-templates>
- <!-- this span disables the float necessary to bring two block elements on one line. It contains a space as IE6 bug workaround -->
- <span class="odfLiEnd"></span>
- <xsl:text>&#160;</xsl:text>
- </xsl:element>
-
- <xsl:apply-templates mode="list-item-children" select="following-sibling::*[1]">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
- <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLabelEmptyElement" select="$listLabelEmptyElement"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listRestart" select="$listRestart"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="listIndent" select="$listIndent"/>
- <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
- <!-- Neglecting the left margin behavior for headings for now -->
- <xsl:template match="text:h" mode="list-item-children">
- <xsl:param name="globalData"/>
- <xsl:param name="listLabelElement"/>
- <xsl:param name="listLabelEmptyElement"/>
- <xsl:param name="isEmptyList"/>
- <xsl:param name="isListNumberingReset"/>
- <xsl:param name="isNextLevelNumberingReset"/>
- <xsl:param name="itemLabel"/>
- <xsl:param name="itemNumber"/>
- <xsl:param name="listIndent"/>
- <xsl:param name="listLevel"/>
- <xsl:param name="listRestart"/>
- <xsl:param name="listStyle"/>
- <xsl:param name="listStyleName"/>
- <xsl:param name="minLabelWidth"/>
-
- <xsl:element name="h">
- <xsl:call-template name="create-list-style">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="listIndent" select="$listIndent"/>
- <xsl:with-param name="styleName" select="@text:style-name"/>
- </xsl:call-template>
- <xsl:variable name="title">
- <xsl:apply-templates mode="concatenate"/>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$listLabelElement">
- <xsl:copy-of select="$listLabelElement"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy-of select="$listLabelEmptyElement"/>
- </xsl:otherwise>
- </xsl:choose>
-
- <!-- REFERENCE HANDLING - ANCHOR -->
- <xsl:element namespace="{$namespace}" name="a">
- <xsl:attribute name="id">
- <xsl:value-of select="translate(concat('a_',$listLabelElement, '_', normalize-space($title)), '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
- </xsl:attribute>
- <xsl:apply-templates>
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="listIndent" select="$minLabelWidth"/>
- </xsl:apply-templates>
- </xsl:element>
-
- <!-- this span disables the float necessary to bring two block elements on one line. It contains a space as IE6 bug workaround -->
- <span class="odfLiEnd"></span>
- <xsl:text>&#160;</xsl:text>
- </xsl:element>
-
- <xsl:apply-templates mode="list-item-children" select="following-sibling::*[1]">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
- <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLabelEmptyElement" select="$listLabelEmptyElement"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listRestart" select="$listRestart"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="listIndent" select="$listIndent"/>
- <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
- </xsl:apply-templates>
- </xsl:template>
-
-
- <xsl:template match="*" mode="list-item-children">
- <xsl:param name="globalData"/>
- <xsl:param name="isEmptyList"/>
- <xsl:param name="listLabelEmptyElement"/>
- <xsl:param name="isListNumberingReset"/>
- <xsl:param name="isNextLevelNumberingReset"/>
- <xsl:param name="itemLabel"/>
- <xsl:param name="itemNumber"/>
- <xsl:param name="listIndent"/>
- <xsl:param name="listLevel"/>
- <xsl:param name="listRestart"/>
- <xsl:param name="listStyle"/>
- <xsl:param name="listStyleName"/>
- <xsl:param name="minLabelWidth"/>
-
- <xsl:apply-templates select="self::*">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
- <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="listLabelEmptyElement" select="$listLabelEmptyElement"/>
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listIndent" select="$listIndent"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listRestart" select="$listRestart"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- </xsl:apply-templates>
-
- <xsl:apply-templates mode="list-item-children" select="following-sibling::*[1]">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
- <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listLabelEmptyElement" select="$listLabelEmptyElement"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listRestart" select="$listRestart"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- <xsl:with-param name="listIndent" select="$listIndent"/>
- <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="*" mode="listItemSibling">
- <xsl:param name="globalData"/>
- <xsl:param name="isEmptyList"/>
- <xsl:param name="isListNumberingReset"/>
- <xsl:param name="isNextLevelNumberingReset"/>
- <xsl:param name="itemLabel"/>
- <xsl:param name="itemNumber"/>
- <xsl:param name="listIndent"/>
- <xsl:param name="listLevel"/>
- <xsl:param name="listRestart"/>
- <xsl:param name="listStyle"/>
- <xsl:param name="listStyleName"/>
-
- <xsl:apply-templates select="self::*">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
- <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listIndent" select="$listIndent"/>
- <!-- receives the same parent label, only with a different itemNumber -->
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="following-sibling::*[1]" mode="listItemSibling">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
- <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
- <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
- <xsl:with-param name="itemNumber" select="$itemNumber"/>
- <xsl:with-param name="listIndent" select="$listIndent"/>
- <!-- receives the same parent label, only with a different itemNumber -->
- <xsl:with-param name="itemLabel" select="$itemLabel"/>
- <xsl:with-param name="listLevel" select="$listLevel"/>
- <xsl:with-param name="listStyle" select="$listStyle"/>
- <xsl:with-param name="listStyleName" select="$listStyleName"/>
- </xsl:apply-templates>
- </xsl:template>
-
- <xsl:template match="text()" mode="list-item-children">
- <xsl:value-of select="."/>
- </xsl:template>
-
-
- <xsl:template name="create-list-style">
- <xsl:param name="globalData"/>
- <xsl:param name="listIndent" select="0"/>
- <xsl:param name="styleName"/>
-
- <xsl:if test="$styleName">
- <xsl:attribute name="class">
- <xsl:value-of select="translate($styleName, '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:attribute name="style">
- <xsl:text>margin-</xsl:text>
- <xsl:call-template name="getOppositeWritingDirection">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="paraStyleName" select="descendant-or-self::*/@text:style-name"/>
- </xsl:call-template>
- <xsl:text>:</xsl:text>
- <xsl:value-of select="$listIndent"/>
- <xsl:text>cm;</xsl:text>
- </xsl:attribute>
- </xsl:template>
-
-
- <!-- ********************************************** -->
- <!-- *** Text Section (contains: draw:text-box) *** -->
- <!-- ********************************************** -->
-
- <xsl:template match="text:section">
- <xsl:param name="globalData"/>
-
- <xsl:if test="not(contains(@text:display, 'none'))">
- <xsl:comment>Next 'div' was a 'text:section'.</xsl:comment>
- <xsl:element name="div">
- <xsl:call-template name="apply-styles-and-content">
- <xsl:with-param name="globalData" select="$globalData"/>
- </xsl:call-template>
- </xsl:element>
- </xsl:if>
- </xsl:template>
-
-
- <!-- Hidden text dependent on Office variables:
- The text is not shown, if condition is 'true'.
- Implemented solely for conditions as '<VARIABLE>==0' or '<VARIABLE>==1'
- -->
- <xsl:key match="text:variable-set" name="varSet" use="@text:name"/>
- <xsl:template match="text:hidden-text">
- <xsl:param name="globalData"/>
-
- <xsl:variable name="varName" select="substring-before(@text:condition, '==')"/>
- <xsl:variable name="varValue" select="substring-after(@text:condition, '==')"/>
- <xsl:choose>
- <xsl:when test="key('varSet', $varName)/@text:value != $varValue">
- <xsl:value-of select="@text:string-value"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:comment>
- <xsl:value-of select="$varName"/>
- <xsl:value-of select="@text:string-value"/>
- <xsl:value-of select="$varName"/>
- </xsl:comment>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="@text:style-name | @draw:style-name | @draw:text-style-name | @table:style-name"><!-- | @presentation:style-name-->
- <xsl:param name="globalData"/>
-
- <xsl:attribute name="class">
- <xsl:value-of select="translate(., '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
- </xsl:template>
-
-
- <!-- ***************** -->
- <!-- *** Footnotes *** -->
- <!-- ***************** -->
-
- <xsl:template match="text:note">
- <xsl:param name="globalData"/>
-
- <!-- get style configuration -->
- <xsl:variable name="footnoteConfig" select="$globalData/office:styles/text:notes-configuration[@text:note-class=current()/@text:note-class]" />
-
- <xsl:variable name="titlePrefix">
- <xsl:choose>
- <xsl:when test="@text:note-class = 'footnote'">
- <xsl:text>Footnote: </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>Endnote: </xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <!-- write anchor -->
- <xsl:element name="span">
- <xsl:attribute name="class">
- <xsl:value-of select="$footnoteConfig/@text:citation-body-style-name"/>
- </xsl:attribute>
- <xsl:attribute name="title">
- <xsl:value-of select="$titlePrefix"/>
- <xsl:apply-templates mode="textOnly" select="text:note-body"/>
- </xsl:attribute>
- <xsl:element name="a">
- <xsl:attribute name="href">
- <xsl:value-of select="concat('#', @text:id)"/>
- </xsl:attribute>
- <xsl:attribute name="id">
- <xsl:value-of select="concat('body_', @text:id)"/>
- </xsl:attribute>
- <xsl:apply-templates mode="textOnly" select="text:note-citation"/>
- </xsl:element>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="*" mode="textOnly">
- <xsl:apply-templates select="* | text()" mode="textOnly" />
- </xsl:template>
-
- <xsl:template match="text()" mode="textOnly">
- <xsl:value-of select="."/>
- </xsl:template>
-
- <!-- Useful in case of 'style:map', conditional formatting, where a style references to another -->
- <xsl:key name="textNotes" match="text:note" use="@text:note-class"/>
-
- <!-- writing the footer- and endnotes beyond the body -->
- <xsl:template name="write-text-nodes">
- <xsl:param name="globalData"/>
-
- <!-- write footnote body -->
- <xsl:for-each select="key('textNotes', 'footnote')">
- <xsl:call-template name="write-text-node">
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="footnoteConfig" select="$globalData/office:styles/text:notes-configuration[@text:note-class=current()/@text:note-class]" />
- </xsl:call-template>
- </xsl:for-each>
-
- <!-- write endnote body -->
- <xsl:for-each select="key('textNotes', 'endnote')">
- <xsl:call-template name="write-text-node">
-
- <xsl:with-param name="globalData" select="$globalData"/>
- <xsl:with-param name="footnoteConfig" select="$globalData/office:styles/text:notes-configuration[@text:note-class=current()/@text:note-class]" />
- </xsl:call-template>
- </xsl:for-each>
- </xsl:template>
-
- <xsl:template name="write-text-node">
- <xsl:param name="globalData"/>
- <xsl:param name="footnoteConfig"/>
-
- <xsl:apply-templates select="text:note-body/*[1]">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="footnotePrefix">
- <xsl:element name="span">
- <xsl:attribute name="class">footnodeNumber</xsl:attribute>
- <xsl:element name="a">
- <xsl:attribute name="class">
- <xsl:value-of select="$footnoteConfig/@text:citation-style-name"/>
- </xsl:attribute>
- <xsl:attribute name="id">
- <xsl:value-of select="@text:id"/>
- </xsl:attribute>
- <xsl:attribute name="href">
- <xsl:value-of select="concat('#body_', @text:id)"/>
- </xsl:attribute>
- <xsl:apply-templates mode="textOnly" select="text:note-citation"/>
- </xsl:element>
- </xsl:element>
- </xsl:with-param>
- </xsl:apply-templates>
- <xsl:apply-templates select="text:note-body/*[position()&gt;1]">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:apply-templates>
- </xsl:template>
-
- <!-- ***************** -->
- <!-- *** Bookmarks *** -->
- <!-- ***************** -->
-
- <xsl:template match="text:bookmark|text:bookmark-start">
- <xsl:element name="a">
- <xsl:attribute name="id">
- <xsl:value-of select="@text:name"/>
- </xsl:attribute>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="text:bookmark-end"/>
-
- <!-- DISABLING this tab handling as the tab width is only relative
- <xsl:template match="text:tab">
- <xsl:param name="globalData"/>
-
- <xsl:variable name="tabNo">
- <xsl:choose>
- <xsl:when test="preceding-sibling::text:line-break">
- <xsl:call-template name="countTextTab"/>
- </xsl:when>
- <xsl:when test="preceding-sibling::text:tab">
- <xsl:value-of select="count(preceding-sibling::text:tab)"/>
- </xsl:when>
- <xsl:otherwise>1</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:element name="span">
- <xsl:attribute name="style">margin-left:<xsl:value-of select="$globalData/all-doc-styles/style[@style:name = current()/parent::*/@text:style-name]/*/style:tab-stops/style:tab-stop[$tabNo]/@style:position"/>;</xsl:attribute>
- </xsl:element>
- </xsl:template>
-
- <xsl:template name="countTextTab">
- <xsl:param name="tabCount" select="1"/>
- <xsl:param name="context" select="."/>
-
- <xsl:choose>
- <xsl:when test="preceding-sibling::*[1]">
- <xsl:for-each select="preceding-sibling::*[1]">
- <xsl:call-template name="countTextTab">
- <xsl:with-param name="tabCout">
- <xsl:choose>
- <xsl:when test="name(.) = 'text:tab'">
- <xsl:value-of select="$tabCount + 1"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$tabCount"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- <xsl:with-param name="context" select="preceding-sibling::*[1]" />
- </xsl:call-template>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$tabCount"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ <xsl:template match="text:list-item | text:list-header" mode="listItemSibling">
+ <xsl:param name="globalData"/>
+ <xsl:param name="firstitemLabelWidth"/>
+ <xsl:param name="isEmptyList" select="not(*[name() = 'text:h' or name() = 'text:p' or name() = 'text:name'])"/>
+ <xsl:param name="isListNumberingReset"/>
+ <xsl:param name="isNextLevelNumberingReset"/>
+ <xsl:param name="itemNumber"/>
+ <xsl:param name="itemLabel"/>
+ <xsl:param name="listLevel"/>
+ <xsl:param name="listLevelStyle"/>
+ <xsl:param name="listRestart"/>
+ <xsl:param name="listStyle"/>
+ <xsl:param name="listStyleName"/>
+ <xsl:param name="minLabelDist"/>
+ <xsl:param name="minLabelWidth"/>
+ <xsl:param name="listIndent" />
+
+ <!-- The text:list-header shall not be labeled. According to ODF specification (sect. 4.3.2):
+ "The <text:list-header> element represents a list header and is a special kind of list item. It
+ contains one or more paragraphs that are displayed before a list. The paragraphs are formatted
+ like list items but they do not have a preceding number or bullet." -->
+ <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
+
+ <xsl:variable name="listIndentNew">
+ <xsl:choose>
+ <xsl:when test="$listIndent">
+ <xsl:value-of select="$listIndent"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="getListIndent">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="firstPara" select="*[name() = 'text:p' or name() = 'text:h'][1]" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="itemNumberNew">
+ <xsl:if test="$listStyle/text:list-style/text:list-level-style-number">
+ <xsl:choose>
+ <xsl:when test="$isListHeader">0</xsl:when>
+ <xsl:when test="$isEmptyList">
+ <!-- An empty list item (no text:h/text:p as child), will not count as item and does not increment the count. -->
+ <xsl:variable name="tempItemNumber">
+ <xsl:choose>
+ <!-- siblings will be incremented by one -->
+ <xsl:when test="$itemNumber">
+ <xsl:if test="not($isListHeader)">
+ <xsl:value-of select="$itemNumber + 1"/>
+ </xsl:if>
+ </xsl:when>
+ <!-- if a higher list level had content the numbering starts with 1 -->
+ <xsl:when test="$isListNumberingReset and $listLevel &gt; 1">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="getItemNumber">
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <!-- in case the empty list-item is the first list-item in document -->
+ <xsl:when test="$tempItemNumber = 1">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$tempItemNumber - 1"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="@text:start-value">
+ <xsl:value-of select="@text:start-value"/>
+ </xsl:when>
+ <!-- text:start-value from list level style will only be taken on the first list-item of a list -->
+ <xsl:when test="$listLevelStyle/@text:start-value and count(preceding-sibling::text:list-item) = 0">
+ <xsl:value-of select="$listLevelStyle/@text:start-value"/>
+ </xsl:when>
+ <!-- siblings will be incremented by one -->
+ <xsl:when test="$itemNumber">
+ <xsl:value-of select="$itemNumber + 1"/>
+ </xsl:when>
+ <!-- if a higher list level had content the numbering starts with 1 -->
+ <xsl:when test="$isListNumberingReset and $listLevel &gt; 1">
+ <xsl:value-of select="1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="getItemNumber">
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="itemLabelNew">
+ <xsl:if test="$listStyle/text:list-style/text:list-level-style-number">
+ <!--
+ A numbered label (e.g. 2.C.III) is created for every text:list-item/header.
+ Above list levels are listed in the label, if the list-style requires this. Levels are separated by a '.'
+ Formatation is dependent for every list level depth.
+ The label is passed from anchestor text:list-item/header and if requrired truncated.
+ The prefix/suffix (as well list level dependent) comes before and after the complete label (after truncation)
+ -->
+ <!-- Numbered label will be generated -->
+ <xsl:call-template name="createItemLabel">
+ <xsl:with-param name="itemNumber" select="$itemNumberNew"/>
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="listLevelsToDisplay">
+ <xsl:variable name="display" select="$listLevelStyle/@text:display-levels"/>
+ <xsl:choose>
+ <xsl:when test="$display">
+ <xsl:value-of select="$display"/>
+ </xsl:when>
+ <xsl:when test="$isListHeader">0</xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:element name="li">
+ <xsl:choose>
+ <xsl:when test="$isEmptyList or $isListHeader">
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="itemLabel" select="$itemLabelNew"/>
+ <xsl:with-param name="listLevel" select="$listLevel + 1"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ </xsl:apply-templates>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Possible following children are text:h, text:p, list:text, text:soft-page-break -->
+ <xsl:apply-templates mode="list-item-children" select="*[1]">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isListHeader or $isNextLevelNumberingReset"/>
+ <!-- The new created label is given to the children -->
+ <xsl:with-param name="itemLabel" select="$itemLabelNew"/>
+ <xsl:with-param name="listLabelElement">
+ <xsl:choose>
+ <xsl:when test="name() = 'text:list-header'"/>
+ <xsl:otherwise>
+ <xsl:variable name="listLabelWidth">
+ <xsl:choose>
+ <xsl:when test="$minLabelWidth &gt; $minLabelDist">
+ <xsl:value-of select="$minLabelWidth"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$minLabelDist &gt; 0">
+ <xsl:value-of select="$minLabelDist"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="listLevelLabelAlignment" select="$listLevelStyle/style:list-level-properties/style:list-level-label-alignment"/>
+ <xsl:variable name="listLevelTextIndent">
+ <xsl:call-template name="convert2cm">
+ <xsl:with-param name="value" select="string($listLevelLabelAlignment/@fo:text-indent)"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:value-of select="-$listLevelTextIndent"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Numbering is being done by this transformation creating a HTML span representing the number label
+ The html:span represents the list item/header label (e.g. 1.A.III)
+ As the html:span is usually a inline element is formatted by CSS as block element to use width upon it,
+ to disable the caridge return float:left is used and later neglected -->
+ <xsl:element name="span">
+ <xsl:if test="$listLevelStyle/@text:style-name">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$listLevelStyle/@text:style-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style">
+ <xsl:text>display:block;float:</xsl:text>
+ <!-- 2DO: Svante - copy this functionality for other used margin:left (in western country 'left') -->
+ <xsl:call-template name="getOppositeWritingDirection">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="paraStyleName" select="descendant-or-self::*/@text:style-name"/>
+ </xsl:call-template>
+ <xsl:text>;min-width:</xsl:text>
+ <xsl:value-of select="$listLabelWidth"/>
+ <xsl:text>cm;</xsl:text>
+ </xsl:attribute>
+ <xsl:variable name="labelContent">
+ <xsl:choose>
+ <xsl:when test="text:number">
+ <xsl:apply-templates select="text:number" mode="listnumber"/>
+ </xsl:when>
+ <xsl:when test="name($listLevelStyle) = 'text:list-level-style-bullet'">
+ <xsl:value-of select="$listLevelStyle/@style:num-prefix"/>
+ <xsl:value-of select="$listLevelStyle/@text:bullet-char"/>
+ <xsl:value-of select="$listLevelStyle/@style:num-suffix"/>
+ </xsl:when>
+ <xsl:when test="name($listLevelStyle) = 'text:list-level-style-number'">
+ <xsl:value-of select="$listLevelStyle/@style:num-prefix"/>
+ <xsl:value-of select="$itemLabelNew"/>
+ <xsl:value-of select="$listLevelStyle/@style:num-suffix"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Listing with image as bullets, taken from the list style's href -->
+ <xsl:value-of select="$listLevelStyle/@xlink:href"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <!-- Some browsers have problem with stand-alone elements (e.g. <span/>)
+ Therefore a comment is being inserted into an empty label -->
+ <xsl:choose>
+ <xsl:when test="$labelContent != ''">
+ <xsl:value-of select="$labelContent"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:comment>&#160;</xsl:comment>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="listLabelEmptyElement">
+ <xsl:variable name="listLabelWidth">
+ <xsl:choose>
+ <xsl:when test="$minLabelWidth &gt; $minLabelDist">
+ <xsl:value-of select="$minLabelWidth"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$minLabelDist"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="span">
+ <xsl:if test="$listLevelStyle/@text:style-name">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$listLevelStyle/@text:style-name"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style">
+ <xsl:text>display:block;float:</xsl:text>
+ <xsl:call-template name="getOppositeWritingDirection">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="paraStyleName" select="descendant-or-self::*/@text:style-name"/>
+ </xsl:call-template>
+ <xsl:text>;min-width:</xsl:text>
+ <xsl:value-of select="$listLabelWidth"/>
+ <xsl:text>cm</xsl:text>
+ </xsl:attribute>
+ <xsl:comment>&#160;</xsl:comment>
+ </xsl:element>
+ </xsl:with-param>
+ <xsl:with-param name="listLevel" select="$listLevel + 1"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listRestart" select="$listRestart"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="listIndent" select="$listIndentNew"/>
+ <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
+ </xsl:apply-templates>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+ <xsl:apply-templates select="following-sibling::*[1]" mode="listItemSibling">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="itemNumber" select="$itemNumberNew"/>
+ <xsl:with-param name="listIndent">
+ <xsl:choose>
+ <xsl:when test="not($isEmptyList)">
+ <xsl:value-of select="$listIndentNew"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:with-param>
+ <!-- Receives the same parent label -->
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="minLabelDist" select="$minLabelDist"/>
+ <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template name="getOppositeWritingDirection">
+ <xsl:param name="globalData"/>
+ <xsl:param name="paraStyleName"/>
+
+ <xsl:variable name="imageParagraphStyle" select="$globalData/all-styles/style[@style:name = $paraStyleName]/final-properties"/>
+
+ <xsl:choose>
+ <xsl:when test="contains($imageParagraphStyle, 'writing-mode:')">
+ <xsl:choose>
+ <xsl:when test="contains(substring-before(substring-after($imageParagraphStyle, 'writing-mode:'), ';'), 'rl')">right</xsl:when>
+ <xsl:otherwise>left</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>left</xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="text:number" mode="listnumber">
+ <xsl:apply-templates/>
+ </xsl:template>
+
+ <xsl:template match="text:number" mode="list-item-children">
+ <xsl:param name="globalData"/>
+ <xsl:param name="listLabelElement"/>
+ <xsl:param name="listLabelEmptyElement"/>
+ <xsl:param name="isEmptyList"/>
+ <xsl:param name="isListNumberingReset"/>
+ <xsl:param name="isNextLevelNumberingReset"/>
+ <xsl:param name="itemLabel"/>
+ <xsl:param name="itemNumber"/>
+ <xsl:param name="listIndent"/>
+ <xsl:param name="listLevel"/>
+ <xsl:param name="listLevelStyle" />
+ <xsl:param name="listRestart"/>
+ <xsl:param name="listStyle"/>
+ <xsl:param name="listStyleName"/>
+ <xsl:param name="minLabelWidth"/>
+
+ <xsl:apply-templates mode="list-item-children" select="following-sibling::*[1]">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="listLabelElement" select="$listLabelElement"/>
+ <xsl:with-param name="listLabelEmptyElement" select="$listLabelEmptyElement"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listRestart" select="$listRestart"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="listIndent" select="$listIndent"/>
+ <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <!-- Each key element holds the set of all text:list-item/text:list-header of a certain level and a certain style -->
+ <xsl:key name="getListItemsByLevelAndStyle" use="concat(count(ancestor::text:list), ancestor::text:list/@text:style-name)" match="text:list-item | text:list-header"/>
+ <!-- Each key element holds the set of all text:list-item/text:list-header of a certain style -->
+ <xsl:key name="getListItemsByStyle" use="ancestor::text:list/@text:style-name" match="text:list-item | text:list-header"/>
+
+
+ <!-- The Numbering start value (or offset from regular counteing) is used at the first item of offset,
+ but have to be reused on following items with no text:start-value -->
+ <xsl:template name="getItemNumber">
+ <xsl:param name="listLevel"/>
+ <xsl:param name="listLevelStyle"/>
+ <xsl:param name="listStyleName"/>
+ <xsl:param name="listStyle"/>
+
+ <xsl:call-template name="countListItemTillStartValue">
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="preceding::text:list-item[generate-id(key('getListItemsByLevelAndStyle', concat($listLevel, $listStyleName))) = generate-id(key('getListItemsByLevelAndStyle', concat(count(ancestor::text:list), ancestor::text:list/@text:style-name)))]"/>
+
+ <xsl:with-param name="precedingListItemsOfSameStyle" select="preceding::text:list-item[generate-id(key('getListItemsByStyle', $listStyleName)) = generate-id(key('getListItemsByStyle', ancestor::text:list/@text:style-name))]"/>
+ </xsl:call-template>
+ </xsl:template>
+
+ <!-- When there is a text:start-value the last have to be found and added to the number -->
+ <xsl:template name="countListItemTillStartValue">
+ <xsl:param name="IteratorSameLevelAndStyle" select="1"/>
+ <xsl:param name="IteratorSameStyle" select="1"/>
+ <xsl:param name="itemNumber" select="1"/>
+ <xsl:param name="listLevel"/>
+ <xsl:param name="listLevelStyle"/>
+ <xsl:param name="listStyle"/>
+ <xsl:param name="listStyleName"/>
+ <xsl:param name="precedingListItemsOfSameLevelAndStyle" />
+ <xsl:param name="precedingListItemsOfSameLevelAndStyleCount" select="count($precedingListItemsOfSameLevelAndStyle)"/>
+ <xsl:param name="precedingListItemsOfSameStyle" />
+ <xsl:param name="precedingListItemsOfSameStyleCount" select="count($precedingListItemsOfSameStyle)"/>
+ <!-- E.g.: If a list level 2 number is searched, a level 3 with content found with only a level 1 parent with content,
+ the level 3 gets a 'pseudoLevel' -->
+ <xsl:param name="pseudoLevel" select="0" />
+
+ <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
+ <xsl:variable name="isEmptyList" select="not(*[name() = 'text:h' or name() = 'text:p'])"/>
+
+ <!-- set the next of preceding list items. Starting from the current to the next previous text:list-item -->
+ <xsl:variable name="precedingListItemOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle[$precedingListItemsOfSameLevelAndStyleCount - $IteratorSameLevelAndStyle + 1]"/>
+ <xsl:variable name="precedingListItemOfSameStyle" select="$precedingListItemsOfSameStyle[$precedingListItemsOfSameStyleCount - $IteratorSameStyle + 1]"/>
+ <xsl:choose>
+ <xsl:when test="($precedingListItemOfSameStyle and $precedingListItemOfSameLevelAndStyle) or ($precedingListItemOfSameStyle and $listStyle/text:list-style/@text:consecutive-numbering)">
+ <xsl:for-each select="$precedingListItemOfSameStyle">
+ <xsl:choose>
+ <!-- if it is a higher list level element -->
+ <xsl:when test="$listStyle/text:list-style/@text:consecutive-numbering">
+
+ <xsl:call-template name="countListItem">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
+ <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
+ <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- NOT CONSECUTIVE NUMBERING -->
+ <xsl:variable name="currentListLevel" select="count(ancestor::text:list)"/>
+ <xsl:choose>
+ <!-- IF IT IS A HIGHER LIST LEVEL ELEMENT -->
+ <xsl:when test="$currentListLevel &lt; $listLevel">
+ <xsl:choose>
+ <!-- if it has content the counting is ended -->
+ <xsl:when test="*[name() = 'text:h' or name() = 'text:p'] or $isListHeader">
+ <!-- 2DO: Perhaps the children still have to be processed -->
+ <xsl:value-of select="$itemNumber + $pseudoLevel"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- if it is empty the counting continues -->
+ <xsl:call-template name="countListItemTillStartValue">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
+ <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
+ <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <!-- IF IT IS A LIST LEVEL ELEMENT OF THE COUNTING LEVEL -->
+ <xsl:when test="$currentListLevel = $listLevel">
+ <xsl:call-template name="countListItem">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
+ <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
+ <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- list item below the current level does not count -->
+ <xsl:call-template name="countListItemTillStartValue">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
+ <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
+ <xsl:with-param name="pseudoLevel">
+ <xsl:choose>
+ <!-- empty list item does not count -->
+ <xsl:when test="not(*[name() = 'text:h' or name() = 'text:p']) or $isListHeader">
+ <xsl:value-of select="$pseudoLevel"/>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$itemNumber"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="countListItem">
+ <xsl:param name="IteratorSameLevelAndStyle"/>
+ <xsl:param name="IteratorSameStyle"/>
+ <xsl:param name="itemNumber"/>
+ <xsl:param name="listLevel"/>
+ <xsl:param name="listLevelStyle"/>
+ <xsl:param name="listStyle"/>
+ <xsl:param name="listStyleName"/>
+ <xsl:param name="precedingListItemsOfSameLevelAndStyle"/>
+ <xsl:param name="precedingListItemsOfSameLevelAndStyleCount"/>
+ <xsl:param name="precedingListItemsOfSameStyle"/>
+ <xsl:param name="precedingListItemsOfSameStyleCount"/>
+ <xsl:param name="pseudoLevel" />
+
+ <xsl:variable name="isListHeader" select="boolean(self::text:list-header)"/>
+ <xsl:variable name="isEmptyList" select="not(*[name() = 'text:h' or name() = 'text:p'])"/>
+
+ <xsl:choose>
+ <xsl:when test="@text:start-value">
+ <xsl:choose>
+ <xsl:when test="$isEmptyList or $isListHeader">
+ <!-- empty list item does not count. neither does list header -->
+ <xsl:call-template name="countListItemTillStartValue">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
+ <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
+ <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$itemNumber + @text:start-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$listLevelStyle/@text:start-value">
+ <xsl:choose>
+ <xsl:when test="$isEmptyList or $isListHeader">
+ <!-- empty list item does not count. neither does list header -->
+ <xsl:call-template name="countListItemTillStartValue">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
+ <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
+ <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$itemNumber + $listLevelStyle/@text:start-value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$isEmptyList or $isListHeader">
+ <!-- empty list item does not count. neither does list header -->
+ <xsl:call-template name="countListItemTillStartValue">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
+ <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
+ <xsl:with-param name="pseudoLevel" select="$pseudoLevel" />
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- count on till you find a start-value or the end is reached -->
+ <xsl:call-template name="countListItemTillStartValue">
+ <xsl:with-param name="IteratorSameLevelAndStyle" select="$IteratorSameLevelAndStyle + 1" />
+ <xsl:with-param name="IteratorSameStyle" select="$IteratorSameStyle + 1"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber + 1"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyle" select="$precedingListItemsOfSameLevelAndStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameLevelAndStyleCount" select="$precedingListItemsOfSameLevelAndStyleCount"/>
+ <xsl:with-param name="precedingListItemsOfSameStyle" select="$precedingListItemsOfSameStyle"/>
+ <xsl:with-param name="precedingListItemsOfSameStyleCount" select="$precedingListItemsOfSameStyleCount"/>
+ <xsl:with-param name="pseudoLevel" select="0" />
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+
+ <!-- Creates the list label containing the number, which is separated by '.' between the levels.
+ Depending on the levels to display (listLevelsToDisplay) -->
+ <xsl:template name="createItemLabel">
+ <xsl:param name="itemLabel" select="''"/>
+ <xsl:param name="itemNumber" />
+ <xsl:param name="listLevel" />
+ <xsl:param name="listLevelStyle" />
+ <xsl:param name="listLevelsToDisplay" />
+
+ <xsl:choose>
+ <xsl:when test="$listLevelsToDisplay &lt; $listLevel">
+ <xsl:call-template name="truncLabel">
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber" />
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle" />
+ <xsl:with-param name="listLevelsToDisplay" select="$listLevelsToDisplay"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="numberedSymbol">
+ <xsl:comment>&#160;</xsl:comment>
+ <!-- only give out a number when number format is not empty -->
+ <xsl:if test="$listLevelStyle/@style:num-format != ''">
+ <xsl:number value="$itemNumber" format="{$listLevelStyle/@style:num-format}"/>
+ </xsl:if>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$listLevelsToDisplay != 1">
+ <xsl:value-of select="concat($itemLabel, '.' , $numberedSymbol)"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$numberedSymbol"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="truncLabel">
+ <xsl:param name="itemLabel" />
+ <xsl:param name="itemNumber" />
+ <xsl:param name="listLevel" />
+ <xsl:param name="listLevelStyle" />
+ <xsl:param name="listLevelsToDisplay" />
+ <xsl:param name="listStyle" />
+ <xsl:param name="listStyleName" />
+
+ <xsl:call-template name="createItemLabel">
+ <xsl:with-param name="itemLabel">
+ <xsl:if test="contains($itemLabel, '.')">
+ <xsl:value-of select="substring-after($itemLabel, '.')"/>
+ </xsl:if>
+ </xsl:with-param>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLevel" select="$listLevel - 1"/>
+ <xsl:with-param name="listLevelStyle" select="$listLevelStyle"/>
+ <xsl:with-param name="listLevelsToDisplay" select="$listLevelsToDisplay"/>
+ </xsl:call-template>
+ </xsl:template>
+
+
+ <xsl:template match="text:p" mode="list-item-children">
+ <xsl:param name="globalData"/>
+ <xsl:param name="listLabelElement"/>
+ <xsl:param name="listLabelEmptyElement"/>
+ <xsl:param name="isEmptyList"/>
+ <xsl:param name="isListNumberingReset"/>
+ <xsl:param name="isNextLevelNumberingReset"/>
+ <xsl:param name="itemLabel"/>
+ <xsl:param name="itemNumber"/>
+ <xsl:param name="listIndent"/>
+ <xsl:param name="listLevel"/>
+ <xsl:param name="listRestart"/>
+ <xsl:param name="listStyle"/>
+ <xsl:param name="listStyleName"/>
+ <xsl:param name="minLabelWidth"/>
+
+ <!-- 2DO page alignment fix - PART1 -->
+
+ <!-- xhtml:p may only contain inline elements.
+ If there is one frame beyond, div must be used! -->
+ <xsl:variable name="elementName">
+ <xsl:choose>
+ <xsl:when test="descendant::draw:frame[1] or descendant::text:p[1]">div</xsl:when>
+ <xsl:otherwise>p</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:element name="{$elementName}">
+ <xsl:call-template name="create-list-style">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="listIndent" select="$listIndent"/>
+ <xsl:with-param name="styleName" select="@text:style-name"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="$listLabelElement">
+ <xsl:copy-of select="$listLabelElement"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$listLabelEmptyElement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="listIndent" select="$minLabelWidth"/>
+ </xsl:apply-templates>
+ <!-- this span disables the float necessary to bring two block elements on one line. It contains a space as IE6 bug workaround -->
+ <span class="odfLiEnd"></span>
+ <xsl:text>&#160;</xsl:text>
+ </xsl:element>
+
+ <xsl:apply-templates mode="list-item-children" select="following-sibling::*[1]">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
+ <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLabelEmptyElement" select="$listLabelEmptyElement"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listRestart" select="$listRestart"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="listIndent" select="$listIndent"/>
+ <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+
+ <!-- Neglecting the left margin behavior for headings for now -->
+ <xsl:template match="text:h" mode="list-item-children">
+ <xsl:param name="globalData"/>
+ <xsl:param name="listLabelElement"/>
+ <xsl:param name="listLabelEmptyElement"/>
+ <xsl:param name="isEmptyList"/>
+ <xsl:param name="isListNumberingReset"/>
+ <xsl:param name="isNextLevelNumberingReset"/>
+ <xsl:param name="itemLabel"/>
+ <xsl:param name="itemNumber"/>
+ <xsl:param name="listIndent"/>
+ <xsl:param name="listLevel"/>
+ <xsl:param name="listRestart"/>
+ <xsl:param name="listStyle"/>
+ <xsl:param name="listStyleName"/>
+ <xsl:param name="minLabelWidth"/>
+
+ <xsl:element name="h">
+ <xsl:call-template name="create-list-style">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="listIndent" select="$listIndent"/>
+ <xsl:with-param name="styleName" select="@text:style-name"/>
+ </xsl:call-template>
+ <xsl:variable name="title">
+ <xsl:apply-templates mode="concatenate"/>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="$listLabelElement">
+ <xsl:copy-of select="$listLabelElement"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="$listLabelEmptyElement"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <!-- REFERENCE HANDLING - ANCHOR -->
+ <xsl:element namespace="{$namespace}" name="a">
+ <xsl:attribute name="id">
+ <xsl:value-of select="translate(concat('a_',$listLabelElement, '_', normalize-space($title)), '&#xA;&amp;&lt;&gt;.,;: %()[]/\+', '___________________________')"/>
+ </xsl:attribute>
+ <xsl:apply-templates>
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="listIndent" select="$minLabelWidth"/>
+ </xsl:apply-templates>
+ </xsl:element>
+
+ <!-- this span disables the float necessary to bring two block elements on one line. It contains a space as IE6 bug workaround -->
+ <span class="odfLiEnd"></span>
+ <xsl:text>&#160;</xsl:text>
+ </xsl:element>
+
+ <xsl:apply-templates mode="list-item-children" select="following-sibling::*[1]">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
+ <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLabelEmptyElement" select="$listLabelEmptyElement"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listRestart" select="$listRestart"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="listIndent" select="$listIndent"/>
+ <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+
+ <xsl:template match="*" mode="list-item-children">
+ <xsl:param name="globalData"/>
+ <xsl:param name="isEmptyList"/>
+ <xsl:param name="listLabelEmptyElement"/>
+ <xsl:param name="isListNumberingReset"/>
+ <xsl:param name="isNextLevelNumberingReset"/>
+ <xsl:param name="itemLabel"/>
+ <xsl:param name="itemNumber"/>
+ <xsl:param name="listIndent"/>
+ <xsl:param name="listLevel"/>
+ <xsl:param name="listRestart"/>
+ <xsl:param name="listStyle"/>
+ <xsl:param name="listStyleName"/>
+ <xsl:param name="minLabelWidth"/>
+
+ <xsl:apply-templates select="self::*">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
+ <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="listLabelEmptyElement" select="$listLabelEmptyElement"/>
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listIndent" select="$listIndent"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listRestart" select="$listRestart"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ </xsl:apply-templates>
+
+ <xsl:apply-templates mode="list-item-children" select="following-sibling::*[1]">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
+ <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listLabelEmptyElement" select="$listLabelEmptyElement"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listRestart" select="$listRestart"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ <xsl:with-param name="listIndent" select="$listIndent"/>
+ <xsl:with-param name="minLabelWidth" select="$minLabelWidth"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="*" mode="listItemSibling">
+ <xsl:param name="globalData"/>
+ <xsl:param name="isEmptyList"/>
+ <xsl:param name="isListNumberingReset"/>
+ <xsl:param name="isNextLevelNumberingReset"/>
+ <xsl:param name="itemLabel"/>
+ <xsl:param name="itemNumber"/>
+ <xsl:param name="listIndent"/>
+ <xsl:param name="listLevel"/>
+ <xsl:param name="listRestart"/>
+ <xsl:param name="listStyle"/>
+ <xsl:param name="listStyleName"/>
+
+ <xsl:apply-templates select="self::*">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
+ <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listIndent" select="$listIndent"/>
+ <!-- receives the same parent label, only with a different itemNumber -->
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="following-sibling::*[1]" mode="listItemSibling">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="isEmptyList" select="$isEmptyList"/>
+ <xsl:with-param name="isListNumberingReset" select="$isListNumberingReset"/>
+ <xsl:with-param name="isNextLevelNumberingReset" select="$isNextLevelNumberingReset"/>
+ <xsl:with-param name="itemNumber" select="$itemNumber"/>
+ <xsl:with-param name="listIndent" select="$listIndent"/>
+ <!-- receives the same parent label, only with a different itemNumber -->
+ <xsl:with-param name="itemLabel" select="$itemLabel"/>
+ <xsl:with-param name="listLevel" select="$listLevel"/>
+ <xsl:with-param name="listStyle" select="$listStyle"/>
+ <xsl:with-param name="listStyleName" select="$listStyleName"/>
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <xsl:template match="text()" mode="list-item-children">
+ <xsl:value-of select="."/>
+ </xsl:template>
+
+
+ <xsl:template name="create-list-style">
+ <xsl:param name="globalData"/>
+ <xsl:param name="listIndent" select="0"/>
+ <xsl:param name="styleName"/>
+
+ <xsl:if test="$styleName">
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate($styleName, '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="style">
+ <xsl:text>margin-</xsl:text>
+ <xsl:call-template name="getOppositeWritingDirection">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="paraStyleName" select="descendant-or-self::*/@text:style-name"/>
+ </xsl:call-template>
+ <xsl:text>:</xsl:text>
+ <xsl:value-of select="$listIndent"/>
+ <xsl:text>cm;</xsl:text>
+ </xsl:attribute>
+ </xsl:template>
+
+
+ <!-- ********************************************** -->
+ <!-- *** Text Section (contains: draw:text-box) *** -->
+ <!-- ********************************************** -->
+
+ <xsl:template match="text:section">
+ <xsl:param name="globalData"/>
+
+ <xsl:if test="not(contains(@text:display, 'none'))">
+ <xsl:comment>Next 'div' was a 'text:section'.</xsl:comment>
+ <xsl:element name="div">
+ <xsl:call-template name="apply-styles-and-content">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
+
+
+ <!-- Hidden text dependent on Office variables:
+ The text is not shown, if condition is 'true'.
+ Implemented solely for conditions as '<VARIABLE>==0' or '<VARIABLE>==1'
+ -->
+ <xsl:key match="text:variable-set" name="varSet" use="@text:name"/>
+ <xsl:template match="text:hidden-text">
+ <xsl:param name="globalData"/>
+
+ <xsl:variable name="varName" select="substring-before(@text:condition, '==')"/>
+ <xsl:variable name="varValue" select="substring-after(@text:condition, '==')"/>
+ <xsl:choose>
+ <xsl:when test="key('varSet', $varName)/@text:value != $varValue">
+ <xsl:value-of select="@text:string-value"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:comment>
+ <xsl:value-of select="$varName"/>
+ <xsl:value-of select="@text:string-value"/>
+ <xsl:value-of select="$varName"/>
+ </xsl:comment>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="@text:style-name | @draw:style-name | @draw:text-style-name | @table:style-name"><!-- | @presentation:style-name-->
+ <xsl:param name="globalData"/>
+
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate(., '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+ </xsl:template>
+
+
+ <!-- ***************** -->
+ <!-- *** Footnotes *** -->
+ <!-- ***************** -->
+
+ <xsl:template match="text:note">
+ <xsl:param name="globalData"/>
+
+ <!-- get style configuration -->
+ <xsl:variable name="footnoteConfig" select="$globalData/office:styles/text:notes-configuration[@text:note-class=current()/@text:note-class]" />
+
+ <xsl:variable name="titlePrefix">
+ <xsl:choose>
+ <xsl:when test="@text:note-class = 'footnote'">
+ <xsl:text>Footnote: </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>Endnote: </xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <!-- write anchor -->
+ <xsl:element name="span">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$footnoteConfig/@text:citation-body-style-name"/>
+ </xsl:attribute>
+ <xsl:attribute name="title">
+ <xsl:value-of select="$titlePrefix"/>
+ <xsl:apply-templates mode="textOnly" select="text:note-body"/>
+ </xsl:attribute>
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#', @text:id)"/>
+ </xsl:attribute>
+ <xsl:attribute name="id">
+ <xsl:value-of select="concat('body_', @text:id)"/>
+ </xsl:attribute>
+ <xsl:apply-templates mode="textOnly" select="text:note-citation"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="*" mode="textOnly">
+ <xsl:apply-templates select="* | text()" mode="textOnly" />
+ </xsl:template>
+
+ <xsl:template match="text()" mode="textOnly">
+ <xsl:value-of select="."/>
+ </xsl:template>
+
+ <!-- Useful in case of 'style:map', conditional formatting, where a style references to another -->
+ <xsl:key name="textNotes" match="text:note" use="@text:note-class"/>
+
+ <!-- writing the footer- and endnotes beyond the body -->
+ <xsl:template name="write-text-nodes">
+ <xsl:param name="globalData"/>
+
+ <!-- write footnote body -->
+ <xsl:for-each select="key('textNotes', 'footnote')">
+ <xsl:call-template name="write-text-node">
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="footnoteConfig" select="$globalData/office:styles/text:notes-configuration[@text:note-class=current()/@text:note-class]" />
+ </xsl:call-template>
+ </xsl:for-each>
+
+ <!-- write endnote body -->
+ <xsl:for-each select="key('textNotes', 'endnote')">
+ <xsl:call-template name="write-text-node">
+
+ <xsl:with-param name="globalData" select="$globalData"/>
+ <xsl:with-param name="footnoteConfig" select="$globalData/office:styles/text:notes-configuration[@text:note-class=current()/@text:note-class]" />
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="write-text-node">
+ <xsl:param name="globalData"/>
+ <xsl:param name="footnoteConfig"/>
+
+ <xsl:apply-templates select="text:note-body/*[1]">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="footnotePrefix">
+ <xsl:element name="span">
+ <xsl:attribute name="class">footnodeNumber</xsl:attribute>
+ <xsl:element name="a">
+ <xsl:attribute name="class">
+ <xsl:value-of select="$footnoteConfig/@text:citation-style-name"/>
+ </xsl:attribute>
+ <xsl:attribute name="id">
+ <xsl:value-of select="@text:id"/>
+ </xsl:attribute>
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat('#body_', @text:id)"/>
+ </xsl:attribute>
+ <xsl:apply-templates mode="textOnly" select="text:note-citation"/>
+ </xsl:element>
+ </xsl:element>
+ </xsl:with-param>
+ </xsl:apply-templates>
+ <xsl:apply-templates select="text:note-body/*[position()&gt;1]">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:apply-templates>
+ </xsl:template>
+
+ <!-- ***************** -->
+ <!-- *** Bookmarks *** -->
+ <!-- ***************** -->
+
+ <xsl:template match="text:bookmark|text:bookmark-start">
+ <xsl:element name="a">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@text:name"/>
+ </xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="text:bookmark-end"/>
+
+ <!-- DISABLING this tab handling as the tab width is only relative
+ <xsl:template match="text:tab">
+ <xsl:param name="globalData"/>
+
+ <xsl:variable name="tabNo">
+ <xsl:choose>
+ <xsl:when test="preceding-sibling::text:line-break">
+ <xsl:call-template name="countTextTab"/>
+ </xsl:when>
+ <xsl:when test="preceding-sibling::text:tab">
+ <xsl:value-of select="count(preceding-sibling::text:tab)"/>
+ </xsl:when>
+ <xsl:otherwise>1</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:element name="span">
+ <xsl:attribute name="style">margin-left:<xsl:value-of select="$globalData/all-doc-styles/style[@style:name = current()/parent::*/@text:style-name]/*/style:tab-stops/style:tab-stop[$tabNo]/@style:position"/>;</xsl:attribute>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="countTextTab">
+ <xsl:param name="tabCount" select="1"/>
+ <xsl:param name="context" select="."/>
+
+ <xsl:choose>
+ <xsl:when test="preceding-sibling::*[1]">
+ <xsl:for-each select="preceding-sibling::*[1]">
+ <xsl:call-template name="countTextTab">
+ <xsl:with-param name="tabCout">
+ <xsl:choose>
+ <xsl:when test="name(.) = 'text:tab'">
+ <xsl:value-of select="$tabCount + 1"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$tabCount"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="context" select="preceding-sibling::*[1]" />
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$tabCount"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
-->
- <!-- MathML -->
- <xsl:template match="draw:object[math:math]">
- <xsl:apply-templates select="math:math" mode="math"/>
- </xsl:template>
-
- <xsl:template match="*" mode="math">
- <xsl:element name="{local-name()}" namespace="http://www.w3.org/1998/Math/MathML">
- <xsl:apply-templates select="@*|node()" mode="math"/>
- </xsl:element>
- </xsl:template>
-
- <xsl:template match="@*" mode="math">
- <xsl:attribute name="{local-name()}">
- <xsl:value-of select="."/>
- </xsl:attribute>
- </xsl:template>
-
- <!-- Ignore semantic annotations -->
- <xsl:template match="math:semantics" mode="math">
- <xsl:apply-templates select="*[1]" mode="math"/>
- </xsl:template>
+ <!-- MathML -->
+ <xsl:template match="draw:object[math:math]">
+ <xsl:apply-templates select="math:math" mode="math"/>
+ </xsl:template>
+
+ <xsl:template match="*" mode="math">
+ <xsl:element name="{local-name()}" namespace="http://www.w3.org/1998/Math/MathML">
+ <xsl:apply-templates select="@*|node()" mode="math"/>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template match="@*" mode="math">
+ <xsl:attribute name="{local-name()}">
+ <xsl:value-of select="."/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <!-- Ignore semantic annotations -->
+ <xsl:template match="math:semantics" mode="math">
+ <xsl:apply-templates select="*[1]" mode="math"/>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
index dcbeda0a3297..b75d6ff7cfda 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/header.xsl
@@ -17,128 +17,128 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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">
-
- <!-- ************** -->
- <!-- *** header *** -->
- <!-- ************** -->
-
- <xsl:template name="create-header">
- <xsl:param name="globalData" />
-
- <xsl:element name="head">
- <xsl:attribute name="profile">http://dublincore.org/documents/dcmi-terms/</xsl:attribute>
- <xsl:if test="$debugEnabled"><xsl:message>CSS helper variable will be created....</xsl:message></xsl:if>
- <xsl:call-template name='xhtml-header-properties'>
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:call-template>
-
- <xsl:if test="$debugEnabled"><xsl:message>CSS variable ready, header will be created....</xsl:message></xsl:if>
- <!-- constructing the css header simulating inheritance of style-families by style order -->
- <xsl:call-template name='create-css-styleheader'>
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:call-template>
- <xsl:if test="$debugEnabled"><xsl:message>CSS header creation finished!</xsl:message></xsl:if>
- </xsl:element>
-
- </xsl:template>
-
- <!-- Creating a CSS style header from the collected styles of the 'globalData' parameter -->
- <xsl:template name='create-css-styleheader'>
- <xsl:param name="globalData" />
-
- <xsl:element name="style">
- <xsl:attribute name="type">text/css</xsl:attribute>
+ 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">
+
+ <!-- ************** -->
+ <!-- *** header *** -->
+ <!-- ************** -->
+
+ <xsl:template name="create-header">
+ <xsl:param name="globalData" />
+
+ <xsl:element name="head">
+ <xsl:attribute name="profile">http://dublincore.org/documents/dcmi-terms/</xsl:attribute>
+ <xsl:if test="$debugEnabled"><xsl:message>CSS helper variable will be created....</xsl:message></xsl:if>
+ <xsl:call-template name='xhtml-header-properties'>
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:call-template>
+
+ <xsl:if test="$debugEnabled"><xsl:message>CSS variable ready, header will be created....</xsl:message></xsl:if>
+ <!-- constructing the css header simulating inheritance of style-families by style order -->
+ <xsl:call-template name='create-css-styleheader'>
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:call-template>
+ <xsl:if test="$debugEnabled"><xsl:message>CSS header creation finished!</xsl:message></xsl:if>
+ </xsl:element>
+
+ </xsl:template>
+
+ <!-- Creating a CSS style header from the collected styles of the 'globalData' parameter -->
+ <xsl:template name='create-css-styleheader'>
+ <xsl:param name="globalData" />
+
+ <xsl:element name="style">
+ <xsl:attribute name="type">text/css</xsl:attribute>
<xsl:text>
- </xsl:text>
- <xsl:call-template name='create-page-layout'>
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:call-template>
+ </xsl:text>
+ <xsl:call-template name='create-page-layout'>
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:call-template>
<xsl:text>table { border-collapse:collapse; border-spacing:0; empty-cells:show }
- </xsl:text>
- <xsl:choose>
- <xsl:when test="/*/office:body/office:spreadsheet"><xsl:text>td, th { vertical-align:top; font-size:10pt;}
- </xsl:text></xsl:when>
- <xsl:otherwise><xsl:text>td, th { vertical-align:top; font-size:12pt;}
- </xsl:text></xsl:otherwise>
- </xsl:choose>
+ </xsl:text>
+ <xsl:choose>
+ <xsl:when test="/*/office:body/office:spreadsheet"><xsl:text>td, th { vertical-align:top; font-size:10pt;}
+ </xsl:text></xsl:when>
+ <xsl:otherwise><xsl:text>td, th { vertical-align:top; font-size:12pt;}
+ </xsl:text></xsl:otherwise>
+ </xsl:choose>
<xsl:text>h1, h2, h3, h4, h5, h6 { clear:both;}
- </xsl:text>
+ </xsl:text>
<xsl:text>ol, ul { margin:0; padding:0;}
- </xsl:text>
+ </xsl:text>
<xsl:text>li { list-style: none; margin:0; padding:0;}
- </xsl:text>
+ </xsl:text>
<xsl:text>/* "li span.odfLiEnd" - IE 7 issue*/</xsl:text>
<xsl:text>
- </xsl:text>
+ </xsl:text>
<xsl:text>li span. { clear: both; line-height:0; width:0; height:0; margin:0; padding:0; }
- </xsl:text>
+ </xsl:text>
<xsl:text>span.footnodeNumber { padding-right:1em; }
- </xsl:text>
+ </xsl:text>
<xsl:text>span.annotation_style_by_filter { font-size:95%; font-family:Arial; background-color:#fff000; margin:0; border:0; padding:0; }
- </xsl:text>
+ </xsl:text>
<!-- Simulate tabs. They are around 0.64cm in LO, we convert that to 0.8rem. -->
<xsl:text>span.heading_numbering { margin-right: 0.8rem; }</xsl:text>
<xsl:text>* { margin:0;}
- </xsl:text>
- <xsl:call-template name="write-mapped-CSS-styles">
- <xsl:with-param name="globalData" select="$globalData" />
- </xsl:call-template>
- </xsl:element>
- </xsl:template>
-
- <xsl:template name="write-mapped-CSS-styles">
- <xsl:param name="globalData" />
- <xsl:param name="emptyStyles"/>
-
- <xsl:for-each select="$globalData/all-styles/style">
- <xsl:if test="final-properties != ''">
- <!-- NOTE: easy process, as only the style family in conjunction with the style name, makes the style unambigous -->
- <xsl:text>.</xsl:text><!--<xsl:value-of select="@style:family" /><xsl:text>:</xsl:text>--><xsl:value-of select="translate(@style:name, '.,;: %()[]/\+', '_____________')"/><xsl:text> { </xsl:text> <xsl:value-of select="final-properties" /><xsl:text>}
- </xsl:text>
- </xsl:if>
-
- </xsl:for-each>
- <!-- Otherwise all styles have been processed and the empty styles have to be given out -->
- <xsl:text>/* ODF styles with no properties representable as CSS */</xsl:text><xsl:text>
- </xsl:text><xsl:for-each select="$globalData/all-styles/style[final-properties = '']"><xsl:value-of select="concat('.', @style:name, ' ')"/></xsl:for-each> { }
- </xsl:template>
-
- <!-- Creating CSS page layout based on first office master style -->
- <xsl:template name='create-page-layout'>
- <xsl:param name="globalData" />
-
- <!-- approximation to find the correct master page style (with page dimensions) -->
- <xsl:variable name="masterPageNames">
+ </xsl:text>
+ <xsl:call-template name="write-mapped-CSS-styles">
+ <xsl:with-param name="globalData" select="$globalData" />
+ </xsl:call-template>
+ </xsl:element>
+ </xsl:template>
+
+ <xsl:template name="write-mapped-CSS-styles">
+ <xsl:param name="globalData" />
+ <xsl:param name="emptyStyles"/>
+
+ <xsl:for-each select="$globalData/all-styles/style">
+ <xsl:if test="final-properties != ''">
+ <!-- NOTE: easy process, as only the style family in conjunction with the style name, makes the style unambigous -->
+ <xsl:text>.</xsl:text><!--<xsl:value-of select="@style:family" /><xsl:text>:</xsl:text>--><xsl:value-of select="translate(@style:name, '.,;: %()[]/\+', '_____________')"/><xsl:text> { </xsl:text> <xsl:value-of select="final-properties" /><xsl:text>}
+ </xsl:text>
+ </xsl:if>
+
+ </xsl:for-each>
+ <!-- Otherwise all styles have been processed and the empty styles have to be given out -->
+ <xsl:text>/* ODF styles with no properties representable as CSS */</xsl:text><xsl:text>
+ </xsl:text><xsl:for-each select="$globalData/all-styles/style[final-properties = '']"><xsl:value-of select="concat('.', @style:name, ' ')"/></xsl:for-each> { }
+ </xsl:template>
+
+ <!-- Creating CSS page layout based on first office master style -->
+ <xsl:template name='create-page-layout'>
+ <xsl:param name="globalData" />
+
+ <!-- approximation to find the correct master page style (with page dimensions) -->
+ <xsl:variable name="masterPageNames">
<!-- set context to styles.xml -->
<xsl:for-each select="$globalData/all-doc-styles/style">
<!-- Loop over every style:style containing a @style:master-page-name attribute -->
@@ -153,297 +153,297 @@
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
- </xsl:variable>
- <!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name -->
- <xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/>
- <!-- Find the according style:page-layout and store the properties in a variable -->
- <xsl:variable name="pageProperties" select="key('pageLayoutElements', $pageLayoutName)/style:page-layout-properties"/>
+ </xsl:variable>
+ <!-- Take the first of the masterpage list and get the according style:master-page element and find the @style:page-layout-name -->
+ <xsl:variable name="pageLayoutName" select="key('masterPageElements', substring-before($masterPageNames,';'))/@style:page-layout-name"/>
+ <!-- Find the according style:page-layout and store the properties in a variable -->
+ <xsl:variable name="pageProperties" select="key('pageLayoutElements', $pageLayoutName)/style:page-layout-properties"/>
<xsl:text>@page { </xsl:text>
- <xsl:call-template name="page-size">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="pageProperties" select="$pageProperties" />
- </xsl:call-template>
- <xsl:call-template name="page-margin">
- <xsl:with-param name="globalData" select="$globalData" />
- <xsl:with-param name="pageProperties" select="$pageProperties" />
- </xsl:call-template>
+ <xsl:call-template name="page-size">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="pageProperties" select="$pageProperties" />
+ </xsl:call-template>
+ <xsl:call-template name="page-margin">
+ <xsl:with-param name="globalData" select="$globalData" />
+ <xsl:with-param name="pageProperties" select="$pageProperties" />
+ </xsl:call-template>
<xsl:text> }
- </xsl:text>
-
- </xsl:template>
-
-
- <xsl:template name="page-size">
- <xsl:param name="globalData" />
- <xsl:param name="pageProperties" />
-
- <xsl:variable name="printOrientation" select="$pageProperties/@style:print-orientation" />
- <xsl:variable name="pageWidth" select="$pageProperties/@fo:page-width" />
- <xsl:variable name="pageHeight" select="$pageProperties/@fo:page-height" />
- <xsl:choose>
- <xsl:when test="$pageWidth and $pageHeight">
- <xsl:text>size: </xsl:text>
- <xsl:value-of select="$pageWidth" />
- <xsl:text> </xsl:text>
- <xsl:value-of select="$pageHeight" />
- <xsl:text>; </xsl:text>
- </xsl:when>
- <xsl:when test="$printOrientation">
- <xsl:text>size: </xsl:text>
- <xsl:value-of select="$printOrientation" />
- <xsl:text>; </xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="page-margin">
- <xsl:param name="globalData" />
- <xsl:param name="pageProperties" />
-
- <xsl:variable name="marginTop" select="$pageProperties/@fo:margin-top" />
- <xsl:if test="$marginTop">
- <xsl:text>margin-top: </xsl:text>
- <xsl:value-of select="$marginTop" />
- <xsl:text>; </xsl:text>
- </xsl:if>
- <xsl:variable name="marginBottom" select="$pageProperties/@fo:margin-bottom" />
- <xsl:if test="$marginBottom">
- <xsl:text>margin-bottom: </xsl:text>
- <xsl:value-of select="$marginBottom" />
- <xsl:text>; </xsl:text>
- </xsl:if>
- <xsl:variable name="marginLeft" select="$pageProperties/@fo:margin-left" />
- <xsl:if test="$marginLeft">
- <xsl:text>margin-left: </xsl:text>
- <xsl:value-of select="$marginLeft" />
- <xsl:text>; </xsl:text>
- </xsl:if>
- <xsl:variable name="marginRight" select="$pageProperties/@fo:margin-right" />
- <xsl:if test="$marginRight">
- <xsl:text>margin-right: </xsl:text>
- <xsl:value-of select="$marginRight" />
- </xsl:if>
- </xsl:template>
-
- <!-- *************************** -->
- <!-- *** Common XHTML header *** -->
- <!-- *************************** -->
-
- <xsl:template name='xhtml-header-properties'>
- <xsl:param name="globalData" />
-
- <xsl:variable name="netloc">
- <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined">
- <xsl:if test="./@meta:name='ODF.base'">
- <xsl:value-of select="." />
- </xsl:if>
- </xsl:for-each>
- <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined">
- <xsl:if test="./@meta:name='ODF.filename'">
- <xsl:value-of select="." />
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <xsl:variable name="lang">
- <xsl:choose>
- <xsl:when test="$globalData/meta-file/*/office:meta/dc:language">
- <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:language" />
- </xsl:when>
- <xsl:otherwise>en-US</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="prov">
- <xsl:choose>
- <xsl:when test="$globalData/meta-file/*/office:meta/meta:printed-by">
- <xsl:value-of select="concat('Printed by &quot;',$globalData/meta-file/*/office:meta/meta:printed-by,'&quot;[dc:publisher] on &quot;',$globalData/meta-file/*/office:meta/meta:print-date,'&quot;[dc:date] in &quot;',$lang,'&quot;[dc:language]')" />
- </xsl:when>
- <xsl:otherwise />
- </xsl:choose>
- </xsl:variable>
-
- <xsl:variable name="keywords">
- <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:keyword">
- <xsl:value-of select="." />
- <xsl:if test="position() != last()">
- <xsl:text>, </xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
-
- <!-- explicit output content-type for low-tech browser (e.g. IE6) -->
- <xsl:element name="meta">
- <xsl:attribute name="http-equiv">Content-Type</xsl:attribute>
- <xsl:attribute name="content">application/xhtml+xml; charset=utf-8</xsl:attribute>
- </xsl:element>
-
- <!-- title of document for browser frame title -->
- <xsl:element name="title">
- <xsl:attribute name="xml:lang">
- <xsl:value-of select="$lang" />
- </xsl:attribute>
-
- <xsl:choose>
- <xsl:when test="$globalData/meta-file/*/office:meta/dc:title">
- <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:title" />
- </xsl:when>
- <!-- providing the mandatory title is a workaround for an IE bug-->
- <xsl:otherwise>
- <xsl:text>- no title specified</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:element>
-
- <!-- title, in DC syntax -->
- <xsl:element name="meta">
- <xsl:attribute name="name">DCTERMS.title</xsl:attribute>
- <xsl:attribute name="content">
- <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:title" />
- </xsl:attribute>
- <xsl:attribute name="xml:lang">
- <xsl:value-of select="$lang" />
- </xsl:attribute>
- </xsl:element>
-
- <!-- the identifier for source (identifier) -->
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="'DCTERMS.identifier'" />
- <xsl:with-param name="meta-data" select="translate($netloc, ' ','')" />
- <xsl:with-param name="meta-enc" select="'DCTERMS.URI'" />
- </xsl:call-template>
-
- <!-- the language for source (language) -->
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="'DCTERMS.language'" />
- <xsl:with-param name="meta-data" select="$lang" />
- <xsl:with-param name="meta-enc" select="'DCTERMS.RFC4646'" />
- </xsl:call-template>
-
- <!-- a bit commercial (generator) -->
- <xsl:element name="meta">
- <xsl:attribute name="name">DCTERMS.source</xsl:attribute>
- <xsl:attribute name="content">http://xml.openoffice.org/odf2xhtml</xsl:attribute>
- </xsl:element>
-
- <!-- the author of the input source (author) -->
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="'DCTERMS.creator'" />
- <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/meta:initial-creator" />
- </xsl:call-template>
-
- <!-- creation-date of the input source (issued) -->
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="'DCTERMS.issued'" />
- <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/meta:creation-date" />
- <xsl:with-param name="meta-enc" select="'DCTERMS.W3CDTF'" />
- </xsl:call-template>
-
- <!-- name of last changing person of the input source (changedby) -->
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="'DCTERMS.contributor'" />
- <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/dc:creator" />
- </xsl:call-template>
-
- <!-- last changing date of the input source (changed) -->
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="'DCTERMS.modified'" />
- <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/dc:date" />
- <xsl:with-param name="meta-enc" select="'DCTERMS.W3CDTF'" />
- </xsl:call-template>
-
- <!-- Last print, as provenance -->
- <xsl:if test="$prov">
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="'DCTERMS.provenance'" />
- <xsl:with-param name="meta-data" select="$prov" />
- <xsl:with-param name="meta-lang" select="$lang" />
- </xsl:call-template>
- </xsl:if>
-
- <!-- keywords about the input source (keywords) -->
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="'DCTERMS.subject'" />
- <xsl:with-param name="meta-data" select="normalize-space(concat($globalData/meta-file/*/office:meta/dc:subject,', ',$keywords))" />
- <xsl:with-param name="meta-lang" select="$lang" />
- </xsl:call-template>
-
- <!-- detailed description about the input source (description) -->
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="'DCTERMS.description'" />
- <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/dc:description" />
- <xsl:with-param name="meta-lang" select="$lang" />
- </xsl:call-template>
-
-
- <!-- user defined use of DCTERM tags -->
- <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined[starts-with(@meta:name,'DCTERMS.')][not(.='')]">
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="@meta:name" />
- <xsl:with-param name="meta-data" select="." />
- <!-- <xsl:with-param name="meta-lang" select="$lang" /> -->
- </xsl:call-template>
- </xsl:for-each>
- <!-- user defined use of DC tags (legacy) -->
- <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined[starts-with(@meta:name,'DC.')][not(.='')]">
- <xsl:call-template name="add-meta-tag">
- <xsl:with-param name="meta-name" select="@meta:name" />
- <xsl:with-param name="meta-data" select="." />
- <!-- <xsl:with-param name="meta-lang" select="$lang" /> -->
- </xsl:call-template>
- </xsl:for-each>
-
- <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" hreflang="en" />
- <link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" hreflang="en" />
- <link rel="schema.DCTYPE" href="http://purl.org/dc/dcmitype/" hreflang="en" />
- <link rel="schema.DCAM" href="http://purl.org/dc/dcam/" hreflang="en" />
- <!-- W3C GRDDL Profile -->
- <!--
- <link rel="transformation" href="http://xml.openoffice.org/odf2xhtml/rdf-extract.xsl" />
- -->
-
- <!-- base URL of document for resolving relative links
- NOTE: CHROME has a problem, with relative references as from content table, referencing to root directory instead of document
- <xsl:element name="base">
- <xsl:attribute name="href">-->
- <!-- earlier 'targetURL' was used for an absolute reference of base provided by the Office (file URL)
- <xsl:value-of select="$targetURL" />
- now '.' let relative links work, even if document has been moved -->
- <!--<xsl:text>.</xsl:text>
- </xsl:attribute>
- </xsl:element>-->
- </xsl:template>
-
- <!-- generic template for adding common meta tags -->
- <xsl:template name="add-meta-tag">
- <xsl:param name="meta-name" />
- <xsl:param name="meta-data" />
- <xsl:param name="meta-enc" />
- <xsl:param name="meta-lang" />
-
- <xsl:if test="$meta-data">
- <xsl:element name="meta">
- <xsl:attribute name="name">
- <xsl:value-of select="$meta-name" />
- </xsl:attribute>
- <xsl:attribute name="content">
- <xsl:value-of select="$meta-data" />
- </xsl:attribute>
- <xsl:if test="$meta-enc">
- <xsl:attribute name="scheme">
- <xsl:value-of select="$meta-enc" />
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="$meta-lang">
- <xsl:attribute name="xml:lang">
- <xsl:value-of select="$meta-lang" />
- </xsl:attribute>
- </xsl:if>
- </xsl:element>
- </xsl:if>
- </xsl:template>
+ </xsl:text>
+
+ </xsl:template>
+
+
+ <xsl:template name="page-size">
+ <xsl:param name="globalData" />
+ <xsl:param name="pageProperties" />
+
+ <xsl:variable name="printOrientation" select="$pageProperties/@style:print-orientation" />
+ <xsl:variable name="pageWidth" select="$pageProperties/@fo:page-width" />
+ <xsl:variable name="pageHeight" select="$pageProperties/@fo:page-height" />
+ <xsl:choose>
+ <xsl:when test="$pageWidth and $pageHeight">
+ <xsl:text>size: </xsl:text>
+ <xsl:value-of select="$pageWidth" />
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$pageHeight" />
+ <xsl:text>; </xsl:text>
+ </xsl:when>
+ <xsl:when test="$printOrientation">
+ <xsl:text>size: </xsl:text>
+ <xsl:value-of select="$printOrientation" />
+ <xsl:text>; </xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="page-margin">
+ <xsl:param name="globalData" />
+ <xsl:param name="pageProperties" />
+
+ <xsl:variable name="marginTop" select="$pageProperties/@fo:margin-top" />
+ <xsl:if test="$marginTop">
+ <xsl:text>margin-top: </xsl:text>
+ <xsl:value-of select="$marginTop" />
+ <xsl:text>; </xsl:text>
+ </xsl:if>
+ <xsl:variable name="marginBottom" select="$pageProperties/@fo:margin-bottom" />
+ <xsl:if test="$marginBottom">
+ <xsl:text>margin-bottom: </xsl:text>
+ <xsl:value-of select="$marginBottom" />
+ <xsl:text>; </xsl:text>
+ </xsl:if>
+ <xsl:variable name="marginLeft" select="$pageProperties/@fo:margin-left" />
+ <xsl:if test="$marginLeft">
+ <xsl:text>margin-left: </xsl:text>
+ <xsl:value-of select="$marginLeft" />
+ <xsl:text>; </xsl:text>
+ </xsl:if>
+ <xsl:variable name="marginRight" select="$pageProperties/@fo:margin-right" />
+ <xsl:if test="$marginRight">
+ <xsl:text>margin-right: </xsl:text>
+ <xsl:value-of select="$marginRight" />
+ </xsl:if>
+ </xsl:template>
+
+ <!-- *************************** -->
+ <!-- *** Common XHTML header *** -->
+ <!-- *************************** -->
+
+ <xsl:template name='xhtml-header-properties'>
+ <xsl:param name="globalData" />
+
+ <xsl:variable name="netloc">
+ <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined">
+ <xsl:if test="./@meta:name='ODF.base'">
+ <xsl:value-of select="." />
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined">
+ <xsl:if test="./@meta:name='ODF.filename'">
+ <xsl:value-of select="." />
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:variable name="lang">
+ <xsl:choose>
+ <xsl:when test="$globalData/meta-file/*/office:meta/dc:language">
+ <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:language" />
+ </xsl:when>
+ <xsl:otherwise>en-US</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="prov">
+ <xsl:choose>
+ <xsl:when test="$globalData/meta-file/*/office:meta/meta:printed-by">
+ <xsl:value-of select="concat('Printed by &quot;',$globalData/meta-file/*/office:meta/meta:printed-by,'&quot;[dc:publisher] on &quot;',$globalData/meta-file/*/office:meta/meta:print-date,'&quot;[dc:date] in &quot;',$lang,'&quot;[dc:language]')" />
+ </xsl:when>
+ <xsl:otherwise />
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:variable name="keywords">
+ <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:keyword">
+ <xsl:value-of select="." />
+ <xsl:if test="position() != last()">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <!-- explicit output content-type for low-tech browser (e.g. IE6) -->
+ <xsl:element name="meta">
+ <xsl:attribute name="http-equiv">Content-Type</xsl:attribute>
+ <xsl:attribute name="content">application/xhtml+xml; charset=utf-8</xsl:attribute>
+ </xsl:element>
+
+ <!-- title of document for browser frame title -->
+ <xsl:element name="title">
+ <xsl:attribute name="xml:lang">
+ <xsl:value-of select="$lang" />
+ </xsl:attribute>
+
+ <xsl:choose>
+ <xsl:when test="$globalData/meta-file/*/office:meta/dc:title">
+ <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:title" />
+ </xsl:when>
+ <!-- providing the mandatory title is a workaround for an IE bug-->
+ <xsl:otherwise>
+ <xsl:text>- no title specified</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:element>
+
+ <!-- title, in DC syntax -->
+ <xsl:element name="meta">
+ <xsl:attribute name="name">DCTERMS.title</xsl:attribute>
+ <xsl:attribute name="content">
+ <xsl:value-of select="$globalData/meta-file/*/office:meta/dc:title" />
+ </xsl:attribute>
+ <xsl:attribute name="xml:lang">
+ <xsl:value-of select="$lang" />
+ </xsl:attribute>
+ </xsl:element>
+
+ <!-- the identifier for source (identifier) -->
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="'DCTERMS.identifier'" />
+ <xsl:with-param name="meta-data" select="translate($netloc, ' ','')" />
+ <xsl:with-param name="meta-enc" select="'DCTERMS.URI'" />
+ </xsl:call-template>
+
+ <!-- the language for source (language) -->
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="'DCTERMS.language'" />
+ <xsl:with-param name="meta-data" select="$lang" />
+ <xsl:with-param name="meta-enc" select="'DCTERMS.RFC4646'" />
+ </xsl:call-template>
+
+ <!-- a bit commercial (generator) -->
+ <xsl:element name="meta">
+ <xsl:attribute name="name">DCTERMS.source</xsl:attribute>
+ <xsl:attribute name="content">http://xml.openoffice.org/odf2xhtml</xsl:attribute>
+ </xsl:element>
+
+ <!-- the author of the input source (author) -->
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="'DCTERMS.creator'" />
+ <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/meta:initial-creator" />
+ </xsl:call-template>
+
+ <!-- creation-date of the input source (issued) -->
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="'DCTERMS.issued'" />
+ <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/meta:creation-date" />
+ <xsl:with-param name="meta-enc" select="'DCTERMS.W3CDTF'" />
+ </xsl:call-template>
+
+ <!-- name of last changing person of the input source (changedby) -->
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="'DCTERMS.contributor'" />
+ <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/dc:creator" />
+ </xsl:call-template>
+
+ <!-- last changing date of the input source (changed) -->
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="'DCTERMS.modified'" />
+ <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/dc:date" />
+ <xsl:with-param name="meta-enc" select="'DCTERMS.W3CDTF'" />
+ </xsl:call-template>
+
+ <!-- Last print, as provenance -->
+ <xsl:if test="$prov">
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="'DCTERMS.provenance'" />
+ <xsl:with-param name="meta-data" select="$prov" />
+ <xsl:with-param name="meta-lang" select="$lang" />
+ </xsl:call-template>
+ </xsl:if>
+
+ <!-- keywords about the input source (keywords) -->
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="'DCTERMS.subject'" />
+ <xsl:with-param name="meta-data" select="normalize-space(concat($globalData/meta-file/*/office:meta/dc:subject,', ',$keywords))" />
+ <xsl:with-param name="meta-lang" select="$lang" />
+ </xsl:call-template>
+
+ <!-- detailed description about the input source (description) -->
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="'DCTERMS.description'" />
+ <xsl:with-param name="meta-data" select="$globalData/meta-file/*/office:meta/dc:description" />
+ <xsl:with-param name="meta-lang" select="$lang" />
+ </xsl:call-template>
+
+
+ <!-- user defined use of DCTERM tags -->
+ <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined[starts-with(@meta:name,'DCTERMS.')][not(.='')]">
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="@meta:name" />
+ <xsl:with-param name="meta-data" select="." />
+ <!-- <xsl:with-param name="meta-lang" select="$lang" /> -->
+ </xsl:call-template>
+ </xsl:for-each>
+ <!-- user defined use of DC tags (legacy) -->
+ <xsl:for-each select="$globalData/meta-file/*/office:meta/meta:user-defined[starts-with(@meta:name,'DC.')][not(.='')]">
+ <xsl:call-template name="add-meta-tag">
+ <xsl:with-param name="meta-name" select="@meta:name" />
+ <xsl:with-param name="meta-data" select="." />
+ <!-- <xsl:with-param name="meta-lang" select="$lang" /> -->
+ </xsl:call-template>
+ </xsl:for-each>
+
+ <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" hreflang="en" />
+ <link rel="schema.DCTERMS" href="http://purl.org/dc/terms/" hreflang="en" />
+ <link rel="schema.DCTYPE" href="http://purl.org/dc/dcmitype/" hreflang="en" />
+ <link rel="schema.DCAM" href="http://purl.org/dc/dcam/" hreflang="en" />
+ <!-- W3C GRDDL Profile -->
+ <!--
+ <link rel="transformation" href="http://xml.openoffice.org/odf2xhtml/rdf-extract.xsl" />
+ -->
+
+ <!-- base URL of document for resolving relative links
+ NOTE: CHROME has a problem, with relative references as from content table, referencing to root directory instead of document
+ <xsl:element name="base">
+ <xsl:attribute name="href">-->
+ <!-- earlier 'targetURL' was used for an absolute reference of base provided by the Office (file URL)
+ <xsl:value-of select="$targetURL" />
+ now '.' let relative links work, even if document has been moved -->
+ <!--<xsl:text>.</xsl:text>
+ </xsl:attribute>
+ </xsl:element>-->
+ </xsl:template>
+
+ <!-- generic template for adding common meta tags -->
+ <xsl:template name="add-meta-tag">
+ <xsl:param name="meta-name" />
+ <xsl:param name="meta-data" />
+ <xsl:param name="meta-enc" />
+ <xsl:param name="meta-lang" />
+
+ <xsl:if test="$meta-data">
+ <xsl:element name="meta">
+ <xsl:attribute name="name">
+ <xsl:value-of select="$meta-name" />
+ </xsl:attribute>
+ <xsl:attribute name="content">
+ <xsl:value-of select="$meta-data" />
+ </xsl:attribute>
+ <xsl:if test="$meta-enc">
+ <xsl:attribute name="scheme">
+ <xsl:value-of select="$meta-enc" />
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="$meta-lang">
+ <xsl:attribute name="xml:lang">
+ <xsl:value-of select="$meta-lang" />
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:element>
+ </xsl:if>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl
index 2fa20efbf7cf..26952c24ddc6 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/opendoc2xhtml.xsl
@@ -17,158 +17,158 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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">
-
-
- <!--+++++ 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" />
-
- <!-- 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 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:variable name="namespace" select="'http://www.w3.org/1999/xhtml'" />
-
- <!--+++++ 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: (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 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 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 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 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 havt to log again in for every graphic he liks 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="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: 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)" />
-
- <!-- ************************************* -->
- <!-- *** build the propriate 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" />
-
- <xsl:element name="html">
- <xsl:comment>This file was converted to xhtml by LibreOffice - see http://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>
-
-
- <!-- 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>
+ 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 +++++-->
+
+ <!-- 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" />
+
+ <!-- office header element handling especially for XHTML -->
+ <xsl:include href="header.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:variable name="namespace" select="'http://www.w3.org/1999/xhtml'" />
+
+ <!--+++++ 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: (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 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 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 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 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 havt to log again in for every graphic he liks 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="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: 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)" />
+
+ <!-- ************************************* -->
+ <!-- *** build the propriate 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" />
+
+ <xsl:element name="html">
+ <xsl:comment>This file was converted to xhtml by LibreOffice - see http://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>
+
+
+ <!-- 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>
diff --git a/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl b/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl
index 533017c17be1..91c6393516a1 100644
--- a/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl
+++ b/filter/source/xslt/odf2xhtml/export/xhtml/table.xsl
@@ -17,197 +17,197 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<!--
- For further documentation and updates visit http://xml.openoffice.org/odf2xhtml
+ 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">
-
-
-
- <!-- 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: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" />
-
- <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>
-
-
- <!-- *** 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:
-
- 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>
-
- <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 (&nbsp;/&#160;) 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>&#160;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
-
- </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 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" />
-
- <!-- 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>
-
- <!-- cell style header -->
- <xsl:attribute name="class">
- <xsl:value-of select="translate($styleName, '.,;: %()[]/\+', '_____________')"/>
- </xsl:attribute>
- </xsl:template>
+ 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" />
+
+ <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>
+
+
+
+ <!-- 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}">
+
+ <!-- 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 depends on two attributes:
+
+ 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>
+
+ <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 (&nbsp;/&#160;) 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>&#160;</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </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 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" />
+
+ <!-- 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>
+
+ <!-- cell style header -->
+ <xsl:attribute name="class">
+ <xsl:value-of select="translate($styleName, '.,;: %()[]/\+', '_____________')"/>
+ </xsl:attribute>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/officecfg/util/alllang.xsl b/officecfg/util/alllang.xsl
index f5d9ae103fc5..b9b2d1983551 100644
--- a/officecfg/util/alllang.xsl
+++ b/officecfg/util/alllang.xsl
@@ -17,12 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
-<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:oor="http://openoffice.org/2001/registry"
- xmlns:install="http://openoffice.org/2004/installation"
- exclude-result-prefixes="install">
+<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:oor="http://openoffice.org/2001/registry"
+ xmlns:install="http://openoffice.org/2004/installation"
+ exclude-result-prefixes="install">
<!-- Get the correct format -->
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
@@ -46,106 +46,106 @@
<!--************************** TEMPLATES ******************************** -->
<!-- ensure that at least root is available -->
- <xsl:template match="/oor:component-data">
- <xsl:copy>
- <xsl:choose>
- <xsl:when test="string-length($locale)">
- <xsl:apply-templates select = "@*" mode="locale"/>
- <xsl:apply-templates select = "node|prop" mode="locale"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select = "@*"/>
- <xsl:for-each select="node|prop">
- <xsl:variable name="component-schema" select="document($schemaURL)/oor:component-schema"/>
- <xsl:apply-templates select=".">
- <xsl:with-param name="component-schema" select="$component-schema"/>
- <xsl:with-param name="context" select="$component-schema/component/*[@oor:name = current()/@oor:name]"/>
- <xsl:with-param name="find-module" select="$module"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:copy>
- </xsl:template>
+ <xsl:template match="/oor:component-data">
+ <xsl:copy>
+ <xsl:choose>
+ <xsl:when test="string-length($locale)">
+ <xsl:apply-templates select = "@*" mode="locale"/>
+ <xsl:apply-templates select = "node|prop" mode="locale"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select = "@*"/>
+ <xsl:for-each select="node|prop">
+ <xsl:variable name="component-schema" select="document($schemaURL)/oor:component-schema"/>
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="component-schema" select="$component-schema"/>
+ <xsl:with-param name="context" select="$component-schema/component/*[@oor:name = current()/@oor:name]"/>
+ <xsl:with-param name="find-module" select="$module"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:copy>
+ </xsl:template>
<!-- locale dependent data -->
- <xsl:template match="node|prop" mode = "locale">
+ <xsl:template match="node|prop" mode = "locale">
<xsl:choose>
<xsl:when test="$locale=$fallback-locale">
<xsl:if test="descendant::value[@xml:lang=$locale]/../value[not (@xml:lang)]">
- <xsl:copy>
- <xsl:apply-templates select = "@*" mode="locale"/>
- <xsl:apply-templates select = "node|prop|value" mode = "locale"/>
- </xsl:copy>
+ <xsl:copy>
+ <xsl:apply-templates select = "@*" mode="locale"/>
+ <xsl:apply-templates select = "node|prop|value" mode = "locale"/>
+ </xsl:copy>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:if test="descendant::value[@xml:lang = $locale]">
- <xsl:copy>
- <xsl:apply-templates select = "@*" mode="locale"/>
- <xsl:apply-templates select = "node|prop|value" mode = "locale"/>
- </xsl:copy>
+ <xsl:copy>
+ <xsl:apply-templates select = "@*" mode="locale"/>
+ <xsl:apply-templates select = "node|prop|value" mode = "locale"/>
+ </xsl:copy>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
- </xsl:template>
+ </xsl:template>
- <xsl:template match="value" mode="locale">
- <xsl:if test="@xml:lang=$locale and not(@install:module)">
- <xsl:copy>
- <xsl:apply-templates select = "@*" mode="locale"/>
- <xsl:apply-templates select="node()"/>
- </xsl:copy>
- </xsl:if>
- </xsl:template>
+ <xsl:template match="value" mode="locale">
+ <xsl:if test="@xml:lang=$locale and not(@install:module)">
+ <xsl:copy>
+ <xsl:apply-templates select = "@*" mode="locale"/>
+ <xsl:apply-templates select="node()"/>
+ </xsl:copy>
+ </xsl:if>
+ </xsl:template>
- <xsl:template match = "@*" mode="locale">
- <xsl:copy/>
- </xsl:template>
+ <xsl:template match = "@*" mode="locale">
+ <xsl:copy/>
+ </xsl:template>
<!-- suppress all merge instructions -->
- <xsl:template match = "@oor:op" mode="locale"/>
+ <xsl:template match = "@oor:op" mode="locale"/>
<!-- suppress all module markers -->
- <xsl:template match = "@install:module" mode="locale"/>
+ <xsl:template match = "@install:module" mode="locale"/>
<!-- locale independent data -->
<!-- handle template references -->
- <xsl:template name="copy-resolve-template">
- <xsl:param name = "node-type"/>
- <xsl:param name = "schema-type"/>
- <xsl:param name = "component-schema"/>
-
+ <xsl:template name="copy-resolve-template">
+ <xsl:param name = "node-type"/>
+ <xsl:param name = "schema-type"/>
+ <xsl:param name = "component-schema"/>
+
<xsl:choose>
<xsl:when test="$schema-type='node-ref'">
- <xsl:apply-templates select=".">
- <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
- <xsl:with-param name="component-schema" select="$component-schema"/>
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
+ <xsl:with-param name="component-schema" select="$component-schema"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$schema-type='set'">
<xsl:copy>
<xsl:apply-templates select = "@*" />
- <xsl:for-each select="node|prop">
- <xsl:apply-templates select=".">
- <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
- <xsl:with-param name="component-schema" select="$component-schema"/>
+ <xsl:for-each select="node|prop">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
+ <xsl:with-param name="component-schema" select="$component-schema"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:copy>
</xsl:when>
<xsl:otherwise>
- <xsl:message terminate="yes">ERROR: The schema element for a <xsl:value-of select="$schema-type"/>
+ <xsl:message terminate="yes">ERROR: The schema element for a <xsl:value-of select="$schema-type"/>
should not have a node-type.
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-
- <xsl:template name="copy-node">
- <xsl:param name = "context"/>
- <xsl:param name = "component-schema"/>
+
+ <xsl:template name="copy-node">
+ <xsl:param name = "context"/>
+ <xsl:param name = "component-schema"/>
<xsl:choose>
<!-- look for matching templates in other components -->
@@ -182,11 +182,11 @@
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
- </xsl:template>
-
- <xsl:template match="node">
- <xsl:param name = "context"/>
- <xsl:param name = "component-schema"/>
+ </xsl:template>
+
+ <xsl:template match="node">
+ <xsl:param name = "context"/>
+ <xsl:param name = "component-schema"/>
<xsl:variable name="applicable-values" select="descendant::value[not (@xml:lang) or (@xml:lang=$fallback-locale) or (@install:module=$module)]"/>
<xsl:variable name="substantive-nodes" select="descendant-or-self::*[(@oor:finalized='true') or (@oor:mandatory='true') or (@oor:op!='modify')]"/>
@@ -200,7 +200,7 @@
<xsl:with-param name="context" select="$context"/>
</xsl:call-template>
</xsl:if>
- </xsl:when>
+ </xsl:when>
<!-- strip data from wrong module -->
<xsl:when test="ancestor-or-self::*/@install:module"/>
<!-- looking for module -->
@@ -211,7 +211,7 @@
<xsl:with-param name="context" select="$context"/>
</xsl:call-template>
</xsl:if>
- </xsl:when>
+ </xsl:when>
<!-- copying non-module data -->
<xsl:otherwise>
<xsl:if test="($applicable-values | $substantive-nodes)[not(ancestor-or-self::*/@install:module)]">
@@ -221,21 +221,21 @@
</xsl:call-template>
</xsl:if>
</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template match="prop">
- <xsl:param name = "context"/>
- <xsl:choose>
+ <xsl:template match="prop">
+ <xsl:param name = "context"/>
+ <xsl:choose>
<xsl:when test="$module and not((ancestor-or-self::* | child::value)/@install:module=$module)"/>
<xsl:when test="not($module) and ancestor-or-self::*/@install:module"/>
- <xsl:when test="not ($context) or @oor:finalized='true' or @oor:op!='modify'">
- <xsl:copy>
- <xsl:apply-templates select = "@*"/>
- <xsl:apply-templates select = "value"/>
- </xsl:copy>
- </xsl:when>
- <xsl:when test="value[not (@xml:lang) or @install:module]">
+ <xsl:when test="not ($context) or @oor:finalized='true' or @oor:op!='modify'">
+ <xsl:copy>
+ <xsl:apply-templates select = "@*"/>
+ <xsl:apply-templates select = "value"/>
+ </xsl:copy>
+ </xsl:when>
+ <xsl:when test="value[not (@xml:lang) or @install:module]">
<xsl:if test="value[not(@install:module) or @install:module=$module]">
<!-- copy locale independent values only, if the values differ -->
<xsl:variable name="isRedundant">
@@ -250,19 +250,19 @@
<xsl:apply-templates select = "value"/>
</xsl:copy>
</xsl:if>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:copy>
- <xsl:apply-templates select = "@*"/>
- <xsl:apply-templates select = "value" mode="fallback-locale"/>
- </xsl:copy>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="value">
- <xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy>
+ <xsl:apply-templates select = "@*"/>
+ <xsl:apply-templates select = "value" mode="fallback-locale"/>
+ </xsl:copy>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="value">
+ <xsl:choose>
<xsl:when test="@xml:lang and not(@install:module)"/>
<xsl:when test="$module and not(ancestor-or-self::*/@install:module=$module)"/>
<xsl:when test="not($module) and ancestor-or-self::*/@install:module"/>
@@ -271,16 +271,16 @@
<xsl:apply-templates select = "@*|node()"/>
</xsl:copy>
</xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ </xsl:choose>
+ </xsl:template>
- <xsl:template match="value" mode="fallback-locale">
- <xsl:if test="@xml:lang=$fallback-locale and not(@install:module)">
+ <xsl:template match="value" mode="fallback-locale">
+ <xsl:if test="@xml:lang=$fallback-locale and not(@install:module)">
<xsl:copy>
<xsl:apply-templates select = "@*|node()"/>
</xsl:copy>
- </xsl:if>
- </xsl:template>
+ </xsl:if>
+ </xsl:template>
<xsl:template match ="it|unicode">
<xsl:copy>
@@ -288,57 +288,57 @@
</xsl:copy>
</xsl:template>
- <xsl:template match = "@*">
- <xsl:copy/>
- </xsl:template>
+ <xsl:template match = "@*">
+ <xsl:copy/>
+ </xsl:template>
<!-- suppress all merge instructions, that are out-of-module -->
- <xsl:template match = "@oor:op">
+ <xsl:template match = "@oor:op">
<xsl:if test="not($module) or ancestor::*/@install:module">
<xsl:copy/>
- </xsl:if>
- </xsl:template>
+ </xsl:if>
+ </xsl:template>
<!-- suppress all module markers -->
- <xsl:template match = "@install:module"/>
+ <xsl:template match = "@install:module"/>
<!-- compares two values -->
- <xsl:template name="isRedundant">
- <xsl:param name = "schemaval"/>
- <xsl:param name = "dataval"/>
- <xsl:choose>
- <xsl:when test="not ($dataval)">
- <xsl:value-of select="true()"/>
- </xsl:when>
+ <xsl:template name="isRedundant">
+ <xsl:param name = "schemaval"/>
+ <xsl:param name = "dataval"/>
+ <xsl:choose>
+ <xsl:when test="not ($dataval)">
+ <xsl:value-of select="true()"/>
+ </xsl:when>
<xsl:when test="$dataval/@oor:external">
<xsl:value-of select="false()"/>
</xsl:when>
- <xsl:when test="not ($schemaval)">
- <xsl:choose>
- <xsl:when test="$dataval/@xsi:nil='true'">
- <xsl:value-of select="true()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="false()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="$schemaval != $dataval">
- <xsl:value-of select="false()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="true()"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="composeFileURL">
- <xsl:param name="componentName"/>
- <xsl:variable name="fileURL">
- <xsl:value-of select="$schemaRootURL"/>/<xsl:value-of select="translate($componentName,'.','/')"/><xsl:text>.xcs</xsl:text>
- </xsl:variable>
- <xsl:value-of select="$fileURL"/>
- </xsl:template>
+ <xsl:when test="not ($schemaval)">
+ <xsl:choose>
+ <xsl:when test="$dataval/@xsi:nil='true'">
+ <xsl:value-of select="true()"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="false()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="$schemaval != $dataval">
+ <xsl:value-of select="false()"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="true()"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="composeFileURL">
+ <xsl:param name="componentName"/>
+ <xsl:variable name="fileURL">
+ <xsl:value-of select="$schemaRootURL"/>/<xsl:value-of select="translate($componentName,'.','/')"/><xsl:text>.xcs</xsl:text>
+ </xsl:variable>
+ <xsl:value-of select="$fileURL"/>
+ </xsl:template>
<xsl:template match="@oor:name">
<xsl:attribute name="oor:name">
@@ -391,12 +391,12 @@
<xsl:param name="replace2"/>
<xsl:choose>
<xsl:when test="contains($input, $pattern1)">
- <xsl:call-template name="replace">
- <xsl:with-param
- name="input" select="substring-before($input, $pattern1)"/>
- <xsl:with-param name="pattern" select="$pattern2"/>
- <xsl:with-param name="replace" select="$replace2"/>
- </xsl:call-template>
+ <xsl:call-template name="replace">
+ <xsl:with-param
+ name="input" select="substring-before($input, $pattern1)"/>
+ <xsl:with-param name="pattern" select="$pattern2"/>
+ <xsl:with-param name="replace" select="$replace2"/>
+ </xsl:call-template>
<xsl:value-of select="$replace1"/>
<xsl:call-template name="replacetwo">
<xsl:with-param
@@ -408,12 +408,12 @@
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
- <xsl:call-template name="replace">
- <xsl:with-param
- name="input" select="$input"/>
- <xsl:with-param name="pattern" select="$pattern2"/>
- <xsl:with-param name="replace" select="$replace2"/>
- </xsl:call-template>
+ <xsl:call-template name="replace">
+ <xsl:with-param
+ name="input" select="$input"/>
+ <xsl:with-param name="pattern" select="$pattern2"/>
+ <xsl:with-param name="replace" select="$replace2"/>
+ </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
diff --git a/officecfg/util/data_val.xsl b/officecfg/util/data_val.xsl
index a6726c1772a2..abe7eb30090c 100644
--- a/officecfg/util/data_val.xsl
+++ b/officecfg/util/data_val.xsl
@@ -18,13 +18,13 @@
-->
<!-- ************************************************************************************** -->
-<!-- * Transformation from New Format XCS & XCU to schema description *** -->
+<!-- * Transformation from New Format XCS & XCU to schema description *** -->
<!-- ************************************************************************************** -->
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:oor="http://openoffice.org/2001/registry"
- xmlns:install="http://openoffice.org/2004/installation">
+ xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:oor="http://openoffice.org/2001/registry"
+ xmlns:install="http://openoffice.org/2004/installation">
<!-- Get the correct format -->
<xsl:output method="xml" indent="yes" />
@@ -40,48 +40,48 @@
</xsl:variable>
<!-- ************************************** -->
-<!-- * oor:component-data *** -->
+<!-- * oor:component-data *** -->
<!-- ************************************** -->
- <xsl:template match="/oor:component-data">
+ <xsl:template match="/oor:component-data">
<xsl:variable name="component-schema" select="document($schemaURL)/oor:component-schema"/>
- <xsl:for-each select="node|prop">
- <xsl:apply-templates select=".">
- <xsl:with-param name="context" select="$component-schema/component/*[@oor:name = current()/@oor:name]"/>
- <xsl:with-param name="component-schema" select="$component-schema"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
+ <xsl:for-each select="node|prop">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="context" select="$component-schema/component/*[@oor:name = current()/@oor:name]"/>
+ <xsl:with-param name="component-schema" select="$component-schema"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ </xsl:template>
<!-- ****************************************** -->
<!-- * handle template references *** -->
<!-- ****************************************** -->
- <xsl:template name="resolve-template">
- <xsl:param name = "node-type"/>
- <xsl:param name = "schema-type"/>
- <xsl:param name = "component-schema"/>
- <xsl:variable name = "path">
- <xsl:call-template name="collectPath"/>
- </xsl:variable>
-
- <xsl:if test="not ($component-schema)">
- <xsl:message terminate="yes">ERROR: Template '<xsl:value-of select="$node-type"/>',
- referenced from node '<xsl:value-of select="$path"/>'
+ <xsl:template name="resolve-template">
+ <xsl:param name = "node-type"/>
+ <xsl:param name = "schema-type"/>
+ <xsl:param name = "component-schema"/>
+ <xsl:variable name = "path">
+ <xsl:call-template name="collectPath"/>
+ </xsl:variable>
+
+ <xsl:if test="not ($component-schema)">
+ <xsl:message terminate="yes">ERROR: Template '<xsl:value-of select="$node-type"/>',
+ referenced from node '<xsl:value-of select="$path"/>'
does not exist in schema!
</xsl:message>
- </xsl:if>
+ </xsl:if>
<xsl:choose>
<xsl:when test="$schema-type='node-ref'">
- <xsl:apply-templates select=".">
- <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
- <xsl:with-param name="component-schema" select="$component-schema"/>
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
+ <xsl:with-param name="component-schema" select="$component-schema"/>
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$schema-type='set'">
- <xsl:for-each select="node|prop">
- <xsl:apply-templates select=".">
- <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
- <xsl:with-param name="component-schema" select="$component-schema"/>
+ <xsl:for-each select="node|prop">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="context" select="$component-schema/templates/*[@oor:name = $node-type]"/>
+ <xsl:with-param name="component-schema" select="$component-schema"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:when>
@@ -92,95 +92,95 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-
+
<!-- ****************************************** -->
-<!-- * node *** -->
+<!-- * node *** -->
<!-- ****************************************** -->
- <xsl:template match="node">
- <xsl:param name = "context"/>
- <xsl:param name = "component-schema"/>
- <xsl:variable name = "path">
- <xsl:call-template name="collectPath"/>
- </xsl:variable>
-
- <xsl:if test="not ($context)">
- <xsl:message terminate="yes">ERROR: Node '<xsl:value-of select="$path"/>' does not exist in schema!</xsl:message>
- </xsl:if>
+ <xsl:template match="node">
+ <xsl:param name = "context"/>
+ <xsl:param name = "component-schema"/>
+ <xsl:variable name = "path">
+ <xsl:call-template name="collectPath"/>
+ </xsl:variable>
+
+ <xsl:if test="not ($context)">
+ <xsl:message terminate="yes">ERROR: Node '<xsl:value-of select="$path"/>' does not exist in schema!</xsl:message>
+ </xsl:if>
<xsl:call-template name="checkModule"/>
<xsl:call-template name="checkDuplicates"/>
- <xsl:choose>
- <!-- look for matching templates in other components -->
- <xsl:when test="$context/@oor:node-type and $context/@oor:component">
- <xsl:variable name="fileURL">
- <xsl:call-template name="composeFileURL">
- <xsl:with-param name="componentName"><xsl:value-of select="$context/@oor:component"/></xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
+ <xsl:choose>
+ <!-- look for matching templates in other components -->
+ <xsl:when test="$context/@oor:node-type and $context/@oor:component">
+ <xsl:variable name="fileURL">
+ <xsl:call-template name="composeFileURL">
+ <xsl:with-param name="componentName"><xsl:value-of select="$context/@oor:component"/></xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable>
<xsl:call-template name="resolve-template">
<xsl:with-param name="node-type" select="$context/@oor:node-type"/>
<xsl:with-param name="schema-type" select="local-name($context)"/>
<xsl:with-param name="component-schema" select="document($fileURL)/oor:component-schema"/>
</xsl:call-template>
- </xsl:when>
- <!-- look for matching templates within the same component -->
- <xsl:when test="$context/@oor:node-type">
+ </xsl:when>
+ <!-- look for matching templates within the same component -->
+ <xsl:when test="$context/@oor:node-type">
<xsl:call-template name="resolve-template">
<xsl:with-param name="node-type" select="$context/@oor:node-type"/>
<xsl:with-param name="schema-type" select="local-name($context)"/>
<xsl:with-param name="component-schema" select="$component-schema"/>
</xsl:call-template>
- </xsl:when>
- <!-- is the node extensible ? -->
- <xsl:when test="$context/@oor:extensible='true'">
- <xsl:for-each select="node|prop">
- <xsl:apply-templates select="." mode="extensible">
- <xsl:with-param name="context" select="$context/*[@oor:name = current()/@oor:name]"/>
- <xsl:with-param name="component-schema" select="$component-schema"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="node|prop">
- <xsl:apply-templates select=".">
- <xsl:with-param name="context" select="$context/*[@oor:name = current()/@oor:name]"/>
- <xsl:with-param name="component-schema" select="$component-schema"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
+ </xsl:when>
+ <!-- is the node extensible ? -->
+ <xsl:when test="$context/@oor:extensible='true'">
+ <xsl:for-each select="node|prop">
+ <xsl:apply-templates select="." mode="extensible">
+ <xsl:with-param name="context" select="$context/*[@oor:name = current()/@oor:name]"/>
+ <xsl:with-param name="component-schema" select="$component-schema"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:for-each select="node|prop">
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="context" select="$context/*[@oor:name = current()/@oor:name]"/>
+ <xsl:with-param name="component-schema" select="$component-schema"/>
+ </xsl:apply-templates>
+ </xsl:for-each>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
<!-- ****************************************** -->
-<!-- * prop *** -->
+<!-- * prop *** -->
<!-- ****************************************** -->
- <xsl:template match="prop">
- <xsl:param name = "context"/>
- <xsl:variable name = "path">
- <xsl:call-template name="collectPath"/>
- </xsl:variable>
-
+ <xsl:template match="prop">
+ <xsl:param name = "context"/>
+ <xsl:variable name = "path">
+ <xsl:call-template name="collectPath"/>
+ </xsl:variable>
+
- <xsl:if test="not ($context)">
- <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' does not exist in schema !</xsl:message>
- </xsl:if>
+ <xsl:if test="not ($context)">
+ <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' does not exist in schema !</xsl:message>
+ </xsl:if>
- <xsl:if test="@oor:op">
- <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has unexpected operation '<xsl:value-of select="@oor:op"/>' !</xsl:message>
- </xsl:if>
+ <xsl:if test="@oor:op">
+ <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has unexpected operation '<xsl:value-of select="@oor:op"/>' !</xsl:message>
+ </xsl:if>
<xsl:call-template name="checkModule"/>
<xsl:call-template name="checkDuplicates"/>
-
- <xsl:apply-templates />
- </xsl:template>
+
+ <xsl:apply-templates />
+ </xsl:template>
<!-- ****************************************** -->
-<!-- * value *** -->
+<!-- * value *** -->
<!-- ****************************************** -->
- <xsl:template match="value">
+ <xsl:template match="value">
<xsl:call-template name="checkModule"/>
<xsl:variable name="path">
<xsl:call-template name="collectPath"/>
@@ -200,94 +200,94 @@
<xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has values with matching xml:lang attribute <xsl:value-of select="$lang"/> and inconsistent install:module attributes.</xsl:message>
</xsl:when>
</xsl:choose>
- </xsl:template>
+ </xsl:template>
<!-- ****************************************** -->
<!-- * node (mode:extensible) - not supported * -->
<!-- ****************************************** -->
- <xsl:template match="node" mode="extensible">
- <xsl:variable name = "path">
- <xsl:call-template name="collectPath"/>
- </xsl:variable>
+ <xsl:template match="node" mode="extensible">
+ <xsl:variable name = "path">
+ <xsl:call-template name="collectPath"/>
+ </xsl:variable>
<xsl:message terminate="yes">ERROR: Node '<xsl:value-of select="$path"/>' is within an extensible node!</xsl:message>
</xsl:template>
<!-- ****************************************** -->
-<!-- * prop (mode:extensible) *** -->
+<!-- * prop (mode:extensible) *** -->
<!-- ****************************************** -->
- <xsl:template match="prop" mode="extensible">
- <xsl:param name = "context"/>
- <xsl:variable name = "path">
- <xsl:call-template name="collectPath"/>
- </xsl:variable>
+ <xsl:template match="prop" mode="extensible">
+ <xsl:param name = "context"/>
+ <xsl:variable name = "path">
+ <xsl:call-template name="collectPath"/>
+ </xsl:variable>
<xsl:choose>
<xsl:when test="not(@oor:op)">
- <xsl:if test="not ($context)">
- <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' does not exist in schema!</xsl:message>
- </xsl:if>
- </xsl:when>
+ <xsl:if test="not ($context)">
+ <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' does not exist in schema!</xsl:message>
+ </xsl:if>
+ </xsl:when>
<xsl:when test="@oor:op='replace'">
- <xsl:if test="not (@oor:type)">
- <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' does not have a type!</xsl:message>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has unexpected operation '<xsl:value-of select="@oor:op"/>'!</xsl:message>
- </xsl:otherwise>
+ <xsl:if test="not (@oor:type)">
+ <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' does not have a type!</xsl:message>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:message terminate="yes">ERROR: Property '<xsl:value-of select="$path"/>' has unexpected operation '<xsl:value-of select="@oor:op"/>'!</xsl:message>
+ </xsl:otherwise>
</xsl:choose>
<xsl:call-template name="checkModule"/>
<xsl:call-template name="checkDuplicates"/>
- </xsl:template>
+ </xsl:template>
<!-- ************************************* -->
-<!-- * checkDuplicates *** -->
+<!-- * checkDuplicates *** -->
<!-- ************************************* -->
- <xsl:template name="checkDuplicates">
+ <xsl:template name="checkDuplicates">
<xsl:variable name="item-name" select="@oor:name"/>
- <xsl:if test="following-sibling::*[@oor:name = $item-name]">
+ <xsl:if test="following-sibling::*[@oor:name = $item-name]">
<xsl:variable name = "path">
<xsl:call-template name="collectPath"/>
</xsl:variable>
- <xsl:message terminate="yes">ERROR: Duplicate node/prop '<xsl:value-of select="$path"/>'!</xsl:message>
- </xsl:if>
- </xsl:template>
+ <xsl:message terminate="yes">ERROR: Duplicate node/prop '<xsl:value-of select="$path"/>'!</xsl:message>
+ </xsl:if>
+ </xsl:template>
<!-- ************************************* -->
-<!-- * checkModule *** -->
+<!-- * checkModule *** -->
<!-- ************************************* -->
- <xsl:template name="checkModule">
- <xsl:if test="@install:module">
+ <xsl:template name="checkModule">
+ <xsl:if test="@install:module">
<xsl:if test="ancestor::*[@install:module]">
<xsl:message terminate="yes">ERROR: Nested modules are not supported. Found module '<xsl:value-of select="@install:module"/>' within module '<xsl:value-of select="ancestor::*/@install:module"/>'!
</xsl:message>
- </xsl:if>
- </xsl:if>
- </xsl:template>
+ </xsl:if>
+ </xsl:if>
+ </xsl:template>
<!-- ************************************* -->
-<!-- * collectPath *** -->
+<!-- * collectPath *** -->
<!-- ************************************* -->
- <xsl:template name="collectPath">
- <xsl:for-each select="ancestor-or-self::node()[@oor:name]">
- <xsl:text>/</xsl:text><xsl:value-of select="@oor:name"/>
- </xsl:for-each>
- </xsl:template>
+ <xsl:template name="collectPath">
+ <xsl:for-each select="ancestor-or-self::node()[@oor:name]">
+ <xsl:text>/</xsl:text><xsl:value-of select="@oor:name"/>
+ </xsl:for-each>
+ </xsl:template>
<!-- ****************************** -->
-<!-- * composeFileURL *** -->
+<!-- * composeFileURL *** -->
<!-- ****************************** -->
- <xsl:template name="composeFileURL">
- <xsl:param name="componentName"/>
- <xsl:variable name="fileURL">
- <xsl:value-of select="$schemaRootURL"/>/<xsl:value-of select="translate($componentName,'.','/')"/><xsl:text>.xcs</xsl:text>
- </xsl:variable>
- <xsl:value-of select="$fileURL"/>
- </xsl:template>
+ <xsl:template name="composeFileURL">
+ <xsl:param name="componentName"/>
+ <xsl:variable name="fileURL">
+ <xsl:value-of select="$schemaRootURL"/>/<xsl:value-of select="translate($componentName,'.','/')"/><xsl:text>.xcs</xsl:text>
+ </xsl:variable>
+ <xsl:value-of select="$fileURL"/>
+ </xsl:template>
</xsl:transform>
diff --git a/officecfg/util/resource.xsl b/officecfg/util/resource.xsl
index d3b44ae679d3..a0119b146cf7 100644
--- a/officecfg/util/resource.xsl
+++ b/officecfg/util/resource.xsl
@@ -18,10 +18,10 @@
-->
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:oor="http://openoffice.org/2001/registry"
- version="1.0">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:oor="http://openoffice.org/2001/registry"
+ version="1.0">
<!-- Set correct output format -->
<xsl:output method="text" indent="no" encoding="UTF-8"/>
diff --git a/officecfg/util/sanity.xsl b/officecfg/util/sanity.xsl
index ea923ed8af86..a02ba25c2972 100755..100644
--- a/officecfg/util/sanity.xsl
+++ b/officecfg/util/sanity.xsl
@@ -17,10 +17,10 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:oor="http://openoffice.org/2001/registry"
- version="1.0">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:oor="http://openoffice.org/2001/registry"
+ version="1.0">
<xsl:output method="text" indent="no" encoding="ISO-8859-1"/>
diff --git a/officecfg/util/schema_trim.xsl b/officecfg/util/schema_trim.xsl
index 4ebac1c5b733..f67d89194a51 100644
--- a/officecfg/util/schema_trim.xsl
+++ b/officecfg/util/schema_trim.xsl
@@ -18,62 +18,62 @@
-->
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:oor="http://openoffice.org/2001/registry"
- version="1.0">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:oor="http://openoffice.org/2001/registry"
+ version="1.0">
<xsl:param name="LIBO_SHARE_FOLDER"/>
<xsl:param name="LIBO_SHARE_HELP_FOLDER"/>
<!-- Get the correct format -->
- <xsl:output method="xml" indent="yes"/>
- <xsl:namespace-alias stylesheet-prefix="xs" result-prefix="xs"></xsl:namespace-alias>
+ <xsl:output method="xml" indent="yes"/>
+ <xsl:namespace-alias stylesheet-prefix="xs" result-prefix="xs"></xsl:namespace-alias>
<!-- Remove all comments from the schema files -->
- <xsl:template match="*|@*">
- <xsl:copy>
- <xsl:apply-templates select="*|@*"/>
- </xsl:copy>
- </xsl:template>
+ <xsl:template match="*|@*">
+ <xsl:copy>
+ <xsl:apply-templates select="*|@*"/>
+ </xsl:copy>
+ </xsl:template>
<!-- suppress the location of the schema -->
- <xsl:template match = "@xsi:schemaLocation"/>
+ <xsl:template match = "@xsi:schemaLocation"/>
<!-- suppress the constraints of the schema
- <xsl:template match = "constraints"/> -->
+ <xsl:template match = "constraints"/> -->
<!-- suppress all documentation items
- <xsl:template match = "info"/> -->
+ <xsl:template match = "info"/> -->
<!-- suppress constraints for deprecated items -->
- <xsl:template match = "constraints[../info/deprecated]"/>
+ <xsl:template match = "constraints[../info/deprecated]"/>
<!-- suppress all documentation for deprecated items -->
- <xsl:template match = "desc[../deprecated]"/>
- <xsl:template match = "label[../deprecated]"/>
+ <xsl:template match = "desc[../deprecated]"/>
+ <xsl:template match = "label[../deprecated]"/>
<!-- copy all other documentation with content -->
- <xsl:template match="desc|label">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:value-of select="."/>
- </xsl:copy>
- </xsl:template>
+ <xsl:template match="desc|label">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:value-of select="."/>
+ </xsl:copy>
+ </xsl:template>
<!-- suppress all author items -->
- <xsl:template match = "author"/>
+ <xsl:template match = "author"/>
<!-- suppress values, which are marked as nil -->
- <xsl:template match="value[@xsi:nil='true']" />
+ <xsl:template match="value[@xsi:nil='true']" />
<!-- copy all other values with content -->
- <xsl:template match="value">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
- </xsl:template>
+ <xsl:template match="value">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
<xsl:template match ="it|unicode">
<xsl:copy>
@@ -120,12 +120,12 @@
<xsl:param name="replace2"/>
<xsl:choose>
<xsl:when test="contains($input, $pattern1)">
- <xsl:call-template name="replace">
- <xsl:with-param
- name="input" select="substring-before($input, $pattern1)"/>
- <xsl:with-param name="pattern" select="$pattern2"/>
- <xsl:with-param name="replace" select="$replace2"/>
- </xsl:call-template>
+ <xsl:call-template name="replace">
+ <xsl:with-param
+ name="input" select="substring-before($input, $pattern1)"/>
+ <xsl:with-param name="pattern" select="$pattern2"/>
+ <xsl:with-param name="replace" select="$replace2"/>
+ </xsl:call-template>
<xsl:value-of select="$replace1"/>
<xsl:call-template name="replacetwo">
<xsl:with-param
@@ -137,12 +137,12 @@
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
- <xsl:call-template name="replace">
- <xsl:with-param
- name="input" select="$input"/>
- <xsl:with-param name="pattern" select="$pattern2"/>
- <xsl:with-param name="replace" select="$replace2"/>
- </xsl:call-template>
+ <xsl:call-template name="replace">
+ <xsl:with-param
+ name="input" select="$input"/>
+ <xsl:with-param name="pattern" select="$pattern2"/>
+ <xsl:with-param name="replace" select="$replace2"/>
+ </xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
diff --git a/officecfg/util/schema_val.xsl b/officecfg/util/schema_val.xsl
index 4161808af2d2..38478ea8bb50 100644
--- a/officecfg/util/schema_val.xsl
+++ b/officecfg/util/schema_val.xsl
@@ -18,10 +18,10 @@
-->
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:xs="http://www.w3.org/2001/XMLSchema"
- xmlns:oor="http://openoffice.org/2001/registry"
- version="1.0">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:oor="http://openoffice.org/2001/registry"
+ version="1.0">
<!-- Get the correct format -->
<xsl:output method="xml" indent="yes"/>
@@ -32,108 +32,108 @@
<xsl:param name="schemaRoot"/>
<xsl:param name="componentName"/>
- <xsl:template match = "/">
- <xsl:apply-templates/>
- </xsl:template>
-
+ <xsl:template match = "/">
+ <xsl:apply-templates/>
+ </xsl:template>
+
<!-- activate attribute templates -->
- <xsl:template match="group|set|prop">
- <xsl:apply-templates select="*|@*"/>
- </xsl:template>
+ <xsl:template match="group|set|prop">
+ <xsl:apply-templates select="*|@*"/>
+ </xsl:template>
<!-- make sure that missing features are not invoked -->
- <xsl:template match = "item">
- <xsl:message terminate="yes">ERROR: multiple template types for sets are NOT supported!</xsl:message>
- </xsl:template>
+ <xsl:template match = "item">
+ <xsl:message terminate="yes">ERROR: multiple template types for sets are NOT supported!</xsl:message>
+ </xsl:template>
- <xsl:template match = "set[@oor:extensible='true']">
- <xsl:message terminate="yes">ERROR: extensible sets are currently NOT supported!</xsl:message>
- </xsl:template>
+ <xsl:template match = "set[@oor:extensible='true']">
+ <xsl:message terminate="yes">ERROR: extensible sets are currently NOT supported!</xsl:message>
+ </xsl:template>
- <xsl:template match = "group[@oor:extensible='true']">
- <xsl:if test="count(child::set) or count(child::group) or count(child::node-ref)">
- <xsl:message terminate="yes">ERROR: extensible groups with children are currently NOT supported!</xsl:message>
- </xsl:if>
- <xsl:apply-templates select="*|@*"/>
- </xsl:template>
+ <xsl:template match = "group[@oor:extensible='true']">
+ <xsl:if test="count(child::set) or count(child::group) or count(child::node-ref)">
+ <xsl:message terminate="yes">ERROR: extensible groups with children are currently NOT supported!</xsl:message>
+ </xsl:if>
+ <xsl:apply-templates select="*|@*"/>
+ </xsl:template>
<!-- Localized info elements (desc/label) are not supported currently -->
- <xsl:template match="info//*[@xml:lang]">
- <xsl:message terminate="yes">ERROR: Info elements (desc/label) are currently not localized. Remove xml:lang attributes!</xsl:message>
- </xsl:template>
+ <xsl:template match="info//*[@xml:lang]">
+ <xsl:message terminate="yes">ERROR: Info elements (desc/label) are currently not localized. Remove xml:lang attributes!</xsl:message>
+ </xsl:template>
<!-- check for duplicate child names -->
- <xsl:template match="@oor:name">
+ <xsl:template match="@oor:name">
<xsl:variable name="item-name" select="."/>
- <xsl:if test="../following-sibling::*[@oor:name = $item-name]">
- <xsl:message terminate="yes">ERROR: Duplicate node name '<xsl:value-of select="$item-name"/>'!</xsl:message>
- </xsl:if>
- </xsl:template>
+ <xsl:if test="../following-sibling::*[@oor:name = $item-name]">
+ <xsl:message terminate="yes">ERROR: Duplicate node name '<xsl:value-of select="$item-name"/>'!</xsl:message>
+ </xsl:if>
+ </xsl:template>
<!-- check if properties of type 'any' do not have a value -->
- <xsl:template match="prop[@oor:type='oor:any']">
- <xsl:if test="count(value)">
- <xsl:message terminate="yes">ERROR: Properties of type 'oor:any' MUST NOT have a value!</xsl:message>
- </xsl:if>
- <xsl:apply-templates select="*|@*"/>
- </xsl:template>
+ <xsl:template match="prop[@oor:type='oor:any']">
+ <xsl:if test="count(value)">
+ <xsl:message terminate="yes">ERROR: Properties of type 'oor:any' MUST NOT have a value!</xsl:message>
+ </xsl:if>
+ <xsl:apply-templates select="*|@*"/>
+ </xsl:template>
<!-- inhibit (explicit) NIL values -->
- <xsl:template match="value[@xsi:nil]">
- <xsl:message terminate="yes">ERROR: xsi:nil is not allowed in schemas !</xsl:message>
- </xsl:template>
+ <xsl:template match="value[@xsi:nil]">
+ <xsl:message terminate="yes">ERROR: xsi:nil is not allowed in schemas !</xsl:message>
+ </xsl:template>
<!-- validate for correct node references -->
- <xsl:template match="@oor:node-type">
- <xsl:choose>
- <xsl:when test="../@oor:component">
- <xsl:variable name ="file">
- <xsl:call-template name="locateFile"><xsl:with-param name="componentName" select="../@oor:component"/></xsl:call-template>
- </xsl:variable>
- <xsl:if test="not(document($file)/oor:component-schema/templates/*[@oor:name=current()])">
- <xsl:message terminate="yes">ERROR: node-type '<xsl:value-of select="current()"/>' not found!</xsl:message>
- </xsl:if>
- </xsl:when>
- <xsl:when test="not(/oor:component-schema/templates/*[@oor:name=current()])">
- <xsl:message terminate="yes">ERROR: node-type '<xsl:value-of select="current()"/>' not found!</xsl:message>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
+ <xsl:template match="@oor:node-type">
+ <xsl:choose>
+ <xsl:when test="../@oor:component">
+ <xsl:variable name ="file">
+ <xsl:call-template name="locateFile"><xsl:with-param name="componentName" select="../@oor:component"/></xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="not(document($file)/oor:component-schema/templates/*[@oor:name=current()])">
+ <xsl:message terminate="yes">ERROR: node-type '<xsl:value-of select="current()"/>' not found!</xsl:message>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="not(/oor:component-schema/templates/*[@oor:name=current()])">
+ <xsl:message terminate="yes">ERROR: node-type '<xsl:value-of select="current()"/>' not found!</xsl:message>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
<!-- validate if file name matches component-name -->
- <xsl:template match="oor:component-schema">
- <xsl:variable name ="fullName"><xsl:value-of select="@oor:package"/>.<xsl:value-of select="@oor:name"/></xsl:variable>
- <xsl:if test="$fullName != $componentName">
- <xsl:message terminate="yes">ERROR: Component name '<xsl:value-of select="$fullName"/>' does not match with file name!</xsl:message>
- </xsl:if>
- <xsl:apply-templates select="*|@*"/>
- </xsl:template>
+ <xsl:template match="oor:component-schema">
+ <xsl:variable name ="fullName"><xsl:value-of select="@oor:package"/>.<xsl:value-of select="@oor:name"/></xsl:variable>
+ <xsl:if test="$fullName != $componentName">
+ <xsl:message terminate="yes">ERROR: Component name '<xsl:value-of select="$fullName"/>' does not match with file name!</xsl:message>
+ </xsl:if>
+ <xsl:apply-templates select="*|@*"/>
+ </xsl:template>
<!-- locate a component file -->
- <xsl:template name="locateFile">
- <xsl:param name="componentName"/>
- <xsl:variable name="path"><xsl:value-of select="translate($componentName,'.','/')"/>.xcs</xsl:variable>
- <xsl:variable name ="file">
- <xsl:variable name ="tryfile" select="concat($root,'/',$path)"/>
- <xsl:choose>
- <xsl:when test="document($tryfile)">
- <xsl:value-of select="$tryfile"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="$schemaRoot">
- <xsl:variable name="globalfile" select="concat($schemaRoot,'/',$path)"/>
- <xsl:if test="document($globalfile)">
- <xsl:value-of select="$globalfile"/>
- </xsl:if>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:if test="not($file)">
- <xsl:message terminate ="yes">**Error: unable to locate document '<xsl:value-of select="$path"/>'</xsl:message>
- </xsl:if>
- <xsl:value-of select="$file"/>
- </xsl:template>
+ <xsl:template name="locateFile">
+ <xsl:param name="componentName"/>
+ <xsl:variable name="path"><xsl:value-of select="translate($componentName,'.','/')"/>.xcs</xsl:variable>
+ <xsl:variable name ="file">
+ <xsl:variable name ="tryfile" select="concat($root,'/',$path)"/>
+ <xsl:choose>
+ <xsl:when test="document($tryfile)">
+ <xsl:value-of select="$tryfile"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$schemaRoot">
+ <xsl:variable name="globalfile" select="concat($schemaRoot,'/',$path)"/>
+ <xsl:if test="document($globalfile)">
+ <xsl:value-of select="$globalfile"/>
+ </xsl:if>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="not($file)">
+ <xsl:message terminate ="yes">**Error: unable to locate document '<xsl:value-of select="$path"/>'</xsl:message>
+ </xsl:if>
+ <xsl:value-of select="$file"/>
+ </xsl:template>
</xsl:transform>
diff --git a/readlicense_oo/docs/readme.xsl b/readlicense_oo/docs/readme.xsl
index 5c329430f3c3..f591b87825ec 100644
--- a/readlicense_oo/docs/readme.xsl
+++ b/readlicense_oo/docs/readme.xsl
@@ -2,169 +2,169 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-<!-- <xsl:output method="text" doctype-public="-//W3C//DTD HTML 3.2//EN" omit-xml-declaration="yes"/> -->
-
+<!-- <xsl:output method="text" doctype-public="-//W3C//DTD HTML 3.2//EN" omit-xml-declaration="yes"/> -->
+
<!-- inputvariable declaration -->
- <xsl:param name="os1"/>
- <xsl:param name="cp1"/>
- <xsl:param name="com1"/>
- <xsl:param name="lang1"/>
- <xsl:param name="type"/>
- <xsl:param name="file"/>
- <xsl:strip-space elements="*"/>
-
- <xsl:param name="platform">
- <xsl:if test="$os1='LINUX'">
- <xsl:value-of select="'LINUX'"/>
- </xsl:if>
- <xsl:if test="$os1='WNT'">
- <xsl:value-of select="'WIN'"/>
- </xsl:if>
- <xsl:if test="$os1='SOLARIS'">
- <xsl:if test="$cp1='SPARC'">
- <xsl:value-of select="'SOLSPARC'"/>
- </xsl:if>
- <xsl:if test="$cp1='INTEL'">
- <xsl:value-of select="'SOLX86'"/>
- </xsl:if>
- </xsl:if>
- <xsl:if test="$os1='MACOSX'">
- <xsl:value-of select="'MAC'"/>
- </xsl:if>
- </xsl:param>
-
- <xsl:param name="lf">
- <xsl:choose>
- <xsl:when test="$platform='WIN'"><xsl:text>&#xD;&#xA;</xsl:text></xsl:when>
- <xsl:otherwise><xsl:text>&#xA;</xsl:text></xsl:otherwise>
- </xsl:choose>
- </xsl:param>
-
- <xsl:template match="/">
- <xsl:choose>
- <xsl:when test="$type='html'">
-
- <xsl:document method="html" href="{$file}" doctype-public="-//W3C//DTD HTML 3.2//EN">
- <xsl:apply-templates mode="html"/>
- </xsl:document>
-
- </xsl:when>
- <xsl:when test="$type='text'">
-
- <xsl:document method="text" href="{$file}">
- <xsl:call-template name="textout" />
- </xsl:document>
-
- </xsl:when>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template match="*" mode="html">
- <xsl:choose>
- <xsl:when test="(contains(@class,$platform) or not(@class) or (name(.)='p'))">
- <xsl:if test="(@xml:lang=$lang1 or not(@xml:lang))"> <!-- check for correct language -->
- <xsl:element name="{name(.)}">
- <xsl:if test="(name(.)='a')">
- <xsl:attribute name="href">
- <xsl:value-of select="@href"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="(name(.)='p') and (@class)">
- <xsl:attribute name="class">
- <xsl:value-of select="@class"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="name(.)='div'">
- <xsl:attribute name="id">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates mode="html"/>
- </xsl:element>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
-
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-
- <xsl:template name="textout">
- <xsl:apply-templates />
- </xsl:template>
-
- <xsl:template match="*">
- <xsl:if test="(@xml:lang=$lang1 or not(@xml:lang))"> <!-- check for correct language -->
- <xsl:choose>
- <xsl:when test="name(.)='html'">
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:when test="name(.)='body'">
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:when test="name(.)='hr'">
- <xsl:text>
-
+ <xsl:param name="os1"/>
+ <xsl:param name="cp1"/>
+ <xsl:param name="com1"/>
+ <xsl:param name="lang1"/>
+ <xsl:param name="type"/>
+ <xsl:param name="file"/>
+ <xsl:strip-space elements="*"/>
+
+ <xsl:param name="platform">
+ <xsl:if test="$os1='LINUX'">
+ <xsl:value-of select="'LINUX'"/>
+ </xsl:if>
+ <xsl:if test="$os1='WNT'">
+ <xsl:value-of select="'WIN'"/>
+ </xsl:if>
+ <xsl:if test="$os1='SOLARIS'">
+ <xsl:if test="$cp1='SPARC'">
+ <xsl:value-of select="'SOLSPARC'"/>
+ </xsl:if>
+ <xsl:if test="$cp1='INTEL'">
+ <xsl:value-of select="'SOLX86'"/>
+ </xsl:if>
+ </xsl:if>
+ <xsl:if test="$os1='MACOSX'">
+ <xsl:value-of select="'MAC'"/>
+ </xsl:if>
+ </xsl:param>
+
+ <xsl:param name="lf">
+ <xsl:choose>
+ <xsl:when test="$platform='WIN'"><xsl:text>&#xD;&#xA;</xsl:text></xsl:when>
+ <xsl:otherwise><xsl:text>&#xA;</xsl:text></xsl:otherwise>
+ </xsl:choose>
+ </xsl:param>
+
+ <xsl:template match="/">
+ <xsl:choose>
+ <xsl:when test="$type='html'">
+
+ <xsl:document method="html" href="{$file}" doctype-public="-//W3C//DTD HTML 3.2//EN">
+ <xsl:apply-templates mode="html"/>
+ </xsl:document>
+
+ </xsl:when>
+ <xsl:when test="$type='text'">
+
+ <xsl:document method="text" href="{$file}">
+ <xsl:call-template name="textout" />
+ </xsl:document>
+
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template match="*" mode="html">
+ <xsl:choose>
+ <xsl:when test="(contains(@class,$platform) or not(@class) or (name(.)='p'))">
+ <xsl:if test="(@xml:lang=$lang1 or not(@xml:lang))"> <!-- check for correct language -->
+ <xsl:element name="{name(.)}">
+ <xsl:if test="(name(.)='a')">
+ <xsl:attribute name="href">
+ <xsl:value-of select="@href"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="(name(.)='p') and (@class)">
+ <xsl:attribute name="class">
+ <xsl:value-of select="@class"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:if test="name(.)='div'">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates mode="html"/>
+ </xsl:element>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="textout">
+ <xsl:apply-templates />
+ </xsl:template>
+
+ <xsl:template match="*">
+ <xsl:if test="(@xml:lang=$lang1 or not(@xml:lang))"> <!-- check for correct language -->
+ <xsl:choose>
+ <xsl:when test="name(.)='html'">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='body'">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='hr'">
+ <xsl:text>
+
----------------------------------------------------------------------------------------------------------
</xsl:text>
- </xsl:when>
- <xsl:when test="name(.)='div'">
- <xsl:if test="(contains(@class,$platform) or not(@class))">
- <xsl:apply-templates/>
- </xsl:if>
- </xsl:when>
- <xsl:when test="name(.)='a'">
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:when test="name(.)='tt'">
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:when test="name(.)='li'">
- <xsl:value-of select="$lf"/>* <xsl:apply-templates/>
- </xsl:when>
- <xsl:when test="name(.)='ul'">
- <xsl:value-of select="$lf"/>
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:when test="name(.)='ol'">
- <xsl:value-of select="$lf"/>
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:when test="name(.)='p'">
- <xsl:if test="(not(name(..)='li') and (count(a) = 0))">
- <xsl:value-of select="$lf"/>
- <xsl:value-of select="$lf"/>
- </xsl:if>
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:when test="name(.)='h1'">
- <xsl:value-of select="$lf"/>
- <xsl:text>======================================================================</xsl:text>
- <xsl:value-of select="$lf"/>
- <xsl:apply-templates/>
- <xsl:value-of select="$lf"/>
- <xsl:text>======================================================================</xsl:text>
- <xsl:value-of select="$lf"/>
- </xsl:when>
- <xsl:when test="name(.)='h2'">
- <xsl:value-of select="$lf"/>
- <xsl:value-of select="$lf"/>
- <xsl:text>----------------------------------------------------------------------</xsl:text>
- <xsl:value-of select="$lf"/>
- <xsl:apply-templates/>
- <xsl:value-of select="$lf"/>
- <xsl:text>----------------------------------------------------------------------</xsl:text>
- </xsl:when>
- <xsl:when test="name(.)='h3'">
- <xsl:value-of select="$lf"/>
- <xsl:value-of select="$lf"/>
- <xsl:apply-templates/>
- <xsl:value-of select="$lf"/>
- <xsl:text>----------------------------------------------------------------------</xsl:text>
- </xsl:when>
- </xsl:choose>
- </xsl:if>
- </xsl:template>
+ </xsl:when>
+ <xsl:when test="name(.)='div'">
+ <xsl:if test="(contains(@class,$platform) or not(@class))">
+ <xsl:apply-templates/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="name(.)='a'">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='tt'">
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='li'">
+ <xsl:value-of select="$lf"/>* <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='ul'">
+ <xsl:value-of select="$lf"/>
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='ol'">
+ <xsl:value-of select="$lf"/>
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='p'">
+ <xsl:if test="(not(name(..)='li') and (count(a) = 0))">
+ <xsl:value-of select="$lf"/>
+ <xsl:value-of select="$lf"/>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:when test="name(.)='h1'">
+ <xsl:value-of select="$lf"/>
+ <xsl:text>======================================================================</xsl:text>
+ <xsl:value-of select="$lf"/>
+ <xsl:apply-templates/>
+ <xsl:value-of select="$lf"/>
+ <xsl:text>======================================================================</xsl:text>
+ <xsl:value-of select="$lf"/>
+ </xsl:when>
+ <xsl:when test="name(.)='h2'">
+ <xsl:value-of select="$lf"/>
+ <xsl:value-of select="$lf"/>
+ <xsl:text>----------------------------------------------------------------------</xsl:text>
+ <xsl:value-of select="$lf"/>
+ <xsl:apply-templates/>
+ <xsl:value-of select="$lf"/>
+ <xsl:text>----------------------------------------------------------------------</xsl:text>
+ </xsl:when>
+ <xsl:when test="name(.)='h3'">
+ <xsl:value-of select="$lf"/>
+ <xsl:value-of select="$lf"/>
+ <xsl:apply-templates/>
+ <xsl:value-of select="$lf"/>
+ <xsl:text>----------------------------------------------------------------------</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/sd/xsl/effect.xsl b/sd/xsl/effect.xsl
index 86306d24759f..283dde3e83a8 100644
--- a/sd/xsl/effect.xsl
+++ b/sd/xsl/effect.xsl
@@ -17,29 +17,29 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:office="urn:oasis:names:tc:openoffice:xmlns:office:1.0"
- xmlns:style="urn:oasis:names:tc:openoffice:xmlns:style:1.0"
- xmlns:text="urn:oasis:names:tc:openoffice:xmlns:text:1.0"
- xmlns:table="urn:oasis:names:tc:openoffice:xmlns:table:1.0"
- xmlns:draw="urn:oasis:names:tc:openoffice:xmlns:drawing:1.0"
- xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:meta="urn:oasis:names:tc:openoffice:xmlns:meta:1.0"
- xmlns:number="urn:oasis:names:tc:openoffice:xmlns:datastyle:1.0"
- xmlns:pres="urn:oasis:names:tc:openoffice:xmlns:presentation:1.0"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns:chart="urn:oasis:names:tc:openoffice:xmlns:chart:1.0"
- xmlns:dr3d="urn:oasis:names:tc:openoffice:xmlns:dr3d:1.0"
- xmlns:math="http://www.w3.org/1998/Math/MathML"
- xmlns:form="urn:oasis:names:tc:openoffice:xmlns:form:1.0"
- xmlns:script="urn:oasis:names:tc:openoffice:xmlns:script: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:smil="http://www.w3.org/2001/SMIL20"
- xmlns:anim="urn:oasis:names:tc:openoffice:xmlns:animation:1.0"
+ xmlns:office="urn:oasis:names:tc:openoffice:xmlns:office:1.0"
+ xmlns:style="urn:oasis:names:tc:openoffice:xmlns:style:1.0"
+ xmlns:text="urn:oasis:names:tc:openoffice:xmlns:text:1.0"
+ xmlns:table="urn:oasis:names:tc:openoffice:xmlns:table:1.0"
+ xmlns:draw="urn:oasis:names:tc:openoffice:xmlns:drawing:1.0"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:meta="urn:oasis:names:tc:openoffice:xmlns:meta:1.0"
+ xmlns:number="urn:oasis:names:tc:openoffice:xmlns:datastyle:1.0"
+ xmlns:pres="urn:oasis:names:tc:openoffice:xmlns:presentation:1.0"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:chart="urn:oasis:names:tc:openoffice:xmlns:chart:1.0"
+ xmlns:dr3d="urn:oasis:names:tc:openoffice:xmlns:dr3d:1.0"
+ xmlns:math="http://www.w3.org/1998/Math/MathML"
+ xmlns:form="urn:oasis:names:tc:openoffice:xmlns:form:1.0"
+ xmlns:script="urn:oasis:names:tc:openoffice:xmlns:script: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:smil="http://www.w3.org/2001/SMIL20"
+ xmlns:anim="urn:oasis:names:tc:openoffice:xmlns:animation:1.0"
version="1.0">
@@ -119,14 +119,14 @@
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
</xsl:template>
-
+
<!-- box -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-entrance-box']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
</xsl:template>
-
+
<!-- checkerboard -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-entrance-checkerboard']">
<anim:par pres:preset-property="Direction">
@@ -217,21 +217,21 @@
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
</xsl:template>
-
+
<!-- zoom -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-entrance-zoom']">
<anim:par pres:preset-property="Zoom">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- swivel -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-entrance-swivel']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- emphasis -->
<!-- change fill color -->
@@ -239,84 +239,84 @@
<anim:par pres:preset-property="FillColor;ColorStyle;Accelerate;Decelerate;AutoReverse">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- change font -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-font']">
<anim:par pres:preset-property="FontStyle" pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- change font color -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-font-color']">
<anim:par pres:preset-property="CharColor;ColorStyle;Accelerate;Decelerate;AutoReverse" pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- change font size -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-font-size']">
<anim:par pres:preset-property="CharHeight" pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- change font style -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-font-style']">
<anim:par pres:preset-property="CharDecoration" pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- change line color -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-line-color']">
<anim:par pres:preset-property="LineColor;ColorStyle;Accelerate;Decelerate;AutoReverse">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- grow/shrink -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-grow-and-shrink']">
<anim:par pres:preset-property="Scale;Accelerate;Decelerate;AutoReverse">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- spin -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-spin']">
<anim:par pres:preset-property="Rotate;Accelerate;Decelerate;AutoReverse">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- Transparency -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-transparency']">
<anim:par pres:preset-property="Transparency">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- brush on color -->
<xsl:template match="anim:iterate[@pres:preset-id = 'ooo-emphasis-color-over-by-word']">
<anim:iterate pres:preset-property="Color" pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:iterate>
- </xsl:template>
-
+ </xsl:template>
+
<!-- color blend -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-color-blend']">
<anim:par pres:preset-property="Color">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- color wave -->
<xsl:template match="anim:iterate[@pres:preset-id = 'ooo-emphasis-color-over-by-letter']">
<anim:iterate pres:preset-property="Color" pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:iterate>
- </xsl:template>
+ </xsl:template>
<!-- bold flash -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-bold-flash']">
@@ -324,13 +324,13 @@
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
</xsl:template>
-
+
<!-- reveal underline -->
<xsl:template match="anim:iterate[@pres:preset-id = 'ooo-emphasis-reveal-underline']">
<anim:iterate pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:iterate>
- </xsl:template>
+ </xsl:template>
<!-- shimmer -->
<xsl:template match="anim:iterate[@pres:preset-id = 'ooo-emphasis-shimmer']">
@@ -344,57 +344,57 @@
<anim:par pres:preset-property="Color">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- flicker -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-flicker']">
<anim:par pres:preset-property="Color">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- grow with color -->
<xsl:template match="anim:iterate[@pres:preset-id = 'ooo-emphasis-grow-with-color']">
<anim:iterate pres:preset-property="Color" pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:iterate>
- </xsl:template>
-
+ </xsl:template>
+
<!-- teeter -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-teeter']">
<anim:par pres:preset-property="Color">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- blast -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-blast']">
<anim:par pres:preset-property="Color">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- style emphasis -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-emphasis-style-emphasis']">
<anim:par pres:preset-property="Color" pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- bold reveal -->
<xsl:template match="anim:iterate[@pres:preset-id = 'ooo-emphasis-bold-reveal']">
<anim:iterate pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:iterate>
</xsl:template>
-
+
<!-- wave -->
<xsl:template match="anim:iterate[@pres:preset-id = 'ooo-emphasis-wave']">
<anim:iterate pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
</anim:iterate>
</xsl:template>
-
+
<!-- exit -->
<!-- blinds -->
@@ -402,126 +402,126 @@
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- box -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-box']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- checkerboard -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-checkerboard']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- circle -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-circle']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- crawl out -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-crawl-out']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- diamond -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-diamond']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- fly out -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-fly-out']">
<anim:par pres:preset-property="Direction;Accelerate;Decelerate">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- peek out -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-peek-out']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- plus -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-plus']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- random bars -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-random-bars']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- split -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-split']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- strips -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-diagonal-squares']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- wheel -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-wheel']">
<anim:par pres:preset-property="Spokes">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- wipe -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-wipe']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- collapse -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-collapse']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- color typewriter -->
<xsl:template match="anim:iterate[@pres:preset-id = 'ooo-exit-colored-lettering']">
<anim:iterate pres:preset-property="Color1;Color2" pres:text-only="true">
<xsl:apply-templates select="*|@*|text()"/>
- </anim:iterate>
- </xsl:template>
-
+ </anim:iterate>
+ </xsl:template>
+
<!-- zoom -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-zoom']">
<anim:par pres:preset-property="Zoom">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
-
+ </xsl:template>
+
<!-- swivel -->
<xsl:template match="anim:par[@pres:preset-id = 'ooo-exit-swivel']">
<anim:par pres:preset-property="Direction">
<xsl:apply-templates select="*|@*|text()"/>
</anim:par>
- </xsl:template>
+ </xsl:template>
<!-- fade in an swivel -->
<xsl:template match="anim:iterate[@pres:preset-id = 'ooo-exit-fade-out-and-swivel']">
@@ -564,7 +564,7 @@
<xsl:apply-templates select="*|@*|text()"/>
</anim:iterate>
</xsl:template>
-
+
<!-- remove pres:group-id -->
<xsl:template match="@xlink:href" />
<xsl:template match="@smil:targetElement" />
diff --git a/swext/mediawiki/src/filter/odt2mediawiki.xsl b/swext/mediawiki/src/filter/odt2mediawiki.xsl
index 8812be4d282d..f6cf345fca61 100644
--- a/swext/mediawiki/src/filter/odt2mediawiki.xsl
+++ b/swext/mediawiki/src/filter/odt2mediawiki.xsl
@@ -17,622 +17,622 @@
$Id: odt2mediawiki.xsl 3180 2013-03-17 16:00:43Z hauma $
-->
-<stylesheet version="1.0"
- xmlns="http://www.w3.org/1999/XSL/Transform"
-
- 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:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
- 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:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
- xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:math="http://www.w3.org/1998/Math/MathML"
- xmlns:dom="http://www.w3.org/2001/xml-events"
- xmlns:xforms="http://www.w3.org/2002/xforms"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+<stylesheet version="1.0"
+ xmlns="http://www.w3.org/1999/XSL/Transform"
+
+ 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:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"
+ 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:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0"
+ xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:math="http://www.w3.org/1998/Math/MathML"
+ xmlns:dom="http://www.w3.org/2001/xml-events"
+ xmlns:xforms="http://www.w3.org/2002/xforms"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
-
- <!--
- == Customization options ==
- -->
-
- <!-- Constant defining the newline token. -->
- <param name="NL" select="'&#10;'"/>
-
- <!-- String that a tabulator is expanded with in preformatted paragraphs. -->
-
- <variable name="codetabdocument-value"
- select="/office:document/office:meta/meta:user-defined[@meta:name='CODE_TAB_REPLACEMENT']"/>
-
- <param name="CODE_TAB_REPLACEMENT">
-
- <choose>
-
- <when test="boolean($codetabdocument-value)">
- <value-of select="$codetabdocument-value"/>
- </when>
-
- <otherwise>
- <value-of select="' '"/>
- </otherwise>
- </choose>
- </param>
-
- <!--
- Switch that suppresses separation of paragraphs with empty lines.
- (Set to 1 to activate) -->
- <param name="CODE_JOIN_PARAGRAPHS"
- select="boolean(string(/office:document/office:meta/meta:user-defined[@meta:name='CODE_JOIN_PARAGRAPHS']) != 'false')"/>
-
- <variable name="document-value"
- select="/office:document/office:meta/meta:user-defined[@meta:name='CODE_STYLES']"/>
-
- <param name="CODE_STYLES">
-
- <choose>
- <when test="boolean($document-value)">
- <value-of select="$document-value"/>
- </when>
-
- <otherwise>
- <value-of select="''"/>
- </otherwise>
- </choose>
- </param>
-
- <variable name="table-class"
- select="/office:document/office:meta/meta:user-defined[@meta:name='TABLE_CLASS']"/>
-
- <param name="TABLE_CLASS">
- <choose>
- <when test="boolean($table-class)">
- <value-of select="$table-class"/>
- </when>
-
- <otherwise>
- <value-of select="''"/>
- </otherwise>
- </choose>
- </param>
-
- <variable name="USE_DEFAULT_TABLE_CLASS" select="string-length($TABLE_CLASS) &gt; 0"/>
-
-
- <!--
- == Wiki style constants ==
- -->
-
- <!-- Bold character style. -->
- <variable name="BOLD_BIT" select="1"/>
-
- <!-- Italic character style. -->
- <variable name="ITALIC_BIT" select="2"/>
-
- <!-- Underline character style. -->
- <variable name="UNDERLINE_BIT" select="4"/>
-
- <!-- Subscript character style. -->
- <variable name="SUBSCRIPT_BIT" select="8"/>
-
- <!-- Superscript character style. -->
- <variable name="SUPERSCRIPT_BIT" select="16"/>
-
- <!-- Typewriter character style. -->
- <variable name="TYPEWRITER_BIT" select="32"/>
-
- <!-- Preformatted text paragraph style. -->
- <variable name="CODE_BIT" select="64"/>
-
- <!-- Centered paragraph style. -->
- <variable name="CENTER_BIT" select="128"/>
-
- <!-- Right aligned paragraph style. -->
- <variable name="RIGHT_BIT" select="256"/>
-
- <!-- Constant defining the empty style. -->
- <variable name="NO_STYLE" select="0"/>
-
-
-
- <output
- method="text"
- media-type="text/plain"
- encoding="UTF-8"
- />
-
-
- <!--
- == Reference resolution ==
- -->
-
- <key
- name="style-ref"
- match="//style:style"
- use="@style:name"
- />
-
- <key
- name="list-style-ref"
- match="//text:list-style"
- use="@style:name"
- />
-
- <key
- name="font-face-ref"
- match="//style:font-face"
- use="@style:name"
- />
-
- <key
- name="text:table-of-content-entry-ref"
- match="//text:table-of-content-entry-template"
- use="@text:style-name"
- />
-
- <key
- name="reference-resolution"
- match="//text:reference-mark | //text:reference-mark-start"
- use="@text:name"
- />
-
-
- <!--
- Multiple pages (draw only)
- -->
-
- <template match="draw:page">
- <value-of select="concat('&#10;&lt;!-- Page ', @draw:name, '--&gt;&#10;')"/>
- <apply-templates/>
- <value-of select="'&#10;----&#10;&#10;'"/>
- </template>
-
-
- <!--
- == Lists ==
- -->
-
- <template match="text:list">
- <!--
- Check, whether this list is used to implement the outline numbering
- for headings. Such list must not be exported, because within the wiki,
- automatic outline numbering is performed. An outline list has a single
- text:h element as its single leaf grandchild.
-
- This method of section numbering seems not to be used when creating new
- documents with OpenOffice.org 2.2, but the document containing the
- OpenDocument specification version 1.1 uses such numbering through nested
- lists.
- -->
- <choose>
- <when test="boolean(./descendant::node()[not(./self::text:list) and not(./self::text:list-item) and not(./ancestor-or-self::text:h)])">
- <apply-templates/>
- </when>
-
- <otherwise>
- <apply-templates select=".//text:h"/>
- </otherwise>
- </choose>
- </template>
-
- <template match="text:list-item">
- <if test="position() &gt; 1 or boolean(ancestor::text:list-item)">
- <value-of select="$NL"/>
- </if>
- <variable name="list-style"
- select="key('list-style-ref',ancestor::text:list[boolean(@text:style-name)][1]/@text:style-name)"/>
- <call-template name="mk-list-token">
- <with-param name="list-style" select="$list-style"/>
- <with-param name="level" select="count(ancestor::text:list)"/>
- </call-template>
- <text> </text>
- <apply-templates/>
- <if test="position() = last() and not(boolean(ancestor::text:list-item))">
- <!-- End of (potentially nested) list is marked with a double newline. -->
- <value-of select="$NL"/>
- <value-of select="$NL"/>
- </if>
- </template>
-
- <template name="mk-list-token">
- <param name="list-style"/>
- <param name="level"/>
-
- <if test="$level &gt; 1">
- <call-template name="mk-list-token">
- <with-param name="list-style" select="$list-style"/>
- <with-param name="level" select="$level - 1"/>
- </call-template>
- </if>
-
- <variable name="number-style" select="$list-style/text:list-level-style-number[@text:level=$level]"/>
- <variable name="bullet-style" select="$list-style/text:list-level-style-bullet[@text:level=$level]"/>
- <choose>
- <when test="boolean($number-style)">
- <choose>
- <when test="string-length($number-style/@style:num-format) &gt; 0">
- <text>#</text>
- </when>
- <otherwise>
- <text>:</text>
- </otherwise>
- </choose>
- </when>
- <when test="boolean($bullet-style)">
- <text>*</text>
- </when>
- </choose>
- </template>
-
-
- <!--
- == Headings ==
- -->
-
- <template match="text:h">
- <if test="string-length(.) &gt; 0">
- <variable name="token">
- <call-template name="mk-heading-prefix">
- <with-param name="level" select="@text:outline-level"/>
- </call-template>
- </variable>
- <value-of select="$token"/>
- <text> </text>
- <apply-templates/>
- <text> </text>
- <value-of select="$token"/>
- <value-of select="$NL"/>
- <value-of select="$NL"/>
- </if>
- </template>
-
- <template match="text:index-title">
- <text>__NOTOC__</text>
- <value-of select="$NL"/>
- <text>== </text>
- <apply-templates/>
- <text> ==</text>
- <value-of select="$NL"/>
- <value-of select="$NL"/>
- </template>
-
- <!--
- Function generating a wiki heading prefix.
-
- @param level
- The heading level. The value must be between 1 and 6.
- -->
- <template name="mk-heading-prefix">
- <param name="level"/>
- <choose>
- <when test="$level &gt; 6">
- <call-template name="mk-heading-prefix">
- <with-param name="level" select="6"/>
- </call-template>
- </when>
- <when test="$level &gt; 0">
- <text>=</text>
- <call-template name="mk-heading-prefix">
- <with-param name="level" select="$level - 1"/>
- </call-template>
- </when>
- </choose>
- </template>
-
- <!--
- Funktion generating a token consisting of the given character
- repeated 'level' times.
-
- @param level
- The length of the result.
- @param char
- The character that should be repeated 'level' times.
- -->
- <template name="mk-token">
- <param name="level"/>
- <param name="char"/>
- <if test="$level &gt; 0">
- <value-of select="$char"/>
- <call-template name="mk-token">
- <with-param name="level" select="$level - 1"/>
- <with-param name="char" select="$char"/>
- </call-template>
- </if>
- </template>
-
-
- <!--
- == Tables ==
- -->
-
- <template match="table:table">
- <value-of select="$NL"/>
- <text>{|</text>
-
- <choose>
- <when test="$USE_DEFAULT_TABLE_CLASS">
- <text> class="</text>
- <value-of select="$TABLE_CLASS"/>
- <text>"</text>
- </when>
-
- <otherwise>
- <variable name="style-element" select="key('style-ref', @table:style-name)"/>
- <variable name="table-align" select="$style-element/style:table-properties/@table:align"/>
- <!-- Table alignment using align -->
- <if test="boolean($table-align)">
- <variable name="align">
- <choose>
- <when test="$table-align='center'">
- <text>center</text>
- </when>
- </choose>
- </variable>
- <if test="string-length($align) &gt; 0">
- <text> align="</text>
- <value-of select="$align"/>
- <text>"</text>
- </if>
- </if>
- <variable name="style">
- <!-- Default setting to translate detailed office table cell styles correctly. -->
- <text>border-spacing:0;</text>
- <!-- Table alignment using css -->
- <if test="boolean($table-align)">
- <choose>
- <when test="$table-align='margins'">
- <text>margin:auto;</text>
- </when>
- </choose>
- </if>
- <if test="boolean($style-element/style:table-properties/@style:width)">
- <text>width:</text>
- <value-of select="$style-element/style:table-properties/@style:width"/>
- <text>;</text>
- </if>
- </variable>
- <text> style="</text>
- <value-of select="$style"/>
- <text>"</text>
- </otherwise>
- </choose>
-
- <value-of select="$NL"/>
- <apply-templates/>
- <text>|-</text>
- <value-of select="$NL"/>
- <text>|}</text>
- <value-of select="$NL"/>
- </template>
-
- <template match="table:table-header-rows">
- <apply-templates/>
- </template>
+
+ <!--
+ == Customization options ==
+ -->
+
+ <!-- Constant defining the newline token. -->
+ <param name="NL" select="'&#10;'"/>
+
+ <!-- String that a tabulator is expanded with in preformatted paragraphs. -->
+
+ <variable name="codetabdocument-value"
+ select="/office:document/office:meta/meta:user-defined[@meta:name='CODE_TAB_REPLACEMENT']"/>
+
+ <param name="CODE_TAB_REPLACEMENT">
+
+ <choose>
+
+ <when test="boolean($codetabdocument-value)">
+ <value-of select="$codetabdocument-value"/>
+ </when>
+
+ <otherwise>
+ <value-of select="' '"/>
+ </otherwise>
+ </choose>
+ </param>
+
+ <!--
+ Switch that suppresses separation of paragraphs with empty lines.
+ (Set to 1 to activate) -->
+ <param name="CODE_JOIN_PARAGRAPHS"
+ select="boolean(string(/office:document/office:meta/meta:user-defined[@meta:name='CODE_JOIN_PARAGRAPHS']) != 'false')"/>
+
+ <variable name="document-value"
+ select="/office:document/office:meta/meta:user-defined[@meta:name='CODE_STYLES']"/>
+
+ <param name="CODE_STYLES">
+
+ <choose>
+ <when test="boolean($document-value)">
+ <value-of select="$document-value"/>
+ </when>
+
+ <otherwise>
+ <value-of select="''"/>
+ </otherwise>
+ </choose>
+ </param>
+
+ <variable name="table-class"
+ select="/office:document/office:meta/meta:user-defined[@meta:name='TABLE_CLASS']"/>
+
+ <param name="TABLE_CLASS">
+ <choose>
+ <when test="boolean($table-class)">
+ <value-of select="$table-class"/>
+ </when>
+
+ <otherwise>
+ <value-of select="''"/>
+ </otherwise>
+ </choose>
+ </param>
+
+ <variable name="USE_DEFAULT_TABLE_CLASS" select="string-length($TABLE_CLASS) &gt; 0"/>
+
+
+ <!--
+ == Wiki style constants ==
+ -->
+
+ <!-- Bold character style. -->
+ <variable name="BOLD_BIT" select="1"/>
+
+ <!-- Italic character style. -->
+ <variable name="ITALIC_BIT" select="2"/>
+
+ <!-- Underline character style. -->
+ <variable name="UNDERLINE_BIT" select="4"/>
+
+ <!-- Subscript character style. -->
+ <variable name="SUBSCRIPT_BIT" select="8"/>
+
+ <!-- Superscript character style. -->
+ <variable name="SUPERSCRIPT_BIT" select="16"/>
+
+ <!-- Typewriter character style. -->
+ <variable name="TYPEWRITER_BIT" select="32"/>
+
+ <!-- Preformatted text paragraph style. -->
+ <variable name="CODE_BIT" select="64"/>
+
+ <!-- Centered paragraph style. -->
+ <variable name="CENTER_BIT" select="128"/>
+
+ <!-- Right aligned paragraph style. -->
+ <variable name="RIGHT_BIT" select="256"/>
+
+ <!-- Constant defining the empty style. -->
+ <variable name="NO_STYLE" select="0"/>
+
+
+
+ <output
+ method="text"
+ media-type="text/plain"
+ encoding="UTF-8"
+ />
+
+
+ <!--
+ == Reference resolution ==
+ -->
+
+ <key
+ name="style-ref"
+ match="//style:style"
+ use="@style:name"
+ />
+
+ <key
+ name="list-style-ref"
+ match="//text:list-style"
+ use="@style:name"
+ />
+
+ <key
+ name="font-face-ref"
+ match="//style:font-face"
+ use="@style:name"
+ />
+
+ <key
+ name="text:table-of-content-entry-ref"
+ match="//text:table-of-content-entry-template"
+ use="@text:style-name"
+ />
+
+ <key
+ name="reference-resolution"
+ match="//text:reference-mark | //text:reference-mark-start"
+ use="@text:name"
+ />
+
+
+ <!--
+ Multiple pages (draw only)
+ -->
+
+ <template match="draw:page">
+ <value-of select="concat('&#10;&lt;!-- Page ', @draw:name, '--&gt;&#10;')"/>
+ <apply-templates/>
+ <value-of select="'&#10;----&#10;&#10;'"/>
+ </template>
+
+
+ <!--
+ == Lists ==
+ -->
+
+ <template match="text:list">
+ <!--
+ Check, whether this list is used to implement the outline numbering
+ for headings. Such list must not be exported, because within the wiki,
+ automatic outline numbering is performed. An outline list has a single
+ text:h element as its single leaf grandchild.
+
+ This method of section numbering seems not to be used when creating new
+ documents with OpenOffice.org 2.2, but the document containing the
+ OpenDocument specification version 1.1 uses such numbering through nested
+ lists.
+ -->
+ <choose>
+ <when test="boolean(./descendant::node()[not(./self::text:list) and not(./self::text:list-item) and not(./ancestor-or-self::text:h)])">
+ <apply-templates/>
+ </when>
+
+ <otherwise>
+ <apply-templates select=".//text:h"/>
+ </otherwise>
+ </choose>
+ </template>
+
+ <template match="text:list-item">
+ <if test="position() &gt; 1 or boolean(ancestor::text:list-item)">
+ <value-of select="$NL"/>
+ </if>
+ <variable name="list-style"
+ select="key('list-style-ref',ancestor::text:list[boolean(@text:style-name)][1]/@text:style-name)"/>
+ <call-template name="mk-list-token">
+ <with-param name="list-style" select="$list-style"/>
+ <with-param name="level" select="count(ancestor::text:list)"/>
+ </call-template>
+ <text> </text>
+ <apply-templates/>
+ <if test="position() = last() and not(boolean(ancestor::text:list-item))">
+ <!-- End of (potentially nested) list is marked with a double newline. -->
+ <value-of select="$NL"/>
+ <value-of select="$NL"/>
+ </if>
+ </template>
+
+ <template name="mk-list-token">
+ <param name="list-style"/>
+ <param name="level"/>
+
+ <if test="$level &gt; 1">
+ <call-template name="mk-list-token">
+ <with-param name="list-style" select="$list-style"/>
+ <with-param name="level" select="$level - 1"/>
+ </call-template>
+ </if>
+
+ <variable name="number-style" select="$list-style/text:list-level-style-number[@text:level=$level]"/>
+ <variable name="bullet-style" select="$list-style/text:list-level-style-bullet[@text:level=$level]"/>
+ <choose>
+ <when test="boolean($number-style)">
+ <choose>
+ <when test="string-length($number-style/@style:num-format) &gt; 0">
+ <text>#</text>
+ </when>
+ <otherwise>
+ <text>:</text>
+ </otherwise>
+ </choose>
+ </when>
+ <when test="boolean($bullet-style)">
+ <text>*</text>
+ </when>
+ </choose>
+ </template>
+
+
+ <!--
+ == Headings ==
+ -->
+
+ <template match="text:h">
+ <if test="string-length(.) &gt; 0">
+ <variable name="token">
+ <call-template name="mk-heading-prefix">
+ <with-param name="level" select="@text:outline-level"/>
+ </call-template>
+ </variable>
+ <value-of select="$token"/>
+ <text> </text>
+ <apply-templates/>
+ <text> </text>
+ <value-of select="$token"/>
+ <value-of select="$NL"/>
+ <value-of select="$NL"/>
+ </if>
+ </template>
+
+ <template match="text:index-title">
+ <text>__NOTOC__</text>
+ <value-of select="$NL"/>
+ <text>== </text>
+ <apply-templates/>
+ <text> ==</text>
+ <value-of select="$NL"/>
+ <value-of select="$NL"/>
+ </template>
+
+ <!--
+ Function generating a wiki heading prefix.
+
+ @param level
+ The heading level. The value must be between 1 and 6.
+ -->
+ <template name="mk-heading-prefix">
+ <param name="level"/>
+ <choose>
+ <when test="$level &gt; 6">
+ <call-template name="mk-heading-prefix">
+ <with-param name="level" select="6"/>
+ </call-template>
+ </when>
+ <when test="$level &gt; 0">
+ <text>=</text>
+ <call-template name="mk-heading-prefix">
+ <with-param name="level" select="$level - 1"/>
+ </call-template>
+ </when>
+ </choose>
+ </template>
+
+ <!--
+ Funktion generating a token consisting of the given character
+ repeated 'level' times.
+
+ @param level
+ The length of the result.
+ @param char
+ The character that should be repeated 'level' times.
+ -->
+ <template name="mk-token">
+ <param name="level"/>
+ <param name="char"/>
+ <if test="$level &gt; 0">
+ <value-of select="$char"/>
+ <call-template name="mk-token">
+ <with-param name="level" select="$level - 1"/>
+ <with-param name="char" select="$char"/>
+ </call-template>
+ </if>
+ </template>
+
+
+ <!--
+ == Tables ==
+ -->
+
+ <template match="table:table">
+ <value-of select="$NL"/>
+ <text>{|</text>
+
+ <choose>
+ <when test="$USE_DEFAULT_TABLE_CLASS">
+ <text> class="</text>
+ <value-of select="$TABLE_CLASS"/>
+ <text>"</text>
+ </when>
+
+ <otherwise>
+ <variable name="style-element" select="key('style-ref', @table:style-name)"/>
+ <variable name="table-align" select="$style-element/style:table-properties/@table:align"/>
+ <!-- Table alignment using align -->
+ <if test="boolean($table-align)">
+ <variable name="align">
+ <choose>
+ <when test="$table-align='center'">
+ <text>center</text>
+ </when>
+ </choose>
+ </variable>
+ <if test="string-length($align) &gt; 0">
+ <text> align="</text>
+ <value-of select="$align"/>
+ <text>"</text>
+ </if>
+ </if>
+ <variable name="style">
+ <!-- Default setting to translate detailed office table cell styles correctly. -->
+ <text>border-spacing:0;</text>
+ <!-- Table alignment using css -->
+ <if test="boolean($table-align)">
+ <choose>
+ <when test="$table-align='margins'">
+ <text>margin:auto;</text>
+ </when>
+ </choose>
+ </if>
+ <if test="boolean($style-element/style:table-properties/@style:width)">
+ <text>width:</text>
+ <value-of select="$style-element/style:table-properties/@style:width"/>
+ <text>;</text>
+ </if>
+ </variable>
+ <text> style="</text>
+ <value-of select="$style"/>
+ <text>"</text>
+ </otherwise>
+ </choose>
+
+ <value-of select="$NL"/>
+ <apply-templates/>
+ <text>|-</text>
+ <value-of select="$NL"/>
+ <text>|}</text>
+ <value-of select="$NL"/>
+ </template>
+
+ <template match="table:table-header-rows">
+ <apply-templates/>
+ </template>
<template match="table:table-row">
- <text>|-</text>
+ <text>|-</text>
- <if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(table:table-cell[1]/@table:style-name)">
- <variable name="style-name" select="table:table-cell[1]/@table:style-name"/>
- <variable name="total-style-name" select="count(table:table-cell/@table:style-name)"/>
- <variable name="total-equal-style-name" select="count(table:table-cell[@table:style-name=$style-name])"/>
+ <if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(table:table-cell[1]/@table:style-name)">
+ <variable name="style-name" select="table:table-cell[1]/@table:style-name"/>
+ <variable name="total-style-name" select="count(table:table-cell/@table:style-name)"/>
+ <variable name="total-equal-style-name" select="count(table:table-cell[@table:style-name=$style-name])"/>
<variable name="style">
- <if test="$total-equal-style-name=$total-style-name">
- <call-template name="translate-table-cell-properties">
- <with-param name="style-element" select="key('style-ref', $style-name)"/>
- </call-template>
- </if>
- </variable>
+ <if test="$total-equal-style-name=$total-style-name">
+ <call-template name="translate-table-cell-properties">
+ <with-param name="style-element" select="key('style-ref', $style-name)"/>
+ </call-template>
+ </if>
+ </variable>
<if test="string-length($style) &gt; 0">
- <text> style="</text>
- <value-of select="$style"/>
- <text>"</text>
- </if>
- </if>
+ <text> style="</text>
+ <value-of select="$style"/>
+ <text>"</text>
+ </if>
+ </if>
<value-of select="$NL"/>
- <apply-templates/>
- </template>
-
- <template match="table:table-header-rows//table:table-cell">
- <text>!</text>
- <if test="@table:number-columns-spanned">
- <text>colspan="</text>
- <value-of select="@table:number-columns-spanned"/>
- <text>" | </text>
- </if>
-
- <!-- Cell alignment -->
- <if test="text:p and count(*) = 1">
- <variable name="style-number">
- <call-template name="mk-style-set">
- <with-param name="node" select="text:p"/>
- </call-template>
- </variable>
-
- <variable name="code"
- select="($style-number mod (2 * $CODE_BIT)) - ($style-number mod ($CODE_BIT)) != 0"/>
- <variable name="center"
- select="($style-number mod (2 * $CENTER_BIT)) - ($style-number mod ($CENTER_BIT)) != 0"/>
- <variable name="right"
- select="($style-number mod (2 * $RIGHT_BIT)) - ($style-number mod ($RIGHT_BIT)) != 0"/>
-
- <choose>
- <when test="$center">
- <text> align=center</text>
- </when>
- <when test="$right">
- <text> align=right</text>
- </when>
- </choose>
- </if>
-
- <if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(@table:style-name)">
- <variable name="style-name" select="@table:style-name"/>
-
- <variable name="style">
- <!-- Only if cells have a different style-name -->
- <if test="count(../table:table-cell/@table:style-name) != count(../table:table-cell[@table:style-name=$style-name]) and count(../table:table-cell/@table:style-name) &gt; 0">
- <call-template name="translate-table-cell-properties">
- <with-param name="style-element" select="key('style-ref', $style-name)"/>
- </call-template>
- </if>
+ <apply-templates/>
+ </template>
+
+ <template match="table:table-header-rows//table:table-cell">
+ <text>!</text>
+ <if test="@table:number-columns-spanned">
+ <text>colspan="</text>
+ <value-of select="@table:number-columns-spanned"/>
+ <text>" | </text>
+ </if>
+
+ <!-- Cell alignment -->
+ <if test="text:p and count(*) = 1">
+ <variable name="style-number">
+ <call-template name="mk-style-set">
+ <with-param name="node" select="text:p"/>
+ </call-template>
+ </variable>
+
+ <variable name="code"
+ select="($style-number mod (2 * $CODE_BIT)) - ($style-number mod ($CODE_BIT)) != 0"/>
+ <variable name="center"
+ select="($style-number mod (2 * $CENTER_BIT)) - ($style-number mod ($CENTER_BIT)) != 0"/>
+ <variable name="right"
+ select="($style-number mod (2 * $RIGHT_BIT)) - ($style-number mod ($RIGHT_BIT)) != 0"/>
+
+ <choose>
+ <when test="$center">
+ <text> align=center</text>
+ </when>
+ <when test="$right">
+ <text> align=right</text>
+ </when>
+ </choose>
+ </if>
+
+ <if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(@table:style-name)">
+ <variable name="style-name" select="@table:style-name"/>
+
+ <variable name="style">
+ <!-- Only if cells have a different style-name -->
+ <if test="count(../table:table-cell/@table:style-name) != count(../table:table-cell[@table:style-name=$style-name]) and count(../table:table-cell/@table:style-name) &gt; 0">
+ <call-template name="translate-table-cell-properties">
+ <with-param name="style-element" select="key('style-ref', $style-name)"/>
+ </call-template>
+ </if>
</variable>
-
- <if test="string-length($style) &gt; 0">
- <text> style="</text>
- <value-of select="$style"/>
- <text>" </text>
- </if>
- </if>
- <text>| </text>
- <apply-templates/>
- <value-of select="$NL"/>
+
+ <if test="string-length($style) &gt; 0">
+ <text> style="</text>
+ <value-of select="$style"/>
+ <text>" </text>
+ </if>
+ </if>
+ <text>| </text>
+ <apply-templates/>
+ <value-of select="$NL"/>
</template>
- <template match="table:table-cell">
- <text>|</text>
- <if test="@table:number-columns-spanned">
- <text> colspan="</text>
- <value-of select="@table:number-columns-spanned"/>
- <text>" </text>
- </if>
-
- <!-- Cell alignment -->
- <if test="text:p and count(*) = 1">
- <variable name="style-number">
- <call-template name="mk-style-set">
- <with-param name="node" select="text:p"/>
- </call-template>
- </variable>
-
- <variable name="code"
- select="($style-number mod (2 * $CODE_BIT)) - ($style-number mod ($CODE_BIT)) != 0"/>
- <variable name="center"
- select="($style-number mod (2 * $CENTER_BIT)) - ($style-number mod ($CENTER_BIT)) != 0"/>
- <variable name="right"
- select="($style-number mod (2 * $RIGHT_BIT)) - ($style-number mod ($RIGHT_BIT)) != 0"/>
-
- <choose>
- <when test="$center">
- <text> align=center</text>
- </when>
- <when test="$right">
- <text> align=right</text>
- </when>
- </choose>
- </if>
-
- <if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(@table:style-name)">
- <variable name="style-name" select="@table:style-name"/>
+ <template match="table:table-cell">
+ <text>|</text>
+ <if test="@table:number-columns-spanned">
+ <text> colspan="</text>
+ <value-of select="@table:number-columns-spanned"/>
+ <text>" </text>
+ </if>
+
+ <!-- Cell alignment -->
+ <if test="text:p and count(*) = 1">
+ <variable name="style-number">
+ <call-template name="mk-style-set">
+ <with-param name="node" select="text:p"/>
+ </call-template>
+ </variable>
+
+ <variable name="code"
+ select="($style-number mod (2 * $CODE_BIT)) - ($style-number mod ($CODE_BIT)) != 0"/>
+ <variable name="center"
+ select="($style-number mod (2 * $CENTER_BIT)) - ($style-number mod ($CENTER_BIT)) != 0"/>
+ <variable name="right"
+ select="($style-number mod (2 * $RIGHT_BIT)) - ($style-number mod ($RIGHT_BIT)) != 0"/>
+
+ <choose>
+ <when test="$center">
+ <text> align=center</text>
+ </when>
+ <when test="$right">
+ <text> align=right</text>
+ </when>
+ </choose>
+ </if>
+
+ <if test="not($USE_DEFAULT_TABLE_CLASS) and boolean(@table:style-name)">
+ <variable name="style-name" select="@table:style-name"/>
<variable name="style">
- <!-- Only if cells have a different style-name -->
- <if test="count(../table:table-cell/@table:style-name) != count(../table:table-cell[@table:style-name=$style-name]) and count(../table:table-cell/@table:style-name) &gt; 0">
- <call-template name="translate-table-cell-properties">
- <with-param name="style-element" select="key('style-ref', $style-name)"/>
- </call-template>
+ <!-- Only if cells have a different style-name -->
+ <if test="count(../table:table-cell/@table:style-name) != count(../table:table-cell[@table:style-name=$style-name]) and count(../table:table-cell/@table:style-name) &gt; 0">
+ <call-template name="translate-table-cell-properties">
+ <with-param name="style-element" select="key('style-ref', $style-name)"/>
+ </call-template>
</if>
- <!-- Font color -->
- <if test="text:p and count(*) = 1">
- <if test="boolean(text:p/@text:style-name)">
- <variable name="style-element" select="key('style-ref', text:p/@text:style-name)"/>
-
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'color'"/>
- <with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
- </call-template>
- </if>
- </if>
- </variable>
-
- <if test="string-length($style) &gt; 0">
- <text> style="</text>
- <value-of select="$style"/>
- <text>" </text>
- </if>
- </if>
- <text>| </text>
- <apply-templates/>
- <value-of select="$NL"/>
- </template>
-
- <template name="translate-table-cell-properties">
- <param name="style-element"/>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'background-color'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:background-color"/>
- </call-template>
-
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'border'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'border-top'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-top"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'border-bottom'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-bottom"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'border-left'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-left"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'border-right'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-right"/>
- </call-template>
-
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'padding'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'padding-top'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-top"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'padding-bottom'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-bottom"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'padding-left'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-left"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'padding-right'"/>
- <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-right"/>
- </call-template>
- </template>
+ <!-- Font color -->
+ <if test="text:p and count(*) = 1">
+ <if test="boolean(text:p/@text:style-name)">
+ <variable name="style-element" select="key('style-ref', text:p/@text:style-name)"/>
+
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'color'"/>
+ <with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
+ </call-template>
+ </if>
+ </if>
+ </variable>
+
+ <if test="string-length($style) &gt; 0">
+ <text> style="</text>
+ <value-of select="$style"/>
+ <text>" </text>
+ </if>
+ </if>
+ <text>| </text>
+ <apply-templates/>
+ <value-of select="$NL"/>
+ </template>
+
+ <template name="translate-table-cell-properties">
+ <param name="style-element"/>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'background-color'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:background-color"/>
+ </call-template>
+
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'border'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'border-top'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-top"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'border-bottom'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-bottom"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'border-left'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-left"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'border-right'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:border-right"/>
+ </call-template>
+
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'padding'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'padding-top'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-top"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'padding-bottom'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-bottom"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'padding-left'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-left"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'padding-right'"/>
+ <with-param name="style-property" select="$style-element/style:table-cell-properties/@fo:padding-right"/>
+ </call-template>
+ </template>
<template name="translate-style-property">
- <param name="style-name"/>
- <param name="style-property"/>
-
- <if test="boolean($style-property)">
- <value-of select="$style-name"/>
- <text>:</text>
- <value-of select="string($style-property)"/>
- <text>;</text>
- </if>
- </template>
-
- <!--
- == WikiMath ==
- -->
+ <param name="style-name"/>
+ <param name="style-property"/>
+
+ <if test="boolean($style-property)">
+ <value-of select="$style-name"/>
+ <text>:</text>
+ <value-of select="string($style-property)"/>
+ <text>;</text>
+ </if>
+ </template>
+
+ <!--
+ == WikiMath ==
+ -->
<!--
Make sure to join sibling node that are all formatted with WikiMath style without repeating
@@ -640,11 +640,11 @@
Do not apply any transformation to the contents marked as WikiMath.
-->
- <template match="text:span[@text:style-name='WikiMath']">
- <value-of select="'&lt;math&gt;'"/>
- <value-of select="string(.)"/>
- <value-of select="'&lt;/math&gt;'"/>
- </template>
+ <template match="text:span[@text:style-name='WikiMath']">
+ <value-of select="'&lt;math&gt;'"/>
+ <value-of select="string(.)"/>
+ <value-of select="'&lt;/math&gt;'"/>
+ </template>
<template match="text:span[@text:style-name='WikiMath' and boolean(preceding-sibling::node()[position()=1 and local-name(.)='span' and @text:style-name='WikiMath'])]">
<value-of select="string(.)"/>
@@ -660,1353 +660,1353 @@
<value-of select="string(.)"/>
</template>
- <!--
- == Native links ==
- -->
-
- <template match="text:a">
- <variable name="link-ref" select="@xlink:href"/>
- <choose>
- <when test="string-length($link-ref) &gt; 0">
- <choose>
- <when test="starts-with($link-ref, '#')">
- <text>[[</text>
- <choose>
- <when test="contains($link-ref, '_')">
- <value-of select="translate($link-ref,'_','')"/>
- </when>
- <otherwise>
- <value-of select="$link-ref"/>
- </otherwise>
- </choose>
- <text>|</text>
- <choose>
- <when test="text:tab and ancestor::text:index-body">
- <value-of select="node()[1]"/>
- </when>
- <otherwise>
- <value-of select="string(.)"/>
- </otherwise>
- </choose>
- <text>]]</text>
- </when>
+ <!--
+ == Native links ==
+ -->
+
+ <template match="text:a">
+ <variable name="link-ref" select="@xlink:href"/>
+ <choose>
+ <when test="string-length($link-ref) &gt; 0">
+ <choose>
+ <when test="starts-with($link-ref, '#')">
+ <text>[[</text>
+ <choose>
+ <when test="contains($link-ref, '_')">
+ <value-of select="translate($link-ref,'_','')"/>
+ </when>
+ <otherwise>
+ <value-of select="$link-ref"/>
+ </otherwise>
+ </choose>
+ <text>|</text>
+ <choose>
+ <when test="text:tab and ancestor::text:index-body">
+ <value-of select="node()[1]"/>
+ </when>
+ <otherwise>
+ <value-of select="string(.)"/>
+ </otherwise>
+ </choose>
+ <text>]]</text>
+ </when>
<otherwise>
- <text>[</text>
- <value-of select="$link-ref"/>
- <text> </text>
- <value-of select="string(.)"/>
- <text>]</text>
- </otherwise>
- </choose>
- </when>
-
- <otherwise>
- <apply-templates/>
- </otherwise>
- </choose>
- </template>
+ <text>[</text>
+ <value-of select="$link-ref"/>
+ <text> </text>
+ <value-of select="string(.)"/>
+ <text>]</text>
+ </otherwise>
+ </choose>
+ </when>
+
+ <otherwise>
+ <apply-templates/>
+ </otherwise>
+ </choose>
+ </template>
<!--
- Function for generating tabulations in TOC entries.
-
- @param style
- The style of the TOC entry
- -->
- <template name="mk-tab-toc">
- <param name="style"/>
- <if test="number($style/@text:outline-level) &gt; 0">
- <call-template name="mk-token">
- <with-param name="level" select="number($style/@text:outline-level) - 1"/>
- <with-param name="char" select="':'"/>
- </call-template>
- </if>
- </template>
-
- <!--
- == WikiLink ==
- -->
-
- <template match="text:span[@text:style-name='WikiLink']">
- <value-of select="'[['"/>
- <variable name="link-def" select="string(.)"/>
- <variable name="link-label" select="normalize-space(substring-before($link-def, '['))"/>
- <variable name="link-ref" select="normalize-space(substring-before(substring-after($link-def, '['), ']'))"/>
- <choose>
- <when test="boolean($link-ref)">
- <value-of select="concat($link-ref, '|', $link-label)"/>
- </when>
- <otherwise>
- <value-of select="$link-def"/>
- </otherwise>
- </choose>
- <value-of select="']]'"/>
- </template>
-
-
- <!--
- == Paragraphs ==
- -->
-
- <template match="text:p">
- <!-- TOC tabs -->
- <if test="ancestor::text:index-body and boolean(@text:style-name)">
- <variable name="style" select="key('style-ref', @text:style-name)"/>
- <if test="boolean($style/@style:parent-style-name)">
- <call-template name="mk-tab-toc">
- <with-param name="style" select="key('text:table-of-content-entry-ref', $style/@style:parent-style-name)"/>
- </call-template>
- </if>
- </if>
-
- <variable name="alignment">
- <call-template name="mk-style-set">
- <with-param name="node" select="."/>
- </call-template>
- </variable>
-
- <variable name="code"
- select="($alignment mod (2 * $CODE_BIT)) - ($alignment mod ($CODE_BIT)) != 0"/>
- <variable name="center"
- select="($alignment mod (2 * $CENTER_BIT)) - ($alignment mod ($CENTER_BIT)) != 0"/>
- <variable name="right"
- select="($alignment mod (2 * $RIGHT_BIT)) - ($alignment mod ($RIGHT_BIT)) != 0"/>
-
- <variable name="style">
- <choose>
- <when test="name(parent::*) != 'table:table-cell'">
- <choose>
- <when test="$center">
- <text>text-align:center;</text>
- </when>
- <when test="$right">
- <text>text-align:right;</text>
- </when>
- </choose>
- <if test="boolean(@text:style-name)">
- <variable name="style-element" select="key('style-ref', @text:style-name)"/>
-
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'color'"/>
- <with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'margin-left'"/>
- <with-param name="style-property" select="$style-element/style:paragraph-properties/@fo:margin-left"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'margin-right'"/>
- <with-param name="style-property" select="$style-element/style:paragraph-properties/@fo:margin-right"/>
- </call-template>
- </if>
- </when>
- <otherwise>
- <if test="count(../text:p) &gt; 1 and boolean(@text:style-name)">
- <variable name="style-element" select="key('style-ref', @text:style-name)"/>
+ Function for generating tabulations in TOC entries.
+
+ @param style
+ The style of the TOC entry
+ -->
+ <template name="mk-tab-toc">
+ <param name="style"/>
+ <if test="number($style/@text:outline-level) &gt; 0">
+ <call-template name="mk-token">
+ <with-param name="level" select="number($style/@text:outline-level) - 1"/>
+ <with-param name="char" select="':'"/>
+ </call-template>
+ </if>
+ </template>
+
+ <!--
+ == WikiLink ==
+ -->
+
+ <template match="text:span[@text:style-name='WikiLink']">
+ <value-of select="'[['"/>
+ <variable name="link-def" select="string(.)"/>
+ <variable name="link-label" select="normalize-space(substring-before($link-def, '['))"/>
+ <variable name="link-ref" select="normalize-space(substring-before(substring-after($link-def, '['), ']'))"/>
+ <choose>
+ <when test="boolean($link-ref)">
+ <value-of select="concat($link-ref, '|', $link-label)"/>
+ </when>
+ <otherwise>
+ <value-of select="$link-def"/>
+ </otherwise>
+ </choose>
+ <value-of select="']]'"/>
+ </template>
+
+
+ <!--
+ == Paragraphs ==
+ -->
+
+ <template match="text:p">
+ <!-- TOC tabs -->
+ <if test="ancestor::text:index-body and boolean(@text:style-name)">
+ <variable name="style" select="key('style-ref', @text:style-name)"/>
+ <if test="boolean($style/@style:parent-style-name)">
+ <call-template name="mk-tab-toc">
+ <with-param name="style" select="key('text:table-of-content-entry-ref', $style/@style:parent-style-name)"/>
+ </call-template>
+ </if>
+ </if>
+
+ <variable name="alignment">
+ <call-template name="mk-style-set">
+ <with-param name="node" select="."/>
+ </call-template>
+ </variable>
+
+ <variable name="code"
+ select="($alignment mod (2 * $CODE_BIT)) - ($alignment mod ($CODE_BIT)) != 0"/>
+ <variable name="center"
+ select="($alignment mod (2 * $CENTER_BIT)) - ($alignment mod ($CENTER_BIT)) != 0"/>
+ <variable name="right"
+ select="($alignment mod (2 * $RIGHT_BIT)) - ($alignment mod ($RIGHT_BIT)) != 0"/>
+
+ <variable name="style">
+ <choose>
+ <when test="name(parent::*) != 'table:table-cell'">
+ <choose>
+ <when test="$center">
+ <text>text-align:center;</text>
+ </when>
+ <when test="$right">
+ <text>text-align:right;</text>
+ </when>
+ </choose>
+ <if test="boolean(@text:style-name)">
+ <variable name="style-element" select="key('style-ref', @text:style-name)"/>
+
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'color'"/>
+ <with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'margin-left'"/>
+ <with-param name="style-property" select="$style-element/style:paragraph-properties/@fo:margin-left"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'margin-right'"/>
+ <with-param name="style-property" select="$style-element/style:paragraph-properties/@fo:margin-right"/>
+ </call-template>
+ </if>
+ </when>
+ <otherwise>
+ <if test="count(../text:p) &gt; 1 and boolean(@text:style-name)">
+ <variable name="style-element" select="key('style-ref', @text:style-name)"/>
<call-template name="translate-style-property">
- <with-param name="style-name" select="'color'"/>
- <with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
- </call-template>
- </if>
- </otherwise>
- </choose>
- </variable>
-
- <if test="string-length($style) &gt; 0">
- <text>&lt;div style="</text>
- <value-of select="$style"/>
- <text>"&gt;</text>
- </if>
-
- <apply-templates/>
-
- <if test="string-length($style) &gt; 0">
- <text>&lt;/div&gt;</text>
- </if>
-
- <variable name="paragraph-right"
- select="./following-sibling::*[1]/self::text:p"/>
-
- <choose>
- <when test="boolean($paragraph-right)">
- <!--
- Insert end of line only if not within a list. Within wiki lists,
- a line break leaves the current list item.
- -->
- <choose>
- <when test="boolean(ancestor::text:list-item)">
- <text>&lt;br/&gt;</text>
- </when>
- <when test="$code">
- <variable name="style-right">
- <call-template name="mk-style-set">
- <with-param name="node" select="$paragraph-right"/>
- </call-template>
- </variable>
-
- <variable name="code-right"
- select="($style-right mod (2 * $CODE_BIT)) - ($style-right mod ($CODE_BIT)) != 0"/>
-
- <choose>
- <when test="$code-right">
- <choose>
- <when test="$CODE_JOIN_PARAGRAPHS">
- <value-of select="$NL"/>
- </when>
-
- <otherwise>
- <value-of select="$NL"/>
- <value-of select="' '"/>
- <value-of select="$NL"/>
- </otherwise>
- </choose>
- </when>
- <otherwise>
- <value-of select="$NL"/>
- <value-of select="$NL"/>
- </otherwise>
- </choose>
- </when>
- <otherwise>
- <value-of select="$NL"/>
- <value-of select="$NL"/>
- </otherwise>
- </choose>
- </when>
- <when test="not(boolean(ancestor::text:note)) and (boolean(./following::*[1]/self::text:h) or boolean(./following::*[1]/self::table:table) or boolean(./following::*[1]/self::text:bibliography))">
- <!-- Newline before following heading or table. -->
- <value-of select="$NL"/>
- <value-of select="$NL"/>
- </when>
- <when test="not(./following-sibling::*[1]) and name(./following::*[1])='text:p' and ancestor::text:list-item">
- <!-- End of the list -->
- <value-of select="$NL"/>
- <value-of select="$NL"/>
- </when>
- </choose>
- </template>
-
- <template match="text:p[string-length(.) = 0 and string-length(preceding-sibling::*[1]/self::text:p) &gt; 0]">
- <value-of select="$NL"/>
- </template>
-
- <!--
- == Preformatted text ==
- -->
-
- <template match="text:s">
- <variable name="style">
- <call-template name="mk-style-set">
- <with-param name="node" select="."/>
- </call-template>
- </variable>
-
- <variable name="code"
- select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
-
- <if test="$code">
- <choose>
- <when test="@text:c">
- <call-template name="mk-token">
- <with-param name="level" select="@text:c"/>
- <with-param name="char" select="' '"/>
- </call-template>
- </when>
- <otherwise>
- <value-of select="' '"/>
- </otherwise>
- </choose>
- </if>
- </template>
-
- <template match="text:span[string-length(.) &gt; 0]">
- <if test="boolean(@text:style-name)">
- <variable name="style-element" select="key('style-ref', @text:style-name)"/>
- <variable name="style">
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'background-color'"/>
- <with-param name="style-property" select="$style-element/style:text-properties/@fo:background-color"/>
- </call-template>
- <call-template name="translate-style-property">
- <with-param name="style-name" select="'color'"/>
- <with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
- </call-template>
- </variable>
-
- <if test="string-length($style) &gt; 0">
- <text>&lt;span style="</text>
- <value-of select="$style"/>
- <text>"&gt;</text>
- </if>
-
- <apply-templates/>
-
- <if test="string-length($style) &gt; 0">
- <text>&lt;/span&gt;</text>
- </if>
- </if>
- </template>
-
- <template match="text:tab">
- <variable name="style">
- <call-template name="mk-style-set">
- <with-param name="node" select="."/>
- </call-template>
- </variable>
-
- <variable name="code"
- select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
-
- <if test="$code">
- <value-of select="$CODE_TAB_REPLACEMENT"/>
- </if>
- </template>
-
- <template match="text:line-break">
- <variable name="style">
- <call-template name="mk-style-set">
- <with-param name="node" select="."/>
- </call-template>
- </variable>
-
- <variable name="code"
- select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
-
- <if test="$code">
- <value-of select="$NL"/>
- <value-of select="' '"/>
- </if>
- </template>
-
- <!--
- Footnotes
- -->
-
- <template match="text:note-body">
- <variable name="note" select="./parent::text:note"/>
-
- <if test="$note/@text:note-class = 'footnote'">
- <text>&lt;ref name="</text>
- <value-of select="$note/@text:id"/>
- <text>"&gt;</text>
- <apply-templates/>
- <text>&lt;/ref&gt;</text>
- </if>
- </template>
-
- <template match="text:note-ref[@text:note-class='footnote']">
- <text>&lt;ref name="</text>
- <value-of select="@text:ref-name"/>
- <text>"/&gt;</text>
- </template>
-
-
- <!--
- == Images ==
- -->
-
- <template match="draw:text-box[boolean(.//draw:image)]">
- <variable name="image" select=".//draw:image[1]"/>
-
- <variable name="image-description">
- <apply-templates/>
- </variable>
-
- <variable name="picture">
- <text>[[</text>
- <call-template name="mk-image-name">
- <with-param name="image" select="$image"/>
- <with-param name="frame" select="."/>
- <with-param name="extension" select="'.png'"/>
- </call-template>
- <text>|thumb</text>
- </variable>
-
- <!-- Picture markup + Horizontal & Vertical align -->
- <call-template name="mk-image-align">
- <with-param name="picture" select="$picture"/>
- </call-template>
+ <with-param name="style-name" select="'color'"/>
+ <with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
+ </call-template>
+ </if>
+ </otherwise>
+ </choose>
+ </variable>
+
+ <if test="string-length($style) &gt; 0">
+ <text>&lt;div style="</text>
+ <value-of select="$style"/>
+ <text>"&gt;</text>
+ </if>
+
+ <apply-templates/>
+
+ <if test="string-length($style) &gt; 0">
+ <text>&lt;/div&gt;</text>
+ </if>
+
+ <variable name="paragraph-right"
+ select="./following-sibling::*[1]/self::text:p"/>
+
+ <choose>
+ <when test="boolean($paragraph-right)">
+ <!--
+ Insert end of line only if not within a list. Within wiki lists,
+ a line break leaves the current list item.
+ -->
+ <choose>
+ <when test="boolean(ancestor::text:list-item)">
+ <text>&lt;br/&gt;</text>
+ </when>
+ <when test="$code">
+ <variable name="style-right">
+ <call-template name="mk-style-set">
+ <with-param name="node" select="$paragraph-right"/>
+ </call-template>
+ </variable>
+
+ <variable name="code-right"
+ select="($style-right mod (2 * $CODE_BIT)) - ($style-right mod ($CODE_BIT)) != 0"/>
+
+ <choose>
+ <when test="$code-right">
+ <choose>
+ <when test="$CODE_JOIN_PARAGRAPHS">
+ <value-of select="$NL"/>
+ </when>
+
+ <otherwise>
+ <value-of select="$NL"/>
+ <value-of select="' '"/>
+ <value-of select="$NL"/>
+ </otherwise>
+ </choose>
+ </when>
+ <otherwise>
+ <value-of select="$NL"/>
+ <value-of select="$NL"/>
+ </otherwise>
+ </choose>
+ </when>
+ <otherwise>
+ <value-of select="$NL"/>
+ <value-of select="$NL"/>
+ </otherwise>
+ </choose>
+ </when>
+ <when test="not(boolean(ancestor::text:note)) and (boolean(./following::*[1]/self::text:h) or boolean(./following::*[1]/self::table:table) or boolean(./following::*[1]/self::text:bibliography))">
+ <!-- Newline before following heading or table. -->
+ <value-of select="$NL"/>
+ <value-of select="$NL"/>
+ </when>
+ <when test="not(./following-sibling::*[1]) and name(./following::*[1])='text:p' and ancestor::text:list-item">
+ <!-- End of the list -->
+ <value-of select="$NL"/>
+ <value-of select="$NL"/>
+ </when>
+ </choose>
+ </template>
+
+ <template match="text:p[string-length(.) = 0 and string-length(preceding-sibling::*[1]/self::text:p) &gt; 0]">
+ <value-of select="$NL"/>
+ </template>
+
+ <!--
+ == Preformatted text ==
+ -->
+
+ <template match="text:s">
+ <variable name="style">
+ <call-template name="mk-style-set">
+ <with-param name="node" select="."/>
+ </call-template>
+ </variable>
+
+ <variable name="code"
+ select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
+
+ <if test="$code">
+ <choose>
+ <when test="@text:c">
+ <call-template name="mk-token">
+ <with-param name="level" select="@text:c"/>
+ <with-param name="char" select="' '"/>
+ </call-template>
+ </when>
+ <otherwise>
+ <value-of select="' '"/>
+ </otherwise>
+ </choose>
+ </if>
+ </template>
+
+ <template match="text:span[string-length(.) &gt; 0]">
+ <if test="boolean(@text:style-name)">
+ <variable name="style-element" select="key('style-ref', @text:style-name)"/>
+ <variable name="style">
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'background-color'"/>
+ <with-param name="style-property" select="$style-element/style:text-properties/@fo:background-color"/>
+ </call-template>
+ <call-template name="translate-style-property">
+ <with-param name="style-name" select="'color'"/>
+ <with-param name="style-property" select="$style-element/style:text-properties/@fo:color"/>
+ </call-template>
+ </variable>
+
+ <if test="string-length($style) &gt; 0">
+ <text>&lt;span style="</text>
+ <value-of select="$style"/>
+ <text>"&gt;</text>
+ </if>
+
+ <apply-templates/>
+
+ <if test="string-length($style) &gt; 0">
+ <text>&lt;/span&gt;</text>
+ </if>
+ </if>
+ </template>
+
+ <template match="text:tab">
+ <variable name="style">
+ <call-template name="mk-style-set">
+ <with-param name="node" select="."/>
+ </call-template>
+ </variable>
+
+ <variable name="code"
+ select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
+
+ <if test="$code">
+ <value-of select="$CODE_TAB_REPLACEMENT"/>
+ </if>
+ </template>
+
+ <template match="text:line-break">
+ <variable name="style">
+ <call-template name="mk-style-set">
+ <with-param name="node" select="."/>
+ </call-template>
+ </variable>
+
+ <variable name="code"
+ select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
+
+ <if test="$code">
+ <value-of select="$NL"/>
+ <value-of select="' '"/>
+ </if>
+ </template>
+
+ <!--
+ Footnotes
+ -->
+
+ <template match="text:note-body">
+ <variable name="note" select="./parent::text:note"/>
+
+ <if test="$note/@text:note-class = 'footnote'">
+ <text>&lt;ref name="</text>
+ <value-of select="$note/@text:id"/>
+ <text>"&gt;</text>
+ <apply-templates/>
+ <text>&lt;/ref&gt;</text>
+ </if>
+ </template>
+
+ <template match="text:note-ref[@text:note-class='footnote']">
+ <text>&lt;ref name="</text>
+ <value-of select="@text:ref-name"/>
+ <text>"/&gt;</text>
+ </template>
+
+
+ <!--
+ == Images ==
+ -->
+
+ <template match="draw:text-box[boolean(.//draw:image)]">
+ <variable name="image" select=".//draw:image[1]"/>
+
+ <variable name="image-description">
+ <apply-templates/>
+ </variable>
+
+ <variable name="picture">
+ <text>[[</text>
+ <call-template name="mk-image-name">
+ <with-param name="image" select="$image"/>
+ <with-param name="frame" select="."/>
+ <with-param name="extension" select="'.png'"/>
+ </call-template>
+ <text>|thumb</text>
+ </variable>
+
+ <!-- Picture markup + Horizontal & Vertical align -->
+ <call-template name="mk-image-align">
+ <with-param name="picture" select="$picture"/>
+ </call-template>
<!-- Image caption -->
<text>|</text>
- <value-of select="normalize-space($image-description)"/>
+ <value-of select="normalize-space($image-description)"/>
<text>]]</text>
- </template>
-
- <template match="draw:image[not(boolean(ancestor::draw:text-box))]">
- <variable name="picture">
- <text>[[</text>
- <call-template name="mk-image-name">
- <with-param name="image" select="."/>
- <with-param name="frame" select="parent::node()"/>
- </call-template>
- </variable>
-
- <!-- Picture markup + Horizontal & Vertical align -->
- <call-template name="mk-image-align">
- <with-param name="picture" select="$picture"/>
- </call-template>
-
- <!-- Image alt -->
- <if test="name(following-sibling::*)='svg:title'">
- <text>|alt="</text>
- <value-of select="following-sibling::*/text()"/>
- <text>"</text>
- </if>
-
- <text>]]</text>
- </template>
-
- <template name="mk-image-align">
- <param name="picture"/>
-
- <choose>
- <when test="name(..)='draw:frame' and boolean(../@draw:style-name)">
- <variable name="style-element" select="key('style-ref', ../@draw:style-name)"/>
- <choose>
- <when test="boolean($style-element/style:graphic-properties/@style:wrap)">
- <choose>
- <!-- wrap=none -->
- <when test="$style-element/style:graphic-properties/@style:wrap='none'">
- <text>{{clear}}</text>
- <value-of select="$NL"/>
- <value-of select="$picture"/>
- <choose>
- <when test="boolean($style-element/style:graphic-properties/@style:horizontal-pos)">
- <choose>
- <when test="$style-element/style:graphic-properties/@style:horizontal-pos='center'">
- <text>|center</text>
- </when>
- <otherwise>
- <text>|none</text>
- </otherwise>
- </choose>
- </when>
- <otherwise>
- <text>|none</text>
- </otherwise>
- </choose>
- </when>
- <!-- wrap != none -->
- <otherwise>
- <value-of select="$picture"/>
- <!-- Horizontal align -->
- <call-template name="mk-image-horizontal-align">
- <with-param name="style-element" select="$style-element"/>
- </call-template>
- <!-- Vertical align -->
- <call-template name="mk-image-vertical-align">
- <with-param name="style-element" select="$style-element"/>
- </call-template>
- </otherwise>
- </choose>
- </when>
- <!-- without wrap -->
- <otherwise>
- <value-of select="$picture"/>
- <!-- Horizontal align -->
- <call-template name="mk-image-horizontal-align">
- <with-param name="style-element" select="$style-element"/>
- </call-template>
- <!-- Vertical align -->
- <call-template name="mk-image-vertical-align">
- <with-param name="style-element" select="$style-element"/>
- </call-template>
- </otherwise>
- </choose>
- </when>
- <otherwise>
- <value-of select="$picture"/>
- </otherwise>
- </choose>
- </template>
-
- <template name="mk-image-horizontal-align">
- <param name="style-element"/>
-
- <if test="boolean($style-element/style:graphic-properties/@style:horizontal-pos)">
- <choose>
- <when test="$style-element/style:graphic-properties/@style:horizontal-pos='right'">
- <text>|right</text>
- </when>
- <when test="$style-element/style:graphic-properties/@style:horizontal-pos='left'">
- <text>|left</text>
- </when>
- </choose>
- </if>
- </template>
-
- <template name="mk-image-vertical-align">
- <param name="style-element"/>
-
- <if test="boolean($style-element/style:graphic-properties/@style:vertical-pos)">
- <choose>
- <when test="$style-element/style:graphic-properties/@style:vertical-pos='top'">
- <text>|top</text>
- </when>
- <when test="$style-element/style:graphic-properties/@style:vertical-pos='middle'">
- <text>|middle</text>
- </when>
- <when test="$style-element/style:graphic-properties/@style:vertical-pos='below'">
- <text>|below</text>
- </when>
- </choose>
- </if>
- </template>
-
- <template name="mk-image-name">
- <param name="image"/>
- <param name="frame"/>
- <param name="extension"/>
-
- <variable name="base-name">
- <call-template name="mk-base-name">
- <with-param name="href" select="$image/@xlink:href"/>
- </call-template>
- </variable>
-
- <if test="not(starts-with($base-name, 'Image:'))">
- <value-of select="'Image:'"/>
- </if>
- <value-of select="$base-name"/>
- <value-of select="$frame/@draw:name"/>
- <value-of select="'.png'"/>
- </template>
-
- <template name="mk-base-name">
- <param name="href"/>
-
- <variable name="result" select="substring-after($href, '/')"/>
- <choose>
- <when test="boolean($result)">
- <call-template name="mk-base-name">
- <with-param name="href" select="$result"/>
- </call-template>
- </when>
- <otherwise>
- <value-of select="$href"/>
- </otherwise>
- </choose>
- </template>
-
- <!-- Frames -->
-
- <template match="draw:frame">
- <choose>
- <when test="draw:object/math:math">
- <apply-templates select="draw:object/math:math[1]"/>
- </when>
-
- <when test="draw:image">
- <apply-templates select="draw:image[1]"/>
- </when>
-
- <otherwise>
- <apply-templates select="./*[1]"/>
- </otherwise>
- </choose>
-
- </template>
-
- <!-- Formulas (Objects) -->
-
- <include href="math/mmltex.xsl"/>
-
- <template match="math:math" priority="1">
- <text>&lt;math&gt;</text>
- <apply-templates/>
- <text>&lt;/math&gt;</text>
- </template>
-
-
- <!--
- References
- -->
-
- <!-- TODO: text:bibliography-mark -->
-
- <template match="text:reference-ref">
- <variable name="reference-mark" select="key('reference-resolution', @text:ref-name)"/>
-
- <choose>
- <when test="boolean($reference-mark)">
- <!--
- In wiki syntax, only a local reference to a heading can be inserted.
- If the link target is a descendant of a heading element, a link can be
- inserted in the result. -->
- <variable name="header-anchor" select="$reference-mark/ancestor::text:h[1]"/>
- <if test="boolean($header-anchor)">
- <text>[[#</text>
- <value-of select="string($header-anchor)"/>
- <text>|</text>
- </if>
-
- <variable name="reference-text" select="string(.)"/>
-
- <choose>
- <!-- Check, whether the reference text is cached in the document. -->
- <when test="string-length($reference-text) &gt; 0">
- <value-of select="$reference-text"/>
- </when>
-
- <otherwise>
- <!--
- TODO: Evaluate the @text:reference-format attribute and
- generate the replacement text (difficult).-->
- <text>(REFERENCE TEXT UNAVAILABLE: "</text>
- <value-of select="@text:ref-name"/>
- <text>")</text>
- </otherwise>
- </choose>
-
- <if test="boolean($header-anchor)">
- <text>]]</text>
- </if>
- </when>
-
- <otherwise>
- <text>(UNDEFINED REFERENCE: "</text>
- <value-of select="@text:ref-name"/>
- <text>")</text>
- </otherwise>
- </choose>
- </template>
-
- <template match="text:reference-mark">
- <!-- TODO: Output an anchor. -->
- <apply-templates/>
- </template>
-
- <template match="text:reference-mark-start">
- <!-- TODO: Output an anchor. -->
- </template>
-
- <template match="text:bookmark-start">
- <if test="boolean(@text:name)">
- <variable name="bookmark">
- <choose>
- <when test="contains(@text:name,'_')">
- <value-of select="translate(@text:name,'_','')"/>
- </when>
- <otherwise>
- <value-of select="@text:name"/>
- </otherwise>
- </choose>
- </variable>
- <text>{{anchor|</text>
- <value-of select="$bookmark"/>
- <text>}} </text>
- </if>
- <apply-templates/>
- </template>
-
- <!--
- == Plain text ==
- -->
-
- <template match="text:p/text() | text:h/text() | text:span/text() | text:sequence/text() | text:sequence-ref/text() | text:a/text() | text:bookmark-ref/text() | text:reference-mark/text() | text:date/text() | text:time/text() | text:page-number/text() | text:sender-firstname/text() | text:sender-lastname/text() | text:sender-initials/text() | text:sender-title/text() | text:sender-position/text() | text:sender-email/text() | text:sender-phone-private/text() | text:sender-fax/text() | text:sender-company/text() | text:sender-phone-work/text() | text:sender-street/text() | text:sender-city/text() | text:sender-postal-code/text() | text:sender-country/text() | text:sender-state-or-province/text() | text:author-name/text() | text:author-initials/text() | text:chapter/text() | text:file-name/text() | text:template-name/text() | text:sheet-name/text() | text:variable-get/text() | text:variable-input/text() | text:user-field-get/text() | text:user-field-input/text() | text:expression/text() | text:text-input/text() | text:initial-creator/text() | text:creation-date/text() | text:creation-time/text() | text:description/text() | text:user-defined/text() | text:print-date/text() | text:printed-by/text() | text:title/text() | text:subject/text() | text:keywords/text() | text:editing-cycles/text() | text:editing-duration/text() | text:modification-date/text() | text:creator/text() | text:modification-time/text() | text:page-count/text() | text:paragraph-count/text() | text:word-count/text() | text:character-count/text() | text:table-count/text() | text:image-count/text() | text:object-count/text() | text:database-display/text() | text:database-row-number/text() | text:database-name/text() | text:page-variable-get/text() | text:placeholder/text() | text:conditional-text/text() | text:hidden-text/text() | text:execute-macro/text() | text:dde-connection/text() | text:measure/text() | text:table-formula/text()">
- <choose>
- <when test="boolean(./ancestor::table:table-header-rows) or boolean(./ancestor::text:h)">
- <!--
- No explicit styles within table headings or section headings,
- because those styles are consistently declared by the Wiki engine. -->
- <value-of select="."/>
- </when>
-
- <when test="string-length(.) &gt; 0">
- <variable name="style">
- <call-template name="mk-style-set">
- <with-param name="node" select="./parent::node()"/>
- </call-template>
- </variable>
-
- <variable name="current-paragraph"
- select="./ancestor::text:p[1]"/>
- <variable name="paragraph-id"
- select="generate-id($current-paragraph)"/>
- <variable name="frames"
- select="$current-paragraph/descendant::draw:frame"/>
- <variable name="frame-count"
- select="count($frames)"/>
-
- <!--
- The current style context consists of all text nodes that are
- descendants of the paragraph ancestor of this text node but not
- descendants of any frame nodes that are descendants of the current
- text nodes paragraph.
- -->
- <variable name="context"
- select="$current-paragraph//text()[not(boolean(./ancestor::draw:frame[1]) and count(./ancestor::draw:frame[1] | $frames) = $frame-count)]"/>
- <variable name="context-size" select="count($context)"/>
-
- <variable name="context-index">
- <call-template name="mk-context-index">
- <with-param name="current-id" select="generate-id(.)"/>
- <with-param name="context" select="$context"/>
- <with-param name="test-index" select="1"/>
- </call-template>
- </variable>
-
- <variable name="style-left">
- <choose>
- <when test="$context-index &gt; 1">
- <variable name="left" select="$context[$context-index - 1]"/>
- <!--
- The preceding text node is a child of this nodes topmost
- styled ancestor. This means that the result of the
- transformation will be directly concatenated.
- -->
- <call-template name="mk-style-set">
- <with-param name="node" select="$left"/>
- </call-template>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
- <variable name="style-right">
- <choose>
- <when test="$context-index &lt; count($context)">
- <variable name="right" select="$context[$context-index + 1]"/>
- <!--
- The preceding text node is a child of this nodes topmost
- styled ancestor. This means that the result of the
- transformation will be directly concatenated.
- -->
- <call-template name="mk-style-set">
- <with-param name="node" select="$right"/>
- </call-template>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
-
- <variable name="bold"
- select="($style mod (2 * $BOLD_BIT)) != 0"/>
- <variable name="italic"
- select="($style mod (2 * $ITALIC_BIT)) - ($style mod ($ITALIC_BIT)) != 0"/>
- <variable name="underline"
- select="($style mod (2 * $UNDERLINE_BIT)) - ($style mod ($UNDERLINE_BIT)) != 0"/>
- <variable name="superscript"
- select="($style mod (2 * $SUPERSCRIPT_BIT)) - ($style mod ($SUPERSCRIPT_BIT)) != 0"/>
- <variable name="subscript"
- select="($style mod (2 * $SUBSCRIPT_BIT)) - ($style mod ($SUBSCRIPT_BIT)) != 0"/>
- <variable name="code"
- select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
- <variable name="typewriter"
- select="($style mod (2 * $TYPEWRITER_BIT)) - ($style mod ($TYPEWRITER_BIT)) != 0"/>
-
- <variable name="bold-left"
- select="($style-left mod (2 * $BOLD_BIT)) != 0"/>
- <variable name="italic-left"
- select="($style-left mod (2 * $ITALIC_BIT)) - ($style-left mod ($ITALIC_BIT)) != 0"/>
- <variable name="underline-left"
- select="($style-left mod (2 * $UNDERLINE_BIT)) - ($style-left mod ($UNDERLINE_BIT)) != 0"/>
- <variable name="superscript-left"
- select="($style-left mod (2 * $SUPERSCRIPT_BIT)) - ($style-left mod ($SUPERSCRIPT_BIT)) != 0"/>
- <variable name="subscript-left"
- select="($style-left mod (2 * $SUBSCRIPT_BIT)) - ($style-left mod ($SUBSCRIPT_BIT)) != 0"/>
- <variable name="typewriter-left"
- select="($style-left mod (2 * $TYPEWRITER_BIT)) - ($style-left mod ($TYPEWRITER_BIT)) != 0"/>
-
- <variable name="bold-right"
- select="($style-right mod (2 * $BOLD_BIT)) != 0"/>
- <variable name="italic-right"
- select="($style-right mod (2 * $ITALIC_BIT)) - ($style-right mod ($ITALIC_BIT)) != 0"/>
- <variable name="underline-right"
- select="($style-right mod (2 * $UNDERLINE_BIT)) - ($style-right mod ($UNDERLINE_BIT)) != 0"/>
- <variable name="superscript-right"
- select="($style-right mod (2 * $SUPERSCRIPT_BIT)) - ($style-right mod ($SUPERSCRIPT_BIT)) != 0"/>
- <variable name="subscript-right"
- select="($style-right mod (2 * $SUBSCRIPT_BIT)) - ($style-right mod ($SUBSCRIPT_BIT)) != 0"/>
- <variable name="typewriter-right"
- select="($style-right mod (2 * $TYPEWRITER_BIT)) - ($style-right mod ($TYPEWRITER_BIT)) != 0"/>
-
- <!-- Debugging: Add style infos to the output. -->
- <!--
- <value-of select="'{'"/>
- <value-of select="$style-left"/>
- <value-of select="'-'"/>
- <value-of select="$style"/>
- <value-of select="','"/>
- <value-of select="$context-size"/>
- <value-of select="'}'"/>
- -->
-
- <if test="$superscript and not($superscript-left) and not(boolean(ancestor::text:note))">
- <text>&lt;sup&gt;</text>
- </if>
- <if test="$subscript and not($subscript-left)">
- <text>&lt;sub&gt;</text>
- </if>
- <if test="not($code) and $typewriter and not($typewriter-left)">
- <text>&lt;tt&gt;</text>
- </if>
- <if test="$underline and not($underline-left)">
- <text>&lt;u&gt;</text>
- </if>
- <if test="$bold and not($bold-left)">
- <text>'''</text>
- </if>
- <if test="$italic and not($italic-left)">
- <text>''</text>
- </if>
-
- <call-template name="render-quoted-text">
- <with-param name="text" select="."/>
- </call-template>
-
- <if test="$italic and not($italic-right)">
- <text>''</text>
- </if>
- <if test="$bold and not($bold-right)">
- <text>'''</text>
- </if>
- <if test="$underline and not($underline-right)">
- <text>&lt;/u&gt;</text>
- </if>
- <if test="not($code) and $typewriter and not($typewriter-right)">
- <text>&lt;/tt&gt;</text>
- </if>
- <if test="$subscript and not($subscript-right)">
- <text>&lt;/sub&gt;</text>
- </if>
- <if test="$superscript and not($superscript-right) and not(boolean(ancestor::text:note))">
- <text>&lt;/sup&gt;</text>
- </if>
-
- <!-- Debugging: Add style details to the output. -->
- <!--
- <value-of select="'{'"/>
- <value-of select="$style"/>
- <value-of select="'-'"/>
- <value-of select="$style-right"/>
- <value-of select="'}'"/>
- -->
-
- </when>
- </choose>
- </template>
-
- <!--
- Function for looking up the position of a node identified by the given
- 'current-id' within a node set 'context'.
-
- The search starts with the index 'test-index'. The search is recursive
- in the 'test-index' argument. To save recursion depth, each recursive call
- iteratively tests a fixed number of indexes (by loop unrolling).
- -->
- <template name="mk-context-index">
- <param name="current-id"/>
- <param name="context"/>
- <param name="test-index"/>
-
- <variable name="context-size" select="count($context)"/>
-
- <choose>
- <when test="context-size &lt; $test-index">
- </when>
- <when test="$current-id = generate-id($context[$test-index])">
- <value-of select="$test-index"/>
- </when>
- <when test="context-size &lt; ($test-index + 1)">
- </when>
- <when test="$current-id = generate-id($context[$test-index + 1])">
- <value-of select="$test-index + 1"/>
- </when>
- <when test="context-size &lt; ($test-index + 2)">
- </when>
- <when test="$current-id = generate-id($context[$test-index + 2])">
- <value-of select="$test-index + 2"/>
- </when>
- <when test="context-size &lt; ($test-index + 3)">
- </when>
- <when test="$current-id = generate-id($context[$test-index + 3])">
- <value-of select="$test-index + 3"/>
- </when>
- <when test="context-size &lt; ($test-index + 4)">
- </when>
- <when test="$current-id = generate-id($context[$test-index + 4])">
- <value-of select="$test-index + 4"/>
- </when>
- <when test="context-size &lt; ($test-index + 5)">
- </when>
- <when test="$current-id = generate-id($context[$test-index + 5])">
- <value-of select="$test-index + 5"/>
- </when>
- <when test="context-size &lt; ($test-index + 6)">
- </when>
- <otherwise>
- <call-template name="mk-context-index">
- <with-param name="current-id" select="$current-id"/>
- <with-param name="context" select="$context"/>
- <with-param name="test-index" select="$test-index + 6"/>
- </call-template>
- </otherwise>
- </choose>
- </template>
-
- <template name="render-quoted-text">
- <param name="text"/>
-
- <choose>
- <when test="contains($text, '[[') or starts-with($text, '----') or starts-with($text, '=') or starts-with($text, '*') or starts-with($text, ';') or starts-with($text, '#')">
- <text>&lt;nowiki&gt;</text>
- <call-template name="render-encoded-text">
- <with-param name="text" select="$text"/>
- </call-template>
- <text>&lt;/nowiki&gt;</text>
- </when>
- <otherwise>
- <call-template name="render-encoded-text">
- <with-param name="text" select="$text"/>
- </call-template>
- </otherwise>
- </choose>
- </template>
-
- <template name="render-escaped-text">
- <param name="text"/>
-
- <choose>
- <when test="contains($text, '&lt;')">
- <call-template name="render-encoded-text">
- <with-param name="text" select="substring-before($text, '&lt;')"/>
- </call-template>
- <value-of select="'&amp;lt;'"/>
- <call-template name="render-escaped-text">
- <with-param name="text" select="substring-after($text, '&lt;')"/>
- </call-template>
- </when>
- <otherwise>
- <call-template name="render-encoded-text">
- <with-param name="text" select="$text"/>
- </call-template>
- </otherwise>
- </choose>
- </template>
-
- <template name="render-encoded-text">
- <param name="text"/>
-
- <choose>
- <when test="contains($text, '&#160;')">
- <value-of select="substring-before($text, '&#160;')"/>
- <value-of select="'&amp;nbsp;'"/>
- <call-template name="render-encoded-text">
- <with-param name="text" select="substring-after($text, '&#160;')"/>
- </call-template>
- </when>
- <otherwise>
- <value-of select="$text"/>
- </otherwise>
- </choose>
- </template>
-
- <!--
- == Wiki styles: bold, italics, ... ==
- -->
-
- <template name="mk-style-set">
- <param name="node"/>
-
- <choose>
- <when test="$node/ancestor-or-self::*[@text:style-name]">
- <variable name="context" select="$node/ancestor-or-self::*[@text:style-name][1]"/>
- <call-template name="mk-style-set-internal">
- <with-param name="node" select="$context"/>
- <with-param name="style" select="key('style-ref', $context/@text:style-name)"/>
- <with-param name="style-set" select="$NO_STYLE"/>
- <with-param name="style-mask" select="$NO_STYLE"/>
- </call-template>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </template>
-
- <!--
- Compute the wiki style set that corresponds
- to the given office style at the given context node.
-
- @param node
- A node in which context the style is computed. If neither the given style
- nor one of its linked styles does specify a style of the given type,
- ancestor nodes of the given context node are considered.
- @param style
- A style:style element node. The style of the requested type is searched
- in the given style and its linked styles.
- @style-set
- A bit set of styles already defined by the context.
- @style-mask
- A bit set of styles that must not be taken from the currently inspected
- style, because those styles are already defined by the context.
-
- @return A bit set composed of the wiki style constants.
- -->
- <template name="mk-style-set-internal">
- <param name="node"/>
- <param name="style"/>
- <param name="style-set"/>
- <param name="style-mask"/>
-
- <variable name="text-properties" select="$style/style:text-properties"/>
-
- <!-- Decompose style-mask into individual bits. -->
- <variable name="bold-requested"
- select="($style-mask mod (2 * $BOLD_BIT)) = 0"/>
- <variable name="italic-requested"
- select="($style-mask mod (2 * $ITALIC_BIT)) - ($style-mask mod ($ITALIC_BIT)) = 0"/>
- <variable name="underline-requested"
- select="($style-mask mod (2 * $UNDERLINE_BIT)) - ($style-mask mod ($UNDERLINE_BIT)) = 0"/>
- <variable name="superscript-requested"
- select="($style-mask mod (2 * $SUPERSCRIPT_BIT)) - ($style-mask mod ($SUPERSCRIPT_BIT)) = 0"/>
- <variable name="subscript-requested"
- select="($style-mask mod (2 * $SUBSCRIPT_BIT)) - ($style-mask mod ($SUBSCRIPT_BIT)) = 0"/>
- <variable name="typewriter-requested"
- select="($style-mask mod (2 * $TYPEWRITER_BIT)) - ($style-mask mod ($TYPEWRITER_BIT)) = 0"/>
- <variable name="code-requested"
- select="($style-mask mod (2 * $CODE_BIT)) - ($style-mask mod ($CODE_BIT)) = 0"/>
- <variable name="center-requested"
- select="($style-mask mod (2 * $CENTER_BIT)) - ($style-mask mod ($CENTER_BIT)) = 0"/>
- <variable name="right-requested"
- select="($style-mask mod (2 * $RIGHT_BIT)) - ($style-mask mod ($RIGHT_BIT)) = 0"/>
-
- <!-- Extract styles that are not already defined by the context. -->
- <variable name="bold-style">
- <choose>
- <when test="$bold-requested and boolean($text-properties/@fo:font-weight='bold')">
- <!-- Bold found in current style. -->
- <value-of select="$BOLD_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
- <variable name="bold-mask">
- <choose>
- <when test="$bold-requested and boolean($text-properties/@fo:font-weight)">
- <!--
- Other value than "bold" means that the character style is not
- bold and no parent style must be considered.
- -->
- <value-of select="$BOLD_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
-
- <variable name="italic-style">
- <choose>
- <when test="$italic-requested and boolean($text-properties/@fo:font-style='italic')">
- <!-- Italic found in current style. -->
- <value-of select="$ITALIC_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
- <variable name="italic-mask">
- <choose>
- <when test="$italic-requested and boolean($text-properties/@fo:font-style)">
- <!--
- Other value than "italic" means that the character style is not
- italic and no parent style must be considered.
- -->
- <value-of select="$ITALIC_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
-
- <variable name="underline-style">
- <choose>
- <when test="$underline-requested and boolean($text-properties/@style:text-underline-style='solid')">
- <!-- Underline found in current style. -->
- <value-of select="$UNDERLINE_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
- <variable name="underline-mask">
- <choose>
- <when test="$underline-requested and boolean($text-properties/@style:text-underline-style='solid')">
- <!--
- Other value than "underline" means that the character style is not
- underline and no parent style must be considered.
- -->
- <value-of select="$UNDERLINE_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
-
- <variable name="superscript-style">
- <choose>
- <when test="$superscript-requested and contains($text-properties/@style:text-position, 'super')">
- <value-of select="$SUPERSCRIPT_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
- <variable name="superscript-mask">
- <choose>
- <when test="$superscript-requested and boolean($text-properties/@style:text-position)">
- <value-of select="$SUPERSCRIPT_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
-
- <variable name="subscript-style">
- <choose>
- <when test="$subscript-requested and contains($text-properties/@style:text-position, 'sub')">
- <value-of select="$SUBSCRIPT_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
- <variable name="subscript-mask">
- <choose>
- <when test="$subscript-requested and boolean($text-properties/@style:text-position)">
- <value-of select="$SUBSCRIPT_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
-
- <variable name="typewriter-style">
- <choose>
- <when test="$typewriter-requested and ($style/@style:family='text') and boolean($text-properties/@style:font-name)">
- <variable name="font-face"
- select="key('font-face-ref', $text-properties/@style:font-name)"/>
- <choose>
- <when test="$font-face/@style:font-pitch='fixed'">
- <value-of select="$TYPEWRITER_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
- <variable name="typewriter-mask">
- <choose>
- <!-- Note: Suppress the typewriter style on text within a code paragraph. -->
- <when test="$typewriter-requested and boolean($text-properties/@style:font-name)">
- <value-of select="$TYPEWRITER_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
-
- <variable name="code-style">
- <choose>
- <when test="$code-requested and ($style/@style:family='paragraph') and boolean($text-properties/@style:font-name)">
- <variable name="font-face"
- select="key('font-face-ref', $text-properties/@style:font-name)"/>
- <choose>
- <when test="$font-face/@style:font-pitch='fixed' or (boolean(@style:display-name) and contains($CODE_STYLES, $style/@style:display-name))">
- <value-of select="$CODE_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
- <variable name="code-mask">
- <choose>
- <when test="$code-requested and ($style/@style:family='paragraph') and boolean($text-properties/@style:font-name)">
- <value-of select="$CODE_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
-
- <variable name="center-style">
- <choose>
- <when test="$center-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align='center')">
- <value-of select="$CENTER_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
- <variable name="center-mask">
- <choose>
- <when test="$center-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align)">
- <value-of select="$CENTER_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
-
- <variable name="right-style">
- <choose>
- <when test="$right-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align='end')">
- <value-of select="$RIGHT_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
- <variable name="right-mask">
- <choose>
- <when test="$center-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align)">
- <value-of select="$RIGHT_BIT"/>
- </when>
- <otherwise>
- <value-of select="$NO_STYLE"/>
- </otherwise>
- </choose>
- </variable>
-
-
- <!-- Compute the updated styles and mask. -->
- <!--
- Note: The bit masks style-mask, bold-style, italic-style,... are
- guaranteed to be disjoint, therefore, addition can be use instead
- of bitwise or (which is missing in XPath). -->
- <variable name="updated-style"
- select="$style-set + $bold-style + $italic-style + $underline-style + $superscript-style + $subscript-style + $code-style + $typewriter-style + $center-style + $right-style"/>
- <variable name="updated-mask"
- select="$style-mask + $bold-mask + $italic-mask + $underline-mask + $superscript-mask + $subscript-mask + $code-mask + $typewriter-mask + $center-mask + $right-mask"/>
-
- <!-- Inspect linked and nested styles. -->
- <choose>
- <when test="boolean($style/@style:parent-style-name)">
- <!-- Look through the style, the current style is based on. -->
- <call-template name="mk-style-set-internal">
- <with-param name="node" select="$node"/>
- <with-param name="style" select="key('style-ref', $style/@style:parent-style-name)"/>
- <with-param name="style-set" select="$updated-style"/>
- <with-param name="style-mask" select="$updated-mask"/>
- </call-template>
- </when>
- <otherwise>
- <variable name="ancestors" select="$node/ancestor::*[@text:style-name][1]"/>
-
- <!-- Debugging: Print currently inspected style. -->
- <!--
- <message>
- <value-of select="'{'"/>
- <value-of select="$style/@style:name"/>
- <value-of select="','"/>
- <value-of select="$updated-style"/>
- <value-of select="','"/>
- <value-of select="$updated-mask"/>
- <value-of select="','"/>
- <value-of select="local-name($ancestors)"/>
- <value-of select="',('"/>
- <value-of select="$node"/>
- <value-of select="')'"/>
- <value-of select="'}'"/>
- </message>
- -->
-
- <!--
- If there is an ancestor that has a style, use that style,
- otherwise, a style is not found. -->
- <choose>
- <when test="boolean($ancestors)">
- <!-- Look through the style of the nearest ancestor that has a style. -->
- <call-template name="mk-style-set-internal">
- <with-param name="node" select="$ancestors"/>
- <with-param name="style" select="key('style-ref', $ancestors/@text:style-name)"/>
- <with-param name="style-set" select="$updated-style"/>
- <with-param name="style-mask" select="$updated-mask"/>
- </call-template>
- </when>
- <otherwise>
- <!-- No more styles to inspect. Return the result. -->
- <value-of select="$updated-style"/>
- </otherwise>
- </choose>
- </otherwise>
- </choose>
- </template>
-
-
- <!--
- == Descending the tree ==
- -->
-
- <template match="/">
- <apply-templates/>
- <value-of select="$NL"/>
- <if test="boolean(//text:note[@text:note-class='footnote'])">
- <value-of select="$NL"/>
- <text>----</text>
- <value-of select="$NL"/>
- <text>&lt;references/&gt;</text>
- <value-of select="$NL"/>
- </if>
- </template>
-
- <template match="office:document-content">
- <apply-templates/>
- </template>
-
- <template match="office:body">
- <apply-templates/>
- </template>
-
- <template match="text:tracked-changes">
- <!-- Ignore change history. -->
- </template>
-
- <template match="office:* | text:* | draw:text-box | draw:a">
- <apply-templates/>
- </template>
-
- <template match="node()">
- </template>
+ </template>
+
+ <template match="draw:image[not(boolean(ancestor::draw:text-box))]">
+ <variable name="picture">
+ <text>[[</text>
+ <call-template name="mk-image-name">
+ <with-param name="image" select="."/>
+ <with-param name="frame" select="parent::node()"/>
+ </call-template>
+ </variable>
+
+ <!-- Picture markup + Horizontal & Vertical align -->
+ <call-template name="mk-image-align">
+ <with-param name="picture" select="$picture"/>
+ </call-template>
+
+ <!-- Image alt -->
+ <if test="name(following-sibling::*)='svg:title'">
+ <text>|alt="</text>
+ <value-of select="following-sibling::*/text()"/>
+ <text>"</text>
+ </if>
+
+ <text>]]</text>
+ </template>
+
+ <template name="mk-image-align">
+ <param name="picture"/>
+
+ <choose>
+ <when test="name(..)='draw:frame' and boolean(../@draw:style-name)">
+ <variable name="style-element" select="key('style-ref', ../@draw:style-name)"/>
+ <choose>
+ <when test="boolean($style-element/style:graphic-properties/@style:wrap)">
+ <choose>
+ <!-- wrap=none -->
+ <when test="$style-element/style:graphic-properties/@style:wrap='none'">
+ <text>{{clear}}</text>
+ <value-of select="$NL"/>
+ <value-of select="$picture"/>
+ <choose>
+ <when test="boolean($style-element/style:graphic-properties/@style:horizontal-pos)">
+ <choose>
+ <when test="$style-element/style:graphic-properties/@style:horizontal-pos='center'">
+ <text>|center</text>
+ </when>
+ <otherwise>
+ <text>|none</text>
+ </otherwise>
+ </choose>
+ </when>
+ <otherwise>
+ <text>|none</text>
+ </otherwise>
+ </choose>
+ </when>
+ <!-- wrap != none -->
+ <otherwise>
+ <value-of select="$picture"/>
+ <!-- Horizontal align -->
+ <call-template name="mk-image-horizontal-align">
+ <with-param name="style-element" select="$style-element"/>
+ </call-template>
+ <!-- Vertical align -->
+ <call-template name="mk-image-vertical-align">
+ <with-param name="style-element" select="$style-element"/>
+ </call-template>
+ </otherwise>
+ </choose>
+ </when>
+ <!-- without wrap -->
+ <otherwise>
+ <value-of select="$picture"/>
+ <!-- Horizontal align -->
+ <call-template name="mk-image-horizontal-align">
+ <with-param name="style-element" select="$style-element"/>
+ </call-template>
+ <!-- Vertical align -->
+ <call-template name="mk-image-vertical-align">
+ <with-param name="style-element" select="$style-element"/>
+ </call-template>
+ </otherwise>
+ </choose>
+ </when>
+ <otherwise>
+ <value-of select="$picture"/>
+ </otherwise>
+ </choose>
+ </template>
+
+ <template name="mk-image-horizontal-align">
+ <param name="style-element"/>
+
+ <if test="boolean($style-element/style:graphic-properties/@style:horizontal-pos)">
+ <choose>
+ <when test="$style-element/style:graphic-properties/@style:horizontal-pos='right'">
+ <text>|right</text>
+ </when>
+ <when test="$style-element/style:graphic-properties/@style:horizontal-pos='left'">
+ <text>|left</text>
+ </when>
+ </choose>
+ </if>
+ </template>
+
+ <template name="mk-image-vertical-align">
+ <param name="style-element"/>
+
+ <if test="boolean($style-element/style:graphic-properties/@style:vertical-pos)">
+ <choose>
+ <when test="$style-element/style:graphic-properties/@style:vertical-pos='top'">
+ <text>|top</text>
+ </when>
+ <when test="$style-element/style:graphic-properties/@style:vertical-pos='middle'">
+ <text>|middle</text>
+ </when>
+ <when test="$style-element/style:graphic-properties/@style:vertical-pos='below'">
+ <text>|below</text>
+ </when>
+ </choose>
+ </if>
+ </template>
+
+ <template name="mk-image-name">
+ <param name="image"/>
+ <param name="frame"/>
+ <param name="extension"/>
+
+ <variable name="base-name">
+ <call-template name="mk-base-name">
+ <with-param name="href" select="$image/@xlink:href"/>
+ </call-template>
+ </variable>
+
+ <if test="not(starts-with($base-name, 'Image:'))">
+ <value-of select="'Image:'"/>
+ </if>
+ <value-of select="$base-name"/>
+ <value-of select="$frame/@draw:name"/>
+ <value-of select="'.png'"/>
+ </template>
+
+ <template name="mk-base-name">
+ <param name="href"/>
+
+ <variable name="result" select="substring-after($href, '/')"/>
+ <choose>
+ <when test="boolean($result)">
+ <call-template name="mk-base-name">
+ <with-param name="href" select="$result"/>
+ </call-template>
+ </when>
+ <otherwise>
+ <value-of select="$href"/>
+ </otherwise>
+ </choose>
+ </template>
+
+ <!-- Frames -->
+
+ <template match="draw:frame">
+ <choose>
+ <when test="draw:object/math:math">
+ <apply-templates select="draw:object/math:math[1]"/>
+ </when>
+
+ <when test="draw:image">
+ <apply-templates select="draw:image[1]"/>
+ </when>
+
+ <otherwise>
+ <apply-templates select="./*[1]"/>
+ </otherwise>
+ </choose>
+
+ </template>
+
+ <!-- Formulas (Objects) -->
+
+ <include href="math/mmltex.xsl"/>
+
+ <template match="math:math" priority="1">
+ <text>&lt;math&gt;</text>
+ <apply-templates/>
+ <text>&lt;/math&gt;</text>
+ </template>
+
+
+ <!--
+ References
+ -->
+
+ <!-- TODO: text:bibliography-mark -->
+
+ <template match="text:reference-ref">
+ <variable name="reference-mark" select="key('reference-resolution', @text:ref-name)"/>
+
+ <choose>
+ <when test="boolean($reference-mark)">
+ <!--
+ In wiki syntax, only a local reference to a heading can be inserted.
+ If the link target is a descendant of a heading element, a link can be
+ inserted in the result. -->
+ <variable name="header-anchor" select="$reference-mark/ancestor::text:h[1]"/>
+ <if test="boolean($header-anchor)">
+ <text>[[#</text>
+ <value-of select="string($header-anchor)"/>
+ <text>|</text>
+ </if>
+
+ <variable name="reference-text" select="string(.)"/>
+
+ <choose>
+ <!-- Check, whether the reference text is cached in the document. -->
+ <when test="string-length($reference-text) &gt; 0">
+ <value-of select="$reference-text"/>
+ </when>
+
+ <otherwise>
+ <!--
+ TODO: Evaluate the @text:reference-format attribute and
+ generate the replacement text (difficult).-->
+ <text>(REFERENCE TEXT UNAVAILABLE: "</text>
+ <value-of select="@text:ref-name"/>
+ <text>")</text>
+ </otherwise>
+ </choose>
+
+ <if test="boolean($header-anchor)">
+ <text>]]</text>
+ </if>
+ </when>
+
+ <otherwise>
+ <text>(UNDEFINED REFERENCE: "</text>
+ <value-of select="@text:ref-name"/>
+ <text>")</text>
+ </otherwise>
+ </choose>
+ </template>
+
+ <template match="text:reference-mark">
+ <!-- TODO: Output an anchor. -->
+ <apply-templates/>
+ </template>
+
+ <template match="text:reference-mark-start">
+ <!-- TODO: Output an anchor. -->
+ </template>
+
+ <template match="text:bookmark-start">
+ <if test="boolean(@text:name)">
+ <variable name="bookmark">
+ <choose>
+ <when test="contains(@text:name,'_')">
+ <value-of select="translate(@text:name,'_','')"/>
+ </when>
+ <otherwise>
+ <value-of select="@text:name"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <text>{{anchor|</text>
+ <value-of select="$bookmark"/>
+ <text>}} </text>
+ </if>
+ <apply-templates/>
+ </template>
+
+ <!--
+ == Plain text ==
+ -->
+
+ <template match="text:p/text() | text:h/text() | text:span/text() | text:sequence/text() | text:sequence-ref/text() | text:a/text() | text:bookmark-ref/text() | text:reference-mark/text() | text:date/text() | text:time/text() | text:page-number/text() | text:sender-firstname/text() | text:sender-lastname/text() | text:sender-initials/text() | text:sender-title/text() | text:sender-position/text() | text:sender-email/text() | text:sender-phone-private/text() | text:sender-fax/text() | text:sender-company/text() | text:sender-phone-work/text() | text:sender-street/text() | text:sender-city/text() | text:sender-postal-code/text() | text:sender-country/text() | text:sender-state-or-province/text() | text:author-name/text() | text:author-initials/text() | text:chapter/text() | text:file-name/text() | text:template-name/text() | text:sheet-name/text() | text:variable-get/text() | text:variable-input/text() | text:user-field-get/text() | text:user-field-input/text() | text:expression/text() | text:text-input/text() | text:initial-creator/text() | text:creation-date/text() | text:creation-time/text() | text:description/text() | text:user-defined/text() | text:print-date/text() | text:printed-by/text() | text:title/text() | text:subject/text() | text:keywords/text() | text:editing-cycles/text() | text:editing-duration/text() | text:modification-date/text() | text:creator/text() | text:modification-time/text() | text:page-count/text() | text:paragraph-count/text() | text:word-count/text() | text:character-count/text() | text:table-count/text() | text:image-count/text() | text:object-count/text() | text:database-display/text() | text:database-row-number/text() | text:database-name/text() | text:page-variable-get/text() | text:placeholder/text() | text:conditional-text/text() | text:hidden-text/text() | text:execute-macro/text() | text:dde-connection/text() | text:measure/text() | text:table-formula/text()">
+ <choose>
+ <when test="boolean(./ancestor::table:table-header-rows) or boolean(./ancestor::text:h)">
+ <!--
+ No explicit styles within table headings or section headings,
+ because those styles are consistently declared by the Wiki engine. -->
+ <value-of select="."/>
+ </when>
+
+ <when test="string-length(.) &gt; 0">
+ <variable name="style">
+ <call-template name="mk-style-set">
+ <with-param name="node" select="./parent::node()"/>
+ </call-template>
+ </variable>
+
+ <variable name="current-paragraph"
+ select="./ancestor::text:p[1]"/>
+ <variable name="paragraph-id"
+ select="generate-id($current-paragraph)"/>
+ <variable name="frames"
+ select="$current-paragraph/descendant::draw:frame"/>
+ <variable name="frame-count"
+ select="count($frames)"/>
+
+ <!--
+ The current style context consists of all text nodes that are
+ descendants of the paragraph ancestor of this text node but not
+ descendants of any frame nodes that are descendants of the current
+ text nodes paragraph.
+ -->
+ <variable name="context"
+ select="$current-paragraph//text()[not(boolean(./ancestor::draw:frame[1]) and count(./ancestor::draw:frame[1] | $frames) = $frame-count)]"/>
+ <variable name="context-size" select="count($context)"/>
+
+ <variable name="context-index">
+ <call-template name="mk-context-index">
+ <with-param name="current-id" select="generate-id(.)"/>
+ <with-param name="context" select="$context"/>
+ <with-param name="test-index" select="1"/>
+ </call-template>
+ </variable>
+
+ <variable name="style-left">
+ <choose>
+ <when test="$context-index &gt; 1">
+ <variable name="left" select="$context[$context-index - 1]"/>
+ <!--
+ The preceding text node is a child of this nodes topmost
+ styled ancestor. This means that the result of the
+ transformation will be directly concatenated.
+ -->
+ <call-template name="mk-style-set">
+ <with-param name="node" select="$left"/>
+ </call-template>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <variable name="style-right">
+ <choose>
+ <when test="$context-index &lt; count($context)">
+ <variable name="right" select="$context[$context-index + 1]"/>
+ <!--
+ The preceding text node is a child of this nodes topmost
+ styled ancestor. This means that the result of the
+ transformation will be directly concatenated.
+ -->
+ <call-template name="mk-style-set">
+ <with-param name="node" select="$right"/>
+ </call-template>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+
+ <variable name="bold"
+ select="($style mod (2 * $BOLD_BIT)) != 0"/>
+ <variable name="italic"
+ select="($style mod (2 * $ITALIC_BIT)) - ($style mod ($ITALIC_BIT)) != 0"/>
+ <variable name="underline"
+ select="($style mod (2 * $UNDERLINE_BIT)) - ($style mod ($UNDERLINE_BIT)) != 0"/>
+ <variable name="superscript"
+ select="($style mod (2 * $SUPERSCRIPT_BIT)) - ($style mod ($SUPERSCRIPT_BIT)) != 0"/>
+ <variable name="subscript"
+ select="($style mod (2 * $SUBSCRIPT_BIT)) - ($style mod ($SUBSCRIPT_BIT)) != 0"/>
+ <variable name="code"
+ select="($style mod (2 * $CODE_BIT)) - ($style mod ($CODE_BIT)) != 0"/>
+ <variable name="typewriter"
+ select="($style mod (2 * $TYPEWRITER_BIT)) - ($style mod ($TYPEWRITER_BIT)) != 0"/>
+
+ <variable name="bold-left"
+ select="($style-left mod (2 * $BOLD_BIT)) != 0"/>
+ <variable name="italic-left"
+ select="($style-left mod (2 * $ITALIC_BIT)) - ($style-left mod ($ITALIC_BIT)) != 0"/>
+ <variable name="underline-left"
+ select="($style-left mod (2 * $UNDERLINE_BIT)) - ($style-left mod ($UNDERLINE_BIT)) != 0"/>
+ <variable name="superscript-left"
+ select="($style-left mod (2 * $SUPERSCRIPT_BIT)) - ($style-left mod ($SUPERSCRIPT_BIT)) != 0"/>
+ <variable name="subscript-left"
+ select="($style-left mod (2 * $SUBSCRIPT_BIT)) - ($style-left mod ($SUBSCRIPT_BIT)) != 0"/>
+ <variable name="typewriter-left"
+ select="($style-left mod (2 * $TYPEWRITER_BIT)) - ($style-left mod ($TYPEWRITER_BIT)) != 0"/>
+
+ <variable name="bold-right"
+ select="($style-right mod (2 * $BOLD_BIT)) != 0"/>
+ <variable name="italic-right"
+ select="($style-right mod (2 * $ITALIC_BIT)) - ($style-right mod ($ITALIC_BIT)) != 0"/>
+ <variable name="underline-right"
+ select="($style-right mod (2 * $UNDERLINE_BIT)) - ($style-right mod ($UNDERLINE_BIT)) != 0"/>
+ <variable name="superscript-right"
+ select="($style-right mod (2 * $SUPERSCRIPT_BIT)) - ($style-right mod ($SUPERSCRIPT_BIT)) != 0"/>
+ <variable name="subscript-right"
+ select="($style-right mod (2 * $SUBSCRIPT_BIT)) - ($style-right mod ($SUBSCRIPT_BIT)) != 0"/>
+ <variable name="typewriter-right"
+ select="($style-right mod (2 * $TYPEWRITER_BIT)) - ($style-right mod ($TYPEWRITER_BIT)) != 0"/>
+
+ <!-- Debugging: Add style infos to the output. -->
+ <!--
+ <value-of select="'{'"/>
+ <value-of select="$style-left"/>
+ <value-of select="'-'"/>
+ <value-of select="$style"/>
+ <value-of select="','"/>
+ <value-of select="$context-size"/>
+ <value-of select="'}'"/>
+ -->
+
+ <if test="$superscript and not($superscript-left) and not(boolean(ancestor::text:note))">
+ <text>&lt;sup&gt;</text>
+ </if>
+ <if test="$subscript and not($subscript-left)">
+ <text>&lt;sub&gt;</text>
+ </if>
+ <if test="not($code) and $typewriter and not($typewriter-left)">
+ <text>&lt;tt&gt;</text>
+ </if>
+ <if test="$underline and not($underline-left)">
+ <text>&lt;u&gt;</text>
+ </if>
+ <if test="$bold and not($bold-left)">
+ <text>'''</text>
+ </if>
+ <if test="$italic and not($italic-left)">
+ <text>''</text>
+ </if>
+
+ <call-template name="render-quoted-text">
+ <with-param name="text" select="."/>
+ </call-template>
+
+ <if test="$italic and not($italic-right)">
+ <text>''</text>
+ </if>
+ <if test="$bold and not($bold-right)">
+ <text>'''</text>
+ </if>
+ <if test="$underline and not($underline-right)">
+ <text>&lt;/u&gt;</text>
+ </if>
+ <if test="not($code) and $typewriter and not($typewriter-right)">
+ <text>&lt;/tt&gt;</text>
+ </if>
+ <if test="$subscript and not($subscript-right)">
+ <text>&lt;/sub&gt;</text>
+ </if>
+ <if test="$superscript and not($superscript-right) and not(boolean(ancestor::text:note))">
+ <text>&lt;/sup&gt;</text>
+ </if>
+
+ <!-- Debugging: Add style details to the output. -->
+ <!--
+ <value-of select="'{'"/>
+ <value-of select="$style"/>
+ <value-of select="'-'"/>
+ <value-of select="$style-right"/>
+ <value-of select="'}'"/>
+ -->
+
+ </when>
+ </choose>
+ </template>
+
+ <!--
+ Function for looking up the position of a node identified by the given
+ 'current-id' within a node set 'context'.
+
+ The search starts with the index 'test-index'. The search is recursive
+ in the 'test-index' argument. To save recursion depth, each recursive call
+ iteratively tests a fixed number of indexes (by loop unrolling).
+ -->
+ <template name="mk-context-index">
+ <param name="current-id"/>
+ <param name="context"/>
+ <param name="test-index"/>
+
+ <variable name="context-size" select="count($context)"/>
+
+ <choose>
+ <when test="context-size &lt; $test-index">
+ </when>
+ <when test="$current-id = generate-id($context[$test-index])">
+ <value-of select="$test-index"/>
+ </when>
+ <when test="context-size &lt; ($test-index + 1)">
+ </when>
+ <when test="$current-id = generate-id($context[$test-index + 1])">
+ <value-of select="$test-index + 1"/>
+ </when>
+ <when test="context-size &lt; ($test-index + 2)">
+ </when>
+ <when test="$current-id = generate-id($context[$test-index + 2])">
+ <value-of select="$test-index + 2"/>
+ </when>
+ <when test="context-size &lt; ($test-index + 3)">
+ </when>
+ <when test="$current-id = generate-id($context[$test-index + 3])">
+ <value-of select="$test-index + 3"/>
+ </when>
+ <when test="context-size &lt; ($test-index + 4)">
+ </when>
+ <when test="$current-id = generate-id($context[$test-index + 4])">
+ <value-of select="$test-index + 4"/>
+ </when>
+ <when test="context-size &lt; ($test-index + 5)">
+ </when>
+ <when test="$current-id = generate-id($context[$test-index + 5])">
+ <value-of select="$test-index + 5"/>
+ </when>
+ <when test="context-size &lt; ($test-index + 6)">
+ </when>
+ <otherwise>
+ <call-template name="mk-context-index">
+ <with-param name="current-id" select="$current-id"/>
+ <with-param name="context" select="$context"/>
+ <with-param name="test-index" select="$test-index + 6"/>
+ </call-template>
+ </otherwise>
+ </choose>
+ </template>
+
+ <template name="render-quoted-text">
+ <param name="text"/>
+
+ <choose>
+ <when test="contains($text, '[[') or starts-with($text, '----') or starts-with($text, '=') or starts-with($text, '*') or starts-with($text, ';') or starts-with($text, '#')">
+ <text>&lt;nowiki&gt;</text>
+ <call-template name="render-encoded-text">
+ <with-param name="text" select="$text"/>
+ </call-template>
+ <text>&lt;/nowiki&gt;</text>
+ </when>
+ <otherwise>
+ <call-template name="render-encoded-text">
+ <with-param name="text" select="$text"/>
+ </call-template>
+ </otherwise>
+ </choose>
+ </template>
+
+ <template name="render-escaped-text">
+ <param name="text"/>
+
+ <choose>
+ <when test="contains($text, '&lt;')">
+ <call-template name="render-encoded-text">
+ <with-param name="text" select="substring-before($text, '&lt;')"/>
+ </call-template>
+ <value-of select="'&amp;lt;'"/>
+ <call-template name="render-escaped-text">
+ <with-param name="text" select="substring-after($text, '&lt;')"/>
+ </call-template>
+ </when>
+ <otherwise>
+ <call-template name="render-encoded-text">
+ <with-param name="text" select="$text"/>
+ </call-template>
+ </otherwise>
+ </choose>
+ </template>
+
+ <template name="render-encoded-text">
+ <param name="text"/>
+
+ <choose>
+ <when test="contains($text, '&#160;')">
+ <value-of select="substring-before($text, '&#160;')"/>
+ <value-of select="'&amp;nbsp;'"/>
+ <call-template name="render-encoded-text">
+ <with-param name="text" select="substring-after($text, '&#160;')"/>
+ </call-template>
+ </when>
+ <otherwise>
+ <value-of select="$text"/>
+ </otherwise>
+ </choose>
+ </template>
+
+ <!--
+ == Wiki styles: bold, italics, ... ==
+ -->
+
+ <template name="mk-style-set">
+ <param name="node"/>
+
+ <choose>
+ <when test="$node/ancestor-or-self::*[@text:style-name]">
+ <variable name="context" select="$node/ancestor-or-self::*[@text:style-name][1]"/>
+ <call-template name="mk-style-set-internal">
+ <with-param name="node" select="$context"/>
+ <with-param name="style" select="key('style-ref', $context/@text:style-name)"/>
+ <with-param name="style-set" select="$NO_STYLE"/>
+ <with-param name="style-mask" select="$NO_STYLE"/>
+ </call-template>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </template>
+
+ <!--
+ Compute the wiki style set that corresponds
+ to the given office style at the given context node.
+
+ @param node
+ A node in which context the style is computed. If neither the given style
+ nor one of its linked styles does specify a style of the given type,
+ ancestor nodes of the given context node are considered.
+ @param style
+ A style:style element node. The style of the requested type is searched
+ in the given style and its linked styles.
+ @style-set
+ A bit set of styles already defined by the context.
+ @style-mask
+ A bit set of styles that must not be taken from the currently inspected
+ style, because those styles are already defined by the context.
+
+ @return A bit set composed of the wiki style constants.
+ -->
+ <template name="mk-style-set-internal">
+ <param name="node"/>
+ <param name="style"/>
+ <param name="style-set"/>
+ <param name="style-mask"/>
+
+ <variable name="text-properties" select="$style/style:text-properties"/>
+
+ <!-- Decompose style-mask into individual bits. -->
+ <variable name="bold-requested"
+ select="($style-mask mod (2 * $BOLD_BIT)) = 0"/>
+ <variable name="italic-requested"
+ select="($style-mask mod (2 * $ITALIC_BIT)) - ($style-mask mod ($ITALIC_BIT)) = 0"/>
+ <variable name="underline-requested"
+ select="($style-mask mod (2 * $UNDERLINE_BIT)) - ($style-mask mod ($UNDERLINE_BIT)) = 0"/>
+ <variable name="superscript-requested"
+ select="($style-mask mod (2 * $SUPERSCRIPT_BIT)) - ($style-mask mod ($SUPERSCRIPT_BIT)) = 0"/>
+ <variable name="subscript-requested"
+ select="($style-mask mod (2 * $SUBSCRIPT_BIT)) - ($style-mask mod ($SUBSCRIPT_BIT)) = 0"/>
+ <variable name="typewriter-requested"
+ select="($style-mask mod (2 * $TYPEWRITER_BIT)) - ($style-mask mod ($TYPEWRITER_BIT)) = 0"/>
+ <variable name="code-requested"
+ select="($style-mask mod (2 * $CODE_BIT)) - ($style-mask mod ($CODE_BIT)) = 0"/>
+ <variable name="center-requested"
+ select="($style-mask mod (2 * $CENTER_BIT)) - ($style-mask mod ($CENTER_BIT)) = 0"/>
+ <variable name="right-requested"
+ select="($style-mask mod (2 * $RIGHT_BIT)) - ($style-mask mod ($RIGHT_BIT)) = 0"/>
+
+ <!-- Extract styles that are not already defined by the context. -->
+ <variable name="bold-style">
+ <choose>
+ <when test="$bold-requested and boolean($text-properties/@fo:font-weight='bold')">
+ <!-- Bold found in current style. -->
+ <value-of select="$BOLD_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <variable name="bold-mask">
+ <choose>
+ <when test="$bold-requested and boolean($text-properties/@fo:font-weight)">
+ <!--
+ Other value than "bold" means that the character style is not
+ bold and no parent style must be considered.
+ -->
+ <value-of select="$BOLD_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+
+ <variable name="italic-style">
+ <choose>
+ <when test="$italic-requested and boolean($text-properties/@fo:font-style='italic')">
+ <!-- Italic found in current style. -->
+ <value-of select="$ITALIC_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <variable name="italic-mask">
+ <choose>
+ <when test="$italic-requested and boolean($text-properties/@fo:font-style)">
+ <!--
+ Other value than "italic" means that the character style is not
+ italic and no parent style must be considered.
+ -->
+ <value-of select="$ITALIC_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+
+ <variable name="underline-style">
+ <choose>
+ <when test="$underline-requested and boolean($text-properties/@style:text-underline-style='solid')">
+ <!-- Underline found in current style. -->
+ <value-of select="$UNDERLINE_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <variable name="underline-mask">
+ <choose>
+ <when test="$underline-requested and boolean($text-properties/@style:text-underline-style='solid')">
+ <!--
+ Other value than "underline" means that the character style is not
+ underline and no parent style must be considered.
+ -->
+ <value-of select="$UNDERLINE_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+
+ <variable name="superscript-style">
+ <choose>
+ <when test="$superscript-requested and contains($text-properties/@style:text-position, 'super')">
+ <value-of select="$SUPERSCRIPT_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <variable name="superscript-mask">
+ <choose>
+ <when test="$superscript-requested and boolean($text-properties/@style:text-position)">
+ <value-of select="$SUPERSCRIPT_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+
+ <variable name="subscript-style">
+ <choose>
+ <when test="$subscript-requested and contains($text-properties/@style:text-position, 'sub')">
+ <value-of select="$SUBSCRIPT_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <variable name="subscript-mask">
+ <choose>
+ <when test="$subscript-requested and boolean($text-properties/@style:text-position)">
+ <value-of select="$SUBSCRIPT_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+
+ <variable name="typewriter-style">
+ <choose>
+ <when test="$typewriter-requested and ($style/@style:family='text') and boolean($text-properties/@style:font-name)">
+ <variable name="font-face"
+ select="key('font-face-ref', $text-properties/@style:font-name)"/>
+ <choose>
+ <when test="$font-face/@style:font-pitch='fixed'">
+ <value-of select="$TYPEWRITER_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <variable name="typewriter-mask">
+ <choose>
+ <!-- Note: Suppress the typewriter style on text within a code paragraph. -->
+ <when test="$typewriter-requested and boolean($text-properties/@style:font-name)">
+ <value-of select="$TYPEWRITER_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+
+ <variable name="code-style">
+ <choose>
+ <when test="$code-requested and ($style/@style:family='paragraph') and boolean($text-properties/@style:font-name)">
+ <variable name="font-face"
+ select="key('font-face-ref', $text-properties/@style:font-name)"/>
+ <choose>
+ <when test="$font-face/@style:font-pitch='fixed' or (boolean(@style:display-name) and contains($CODE_STYLES, $style/@style:display-name))">
+ <value-of select="$CODE_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <variable name="code-mask">
+ <choose>
+ <when test="$code-requested and ($style/@style:family='paragraph') and boolean($text-properties/@style:font-name)">
+ <value-of select="$CODE_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+
+ <variable name="center-style">
+ <choose>
+ <when test="$center-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align='center')">
+ <value-of select="$CENTER_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <variable name="center-mask">
+ <choose>
+ <when test="$center-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align)">
+ <value-of select="$CENTER_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+
+ <variable name="right-style">
+ <choose>
+ <when test="$right-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align='end')">
+ <value-of select="$RIGHT_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+ <variable name="right-mask">
+ <choose>
+ <when test="$center-requested and ($style/@style:family='paragraph') and boolean($style/style:paragraph-properties/@fo:text-align)">
+ <value-of select="$RIGHT_BIT"/>
+ </when>
+ <otherwise>
+ <value-of select="$NO_STYLE"/>
+ </otherwise>
+ </choose>
+ </variable>
+
+
+ <!-- Compute the updated styles and mask. -->
+ <!--
+ Note: The bit masks style-mask, bold-style, italic-style,... are
+ guaranteed to be disjoint, therefore, addition can be use instead
+ of bitwise or (which is missing in XPath). -->
+ <variable name="updated-style"
+ select="$style-set + $bold-style + $italic-style + $underline-style + $superscript-style + $subscript-style + $code-style + $typewriter-style + $center-style + $right-style"/>
+ <variable name="updated-mask"
+ select="$style-mask + $bold-mask + $italic-mask + $underline-mask + $superscript-mask + $subscript-mask + $code-mask + $typewriter-mask + $center-mask + $right-mask"/>
+
+ <!-- Inspect linked and nested styles. -->
+ <choose>
+ <when test="boolean($style/@style:parent-style-name)">
+ <!-- Look through the style, the current style is based on. -->
+ <call-template name="mk-style-set-internal">
+ <with-param name="node" select="$node"/>
+ <with-param name="style" select="key('style-ref', $style/@style:parent-style-name)"/>
+ <with-param name="style-set" select="$updated-style"/>
+ <with-param name="style-mask" select="$updated-mask"/>
+ </call-template>
+ </when>
+ <otherwise>
+ <variable name="ancestors" select="$node/ancestor::*[@text:style-name][1]"/>
+
+ <!-- Debugging: Print currently inspected style. -->
+ <!--
+ <message>
+ <value-of select="'{'"/>
+ <value-of select="$style/@style:name"/>
+ <value-of select="','"/>
+ <value-of select="$updated-style"/>
+ <value-of select="','"/>
+ <value-of select="$updated-mask"/>
+ <value-of select="','"/>
+ <value-of select="local-name($ancestors)"/>
+ <value-of select="',('"/>
+ <value-of select="$node"/>
+ <value-of select="')'"/>
+ <value-of select="'}'"/>
+ </message>
+ -->
+
+ <!--
+ If there is an ancestor that has a style, use that style,
+ otherwise, a style is not found. -->
+ <choose>
+ <when test="boolean($ancestors)">
+ <!-- Look through the style of the nearest ancestor that has a style. -->
+ <call-template name="mk-style-set-internal">
+ <with-param name="node" select="$ancestors"/>
+ <with-param name="style" select="key('style-ref', $ancestors/@text:style-name)"/>
+ <with-param name="style-set" select="$updated-style"/>
+ <with-param name="style-mask" select="$updated-mask"/>
+ </call-template>
+ </when>
+ <otherwise>
+ <!-- No more styles to inspect. Return the result. -->
+ <value-of select="$updated-style"/>
+ </otherwise>
+ </choose>
+ </otherwise>
+ </choose>
+ </template>
+
+
+ <!--
+ == Descending the tree ==
+ -->
+
+ <template match="/">
+ <apply-templates/>
+ <value-of select="$NL"/>
+ <if test="boolean(//text:note[@text:note-class='footnote'])">
+ <value-of select="$NL"/>
+ <text>----</text>
+ <value-of select="$NL"/>
+ <text>&lt;references/&gt;</text>
+ <value-of select="$NL"/>
+ </if>
+ </template>
+
+ <template match="office:document-content">
+ <apply-templates/>
+ </template>
+
+ <template match="office:body">
+ <apply-templates/>
+ </template>
+
+ <template match="text:tracked-changes">
+ <!-- Ignore change history. -->
+ </template>
+
+ <template match="office:* | text:* | draw:text-box | draw:a">
+ <apply-templates/>
+ </template>
+
+ <template match="node()">
+ </template>
</stylesheet>
<!--
Local Variables:
- tab-width: 4
- sgml-indent-step: 4
+ tab-width: 4
+ sgml-indent-step: 4
End:
-->
diff --git a/xmlhelp/util/compact.xsl b/xmlhelp/util/compact.xsl
index 9d61963ce1b4..781ad3179296 100644
--- a/xmlhelp/util/compact.xsl
+++ b/xmlhelp/util/compact.xsl
@@ -11,8 +11,8 @@
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
- <xsl:strip-space elements="*"/>
- <xsl:preserve-space elements="paragraph"/>
+ <xsl:strip-space elements="*"/>
+ <xsl:preserve-space elements="paragraph"/>
<!-- Copy everything -->
<xsl:template match="@*|node()|text()">
@@ -21,8 +21,8 @@
</xsl:copy>
</xsl:template>
- <!-- To remove attributes or nodes,
- simply write a matching template that doesn't do anything.
+ <!-- To remove attributes or nodes,
+ simply write a matching template that doesn't do anything.
Therefore, it is removed -->
<xsl:template match="image/@localize">
<xsl:copy>
diff --git a/xmlhelp/util/embed.xsl b/xmlhelp/util/embed.xsl
index a611e4dbcbc0..0cc067714cf8 100644
--- a/xmlhelp/util/embed.xsl
+++ b/xmlhelp/util/embed.xsl
@@ -28,7 +28,7 @@ All others
######################################################
-->
<xsl:template match="/">
- <xsl:apply-templates/>
+ <xsl:apply-templates/>
</xsl:template>
<xsl:template match="*|@*|comment()|processing-instruction()|text()">
@@ -45,7 +45,7 @@ All others
<xsl:template match="bookmark" mode="embedded" />
<xsl:template match="ahelp" mode="embedded">
- <xsl:apply-templates mode="embedded"/>
+ <xsl:apply-templates mode="embedded"/>
</xsl:template>
<xsl:template match="paragraph[@role='heading']">
@@ -65,36 +65,36 @@ All others
</xsl:template>
-<!--
-######################################################
+<!--
+######################################################
EMBED
-######################################################
+######################################################
-->
<xsl:template match="embed">
- <xsl:variable name="href"><xsl:value-of select="substring-before(concat($fsroot,@href),'#')"/></xsl:variable>
- <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
- <xsl:variable name="doc" select="document($href)"/>
- <xsl:apply-templates select="$doc//section[@id=$anchor]" mode="embedded"/>
- <xsl:if test="not($doc//section[@id=$anchor])"> <!-- fallback for embeds that actually should be embedvars -->
- <paragraph role="paragraph"><xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/></paragraph>
- </xsl:if>
+ <xsl:variable name="href"><xsl:value-of select="substring-before(concat($fsroot,@href),'#')"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <xsl:apply-templates select="$doc//section[@id=$anchor]" mode="embedded"/>
+ <xsl:if test="not($doc//section[@id=$anchor])"> <!-- fallback for embeds that actually should be embedvars -->
+ <paragraph role="paragraph"><xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/></paragraph>
+ </xsl:if>
</xsl:template>
-<!--
-######################################################
+<!--
+######################################################
EMBEDVAR
-######################################################
+######################################################
-->
<xsl:template match="embedvar">
- <xsl:if test="not(@href='text/shared/00/00000004.xhp#wie')"> <!-- special treatment if howtoget links -->
- <xsl:variable name="href"><xsl:value-of select="substring-before(concat($fsroot,@href),'#')"/></xsl:variable>
- <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
- <xsl:variable name="doc" select="document($href)"/>
- <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
- </xsl:if>
-
- <!-- FPE: embedvars, that point to "text/shared/00/00000004.xml#wie" will only be resolved in the main_transform -->
-
+ <xsl:if test="not(@href='text/shared/00/00000004.xhp#wie')"> <!-- special treatment if howtoget links -->
+ <xsl:variable name="href"><xsl:value-of select="substring-before(concat($fsroot,@href),'#')"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+ </xsl:if>
+
+ <!-- FPE: embedvars, that point to "text/shared/00/00000004.xml#wie" will only be resolved in the main_transform -->
+
</xsl:template>
</xsl:stylesheet>
diff --git a/xmlhelp/util/idxcaption.xsl b/xmlhelp/util/idxcaption.xsl
index 08f09d70cefc..398b59af3c98 100644
--- a/xmlhelp/util/idxcaption.xsl
+++ b/xmlhelp/util/idxcaption.xsl
@@ -16,33 +16,33 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<xsl:stylesheet version="1.0" encoding="UTF-8"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:office="http://openoffice.org/2000/office"
- xmlns:style="http://openoffice.org/2000/style"
- xmlns:table="http://openoffice.org/2000/table"
- xmlns:draw="http://openoffice.org/2000/drawing"
- xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:meta="http://openoffice.org/2000/meta"
- xmlns:number="http://openoffice.org/2000/datastyle"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns:chart="http://openoffice.org/2000/chart"
- xmlns:help="http://openoffice.org/2000/help"
- xmlns:index="http://sun.com/2000/XMLSearch"
- xmlns:text="http://openoffice.org/2000/text">
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:office="http://openoffice.org/2000/office"
+ xmlns:style="http://openoffice.org/2000/style"
+ xmlns:table="http://openoffice.org/2000/table"
+ xmlns:draw="http://openoffice.org/2000/drawing"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:meta="http://openoffice.org/2000/meta"
+ xmlns:number="http://openoffice.org/2000/datastyle"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:chart="http://openoffice.org/2000/chart"
+ xmlns:help="http://openoffice.org/2000/help"
+ xmlns:index="http://sun.com/2000/XMLSearch"
+ xmlns:text="http://openoffice.org/2000/text">
<xsl:param name="Language" select="'en-US'"/>
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="/">
- <xsl:apply-templates select="//title" mode="include"/>
- <xsl:apply-templates select="//paragraph[@role='heading']" mode="include"/>
+ <xsl:apply-templates select="//title" mode="include"/>
+ <xsl:apply-templates select="//paragraph[@role='heading']" mode="include"/>
</xsl:template>
<xsl:template match="*" mode="include">
- <xsl:value-of select="."/>
- <xsl:text>&#xA;</xsl:text>
+ <xsl:value-of select="."/>
+ <xsl:text>&#xA;</xsl:text>
</xsl:template>
<xsl:template match="*"/>
diff --git a/xmlhelp/util/idxcontent.xsl b/xmlhelp/util/idxcontent.xsl
index c09e04500f71..d06b4f67ba36 100644
--- a/xmlhelp/util/idxcontent.xsl
+++ b/xmlhelp/util/idxcontent.xsl
@@ -16,21 +16,21 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
<xsl:stylesheet version="1.0" encoding="UTF-8"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:office="http://openoffice.org/2000/office"
- xmlns:style="http://openoffice.org/2000/style"
- xmlns:table="http://openoffice.org/2000/table"
- xmlns:draw="http://openoffice.org/2000/drawing"
- xmlns:fo="http://www.w3.org/1999/XSL/Format"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:meta="http://openoffice.org/2000/meta"
- xmlns:number="http://openoffice.org/2000/datastyle"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns:chart="http://openoffice.org/2000/chart"
- xmlns:help="http://openoffice.org/2000/help"
- xmlns:index="http://sun.com/2000/XMLSearch"
- xmlns:text="http://openoffice.org/2000/text">
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:office="http://openoffice.org/2000/office"
+ xmlns:style="http://openoffice.org/2000/style"
+ xmlns:table="http://openoffice.org/2000/table"
+ xmlns:draw="http://openoffice.org/2000/drawing"
+ xmlns:fo="http://www.w3.org/1999/XSL/Format"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:meta="http://openoffice.org/2000/meta"
+ xmlns:number="http://openoffice.org/2000/datastyle"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:chart="http://openoffice.org/2000/chart"
+ xmlns:help="http://openoffice.org/2000/help"
+ xmlns:index="http://sun.com/2000/XMLSearch"
+ xmlns:text="http://openoffice.org/2000/text">
<xsl:param name="Language" select="'en-US'"/>
<xsl:output method="text" encoding="UTF-8"/>
diff --git a/xmlhelp/util/main_transform.xsl b/xmlhelp/util/main_transform.xsl
index 9a40abb66f15..ac1b3abb7d9d 100644
--- a/xmlhelp/util/main_transform.xsl
+++ b/xmlhelp/util/main_transform.xsl
@@ -80,15 +80,15 @@
<xsl:param name="Database" select="'swriter'"/>
<xsl:variable name="module" select="$Database"/>
<xsl:variable name="appl">
- <xsl:choose>
- <xsl:when test="$module = 'swriter'"><xsl:value-of select="'WRITER'"/></xsl:when>
- <xsl:when test="$module = 'scalc'"><xsl:value-of select="'CALC'"/></xsl:when>
- <xsl:when test="$module = 'sdraw'"><xsl:value-of select="'DRAW'"/></xsl:when>
- <xsl:when test="$module = 'simpress'"><xsl:value-of select="'IMPRESS'"/></xsl:when>
- <xsl:when test="$module = 'schart'"><xsl:value-of select="'CHART'"/></xsl:when>
- <xsl:when test="$module = 'sbasic'"><xsl:value-of select="'BASIC'"/></xsl:when>
- <xsl:when test="$module = 'smath'"><xsl:value-of select="'MATH'"/></xsl:when>
- </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="$module = 'swriter'"><xsl:value-of select="'WRITER'"/></xsl:when>
+ <xsl:when test="$module = 'scalc'"><xsl:value-of select="'CALC'"/></xsl:when>
+ <xsl:when test="$module = 'sdraw'"><xsl:value-of select="'DRAW'"/></xsl:when>
+ <xsl:when test="$module = 'simpress'"><xsl:value-of select="'IMPRESS'"/></xsl:when>
+ <xsl:when test="$module = 'schart'"><xsl:value-of select="'CHART'"/></xsl:when>
+ <xsl:when test="$module = 'sbasic'"><xsl:value-of select="'BASIC'"/></xsl:when>
+ <xsl:when test="$module = 'smath'"><xsl:value-of select="'MATH'"/></xsl:when>
+ </xsl:choose>
</xsl:variable>
<!-- the other parameters given by the help caller -->
@@ -96,7 +96,7 @@
<xsl:param name="productname" select="'Office'"/>
<xsl:param name="productversion" select="''"/>
<xsl:variable name="pversion">
- <xsl:value-of select="translate($productversion,' ','')"/>
+ <xsl:value-of select="translate($productversion,' ','')"/>
</xsl:variable>
<!-- this is were the images are -->
<xsl:param name="imgtheme" select="''"/>
@@ -113,7 +113,7 @@
<xsl:variable name="img_url_prefix" select="concat('vnd.libreoffice.image://',$imgtheme,'/')"/>
<xsl:variable name="img_url_internal" select="'vnd.libreoffice.image://helpimg/'"/>
<xsl:variable name="urlpost" select="concat('?Language=',$lang,$am,'System=',$System,$am,'UseDB=no')"/>
-<xsl:variable name="urlpre" select="$help_url_prefix" />
+<xsl:variable name="urlpre" select="$help_url_prefix" />
<xsl:variable name="linkprefix" select="$urlpre"/>
<xsl:variable name="linkpostfix" select="$urlpost"/>
@@ -132,22 +132,22 @@
<!-- Create the document skeleton -->
<xsl:template match="/">
- <xsl:variable name="csslink" select="concat($urlpre,'/',$urlpost)"/>
- <html>
- <head>
- <title><xsl:value-of select="$title"/></title>
- <link href="{$csslink}" rel="Stylesheet" type="text/css" /> <!-- stylesheet link -->
- <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
- </head>
- <body lang="{$lang}">
- <xsl:apply-templates select="/helpdocument/body"/>
- </body>
- </html>
+ <xsl:variable name="csslink" select="concat($urlpre,'/',$urlpost)"/>
+ <html>
+ <head>
+ <title><xsl:value-of select="$title"/></title>
+ <link href="{$csslink}" rel="Stylesheet" type="text/css" /> <!-- stylesheet link -->
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
+ </head>
+ <body lang="{$lang}">
+ <xsl:apply-templates select="/helpdocument/body"/>
+ </body>
+ </html>
</xsl:template>
<!-- AHELP -->
<xsl:template match="ahelp">
- <xsl:if test="not(@visibility='hidden')"><span class="avis"><xsl:apply-templates /></span></xsl:if>
+ <xsl:if test="not(@visibility='hidden')"><span class="avis"><xsl:apply-templates /></span></xsl:if>
</xsl:template>
<!-- ALT -->
@@ -155,11 +155,11 @@
<!-- BOOKMARK -->
<xsl:template match="bookmark">
- <a name="{@id}"></a>
- <xsl:choose>
- <xsl:when test="starts-with(@branch,'hid')" />
- <xsl:otherwise><xsl:apply-templates /></xsl:otherwise>
- </xsl:choose>
+ <a name="{@id}"></a>
+ <xsl:choose>
+ <xsl:when test="starts-with(@branch,'hid')" />
+ <xsl:otherwise><xsl:apply-templates /></xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match="bookmark" mode="embedded" />
@@ -175,17 +175,17 @@
<!-- CASE -->
<xsl:template match="case"><xsl:call-template name="insertcase" /></xsl:template>
<xsl:template match="case" mode="embedded">
- <xsl:call-template name="insertcase">
- <xsl:with-param name="embedded" select="'yes'"/>
- </xsl:call-template>
+ <xsl:call-template name="insertcase">
+ <xsl:with-param name="embedded" select="'yes'"/>
+ </xsl:call-template>
</xsl:template>
<!-- CASEINLINE -->
<xsl:template match="caseinline"><xsl:call-template name="insertcase" /></xsl:template>
<xsl:template match="caseinline" mode="embedded">
- <xsl:call-template name="insertcase">
- <xsl:with-param name="embedded" select="'yes'"/>
- </xsl:call-template>
+ <xsl:call-template name="insertcase">
+ <xsl:with-param name="embedded" select="'yes'"/>
+ </xsl:call-template>
</xsl:template>
<!-- COMMENT -->
@@ -198,17 +198,17 @@
<!-- DEFAULT -->
<xsl:template match="default"><xsl:call-template name="insertdefault" /></xsl:template>
<xsl:template match="default" mode="embedded">
- <xsl:call-template name="insertdefault">
- <xsl:with-param name="embedded" select="'yes'"/>
- </xsl:call-template>
+ <xsl:call-template name="insertdefault">
+ <xsl:with-param name="embedded" select="'yes'"/>
+ </xsl:call-template>
</xsl:template>
<!-- DEFAULTINLINE -->
<xsl:template match="defaultinline"><xsl:call-template name="insertdefault" /></xsl:template>
<xsl:template match="defaultinline" mode="embedded">
- <xsl:call-template name="insertdefault">
- <xsl:with-param name="embedded" select="'yes'"/>
- </xsl:call-template>
+ <xsl:call-template name="insertdefault">
+ <xsl:with-param name="embedded" select="'yes'"/>
+ </xsl:call-template>
</xsl:template>
<!-- EMBED -->
@@ -221,26 +221,26 @@
<!-- EMPH -->
<xsl:template match="emph">
- <span class="emph"><xsl:apply-templates /></span>
+ <span class="emph"><xsl:apply-templates /></span>
</xsl:template>
<xsl:template match="emph" mode="embedded">
- <span class="emph"><xsl:apply-templates /></span>
+ <span class="emph"><xsl:apply-templates /></span>
</xsl:template>
<!-- SUB -->
<xsl:template match="sub">
- <sub><xsl:apply-templates /></sub>
+ <sub><xsl:apply-templates /></sub>
</xsl:template>
<xsl:template match="sub" mode="embedded">
- <sub><xsl:apply-templates /></sub>
+ <sub><xsl:apply-templates /></sub>
</xsl:template>
<!-- SUP -->
<xsl:template match="sup">
- <sup><xsl:apply-templates /></sup>
+ <sup><xsl:apply-templates /></sup>
</xsl:template>
<xsl:template match="sup" mode="embedded">
- <sup><xsl:apply-templates /></sup>
+ <sup><xsl:apply-templates /></sup>
</xsl:template>
<!-- FILENAME -->
@@ -259,64 +259,64 @@
<!-- LINK -->
<xsl:template match="link">
- <xsl:choose> <!-- don't insert the heading link to itself -->
- <xsl:when test="(concat('/',@href) = /helpdocument/meta/topic/filename) or (@href = /helpdocument/meta/topic/filename)">
- <xsl:apply-templates />
- </xsl:when>
- <xsl:when test="contains(child::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
- <xsl:call-template name="insert_howtoget">
- <xsl:with-param name="linkhref" select="@href"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="createlink" />
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:choose> <!-- don't insert the heading link to itself -->
+ <xsl:when test="(concat('/',@href) = /helpdocument/meta/topic/filename) or (@href = /helpdocument/meta/topic/filename)">
+ <xsl:apply-templates />
+ </xsl:when>
+ <xsl:when test="contains(child::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
+ <xsl:call-template name="insert_howtoget">
+ <xsl:with-param name="linkhref" select="@href"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="createlink" />
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match="link" mode="embedded">
- <xsl:call-template name="createlink"/>
+ <xsl:call-template name="createlink"/>
</xsl:template>
<!-- LIST -->
<xsl:template match="list">
- <xsl:choose>
- <xsl:when test="@type='ordered'">
- <ol>
- <xsl:if test="@startwith">
- <xsl:attribute name="start"><xsl:value-of select="@startwith"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates />
- </ol>
- </xsl:when>
- <xsl:otherwise>
- <ul><xsl:apply-templates /></ul>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@type='ordered'">
+ <ol>
+ <xsl:if test="@startwith">
+ <xsl:attribute name="start"><xsl:value-of select="@startwith"/></xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates />
+ </ol>
+ </xsl:when>
+ <xsl:otherwise>
+ <ul><xsl:apply-templates /></ul>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template match="list" mode="embedded">
- <xsl:choose>
- <xsl:when test="@type='ordered'">
- <ol>
- <xsl:if test="@startwith">
- <xsl:attribute name="start"><xsl:value-of select="@startwith"/></xsl:attribute>
- </xsl:if>
- <xsl:apply-templates mode="embedded"/>
- </ol>
- </xsl:when>
- <xsl:otherwise>
- <ul><xsl:apply-templates mode="embedded"/></ul>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="@type='ordered'">
+ <ol>
+ <xsl:if test="@startwith">
+ <xsl:attribute name="start"><xsl:value-of select="@startwith"/></xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates mode="embedded"/>
+ </ol>
+ </xsl:when>
+ <xsl:otherwise>
+ <ul><xsl:apply-templates mode="embedded"/></ul>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<!-- LISTITEM -->
<xsl:template match="listitem">
- <li><xsl:apply-templates /></li>
+ <li><xsl:apply-templates /></li>
</xsl:template>
<xsl:template match="listitem" mode="embedded">
- <li><xsl:apply-templates mode="embedded"/></li>
+ <li><xsl:apply-templates mode="embedded"/></li>
</xsl:template>
<!-- META, SEE HEADER -->
@@ -327,127 +327,127 @@
<!-- PARAGRAPH -->
<xsl:template match="paragraph">
- <xsl:choose>
-
- <xsl:when test="@role='heading'">
- <xsl:call-template name="insertheading">
- <xsl:with-param name="level" select="@level"/>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="contains(' note warning tip ',@role)">
- <xsl:call-template name="insertnote">
- <xsl:with-param name="type" select="@role" />
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="contains(descendant::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
- <xsl:apply-templates />
- </xsl:when>
-
- <xsl:when test="@role='bascode'">
- <xsl:call-template name="insertbascode" />
- </xsl:when>
-
- <xsl:when test="@role='logocode'">
- <xsl:call-template name="insertlogocode" />
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:call-template name="insertpara" />
- </xsl:otherwise>
-
- </xsl:choose>
+ <xsl:choose>
+
+ <xsl:when test="@role='heading'">
+ <xsl:call-template name="insertheading">
+ <xsl:with-param name="level" select="@level"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains(' note warning tip ',@role)">
+ <xsl:call-template name="insertnote">
+ <xsl:with-param name="type" select="@role" />
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains(descendant::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
+ <xsl:apply-templates />
+ </xsl:when>
+
+ <xsl:when test="@role='bascode'">
+ <xsl:call-template name="insertbascode" />
+ </xsl:when>
+
+ <xsl:when test="@role='logocode'">
+ <xsl:call-template name="insertlogocode" />
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:call-template name="insertpara" />
+ </xsl:otherwise>
+
+ </xsl:choose>
</xsl:template>
<xsl:template match="paragraph" mode="embedded">
- <xsl:choose>
-
- <xsl:when test="@role='heading'"> <!-- increase the level of headings that are embedded -->
- <!--
- The internal sablotron processor does not seem to support the number function.
- Therefore, we need a workaround for
- <xsl:variable name="level"><xsl:value-of select="number(@level)+1"/></xsl:variable>
- -->
- <xsl:variable name="newlevel">
- <xsl:choose>
- <xsl:when test="@level='1'"><xsl:value-of select="'2'"/></xsl:when>
- <xsl:when test="@level='2'"><xsl:value-of select="'2'"/></xsl:when>
- <xsl:when test="@level='3'"><xsl:value-of select="'3'"/></xsl:when>
- <xsl:when test="@level='4'"><xsl:value-of select="'4'"/></xsl:when>
- <xsl:when test="@level='5'"><xsl:value-of select="'5'"/></xsl:when>
- </xsl:choose>
- </xsl:variable>
-
- <xsl:call-template name="insertheading">
- <xsl:with-param name="level" select="$newlevel"/>
- <xsl:with-param name="embedded" select="'yes'"/>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="contains(' note warning tip ',@role)">
- <xsl:call-template name="insertnote">
- <xsl:with-param name="type" select="@role" />
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="contains(descendant::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
- <xsl:apply-templates />
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:call-template name="insertpara" />
- </xsl:otherwise>
-
- </xsl:choose>
+ <xsl:choose>
+
+ <xsl:when test="@role='heading'"> <!-- increase the level of headings that are embedded -->
+ <!--
+ The internal sablotron processor does not seem to support the number function.
+ Therefore, we need a workaround for
+ <xsl:variable name="level"><xsl:value-of select="number(@level)+1"/></xsl:variable>
+ -->
+ <xsl:variable name="newlevel">
+ <xsl:choose>
+ <xsl:when test="@level='1'"><xsl:value-of select="'2'"/></xsl:when>
+ <xsl:when test="@level='2'"><xsl:value-of select="'2'"/></xsl:when>
+ <xsl:when test="@level='3'"><xsl:value-of select="'3'"/></xsl:when>
+ <xsl:when test="@level='4'"><xsl:value-of select="'4'"/></xsl:when>
+ <xsl:when test="@level='5'"><xsl:value-of select="'5'"/></xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:call-template name="insertheading">
+ <xsl:with-param name="level" select="$newlevel"/>
+ <xsl:with-param name="embedded" select="'yes'"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains(' note warning tip ',@role)">
+ <xsl:call-template name="insertnote">
+ <xsl:with-param name="type" select="@role" />
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains(descendant::embedvar/@href,'/00/00000004.xhp#wie')"> <!-- special treatment of howtoget links -->
+ <xsl:apply-templates />
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:call-template name="insertpara" />
+ </xsl:otherwise>
+
+ </xsl:choose>
</xsl:template>
<!-- SECTION -->
<xsl:template match="section">
- <a name="{@id}"></a>
-
- <xsl:choose>
-
- <xsl:when test="@id='relatedtopics'">
- <div class="relatedtopics">
- <xsl:variable name="href"><xsl:value-of select="concat($urlpre,'shared/text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>
- <xsl:variable name="anchor"><xsl:value-of select="'related'"/></xsl:variable>
- <xsl:variable name="doc" select="document($href)"/>
- <p class="related">
- <xsl:apply-templates select="$doc//variable[@id=$anchor]"/>
- </p>
- <div class="relatedbody">
- <xsl:apply-templates />
- </div>
- </div>
- </xsl:when>
-
- <xsl:when test="@id='howtoget'">
- <xsl:call-template name="insert_howtoget" />
- </xsl:when>
-
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
-
- </xsl:choose>
+ <a name="{@id}"></a>
+
+ <xsl:choose>
+
+ <xsl:when test="@id='relatedtopics'">
+ <div class="relatedtopics">
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,'shared/text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="'related'"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <p class="related">
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]"/>
+ </p>
+ <div class="relatedbody">
+ <xsl:apply-templates />
+ </div>
+ </div>
+ </xsl:when>
+
+ <xsl:when test="@id='howtoget'">
+ <xsl:call-template name="insert_howtoget" />
+ </xsl:when>
+
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+
+ </xsl:choose>
</xsl:template>
<!-- SECTION -->
<xsl:template match="section" mode="embedded">
- <a name="{@id}"></a>
- <xsl:apply-templates mode="embedded"/>
+ <a name="{@id}"></a>
+ <xsl:apply-templates mode="embedded"/>
</xsl:template>
<!-- SORT -->
<xsl:template match="sort" >
- <xsl:apply-templates><xsl:sort select="descendant::paragraph"/></xsl:apply-templates>
+ <xsl:apply-templates><xsl:sort select="descendant::paragraph"/></xsl:apply-templates>
</xsl:template>
<xsl:template match="sort" mode="embedded">
- <xsl:apply-templates><xsl:sort select="descendant::paragraph"/></xsl:apply-templates>
+ <xsl:apply-templates><xsl:sort select="descendant::paragraph"/></xsl:apply-templates>
</xsl:template>
<!-- SWITCH -->
@@ -483,21 +483,21 @@
<xsl:template match="variable" mode="embedded"><a name="{@id}"></a><xsl:apply-templates mode="embedded"/></xsl:template>
<xsl:template match="text()">
- <xsl:call-template name="brand">
- <xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
- </xsl:call-template>
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
+ </xsl:call-template>
</xsl:template>
<xsl:template match="text()" mode="embedded">
- <xsl:call-template name="brand">
- <xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
- </xsl:call-template>
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string"><xsl:value-of select="."/></xsl:with-param>
+ </xsl:call-template>
</xsl:template>
<!-- In case of missing help files -->
<xsl:template match="help-id-missing"><xsl:value-of select="$Id"/></xsl:template>
-<!--
+<!--
###################
# NAMED TEMPLATES #
###################
@@ -505,296 +505,296 @@
<!-- Branding -->
<xsl:template name="brand" >
- <xsl:param name="string"/>
-
+ <xsl:param name="string"/>
+
<xsl:choose>
-
+
<xsl:when test="contains($string,$brand1)">
<xsl:variable name="newstr">
<xsl:value-of select="substring-before($string,$brand1)"/>
<xsl:value-of select="$productname"/>
<xsl:value-of select="substring-after($string,$brand1)"/>
</xsl:variable>
- <xsl:call-template name="brand">
- <xsl:with-param name="string" select="$newstr"/>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="contains($string,$brand2)">
- <xsl:variable name="newstr">
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains($string,$brand2)">
+ <xsl:variable name="newstr">
<xsl:value-of select="substring-before($string,$brand2)"/>
<xsl:value-of select="$pversion"/>
<xsl:value-of select="substring-after($string,$brand2)"/>
</xsl:variable>
- <xsl:call-template name="brand">
- <xsl:with-param name="string" select="$newstr"/>
- </xsl:call-template>
- </xsl:when>
-
- <xsl:when test="contains($string,$brand3)">
- <xsl:variable name="newstr">
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
+ <xsl:when test="contains($string,$brand3)">
+ <xsl:variable name="newstr">
<xsl:value-of select="substring-before($string,$brand3)"/>
<xsl:value-of select="$productname"/>
<xsl:value-of select="substring-after($string,$brand3)"/>
</xsl:variable>
- <xsl:call-template name="brand">
- <xsl:with-param name="string" select="$newstr"/>
- </xsl:call-template>
- </xsl:when>
-
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
<xsl:when test="contains($string,$brand4)">
- <xsl:variable name="newstr">
+ <xsl:variable name="newstr">
<xsl:value-of select="substring-before($string,$brand4)"/>
<xsl:value-of select="$pversion"/>
<xsl:value-of select="substring-after($string,$brand4)"/>
</xsl:variable>
- <xsl:call-template name="brand">
- <xsl:with-param name="string" select="$newstr"/>
- </xsl:call-template>
- </xsl:when>
-
+ <xsl:call-template name="brand">
+ <xsl:with-param name="string" select="$newstr"/>
+ </xsl:call-template>
+ </xsl:when>
+
<xsl:otherwise>
- <xsl:value-of select="$string"/>
- </xsl:otherwise>
- </xsl:choose>
-
+ <xsl:value-of select="$string"/>
+ </xsl:otherwise>
+ </xsl:choose>
+
</xsl:template>
<!-- Insert Paragraph -->
<xsl:template name="insertpara">
- <xsl:variable name="role">
- <xsl:choose>
- <xsl:when test="ancestor::table">
- <xsl:value-of select="concat(@role,'intable')"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@role"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <p class="{$role}"><xsl:apply-templates /></p>
+ <xsl:variable name="role">
+ <xsl:choose>
+ <xsl:when test="ancestor::table">
+ <xsl:value-of select="concat(@role,'intable')"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@role"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <p class="{$role}"><xsl:apply-templates /></p>
</xsl:template>
<!-- Insert Basic code snippet -->
<xsl:template name="insertbascode">
- <pre><xsl:apply-templates /></pre>
+ <pre><xsl:apply-templates /></pre>
</xsl:template>
<!-- Insert Logo code snippet -->
<xsl:template name="insertlogocode">
- <pre><xsl:apply-templates /></pre>
+ <pre><xsl:apply-templates /></pre>
</xsl:template>
<!-- Insert "How to get Link" -->
<xsl:template name="insert_howtoget">
- <xsl:param name="linkhref" />
- <xsl:variable name="archive" select="'shared'"/>
- <xsl:variable name="tmp_href"><xsl:value-of select="concat($urlpre,'shared/text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>
- <xsl:variable name="tmp_doc" select="document($tmp_href)"/>
- <table class="howtoget" width="100%" border="1" cellpadding="3" cellspacing="0">
- <tr>
- <td>
- <p class="howtogetheader"><xsl:apply-templates select="$tmp_doc//variable[@id='wie']"/></p>
- <div class="howtogetbody">
- <xsl:choose>
- <xsl:when test="$linkhref = ''"> <!-- new style -->
- <xsl:apply-templates/>
- </xsl:when>
- <xsl:otherwise> <!-- old style -->
- <xsl:variable name="archive1"><xsl:value-of select="concat(substring-before(substring-after($linkhref,'text/'),'/'),'/')"/></xsl:variable>
- <xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive1,substring-before($linkhref,'#'),$urlpost)"/></xsl:variable>
- <xsl:variable name="anc"><xsl:value-of select="substring-after($linkhref,'#')"/></xsl:variable>
- <xsl:variable name="docum" select="document($href)"/>
-
- <xsl:call-template name="insertembed">
- <xsl:with-param name="doc" select="$docum" />
- <xsl:with-param name="anchor" select="$anc" />
- </xsl:call-template>
-
- </xsl:otherwise>
- </xsl:choose>
- </div>
- </td>
- </tr>
- </table>
- <br/>
+ <xsl:param name="linkhref" />
+ <xsl:variable name="archive" select="'shared'"/>
+ <xsl:variable name="tmp_href"><xsl:value-of select="concat($urlpre,'shared/text/shared/00/00000004.xhp',$urlpost)"/></xsl:variable>
+ <xsl:variable name="tmp_doc" select="document($tmp_href)"/>
+ <table class="howtoget" width="100%" border="1" cellpadding="3" cellspacing="0">
+ <tr>
+ <td>
+ <p class="howtogetheader"><xsl:apply-templates select="$tmp_doc//variable[@id='wie']"/></p>
+ <div class="howtogetbody">
+ <xsl:choose>
+ <xsl:when test="$linkhref = ''"> <!-- new style -->
+ <xsl:apply-templates/>
+ </xsl:when>
+ <xsl:otherwise> <!-- old style -->
+ <xsl:variable name="archive1"><xsl:value-of select="concat(substring-before(substring-after($linkhref,'text/'),'/'),'/')"/></xsl:variable>
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive1,substring-before($linkhref,'#'),$urlpost)"/></xsl:variable>
+ <xsl:variable name="anc"><xsl:value-of select="substring-after($linkhref,'#')"/></xsl:variable>
+ <xsl:variable name="docum" select="document($href)"/>
+
+ <xsl:call-template name="insertembed">
+ <xsl:with-param name="doc" select="$docum" />
+ <xsl:with-param name="anchor" select="$anc" />
+ </xsl:call-template>
+
+ </xsl:otherwise>
+ </xsl:choose>
+ </div>
+ </td>
+ </tr>
+ </table>
+ <br/>
</xsl:template>
<!-- Create a link -->
<xsl:template name="createlink">
<xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
<xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
- <xsl:choose>
- <xsl:when test="starts-with(@href,'http://') or starts-with(@href,'https://')"> <!-- web links -->
- <a href="{@href}"><xsl:apply-templates /></a>
- </xsl:when>
- <xsl:when test="contains(@href,'#')">
- <xsl:variable name="anchor"><xsl:value-of select="concat('#',substring-after(@href,'#'))"/></xsl:variable>
- <xsl:variable name="href"><xsl:value-of select="concat($linkprefix,$archive,substring-before(@href,'#'),$linkpostfix,$dbpostfix,$anchor)"/></xsl:variable>
- <a href="{$href}"><xsl:apply-templates /></a>
- </xsl:when>
- <xsl:otherwise>
- <xsl:variable name="href"><xsl:value-of select="concat($linkprefix,$archive,@href,$linkpostfix,$dbpostfix)"/></xsl:variable>
- <a href="{$href}"><xsl:apply-templates /></a>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="starts-with(@href,'http://') or starts-with(@href,'https://')"> <!-- web links -->
+ <a href="{@href}"><xsl:apply-templates /></a>
+ </xsl:when>
+ <xsl:when test="contains(@href,'#')">
+ <xsl:variable name="anchor"><xsl:value-of select="concat('#',substring-after(@href,'#'))"/></xsl:variable>
+ <xsl:variable name="href"><xsl:value-of select="concat($linkprefix,$archive,substring-before(@href,'#'),$linkpostfix,$dbpostfix,$anchor)"/></xsl:variable>
+ <a href="{$href}"><xsl:apply-templates /></a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:variable name="href"><xsl:value-of select="concat($linkprefix,$archive,@href,$linkpostfix,$dbpostfix)"/></xsl:variable>
+ <a href="{$href}"><xsl:apply-templates /></a>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<!-- Insert Note, Warning, or Tip -->
<xsl:template name="insertnote">
- <xsl:param name="type" /> <!-- note, tip, or warning -->
- <xsl:variable name="imgsrc">
- <xsl:choose>
- <xsl:when test="$type='note'"><xsl:value-of select="$note_img"/></xsl:when>
- <xsl:when test="$type='tip'"><xsl:value-of select="$tip_img"/></xsl:when>
- <xsl:when test="$type='warning'"><xsl:value-of select="$warning_img"/></xsl:when>
- </xsl:choose>
- </xsl:variable>
- <xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="'shared'"/></xsl:call-template></xsl:variable>
- <xsl:variable name="alt">
- <xsl:variable name="href"><xsl:value-of select="concat($urlpre,'shared/',$alttext,$urlpost,$dbpostfix)"/></xsl:variable>
- <xsl:variable name="anchor"><xsl:value-of select="concat('alt_',$type)"/></xsl:variable>
- <xsl:variable name="doc" select="document($href)"/>
- <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
- </xsl:variable>
- <div class="{$type}">
- <table border="0" class="{$type}" cellspacing="0" cellpadding="5">
- <tr>
- <td><img src="{$imgsrc}" alt="{$alt}" title="{$alt}"/></td>
- <td><xsl:apply-templates /></td>
- </tr>
- </table>
- </div>
- <br/>
+ <xsl:param name="type" /> <!-- note, tip, or warning -->
+ <xsl:variable name="imgsrc">
+ <xsl:choose>
+ <xsl:when test="$type='note'"><xsl:value-of select="$note_img"/></xsl:when>
+ <xsl:when test="$type='tip'"><xsl:value-of select="$tip_img"/></xsl:when>
+ <xsl:when test="$type='warning'"><xsl:value-of select="$warning_img"/></xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="'shared'"/></xsl:call-template></xsl:variable>
+ <xsl:variable name="alt">
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,'shared/',$alttext,$urlpost,$dbpostfix)"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="concat('alt_',$type)"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+ </xsl:variable>
+ <div class="{$type}">
+ <table border="0" class="{$type}" cellspacing="0" cellpadding="5">
+ <tr>
+ <td><img src="{$imgsrc}" alt="{$alt}" title="{$alt}"/></td>
+ <td><xsl:apply-templates /></td>
+ </tr>
+ </table>
+ </div>
+ <br/>
</xsl:template>
<!-- Insert a heading -->
<xsl:template name="insertheading">
- <xsl:param name="level" />
- <xsl:param name="embedded" />
- <xsl:text disable-output-escaping="yes">&lt;h</xsl:text><xsl:value-of select="$level"/><xsl:text disable-output-escaping="yes">&gt;</xsl:text>
- <xsl:choose>
- <xsl:when test="$embedded = 'yes'">
- <xsl:apply-templates mode="embedded"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates />
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text disable-output-escaping="yes">&lt;/h</xsl:text><xsl:value-of select="$level"/><xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+ <xsl:param name="level" />
+ <xsl:param name="embedded" />
+ <xsl:text disable-output-escaping="yes">&lt;h</xsl:text><xsl:value-of select="$level"/><xsl:text disable-output-escaping="yes">&gt;</xsl:text>
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text disable-output-escaping="yes">&lt;/h</xsl:text><xsl:value-of select="$level"/><xsl:text disable-output-escaping="yes">&gt;</xsl:text>
</xsl:template>
<!-- Evaluate a case or caseinline switch -->
<xsl:template name="insertcase">
- <xsl:param name="embedded" />
- <xsl:choose>
- <xsl:when test="parent::switch[@select='sys'] or parent::switchinline[@select='sys']">
- <xsl:if test="@select = $System">
- <xsl:choose>
- <xsl:when test="$embedded = 'yes'">
- <xsl:apply-templates mode="embedded"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:when>
- <xsl:when test="parent::switch[@select='appl'] or parent::switchinline[@select='appl']">
- <xsl:if test="@select = $appl">
- <xsl:choose>
- <xsl:when test="$embedded = 'yes'">
- <xsl:apply-templates mode="embedded"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:when>
- <xsl:when test="parent::switch[@select='distrib'] or parent::switchinline[@select='distrib']">
- <xsl:if test="@select = $distrib">
- <xsl:choose>
- <xsl:when test="$embedded = 'yes'">
- <xsl:apply-templates mode="embedded"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
+ <xsl:param name="embedded" />
+ <xsl:choose>
+ <xsl:when test="parent::switch[@select='sys'] or parent::switchinline[@select='sys']">
+ <xsl:if test="@select = $System">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="parent::switch[@select='appl'] or parent::switchinline[@select='appl']">
+ <xsl:if test="@select = $appl">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="parent::switch[@select='distrib'] or parent::switchinline[@select='distrib']">
+ <xsl:if test="@select = $distrib">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
</xsl:template>
<!-- Evaluate a default or defaultinline switch -->
<xsl:template name="insertdefault">
- <xsl:param name="embedded" />
-
- <xsl:choose>
- <xsl:when test="parent::switch[@select='sys'] or parent::switchinline[@select='sys']">
- <xsl:if test="not(../child::case[@select=$System]) and not(../child::caseinline[@select=$System])">
- <xsl:choose>
- <xsl:when test="$embedded = 'yes'">
- <xsl:apply-templates mode="embedded"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:when>
- <xsl:when test="parent::switch[@select='appl'] or parent::switchinline[@select='appl']">
- <xsl:if test="not(../child::case[@select=$appl]) and not(../child::caseinline[@select=$appl])">
- <xsl:choose>
- <xsl:when test="$embedded = 'yes'">
- <xsl:apply-templates mode="embedded"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:when>
- <xsl:when test="parent::switch[@select='distrib'] or parent::switchinline[@select='distrib']">
- <xsl:if test="not(../child::case[@select=$distrib]) and not(../child::caseinline[@select=$distrib])">
- <xsl:choose>
- <xsl:when test="$embedded = 'yes'">
- <xsl:apply-templates mode="embedded"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates />
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:when>
- </xsl:choose>
+ <xsl:param name="embedded" />
+
+ <xsl:choose>
+ <xsl:when test="parent::switch[@select='sys'] or parent::switchinline[@select='sys']">
+ <xsl:if test="not(../child::case[@select=$System]) and not(../child::caseinline[@select=$System])">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="parent::switch[@select='appl'] or parent::switchinline[@select='appl']">
+ <xsl:if test="not(../child::case[@select=$appl]) and not(../child::caseinline[@select=$appl])">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="parent::switch[@select='distrib'] or parent::switchinline[@select='distrib']">
+ <xsl:if test="not(../child::case[@select=$distrib]) and not(../child::caseinline[@select=$distrib])">
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
</xsl:template>
<!-- evaluate embeds -->
<xsl:template name="insertembed">
- <xsl:param name="doc" />
- <xsl:param name="anchor" />
- <!-- different embed targets (also falsely used embed instead embedvar) -->
- <xsl:choose>
- <xsl:when test="$doc//section[@id=$anchor]"> <!-- first test for a section of that name -->
- <xsl:apply-templates select="$doc//section[@id=$anchor]" mode="embedded"/>
- </xsl:when>
- <xsl:when test="$doc//paragraph[@id=$anchor]"> <!-- then test for a para of that name -->
- <p class="embedded">
- <xsl:apply-templates select="$doc//paragraph[@id=$anchor]" mode="embedded"/>
- </p>
- </xsl:when>
- <xsl:when test="$doc//variable[@id=$anchor]"> <!-- then test for a variable of that name -->
- <p class="embedded">
- <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
- </p>
- </xsl:when>
- <xsl:otherwise> <!-- then give up -->
- <p class="bug">D'oh! You found a bug (<xsl:value-of select="@href"/> not found).</p>
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="doc" />
+ <xsl:param name="anchor" />
+ <!-- different embed targets (also falsely used embed instead embedvar) -->
+ <xsl:choose>
+ <xsl:when test="$doc//section[@id=$anchor]"> <!-- first test for a section of that name -->
+ <xsl:apply-templates select="$doc//section[@id=$anchor]" mode="embedded"/>
+ </xsl:when>
+ <xsl:when test="$doc//paragraph[@id=$anchor]"> <!-- then test for a para of that name -->
+ <p class="embedded">
+ <xsl:apply-templates select="$doc//paragraph[@id=$anchor]" mode="embedded"/>
+ </p>
+ </xsl:when>
+ <xsl:when test="$doc//variable[@id=$anchor]"> <!-- then test for a variable of that name -->
+ <p class="embedded">
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+ </p>
+ </xsl:when>
+ <xsl:otherwise> <!-- then give up -->
+ <p class="bug">D'oh! You found a bug (<xsl:value-of select="@href"/> not found).</p>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<!-- Insert an image -->
@@ -819,115 +819,115 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
-
- <!--<xsl:variable name="src"><xsl:value-of select="concat($img_url_prefix,@src)"/></xsl:variable>-->
- <xsl:variable name="alt"><xsl:value-of select="./alt"/></xsl:variable>
- <xsl:variable name="width" select="''"/> <!-- Images don't all have the correct size -->
- <xsl:variable name="height" select="''"/><!-- Image don't all have the correct size -->
- <img src="{$src}" alt="{$alt}" title="{$alt}">
- <xsl:if test="not($width='')"><xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute></xsl:if>
- <xsl:if test="not($height='')"><xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute></xsl:if>
- </img>
+
+ <!--<xsl:variable name="src"><xsl:value-of select="concat($img_url_prefix,@src)"/></xsl:variable>-->
+ <xsl:variable name="alt"><xsl:value-of select="./alt"/></xsl:variable>
+ <xsl:variable name="width" select="''"/> <!-- Images don't all have the correct size -->
+ <xsl:variable name="height" select="''"/><!-- Image don't all have the correct size -->
+ <img src="{$src}" alt="{$alt}" title="{$alt}">
+ <xsl:if test="not($width='')"><xsl:attribute name="width"><xsl:value-of select="$width"/></xsl:attribute></xsl:if>
+ <xsl:if test="not($height='')"><xsl:attribute name="height"><xsl:value-of select="$height"/></xsl:attribute></xsl:if>
+ </img>
</xsl:template>
<!-- Insert a Table -->
<xsl:template name="inserttable">
- <xsl:variable name="imgsrc"> <!-- see if we are in an image table -->
- <xsl:value-of select="tablerow/tablecell[1]/paragraph[1]/image/@src"/>
- </xsl:variable>
-
- <xsl:choose>
-
- <xsl:when test="count(descendant::tablecell)=1">
- <table border="0" class="onecell" cellpadding="0" cellspacing="0">
- <xsl:apply-templates />
- </table>
- </xsl:when>
-
- <xsl:when test="descendant::tablecell[1]/descendant::image">
- <table border="0" class="icontable" cellpadding="5" cellspacing="0">
- <xsl:apply-templates mode="icontable"/>
- </table>
- </xsl:when>
-
- <xsl:when test="@class='wide'">
- <table border="1" class="{@class}" cellpadding="0" cellspacing="0" width="100%" >
- <xsl:apply-templates />
- </table>
- </xsl:when>
-
- <xsl:when test="not(@class='')">
- <table border="1" class="{@class}" cellpadding="0" cellspacing="0" >
- <xsl:apply-templates />
- </table>
- </xsl:when>
-
- <xsl:otherwise>
- <table border="1" class="border" cellpadding="0" cellspacing="0" >
- <xsl:apply-templates />
- </table>
- </xsl:otherwise>
- </xsl:choose>
-
- <br/>
+ <xsl:variable name="imgsrc"> <!-- see if we are in an image table -->
+ <xsl:value-of select="tablerow/tablecell[1]/paragraph[1]/image/@src"/>
+ </xsl:variable>
+
+ <xsl:choose>
+
+ <xsl:when test="count(descendant::tablecell)=1">
+ <table border="0" class="onecell" cellpadding="0" cellspacing="0">
+ <xsl:apply-templates />
+ </table>
+ </xsl:when>
+
+ <xsl:when test="descendant::tablecell[1]/descendant::image">
+ <table border="0" class="icontable" cellpadding="5" cellspacing="0">
+ <xsl:apply-templates mode="icontable"/>
+ </table>
+ </xsl:when>
+
+ <xsl:when test="@class='wide'">
+ <table border="1" class="{@class}" cellpadding="0" cellspacing="0" width="100%" >
+ <xsl:apply-templates />
+ </table>
+ </xsl:when>
+
+ <xsl:when test="not(@class='')">
+ <table border="1" class="{@class}" cellpadding="0" cellspacing="0" >
+ <xsl:apply-templates />
+ </table>
+ </xsl:when>
+
+ <xsl:otherwise>
+ <table border="1" class="border" cellpadding="0" cellspacing="0" >
+ <xsl:apply-templates />
+ </table>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ <br/>
</xsl:template>
<xsl:template name="resolveembed">
- <div class="embedded">
- <xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
- <xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
- <xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive,substring-before(@href,'#'),$urlpost,$dbpostfix)"/></xsl:variable>
- <xsl:variable name="anc"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
- <xsl:variable name="docum" select="document($href)"/>
-
- <xsl:call-template name="insertembed">
- <xsl:with-param name="doc" select="$docum" />
- <xsl:with-param name="anchor" select="$anc" />
- </xsl:call-template>
+ <div class="embedded">
+ <xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
+ <xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive,substring-before(@href,'#'),$urlpost,$dbpostfix)"/></xsl:variable>
+ <xsl:variable name="anc"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+ <xsl:variable name="docum" select="document($href)"/>
+
+ <xsl:call-template name="insertembed">
+ <xsl:with-param name="doc" select="$docum" />
+ <xsl:with-param name="anchor" select="$anc" />
+ </xsl:call-template>
- </div>
+ </div>
</xsl:template>
<xsl:template name="resolveembedvar">
- <xsl:if test="not(@href='text/shared/00/00000004.xhp#wie')"> <!-- special treatment if howtoget links -->
- <xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
- <xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
- <xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive,substring-before(@href,'#'),$urlpost,$dbpostfix)"/></xsl:variable>
- <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
- <xsl:variable name="doc" select="document($href)"/>
- <xsl:choose>
- <xsl:when test="$doc//variable[@id=$anchor]"> <!-- test for a variable of that name -->
- <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
- </xsl:when>
- <xsl:otherwise> <!-- or give up -->
- <span class="bug">[<xsl:value-of select="@href"/> not found].</span>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
+ <xsl:if test="not(@href='text/shared/00/00000004.xhp#wie')"> <!-- special treatment if howtoget links -->
+ <xsl:variable name="archive"><xsl:value-of select="concat(substring-before(substring-after(@href,'text/'),'/'),'/')"/></xsl:variable>
+ <xsl:variable name="dbpostfix"><xsl:call-template name="createDBpostfix"><xsl:with-param name="archive" select="$archive"/></xsl:call-template></xsl:variable>
+ <xsl:variable name="href"><xsl:value-of select="concat($urlpre,$archive,substring-before(@href,'#'),$urlpost,$dbpostfix)"/></xsl:variable>
+ <xsl:variable name="anchor"><xsl:value-of select="substring-after(@href,'#')"/></xsl:variable>
+ <xsl:variable name="doc" select="document($href)"/>
+ <xsl:choose>
+ <xsl:when test="$doc//variable[@id=$anchor]"> <!-- test for a variable of that name -->
+ <xsl:apply-templates select="$doc//variable[@id=$anchor]" mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise> <!-- or give up -->
+ <span class="bug">[<xsl:value-of select="@href"/> not found].</span>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
</xsl:template>
<!-- Apply -->
<xsl:template name="apply">
- <xsl:param name="embedded" />
- <xsl:choose>
- <xsl:when test="$embedded = 'yes'">
- <xsl:apply-templates mode="embedded"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates />
- </xsl:otherwise>
- </xsl:choose>
+ <xsl:param name="embedded" />
+ <xsl:choose>
+ <xsl:when test="$embedded = 'yes'">
+ <xsl:apply-templates mode="embedded"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates />
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<xsl:template name="createDBpostfix">
- <xsl:param name="archive"/>
- <xsl:variable name="newDB">
- <xsl:choose>
- <xsl:when test="(substring($archive,1,6) = 'shared')"><xsl:value-of select="$Database"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="substring-before($archive,'/')"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:value-of select="concat($am,'DbPAR=',$newDB)"/>
+ <xsl:param name="archive"/>
+ <xsl:variable name="newDB">
+ <xsl:choose>
+ <xsl:when test="(substring($archive,1,6) = 'shared')"><xsl:value-of select="$Database"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="substring-before($archive,'/')"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:value-of select="concat($am,'DbPAR=',$newDB)"/>
</xsl:template>
</xsl:stylesheet>