1 Mar 2007 03:45
chunking templates rearranged in snapshot
Bob Stayton <bobs <at> sagehill.net>
2007-03-01 02:45:35 GMT
2007-03-01 02:45:35 GMT
I've rearranged the templates in the chunking stylesheet files, and I'm hoping some people will try out the latest DocBook XSL snapshot and report any problems. I've been trying to solve a long standing problem with the chunking stylesheets: how do you customize both the element formats and the chunking behavior, without creating conflicts between templates. The chunking templates make extensive use of import precedence, but sometimes when another import layer is added for a customization, things would break. The basic idea is that the chunking stylesheet imports the non-chunking stylesheet to get the templates that format elements. The chunking stylesheet also defines templates that match on the same elements, but instead perform the chunking process to contain the formatted content. The chunking version has import precedence over the non-chunking version, so it acts first. Inside the chunking template, the xsl:apply-imports element is used to apply the non-chunking version to format the content. So far so good. The problem arises when a customization layer imports the chunking templates and then customizes the chunking behavior. If the customized chunking template does xsl:apply-imports, it applies the most recent import, which is the original chunking template, not the element formatting template. Oops, broken output, most visibly noticed as chunks with header and footer but no content. The chunking customization process tries to work around this by using xsl:include instead of xsl:import for the chunking templates. That way you don't add another layer of import, so xsl:apply-imports will find the element formatting version. The problem with xsl:include is that any(Continue reading)
Nigel
RSS Feed