1 <?xml version='
1.0'
encoding=
"UTF-8"?>
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 $
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 #*************************************************************************
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 />
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">
77 <style:font-decl style:
name=
"Letter Gothic" fo:
font-family=
"'Letter Gothic'" style:
font-family-generic=
"modern" style:
font-pitch=
"fixed"/>
78 <style:font-decl style:
name=
"Arial Unicode MS" fo:
font-family=
"'Arial Unicode MS'" style:
font-pitch=
"variable"/>
79 <style:font-decl style:
name=
"HG Mincho Light J" fo:
font-family=
"'HG Mincho Light J'" style:
font-pitch=
"variable"/>
80 <style:font-decl style:
name=
"CG Times" fo:
font-family=
"'CG Times'" 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=
"'Antique Olive'" style:
font-family-generic=
"swiss" style:
font-pitch=
"variable"/>
83 <style:font-decl style:
name=
"Arial Black" fo:
font-family=
"'Arial Black'" style:
font-family-generic=
"swiss" style:
font-pitch=
"variable"/>
85 <office:automatic-styles>
86 <style:style style:
name=
"Table1" style:
family=
"table">
87 <style:properties style:
width=
"16.999cm" table:
align=
"margins"/>
89 <style:style style:
name=
"Table1.A" style:
family=
"table-column">
90 <style:properties style:
column-width=
"3.399cm" style:
rel-column-width=
"13107*"/>
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"/>
95 <style:style style:
name=
"Table1.E1" style:
family=
"table-cell">
96 <style:properties fo:
padding=
"0.097cm" fo:
border=
"0.002cm solid #000000"/>
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"/>
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"/>
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"/>
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"/>
110 </office:automatic-styles>
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/>
126 </office:document-content>
130 <xsl:template match=
"body">
131 <xsl:apply-templates />
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 />
145 <xsl:template match=
"br">
146 <xsl:if test=
"ancestor::p">
147 <xsl:text disable-output-escaping=
"yes"></text:p
> <text:p text:
style-name=
"P1"></xsl:text>
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/>
160 <xsl:template match=
"tr">
161 <xsl:for-each select=
".">
163 <xsl:apply-templates/>
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=
"."/>