RE: [dita-comment] Enhancing filtering logic

From
David Artman <>
Date
2018-06-06T18:00:08+00:00
ID
Thread
RE: [dita-comment] Enhancing filtering logic
I think I follow your ideas, but I also think that some of them are already doable (albeit with some hacky approaches):

--A--

"Combining several attributes in a filtering situation:

All attributes must be “true” to process the element (AND logic).

<ph type=”tree” color=”green”>…</ph>

(@type AND @color must be true to process the element)"

-----

This can be accomplished by wrapping/nesting elements with the AND attributes:

<ph type=”tree”><ph color=”green”>…</ph></ph>

If either attribute-value pair evaluate to exclude, then the 'surviving' included attribute-value pair will either be a blank PH ("green"=exclude means outer PH is empty) or a full exclusion ("tree"=exclude means outer PH takes the inner out with it).

--B--

Combining several values within one attribute in a filtering situation:

Only one of the listed values must be true to process the element (OR logic).

<ph product=”ProdA ProdB ProdC” >…</ph>

(only one of the listed “Prod…” values must be true to process the element)

-----

I am fairly sure this is how existing ditaval filtering works, when you include more than one attribute value. [It might just be something EVERY output-generator coder has done at my past and present positions, and so I am misquoting the standard!]

--C--

We would like to say:

<ph product=”if-not(ProdA)”/>

This fragment would be processed if @product is empty or any other value than “ProdA” is set.

-----

Ah... negation filtering. SOME would say this is a Very Bad Idea or a Slippery Slope To Boolean-Logic Hell. It's been a debate/curse in FrameMaker conditions for as long as I've known how to use them (decades).

The 'lazy' solution is to just make negation values for every positive value. "ProdA" would have an inverse "ProdA-NOT" value. In many cases, this is logically what you mean/want in your information architecture. So the example just above would have two elements: a "ProdA" and "ProdA-NOT". That said, I've gotten WAY buried in FrameMaker boolean expressions for conditional sets that took such negations too far.

HTH;

David

-------- Original Message --------

Subject: [dita-comment] Enhancing filtering logic

From: Frank Ralf <>

Date: Wed, June 06, 2018 11:44 am

To: ""

<>

       
 
Hi,
 
 
 
We stumbled across the limitations of the  current filtering logic in DITA during a recent customer project. I found the following discussion in the Yahoo DITA Users group that makes some interesting suggestions to enhance the filtering logic and make it more versatile. We support these proposals. Basically it would allow switching the AND and OR behavior and introducing a kind of NOT operator. Would that be feasible?
 
 
 
Best regards,
 
Frank
 
 
 
 
 
Managing filtering logic
 
[…]
 
Filtering logic for attributes and values
 
 
 
The filtering of attributes and values follows a fixed logical combining behavior.
 
 
 
Combining several attributes in a filtering situation:
 
All attributes must be “true” to process the element (AND logic).
 
<ph type=”tree” color=”green”>…</ph>
 
(@type AND @color must be true to process the element)
 
 
 
Combining several values within one attribute in a filtering situation:
 
Only one of the listed values must be true to process the element (OR logic).
 
<ph product=”ProdA ProdB ProdC” >…</ph>
 
(only one of the listed “Prod…” values must be true to process the element)
 
 
 
We would like to give authors the chance to change the filtering logic because it depends on the filtering situation which logic is needed.
 
 
 
<ph type=”tree” color=”green” or-profiling-logic=”type color”>Process me if type is tree or color is green.</ph>
 
 
 
<ph feature=”all-values(wlan bluetooth nfc)” >Process me if all listed wireless-features are set</ph>
 
 
 
The “other-than” logic
 
 
 
Sometimes we want to filter-in a text fragment only if a specific value is NOT set (regardless other values of this attribute are set or not).
 
 
 
Example:
 
Normally, if you want to exclude content for only one product (e. g. ProdA) you have to filter all other products in, like:
 
 
 
<ph product=”ProdB ProdC ProdD … ProdN” >Text for non-ProdA products</ph>
 
 
 
This is very difficult to manage.
 
 
 
We would like to say: 
 
<ph product=”if-not(ProdA)”/>
 
This fragment would be processed if @product is empty or any other value than “ProdA” is set.
 
[…]
 
 
 
Source:  https://groups.yahoo.com/neo/groups/dita-users/conversations/topics/42463  
 
 
 
 
 
 
 

 
 
 
 
 
 
 
Frank Ralf
 
Technical Consultant
 
_______________________________________________________________
 
 
 
Phone: +49 40 7200 500-30
 
E-Mail:  
 
_______________________________________________________________
 
 
 

 
parson AG
 
Chrysanderstraße 69A, 21029 Hamburg, Germany
 
 
 
Sitz und Registergericht/Domicile and Court of Registry: Hamburg; HRB-Nr./Commercial Register No.: 126569 
 
Vorsitzender des Aufsichtsrates/Chairman of the Supervisory Board: Dirk Lindberg
 
 
 
Vorstand/CEO: Ulrike Parson
 
Phone: +49 40 7200 500-0
 
E-Mail: 
 
Web: http://www.parson-europe.com
 
 
 
The information contained in this message is confidential and may be legally privileged. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, dissemination, or reproduction is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message.