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
b...@sagehill.net


----- Original Message ----- From: "Nic Gibson" <n...@corbas.net>
To: <docbook-apps@lists.oasis-open.org>
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: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org




---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

Reply via email to