chunk-changebars.xsl 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?xml version="1.0" encoding="ASCII"?>
  2. <!--This file was created automatically by html2xhtml-->
  3. <!--from the HTML stylesheets.-->
  4. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0" xmlns="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="exsl cf">
  5. <!-- ********************************************************************
  6. $Id: chunk-changebars.xsl 8399 2009-04-08 07:37:42Z bobstayton $
  7. ********************************************************************
  8. This file is part of the XSL DocBook Stylesheet distribution.
  9. See ../README or http://docbook.sf.net/release/xsl/current/ for
  10. copyright and other information.
  11. ******************************************************************** -->
  12. <!-- ==================================================================== -->
  13. <!-- This file is a variant of chunk.xsl, to be used for generating chunked
  14. output with highlighting based on change markup. -->
  15. <xsl:import href="changebars.xsl"/>
  16. <xsl:import href="chunk-common.xsl"/>
  17. <!-- This customization of "process-chunk-element" is needed in order to make change
  18. highlighting be inherited by chunked children of an element with change markup. -->
  19. <xsl:template name="process-chunk-element">
  20. <xsl:param name="content">
  21. <xsl:choose>
  22. <xsl:when test="ancestor-or-self::*[@revisionflag] and $show.revisionflag != 0">
  23. <xsl:variable name="revisionflag" select="ancestor-or-self::*[@revisionflag][1]/@revisionflag"/>
  24. <xsl:call-template name="block.or.inline.revision">
  25. <xsl:with-param name="revisionflag" select="$revisionflag"/>
  26. </xsl:call-template>
  27. </xsl:when>
  28. <xsl:otherwise>
  29. <xsl:apply-imports/>
  30. </xsl:otherwise>
  31. </xsl:choose>
  32. </xsl:param>
  33. <xsl:choose>
  34. <xsl:when test="$chunk.fast != 0 and $exsl.node.set.available != 0">
  35. <xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
  36. <xsl:variable name="genid" select="generate-id()"/>
  37. <xsl:variable name="div" select="$chunks[@id=$genid or @xml:id=$genid]"/>
  38. <xsl:variable name="prevdiv" select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
  39. <xsl:variable name="prev" select="key('genid', ($prevdiv/@id|$prevdiv/@xml:id)[1])"/>
  40. <xsl:variable name="nextdiv" select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
  41. <xsl:variable name="next" select="key('genid', ($nextdiv/@id|$nextdiv/@xml:id)[1])"/>
  42. <xsl:choose>
  43. <xsl:when test="$onechunk != 0 and parent::*">
  44. <xsl:copy-of select="$content"/>
  45. </xsl:when>
  46. <xsl:otherwise>
  47. <xsl:call-template name="process-chunk">
  48. <xsl:with-param name="prev" select="$prev"/>
  49. <xsl:with-param name="next" select="$next"/>
  50. <xsl:with-param name="content" select="$content"/>
  51. </xsl:call-template>
  52. </xsl:otherwise>
  53. </xsl:choose>
  54. </xsl:when>
  55. <xsl:otherwise>
  56. <xsl:choose>
  57. <xsl:when test="$onechunk != 0 and not(parent::*)">
  58. <xsl:call-template name="chunk-all-sections">
  59. <xsl:with-param name="content" select="$content"/>
  60. </xsl:call-template>
  61. </xsl:when>
  62. <xsl:when test="$onechunk != 0">
  63. <xsl:copy-of select="$content"/>
  64. </xsl:when>
  65. <xsl:when test="$chunk.first.sections = 0">
  66. <xsl:call-template name="chunk-first-section-with-parent">
  67. <xsl:with-param name="content" select="$content"/>
  68. </xsl:call-template>
  69. </xsl:when>
  70. <xsl:otherwise>
  71. <xsl:call-template name="chunk-all-sections">
  72. <xsl:with-param name="content" select="$content"/>
  73. </xsl:call-template>
  74. </xsl:otherwise>
  75. </xsl:choose>
  76. </xsl:otherwise>
  77. </xsl:choose>
  78. </xsl:template>
  79. <xsl:include href="chunk-code.xsl"/>
  80. </xsl:stylesheet>