home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 October / INTERNET108.ISO / pc / software / windows / building / xmlspy / xmlspyentcomplete5.exe / Data1.cab / _AAC28C353D57440EB1B91090EF217EB4 < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-04  |  1.7 KB  |  50 lines

  1. <?xml version='1.0' encoding="utf-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.                 xmlns:fo="http://www.w3.org/1999/XSL/Format"
  4.                 version='1.0'>
  5.  
  6. <!-- ********************************************************************
  7.      $Id: passivetex.xsl,v 1.1.2.1 2002/09/04 14:25:33 jdj Exp $
  8.      ********************************************************************
  9.       This extension stops PassiveTeX from merging subsequent '-' to 
  10.       dashes. You must set passivetex.extensions to '1' if you want get
  11.       this functionality.
  12.      ******************************************************************** -->
  13.  
  14. <xsl:template match="text()">
  15.   <xsl:choose>
  16.     <xsl:when test="$passivetex.extensions != 0">
  17.       <xsl:call-template name="passivetex.dash.subst">
  18.         <xsl:with-param name="string" select="."/>
  19.       </xsl:call-template>
  20.     </xsl:when>
  21.     <xsl:otherwise>
  22.       <xsl:value-of select="."/>
  23.     </xsl:otherwise>
  24.   </xsl:choose>
  25. </xsl:template>
  26.  
  27. <xsl:template name="passivetex.dash.subst">
  28.   <xsl:param name="string"/>
  29.  
  30.   <xsl:choose>
  31.     <xsl:when test="contains($string, '--')">
  32.       <xsl:variable name="rest">
  33.         <xsl:call-template name="passivetex.dash.subst">
  34.           <xsl:with-param name="string"
  35.                           select="concat('-', substring-after($string, '--'))"/>
  36.         </xsl:call-template>
  37.       </xsl:variable>
  38.       <xsl:value-of select="concat(substring-before($string, '--'),
  39.                                    '-​',
  40.                                    $rest)"/>
  41.     </xsl:when>
  42.     <xsl:otherwise>
  43.       <xsl:value-of select="$string"/>
  44.     </xsl:otherwise>
  45.   </xsl:choose>
  46. </xsl:template>
  47.  
  48. </xsl:stylesheet>
  49.  
  50.