glossary.xsl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This file is part of the DITA Open Toolkit project.
  4. Copyright 2010 aryehsanders
  5. See the accompanying LICENSE file for applicable license.
  6. -->
  7. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  8. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  9. xmlns:ot-placeholder="http://suite-sol.com/namespaces/ot-placeholder"
  10. exclude-result-prefixes="ot-placeholder"
  11. version="2.0">
  12. <xsl:template match="ot-placeholder:glossarylist" name="createGlossary">
  13. <fo:page-sequence master-reference="glossary-sequence" xsl:use-attribute-sets="page-sequence.glossary">
  14. <xsl:call-template name="insertGlossaryStaticContents"/>
  15. <fo:flow flow-name="xsl-region-body">
  16. <fo:marker marker-class-name="current-header">
  17. <xsl:call-template name="getVariable">
  18. <xsl:with-param name="id" select="'Glossary'"/>
  19. </xsl:call-template>
  20. </fo:marker>
  21. <xsl:apply-templates select="." mode="customTopicMarker"/>
  22. <fo:block xsl:use-attribute-sets="__glossary__label" id="{$id.glossary}">
  23. <xsl:apply-templates select="." mode="customTopicAnchor"/>
  24. <xsl:call-template name="getVariable">
  25. <xsl:with-param name="id" select="'Glossary'"/>
  26. </xsl:call-template>
  27. </fo:block>
  28. <xsl:apply-templates/>
  29. </fo:flow>
  30. </fo:page-sequence>
  31. </xsl:template>
  32. <xsl:template match="ot-placeholder:glossarylist//*[contains(@class, ' glossentry/glossentry ')]">
  33. <fo:block>
  34. <xsl:call-template name="commonattributes"/>
  35. <fo:block>
  36. <xsl:attribute name="id">
  37. <xsl:call-template name="generate-toc-id"/>
  38. </xsl:attribute>
  39. <fo:block xsl:use-attribute-sets="__glossary__term">
  40. <xsl:apply-templates select="*[contains(@class, ' glossentry/glossterm ')]/node()"/>
  41. </fo:block>
  42. <fo:block xsl:use-attribute-sets="__glossary__def">
  43. <xsl:apply-templates select="*[contains(@class, ' glossentry/glossdef ')]/node()"/>
  44. </fo:block>
  45. </fo:block>
  46. </fo:block>
  47. </xsl:template>
  48. </xsl:stylesheet>