Page 1 of 1

My reusable component element suddenly went awry

Posted: Fri Mar 15, 2019 2:27 am
by Carl
This is a tricky one to explain, but I'll do my best. In my project, we have resource files that contain reusable components for things like our company name, product name, etc. Until now, this feature has been rock solid: when I insert the variable from the DITA Reusable Components window, it works.

Fast forward to the most recent topic I wrote. In that topic, I inserted my product name several times. The correct reference is this:

Code: Select all

<ph conkeyref="strings-prods/phemi-central"/>
I then PDF'd my project and was drawn to this one error that it claimed it couldn't resolve "strings-prods". I checked the PDF output and sure enough, some of my references were blank, a telltale sign that it could not resolve the reusable component. But the strange this, only some of the references are bad! The first few in the topic are correct, while the latter bunch mysteriously took on this form:

Code: Select all

 <ph conkeyref="data-sources.strings-prods/phemi-central"/>
I have no idea where the data-sources prefix came from! It's not in any other topic where the reference works. BUT, when I try inserting the variable in several different topics, they all get inserted with that prefix!

Any ideas how things can suddenly change like this?

Re: My reusable component element suddenly went awry

Posted: Fri Mar 15, 2019 8:34 am
by Radu
Hi Carl,

Oxygen does not automatically change content that you have not edited yourself. If you have colleagues you may want to ask them if they changed anything. A construct like this "data-sources.strings-prods" usually indicates a reference to a key definied in a DITA key scope.
If you open the main DITA Map in the DITA Maps Manager view and use the "Validate and check for completeness" toolbar action does it report these broken conkeyrefs?


Re: My reusable component element suddenly went awry

Posted: Wed Mar 20, 2019 9:32 pm
by Carl
I think I've figured it out. The "correct" product name strings are inserted when "Root map = <current map>". The "incorrect" strings are inserted when I set root map to another ditamap.

I inherited this project where the previous writer created an "overall" ditamap that included both our user guides, as well as separate ditamaps for each individual user guide. I think this was done to accommodate how the "overall" one was meant for creating WebHelp, while the individual ones were for creating PDF. It's all very confusing.

I originally thought that the root map should always be set to the "overall" ditamap, as things seemed to work fine with that. Then I stumble across this issue.

So I think this problem arose when some reuse components were inserted when the root map was set to "<current map>", while others were inserted when root map was set to the "overall" ditamap. The "overall" version added the extra "data_sources." prefix that causes the problems.