merge the formfield patch from ooo-build
[ooovba.git] / filter / source / docbook / sofftodocbookheadings.xsl
blobb91a7d3e30116598acaa6fdeec771ee2cb2d00fe
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: sofftodocbookheadings.xsl,v $
12 $Revision: 1.11 $
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:style="http://openoffice.org/2000/style" xmlns:text="http://openoffice.org/2000/text" xmlns:office="http://openoffice.org/2000/office" xmlns:table="http://openoffice.org/2000/table" xmlns:draw="http://openoffice.org/2000/drawing" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="http://openoffice.org/2000/meta" xmlns:number="http://openoffice.org/2000/datastyle" xmlns:svg="http://www.w3.org/2000/svg" xmlns:chart="http://openoffice.org/2000/chart" xmlns:dr3d="http://openoffice.org/2000/dr3d" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="http://openoffice.org/2000/form" xmlns:script="http://openoffice.org/2000/script" xmlns:config="http://openoffice.org/2001/config" office:class="text" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="office meta table number dc fo xlink chart math script xsl draw svg dr3d form config text style">
33 <xsl:output method="xml" indent="yes" omit-xml-declaration="no" version="1.0" encoding="UTF-8" doctype-public="-//OASIS//DTD DocBook XML V4.1.2//EN" doctype-system="http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"/>
36 <!-- Heading will be mapped to sections.
37 In OpenDocument headings are not nested, they do not embrace their related content, the XML hierarchy has to be restructured.
39 Example of OpenDocument content:
41 <office:body>
42 <text:h text:style-name="Heading 1" text:level="1">Heading 1</text:h>
43 <text:p text:style-name="Text body">Heading 1 Content</text:p>
44 <text:h text:style-name="Heading 2" text:level="2">Heading 2</text:h>
45 <text:p text:style-name="Text body">Heading 2 Content</text:p>
46 <office:body>
48 Example of DocBook content:
50 <article lang="en-US">
51 <sect1>
52 <title>Heading 1</title>
53 <para>Heading 1 Content</para>
54 <sect2>
55 <title>Heading 2</title>
56 <para>Heading 2 Content</para>
57 </sect2>
58 </sect1>
59 </article>
60 -->
62 <!-- The key function "nestedContent" returns all ODF elements that are children of the current heading (i.e. text:h) or their parent office:body in case there is no text:h.
63 It works by matching all ODF elements, that text:h refer to (it's sibling or office:body childring)
64 Various keyed element sets of these matched elements are being generated. A set is identified by having the same last (closest) preceding text:h or if none exisitent the parent document.
65 All those elements, that have the current heading as last preceding heading (text:h) are returned as a nodeset.
66 -->
67 <xsl:key name="nestedContent"
68 match="text:p | table:table | text:span | text:ordered-list | office:annotation | text:unordered-list | text:footnote | text:a | text:list-item | draw:plugin | draw:text-box | text:footnote-body | text:section"
69 use="generate-id((.. | preceding::text:h)[last()])"/>
71 <!-- The key function "nestedHeadings" returns a nodeset of all heading (text:h) elements, which belong to this heading (follow and have a higher outline number than the current text:h, which ID is given to the function) -->
72 <xsl:key name="nestedHeadings"
73 match="text:h"
74 use="generate-id(preceding::text:h[@text:level &lt; current()/@text:level][1])"/>
76 <!-- All those headings have not the lowest outline level (mapped to section1), but come before the first heading mapped to section1 -->
77 <xsl:key name="preludingHeadings"
78 match="text:h"
79 use="generate-id(following::text:h[@text:level = $section1_OutlineLevel][1])"/>
81 <!-- The key function "getHeadingsByOutline" returns all headings of a certain outline level -->
82 <xsl:key name="getHeadingsByOutline"
83 match="text:h"
84 use="@text:level"/>
86 <!-- A further problem during mapping of Heading to sections is the quantity of levels. In OpenDocument there can exist more than 4 hierarchies (outline levels).
87 Furthermore an OpenDocument have not to start with heading outline level 1 nor does a outline level 2 have to follow.
88 Therefore all possible existing heading outline levels from 1 to 10 have to be mapped to the section1 to section4 in DocBook.
89 The lowest outline number is mapped section1, second is section2... until fourth and higher are all mapped to section4 -->
91 <!-- Each global variable hold the outline level which has been mapped to one of the four sections in DocBook -->
92 <xsl:variable name="section1_OutlineLevel">
93 <xsl:call-template name="findOutlineLevel">
94 <xsl:with-param name="candidateOutlineLevel" select="1"/>
95 </xsl:call-template>
96 </xsl:variable>
97 <xsl:variable name="section2_OutlineLevel">
98 <xsl:call-template name="findOutlineLevel">
99 <xsl:with-param name="candidateOutlineLevel" select="$section1_OutlineLevel + 1"/>
100 </xsl:call-template>
101 </xsl:variable>
102 <xsl:variable name="section3_OutlineLevel">
103 <xsl:call-template name="findOutlineLevel">
104 <xsl:with-param name="candidateOutlineLevel" select="$section2_OutlineLevel + 1"/>
105 </xsl:call-template>
106 </xsl:variable>
107 <xsl:variable name="section4_OutlineLevel">
108 <xsl:call-template name="findOutlineLevel">
109 <xsl:with-param name="candidateOutlineLevel" select="$section3_OutlineLevel + 1"/>
110 </xsl:call-template>
111 </xsl:variable>
113 <!-- get the minimum available heading outline level (usually '1') -->
114 <xsl:template name="findOutlineLevel">
115 <xsl:param name="candidateOutlineLevel"/>
116 <xsl:choose>
117 <xsl:when test="key('getHeadingsByOutline', $candidateOutlineLevel)[1]/@text:level != ''">
118 <xsl:value-of select="$candidateOutlineLevel"/>
119 </xsl:when>
120 <xsl:otherwise>
121 <xsl:if test="$candidateOutlineLevel &lt; 11">
122 <xsl:call-template name="findOutlineLevel">
123 <xsl:with-param name="candidateOutlineLevel" select="$candidateOutlineLevel + 1"/>
124 </xsl:call-template>
125 </xsl:if>
126 </xsl:otherwise>
127 </xsl:choose>
128 </xsl:template>
131 <!-- START -->
132 <xsl:template match="/*">
133 <xsl:element name="article">
134 <xsl:attribute name="lang">
135 <xsl:value-of select="/*/office:meta/dc:language"/>
136 </xsl:attribute>
137 <!-- page style header -->
138 <xsl:call-template name="page-style">
139 <xsl:with-param name="area" select="'header'"/>
140 </xsl:call-template>
141 <xsl:apply-templates select="office:body"/>
142 <!-- page style footer -->
143 <xsl:call-template name="page-style"/>
144 </xsl:element>
145 </xsl:template>
148 <xsl:key match="style:master-page" name="styleMasterPage" use="@style:name" />
149 <!-- using a simple heuristic for "standard" page-style heading/footer from page styles -->
150 <xsl:template name="page-style">
151 <xsl:param name="area"/>
153 <xsl:variable name="defaultPageStyle" select="key('styleMasterPage', 'Standard')"/>
154 <xsl:choose>
155 <xsl:when test="$area = 'header'">
156 <xsl:apply-templates select="$defaultPageStyle/style:header/*"/>
157 </xsl:when>
158 <xsl:otherwise>
159 <xsl:apply-templates select="$defaultPageStyle/style:footer/*"/>
160 </xsl:otherwise>
161 </xsl:choose>
163 </xsl:template>
165 <xsl:template match="office:body">
166 <!-- here all children of office:body before the first heading are matched -->
167 <xsl:apply-templates select="key('nestedContent', generate-id())"/>
168 <!-- have to be descendant as text:h can be in a list:item in some list -->
169 <xsl:variable name="firstHeading" select="descendant::text:h[1]"/>
170 <!-- changing the context node from office:body to text:h as required for used key functions -->
171 <xsl:for-each select="descendant::text:h[@text:level=$section1_OutlineLevel][1]">
172 <!-- if the first heading is not of the section1 level -->
173 <xsl:if test="generate-id(.) != generate-id($firstHeading)">
174 <!-- create an anonymous section1 and embrace all headings preceding the first real existent section1 -->
175 <xsl:text disable-output-escaping="yes">&lt;sect1&gt;</xsl:text>
176 <title></title>
177 <!-- create sections for all the first section1 preluding headings -->
178 <xsl:for-each select="key('preludingHeadings', generate-id())">
179 <xsl:call-template name="make-section">
180 <xsl:with-param name="previousSectionLevel" select="$section1_OutlineLevel"/>
181 <xsl:with-param name="currentSectionLevel">
182 <xsl:call-template name="getSectionLevel">
183 <xsl:with-param name="outlineLevel" select="@text:level"/>
184 </xsl:call-template>
185 </xsl:with-param>
186 </xsl:call-template>
187 </xsl:for-each>
188 <xsl:text disable-output-escaping="yes">&lt;/sect1&gt;</xsl:text>
189 </xsl:if>
190 </xsl:for-each>
191 <!-- match all headings, which are mapped to section1 to create a nested section structure used in docbook (see first comment after copyright) -->
192 <xsl:apply-templates mode="recreateStructure" select="descendant::text:h[@text:level = $section1_OutlineLevel]"/>
193 </xsl:template>
195 <xsl:template match="text:h" mode="recreateStructure">
196 <!-- relate the current ODF outline level of the heading to one of the four docbook section levels-->
197 <xsl:variable name="currentSectionLevel">
198 <xsl:call-template name="getSectionLevel">
199 <xsl:with-param name="outlineLevel" select="@text:level"/>
200 </xsl:call-template>
201 </xsl:variable>
202 <xsl:choose>
203 <!-- heading with outline level 1 might be an Abstract -->
204 <xsl:when test="$currentSectionLevel = 1">
205 <xsl:choose>
206 <!-- when the content of a level 1 heading is 'Abstract' the <abstract> docbook element is used instead of <section1> -->
207 <xsl:when test=".='Abstract'">
208 <abstract>
209 <xsl:apply-templates select="key('nestedContent', generate-id())"/>
210 <xsl:apply-templates select="key('nestedHeadings', generate-id())" mode="recreateStructure"/>
211 </abstract>
212 </xsl:when>
213 <xsl:otherwise>
214 <xsl:call-template name="make-section">
215 <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
216 <xsl:with-param name="previousSectionLevel" select="$currentSectionLevel"/>
217 </xsl:call-template>
218 </xsl:otherwise>
219 </xsl:choose>
220 </xsl:when>
221 <xsl:otherwise>
222 <xsl:variable name="previousHeading" select="preceding::text:h[@text:level &lt; current()/@text:level][1]"/>
223 <xsl:choose>
224 <xsl:when test="$previousHeading/@text:level != ''">
225 <xsl:call-template name="make-section">
226 <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
227 <xsl:with-param name="previousSectionLevel">
228 <xsl:call-template name="getSectionLevel">
229 <xsl:with-param name="outlineLevel" select="$previousHeading/@text:level"/>
230 </xsl:call-template>
231 </xsl:with-param>
232 </xsl:call-template>
233 </xsl:when>
234 <xsl:otherwise>
235 <xsl:call-template name="make-section">
236 <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
237 <xsl:with-param name="previousSectionLevel" select="$currentSectionLevel"/>
238 </xsl:call-template>
239 </xsl:otherwise>
240 </xsl:choose>
241 </xsl:otherwise>
242 </xsl:choose>
243 </xsl:template>
245 <xsl:template match="text:bookmark | text:bookmark-start">
246 <xsl:element name="anchor">
247 <xsl:attribute name="id">
248 <!-- ID have to be an NCName which have to start with a letter or '_'
249 in case of the frequent starting number a '_' will be added as prefix -->
250 <xsl:choose>
251 <xsl:when test="(starts-with(@text:name, '0') or
252 starts-with(@text:name, '1') or
253 starts-with(@text:name, '2') or
254 starts-with(@text:name, '3') or
255 starts-with(@text:name, '4') or
256 starts-with(@text:name, '5') or
257 starts-with(@text:name, '6') or
258 starts-with(@text:name, '7') or
259 starts-with(@text:name, '8') or
260 starts-with(@text:name, '9'))">
261 <xsl:value-of select="concat('_', @text:name)"/>
262 </xsl:when>
263 <xsl:otherwise>
264 <xsl:value-of select="@text:name"/>
265 </xsl:otherwise>
266 </xsl:choose>
267 </xsl:attribute>
268 </xsl:element>
269 </xsl:template>
271 <xsl:template name="getSectionLevel">
272 <xsl:param name="outlineLevel"/>
273 <xsl:choose>
274 <xsl:when test="$outlineLevel = $section1_OutlineLevel">1</xsl:when>
275 <xsl:when test="$outlineLevel = $section2_OutlineLevel">2</xsl:when>
276 <xsl:when test="$outlineLevel = $section3_OutlineLevel">3</xsl:when>
277 <xsl:otherwise>4</xsl:otherwise>
278 </xsl:choose>
279 </xsl:template>
281 <!-- make-section creates the nested section hierarchy and
282 in case the difference between the parent section and the new section is higher than one
283 a section is inserted to keep the output format valid -->
284 <xsl:template name="make-section">
285 <xsl:param name="currentSectionLevel"/>
286 <xsl:param name="previousSectionLevel"/>
287 <xsl:choose>
288 <!-- empty title as it is an empty section between two headings with an outline level difference higher than 1 -->
289 <xsl:when test="$currentSectionLevel &gt; $previousSectionLevel+1">
290 <xsl:text disable-output-escaping="yes">&lt;sect</xsl:text>
291 <xsl:value-of select="$previousSectionLevel +1"/>
292 <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
293 <title></title>
294 <xsl:call-template name="make-section">
295 <xsl:with-param name="currentSectionLevel" select="$currentSectionLevel"/>
296 <xsl:with-param name="previousSectionLevel" select="$previousSectionLevel +1"/>
297 </xsl:call-template>
298 <xsl:text disable-output-escaping="yes">&lt;/sect</xsl:text>
299 <xsl:value-of select="$previousSectionLevel +1"/>
300 <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
301 </xsl:when>
302 <xsl:otherwise>
303 <xsl:text disable-output-escaping="yes">&lt;sect</xsl:text>
304 <xsl:value-of select="$currentSectionLevel"/>
305 <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
306 <title>
307 <xsl:apply-templates/>
308 </title>
309 <xsl:apply-templates select="key('nestedContent', generate-id())"/>
310 <xsl:apply-templates select="key('nestedHeadings', generate-id())" mode="recreateStructure"/>
311 <xsl:text disable-output-escaping="yes">&lt;/sect</xsl:text>
312 <xsl:value-of select="$currentSectionLevel"/>
313 <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
314 </xsl:otherwise>
315 </xsl:choose>
316 </xsl:template>
319 <xsl:template match="office:meta">
320 <!--<xsl:apply-templates/>--></xsl:template>
322 <xsl:template match="meta:editing-cycles"></xsl:template>
324 <xsl:template match="meta:user-defined"></xsl:template>
326 <xsl:template match="meta:editing-duration"></xsl:template>
328 <xsl:template match="dc:language"></xsl:template>
330 <xsl:template match="dc:date">
331 <!--<pubdate>
332 <xsl:value-of select="substring-before(.,'T')"/>
333 </pubdate>--></xsl:template>
335 <xsl:template match="meta:creation-date"></xsl:template>
337 <xsl:template match="office:styles">
338 <xsl:apply-templates/>
339 </xsl:template>
341 <xsl:template match="office:script"></xsl:template>
344 <xsl:template match="office:settings"></xsl:template>
346 <xsl:template match="office:font-decls"></xsl:template>
348 <xsl:template match="text:section">
349 <xsl:choose>
350 <xsl:when test="@text:name='ArticleInfo'">
351 <articleinfo>
352 <title>
353 <xsl:value-of select="text:p[@text:style-name='Document Title']"/>
354 </title>
355 <subtitle>
356 <xsl:value-of select="text:p[@text:style-name='Document SubTitle']"/>
357 </subtitle>
358 <edition>
359 <xsl:value-of select="text:p/text:variable-set[@text:name='articleinfo.edition']"/>
360 </edition>
361 <xsl:for-each select="text:p/text:variable-set[substring-after(@text:name,'articleinfo.releaseinfo')]">
362 <releaseinfo>
363 <xsl:value-of select="."/>
364 </releaseinfo>
365 </xsl:for-each>
366 <xsl:call-template name="ArticleInfo">
367 <xsl:with-param name="level" select="0"/>
368 </xsl:call-template>
369 </articleinfo>
370 </xsl:when>
371 <xsl:when test="@text:name='Abstract'">
372 <abstract>
373 <xsl:apply-templates/>
374 </abstract>
375 </xsl:when>
376 <xsl:when test="@text:name='Appendix'">
377 <appendix>
378 <xsl:apply-templates/>
379 </appendix>
380 </xsl:when>
381 <xsl:otherwise>
382 <xsl:variable name="sectvar">
383 <xsl:text>sect</xsl:text>
384 <xsl:value-of select="count(ancestor::text:section)+1"/>
385 </xsl:variable>
386 <xsl:variable name="idvar">
387 <xsl:text> id="</xsl:text>
388 <xsl:value-of select="@text:name"/>
389 <xsl:text>"</xsl:text>
390 </xsl:variable>
391 <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
392 <xsl:value-of select="$sectvar"/>
393 <xsl:value-of select="$idvar"/>
394 <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
395 <xsl:apply-templates/>
396 <xsl:text disable-output-escaping="yes">&lt;/</xsl:text>
397 <xsl:value-of select="$sectvar"/>
398 <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
399 </xsl:otherwise>
400 </xsl:choose>
401 </xsl:template>
403 <xsl:template name="ArticleInfo">
404 <xsl:param name="level"/>
405 <xsl:variable name="author">
406 <xsl:value-of select="concat('articleinfo.author_','', $level)"/>
407 </xsl:variable>
408 <xsl:if test="text:p/text:variable-set[contains(@text:name, $author )]">
409 <xsl:call-template name="Author">
410 <xsl:with-param name="AuthorLevel" select="0"/>
411 </xsl:call-template>
412 <xsl:call-template name="Copyright">
413 <xsl:with-param name="CopyrightLevel" select="0"/>
414 </xsl:call-template>
415 </xsl:if>
416 </xsl:template>
418 <xsl:template name="Copyright">
419 <xsl:param name="CopyrightLevel"/>
421 <xsl:variable name="Copyright">
422 <xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/>
423 </xsl:variable>
425 <xsl:if test="text:p/text:variable-set[contains(@text:name,$Copyright)]">
426 <copyright>
427 <xsl:call-template name="Year">
428 <xsl:with-param name="CopyrightLevel" select="$CopyrightLevel"/>
429 <xsl:with-param name="YearlLevel" select="0"/>
430 </xsl:call-template>
431 <xsl:call-template name="Holder">
432 <xsl:with-param name="CopyrightLevel" select="$CopyrightLevel"/>
433 <xsl:with-param name="HolderlLevel" select="0"/>
435 </xsl:call-template>
436 </copyright>
437 </xsl:if>
438 </xsl:template>
441 <xsl:template name="Year">
442 <xsl:param name="CopyrightLevel"/>
443 <xsl:param name="YearLevel"/>
444 <xsl:variable name="Copyright">
445 <xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/>
446 </xsl:variable>
447 <xsl:variable name="Year">
448 <xsl:value-of select="concat($Copyright,'',concat('.year_','',$YearLevel))"/>
449 </xsl:variable>
451 <xsl:if test="text:p/text:variable-set[@text:name=$Year]">
452 <orgname>
453 <xsl:value-of select="text:p/text:variable-set[@text:name=$Year]"/>
454 </orgname>
455 </xsl:if>
456 </xsl:template>
459 <xsl:template name="Holder">
460 <xsl:param name="CopyrightLevel"/>
461 <xsl:param name="HolderLevel"/>
462 <xsl:variable name="Copyright">
463 <xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/>
464 </xsl:variable>
465 <xsl:variable name="Holder">
466 <xsl:value-of select="concat($Copyright,'',concat('.holder_','',$HolderLevel))"/>
467 </xsl:variable>
469 <xsl:if test="text:p/text:variable-set[@text:name=$Holder]">
470 <orgname>
471 <xsl:value-of select="text:p/text:variable-set[@text:name=$Holder]"/>
472 </orgname>
473 </xsl:if>
474 </xsl:template>
478 <xsl:template name="Author">
479 <xsl:param name="AuthorLevel"/>
480 <xsl:variable name="Author">
481 <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
482 </xsl:variable>
483 <xsl:if test="text:p/text:variable-set[contains(@text:name, $Author )]">
484 <author>
485 <xsl:call-template name="Surname">
486 <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
487 <xsl:with-param name="SurnameLevel" select="0"/>
488 </xsl:call-template>
489 <xsl:call-template name="Firstname">
490 <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
491 <xsl:with-param name="FirstnameLevel" select="0"/>
492 </xsl:call-template>
493 <xsl:call-template name="Affiliation">
494 <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
495 <xsl:with-param name="AffilLevel" select="0"/>
496 </xsl:call-template>
497 </author>
498 <xsl:call-template name="Author">
499 <xsl:with-param name="AuthorLevel" select="$AuthorLevel+1"/>
500 </xsl:call-template>
501 </xsl:if>
502 </xsl:template>
505 <xsl:template name="Surname">
506 <xsl:param name="AuthorLevel"/>
507 <xsl:param name="SurnameLevel"/>
508 <xsl:variable name="Author">
509 <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
510 </xsl:variable>
511 <xsl:variable name="Surname">
512 <xsl:value-of select="concat($Author,'',concat('.surname_','',$SurnameLevel))"/>
513 </xsl:variable>
514 <xsl:if test="text:p/text:variable-set[@text:name=$Surname]">
515 <surname>
516 <xsl:value-of select="text:p/text:variable-set[@text:name=$Surname]"/>
517 </surname>
518 <xsl:call-template name="Surname">
519 <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
520 <xsl:with-param name="SurnameLevel" select="SurnameLevel+1"/>
521 </xsl:call-template>
523 </xsl:if>
524 </xsl:template>
529 <xsl:template name="Firstname">
530 <xsl:param name="AuthorLevel"/>
531 <xsl:param name="FirstnameLevel"/>
532 <xsl:variable name="Author">
533 <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
534 </xsl:variable>
535 <xsl:variable name="Firstname">
536 <xsl:value-of select="concat($Author,'',concat('.firstname_','',$FirstnameLevel))"/>
537 </xsl:variable>
538 <xsl:if test="text:p/text:variable-set[@text:name=$Firstname]">
539 <firstname>
540 <xsl:value-of select="text:p/text:variable-set[@text:name=$Firstname]"/>
541 </firstname>
542 <xsl:call-template name="Surname">
543 <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
544 <xsl:with-param name="FirstnameLevel" select="FirstnameLevel+1"/>
545 </xsl:call-template>
546 </xsl:if>
547 </xsl:template>
551 <xsl:template name="Affiliation">
552 <xsl:param name="AuthorLevel"/>
553 <xsl:param name="AffilLevel"/>
554 <xsl:variable name="Author">
555 <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
556 </xsl:variable>
557 <xsl:variable name="Affil">
558 <xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/>
559 </xsl:variable>
560 <xsl:if test="text:p/text:variable-set[contains(@text:name,$Affil)]">
561 <affiliation>
562 <xsl:call-template name="Orgname">
563 <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
564 <xsl:with-param name="AffilLevel" select="$AffilLevel"/>
565 <xsl:with-param name="OrgLevel" select="0"/>
566 </xsl:call-template>
567 <xsl:call-template name="Address">
568 <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
569 <xsl:with-param name="AffilLevel" select="$AffilLevel"/>
570 <xsl:with-param name="AddressLevel" select="0"/>
572 </xsl:call-template>
573 </affiliation>
574 </xsl:if>
575 </xsl:template>
577 <xsl:template name="Orgname">
578 <xsl:param name="AuthorLevel"/>
579 <xsl:param name="AffilLevel"/>
580 <xsl:param name="OrgLevel"/>
582 <xsl:variable name="Author">
583 <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
584 </xsl:variable>
585 <xsl:variable name="Affil">
586 <xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/>
587 </xsl:variable>
588 <xsl:variable name="Org">
589 <xsl:value-of select="concat($Affil,'',concat('.orgname_','',$OrgLevel))"/>
590 </xsl:variable>
592 <xsl:if test="text:p/text:variable-set[@text:name=$Org]">
593 <orgname>
594 <xsl:value-of select="text:p/text:variable-set[@text:name=$Org]"/>
595 </orgname>
596 </xsl:if>
597 </xsl:template>
599 <xsl:template name="Address">
600 <xsl:param name="AuthorLevel"/>
601 <xsl:param name="AffilLevel"/>
602 <xsl:param name="AddressLevel"/>
604 <xsl:variable name="Author">
605 <xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/>
606 </xsl:variable>
607 <xsl:variable name="Affil">
608 <xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/>
609 </xsl:variable>
610 <xsl:variable name="Address">
611 <xsl:value-of select="concat($Affil,'',concat('.address_','',$AddressLevel))"/>
612 </xsl:variable>
614 <xsl:if test="text:p/text:variable-set[@text:name=$Address]">
615 <address>
616 <xsl:value-of select="text:p/text:variable-set[@text:name=$Address]"/>
617 </address>
618 </xsl:if>
619 </xsl:template>
624 <xsl:template match="text:p[@text:style-name='Document Title']"></xsl:template>
626 <xsl:template match="text:p[@text:style-name='Document SubTitle']"></xsl:template>
629 <xsl:template match="text:p[@text:style-name='Section Title']">
630 <xsl:element name="title">
631 <xsl:apply-templates/>
632 </xsl:element>
633 </xsl:template>
635 <xsl:template match="text:p[@text:style-name='Appendix Title']">
636 <xsl:element name="title">
637 <xsl:apply-templates/>
638 </xsl:element>
639 </xsl:template>
642 <!--<xsl:template match="text:p[@text:style-name='VarList Item']">
643 <xsl:if test="not(preceding-sibling::text:p[@text:style-name='VarList Item'])">
644 <xsl:text disable-output-escaping="yes">&lt;listitem&gt;</xsl:text>
645 </xsl:if>
646 <para>
647 <xsl:apply-templates/>
648 </para>
649 <xsl:if test="not(following-sibling::text:p[@text:style-name='VarList Item'])">
650 <xsl:text disable-output-escaping="yes">&lt;/listitem&gt;</xsl:text>
651 </xsl:if>
652 </xsl:template>-->
655 <xsl:template match="text:p[@text:style-name='Section1 Title']">
656 <xsl:element name="title">
657 <xsl:apply-templates/>
658 </xsl:element>
659 </xsl:template>
662 <xsl:template match="text:p[@text:style-name='Section2 Title']">
663 <xsl:element name="title">
664 <xsl:apply-templates/>
665 </xsl:element>
666 </xsl:template>
669 <xsl:template match="text:p[@text:style-name='Section3 Title']">
670 <xsl:element name="title">
671 <xsl:apply-templates/>
672 </xsl:element>
673 </xsl:template>
675 <xsl:template match="text:footnote-citation"></xsl:template>
677 <xsl:template match="text:p[@text:style-name='Mediaobject']">
678 <mediaobject>
679 <xsl:apply-templates/>
680 </mediaobject>
681 </xsl:template>
683 <xsl:template match="office:annotation/text:p">
684 <note>
685 <remark>
686 <xsl:apply-templates/>
687 </remark>
688 </note>
689 </xsl:template>
691 <!--<xsl:template match="meta:initial-creator">
692 <author>
693 <xsl:apply-templates />
694 </author>
695 </xsl:template>-->
697 <xsl:template match="table:table">
698 <xsl:choose>
699 <xsl:when test="following-sibling::text:p[@text:style-name='Table']">
700 <table frame="all">
701 <xsl:attribute name="id">
702 <xsl:value-of select="@table:name"/>
703 </xsl:attribute>
704 <title>
705 <xsl:value-of select="following-sibling::text:p[@text:style-name='Table']"/>
706 </title>
707 <xsl:call-template name="generictable"/>
708 </table>
709 </xsl:when>
710 <xsl:otherwise>
711 <informaltable frame="all">
712 <xsl:call-template name="generictable"/>
713 </informaltable>
714 </xsl:otherwise>
715 </xsl:choose>
716 </xsl:template>
719 <xsl:template name="generictable">
720 <xsl:variable name="cells" select="count(descendant::table:table-cell)"></xsl:variable>
721 <xsl:variable name="rows">
722 <xsl:value-of select="count(descendant::table:table-row)"/>
723 </xsl:variable>
724 <xsl:variable name="cols">
725 <xsl:value-of select="$cells div $rows"/>
726 </xsl:variable>
727 <xsl:variable name="numcols">
728 <xsl:choose>
729 <xsl:when test="child::table:table-column/@table:number-columns-repeated">
730 <xsl:value-of select="number(table:table-column/@table:number-columns-repeated+1)"/>
731 </xsl:when>
732 <xsl:otherwise>
733 <xsl:value-of select="$cols"/>
734 </xsl:otherwise>
735 </xsl:choose>
736 </xsl:variable>
737 <xsl:element name="tgroup">
738 <xsl:attribute name="cols">
739 <xsl:value-of select="$numcols"/>
740 </xsl:attribute>
741 <xsl:call-template name="colspec">
742 <xsl:with-param name="left" select="1"/>
743 </xsl:call-template>
744 <xsl:apply-templates/>
745 </xsl:element>
746 </xsl:template>
748 <xsl:template name="colspec">
749 <xsl:param name="left"/>
750 <xsl:if test="number($left &lt; ( table:table-column/@table:number-columns-repeated +2) )">
751 <xsl:element name="colspec">
752 <xsl:attribute name="colnum">
753 <xsl:value-of select="$left"/>
754 </xsl:attribute>
755 <xsl:attribute name="colname">c<xsl:value-of select="$left"/>
756 </xsl:attribute>
757 </xsl:element>
758 <xsl:call-template name="colspec">
759 <xsl:with-param name="left" select="$left+1"/>
760 </xsl:call-template>
761 </xsl:if>
762 </xsl:template>
764 <xsl:template match="table:table-column">
765 <xsl:apply-templates/>
766 </xsl:template>
768 <xsl:template match="table:table-header-rows">
769 <thead>
770 <xsl:apply-templates/>
771 </thead>
772 </xsl:template>
774 <xsl:template match="table:table-header-rows/table:table-row">
775 <row>
776 <xsl:apply-templates/>
777 </row>
778 </xsl:template>
780 <xsl:template match="table:table/table:table-row">
781 <xsl:if test="not(preceding-sibling::table:table-row)">
782 <xsl:text disable-output-escaping="yes">&lt;tbody&gt;</xsl:text>
783 </xsl:if>
784 <row>
785 <xsl:apply-templates/>
786 </row>
787 <xsl:if test="not(following-sibling::table:table-row)">
788 <xsl:text disable-output-escaping="yes">&lt;/tbody&gt;</xsl:text>
789 </xsl:if>
790 </xsl:template>
792 <xsl:template match="table:table-cell">
793 <xsl:element name="entry">
794 <xsl:if test="@table:number-columns-spanned >'1'">
795 <xsl:attribute name="namest">
796 <xsl:value-of select="concat('c',count(preceding-sibling::table:table-cell[not(@table:number-columns-spanned)]) +sum(preceding-sibling::table:table-cell/@table:number-columns-spanned)+1)"/>
797 </xsl:attribute>
798 <xsl:attribute name="nameend">
799 <xsl:value-of select="concat('c',count(preceding-sibling::table:table-cell[not(@table:number-columns-spanned)]) +sum(preceding-sibling::table:table-cell/@table:number-columns-spanned)+ @table:number-columns-spanned)"/>
800 </xsl:attribute>
801 </xsl:if>
802 <xsl:apply-templates/>
803 </xsl:element>
804 </xsl:template>
806 <xsl:template match="text:p">
807 <xsl:choose>
808 <xsl:when test="@text:style-name='Table'"></xsl:when>
809 <xsl:otherwise>
810 <para>
811 <xsl:apply-templates/>
812 </para>
813 </xsl:otherwise>
814 </xsl:choose>
815 </xsl:template>
817 <xsl:key match="text:list-style" name="getListStyle" use="@style:name"/>
819 <xsl:template match="text:ordered-list">
820 <xsl:param name="outlineLevel" select="1"/>
822 <xsl:variable name="listStyle" select="key('getListStyle', @text:style-name)/*[@text:level = $outlineLevel]"/>
824 <!-- if the list is not recognizable as a list (e.g. no indent, number/bullet, etc.) the list will be ignored -->
825 <xsl:if test="$listStyle/style:properties/@*">
826 <orderedlist>
827 <xsl:apply-templates>
828 <xsl:with-param name="itemType" select="'listitem'"/>
829 <xsl:with-param name="outlineLevel" select="$outlineLevel + 1"/>
830 </xsl:apply-templates>
831 </orderedlist>
832 </xsl:if>
833 </xsl:template>
835 <xsl:template match="text:unordered-list">
836 <xsl:param name="outlineLevel" select="1"/>
838 <xsl:variable name="listStyle" select="key('getListStyle', @text:style-name)/*[@text:level = $outlineLevel]"/>
839 <!-- if the list is not recognizable as a list (e.g. no indent, number/bullet, etc.) the list will be ignored -->
840 <xsl:if test="$listStyle/style:properties/@*">
841 <xsl:choose>
842 <xsl:when test="@text:style-name='Var List'">
843 <variablelist>
844 <xsl:apply-templates>
845 <xsl:with-param name="itemType" select="'varlist'"/>
846 <xsl:with-param name="outlineLevel" select="$outlineLevel + 1"/>
847 </xsl:apply-templates>
848 </variablelist>
849 </xsl:when>
850 <xsl:otherwise>
851 <itemizedlist>
852 <xsl:apply-templates>
853 <xsl:with-param name="itemType" select="'listitem'"/>
854 <xsl:with-param name="outlineLevel" select="$outlineLevel + 1"/>
855 </xsl:apply-templates>
856 </itemizedlist>
857 </xsl:otherwise>
858 </xsl:choose>
859 </xsl:if>
860 </xsl:template>
862 <xsl:template match="text:list-item | text:list-header">
863 <xsl:param name="listType"/>
864 <xsl:param name="outlineLevel"/>
866 <xsl:choose>
867 <xsl:when test="$listType='Var List'">
868 <xsl:element name="varlistentry">
869 <xsl:apply-templates>
870 <xsl:with-param name="outlineLevel" select="$outlineLevel"/>
871 </xsl:apply-templates>
872 </xsl:element>
873 </xsl:when>
874 <xsl:otherwise>
875 <xsl:element name="listitem">
876 <xsl:apply-templates>
877 <xsl:with-param name="outlineLevel" select="$outlineLevel"/>
878 </xsl:apply-templates>
879 </xsl:element>
880 </xsl:otherwise>
881 </xsl:choose>
882 </xsl:template>
884 <xsl:template match="text:p[@text:style-name='VarList Term']">
885 <xsl:element name="term">
886 <xsl:apply-templates/>
887 </xsl:element>
888 </xsl:template>
890 <xsl:template match="text:p[@text:style-name='VarList Item']">
891 <xsl:element name="para">
892 <xsl:apply-templates/>
893 </xsl:element>
894 </xsl:template>
896 <!-- text headings should only be matched once, when creating a nested docbook section structure, but might be as well become as part of a list a title -->
897 <xsl:template match="text:h">
898 <title>
899 <xsl:apply-templates/>
900 </title>
901 </xsl:template>
903 <xsl:template match="dc:title"></xsl:template>
905 <xsl:template match="dc:description">
906 <abstract>
907 <para>
908 <xsl:apply-templates/>
909 </para>
910 </abstract>
911 </xsl:template>
913 <xsl:template match="dc:subject"></xsl:template>
916 <xsl:template match="meta:generator"></xsl:template>
918 <xsl:template match="draw:plugin">
919 <xsl:element name="audioobject">
920 <xsl:attribute name="fileref">
921 <xsl:value-of select="@xlink:href"/>
922 </xsl:attribute>
923 <xsl:attribute name="width"></xsl:attribute>
924 </xsl:element>
925 </xsl:template>
927 <xsl:template match="text:footnote">
928 <footnote>
929 <xsl:apply-templates/>
930 </footnote>
931 </xsl:template>
933 <xsl:template match="text:footnote-body">
934 <xsl:apply-templates/>
935 </xsl:template>
938 <xsl:template match="draw:text-box"></xsl:template>
942 <xsl:template match="draw:image">
943 <xsl:choose>
944 <xsl:when test="parent::text:p[@text:style-name='Mediaobject']">
945 <xsl:element name="imageobject">
946 <xsl:element name="imagedata">
947 <xsl:attribute name="fileref">
948 <xsl:value-of select="@xlink:href"/>
949 </xsl:attribute>
950 </xsl:element>
951 <xsl:element name="caption">
952 <xsl:value-of select="."/>
953 </xsl:element>
954 </xsl:element>
955 </xsl:when>
956 <xsl:otherwise>
957 <xsl:element name="inlinegraphic">
958 <xsl:attribute name="fileref">
959 <xsl:choose>
960 <xsl:when test="@xlink:href != ''">
961 <xsl:value-of select="@xlink:href"/>
962 </xsl:when>
963 <xsl:otherwise>
964 <xsl:text>embedded:</xsl:text>
965 <xsl:value-of select="@draw:name"/>
966 </xsl:otherwise>
967 </xsl:choose>
968 </xsl:attribute>
969 <xsl:attribute name="width">
970 <xsl:value-of select="@svg:width"/>
971 </xsl:attribute>
972 <xsl:attribute name="depth">
973 <xsl:value-of select="@svg:height"/>
974 </xsl:attribute>
975 </xsl:element>
976 </xsl:otherwise>
977 </xsl:choose>
978 </xsl:template>
981 <xsl:template match="text:span">
982 <xsl:choose>
983 <xsl:when test="./@text:style-name='GuiMenu'">
984 <xsl:element name="guimenu">
985 <xsl:value-of select="."/>
986 </xsl:element>
987 </xsl:when>
988 <xsl:when test="./@text:style-name='GuiSubMenu'">
989 <xsl:element name="guisubmenu">
990 <xsl:value-of select="."/>
991 </xsl:element>
992 </xsl:when>
993 <xsl:when test="@text:style-name='GuiMenuItem'">
994 <xsl:element name="guimenuitem">
995 <xsl:value-of select="."/>
996 </xsl:element>
997 </xsl:when>
998 <xsl:when test="@text:style-name='GuiButton'">
999 <xsl:element name="guibutton">
1000 <xsl:value-of select="."/>
1001 </xsl:element>
1002 </xsl:when>
1003 <xsl:when test="@text:style-name='GuiButton'">
1004 <xsl:element name="guibutton">
1005 <xsl:value-of select="."/>
1006 </xsl:element>
1007 </xsl:when>
1008 <xsl:when test="@text:style-name='GuiLabel'">
1009 <xsl:element name="guilabel">
1010 <xsl:value-of select="."/>
1011 </xsl:element>
1012 </xsl:when>
1013 <xsl:when test="@text:style-name='Emphasis'">
1014 <xsl:element name="emphasis">
1015 <xsl:value-of select="."/>
1016 </xsl:element>
1017 </xsl:when>
1018 <xsl:when test="@text:style-name='FileName'">
1019 <xsl:element name="filename">
1020 <xsl:value-of select="."/>
1021 </xsl:element>
1022 </xsl:when>
1023 <xsl:when test="@text:style-name='Application'">
1024 <xsl:element name="application">
1025 <xsl:value-of select="."/>
1026 </xsl:element>
1027 </xsl:when>
1028 <xsl:when test="@text:style-name='Command'">
1029 <command>
1030 <xsl:apply-templates/>
1031 </command>
1032 </xsl:when>
1033 <xsl:when test="@text:style-name='SubScript'">
1034 <subscript>
1035 <xsl:apply-templates/>
1036 </subscript>
1037 </xsl:when>
1038 <xsl:when test="@text:style-name='SuperScript'">
1039 <superscript>
1040 <xsl:apply-templates/>
1041 </superscript>
1042 </xsl:when>
1043 <xsl:when test="@text:style-name='SystemItem'">
1044 <systemitem>
1045 <xsl:apply-templates/>
1046 </systemitem>
1047 </xsl:when>
1048 <xsl:when test="@text:style-name='ComputerOutput'">
1049 <computeroutput>
1050 <xsl:apply-templates/>
1051 </computeroutput>
1052 </xsl:when>
1053 <xsl:when test="@text:style-name='Highlight'">
1054 <highlight>
1055 <xsl:apply-templates/>
1056 </highlight>
1057 </xsl:when>
1058 <xsl:when test="@text:style-name='KeyCap'">
1059 <keycap>
1060 <xsl:apply-templates/>
1061 </keycap>
1062 </xsl:when>
1063 <xsl:when test="@text:style-name='KeySym'">
1064 <xsl:element name="keysym">
1065 <xsl:apply-templates/>
1066 </xsl:element>
1067 </xsl:when>
1068 <xsl:when test="@text:style-name='KeyCombo'">
1069 <keycombo>
1070 <xsl:apply-templates/>
1071 </keycombo>
1072 </xsl:when>
1073 <xsl:otherwise>
1074 <xsl:apply-templates/>
1075 </xsl:otherwise>
1076 </xsl:choose>
1078 </xsl:template>
1081 <xsl:template match="text:a">
1082 <xsl:choose>
1083 <xsl:when test="contains(@xlink:href,'://')">
1084 <xsl:element name="ulink">
1085 <xsl:attribute name="url">
1086 <xsl:value-of select="@xlink:href"/>
1087 </xsl:attribute>
1088 <xsl:apply-templates/>
1089 </xsl:element>
1090 </xsl:when>
1091 <xsl:when test="contains(@xlink:href,'mailto:')">
1092 <xsl:element name="ulink">
1093 <xsl:attribute name="url">
1094 <xsl:value-of select="@xlink:href"/>
1095 </xsl:attribute>
1096 <xsl:apply-templates/>
1097 </xsl:element>
1098 </xsl:when>
1099 <xsl:when test="not(contains(@xlink:href,'#'))">
1100 <xsl:element name="olink">
1101 <xsl:attribute name="targetdocent">
1102 <xsl:value-of select="@xlink:href"/>
1103 </xsl:attribute>
1104 <xsl:apply-templates/>
1105 </xsl:element>
1106 </xsl:when>
1107 <xsl:otherwise>
1108 <xsl:variable name="linkvar" select="substring-after(@xlink:href,'#')"/>
1109 <xsl:element name="link">
1110 <xsl:attribute name="linkend">
1111 <xsl:value-of select="substring-before($linkvar,'%')"/>
1112 </xsl:attribute>
1113 <xsl:apply-templates/>
1114 </xsl:element>
1115 </xsl:otherwise>
1116 </xsl:choose>
1117 </xsl:template>
1119 <!--
1120 Change Made By Kevin Fowlks (fowlks@msu.edu) July 2nd, 2003
1121 This allows users to create example code in DocBook.
1123 Note: This type of grouping could also be implemented for
1124 <notes>,<literallayout>, <blockquote> or any other tag that requires text to be treated as blocked.
1126 <xsl:template match="text:p[@text:style-name='Example']">
1127 <xsl:if test="not(preceding-sibling::*[1][self::text:p[@text:style-name='Example']])">
1128 <xsl:element name="example">
1129 <xsl:element name="title"></xsl:element>
1130 <xsl:element name="programlisting">
1131 <xsl:value-of select="."/>
1132 <xsl:text disable-output-escaping="no">&#xD;</xsl:text>
1133 <xsl:apply-templates mode="in-list" select="following-sibling::*[1][self::text:p[@text:style-name='Example']]"/>
1134 </xsl:element>
1135 </xsl:element>
1136 </xsl:if>
1137 </xsl:template>
1139 <xsl:template match="text:p[@text:style-name='Example']" mode="in-list">
1140 <xsl:value-of select="."/>
1141 <xsl:text disable-output-escaping="no">&#xD;</xsl:text>
1142 <xsl:apply-templates mode="in-list" select="following-sibling::*[1][self::text:p[@text:style-name='Example']]"/>
1143 </xsl:template>
1145 <!-- ****************** -->
1146 <!-- *** Whitespace *** -->
1147 <!-- ****************** -->
1149 <xsl:template match="text:s">
1150 <xsl:call-template name="write-breakable-whitespace">
1151 <xsl:with-param name="whitespaces" select="@text:c"/>
1152 </xsl:call-template>
1153 </xsl:template>
1156 <!--write the number of 'whitespaces' -->
1157 <xsl:template name="write-breakable-whitespace">
1158 <xsl:param name="whitespaces"/>
1160 <!--write two space chars as the normal white space character will be stripped
1161 and the other is able to break -->
1162 <xsl:text>&#160;</xsl:text>
1163 <xsl:if test="$whitespaces >= 2">
1164 <xsl:call-template name="write-breakable-whitespace-2">
1165 <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
1166 </xsl:call-template>
1167 </xsl:if>
1168 </xsl:template>
1171 <!--write the number of 'whitespaces' -->
1172 <xsl:template name="write-breakable-whitespace-2">
1173 <xsl:param name="whitespaces"/>
1174 <!--write two space chars as the normal white space character will be stripped
1175 and the other is able to break -->
1176 <xsl:text> </xsl:text>
1177 <xsl:if test="$whitespaces >= 2">
1178 <xsl:call-template name="write-breakable-whitespace">
1179 <xsl:with-param name="whitespaces" select="$whitespaces - 1"/>
1180 </xsl:call-template>
1181 </xsl:if>
1182 </xsl:template>
1184 <xsl:template match="text:tab-stop">
1185 <xsl:call-template name="write-breakable-whitespace">
1186 <xsl:with-param name="whitespaces" select="8"/>
1187 </xsl:call-template>
1188 </xsl:template>
1189 </xsl:stylesheet>