lfs-admon.xsl 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. <xsl:variable name="alt">
  22. <xsl:call-template name="gentext">
  23. <xsl:with-param name="key" select="$admon.type"/>
  24. </xsl:call-template>
  25. </xsl:variable>
  26. <div class="{name(.)}">
  27. <div class ="admonhead">
  28. <img alt="[{$alt}]">
  29. <xsl:attribute name="src">
  30. <xsl:call-template name="admon.graphic"/>
  31. </xsl:attribute>
  32. </img>
  33. <h3 class="admontitle">
  34. <xsl:apply-templates select="." mode="object.title.markup"/>
  35. </h3>
  36. </div>
  37. <div class="admonbody">
  38. <xsl:apply-templates/>
  39. </div>
  40. </div>
  41. </xsl:template>
  42. </xsl:stylesheet>