tables_fop.xsl 1.2 KB

123456789101112131415161718192021222324252627282930
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This file is part of the DITA Open Toolkit project.
  4. See the accompanying license.txt file for applicable licenses.
  5. -->
  6. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  7. xmlns:fo="http://www.w3.org/1999/XSL/Format"
  8. xmlns:xs="http://www.w3.org/2001/XMLSchema"
  9. version="2.0"
  10. exclude-result-prefixes="xs">
  11. <xsl:template match="*[contains(@class, ' topic/dt ')]">
  12. <fo:block xsl:use-attribute-sets="dlentry.dt__content">
  13. <xsl:call-template name="commonattributes"/>
  14. <xsl:if test="not(preceding-sibling::*[contains(@class,' topic/dt ')])">
  15. <xsl:apply-templates select="../@id" mode="dlentry-id-for-fop"/>
  16. <xsl:apply-templates select="../*[contains(@class,' ditaot-d/ditaval-startprop ')]" mode="outofline"/>
  17. </xsl:if>
  18. <xsl:apply-templates/>
  19. </fo:block>
  20. </xsl:template>
  21. <xsl:template match="*[contains(@class,' topic/dlentry ')]/@id">
  22. <!-- FOP does not support @id on table rows; drop from the row and add to an <fo:inline> in the first term. -->
  23. </xsl:template>
  24. <xsl:template match="@id" mode="dlentry-id-for-fop">
  25. <fo:inline id="{.}"/>
  26. </xsl:template>
  27. </xsl:stylesheet>