Home Forums DITA and XMetaL Discussion assigning Id Reply To: assigning Id

Derek Read

Reply to: assigning Id

If you are authoring DITA documents then the topic element (which is reference for reference topics, task for task topics, etc) has id as a required attribute so to make your document valid you must set a value for this attribute.

There is no prescribed format for the id other than the fact that it is declared as an ID and should therefore follow the XML recommendation for ID values (see http://www.w3.org/TR/REC-xml/#sec-attribute-types). Because this is the only element that declares its id attribute as type ID you generally don't need to worry about it being unique. All other DITA elements declare their id attributes as CDATA. So, the only time you need to make an id unique is if you have multiple topics in the same file (which is generally considered bad DITA style and to be avoided). In that case each topic element must have a unique id value.

If you are authoring DITA documents using XMetaL Author Enterprise and you do not want to manually create your own id values you should leave the default settings for the DITA “auto-id” feature enabled. In XMetaL Author Enterprise 6.0 through 8.0 you can turn it back on in the DITA Options dialog:

1. Select Tools > DITA Options
2. On the General tab check the box labeled “Auto-assign element IDs”

See the help topic on “DITA Options” for more information on this feature.

Reply

Products
Downloads
Support