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