Update ooo320-m1
[ooovba.git] / xmerge / source / htmlsoff / sofftohtml.xsl
blobdb2e38e66af717ac425c743c82233380d05a50f1
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
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 $
12 $Revision: 1.4 $
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.
31 -->
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">
37 <html>
38 <xsl:apply-templates/>
39 </html>
40 </xsl:template>
41 <xsl:template match="office:document-content">
42 <html>
43 <xsl:apply-templates/>
44 </html>
45 </xsl:template>
46 <xsl:template match="office:automatic-styles">
47 <style type="text/css">p.Table-Heading{font-weight:bold;}<xsl:apply-templates/>
48 </style>
49 </xsl:template>
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>
59 </xsl:template>
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"/>-->
72 </xsl:template>
73 <xsl:template match="office:body">
74 <xsl:apply-templates/>
75 </xsl:template>
76 <xsl:template match="table:table">
77 <table border="1" cellpadding="2" width="100%">
78 <xsl:apply-templates/>
79 </table>
80 </xsl:template>
81 <xsl:template match="table:table-header-rows">
82 <th>
83 <xsl:apply-templates/>
84 </th>
85 </xsl:template>
86 <xsl:template match="table:table-row">
87 <tr>
88 <xsl:apply-templates/>
89 </tr>
90 </xsl:template>
91 <xsl:template match="table:table-cell">
92 <xsl:text disable-output-escaping="yes">&lt;td class="</xsl:text>
93 <xsl:value-of select="@table:style-name"/>
94 <xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
95 <!--<xsl:value-of select="."/>-->
96 <xsl:apply-templates/>
97 <xsl:text disable-output-escaping="yes">&lt;/td&gt;</xsl:text>
98 <!--<td width="20%">
99 <xsl:apply-templates />
100 </td>-->
101 </xsl:template>
102 <xsl:template match="text:p">
103 <xsl:if test="ancestor-or-self::table:table-cell">
104 <xsl:if test=".=''">
105 <br/>
106 </xsl:if>
107 </xsl:if>
108 <xsl:text disable-output-escaping="yes">&lt;p class="</xsl:text>
109 <xsl:choose>
110 <xsl:when test="@text:style-name ='Table Heading'">Table-Heading</xsl:when>
111 <xsl:otherwise>
112 <xsl:value-of select="@text:style-name"/>
113 </xsl:otherwise>
114 </xsl:choose>
115 <xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
116 <xsl:apply-templates/>
117 <xsl:text disable-output-escaping="yes">&lt;/p&gt;</xsl:text>
118 <!--<xsl:value-of select="."/>-->
119 <!--<xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text>-->
120 <!--<br/>-->
121 </xsl:template>
122 </xsl:stylesheet>