lfs-admon.xsl 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?xml version='1.0' encoding='ISO-8859-1'?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns="http://www.w3.org/1999/xhtml"
  4. version="1.0">
  5. <!-- Use graphics in admonitions -->
  6. <xsl:param name="admon.graphics" select="1"/>
  7. <xsl:param name="admon.graphics.path">../images/</xsl:param>
  8. <xsl:param name="admon.graphics.extension" select="'.png'"/>
  9. <!-- Changing the output tagging -->
  10. <xsl:template name="graphical.admonition">
  11. <xsl:variable name="admon.type">
  12. <xsl:choose>
  13. <xsl:when test="local-name(.)='note'">Note</xsl:when>
  14. <xsl:when test="local-name(.)='warning'">Warning</xsl:when>
  15. <xsl:when test="local-name(.)='caution'">Caution</xsl:when>
  16. <xsl:when test="local-name(.)='tip'">Tip</xsl:when>
  17. <xsl:when test="local-name(.)='important'">Important</xsl:when>
  18. <xsl:otherwise>Note</xsl:otherwise>
  19. </xsl:choose>
  20. </xsl:variable>
  21. <div class="{name(.)}">
  22. <div class ="admonhead">
  23. <img alt="[{$admon.type}]">
  24. <xsl:attribute name="src">
  25. <xsl:call-template name="admon.graphic"/>
  26. </xsl:attribute>
  27. </img>
  28. <h3 class="admontitle">
  29. <xsl:value-of select="$admon.type"/>
  30. <xsl:if test="title">
  31. <xsl:text>: </xsl:text>
  32. <xsl:value-of select="title"/>
  33. </xsl:if>
  34. </h3>
  35. </div>
  36. <div class="admonbody">
  37. <xsl:apply-templates/>
  38. </div>
  39. </div>
  40. </xsl:template>
  41. </xsl:stylesheet>