cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

DCF: Specify whether an AttributeOption is intended as global or element-specific option

DCF: Specify whether an AttributeOption is intended as global or element-specific option

DCF (Doctype Configuration Files) allow us to specify certain traits that should help a user in writing their content.

One of them is the element <AttributeOption> which - amongst others - allows us to hide an attribute from being displayed in both the structure view and the attribute window (for example to prevent the user from filling out unnecessary fields which aren't being used, or even to make sure they use the correct field if multiple ones with similar names are present).

 

This element allows one of two behaviors:

  1. The option is applied globally; no matter where the attribute appears.
  2. The option is applied to a list of specified elements, to be even more precise where certain attributes are shown/hidden.

Currently, picking one mode over the other is done by adding the child element <ElementListItem> and specifying the element name (as many times as there are elements).

 

However, this list is checked against the DTD or XML Schema of the document, effectively removing any <ElementListItem> occurrences for elements that do not appear in the document type.

In the worst case scenario, none of the elements appears in the DTD/XSD and the option intended as being element specific is now treated as global; applying to every single occurrence of the attribute.

Reproducing this is as easy as creating an <AttributeOption> with a single <ElementListItem> that has its element name mis-spelled.

This effectively prevents us (and some of our customers) from creating a common DCF module that is reused across multiple document types and intends to provide a complete list of options (in a single place) across a set of document types of the same standard (such as DITA, S1000D or others), as there is bound to be a document type where none of the elements listed exist.

 

We reported this as issue in Case C15140270, but unfortunately got the response that this is currently working as designed and may even break someones usecase if it were changed.

 

Due to that, we're proposing a new optional attribute on <AttributeOption> to specify the desired intended behavior. Not sure which one will be the most sensible option (so please leave a reply if you have an opinion; or an alternative way of specifying this), but those are the ones we thought up:

  • <AttributeOption onlyForDefinedElements="yes">: possible values are "yes" and "no" (default)
  • <AttributeOption application="element">: possible values are "element" (or perhaps "element-list") and "global" (default)
  • <AttributeOption ignoreWhenElementListIsEmpty="yes">: possible values are "yes" and "no" (default)

When set, and the list of <ElementListItem> converges on an empty list, the <AttributeOption> is effectively considered to not apply anywhere (instead of applying everywhere). For backwards-compatibility, this option defaults to the equivalent of using a global option.

5 Comments
plutsky
12-Amethyst
Status changed to: Under Consideration

Thanks for filing the idea.  

I agree that the best way to handle this is to add a optional attribute on <AttributeOption>.  We will try to include this in a future release.

plutsky
12-Amethyst
Status changed to: Implementation In Progress

We were able to address this in Arbortext Editor 8.1, due out in October, 2020.

 

The AttributeOption element will be applied to elements in ElementListItem regardless of whether the Element in the ElementListItem is in the doctype.

This should allow you to create the common DCF module that is used for multiple doctypes.

EmanuelW
4-Participant

Thanks!

plutsky
12-Amethyst
Status changed to: Current Functionality
 
plutsky
12-Amethyst
Status changed to: Delivered