1 <?xml version=
"1.0" encoding=
"UTF-8"?>
4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 Copyright 2008 by Sun Microsystems, Inc.
8 OpenOffice.org - a multi-platform office productivity suite
10 $RCSfile: sofftohtml.xsl,v $
14 This file is part of OpenOffice.org.
16 OpenOffice.org is free software: you can redistribute it and/or modify
17 it under the terms of the GNU Lesser General Public License version 3
18 only, as published by the Free Software Foundation.
20 OpenOffice.org is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU Lesser General Public License version 3 for more details
24 (a copy is included in the LICENSE file that accompanied this code).
26 You should have received a copy of the GNU Lesser General Public License
27 version 3 along with OpenOffice.org. If not, see
28 <http://www.openoffice.org/license.html>
29 for a copy of the LGPLv3 License.
32 <xsl:stylesheet version=
"1.0" xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform" xmlns:
style=
"http://openoffice.org/2000/style" xmlns:
table=
"http://openoffice.org/2000/table" xmlns:
text=
"http://openoffice.org/2000/text" xmlns:
office=
"http://openoffice.org/2000/office" xmlns:
fo=
"http://www.w3.org/1999/XSL/Format">
33 <xsl:output method=
"xml" omit-xml-declaration=
"yes" indent=
"yes" encoding=
"ISO-8859-1"/>
34 <!--doctype-system=[<!ENTITY acirc "">] -->
35 <xsl:strip-space elements=
"tokens"/>
36 <xsl:template match=
"office:document">
38 <xsl:apply-templates/>
41 <xsl:template match=
"office:document-content">
43 <xsl:apply-templates/>
46 <xsl:template match=
"office:automatic-styles">
47 <style type=
"text/css">p.Table-Heading{font-weight:bold;}
<xsl:apply-templates/>
50 <xsl:template match=
"office:styles"/>
51 <xsl:template match=
"office:meta"/>
52 <xsl:template match=
"office:settings"/>
53 <xsl:template match=
"style:style">
54 <xsl:if test=
"@style:family ='paragraph'">p.
<xsl:value-of select=
"@style:name"/>{
<xsl:apply-templates/>}
</xsl:if>
55 <xsl:if test=
"@style:family ='paragraph'">p.
<xsl:value-of select=
"@style:name"/>{
<xsl:if test=
"@style:parent-style-name='Table Heading'">font-weight:bold;font-style:italic;
</xsl:if>
56 <xsl:apply-templates/>}
</xsl:if>
57 <xsl:if test=
"@style:family ='table-cell'">td.
<xsl:value-of select=
"@style:name"/>{
<xsl:if test=
"@style:parent-style-name='Table Heading'">font-weight:bold;font-style:italic;
</xsl:if>
58 <xsl:apply-templates/>}
</xsl:if>
60 <xsl:template match=
"style:properties">
61 <!--<xsl:param name="style" select="@fo:font-weight"/>-->
62 <xsl:if test=
"@fo:font-weight">font-weight:
<xsl:value-of select=
"@fo:font-weight"/>;
</xsl:if>
63 <xsl:if test=
"@fo:font-style">font-style:
<xsl:value-of select=
"@fo:font-style"/>;
</xsl:if>
64 <xsl:if test=
"@style:font-name">font-family:
<xsl:value-of select=
"@style:font-name"/>;
</xsl:if>
65 <xsl:if test=
"@fo:font-size">font-size:
<xsl:value-of select=
"@fo:font-size"/>;
</xsl:if>
66 <xsl:if test=
"@style:text-underline='single'">text-decoration:underline;
</xsl:if>
67 <xsl:if test=
"@style:text-crossing-out='single-line'">text-decoration:line-through;
</xsl:if>
68 <xsl:if test=
"@fo:text-align='start'">text-align:left
</xsl:if>
69 <xsl:if test=
"@fo:text-align='center'">text-align:center
</xsl:if>
70 <xsl:if test=
"@fo:text-align='end'">text-align:right
</xsl:if>
71 <!--<xsl:value-of select="$style"/>-->
73 <xsl:template match=
"office:body">
74 <xsl:apply-templates/>
76 <xsl:template match=
"table:table">
77 <table border=
"1" cellpadding=
"2" width=
"100%">
78 <xsl:apply-templates/>
81 <xsl:template match=
"table:table-header-rows">
83 <xsl:apply-templates/>
86 <xsl:template match=
"table:table-row">
88 <xsl:apply-templates/>
91 <xsl:template match=
"table:table-cell">
92 <xsl:text disable-output-escaping=
"yes"><td
class=
"</xsl:text>
93 <xsl:value-of select="@table:style-name
"/>
94 <xsl:text disable-output-escaping="yes
">"></xsl:text>
95 <!--<xsl:value-of select="."/>-->
96 <xsl:apply-templates/>
97 <xsl:text disable-output-escaping=
"yes"></td
></xsl:text>
99 <xsl:apply-templates />
102 <xsl:template match=
"text:p">
103 <xsl:if test=
"ancestor-or-self::table:table-cell">
108 <xsl:text disable-output-escaping=
"yes"><p
class=
"</xsl:text>
110 <xsl:when test="@text:style-name ='Table Heading'
">Table-Heading</xsl:when>
112 <xsl:value-of select="@text:style-name
"/>
115 <xsl:text disable-output-escaping="yes
">"></xsl:text>
116 <xsl:apply-templates/>
117 <xsl:text disable-output-escaping=
"yes"></p
></xsl:text>
118 <!--<xsl:value-of select="."/>-->
119 <!--<xsl:text disable-output-escaping="yes">&nbsp;</xsl:text>-->