Customize Content with DITA Conditional Text Part 2: How to Add Custom Conditional Attributes1. in 37 minutes
Episode 18
Customize Content with DITA
Conditional Text Part 2: How to Add
Custom Conditional Attributes
Su-Laine Yeo, Solutions Consultant
March 2011
© 2011 JustSystems
2. Agenda
• Today‟s slides are on
http://www.slideshare.net/XMetaL
• What‟s new at JustSystems
• Custom conditional text attributes:
– Quick review of conditional text functionality
– Who needs custom attributes?
– How do they work?
– How do I get them set up?
© 2011 JustSystems
3. What’s new
• JustSystems employees and offices in Japan are OK
• XMetaL Author Enterprise – SP Edition 6.0 is available
– https support, Sharepoint 2010 support, and more
• Service pack for XMetaL Author and XMAX 6.0 will be
ready late this month
• Upcoming conferences:
– Content Management Strategies/DITA North America: Baltimore,
April 4-6
– Mark Logic: San Francisco, April 26-29
© 2011 JustSystems
4. Review: Conditional text in DITA
“Conditional text” refers to:
• The practice of marking up the content in a single
source file, so you can create deliverables with different
subsets of the file.
• The content that is marked up so you can filter it out of
some deliverables. In DITA, conditional "text" can be
words, images, tables, index markers, links, etc.
© 2011 JustSystems
5. Conditional text
• Marking up the content in a single source file, so you can
create deliverables with different subsets of the file.
• E.g. Windows-only content (Ctrl+S) and Macintosh-only
content (Command+S)
© 2011 JustSystems
6. Under the covers: XML
• A paragraph that is not conditional:
<p>Press Ctrl+S.</p>
• A paragraph that applies to the Windows platform only:
<p platform = "windows">Press Ctrl+S.</p>
attribute attribute value
© 2011 JustSystems
7. Five predefined attributes
• Only four conditional text attributes work
in DITA Open Toolkit version 1.4:
– product
– platform
– audience
– otherprops
• One additional attribute works after a bug fix in
DITA Open Toolkit 1.5.2 M2:
– props
© 2011 JustSystems
8. Adding attribute values is easy
<p platform = "windows">Press Ctrl+S.</p>
attribute attribute value
• You can have as many values as you want for
any of the 5 predefined attributes
• But.... adding attributes is a lot harder
© 2011 JustSystems
9. What if you have…
• Products: Model100, Model200, Model300
• Platforms: Windows, Macintosh, Linux
• Editions: Standard, professional
• States: Hawaii, California, New York
• Roles: Teacher, Student
• Measuring systems: Metric, Imperial
…oops, 6 attributes already
© 2011 JustSystems
10. Possible approach 1:
Overload attributes
• audience = “Hawaii student”
• audience = “New York”
• audience = “Metric”
Problem: It won‟t work.
© 2011 JustSystems
11. Possible approach 2:
Use other attributes
• Some tools allow you to filter output using any
attribute, e.g. “rev” and “base”
• Caution: Are you sure you don‟t want to use
these attributes for something else?
• Caution: Do you want to commit to doing all your
publishing through these tools?
© 2011 JustSystems
12. Recommended approach:
• Add new attributes to the DITA DTDs
– Requires writing and modifying DTD files
– Each new attribute must be declared as a
specialization of the “props” attribute
• Good news: New extension pack makes it easier
– Unzip package and drop files into place
– Get 5 attributes named “otherprops2” “otherprops3”
etc.
© 2011 JustSystems
13. Demo: DITA 1.1
Conditional Text Extension Pack
Free download from the XMetaL Community
Forums:
– http://forums.xmetal.com/index.php/topic,1225.0.html
Drop DTD files in the right places
© 2011 JustSystems
14. Caution: Commitment ahead!
• Once you use the new “otherprops#” attributes,
your content will no longer validate against the
base DITA 1.1 DTDs
• All writers and translators will need to install the
Extension Pack
• Make sure you can configure all your tools to
use the DTDs in the Extension Pack
• Consider setting up “local shell” DTDs
© 2011 JustSystems
15. Want to modify DTDs yourself?
• Needed if you want the attributes to have meaningful
names, or need more than 5 new attributes
• Follow the tutorial here:
– http://www.xiruss.org/tutorials/dita-specialization/body/part-config-and-
extend/tutorials/attribute-domain/domain-att-spec-process.html
• Read the section on “Attribute domain specialization
pattern” here:
– http://docs.oasis-open.org/dita/v1.1/OS/archspec/dtdmod.html
© 2011 JustSystems
16. DITA 1.2 Conditional Text
Extension Pack
For DITA 1.2, everything is the same except:
• Download and install the XMetaL DITA 1.2 Configuration
Kit first
– Free for XMetaL customers on maintenance (contact your
account manager, or me at syeo at justsystems dot com)
• Drop files into the “DITA_OT1.5” folder instead of the
“DITA_OT” folder
© 2011 JustSystems
17. Support for the Extension Packs
• Usage in XMetaL Author Enterprise is supported
by JustSystems
• Licensing terms allow use in other tools
– With the standard disclaimer that these files may not
be perfect. Use at your own risk.
• There is a proposal to have the 5 new
“otherprops#” attributes be part of the DITA 1.3
standard
© 2011 JustSystems
18. Summary
• Conditional text = excellent way to produce customized
documents which reflect audience variations and product
variations
• Know the difference between adding attribute values
and adding attributes
• To add attributes, either modify DTD files, or install the
DITA 1.x Conditional Text Extension Pack
• Use the ct_config.xml file in XMetaL Author Enterprise to
display meaningful names
© 2011 JustSystems
19. About JustSystems
• Global Presence 2,500 Customers,
Marquee Brands
– 1,000 employees, „07 revenues of $110M
– HQ in Japan; Corporate Offices in Vancouver
and London; Sales Offices Worldwide
• Our Experience
– Established in 1979
– Market leader with over 2,500 customers
• Our Expertise
– Global provider of office productivity, information
management, consumer & enterprise software
– Framework for XML-based content creation,
integration, visualization and delivery
• Our Credibility
– eContent 100 member in 2009
– KMWorld Trend-Setting Product Award 2009
– KM World “100 Companies that Matter” 2010
© 2011 JustSystems
20. Global Customers
High-Tech Automotive Aerospace
Publishing Financial Other
© 2011 JustSystems