DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Hide elements and attributes

  • bjorn

    Hide elements and attributes

    Participants 0
    Replies 1
    Last Activity 8 years ago

    Hi.

    After dita specializing many of the standard dita elements and attributes is showing in the Element list and Attribute inspector,
    and we don't want our authors to insert these elements or edit these attributes.

    Is it possible to hide some of the elements and attributes from the Element list and Attribute inspector in XMetaL 9.0?
    Or do I have to remove the element from my element/attribute specialization files?

    Thanks!

    Bjorn

    Reply

    Derek Read

    Reply to: Hide elements and attributes

    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.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support