1 | <?xml version="1.0" encoding="utf-8"?> |
---|
2 | <!-- |
---|
3 | |
---|
4 | xhtml2odt - XHTML to ODT XML transformation. |
---|
5 | Copyright (C) 2009 Aurelien Bompard |
---|
6 | Based on the work on docbook2odt, by Roman Fordinal |
---|
7 | http://open.comsultia.com/docbook2odf/ |
---|
8 | |
---|
9 | This program is free software; you can redistribute it and/or |
---|
10 | modify it under the terms of the GNU General Public License |
---|
11 | as published by the Free Software Foundation; either version 2 |
---|
12 | of the License, or (at your option) any later version. |
---|
13 | |
---|
14 | This program is distributed in the hope that it will be useful, |
---|
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
17 | GNU General Public License for more details. |
---|
18 | |
---|
19 | --> |
---|
20 | <xsl:stylesheet |
---|
21 | xmlns:h="http://www.w3.org/1999/xhtml" |
---|
22 | xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" |
---|
23 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
---|
24 | xmlns:dc="http://purl.org/dc/elements/1.1/" |
---|
25 | xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" |
---|
26 | xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" |
---|
27 | xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" |
---|
28 | xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" |
---|
29 | xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" |
---|
30 | xmlns:xlink="http://www.w3.org/1999/xlink" |
---|
31 | xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" |
---|
32 | xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" |
---|
33 | xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" |
---|
34 | xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" |
---|
35 | xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" |
---|
36 | xmlns:math="http://www.w3.org/1998/Math/MathML" |
---|
37 | xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" |
---|
38 | xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" |
---|
39 | xmlns:dom="http://www.w3.org/2001/xml-events" |
---|
40 | xmlns:xforms="http://www.w3.org/2002/xforms" |
---|
41 | xmlns:xsd="http://www.w3.org/2001/XMLSchema" |
---|
42 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
---|
43 | xmlns:presentation="urn:oasis:names:tc:opendocument:xmlns:presentation:1.0" |
---|
44 | version="1.0"> |
---|
45 | |
---|
46 | |
---|
47 | <xsl:template name="section" match="h:h1|h:h2|h:h3|h:h4|h:h5|h:h6"> |
---|
48 | |
---|
49 | <!-- compute level of section --> |
---|
50 | <xsl:variable name="level"> |
---|
51 | <xsl:value-of select="substring-after(local-name(.),'h') - $heading_minus_level"/> |
---|
52 | </xsl:variable> |
---|
53 | |
---|
54 | <xsl:comment> |
---|
55 | <xsl:text>section level </xsl:text><xsl:value-of select="$level"/> |
---|
56 | </xsl:comment> |
---|
57 | |
---|
58 | <text:h> |
---|
59 | <!-- |
---|
60 | <xsl:attribute name="text:outline-level"> |
---|
61 | <xsl:value-of select="$level"/> |
---|
62 | </xsl:attribute> |
---|
63 | --> |
---|
64 | <xsl:attribute name="text:style-name"><xsl:text>Heading_20_</xsl:text> |
---|
65 | <xsl:value-of select="$level"/> |
---|
66 | </xsl:attribute> |
---|
67 | |
---|
68 | <xsl:apply-templates mode="inparagraph"/> |
---|
69 | |
---|
70 | </text:h> |
---|
71 | |
---|
72 | </xsl:template> |
---|
73 | |
---|
74 | |
---|
75 | </xsl:stylesheet> |
---|