Update ooo320-m1
[ooovba.git] / xmerge / source / htmlsoff / htmltosoff.xsl
blob509849dd01ed165950cf63499e34c1d0bcc04b3f
1 <?xml version='1.0' encoding="UTF-8"?>
2 <!--
3 #*************************************************************************
5 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7 Copyright 2008 by Sun Microsystems, Inc.
9 OpenOffice.org - a multi-platform office productivity suite
11 $RCSfile: htmltosoff.xsl,v $
13 $Revision: 1.4 $
15 This file is part of OpenOffice.org.
17 OpenOffice.org is free software: you can redistribute it and/or modify
18 it under the terms of the GNU Lesser General Public License version 3
19 only, as published by the Free Software Foundation.
21 OpenOffice.org is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 GNU Lesser General Public License version 3 for more details
25 (a copy is included in the LICENSE file that accompanied this code).
27 You should have received a copy of the GNU Lesser General Public License
28 version 3 along with OpenOffice.org. If not, see
29 <http://www.openoffice.org/license.html>
30 for a copy of the LGPLv3 License.
32 #*************************************************************************
33 -->
34 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
35 xmlns:office="http://openoffice.org/2000/office"
36 xmlns:style="http://openoffice.org/2000/style"
37 xmlns:text="http://openoffice.org/2000/text"
38 xmlns:table="http://openoffice.org/2000/table"
39 xmlns:draw="http://openoffice.org/2000/drawing"
40 xmlns:fo="http://www.w3.org/1999/XSL/Format"
41 xmlns:xlink="http://www.w3.org/1999/xlink"
42 xmlns:number="http://openoffice.org/2000/datastyle"
43 xmlns:svg="http://www.w3.org/2000/svg"
44 xmlns:chart="http://openoffice.org/2000/chart"
45 xmlns:dr3d="http://openoffice.org/2000/dr3d"
46 xmlns:math="http://www.w3.org/1998/Math/MathML"
47 xmlns:form="http://openoffice.org/2000/form"
48 xmlns:script="http://openoffice.org/2000/script"
50 <xsl:output method="xml" />
53 <xsl:template match="/">
54 <xsl:apply-templates />
55 </xsl:template>
57 <xsl:template match="html">
59 <office:document-content xmlns:office="http://openoffice.org/2000/office"
60 xmlns:style="http://openoffice.org/2000/style"
61 xmlns:text="http://openoffice.org/2000/text"
62 xmlns:table="http://openoffice.org/2000/table"
63 xmlns:draw="http://openoffice.org/2000/drawing"
64 xmlns:fo="http://www.w3.org/1999/XSL/Format"
65 xmlns:xlink="http://www.w3.org/1999/xlink"
66 xmlns:number="http://openoffice.org/2000/datastyle"
67 xmlns:svg="http://www.w3.org/2000/svg"
68 xmlns:chart="http://openoffice.org/2000/chart"
69 xmlns:dr3d="http://openoffice.org/2000/dr3d"
70 xmlns:math="http://www.w3.org/1998/Math/MathML"
71 xmlns:form="http://openoffice.org/2000/form"
72 xmlns:script="http://openoffice.org/2000/script"
73 office:class="text" office:version="1.0">
75 <office:script/>
76 <office:font-decls>
77 <style:font-decl style:name="Letter Gothic" fo:font-family="&apos;Letter Gothic&apos;" style:font-family-generic="modern" style:font-pitch="fixed"/>
78 <style:font-decl style:name="Arial Unicode MS" fo:font-family="&apos;Arial Unicode MS&apos;" style:font-pitch="variable"/>
79 <style:font-decl style:name="HG Mincho Light J" fo:font-family="&apos;HG Mincho Light J&apos;" style:font-pitch="variable"/>
80 <style:font-decl style:name="CG Times" fo:font-family="&apos;CG Times&apos;" style:font-family-generic="roman" style:font-pitch="variable"/>
81 <style:font-decl style:name="Thorndale" fo:font-family="Thorndale" style:font-family-generic="roman" style:font-pitch="variable"/>
82 <style:font-decl style:name="Antique Olive" fo:font-family="&apos;Antique Olive&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
83 <style:font-decl style:name="Arial Black" fo:font-family="&apos;Arial Black&apos;" style:font-family-generic="swiss" style:font-pitch="variable"/>
84 </office:font-decls>
85 <office:automatic-styles>
86 <style:style style:name="Table1" style:family="table">
87 <style:properties style:width="16.999cm" table:align="margins"/>
88 </style:style>
89 <style:style style:name="Table1.A" style:family="table-column">
90 <style:properties style:column-width="3.399cm" style:rel-column-width="13107*"/>
91 </style:style>
92 <style:style style:name="Table1.A1" style:family="table-cell">
93 <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"/>
94 </style:style>
95 <style:style style:name="Table1.E1" style:family="table-cell">
96 <style:properties fo:padding="0.097cm" fo:border="0.002cm solid #000000"/>
97 </style:style>
98 <style:style style:name="Table1.A2" style:family="table-cell">
99 <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"/>
100 </style:style>
101 <style:style style:name="Table1.E2" style:family="table-cell">
102 <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"/>
103 </style:style>
104 <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
105 <style:properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
106 </style:style>
107 <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Table Contents">
108 <style:properties style:font-name="Arial Black" fo:font-size="20pt"/>
109 </style:style>
110 </office:automatic-styles>
116 <office:body>
117 <text:sequence-decls>
118 <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
119 <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
120 <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
121 <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
122 </text:sequence-decls>
124 <xsl:apply-templates/>
125 </office:body>
126 </office:document-content>
128 </xsl:template>
130 <xsl:template match="body">
131 <xsl:apply-templates />
132 </xsl:template>
136 <xsl:template match="p">
137 <xsl:for-each select=".">
138 <text:p text:style-name="P1">
139 <!--<xsl:value-of select="."/>-->
140 <xsl:apply-templates />
141 </text:p>
142 </xsl:for-each>
143 </xsl:template>
145 <xsl:template match="br">
146 <xsl:if test="ancestor::p">
147 <xsl:text disable-output-escaping="yes">&lt;/text:p&gt; &lt;text:p text:style-name="P1"&gt;</xsl:text>
148 </xsl:if>
149 </xsl:template>
151 <xsl:template match="table">
152 <xsl:for-each select=".">
153 <table:table table:name="Table1" table:style-name="Table1">
154 <table:table-column table:style-name="Table1.A" table:number-columns-repeated="5"/>
155 <xsl:apply-templates/>
156 </table:table>
157 </xsl:for-each>
158 </xsl:template>
160 <xsl:template match="tr">
161 <xsl:for-each select=".">
162 <table:table-row>
163 <xsl:apply-templates/>
164 </table:table-row>
165 </xsl:for-each>
166 </xsl:template>
168 <xsl:template match="td">
169 <xsl:for-each select=".">
170 <table:table-cell table:style-name="Table1.A1" table:value-type="string">
171 <text:p text:style-name="P1">
172 <xsl:value-of select="."/>
173 </text:p>
174 </table:table-cell>
175 </xsl:for-each>
176 </xsl:template>
180 </xsl:stylesheet>