OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: RE: [docbook-apps] Suppressing toc entries based on role attribute


DocBook has a profiling capability that should do what
you want.  It's supported by the stylesheets, so you
can make two versions of a document from the same source
and get the correct toc for each automatically.

Check out this section from Bob Stayton's book: DocBook
XSL: The Complete Guide:


Dick Hamilton

> -----Original Message-----
> From: elizabethw [mailto:elizabeth.wootten@antixlabs.com] 
> Sent: Monday, March 10, 2008 9:54 AM
> To: docbook-apps@lists.oasis-open.org
> 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-at
Sent from the docbook apps mailing list archive at Nabble.com.

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

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]