[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Profiling/conditional text based on document context?
Hi Mark PACBook can do this (among other things).Use this stylesheet as a custom layer to call the DocBook profiling stylesheet:
https://github.com/janiveer/PACBook/blob/master/xsl/DBProfile.xsl Documentation is here: https://github.com/STANLEYSecurity/PACBook/wiki/DBProfile.xsl In your case, to use the PACBook DBProfile stylesheet:* If the root element of the standard notes has xml:id="standard", you would add condition="standard" to the elements that should only appear in the standard edition.
* If the root element of the OEM notes has xml:id="OEM", you would add condition="OEM" to the elements that should only appear in the OEM edition.
* Do not add a condition attribute to the elements that should appear in both editions.
If you don't want to refer to the xml:id of the containing document, you can use the condition attribute on the root element of the containing document. Refer to the docs as shown above.
Hope this helps -- Simon Dew On 22/06/2016 07:46, Mark Craig wrote:
Hello, We use profiling/conditional text already at build time and it works fine. What is the right way to set up conditional text to have the condition depend on the document context? In other words, if the document is included in book 1, exclude this and include that. If the document is included in book 2, include this and exclude that. Here's a simplified example, a common section XIncluded in two different release notes books: <?xml version="1.0" encoding="UTF-8"?> <!-- This file is included in both release notes in the same doc set. Both sets of release notes are built *at the same time*. That is, profiles depend on the document, not on the build. --> <section xml:id="whats-new" xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd"> <title>What's New</title> <itemizedlist> <para> This release includes the following new features: </para> <listitem><!-- Make this appear only in standard edition release notes. --> <para> A feature that is only in the standard edition of the product </para> </listitem> <listitem><!-- Make this appear only in OEM edition release notes. --> <para> A feature that is only in the OEM edition of the product </para> </listitem> <listitem><!-- Make this appear in both release notes. --> <para> A feature that is in both standard and OEM editions </para> </listitem> </itemizedlist> </section> The first item should be included in the standard edition release notes and excluded from the OEM edition release notes. The second item should be excluded from the standard edition release notes and included in the OEM edition release notes. The third item appears in both. The whole doc set is built at the same time with the same configuration. In other words, the profiling conditions depend not on the build, but on the document context. Thanks for your help. Regards, Mark