DITA and XMetaL Discussion
XMetaL Community Forum › DITA and XMetaL Discussion › Possible to use conditions for different chapters of same book?
1023 June 8, 2010 at 5:34 pm
Possible to use conditions for different chapters of same book?June 8, 2010 at 5:34 pmParticipants 3Replies 4Last Activity 12 years, 9 months ago
I'm creating a bookmap in DITA. Several of the chapters reuse much of the same content, but each chapter is specific to a different product, so only one or two words change.
For example, a paragraph in chapter 1 may say, “The X card is based on the following items.” Chapter 2 has the same sentence, but lists a different product name, “The Y card is based on the following items.”
I've used conrefs for as much of the text as possible, but I'm wondering if there's a way to add conditions for the few words that differ. I'm only familiar with conditions being used for multiple book outputs, and am not sure if there's a way to specify text to output with certain chapters of the same book output.gcrews June 8, 2010 at 8:51 pm
Reply to: Possible to use conditions for different chapters of same book?June 8, 2010 at 8:51 pm
Sounds like the same issue I had about a month ago when I needed to conditionally process different things in same deliverable. I asked on the dita-users forum and got a bunch of good feedback.
What I ended up doing was to create a build run that first compiles a map though a new target I created that filters the content with a datival. The filtered xml files get placed in a folder where I can then run my final compile on and it will pull in the conditionally processed files into the final. It’s a bit of a kluge but it works for us for the current time being. It seems like dita 1.2 may have some ways to get this done.
Here is the target I made that just filters the files and copies any referenced images:
1023 June 9, 2010 at 1:21 pm
Reply to: Possible to use conditions for different chapters of same book?June 9, 2010 at 1:21 pm
Thanks for the suggestion! I'll give it a try.Derek Read June 9, 2010 at 6:40 pm
Reply to: Possible to use conditions for different chapters of same book?June 9, 2010 at 6:40 pm
I think very likely the ultimate solution to this (assuming I understand what is described here) is the DITA 1.2 “keyref” attribute and associated functionality. A few things need to fall into place before that can be done though, with the DITA OT being the main one obviously.
If you want to work on the bleeding edge (and perhaps ideally you also have a second computer or virtual machine you can muck around with) you might check this out: http://forums.xmetal.com/index.php/topic,747.0.html
I'm not sure what the support in the DITA OT that comes with that is like for “keyref”, but as far as editing is concerned you get the 1.2 version of the DTDs. This “configuration kit” doesn't add any special UI helpers for inserting the new 1.2 stuff, so you will be working in the Element List and Attribute Inspector when it comes to that.Su-Laine Yeo June 16, 2010 at 6:20 pm
Reply to: Possible to use conditions for different chapters of same book?June 16, 2010 at 6:20 pm
I don't think the DITA 1.2 keyref feature, or any other feature of DITA 1.2, would be of use for this particular scenario. The draft DITA 1.2 spec says, “A root map and its directly addressed, local scope descendant maps establish a unique key space within which each unique key name has exactly one binding to a set of resources.” In other words, you can't define a key in different ways for different chapters within a bookmap.
I did some testing with DITA Open Toolkit 1.5 and its behaviour was consistent with what the spec says. The ideas that gcrews suggests are your best bet.
- You must be logged in to reply to this topic.