home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 October / PCWorld_2004-10_cd.bin / akce / openoffice / f_0279 / htmlsoff.jar / htmltosoff.xsl next >
Extensible Markup Language  |  2002-04-18  |  8KB  |  202 lines

  1. <?xml version='1.0' encoding="UTF-8"?>
  2. <!--
  3.  #  The Contents of this file are made available subject to the terms of
  4.  #  either of the following licenses
  5.  #
  6.  #         - GNU Lesser General Public License Version 2.1
  7.  #         - Sun Industry Standards Source License Version 1.1
  8.  #
  9.  #  Sun Microsystems Inc., October, 2000
  10.  #
  11.  #  GNU Lesser General Public License Version 2.1
  12.  #  =============================================
  13.  #  Copyright 2000 by Sun Microsystems, Inc.
  14.  #  901 San Antonio Road, Palo Alto, CA 94303, USA
  15.  #
  16.  #  This library is free software; you can redistribute it and/or
  17.  #  modify it under the terms of the GNU Lesser General Public
  18.  #  License version 2.1, as published by the Free Software Foundation.
  19.  #
  20.  #  This library 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 GNU
  23.  #  Lesser General Public License for more details.
  24.  #
  25.  #  You should have received a copy of the GNU Lesser General Public
  26.  #  License along with this library; if not, write to the Free Software
  27.  #  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  28.  #  MA  02111-1307  USA
  29.  #
  30.  #
  31.  #  Sun Industry Standards Source License Version 1.1
  32.  #  =================================================
  33.  #  The contents of this file are subject to the Sun Industry Standards
  34.  #  Source License Version 1.1 (the "License"); You may not use this file
  35.  #  except in compliance with the License. You may obtain a copy of the
  36.  #  License at http://www.openoffice.org/license.html.
  37.  #
  38.  #  Software provided under this License is provided on an "AS IS" basis,
  39.  #  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  40.  #  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
  41.  #  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
  42.  #  See the License for the specific provisions governing your rights and
  43.  #  obligations concerning the Software.
  44.  #
  45.  #  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
  46.  #
  47.  #  Copyright: 2000 by Sun Microsystems, Inc.
  48.  #
  49.  #  All Rights Reserved.
  50.  #
  51.  #  Contributor(s): _______________________________________
  52.  #
  53.  #
  54.  -->
  55. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  56.                   xmlns:office="http://openoffice.org/2000/office"
  57.                   xmlns:style="http://openoffice.org/2000/style"
  58.                   xmlns:text="http://openoffice.org/2000/text"                    
  59.                   xmlns:table="http://openoffice.org/2000/table"                  
  60.                   xmlns:draw="http://openoffice.org/2000/drawing"
  61.                   xmlns:fo="http://www.w3.org/1999/XSL/Format" 
  62.                   xmlns:xlink="http://www.w3.org/1999/xlink" 
  63.                   xmlns:number="http://openoffice.org/2000/datastyle"                 
  64.                   xmlns:svg="http://www.w3.org/2000/svg" 
  65.                   xmlns:chart="http://openoffice.org/2000/chart" 
  66.                   xmlns:dr3d="http://openoffice.org/2000/dr3d" 
  67.                   xmlns:math="http://www.w3.org/1998/Math/MathML" 
  68.                   xmlns:form="http://openoffice.org/2000/form" 
  69.                   xmlns:script="http://openoffice.org/2000/script"
  70.                   >
  71. <xsl:output method="html" />
  72.  
  73.  
  74. <xsl:template match="/">
  75.     <xsl:apply-templates />
  76. </xsl:template>
  77.  
  78. <xsl:template match="html">    
  79.     
  80.     <office:document-content xmlns:office="http://openoffice.org/2000/office"                 
  81.                  xmlns:style="http://openoffice.org/2000/style"                  
  82.                  xmlns:text="http://openoffice.org/2000/text"
  83.                  xmlns:table="http://openoffice.org/2000/table"
  84.                  xmlns:draw="http://openoffice.org/2000/drawing"
  85.                  xmlns:fo="http://www.w3.org/1999/XSL/Format" 
  86.                  xmlns:xlink="http://www.w3.org/1999/xlink" 
  87.                  xmlns:number="http://openoffice.org/2000/datastyle" 
  88.                  xmlns:svg="http://www.w3.org/2000/svg" 
  89.                  xmlns:chart="http://openoffice.org/2000/chart" 
  90.                  xmlns:dr3d="http://openoffice.org/2000/dr3d" 
  91.                  xmlns:math="http://www.w3.org/1998/Math/MathML" 
  92.                  xmlns:form="http://openoffice.org/2000/form" 
  93.                  xmlns:script="http://openoffice.org/2000/script" 
  94.                  office:class="text" office:version="1.0">
  95.  
  96. <office:script/>
  97.  <office:font-decls>
  98.   <style:font-decl style:name="Letter Gothic" fo:font-family="'Letter Gothic'" style:font-family-generic="modern" style:font-pitch="fixed"/>
  99.   <style:font-decl style:name="Arial Unicode MS" fo:font-family="'Arial Unicode MS'" style:font-pitch="variable"/>
  100.   <style:font-decl style:name="HG Mincho Light J" fo:font-family="'HG Mincho Light J'" style:font-pitch="variable"/>
  101.   <style:font-decl style:name="CG Times" fo:font-family="'CG Times'" style:font-family-generic="roman" style:font-pitch="variable"/>
  102.   <style:font-decl style:name="Thorndale" fo:font-family="Thorndale" style:font-family-generic="roman" style:font-pitch="variable"/>
  103.   <style:font-decl style:name="Antique Olive" fo:font-family="'Antique Olive'" style:font-family-generic="swiss" style:font-pitch="variable"/>
  104.   <style:font-decl style:name="Arial Black" fo:font-family="'Arial Black'" style:font-family-generic="swiss" style:font-pitch="variable"/>
  105.  </office:font-decls>
  106.  <office:automatic-styles>
  107.   <style:style style:name="Table1" style:family="table">
  108.    <style:properties style:width="16.999cm" table:align="margins"/>
  109.   </style:style>
  110.   <style:style style:name="Table1.A" style:family="table-column">
  111.    <style:properties style:column-width="3.399cm" style:rel-column-width="13107*"/>
  112.   </style:style>
  113.   <style:style style:name="Table1.A1" style:family="table-cell">
  114.    <style:properties fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="none" fo:border-top="0.002cm solid #000000" fo:border-bottom="0.002cm solid #000000"/>
  115.   </style:style>
  116.   <style:style style:name="Table1.E1" style:family="table-cell">
  117.    <style:properties fo:padding="0.097cm" fo:border="0.002cm solid #000000"/>
  118.   </style:style>
  119.   <style:style style:name="Table1.A2" style:family="table-cell">
  120.    <style:properties fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="none" fo:border-top="none" fo:border-bottom="0.002cm solid #000000"/>
  121.   </style:style>
  122.   <style:style style:name="Table1.E2" style:family="table-cell">
  123.    <style:properties fo:padding="0.097cm" fo:border-left="0.002cm solid #000000" fo:border-right="0.002cm solid #000000" fo:border-top="none" fo:border-bottom="0.002cm solid #000000"/>
  124.   </style:style>
  125.   <style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
  126.    <style:properties fo:margin-left="0cm" fo:margin-right="0cm" fo:text-indent="0cm" style:auto-text-indent="false"/>
  127.   </style:style>
  128.   <style:style style:name="P2" style:family="paragraph" style:parent-style-name="Table Contents">
  129.    <style:properties style:font-name="Arial Black" fo:font-size="20pt"/>
  130.   </style:style>
  131.  </office:automatic-styles>
  132.  
  133.  
  134.     
  135.  
  136.  
  137.      <office:body>
  138.          <text:sequence-decls>
  139.                <text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
  140.                <text:sequence-decl text:display-outline-level="0" text:name="Table"/>
  141.                <text:sequence-decl text:display-outline-level="0" text:name="Text"/>
  142.                <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
  143.           </text:sequence-decls>           
  144.           
  145.           <xsl:apply-templates/>
  146.      </office:body>
  147.     </office:document-content>
  148.  
  149. </xsl:template>
  150.  
  151. <xsl:template match="body">
  152.     <xsl:apply-templates />
  153. </xsl:template>
  154.  
  155.  
  156.  
  157. <xsl:template match="p">
  158.     <xsl:for-each select=".">
  159.         <text:p text:style-name="P1">
  160.             <!--<xsl:value-of select="."/>-->
  161.             <xsl:apply-templates />
  162.         </text:p>
  163.     </xsl:for-each>
  164. </xsl:template>
  165.  
  166. <xsl:template match="br">
  167.     <xsl:if test="ancestor::p">
  168.         <xsl:text disable-output-escaping="yes"></text:p> <text:p text:style-name="P1"></xsl:text>
  169.     </xsl:if>
  170. </xsl:template>
  171.  
  172. <xsl:template match="table">
  173.     <xsl:for-each select=".">
  174.         <table:table table:name="Table1" table:style-name="Table1">
  175.                  <table:table-column table:style-name="Table1.A" table:number-columns-repeated="5"/>
  176.             <xsl:apply-templates/>
  177.         </table:table>
  178.     </xsl:for-each>
  179. </xsl:template>
  180.  
  181. <xsl:template match="tr">
  182.     <xsl:for-each select=".">
  183.         <table:table-row>
  184.             <xsl:apply-templates/>
  185.         </table:table-row>
  186.     </xsl:for-each>
  187. </xsl:template>
  188.  
  189. <xsl:template match="td">
  190.     <xsl:for-each select=".">
  191.         <table:table-cell table:style-name="Table1.A1" table:value-type="string">
  192.         <text:p text:style-name="P1">
  193.                 <xsl:value-of select="."/>
  194.             </text:p>
  195.         </table:table-cell>
  196.     </xsl:for-each>
  197. </xsl:template>
  198.  
  199.  
  200.  
  201. </xsl:stylesheet>
  202.