DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Outputclass dropdown options?

  • rweiser

    Outputclass dropdown options?

    Participants 3
    Replies 4
    Last Activity 13 years, 6 months ago


    We've set up a number of outputclass options and are wondering if there's a way to set up a dropdown for the outputclass attribute with a list of all the available options. Anyone have any experience with this?

    Reuven Weiser
    Suite Solutions


    Derek Read

    Reply to: Outputclass dropdown options?

    One option (arguably the best and most proper solution) is to specialize DITA, changing this attribute from CDATA to an enumerated list. XMetaL Author displays a dropdown list in the Attribute Inspector for any attributes that are defined as an enumerated list. Specialization isn't a trivial task though, and you may not want (or be allowed by your organization) to specialize DITA for this purpose.

    The Hack
    If you don't want to specialize, there's a hack for this. This really is a *hack* though and I really want to stress that. Many users will be confused (possibly very confused) by this solution, but it might be better than nothing for some people (if you have a small group and everyone knows it is a hack, or perhaps just for yourself).

    The solution is to piggyback on the Conditional Text feature. This feature is meant to be used for Conditional Text only, but because of the way it was written it is possible to configure it to work with any attribute, with some limitations (as noted below).

    Follow the instructions in the Help topic “Working with conditions” where it talks about the “Condition configuration file” named ctconfig.xml. Instead of modifying the values for the conditional text attributes (audience, platform, product, otherprops) you can add a new section for any other attribute along with your preferred values.


    Probably Confusing for Many People
    The most confusing part of this solution is that to set these values while editing you do it through the Conditional Text dialog. So, if you set this solution up for anyone else you will probably want to explain that this is a hack. Also note that this doesn't change the fact that the attribute will still be CDATA in the DTD, so you will still be able to enter any valid CDATA value via the Attribute Inspector and the document will still be valid. This hack just makes it a little more convenient to select from a list than it is to type values in from memory.

    The second confusing part of this is that the Conditional Text dialog displays checkboxes because the conditional text attributes (audience, platform, product, otherprops) can contain multiple values that are delimited by a space. When the DITA OT deals with the outputclass attribute it treats the entire attribute as single value. In this case radio buttons would make the most sense but there's no way to configure this dialog to do that (without modifying the source code) so you'll have to remember to select only one value. Remember, this is a hack. (have I stressed that enough?)

    The Future
    On behalf of people like yourself I'm arguing for a feature that would be a proper solution to aid setting this and other attributes. The problem with DITA is that almost all attributes are defined as CDATA (primarily because it makes specialization possible, but also because people need to be able to make up their own values for many things like outputclass), but at the same time people want to standardize on a given set of values AND they don't want to specialize. Such a feature would not completely restrict the allowed values, it would just help people select what you consider to be your preferred values. To restrict which values are allowed you really should consider specializing the DITA DTDs so that proper validation can be done by XMetaL Author and other validating XML parsers.


    Derek Read

    Reply to: Outputclass dropdown options?

    In response to this post I've created an example of what might be done to support this need here: http://forums.xmetal.com/index.php/topic,393


    Su-Laine Yeo

    Reply to: Outputclass dropdown options?

    If you have a small number of outputclass values (e.g. 5 or fewer), another reasonable option may be to set up a macro to assign each outputclass value. If you have 5 possible values of outputclass, you will need 5 macros, or possibly more depending on whether you have fancy rules about what values of outputclass can go on what element types.

    This tutorial should give you an idea of what's involved: http://forums.xmetal.com/index.php/topic,395.0.html .



    Reply to: Outputclass dropdown options?

    I have developed a customization, basically a form which displays values for outputclass based on element selected.

    The outputclass attribute in the Attribute Inspector is controlled using the “ellipses” button feature in 5.5 and through some custom validations, so that user can enter the only permissible values on the elements and only through the form. Anything which is typed in the Attribute Inspector is validated and ignored and user is presented with the form for selection.



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

Lost Your Password?