passivetex.xsl 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  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. $Id: passivetex.xsl 5315 2005-10-20 10:08:42Z kosek $
  7. ********************************************************************
  8. This extension stops PassiveTeX from merging subsequent '-' to
  9. dashes. You must set passivetex.extensions to '1' if you want get
  10. this functionality.
  11. ******************************************************************** -->
  12. <xsl:template name="passivetex.dash.subst">
  13. <xsl:param name="string"/>
  14. <xsl:choose>
  15. <xsl:when test="contains($string, '--')">
  16. <xsl:variable name="rest">
  17. <xsl:call-template name="passivetex.dash.subst">
  18. <xsl:with-param name="string"
  19. select="concat('-', substring-after($string, '--'))"/>
  20. </xsl:call-template>
  21. </xsl:variable>
  22. <xsl:value-of select="concat(substring-before($string, '--'),
  23. '-&#x200b;',
  24. $rest)"/>
  25. </xsl:when>
  26. <xsl:otherwise>
  27. <xsl:value-of select="$string"/>
  28. </xsl:otherwise>
  29. </xsl:choose>
  30. </xsl:template>
  31. </xsl:stylesheet>