Reply to: Hide elements and attributesSeptember 22, 2014 at 5:18 pm
If an element or attribute can be legally inserted at the current position in the document according to the schema (in this case a specialized DITA DTD) then the Element List and Attribute Inspector will show it.
We have APIs that allow you to manage what is displayed in the Element List and the Attribute Inspector. Usually using these to hide elements that are allowed in a DTD is not the best approach (the best approach is to rewrite the DTD), however, it may be the only approach for DITA due to the way DITA specialization works.
Please see the XMetaL Developer Programmers Guide.
The relevant topic for the Element List is “When the element list changes”. There are a few different events you may use to alter what it contains, but the main one is On_Update_ElementList.
To hide attributes you use the HideInAttributeInspector() method. Most likely you would need to have this inside On_Update_UI event (there is no specific event tied directly to the Attribute Inspector like there is for the Element List).
Note that hiding these things will not completely stop an author from inserting them since they are still allowed according to the DTD. However, in order for an author to insert them when they are hidden in the Element List or Attribute Inspector they would need to paste them in after copying them from another document or enter them into Plain Text view.