Re: [docbook-apps] HTML Chunking confusion...

From
Bob Stayton <>
Date
2011-08-07T16:43:42+00:00
ID
000901cc5521$19fc5230$0401a8c0@pazu
Thread
Re: [docbook-apps] HTML Chunking confusion...
Hi Nic,
I think your assessment is correct that the find.chunks template that generates the 
chunk.hierarchy is processing the original namespaced nodes when it calls the "chunk" 
template.  So preceding-sibling::section would not be matched in that round of 
processing.  This looks like a bug in fast chunking.   You should file a bug report on 
it and I'll look at it in more detail when I get back from my trip.

This is another example of why the name-spaced version of the stylesheets should be 
used with namespaced content.  While the namespace stripping process basically works 
to handle a namespaced document with the non-namespaced stylesheet, there are several 
edge cases like this using internal node sets where it gets more complicated.

Bob Stayton
Sagehill Enterprises



----- Original Message ----- 
From: "Nic Gibson" <>
To: <>
Sent: Friday, August 05, 2011 5:48 AM
Subject: [docbook-apps] HTML Chunking confusion...


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 &gt;= count($node/ancestor::section)+1
and ($chunk.first.sections != 0   or count($node/preceding-sibling::section) &gt; 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



---------------------------------------------------------------------
To unsubscribe, e-mail: 
For additional commands, e-mail: