DITA Map MS Office Word transformation scenario: resolving xref
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 42
- Joined: Wed Jun 20, 2018 11:30 am
DITA Map MS Office Word transformation scenario: resolving xref
Post by pieterjan_vdw »
The hyperlinks in Word do not work when I publish a bookmap with DITA Map MS Office Word transformation scenario. I get this error message: see Error! Reference source not found.
When I click on the hyperlink in MS Word, there's no link at all.
Below you find my dita content.
I link from one DITA file to another one.
Do I have to add extra attributes to get this work?
When I click on the hyperlink in MS Word, there's no link at all.
Below you find my dita content.
I link from one DITA file to another one.
Code: Select all
<p>You then see the <xref href="scherm_standby.dita" class="- topic/xref " format="dita"/> screen.</p>
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Hi,
I can reproduce the problem, actually I added an issue for it some time ago:
https://github.com/jelovirt/com.elovirt ... /issues/31
a possible fix you can try on your side, open the XSLT stylesheet OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\com.elovirta.ooxml\docx\word\document.topic.xsl, find the XSLT template:
and modify it like this:
Regards,
Radu
I can reproduce the problem, actually I added an issue for it some time ago:
https://github.com/jelovirt/com.elovirt ... /issues/31
a possible fix you can try on your side, open the XSLT stylesheet OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT3.x\plugins\com.elovirta.ooxml\docx\word\document.topic.xsl, find the XSLT template:
Code: Select all
<xsl:template match="*[contains(@class, ' topic/topic ')]/
*[contains(@class, ' topic/title ')]"
name="topic.title">
Code: Select all
<xsl:template match="*[contains(@class, ' topic/topic ')]/
*[contains(@class, ' topic/title ')]"
name="topic.title">
<xsl:variable name="depth" select="count(ancestor-or-self::*[contains(@class, ' topic/topic ')])" as="xs:integer"/>
<w:p>
<w:pPr>
<xsl:apply-templates select="." mode="block-style"/>
</w:pPr>
<xsl:call-template name="start-bookmark-number">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
<xsl:call-template name="start-bookmark">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
<xsl:apply-templates select="." mode="numbering"/>
<xsl:apply-templates/>
<xsl:call-template name="end-bookmark">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
<xsl:call-template name="end-bookmark-number">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
</w:p>
</xsl:template>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 42
- Joined: Wed Jun 20, 2018 11:30 am
Re: DITA Map MS Office Word transformation scenario: resolving xref
Post by pieterjan_vdw »
Thanks Radu. Works like a charm!
-
- Posts: 7
- Joined: Thu Aug 27, 2015 3:11 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Post by gilloxygen »
Hi, I'm hoping you can help me too as I have the same issue that my xrefs either show as Error! Reference source not found. or as the correct link text but it doesn't take you to the correct location (this depends on whether I select to update the fields when the Word doc opens).
I am on Oxygen 20.1 and have a DITA-OT2.x folder and the code is different in my file so I don't know what I need to change it to:
I am on Oxygen 20.1 and have a DITA-OT2.x folder and the code is different in my file so I don't know what I need to change it to:
Code: Select all
<xsl:template match="*[contains(@class, ' topic/topic ')]" mode="x:toc">
<xsl:param name="depth" select="count(ancestor-or-self::*[contains(@class, ' topic/topic ')])" as="xs:integer"/>
<xsl:param name="prefix" as="node()*"/>
<xsl:variable name="target" select="concat($bookmark-prefix.toc, generate-id())" as="xs:string"/>
<w:p>
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Hi,
Looking at the XSLT stylesheet:
Oxygen XML Editor/frameworks/dita/DITA-OT2.x/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
it seems to have that XSLT template I suggested you to change:
and it seems to have a similar content with the one in a DITA OT 3.x distribution.
Regards,
Radu
Looking at the XSLT stylesheet:
Oxygen XML Editor/frameworks/dita/DITA-OT2.x/plugins/com.elovirta.ooxml/docx/word/document.topic.xsl
it seems to have that XSLT template I suggested you to change:
Code: Select all
<xsl:template match="*[contains(@class, ' topic/topic ')]/
*[contains(@class, ' topic/title ')]"
name="topic.title">
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 7
- Joined: Thu Aug 27, 2015 3:11 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Post by gilloxygen »
Hi Radu, I can't get that to correct the issue, I still get the Error! Reference source not found. where the reference should be.
This is what my original file has:
So your sample also has:
and:
Do you have any other suggestions or is there likely something I've done wrong? I've tried this several times and checked back to ensure I have the correct version active, but get the same result each time.
Thanks.
This is what my original file has:
Code: Select all
<xsl:template match="*[contains(@class, ' topic/topic ')]/
*[contains(@class, ' topic/title ')]"
name="topic.title">
<xsl:variable name="depth" select="count(ancestor-or-self::*[contains(@class, ' topic/topic ')])" as="xs:integer"/>
<w:p>
<w:pPr>
<xsl:apply-templates select="." mode="block-style"/>
</w:pPr>
<xsl:call-template name="start-bookmark">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
<xsl:apply-templates select="." mode="numbering"/>
<xsl:apply-templates/>
<xsl:call-template name="end-bookmark">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
</w:p>
</xsl:template>
Code: Select all
<w:pPr>
<xsl:apply-templates select="." mode="block-style"/>
</w:pPr>
and:
Code: Select all
<xsl:call-template name="end-bookmark-number">
<xsl:with-param name="node" select=".."/>
</xsl:call-template>
Thanks.
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Hi,
I'm sorry but it's hard to try and determine what changes took place between two versions of a third party plugin we are bundling. The changes I originally gave should work with the DITA OT 3.x bundled with Oxygen 21.1.
Regards,
Radu
I'm sorry but it's hard to try and determine what changes took place between two versions of a third party plugin we are bundling. The changes I originally gave should work with the DITA OT 3.x bundled with Oxygen 21.1.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Hi,
We released Oxygen 22 which should have bundled inside its internal DITA OT publishing engine the changes we discussed.
Regards,
Radu
We released Oxygen 22 which should have bundled inside its internal DITA OT publishing engine the changes we discussed.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 24
- Joined: Tue Jun 14, 2022 1:08 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Hello,
the Word/docx output in version 24.1 ignores the section titles inside topics. So they become text with a Standard style in the output. As a result these chapters cannot get crossreferenced either.
I do not know how to handle this in the document.topic.xsl. In the code area regarding DITA sections, [<w:pStyle w:val="Subtitle"/> seems to be applied. But the sections do not even get the Subtitle style, only Standard. Also, I had exptected them to become headings as it is the case in all other transformation types. Could someone know more about this?
Kind regards,
im_rem
PS: I also tried the @chunk="to-content" on the map's root level but it does not make a difference in the Word output.
the Word/docx output in version 24.1 ignores the section titles inside topics. So they become text with a Standard style in the output. As a result these chapters cannot get crossreferenced either.
I do not know how to handle this in the document.topic.xsl. In the code area regarding DITA sections, [<w:pStyle w:val="Subtitle"/> seems to be applied. But the sections do not even get the Subtitle style, only Standard. Also, I had exptected them to become headings as it is the case in all other transformation types. Could someone know more about this?
Code: Select all
<xsl:template match="*[contains(@class, ' topic/sectiondiv ')]" name="sectiondiv">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="*[contains(@class, ' topic/section ')]" name="section">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="*[contains(@class, ' topic/section ')]/*[contains(@class, ' topic/title ')] |
*[contains(@class, ' topic/example ')]/*[contains(@class, ' topic/title ')]"
name="section.title">
<xsl:param name="contents" as="node()*">
<xsl:apply-templates/>
</xsl:param>
<xsl:param name="style">
<xsl:apply-templates select="." mode="block-style"/>
</xsl:param>
<w:p>
<xsl:if test="exists($style)">
<w:pPr>
<xsl:copy-of select="$style"/>
</w:pPr>
</xsl:if>
<xsl:copy-of select="$contents"/>
</w:p>
</xsl:template>
<xsl:template match="*[contains(@class, ' topic/section ')]/*[contains(@class, ' topic/title ')] |
*[contains(@class, ' topic/example ')]/*[contains(@class, ' topic/title ')]"
mode="block-style"
name="block-style-section.title"
as="element()*">
<w:pStyle w:val="Subtitle"/>
</xsl:template>
im_rem
PS: I also tried the @chunk="to-content" on the map's root level but it does not make a difference in the Word output.
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Hi,
We (the Oxygen team) are not very familiar with how the DITA to Word publishing plugin works.
If this seems like a bug to you and the bug can be reproduced with the latest plugin contents:
https://github.com/jelovirt/com.elovirta.ooxml/
then maybe you can prepare a very small sample project exhibiting the problem and add an issue for it:
https://github.com/jelovirt/com.elovirta.ooxml/issues
Regards,
Radu
We (the Oxygen team) are not very familiar with how the DITA to Word publishing plugin works.
If this seems like a bug to you and the bug can be reproduced with the latest plugin contents:
https://github.com/jelovirt/com.elovirta.ooxml/
then maybe you can prepare a very small sample project exhibiting the problem and add an issue for it:
https://github.com/jelovirt/com.elovirta.ooxml/issues
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 24
- Joined: Tue Jun 14, 2022 1:08 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Thank you for the link. I found a corresponding issue in it: https://github.com/jelovirt/com.elovirt ... /issues/63. So I will not create another one.Radu wrote: ↑Fri May 12, 2023 1:09 pm If this seems like a bug to you and the bug can be reproduced with the latest plugin contents:
https://github.com/jelovirt/com.elovirta.ooxml/
I will go for a workaround instead by making an HTML5 transformation where the content is chunked into one page. Word can open HTML and save it as DOCX. In a second step, I will only have to find a way to resize all images using a VBA macro. So I will do this now.
Kind regards and have a nice day
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Hi,
Sure, I added a comment on the opened issue with a link to the Oxygen forum. You can also register to watch on the issue to see when it gets fixed.
Regards,
Radu
Sure, I added a comment on the opened issue with a link to the Oxygen forum. You can also register to watch on the issue to see when it gets fixed.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 1
- Joined: Fri Nov 15, 2024 6:55 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Hi,
I use DITA-OT version 4.1.1 (DITA to Word plugin 1.4.0) with <oXygen/> XML Editor 26.0, and I still have issues with internal links
Doesn't matter if I use or , the link in the created word doc is not highlighted. If I know where it is and click it, it works. When I right-click, I don't get the usual hyperlink options (Edit, Open, Copy, Remove Hyperlink). I receive the same result if I define scope, type, or format.
I tried to link to the title of the topic:, but it resulted in "Error! Reference source not found." in the resulting word doc.
I want to upload the document to a confluence page, and in confluence the link does not work at all.
When I manually add a link within the docx, it works in confluence, so I think the issue is with the DITA to Word transformation.
Linking to a web page works fine (I see the usual hyperlink options in word, it's highlighted, works when uploaded to confluence).
I went through the previous suggestion on how to update the document.topic.xsl file, but it was all incorporated in my version.
Do you have any idea/suggestion?
Thank you
I use DITA-OT version 4.1.1 (DITA to Word plugin 1.4.0) with <oXygen/> XML Editor 26.0, and I still have issues with internal links
Doesn't matter if I use
Code: Select all
<xref href="testconcept.dita#testtask"/>
Code: Select all
<xref href="testconcept.dita"/>
I tried to link to the title of the topic:
Code: Select all
<xref href="testconcept.dita#testtask/qweqwe"/>
I want to upload the document to a confluence page, and in confluence the link does not work at all.
When I manually add a link within the docx, it works in confluence, so I think the issue is with the DITA to Word transformation.
Linking to a web page works fine (I see the usual hyperlink options in word, it's highlighted, works when uploaded to confluence).
I went through the previous suggestion on how to update the document.topic.xsl file, but it was all incorporated in my version.
Do you have any idea/suggestion?
Thank you
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: DITA Map MS Office Word transformation scenario: resolving xref
Hi,
This forum thread started 5 years ago was for a problem where the links did not work at all.
I'm afraid I do not know much about the inner workings of Word links.
Please see some suggestions below:
Maybe you could add an issue on the GitHub project of the plugin which does DITA to Word conversions:
https://github.com/jelovirt/com.elovirta.ooxml/issues
Regards,
Radu
This forum thread started 5 years ago was for a problem where the links did not work at all.
I'm afraid I do not know much about the inner workings of Word links.
Please see some suggestions below:
So it is a link but probably somehow styled a bit differently than regular links.the link in the created word doc is not highlighted. If I know where it is and click it, it works.
Maybe you could add an issue on the GitHub project of the plugin which does DITA to Word conversions:
https://github.com/jelovirt/com.elovirta.ooxml/issues
This would be incorrect according to the specification.I tried to link to the title of the topic
Maybe you could contact Confluence and see if you can get them to support importing also from this type of link.I want to upload the document to a confluence page, and in confluence the link does not work at all.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service