Conditioning Question

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Stacey
Posts: 16
Joined: Tue Mar 14, 2017 12:36 am

Conditioning Question

Post by Stacey » Fri Jan 29, 2021 8:51 pm

Hello:

I know that you can exclude conditioned content from the final product, but is there a way to include content?

For example, products A and C use some of the same information. If I condition out A, the documentation for C is missing the information that was shared by A and C. Have I missed something? Is there a way to show all of the information for C, even if it's marked with A (as long as it's marked for C as well)?

chrispitude
Posts: 326
Joined: Thu May 02, 2019 2:32 pm

Re: Conditioning Question

Post by chrispitude » Sat Jan 30, 2021 6:23 pm

Hi Stacey,

I find it easiest to use profiling attributes to specify what to include. For example,

Code: Select all

<p>This is for everyone.</p>
<p audience="novice">This is for novice users only.</p>
<p audience="intermediate">This is for intermediate users only.</p>
<p audience="expert">This is for expert users only.</p>
Now, you can make DITAVAL files that -- for elements where @audience is defined -- includes content relevant to a value. For example, novice.ditaval would look like this:

Code: Select all

<val>
   <!-- if @audience is defined, exclude all values... -->
   <prop att="audience"              action="exclude"/>

   <!-- ...then incrementally include only "novice" -->
   <prop att="audience" val="novice" action="include"/>
</val>
If content is relevant to multiple values, just include them, space-separated:

Code: Select all

<p audience="intermediate expert">This is for intermediate and expert users.</p>
I find this inclusion-based use of attributes more intuitive than an exclusion-based approach.

Post Reply