[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: [docbook-apps] Suppressing toc entries based on role attribute
I wish to generate two slightly different sets of documentation from the same DocBook XML. I thought I'd achieved this by setting the role attribute on affected elements, eg: <sect2 role="not_doc_a" id="something"> ...content... </sect2> and having two local stylesheets, one which ignores elements with the role not_doc_a and one which ignores elements with the role not_doc_b. I had thought that this had worked, but have just noticed that the autogenerated toc includes entries for each section, regardless of the role. Obviously, the links in the toc to suppress sections don't work because the content isn't there! Is there anyway to suppress toc entries for elements with a particular role ? I believe that the toc entry isn't generated when the (eg) sect2 element is processed - if I include a local empty template for sect2 so the text, headings etc disappear, the toc entries remain. So all attempts to intercept sect2 elements with the correct role are futile - the toc's already been generated. I had hoped that overriding generate.toc in my local stylesheet in the following way: <xsl:param name="generate.toc"> <xsl:choose> <xsl:when test="@role='not_doc_a'"> sect2 nop </xsl:when> <xsl:when test="@role='not_doc_b'"> sect2 nop </xsl:when> <xsl:otherwise> ... what it would otherwise be... </xsl:otherwise> </xsl:choose> </xsl:param> would do The Right Thing, but the toc entries for the missing sections are still present. Does anyone know whether what I want to do is possible? If it is not, could anyone suggest an alternative method of generating my two sets of docs which won't result in this problem? I'm reluctant to build my toc manually unless it's absolutely unavoidable. Thanks, Elizabeth -- View this message in context: http://www.nabble.com/Suppressing-toc-entries-based-on-role-attribute-tp15950845p15950845.html Sent from the docbook apps mailing list archive at Nabble.com.