com.elovirta.ooxml
com.elovirta.ooxml copied to clipboard
Link text for Xref links to topics is not resolved
I have a DITA topic looking like this:
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="introduction">
<title>Introduction</title>
<body>
<p>This is it <xref href="#topic_tnd_j4h_kz" format="dita"/></p>
</body>
<topic id="topic_tnd_j4h_kz">
<title>Second topic</title>
</topic>
</topic>
When publishing to Word the xref is not properly resolved, you end up in the Word document with "Error! Reference source not found." errors. XHTML and PDF output formats properly work.
Actually it seems that even for xref's to other topics like:
<xref href="someOtherTopic.dita"/>
the title of the link does not appear in the Word document, only the index of the referenced topic appears.
It seems that during conversion always the numeric reference _Num...
is chosen. Also if no header numbers are in use (like in the first example) - in which case the respective numeric reference does not exist and therefore Word complains.
However the general reference _Ref...
seems to exist at all times, so I fixed this problem for me by changing $bookmark-prefix.num
to $bookmark-prefix.ref
in /docx/word/document.link.xsl
(line 242 of 152bf51). The link text is then of course the clause name and not the respective header number.
It seems that during conversion always the numeric reference
_Num...
is chosen. Also if no header numbers are in use (like in the first example) - in which case the respective numeric reference does not exist and therefore Word complains.However the general reference
_Ref...
seems to exist at all times, so I fixed this problem for me by changing$bookmark-prefix.num
to$bookmark-prefix.ref
in/docx/word/document.link.xsl
(line 242 of 152bf51). The link text is then of course the clause name and not the respective header number.
Thanks very much. I also encountered this problem, and fixed by your method. Does this method have any side effect?
It is some time ago that I used the plugin and applied the described fix. While I'm not 100% sure, I currently don't recall any problems though.
👍 One more report here: https://www.oxygenxml.com/forum/viewtopic.php?f=20&t=20057
👍 One more report on the same Oxygen forum post.