Conditioning Question

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Stacey
Posts: 44
Joined: Tue Mar 14, 2017 12:36 am

Conditioning Question

Post by Stacey »

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: 907
Joined: Thu May 02, 2019 2:32 pm

Re: Conditioning Question

Post by chrispitude »

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.
im_rem
Posts: 20
Joined: Tue Jun 14, 2022 1:08 pm

Re: Conditioning Question

Post by im_rem »

Hello,
my question is not related to the original one but still a rather general question about conditions:
Is there a possibility to force-exclude elements where an attribute has multiple values but only one of the values is defined as "excluded" in the DITAVAL? This is the default behavior in Madcap Flare which was quiet practical. After I made a DITA project out of a Flare project, I regularly find paragraphs or whole topics in the output that should have been excluded and the reason is always multiple values in an attribute.
For fun, I tried using regex in the @val attribute to catch cases where the target value is enclosed by other values. But of course that did not work.
So is there another way to force exclude without having to find out and write down every possible combination of multiple values in the ditaval?

Example element:

Code: Select all

<topic id="beispiel_zur_datenanlage" audience="internal lang_de">
    <title>Beispiel zur Datenanlage</title>
    ...
    
Example ditaval:

Code: Select all

<val>
    <prop action="exclude" att="audience" val="lang_de"/>
</val>
Note:
- The DITA project uses a subject scheme.
- Please ignore the fact, that the second value is regarding language. This is just as an example.
- I know that I could make specializations of @props, but this is a rather complicated approach.

Kind regards
im_rem
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: Conditioning Question

Post by Radu »

Hi,
The DITA 1.3 specs describes exactly how filtering with DITAVAL filter files should work:
https://www.oxygenxml.com/dita/1.3/spec ... ering.html
if any token in the attribute value evaluates to "include", the element evaluates to "include"; otherwise it evaluates to "exclude". In other words, the attribute evaluates to "exclude" only when all the values in that attribute evaluate to "exclude".
So the DITA OT publishing engine bundled with Oxygen precisely follows the DITA specification in this regard and there is no setting to control this as the specification is quite clear about how the filtering should work.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply