Page 1 of 1

Figure and Table cross-references

Posted: Fri Oct 31, 2014 12:53 am
by Lachlan_Murray
Hi,

I'm using Oxygen 16.0 to output HTML WebHelp from DITA.

I'd like the Figure and Table cross-reference links in the text of the Help topics to say "Figure #" or "Table #" rather than repeat the actual title of the figure or the table. Is there a way to do that?

For example, I'd like "Figure 3 shows the user interface." rather than "User interface shows the user interface." We're moving from FrameMaker/Eclipse Help to Oxygen/WebHelp and all our content is written to assume figure and table cross-references use "Figure #" or "Table #", not the actual text of the figure and table titles.

Thanks for any help you can provide.

Re: Figure and Table cross-references

Posted: Mon Nov 03, 2014 7:03 pm
by sorin_ristache
Hi,

Sorry, this can't be done in the DITA WebHElp transformation or in the DITA XHTML transformation, because these transformations do not create a continuous sequence with all the content so that the position of each figure can be known in the overall sequence (like: the first figure/table in the complete sequence with all figures/tables, the second figure/table in the complete sequence, etc). Each DITA XML topic file is processed individually so the position of a figure can be known only relative to the start of that topic, not relative to the start of the DITA map.

Re: Figure and Table cross-references

Posted: Mon Nov 03, 2014 7:50 pm
by Lachlan_Murray
sorin wrote:Each DITA XML topic file is processed individually so the position of a figure can be known only relative to the start of that topic, not relative to the start of the DITA map.
Actually, that's all I need. I just want cross-references to Figures and Tables to be inserted and numbered within the context of individual DITA topics. So, for example:

DITA topic 1

... Figure 1 shows...
... Figure 2 shows ...

DITA topic 2

... Figure 1 shows ...
... Figure 2 shows ...

Being able to insert cross-references that use "Figure #" and "Table #", instead of the actual text of the figure and table titles, would save us a lot of re-work. If we can't do that, one option would be to manually type in "Figure #" and "Table #" cross-references, which is a bad workaround, because then the cross-references wouldn't dynamically update. Or we'd have to rewrite numerous sentences in our Help system to use the figure and table titles instead of "Figure #" or "Table #".

I guess another option is to go back to outputting Eclipse Help, which does allow "Figure #" and "Table #" to be used instead of the title text. But there are features of WebHelp that we like, so we're hoping to move away from Eclipse Help.

Re: Figure and Table cross-references

Posted: Thu Nov 06, 2014 11:47 am
by sorin_ristache
I think it could be done but you need to customize the stylesheets of DITA-OT that create the XHTML pages. You can start from the stylesheet OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.xhtml\xsl\dita2xhtml.xsl. This file is used in the WebHelp transformation so if you modify the figure and table references in this stylesheet the result will be visible in the WebHelp pages.

Re: Figure and Table cross-references

Posted: Fri Nov 07, 2014 7:35 pm
by Lachlan_Murray
Thanks Sorin,

I thought it might involve modifying some of the XSL. You've pointed me in the right direction. Now I just have to learn something about XSLT.