normalise-common.xsl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <xsl:stylesheet version='1.0'
  2. xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
  3. xmlns:rnd='http://docbook.org/ns/docbook/roundtrip'
  4. xmlns:db='http://docbook.org/ns/docbook'
  5. exclude-result-prefixes='db'>
  6. <!-- ********************************************************************
  7. $Id$
  8. ********************************************************************
  9. This file is part of the XSL DocBook Stylesheet distribution.
  10. See ../README or http://nwalsh.com/docbook/xsl/ for copyright
  11. and other information.
  12. ******************************************************************** -->
  13. <!-- rnd:map-paragraph-style and rd:map-character-style
  14. allows the application to customise
  15. the style names used by overriding this template.
  16. The idea is to map custom names back to standard names. -->
  17. <xsl:template name='rnd:map-paragraph-style'>
  18. <xsl:param name='style'/>
  19. <xsl:choose>
  20. <xsl:when test='starts-with($style, "Normal")'/>
  21. <!-- Probably should fold all style names to lower-case -->
  22. <xsl:when test='$style = "Caption"'>caption</xsl:when>
  23. <xsl:otherwise>
  24. <xsl:value-of select='$style'/>
  25. </xsl:otherwise>
  26. </xsl:choose>
  27. </xsl:template>
  28. <xsl:template name='rnd:map-character-style'>
  29. <xsl:param name='style'/>
  30. <xsl:value-of select='$style'/>
  31. </xsl:template>
  32. </xsl:stylesheet>