Topics

How deal with complex conditions with combinations of AND, OR and NOT #conditional-processing

Bella Zhao
 

Hi,

 

The conditional attributes are very complex for our documentation because our product is highly customer configurable.

 

Our conditions have complex combinations of AND, OR, and NOT, for example, (A || B) && C && !D. In real cases there can be much more layers. While I think DITAVAL can only deal with OR and NOT, such as (A || B) and !A?

 

Is there any way to deal with such complex conditions in DITA? Do we need some special programming?

 

Thanks,

Bella

 

 

Reece Roggentien
 

We have some complex conditionalization, too, and these are some techniques I’ve used. For ditavals:

 

·       “Exclude” all profiling attributes by default: <prop action="exclude"/>

·       “Include” all @otherprops by default: <prop action="include" att="otherprops"/>

·       “Include” any other profiling attributes that shouldn’t get filtered

 

What this does:

 

·       It allows us to use @otherprops for selective exclusion (one-off filtering), like: <prop action="exclude" att="otherprops" val="everyone_but_customer_1"/>

·       It allows us to use @props and any specializations of @props for selective inclusion, like: <prop action="include" att="props" val="only_customer_1"/>

 

In the content itself, it’s sometimes impossible to accomplish the and/or/not behavior we want on a single element. In those cases we’ve repeated the element but applied different profiling attributes to each one to get the desired output. We could use also a single keyref or conkeyref with conditionalized keydefs instead.

 

-Reece

 

From: main@dita-users.groups.io [mailto:main@dita-users.groups.io] On Behalf Of Bella Zhao via groups.io
Sent: Friday, April 03, 2020 12:08 AM
To: dita-users@groups.io
Subject: [dita-users] How deal with complex conditions with combinations of AND, OR and NOT

 

Hi,

 

The conditional attributes are very complex for our documentation because our product is highly customer configurable.

 

Our conditions have complex combinations of AND, OR, and NOT, for example, (A || B) && C && !D. In real cases there can be much more layers. While I think DITAVAL can only deal with OR and NOT, such as (A || B) and !A?

 

Is there any way to deal with such complex conditions in DITA? Do we need some special programming?

 

Thanks,

Bella

 

 

Zoë Lawson
 

I haven’t done it yet, but have you looked into groups?

http://docs.oasis-open.org/dita/dita/v1.3/errata02/os/complete/part3-all-inclusive/archSpec/base/usage-of-conditional-processing-attributes.html#usage-of-conditional-processing-attributes

Zoë

Zoë Lawson


From: main@dita-users.groups.io <main@dita-users.groups.io> on behalf of Reece Roggentien <Reece.Roggentien@...>
Sent: Friday, April 3, 2020 10:33:15 AM
To: main@dita-users.groups.io <main@dita-users.groups.io>
Subject: Re: [dita-users] How deal with complex conditions with combinations of AND, OR and NOT
 

We have some complex conditionalization, too, and these are some techniques I’ve used. For ditavals:

 

·       “Exclude” all profiling attributes by default: <prop action="exclude"/>

·       “Include” all @otherprops by default: <prop action="include" att="otherprops"/>

·       “Include” any other profiling attributes that shouldn’t get filtered

 

What this does:

 

·       It allows us to use @otherprops for selective exclusion (one-off filtering), like: <prop action="exclude" att="otherprops" val="everyone_but_customer_1"/>

·       It allows us to use @props and any specializations of @props for selective inclusion, like: <prop action="include" att="props" val="only_customer_1"/>

 

In the content itself, it’s sometimes impossible to accomplish the and/or/not behavior we want on a single element. In those cases we’ve repeated the element but applied different profiling attributes to each one to get the desired output. We could use also a single keyref or conkeyref with conditionalized keydefs instead.

 

-Reece

 

From: main@dita-users.groups.io [mailto:main@dita-users.groups.io] On Behalf Of Bella Zhao via groups.io
Sent: Friday, April 03, 2020 12:08 AM
To: dita-users@groups.io
Subject: [dita-users] How deal with complex conditions with combinations of AND, OR and NOT

 

Hi,

 

The conditional attributes are very complex for our documentation because our product is highly customer configurable.

 

Our conditions have complex combinations of AND, OR, and NOT, for example, (A || B) && C && !D. In real cases there can be much more layers. While I think DITAVAL can only deal with OR and NOT, such as (A || B) and !A?

 

Is there any way to deal with such complex conditions in DITA? Do we need some special programming?

 

Thanks,

Bella

 

 

Wim Hooghwinkel
 

Hi Bella,

Since you’re using DITAToo CCMS, you might check out the configuration database add on. This has been designed for managing complex conditions in DITA content. Contact your DITAToo vendor to get more info.


Vriendelijke groet / Kind regards,
 
Wim Hooghwinkel



Phone +31652036811
Skype wimhooghwinkel
Twitter @idtp

Check my LinkedIn profile for latest updates

-