[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: DOCBOOK-APPS: Chunk wish
> I think it could be interesting to specify at which level you want > the > document splitted. In the current implementation it splits for each > section, and I would like to have some new variable (such as > chunk.level) through wich you could say to split for each chapter, > each > part, etc. In your customization stylesheet, override the "chunk" template (found in html/chunk-common.xsl) and change the logic for what constitutes a chunk. For instance, to say that sections are not chunks, change it to this: <xsl:template name="chunk"> <xsl:param name="node" select="."/> <!-- returns 1 if $node is a chunk --> <xsl:choose> <!-- comment out these lines to make sections not be chunks <xsl:when test="name($node)='sect1' and count($node/preceding-sibling::sect1) > 0">1</xsl:when> <xsl:when test="name($node)='section' and count($node/parent::section) = 0 and count($node/preceding-sibling::section) > 0">1</xsl:when> --> <xsl:when test="name($node)='preface'">1</xsl:when> <xsl:when test="name($node)='chapter'">1</xsl:when> <xsl:when test="name($node)='appendix'">1</xsl:when> <xsl:when test="name($node)='article'">1</xsl:when> <xsl:when test="name($node)='part'">1</xsl:when> <xsl:when test="name($node)='reference'">1</xsl:when> <xsl:when test="name($node)='refentry'">1</xsl:when> <xsl:when test="name($node)='index' and (name($node/parent::*) = 'article' or name($node/parent::*) = 'book')">1</xsl:when> <xsl:when test="name($node)='bibliography' and (name($node/parent::*) = 'article' or name($node/parent::*) = 'book')">1</xsl:when> <xsl:when test="name($node)='glossary' and (name($node/parent::*) = 'article' or name($node/parent::*) = 'book')">1</xsl:when> <xsl:when test="name($node)='colophon'">1</xsl:when> <xsl:when test="name($node)='book'">1</xsl:when> <xsl:when test="name($node)='set'">1</xsl:when> <xsl:when test="name($node)='setindex'">1</xsl:when> <xsl:otherwise>0</xsl:otherwise> </xsl:choose> </xsl:template> Hope this helps. -M -- You're smart; why haven't you learned Python yet? http://diveintopython.org/ __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC