From 8ce4a2944741b9b47510160907706282968c22f4 Mon Sep 17 00:00:00 2001 From: Norman Walsh Date: Tue, 4 Dec 2001 18:54:49 +0000 Subject: [PATCH] Feature #477348: support chunk.section.depth (lots and lots of changes here: danger will robinson) --- xsl/html/chunk.xsl | 348 +++++++++++++++++++++++++++++++-------------- 1 file changed, 242 insertions(+), 106 deletions(-) diff --git a/xsl/html/chunk.xsl b/xsl/html/chunk.xsl index e88e89d9d..eee202d82 100644 --- a/xsl/html/chunk.xsl +++ b/xsl/html/chunk.xsl @@ -5,10 +5,6 @@ - - @@ -43,8 +39,8 @@ ( ) - cs: - + csd: + cfs: ps: @@ -56,19 +52,54 @@ 1 - 0)"> + or count($node/preceding-sibling::sect1) > 0)"> 1 - 0"> - 1 + or count($node/preceding-sibling::sect2) > 0)"> + + + + + + + + + + + + + + + + + + + + + + + + 1 1 1 @@ -103,6 +134,19 @@ + + @@ -274,6 +318,22 @@ + + + + + s + + + + + + @@ -645,14 +705,11 @@ - - - - + @@ -698,6 +755,9 @@ + + + - + |preceding::sect1[$chunk.section.depth > 0 + and preceding-sibling::sect1][1] - - - - - + |preceding::sect2[$chunk.section.depth > 1 + and preceding-sibling::sect2 + and parent::sect1[preceding-sibling::sect1]][1] + + |preceding::sect3[$chunk.section.depth > 2 + and preceding-sibling::sect3 + and parent::sect2[preceding-sibling::sect2] + and ancestor::sect1[preceding-sibling::sect1]][1] + + |preceding::sect4[$chunk.section.depth > 3 + and preceding-sibling::sect4 + and parent::sect3[preceding-sibling::sect2] + and ancestor::sect2[preceding-sibling::sect2] + and ancestor::sect1[preceding-sibling::sect1]][1] + + |preceding::sect5[$chunk.section.depth > 4 + and preceding-sibling::sect5 + and parent::sect4[preceding-sibling::sect4] + and ancestor::sect3[preceding-sibling::sect3] + and ancestor::sect2[preceding-sibling::sect2] + and ancestor::sect1[preceding-sibling::sect1]][1] + + |preceding::section[$chunk.section.depth > count(ancestor::section) + and preceding-sibling::section + and not(ancestor::section[not(preceding-sibling::section)])][1] - - @@ -797,8 +849,36 @@ |following::reference[1] |following::refentry[1] |following::colophon[1] - |following::sect1[1] - |following::section[name(parent::*) != 'section'][1] + + |following::sect1[$chunk.section.depth > 0 + and preceding-sibling::sect1][1] + + |following::sect2[$chunk.section.depth > 1 + and preceding-sibling::sect2 + and parent::sect1[preceding-sibling::sect1]][1] + + |following::sect3[$chunk.section.depth > 2 + and preceding-sibling::sect3 + and parent::sect2[preceding-sibling::sect2] + and ancestor::sect1[preceding-sibling::sect1]][1] + + |following::sect4[$chunk.section.depth > 3 + and preceding-sibling::sect4 + and parent::sect3[preceding-sibling::sect2] + and ancestor::sect2[preceding-sibling::sect2] + and ancestor::sect1[preceding-sibling::sect1]][1] + + |following::sect5[$chunk.section.depth > 4 + and preceding-sibling::sect5 + and parent::sect4[preceding-sibling::sect4] + and ancestor::sect3[preceding-sibling::sect3] + and ancestor::sect2[preceding-sibling::sect2] + and ancestor::sect1[preceding-sibling::sect1]][1] + + |following::section[$chunk.section.depth > count(ancestor::section) + and preceding-sibling::section + and not(ancestor::section[not(preceding-sibling::section)])][1] + |following::bibliography[1] |following::glossary[1] |following::index[1] @@ -817,8 +897,36 @@ |descendant::part[1] |descendant::reference[1] |descendant::refentry[1] - |descendant::sect1[1] - |descendant::section[name(parent::*) != 'section'][1])[1]"/> + + |descendant::sect1[$chunk.section.depth > 0 + and preceding-sibling::sect1][1] + + |descendant::sect2[$chunk.section.depth > 1 + and preceding-sibling::sect2 + and parent::sect1[preceding-sibling::sect1]][1] + + |descendant::sect3[$chunk.section.depth > 2 + and preceding-sibling::sect3 + and parent::sect2[preceding-sibling::sect2] + and ancestor::sect1[preceding-sibling::sect1]][1] + + |descendant::sect4[$chunk.section.depth > 3 + and preceding-sibling::sect4 + and parent::sect3[preceding-sibling::sect2] + and ancestor::sect2[preceding-sibling::sect2] + and ancestor::sect1[preceding-sibling::sect1]][1] + + |descendant::sect5[$chunk.section.depth > 4 + and preceding-sibling::sect5 + and parent::sect4[preceding-sibling::sect4] + and ancestor::sect3[preceding-sibling::sect3] + and ancestor::sect2[preceding-sibling::sect2] + and ancestor::sect1[preceding-sibling::sect1]][1] + + |descendant::section[$chunk.section.depth > count(ancestor::section) + and preceding-sibling::section + and not(ancestor::section[not(preceding-sibling::section)])])[1] +"/> @@ -826,7 +934,7 @@ - + + |ancestor::article[1] + |ancestor::sect1[$chunk.section.depth > 0][1] + |ancestor::sect2[$chunk.section.depth > 1][1] + |ancestor::sect3[$chunk.section.depth > 2][1] + |ancestor::sect4[$chunk.section.depth > 3][1] + |ancestor::sect5[$chunk.section.depth > 4][1] + |ancestor::section[$chunk.section.depth > count(ancestor::section)][1])[last()]"/> + |descendant::refentry[1] + + |descendant::sect1[$chunk.section.depth > 0][1] + |descendant::sect2[$chunk.section.depth > 1][1] + |descendant::sect3[$chunk.section.depth > 2][1] + |descendant::sect4[$chunk.section.depth > 3][1] + |descendant::sect5[$chunk.section.depth > 4][1] + |descendant::section[$chunk.section.depth + > count(ancestor::section)][1])[1]"/> @@ -958,27 +1096,25 @@ - + + + + + + - + - - - - - - - - - - -- 2.40.0