xref: /AOO41X/main/xmerge/source/htmlsoff/htmltosoff.xsl (revision 54628ca40d27d15cc98fe861da7fff7e60c2f7d6)
1<?xml version='1.0' encoding="UTF-8"?>
2<!--***********************************************************
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements.  See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership.  The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License.  You may obtain a copy of the License at
11 *
12 *   http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied.  See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 *
21 ***********************************************************-->
22
23
24<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
25                  xmlns:office="http://openoffice.org/2000/office"
26                  xmlns:style="http://openoffice.org/2000/style"
27                  xmlns:text="http://openoffice.org/2000/text"
28                  xmlns:table="http://openoffice.org/2000/table"
29                  xmlns:draw="http://openoffice.org/2000/drawing"
30                  xmlns:fo="http://www.w3.org/1999/XSL/Format"
31                  xmlns:xlink="http://www.w3.org/1999/xlink"
32                  xmlns:number="http://openoffice.org/2000/datastyle"
33                  xmlns:svg="http://www.w3.org/2000/svg"
34                  xmlns:chart="http://openoffice.org/2000/chart"
35                  xmlns:dr3d="http://openoffice.org/2000/dr3d"
36                  xmlns:math="http://www.w3.org/1998/Math/MathML"
37                  xmlns:form="http://openoffice.org/2000/form"
38                  xmlns:script="http://openoffice.org/2000/script"
39                  >
40<xsl:output method="xml" />
41
42
43<xsl:template match="/">
44    <xsl:apply-templates />
45</xsl:template>
46
47<xsl:template match="html">
48
49    <office:document-content xmlns:office="http://openoffice.org/2000/office"
50                 xmlns:style="http://openoffice.org/2000/style"
51                 xmlns:text="http://openoffice.org/2000/text"
52                 xmlns:table="http://openoffice.org/2000/table"
53                 xmlns:draw="http://openoffice.org/2000/drawing"
54                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
55                 xmlns:xlink="http://www.w3.org/1999/xlink"
56                 xmlns:number="http://openoffice.org/2000/datastyle"
57                 xmlns:svg="http://www.w3.org/2000/svg"
58                 xmlns:chart="http://openoffice.org/2000/chart"
59                 xmlns:dr3d="http://openoffice.org/2000/dr3d"
60                 xmlns:math="http://www.w3.org/1998/Math/MathML"
61                 xmlns:form="http://openoffice.org/2000/form"
62                 xmlns:script="http://openoffice.org/2000/script"
63                 office:class="text" office:version="1.0">
64
65<office:script/>
66 <office:font-decls>
67  <style:font-decl style:name="Letter Gothic" fo:font-family="&apos;Letter Gothic&apos;" style:font-family-generic="modern" style:font-pitch="fixed"/>
68  <style:font-decl style:name="Arial Unicode MS" fo:font-family="&apos;Arial Unicode MS&apos;" style:font-pitch="variable"/>
69  <style:font-decl style:name="HG Mincho Light J" fo:font-family="&apos;HG Mincho Light J&apos;" style:font-pitch="variable"/>
70  <style:font-decl style:name="CG Times" fo:font-family="&apos;CG Times&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
71  <style:font-decl style:name="Thorndale" fo:font-family="Thorndale" style:font-family-generic="roman" style:font-pitch="variable"/>
72  <style:font-decl style:name="Antique Olive" fo:font-family="&apos;Antique Olive&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
73  <style:font-decl style:name="Arial Black" fo:font-family="&apos;Arial Black&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
74 </office:font-decls>
75 <office:automatic-styles>
76  <style:style style:name="Table1" style:family="table">
77   <style:properties style:width="16.999cm" table:align="margins"/>
78  </style:style>
79  <style:style style:name="Table1.A" style:family="table-column">
80   <style:properties style:column-width="3.399cm" style:rel-column-width="13107*"/>
81  </style:style>
82  <style:style style:name="Table1.A1" style:family="table-cell">
83   <style:properties fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="none" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000"/>
84  </style:style>
85  <style:style style:name="Table1.E1" style:family="table-cell">
86   <style:properties fo:padding="0.097cm" fo:border="0.002cm solid #000000"/>
87  </style:style>
88  <style:style style:name="Table1.A2" style:family="table-cell">
89   <style:properties fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.002cm solid #000000"/>
90  </style:style>
91  <style:style style:name="Table1.E2" style:family="table-cell">
92   <style:properties fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="none" fo:border-bottom="0.002cm solid #000000"/>
93  </style:style>
94  <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
95   <style:properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
96  </style:style>
97  <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Table Contents">
98   <style:properties style:font-name="Arial Black" fo:font-size="20pt"/>
99  </style:style>
100 </office:automatic-styles>
101
102
103
104
105
106    <office:body>
107         <text:sequence-decls>
108            <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
109            <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
110            <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
111            <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
112        </text:sequence-decls>
113
114        <xsl:apply-templates/>
115    </office:body>
116    </office:document-content>
117
118</xsl:template>
119
120<xsl:template match="body">
121    <xsl:apply-templates />
122</xsl:template>
123
124
125
126<xsl:template match="p">
127    <xsl:for-each select=".">
128        <text:p text:style-name="P1">
129            <!--<xsl:value-of select="."/>-->
130            <xsl:apply-templates />
131        </text:p>
132    </xsl:for-each>
133</xsl:template>
134
135<xsl:template match="br">
136    <xsl:if test="ancestor::p">
137        <xsl:text disable-output-escaping="yes">&lt;/text:p&gt; &lt;text:p text:style-name="P1"&gt;</xsl:text>
138    </xsl:if>
139</xsl:template>
140
141<xsl:template match="table">
142    <xsl:for-each select=".">
143        <table:table table:name="Table1" table:style-name="Table1">
144                 <table:table-column table:style-name="Table1.A" table:number-columns-repeated="5"/>
145            <xsl:apply-templates/>
146        </table:table>
147    </xsl:for-each>
148</xsl:template>
149
150<xsl:template match="tr">
151    <xsl:for-each select=".">
152        <table:table-row>
153            <xsl:apply-templates/>
154        </table:table-row>
155    </xsl:for-each>
156</xsl:template>
157
158<xsl:template match="td">
159    <xsl:for-each select=".">
160        <table:table-cell table:style-name="Table1.A1" table:value-type="string">
161        <text:p text:style-name="P1">
162                <xsl:value-of select="."/>
163            </text:p>
164        </table:table-cell>
165    </xsl:for-each>
166</xsl:template>
167
168
169
170</xsl:stylesheet>
171