OASIS Darwin Information Typing Architecture (DITA) TC

 View Only

Follow-up on ditaval group processing

  • 1.  Follow-up on ditaval group processing

    Posted 08-25-2025 16:24

    I had an action item to follow up on this email to the comment list:

    https://groups.oasis-open.org/discussion/question-about-ditaval-1

     

    The email is asking about this example topic in the "Conditional processing" section of the architectural spec:

    https://dita-lang.org/dita/archspec/base/example-ditaval-groups

     

    Specifically, the question is about item 3 in the list at the bottom, on how to evaluate the include/exclude behavior for groups within filter attributes. In this example, the content uses groups (which are also the "generalized" form of a specialized attribute). Focusing on just the "database" group, the sample input is:

    <li product="database(dbOne dbOther)">

     

    Per the rules in the example, when deciding how to evaluate the token "dbOne", you first check for explicit rules, then general rules:

    1. Check for a DITAVAL rule for database="dbOne"
    2. Check for a DITAVAL rule for product="dbOne"
    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"

    I think Chris is right that item three in that list is only documented in this example. But I also think the example is trying (incorrectly) to describe something we do document. Like Chris I'd interpret number three as being thi sort of rule:

    <prop action="exclude" att="product" val="database"/>

     

    Based on this example topic, this DITAVAL rule has two meanings:

    1. The single value "database" inside of a product attribute evaluates to "exclude". This is the original DITAVAL behavior going back to DITA 1.0, it means product="database" evaluates to "exclude".
    2. It also means that any attribute group named "database", when found inside of the product attribute, defaults to "exclude" if other more specific values are not set.

     

    But ... I don't think that's right. When you look at our description of the "prop" element in a DITAVAL, it already says that you can set up a default for they "database" group by treating it as an attribute name. That is in the second row of the table here, where it says that @att can be an attribute name or group name:

    https://dita-lang.org/dita/langref/ditaval/prop

     

    Groups like this are meant to be the generalized form of a specialized attribute. If we treat the group just as an attribute, I think it works to handle both conditions here – database as a group, and database as a specialized attribute. Based on that row, this rule would be the correct way to set up a default value for the database group:

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

     

    So – my recommendation is to fix this list in the current example to remove that product="database" code phrase, and instead change to this, which works for both groups and specialized attributes:

    1. Check for a DITAVAL rule for "database" (default for the database group)

     

    Thanks,

    Robert