List Info

Thread: refentry and HTML chunking customization




refentry and HTML chunking customization
user name
2007-01-29 04:51:33

Hello,

 

we are preparing a document which uses „refentry“; element inside „sections“;. The resulting HTML will be chunkend on chapter level. As I have found out, the refentry element gets chunked despite section chunking is turned off.

 

After that, I customized the chunking templates so that it would not produce refentry in a standalone file with broken hyperlinks in table of contents. My problem, however, is that I did not succeeded in creating proper cutomization file as described in Bob Stayton’s book (http://www.sagehill.net/docbookxsl/ChunkingCustomization.html).

 

After creating customized version of chunk.xsl with suggested orderd of imported files I placed the changed templates right after imported chunk-code.xsl.

 

I removed all refentries in these templates:

process-chunk

chunk-all-sections

chunk-first-section-with-parent

 

<xsl:template match=&quot;set|book|part|preface|chapter|appendix

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  |article

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  |reference|refentry

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  |book/glossary|article/glossary|part/glossary

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  |book/bibliography|article/bibliography|part/bibliography

 &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;  |colophon">

chunk

 

<xsl:when test=";local-name($node)='refentry'&quot;>1</xsl:when&gt;

 

But during transformation I get a lot of error messaged reporting various ambiguous matches and the process fails. Perhaps I did something wrong as to templates import precedence.

 

In the end my solution was to make a copy of chunk-code.xsl and chunk-common.xsl, rename them, change appropriate templates and create a new chunk.xsl which imports my main driver file and the above mentioned files.

 

My customized version of chunk.xsl looks like this and gets me the desired result:

 

<xsl:import href=";my-custom-docbook.xsl"/>

<xsl:import href=";chunk-common-customized.xsl";/>

<xsl:include href=";manifest.xsl"/&gt;

<xsl:include href=";chunk-code-customized.xsl"/>

 

But I would like to ask wheter somebody has come across a similar problem and was able to achieve the right solution.

 

Greetings

 

pavel

 

 

 

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )