home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 December / CHIP_CD_2004-12.iso / bonus / oo / OOo_1.1.3_ru_RU_infra_WinIntel_install.exe / $PLUGINSDIR / f_0115 / docbook.jar / sofftodocbook.xsl < prev   
Extensible Markup Language  |  2003-01-28  |  25KB  |  740 lines

  1. <?xml version='1.0' encoding="UTF-8"?>
  2. <!-- #  The Contents of this file are made available subject to the terms of
  3.  #  either of the following licenses
  4.  #
  5.  #         - GNU Lesser General Public License Version 2.1
  6.  #         - Sun Industry Standards Source License Version 1.1
  7.  #
  8.  #  Sun Microsystems Inc., October, 2000
  9.  #
  10.  #  GNU Lesser General Public License Version 2.1
  11.  #  =============================================
  12.  #  Copyright 2000 by Sun Microsystems, Inc.
  13.  #  901 San Antonio Road, Palo Alto, CA 94303, USA
  14.  #
  15.  #  This library is free software; you can redistribute it and/or
  16.  #  modify it under the terms of the GNU Lesser General Public
  17.  #  License version 2.1, as published by the Free Software Foundation.
  18.  #
  19.  #  This library is distributed in the hope that it will be useful,
  20.  #  but WITHOUT ANY WARRANTY; without even the implied warranty of
  21.  #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  22.  #  Lesser General Public License for more details.
  23.  #
  24.  #  You should have received a copy of the GNU Lesser General Public
  25.  #  License along with this library; if not, write to the Free Software
  26.  #  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  27.  #  MA  02111-1307  USA
  28.  #
  29.  #
  30.  #  Sun Industry Standards Source License Version 1.1
  31.  #  =================================================
  32.  #  The contents of this file are subject to the Sun Industry Standards
  33.  #  Source License Version 1.1 (the "License"); You may not use this file
  34.  #  except in compliance with the License. You may obtain a copy of the
  35.  #  License at http://www.openoffice.org/license.html.
  36.  #
  37.  #  Software provided under this License is provided on an "AS IS" basis,
  38.  #  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  39.  #  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
  40.  #  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
  41.  #  See the License for the specific provisions governing your rights and
  42.  #  obligations concerning the Software.
  43.  #
  44.  #  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
  45.  #
  46.  #  Copyright: 2000 by Sun Microsystems, Inc.
  47.  #
  48.  #  All Rights Reserved.
  49.  #
  50.  #  Contributor(s): _______________________________________
  51.  #
  52.  #-->
  53. <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">
  54. <xsl:output method="xml" indent="yes" omit-xml-declaration="no"  />
  55. <xsl:output method="xml" version="1.0" encoding="UTF-8" doctype-public="-//OASIS//DTD DocBook XML V4.1.2//EN"
  56.    doctype-system= "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"   />
  57.  
  58. <xsl:variable name="varname">1</xsl:variable>
  59.  
  60. <xsl:template match="/office:document">
  61.     <article>
  62.         <xsl:attribute name="lang"><xsl:value-of select="/office:document/office:meta/dc:language"/>
  63.         </xsl:attribute>
  64.         <xsl:apply-templates />
  65.     </article>
  66. </xsl:template>
  67.  
  68. <xsl:template match="office:meta">
  69.     <xsl:apply-templates/>
  70. </xsl:template>
  71.  
  72. <xsl:template match="text:ordered-list">
  73.     <orderedlist>
  74.         <xsl:apply-templates/>
  75.     </orderedlist>
  76. </xsl:template>
  77.  
  78.  
  79.  
  80. <xsl:template match="meta:editing-cycles">
  81. </xsl:template>
  82.  
  83. <xsl:template match="meta:user-defined">
  84. </xsl:template>
  85.  
  86. <xsl:template match="meta:editing-duration">
  87. </xsl:template>
  88.  
  89. <xsl:template match="dc:language">
  90. </xsl:template>
  91.  
  92. <xsl:template match="dc:date">
  93.     <!--<pubdate>
  94.         <xsl:value-of select="substring-before(.,'T')"/>
  95.     </pubdate>-->
  96. </xsl:template>
  97.  
  98. <xsl:template match="meta:creation-date">
  99. </xsl:template>
  100.  
  101. <xsl:template match="office:body">
  102.     <xsl:apply-templates/>
  103. </xsl:template>
  104.  
  105. <xsl:template match="office:styles">
  106.     <xsl:apply-templates/>
  107. </xsl:template>
  108.  
  109. <xsl:template match="office:script">
  110. </xsl:template>
  111.  
  112.  
  113. <xsl:template match="office:settings">
  114. </xsl:template>
  115.  
  116. <xsl:template match="office:font-decls">
  117. </xsl:template>
  118.  
  119. <xsl:template match="text:section">
  120. <xsl:choose>
  121.     <xsl:when test="@text:name='ArticleInfo'">
  122.         <articleinfo>
  123.             <title><xsl:value-of select="text:p[@text:style-name='Document Title']"/></title>
  124.             <subtitle><xsl:value-of select="text:p[@text:style-name='Document SubTitle']"/></subtitle>
  125.             <edition><xsl:value-of select="text:p/text:variable-set[@text:name='articleinfo.edition']"/></edition>
  126.             <xsl:for-each select="text:p/text:variable-set[substring-after(@text:name,'articleinfo.releaseinfo')]">
  127.                 <releaseinfo>
  128.                     <xsl:value-of select="."/>
  129.                 </releaseinfo>
  130.             </xsl:for-each>
  131.             <xsl:call-template name="ArticleInfo"><xsl:with-param name="level" select="0"/></xsl:call-template>
  132.     
  133.         </articleinfo>
  134.     </xsl:when>
  135.     <xsl:when test="@text:name='Abstract'">
  136.         <abstract>
  137.             <xsl:apply-templates/>
  138.         </abstract>
  139.     </xsl:when>
  140.     <xsl:when test="@text:name='Appendix'">
  141.         <appendix>
  142.             <xsl:apply-templates/>
  143.         </appendix>
  144.     </xsl:when>
  145.     <xsl:otherwise>
  146.         <xsl:variable name="sectvar"><xsl:text>sect</xsl:text><xsl:value-of select="count(ancestor::text:section)+1"/></xsl:variable>    
  147.         <xsl:variable name="idvar"><xsl:text> id="</xsl:text><xsl:value-of select="@text:name"/><xsl:text>"</xsl:text></xsl:variable>
  148.         <xsl:text disable-output-escaping="yes"><</xsl:text><xsl:value-of select="$sectvar"/><xsl:value-of select="$idvar"/><xsl:text  disable-output-escaping="yes">></xsl:text>
  149.             <xsl:apply-templates/>
  150.         <xsl:text disable-output-escaping="yes"></</xsl:text><xsl:value-of select="$sectvar"/><xsl:text  disable-output-escaping="yes">></xsl:text>
  151.     </xsl:otherwise>
  152.  
  153.  
  154. </xsl:choose>
  155. </xsl:template>
  156.  
  157. <xsl:template name="ArticleInfo">
  158.     <xsl:param name="level"/>
  159.     <xsl:variable name="author"><xsl:value-of select="concat('articleinfo.author_','', $level)"/></xsl:variable>
  160.     <xsl:if test="text:p/text:variable-set[contains(@text:name, $author )]">
  161.         <xsl:call-template name="Author"><xsl:with-param name="AuthorLevel" select="0"/></xsl:call-template>
  162.         <xsl:call-template name="Copyright"><xsl:with-param name="CopyrightLevel" select="0"/></xsl:call-template>    
  163.     </xsl:if>    
  164. </xsl:template>
  165.  
  166. <xsl:template name="Copyright">
  167.     <xsl:param name="CopyrightLevel"/>
  168.     
  169.     <xsl:variable name="Copyright"><xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/></xsl:variable>
  170.     
  171.     <xsl:if test="text:p/text:variable-set[contains(@text:name,$Copyright)]">
  172.         <copyright>
  173.             <xsl:call-template name="Year">
  174.                 <xsl:with-param name="CopyrightLevel" select="$CopyrightLevel"/>
  175.                 <xsl:with-param name="YearlLevel" select="0"/>
  176.             </xsl:call-template>
  177.             <xsl:call-template name="Holder">
  178.                 <xsl:with-param name="CopyrightLevel" select="$CopyrightLevel"/>
  179.                 <xsl:with-param name="HolderlLevel" select="0"/>
  180.  
  181.             </xsl:call-template>
  182.         </copyright>
  183.     </xsl:if>
  184. </xsl:template>
  185.  
  186.  
  187. <xsl:template name="Year">
  188.     <xsl:param name="CopyrightLevel"/>
  189.     <xsl:param name="YearLevel"/>
  190.     <xsl:variable name="Copyright"><xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/></xsl:variable>
  191. <xsl:variable name="Year"><xsl:value-of select="concat($Copyright,'',concat('.year_','',$YearLevel))"/></xsl:variable>
  192.  
  193.     <xsl:if test="text:p/text:variable-set[@text:name=$Year]">
  194.         <orgname>
  195.             <xsl:value-of select="text:p/text:variable-set[@text:name=$Year]"/>
  196.         </orgname>
  197.     </xsl:if>
  198. </xsl:template>
  199.  
  200.  
  201. <xsl:template name="Holder">
  202.     <xsl:param name="CopyrightLevel"/>
  203.     <xsl:param name="HolderLevel"/>
  204.     <xsl:variable name="Copyright"><xsl:value-of select="concat('articleinfo.copyright_','', $CopyrightLevel)"/></xsl:variable>
  205. <xsl:variable name="Holder"><xsl:value-of select="concat($Copyright,'',concat('.holder_','',$HolderLevel))"/></xsl:variable>
  206.  
  207.     <xsl:if test="text:p/text:variable-set[@text:name=$Holder]">
  208.         <orgname>
  209.             <xsl:value-of select="text:p/text:variable-set[@text:name=$Holder]"/>
  210.         </orgname>
  211.     </xsl:if>
  212. </xsl:template>
  213.  
  214.  
  215.  
  216. <xsl:template name="Author">
  217.     <xsl:param name="AuthorLevel"/>
  218.     <xsl:variable name="Author"><xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/></xsl:variable>    
  219.     <xsl:if test="text:p/text:variable-set[contains(@text:name, $Author )]">
  220.         <author>
  221.             <xsl:call-template name="Surname"><xsl:with-param name="AuthorLevel" select="$AuthorLevel"/><xsl:with-param name="SurnameLevel" select="0"/></xsl:call-template>
  222.             <xsl:call-template name="Firstname"><xsl:with-param name="AuthorLevel" select="$AuthorLevel"/><xsl:with-param name="FirstnameLevel" select="0"/></xsl:call-template>
  223.             <xsl:call-template name="Affiliation"><xsl:with-param name="AuthorLevel" select="$AuthorLevel"/><xsl:with-param name="AffilLevel" select="0"/></xsl:call-template>
  224.         </author>
  225.         <xsl:call-template name="Author"><xsl:with-param name="AuthorLevel" select="$AuthorLevel+1"/></xsl:call-template>
  226.     </xsl:if>    
  227. </xsl:template>
  228.  
  229.  
  230. <xsl:template name="Surname">
  231.     <xsl:param name="AuthorLevel"/>
  232.     <xsl:param name="SurnameLevel"/>
  233.     <xsl:variable name="Author"><xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/></xsl:variable>
  234.     <xsl:variable name="Surname"><xsl:value-of select="concat($Author,'',concat('.surname_','',$SurnameLevel))"/></xsl:variable>
  235.     <xsl:if test="text:p/text:variable-set[@text:name=$Surname]">
  236.         <surname>
  237.             <xsl:value-of select="text:p/text:variable-set[@text:name=$Surname]"/>
  238.         </surname>
  239.         <xsl:call-template name="Surname"><xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
  240.         <xsl:with-param name="SurnameLevel" select="SurnameLevel+1"/>
  241.         </xsl:call-template>
  242.  
  243.     </xsl:if>
  244. </xsl:template>
  245.  
  246.  
  247.  
  248.  
  249. <xsl:template name="Firstname">
  250.     <xsl:param name="AuthorLevel"/>
  251.     <xsl:param name="FirstnameLevel"/>
  252.     <xsl:variable name="Author"><xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/></xsl:variable>
  253.     <xsl:variable name="Firstname"><xsl:value-of select="concat($Author,'',concat('.firstname_','',$FirstnameLevel))"/></xsl:variable>
  254.     <xsl:if test="text:p/text:variable-set[@text:name=$Firstname]">
  255.         <firstname>
  256.             <xsl:value-of select="text:p/text:variable-set[@text:name=$Firstname]"/>
  257.         </firstname>
  258.         <xsl:call-template name="Surname">
  259.             <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
  260.             <xsl:with-param name="FirstnameLevel" select="FirstnameLevel+1"/>
  261.         </xsl:call-template>
  262.     </xsl:if>
  263. </xsl:template>
  264.  
  265.  
  266.  
  267. <xsl:template name="Affiliation">
  268.     <xsl:param name="AuthorLevel"/>
  269.     <xsl:param name="AffilLevel"/>
  270.     <xsl:variable name="Author"><xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/></xsl:variable>
  271.     <xsl:variable name="Affil"><xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/></xsl:variable>
  272.     <xsl:if test="text:p/text:variable-set[contains(@text:name,$Affil)]">
  273.         <affiliation>
  274.             <xsl:call-template name="Orgname">
  275.                 <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
  276.                 <xsl:with-param name="AffilLevel" select="$AffilLevel"/><xsl:with-param name="OrgLevel" select="0"/>
  277.             </xsl:call-template>
  278.             <xsl:call-template name="Address">
  279.                 <xsl:with-param name="AuthorLevel" select="$AuthorLevel"/>
  280.                 <xsl:with-param name="AffilLevel" select="$AffilLevel"/><xsl:with-param name="AddressLevel" select="0"/>
  281.  
  282.             </xsl:call-template>
  283.         </affiliation>
  284.     </xsl:if>
  285. </xsl:template>
  286.  
  287. <xsl:template name="Orgname">
  288.     <xsl:param name="AuthorLevel"/>
  289.     <xsl:param name="AffilLevel"/>
  290.     <xsl:param name="OrgLevel"/>
  291.  
  292.     <xsl:variable name="Author"><xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/></xsl:variable>
  293. <xsl:variable name="Affil"><xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/></xsl:variable>
  294.     <xsl:variable name="Org"><xsl:value-of select="concat($Affil,'',concat('.orgname_','',$OrgLevel))"/></xsl:variable>
  295.  
  296.     <xsl:if test="text:p/text:variable-set[@text:name=$Org]">
  297.         <orgname>
  298.             <xsl:value-of select="text:p/text:variable-set[@text:name=$Org]"/>
  299.         </orgname>
  300.     </xsl:if>
  301. </xsl:template>
  302.  
  303. <xsl:template name="Address">
  304.     <xsl:param name="AuthorLevel"/>
  305.     <xsl:param name="AffilLevel"/>
  306.     <xsl:param name="AddressLevel"/>
  307.  
  308.     <xsl:variable name="Author"><xsl:value-of select="concat('articleinfo.author_','', $AuthorLevel)"/></xsl:variable>
  309. <xsl:variable name="Affil"><xsl:value-of select="concat($Author,'',concat('.affiliation_','',$AffilLevel))"/></xsl:variable>
  310.     <xsl:variable name="Address"><xsl:value-of select="concat($Affil,'',concat('.address_','',$AddressLevel))"/></xsl:variable>
  311.  
  312.     <xsl:if test="text:p/text:variable-set[@text:name=$Address]">
  313.         <address>
  314.             <xsl:value-of select="text:p/text:variable-set[@text:name=$Address]"/>
  315.         </address>
  316.     </xsl:if>
  317. </xsl:template>
  318.  
  319.  
  320.  
  321.  
  322. <xsl:template match="text:p[@text:style-name='Document Title']">
  323. </xsl:template>
  324.  
  325. <xsl:template match="text:p[@text:style-name='Document SubTitle']">
  326. </xsl:template>
  327.  
  328.  
  329. <xsl:template match="text:p[@text:style-name='Section Title']">
  330.     <title>
  331.         <xsl:apply-templates/>
  332.     </title>
  333. </xsl:template>
  334.  
  335. <xsl:template match="text:p[@text:style-name='Appendix Title']">
  336.     <title>
  337.         <xsl:apply-templates/>
  338.     </title>
  339. </xsl:template>
  340.  
  341.  
  342. <xsl:template match="text:p[@text:style-name='VarList Item']">
  343.     <xsl:if test="not(preceding-sibling::text:p[@text:style-name='VarList Item'])">
  344.         <xsl:text disable-output-escaping="yes"><listitem></xsl:text>
  345.     </xsl:if>
  346.         <para>
  347.             <xsl:apply-templates/>
  348.         </para>
  349.     <xsl:if test="not(following-sibling::text:p[@text:style-name='VarList Item'])">
  350.         <xsl:text disable-output-escaping="yes"></listitem></xsl:text>
  351.     </xsl:if>
  352. </xsl:template>
  353.  
  354. <xsl:template match="text:p[@text:style-name='VarList Term']">
  355.     <term>
  356.             <xsl:apply-templates/>
  357.     </term>
  358. </xsl:template>
  359.  
  360. <xsl:template match="text:p[@text:style-name='Section1 Title']">
  361.     <title>
  362.         <xsl:apply-templates/>
  363.     </title>
  364. </xsl:template>
  365.  
  366.  
  367. <xsl:template match="text:p[@text:style-name='Section2 Title']">
  368.     <title>
  369.         <xsl:apply-templates/>
  370.     </title>
  371. </xsl:template>
  372.  
  373.  
  374. <xsl:template match="text:p[@text:style-name='Section3 Title']">
  375.     <title>
  376.         <xsl:apply-templates/>
  377.     </title>
  378. </xsl:template>
  379.  
  380. <xsl:template match="text:footnote-citation">
  381. </xsl:template>
  382.  
  383. <xsl:template match="text:p[@text:style-name='Mediaobject']">
  384.     <mediaobject>
  385.         <xsl:apply-templates/>
  386.     </mediaobject>
  387. </xsl:template>
  388.  
  389. <xsl:template match="office:annotation/text:p">
  390.     <note>
  391.     <remark>
  392.         <xsl:apply-templates/>
  393.     </remark>
  394.     </note>
  395. </xsl:template>
  396.  
  397. <!--<xsl:template match="meta:initial-creator">
  398.     <author>
  399.     <xsl:apply-templates />
  400.         </author>
  401. </xsl:template>-->
  402.  
  403. <xsl:template match="table:table">
  404.     <xsl:choose>
  405.         <xsl:when test="following-sibling::text:p[@text:style-name='Table']">
  406.             <table frame="all">
  407.                  <xsl:attribute name="id">
  408.                     <xsl:value-of select="@table:name"/>
  409.                 </xsl:attribute>
  410.                 <title>
  411.                     <xsl:value-of select="following-sibling::text:p[@text:style-name='Table']"/>
  412.                 </title>
  413.                 <xsl:call-template name="generictable"/>
  414.             </table>
  415.         </xsl:when>
  416.         <xsl:otherwise>
  417.             <informaltable frame="all">
  418.                 <xsl:call-template name="generictable"/>
  419.             </informaltable>
  420.         </xsl:otherwise>
  421.     </xsl:choose>
  422. </xsl:template>
  423.  
  424.  
  425. <xsl:template name="generictable">
  426.             <xsl:variable name="cells" select="count(descendant::table:table-cell)" ></xsl:variable>
  427.             <xsl:variable name="rows"><xsl:value-of select="count(descendant::table:table-row) "/></xsl:variable>
  428.             <xsl:variable name="cols"><xsl:value-of select="$cells div $rows"/></xsl:variable>
  429.             <xsl:variable name="numcols">
  430.             <xsl:choose>
  431.                     <xsl:when test="child::table:table-column/@table:number-columns-repeated">
  432.                             <xsl:value-of select="number(table:table-column/@table:number-columns-repeated+1)"/>
  433.                     </xsl:when>
  434.                     <xsl:otherwise >
  435.                             <xsl:value-of select="$cols"/>
  436.                     </xsl:otherwise>
  437.             </xsl:choose>
  438.         </xsl:variable>
  439.         <xsl:element name="tgroup">
  440.             <xsl:attribute name="cols">
  441.                         <xsl:value-of select="$numcols"/>
  442.             </xsl:attribute>    
  443.             <xsl:call-template name="colspec"><xsl:with-param name="left" select="1" /></xsl:call-template>
  444.                 <xsl:apply-templates/>
  445.         </xsl:element>
  446. </xsl:template>
  447.  
  448.  
  449.  
  450. <xsl:template name="colspec">
  451.     <xsl:param name="left"/>
  452.     <xsl:if test="number($left < ( table:table-column/@table:number-columns-repeated +2)  )">
  453.             <xsl:element name="colspec">
  454.                 <xsl:attribute name="colnum"><xsl:value-of select="$left"/></xsl:attribute>
  455.                 <xsl:attribute name="colname">c<xsl:value-of select="$left"/></xsl:attribute>
  456.             </xsl:element>
  457.             <xsl:call-template name="colspec"><xsl:with-param name="left" select="$left+1" /></xsl:call-template>
  458.     </xsl:if>
  459. </xsl:template>
  460.  
  461.  
  462.  
  463. <xsl:template match="table:table-column">
  464.         <xsl:apply-templates/>
  465. </xsl:template>
  466.  
  467. <xsl:template match="table:table-header-rows">
  468.     <thead>
  469.         <xsl:apply-templates/>
  470.     </thead>    
  471. </xsl:template>
  472.  
  473. <xsl:template match="table:table-header-rows/table:table-row">
  474.     <row>
  475.         <xsl:apply-templates />
  476.     </row>
  477. </xsl:template>
  478.  
  479. <xsl:template match="table:table/table:table-row">
  480.     <xsl:if test="not(preceding-sibling::table:table-row)">
  481.         <xsl:text disable-output-escaping="yes"><tbody></xsl:text>
  482.     </xsl:if>
  483.     <row>
  484.         <xsl:apply-templates />
  485.     </row>
  486.         <xsl:if test="not(following-sibling::table:table-row)">
  487.         <xsl:text disable-output-escaping="yes"></tbody></xsl:text>
  488.     </xsl:if>
  489. </xsl:template>
  490.  
  491. <xsl:template match="table:table-cell">
  492.  <xsl:element name="entry">
  493.          <xsl:if test="@table:number-columns-spanned >'1'">
  494.             <xsl:attribute name="namest"><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)"/></xsl:attribute>
  495.             <xsl:attribute name="nameend"><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)"/></xsl:attribute>
  496.         </xsl:if>
  497.         <xsl:apply-templates />
  498.     </xsl:element>
  499. </xsl:template>
  500.  
  501. <xsl:template match="text:p">
  502. <xsl:choose>
  503.     <xsl:when test="@text:style-name='Table'">
  504.     </xsl:when>
  505.     <xsl:otherwise>
  506.         <para>        
  507.             <xsl:apply-templates/>
  508.         </para>
  509.     </xsl:otherwise>
  510. </xsl:choose>
  511. </xsl:template>
  512.  
  513. <xsl:template match="text:unordered-list">
  514.     <xsl:if test="@text:style-name='Var List'">
  515.         <variablelist>
  516.             <xsl:apply-templates/>
  517.         </variablelist>
  518.     </xsl:if>
  519.     <xsl:if test="@text:style-name='UnOrdered List'">
  520.     <itemizedlist>
  521.         <title></title>
  522.         <xsl:apply-templates/>
  523.     </itemizedlist>
  524.     </xsl:if>
  525. </xsl:template>
  526.  
  527. <xsl:template match="text:list-item">
  528.     <xsl:if test="parent::text:unordered-list/@text:style-name='Var List'">
  529.         <varlistentry>
  530.             <xsl:for-each select="text:p[@text:style-name='VarList Term']">
  531.                         <xsl:apply-templates select="."/>
  532.             </xsl:for-each>
  533.         </varlistentry>
  534.     </xsl:if>
  535.     <xsl:if test="not(parent::text:unordered-list/@text:style-name='Var List')">
  536.         <listitem>
  537.             <xsl:apply-templates/>
  538.         </listitem>
  539.     </xsl:if>
  540. </xsl:template>
  541.  
  542.  
  543.  
  544.  
  545.  
  546. <xsl:template match="dc:title">
  547. </xsl:template>
  548.  
  549. <xsl:template match="dc:description">
  550.     <abstract><para>
  551.         <xsl:apply-templates/>
  552.         </para>
  553.     </abstract>
  554. </xsl:template>
  555.  
  556. <xsl:template match="dc:subject">
  557. </xsl:template>
  558.  
  559.  
  560. <xsl:template match="meta:generator">
  561. </xsl:template>
  562.  
  563. <xsl:template match="draw:plugin">
  564. <xsl:element name="audioobject">
  565.     <xsl:attribute name="fileref">
  566.         <xsl:value-of select="@xlink:href"/>
  567.     </xsl:attribute>
  568.     <xsl:attribute name="width">
  569.     </xsl:attribute>
  570. </xsl:element>
  571. </xsl:template>
  572.  
  573. <xsl:template match="text:footnote">
  574.     <footnote>
  575.         <xsl:apply-templates/>
  576.     </footnote>
  577. </xsl:template>
  578.  
  579. <xsl:template match="text:footnote-body">
  580.         <xsl:apply-templates/>
  581. </xsl:template>
  582.  
  583.  
  584.  
  585. <xsl:template match="draw:image">
  586. <xsl:choose>
  587.     <xsl:when test="parent::text:p[@text:style-name='Mediaobject']">
  588.         <xsl:element name="imageobject">
  589.             <xsl:element name="imagedata">
  590.             <xsl:attribute name="fileref">
  591.                 <xsl:value-of select="@xlink:href"/>
  592.             </xsl:attribute>
  593.             </xsl:element>
  594.             <xsl:element name="caption">
  595.                 <xsl:value-of select="."/>
  596.             </xsl:element>
  597.         </xsl:element>
  598.     </xsl:when>
  599.     <xsl:otherwise>
  600.         <xsl:element name="inlinegraphic">
  601.             <xsl:attribute name="fileref">
  602.                 <xsl:value-of select="@xlink:href"/>
  603.             </xsl:attribute>
  604.             <xsl:attribute name="width"></xsl:attribute>
  605.         </xsl:element>
  606.     </xsl:otherwise>
  607. </xsl:choose>
  608. </xsl:template>
  609.  
  610.  
  611.  
  612.  
  613.  
  614. <xsl:template match="text:span">
  615.  
  616.     <xsl:if test="./@text:style-name='GuiMenu'">
  617.         <xsl:element name="guimenu">
  618.             <xsl:value-of select="."/>    
  619.         </xsl:element>
  620.     </xsl:if>
  621.     <xsl:if test="./@text:style-name='GuiSubMenu'">
  622.         <xsl:element name="guisubmenu">
  623.             <xsl:value-of select="."/>    
  624.         </xsl:element>
  625.     </xsl:if>
  626.         <xsl:if test="@text:style-name='GuiMenuItem'">
  627.         <xsl:element name="guimenuitem">
  628.             <xsl:value-of select="."/>    
  629.         </xsl:element>
  630.     </xsl:if>
  631.     <xsl:if test="@text:style-name='GuiButton'">
  632.         <xsl:element name="guibutton">
  633.             <xsl:value-of select="."/>    
  634.         </xsl:element>
  635.     </xsl:if>
  636.         <xsl:if test="@text:style-name='GuiButton'">
  637.         <xsl:element name="guibutton">
  638.             <xsl:value-of select="."/>    
  639.         </xsl:element>
  640.     </xsl:if>
  641.     <xsl:if test="@text:style-name='GuiLabel'">
  642.         <xsl:element name="guilabel">
  643.             <xsl:value-of select="."/>    
  644.         </xsl:element>
  645.     </xsl:if>
  646.     <xsl:if test="@text:style-name='Emphasis'">
  647.         <xsl:element name="emphasis">
  648.             <xsl:value-of select="."/>    
  649.         </xsl:element>
  650.     </xsl:if>
  651.     <xsl:if test="@text:style-name='FileName'">
  652.         <xsl:element name="filename">
  653.             <xsl:value-of select="."/>    
  654.         </xsl:element>
  655.     </xsl:if>
  656.     <xsl:if test="@text:style-name='Application'">
  657.         <xsl:element name="application">
  658.             <xsl:value-of select="."/>    
  659.         </xsl:element>
  660.     </xsl:if>
  661.     <xsl:if test="@text:style-name='Command'">
  662.         <command>
  663.             <xsl:apply-templates/>
  664.         </command>
  665.     </xsl:if>
  666.     <xsl:if test="@text:style-name='SubScript'">
  667.         <subscript>
  668.             <xsl:apply-templates/>
  669.         </subscript>
  670.     </xsl:if>
  671.     <xsl:if test="@text:style-name='SuperScript'">
  672.         <superscript>
  673.             <xsl:apply-templates/>
  674.         </superscript>
  675.     </xsl:if>
  676.     <xsl:if test="@text:style-name='SystemItem'">
  677.         <systemitem>
  678.             <xsl:apply-templates/>
  679.         </systemitem>
  680.     </xsl:if>
  681.     <xsl:if test="@text:style-name='ComputerOutput'">
  682.         <computeroutput>
  683.             <xsl:apply-templates/>
  684.         </computeroutput>
  685.     </xsl:if>
  686.     <xsl:if test="@text:style-name='Highlight'">
  687.         <highlight>
  688.             <xsl:apply-templates/>
  689.         </highlight>
  690.     </xsl:if>
  691.         <xsl:if test="@text:style-name='KeyCap'">
  692.         <keycap>
  693.             <xsl:apply-templates/>
  694.         </keycap>
  695.     </xsl:if>
  696.     <xsl:if test="@text:style-name='KeySym'">
  697.         <xsl:element name="keysym">
  698.             <xsl:apply-templates/>
  699.         </xsl:element>
  700.     </xsl:if>
  701.     <xsl:if test="@text:style-name='KeyCombo'">
  702.         <keycombo>
  703.             <xsl:apply-templates/>
  704.         </keycombo>
  705.     </xsl:if>
  706. </xsl:template>
  707.  
  708.  
  709. <xsl:template match="text:a">
  710.     <xsl:choose>
  711.         <xsl:when test="contains(@xlink:href,'://')">
  712.             <xsl:element name="ulink">
  713.                 <xsl:attribute name="url">
  714.                     <xsl:value-of select="@xlink:href"/>
  715.                 </xsl:attribute>
  716.                 <xsl:apply-templates/>
  717.             </xsl:element>
  718.         </xsl:when>
  719.         <xsl:when test="not(contains(@xlink:href,'#'))">
  720.             <xsl:element name="olink">
  721.                 <xsl:attribute name="targetdocent">
  722.                     <xsl:value-of select="@xlink:href"/>
  723.                 </xsl:attribute>
  724.                 <xsl:apply-templates/>
  725.             </xsl:element>
  726.         </xsl:when>
  727.         <xsl:otherwise>
  728.         <xsl:variable name="linkvar" select="substring-after(@xlink:href,'#')"/>
  729.             <xsl:element name="link">
  730.                 <xsl:attribute name="linkend">
  731.                     <xsl:value-of select="substring-before($linkvar,'%')"/>    
  732.                 </xsl:attribute>
  733.                 <xsl:apply-templates/>
  734.             </xsl:element>
  735.         </xsl:otherwise>
  736.     </xsl:choose>
  737. </xsl:template>
  738.  
  739.  
  740. </xsl:stylesheet>