home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / LibO_3.3.0_beta2_Win_x86_install_multi.exe / libreoffice1.cab / print_ff.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2010-10-09  |  1.4 KB  |  63 lines

  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.     version="1.0">
  4.     <!-- XSLT stylesheet to pretty print false-friends.xml
  5.         
  6.         usage:
  7.         
  8.         java -jar saxon8.jar false-friends.xml print-ff.xsl
  9.         
  10.     -->
  11.     <xsl:output method="html" encoding="UTF-8" indent="no" />
  12.  
  13.     <xsl:template match="text()" />
  14.  
  15.     <xsl:template match="token">
  16.         <xsl:choose>
  17.             <xsl:when test="@negate='yes'">
  18.                 <strike>
  19.                     <strong style="color: #339900;">
  20.                         <xsl:value-of select="translate(.,'|',',')" />
  21.                         <xsl:text> </xsl:text>
  22.                     </strong>
  23.                 </strike>
  24.             </xsl:when>
  25.             <xsl:otherwise>
  26.                 <strong style="color: #339900;">
  27.                     <xsl:value-of select="translate(.,'|',',')" />
  28.                     <xsl:text> </xsl:text>
  29.                 </strong>
  30.             </xsl:otherwise>
  31.         </xsl:choose>
  32.     </xsl:template>
  33.  
  34.     <xsl:template match="pattern">
  35.         <xsl:apply-templates select="*"/>
  36.         (<xsl:value-of select="@lang"/>)
  37.     </xsl:template>
  38.  
  39.     <xsl:template match="//rule">
  40.         <xsl:apply-templates select="*"/>
  41.     </xsl:template>
  42.     
  43.     <xsl:template match="translation">
  44.         <ul>
  45.         <li>
  46.             <xsl:value-of select="."/>            
  47.             <xsl:text> (</xsl:text><xsl:value-of select="@lang"/><xsl:text>)</xsl:text>            
  48.         </li>
  49.         </ul>
  50.     </xsl:template>
  51.  
  52.     <xsl:template match="//rules">    
  53.     <html>
  54.     <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
  55.     <body>    
  56.             <xsl:apply-templates select="//rule">
  57.                 <xsl:sort select="pattern"/>
  58.             </xsl:apply-templates>
  59.     </body>
  60.     </html>
  61.     </xsl:template>    
  62.     
  63. </xsl:stylesheet>