XMetaL Tips and Tricks
Su-Laine Yeo March 1, 2011 at 12:16 am
DITA: Adding attributes for conditional textMarch 1, 2011 at 12:16 amParticipants 0Replies 1Last Activity 11 years, 11 months ago
Products: This topic applies to XMetaL Author Enterprise.
Issue: By default, the DITA 1.1 standard includes five attributes which can be used for conditional text: @audience, @product, @platform, @otherprops, and @props. Due to [url=http://sourceforge.net/tracker/?func=detail&atid=725074&aid=3030317&group_id=132728]a bug[/url] in the version of the DITA Open Toolkit which is included in XMetaL Author Enterprise 6.0, the @props attribute doesn't work when generating output.
For some DITA users, four conditional text attributes are not sufficient, and for some five wouldn't be sufficient either. This topic describes options for adding more conditional text attributes which will work when generating output.
Adding new attributes is a form of DITA specialization. Before you use the new attributes in a production system, make sure that all of your required tools can use specialized DITA DTDs, including your content management system, publishing system, and translation management system.
Option 1: Use the free DITA 1.1 Conditional Text Extension Pack which is attached to this post. This package will give you five additional attributes, with names “otherprops2”, “otherprops3”, “otherprops4” etc., for all base DITA topic and map types in DITA 1.1. The five new attributes will be available for all element types which can have the base conditional attributes.
You can configure XMetaL to use more meaningful names for your condition types through the ct_config.xml file in C:Program FilesXMetaL 6.0AuthorConditional Text. For details, see http://na.justsystems.com/webhelp/en/xmetalauthor/enterprise/6.0/XMEE.html#Conditional%20text.
This extension pack will work only with DITA 1.1 DTDs, however a version that will work with DITA 1.2 DTDs is available [url=http://forums.xmetal.com/index.php/topic,1233.0.html]here[/url]. We have tested the extension pack with the version of the DITA Open Toolkit that is included with XMetaL 6.0.1, and expect that it would work for most other versions as well.
Option 2: Add meaningfully-named attributes to the base DITA DTDs. Use the DITA 1.1 Conditional Text Extension Pack, and its installation instructions, as a model for adding attributes with meaningful names instead of “otherprops#”. Choose this option only if you are confident with editing DTD files.
Option 3: Add either generically-named or meaningfully-named attributes to local shell DTDs, using the tutorial here: http://www.xiruss.org/tutorials/dita-specialization/body/part-config-and-extend/tutorials/attribute-domain/domain-att-spec-process.html. You might also want to refer to the DITA 1.1 Conditional Text Extension Pack as a model. This option requires the most experience with editing DTD files, however if you need to share your content with other teams which have extended DITA in different ways, this option will probably be easiest to manage in the long term.
Installing the DITA 1.1 Conditional Text Extension Pack
1) Download and unzip the attached dita11_conditional_extension_pack.zip file.
2) Exit XMetaL Author Enterprise.
3) Back up the following folders. Then copy the contents of the “DTDs” folder to all of the following folders, accepting all prompts to overwrite files:
- C:Program FilesXMetaL 6.0AuthorDITADITA_OT_DTD
- C:Program FilesCommon FilesXMetaL SharedDITA_OTdtd
- %APPDATA%SoftQuadXMetaL SharedDITA_OTdtd if it exists. ([url=http://forums.xmetal.com/index.php/topic,1231.msg3946.html#msg3946]What is the %APPDATA% folder?[/url]) If this folder does not exist, you don't have to copy the files into it. However, if the folder exists but is hidden on your system, you must arrange to have it un-hidden and then copy the files into it.
4) Open the C:Program FilesXMetaL 6.0AuthorConditional Textconfigsct_config.xml file in a [url=http://forums.xmetal.com/index.php/topic,955.0.html]text editor[/url].
5) Add rows to the ct_config.xml file for the new attributes. An example is provided in the attached ct_config.xml file.
6) Start XMetaL and open a DITA topic. You should see the five new attributes in the Attribute Inspector for all types of elements that have the @audience, @platform, and @product attributes. If you don't, you might need to [url=http://forums.xmetal.com/index.php/topic,1165.0.html]clear rules files from the cache[/url].
After installing the extension pack, here is how the Attribute Inspector will look for a
element in a DITA topic:
Here is how the “Show/Hide Conditional Text” dialog will look if the sample ct_config.xml file in the extension pack is used:
We'll be demonstrating the DITA 1.1 Conditional Text Extension Pack, and the options described above, in a free webinar on March 17: http://forums.xmetal.com/index.php/topic,1228.0.html .Su-Laine Yeo April 14, 2011 at 12:44 am
Reply to: DITA: Adding attributes for conditional textApril 14, 2011 at 12:44 am
I just replaced the attachment for this post with a newer version. The new version has the following changes:
– Added map.dtd, bookmap.dtd, glossary.dtd and ditabase.dtd files so you can use the new otherprops# attributes in these document types
– Moved attribute declarations from the “Domain entity declarations” part of the DTD files to the “Domain attribute declarations” section. This change should not make a practical difference, but makes the files easier to read.
- You must be logged in to reply to this topic.