Page 1 of 1

Conditional tagging

Posted: Thu Sep 20, 2012 7:43 pm
by Frankwin
Hi,

I was wondering if someone knows of a DocBook tag to use that we can tag content with that we only want displayed when generating (Transforming into WebHelp) Help files for certain customers. We have several items in our help files that are only available for those customers that want/pay for them, so when we generate our help files for Customer A we want to include them, but not for Customer B.

Any help is appreciated.

Thanks,

Frankwin

Re: Conditional tagging

Posted: Fri Sep 21, 2012 10:27 am
by sorin_ristache
Hi Frankwin,

Tagging content for different target audiences/output types is called profiling and in the DocBook framework that is usually accomplished by adding profiling attributes on the elements specific for some audience. The attributes used for profiling are general (available on every DocBook element). They are: audience, userlevel, role, vendor, security, condition, conformance, os, arch, etc. For example profiling for the expert and novice audience is done in the XML source document as in the following:

Code: Select all

  <sect1>
    <title>Checking for Updates</title>
    <para audience="novice">If the connection is blocked at this point you should contact your
        network administrator.</para>
    <para audience="expert">If the program stops responding first check the user credentials
        configured in the user options and the the proxy settings.</para>
  </sect1>


When the output is generated the profile is selected by setting the value of the corresponding profiling parameter in the DocBook transformation scenario. For example for the audience attribute the parameter profile.audience of the transformation should be set to either novice (for including in the output only the elements that have no audience attribute or have the attribute audience="novice") or expert (for including in the output only the elements that have no audience attribute or have the attribute audience="expert") or novice;expert (if both profiles need to be generated in the output). For the userlevel profiling attribute the transformation parameter is called profile.userlevel, etc.


Regards,
Sorin

Re: Conditional tagging

Posted: Mon Sep 24, 2012 10:19 pm
by Frankwin
Thanks. That was exactly what I was looking for :)

Re: Conditional tagging

Posted: Tue Sep 03, 2013 10:18 pm
by jsk
Is profiling supported in oXygen PDF output as well? I am using the following XML:

<para condition="journal">This is optional for journals.</para>
<para condition="book">This is required for books.</para>

I edited the DocBook transformation scenario to set the profile.condition parameter to "journal", and ran the transformation. Both the "journal" and the "book" paragraphs were included in the PDF file. (I expected to see only the "journal" paragraph in the output.)

Thanks in advance!

Re: Conditional tagging

Posted: Wed Sep 04, 2013 11:39 am
by sorin_ristache
Hi,

jsk wrote:Is profiling supported in oXygen PDF output as well?


Yes, profiling is supported in all Docbook transformations. If the profiling parameters are present in the Parameters dialog box then they should work.

jsk wrote:I am using the following XML:

<para condition="journal">This is optional for journals.</para>
<para condition="book">This is required for books.</para>

I edited the DocBook transformation scenario to set the profile.condition parameter to "journal", and ran the transformation. Both the "journal" and the "book" paragraphs were included in the PDF file. (I expected to see only the "journal" paragraph in the output.)


I tried that too in a simple DOcbook document and only the journal paragraph was present in the PDF output, that is:

Code: Select all

<para condition="journal">This is optional for journals.</para>


Can you post here or send us the Docbook document for testing the PDF transformation on it with the profile.condition parameter set to journal?


Regards,
Sorin