On 10/14/24 00:01, Jirka Kosek wrote:

I've encountered strange behaviour of DITAC that seems to me as a bug in filtering when attribute groups are used.

Consider that map includes topic by:

<topicref href="topic-for-group-B.dita" audience="group(B)"/>

Now lets consider that I want to include only topics belonging into group A. I will use the following .ditaval file

<val>
   <prop action="exclude" att="group"/>
   <prop action="include" att="group" val="A"/>
</val>

However topic topic-for-group-B.dita is included. It seems that exclude for group in .ditaval is ignored.

If I will modify .ditaval to exclude all profiling attributes and groups instead, filtering works correctly:

<val>
   <prop action="exclude"/>
   <prop action="include" att="group" val="A"/>
</val>

Filtering works correctly also if I will directly reference profiling attribute instead of attribute group in .ditaval as:

<val>
   <prop action="exclude" att="audience"/>
   <prop action="include" att="group" val="A"/>
</val>

So to me it seems that following is being ignored by ditac:

   <prop action="exclude" att="group"/>

Seems like attribute groups are not honored for exclusions in ditac. My understading of DITAC specs is that this should work and DITA-OT also support this -- and produces different output than DITAC when filtering is applied in this way.

Many thanks in advance for looking into this issue.

The issue you describe seems to come from a possible ambiguity in "Darwin Information Typing Architecture (DITA) Version 1.3 Part 2: Technical Content Edition (OASIS specification)", "2.4.3.2 Filtering", http://docs.oasis-open.org/dita/dita/v1.3/errata02/os/complete/part2-tech-content/archSpec/base/filtering.html

---
In more advanced usage, a DITAVAL can be used to specify a rule for a group name. For example, an author could create a DITAVAL rule that sets product="database" to "exclude". This is equivalent to setting a default of "exclude" for any individual value in a database() group; it also excludes the more common usage of "database" as a single value within the @product attribute. Thus when "myDB" appears in a database() group within the @product attribute, the full precedence for determining whether to include or exclude the value is as follows:

    1. Check for a DITAVAL rule for database="myDB"
    2. Check for a DITAVAL rule for product="myDB"
3. Check for a DITAVAL rule for product="database" (default for the database group) 4. Check for a DITAVAL rule for "product" (default for the @product attribute) 5. Check for a default rule for all conditions (default of include or exclude for all attributes)
    6. Otherwise, evaluate to "include"
---

There are 2 ways (A) and (B) to implement step #3.

With method (A), currently implemented by ditac, you must specify in your DITAVAL:
---
<val>
  <prop action="exclude" att="audience" val="group"/>
  <prop action="include" att="group" val="A"/>
</val>
---

With method (B), NOT implemented by current version of ditac, hence your issue, you must specify in your DITAVAL:
---
<val>
  <prop action="exclude" att="group"/>
  <prop action="include" att="group" val="A"/>
</val>
---

In our opinion, the spec corresponding to method (A) matches quite well the above explanation as found in the DITA spec and also is easier to understand (however we have no idea if it also works in DITA-OT; we don't use the DITA-OT as a reference, only the the DITA spec).

Anyway, as of v3.16 (to be released), ditac supports both (A) and (B).

Meanwhile, the spec corresponding to method (A) may be used as a (very clean) workaround for your issue.





--
XMLmind DITA Converter Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/ditac-support

Reply via email to