docbook-apps

HTML Chunking confusion...

  • 1.  HTML Chunking confusion...

    Posted 08-05-2011 12:48
    Hi all

    I'm looking at adding some additional logic to the chunking code because we need some additional nodes to create chunks. I'm overriding the named 'chunk' template from chunk-common.xsl. I've been trying to work out why changing the value of chunk.section.depth does nothing in my code. I solved that but came up with something that I'm not sure about. The following is from the chunk template (reformatted for readability)

    <xsl:when test="local-name($node) = 'section'
    and $chunk.section.depth >= count($node/ancestor::section)+1
    and ($chunk.first.sections != 0 or count($node/preceding-sibling::section) > 0)">

    <xsl:call-template name="chunk">
    <xsl:with-param name="node" select="$node/parent::*"/>
    </xsl:call-template>
    </xsl:when>

    I'm using chunkfast.xsl. The chunk template is called by the template which finds chunks (<xsl:template match="*" mode="chunk-filename"/> in chunk-code.xsl). As far as I can see, with a namespaced document, chunkfast.xsl will populate it's tracking variable (chunk.hierarchy) by processing the input before namespaces are stripped. So, how does " count($node/ancestor::section)" ever count anything? What have I missed?



    thanks (from a confused)


    nic
    --
    Nic Gibson
    Corbas Consulting
    Digital Publishing Consultancy and Training
    http://www.corbas.co.uk, +44 (0)7718 906817

    Nic Gibson
    Corbas Consulting
    Digital Publishing Consultancy and Training
    http://www.corbas.co.uk, +44 (0)7718 906817