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