Pages: 1
Print
Author Topic: DITA: Adding attributes for conditional text  (Read 5443 times)
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« on: February 28, 2011, 06:16:19 PM »

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 a bug 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 Files\XMetaL 6.0\Author\Conditional 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 here. 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 Files\XMetaL 6.0\Author\DITA\DITA_OT_DTD
  • C:\Program Files\Common Files\XMetaL Shared\DITA_OT\dtd
  • %APPDATA%\SoftQuad\XMetaL Shared\DITA_OT\dtd if it exists. (What is the %APPDATA% folder?) 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 Files\XMetaL 6.0\Author\Conditional Text\configs\ct_config.xml file in a text editor.
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 clear rules files from the cache.

Screenshots
After installing the extension pack, here is how the Attribute Inspector will look for a <p> 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:



Webinar
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 .

* dita11_conditional_extension_pack_April2011.zip (22.17 KB - downloaded 308 times.)
« Last Edit: January 19, 2012, 01:36:22 PM by Derek Read » Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
Su-Laine Yeo
Solutions Consultant
Member

Posts: 260


« Reply #1 on: April 13, 2011, 06:44:16 PM »

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.
Logged

Su-Laine Yeo
Solutions Consultant
JustSystems Canada, Inc.
Pages: 1
Print
Jump to:  

email us