Reusing topics that have keyrefs
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 316
- Joined: Wed Jun 17, 2015 10:19 am
Reusing topics that have keyrefs
Post by ann.jensen »
Hi,
I am using keyrefs throughout much of my DITA code. My main output is oxygen webhelp and all is fine.
I am starting to ruse some of my topics for Pdf output. I create a new project with a new root ditamap and then add in references to the topics from my main project whose content I want for the pdf output. However I run in to problems if those topics have keyrefs that cannot be resolved since the ditamap with the related key definitions cannot be found.
Is there a way that I can reference the ditamap with the related key definitions without including it in the project as I don't want all of its topics included in the output and I don't want to actually change the ditamap code...as it is used in my main project in its entirety.
Any advice appreciated.
Ann
I am using keyrefs throughout much of my DITA code. My main output is oxygen webhelp and all is fine.
I am starting to ruse some of my topics for Pdf output. I create a new project with a new root ditamap and then add in references to the topics from my main project whose content I want for the pdf output. However I run in to problems if those topics have keyrefs that cannot be resolved since the ditamap with the related key definitions cannot be found.
Is there a way that I can reference the ditamap with the related key definitions without including it in the project as I don't want all of its topics included in the output and I don't want to actually change the ditamap code...as it is used in my main project in its entirety.
Any advice appreciated.
Ann
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Reusing topics that have keyrefs
Hi Ann,
There is no specific publishing engine support for what you want. Maybe you can refer in the new DITA map you are working on to the other DITA Map using the "processing-role='resource-only'" attribute. This will allow the processor to use the keys from the map but the published output and TOC should not contain topics from it.
Probably in time you will need to refactor your DITA project and extract separate submaps which define keys and are used in both maps.
Regards,
Radu
There is no specific publishing engine support for what you want. Maybe you can refer in the new DITA map you are working on to the other DITA Map using the "processing-role='resource-only'" attribute. This will allow the processor to use the keys from the map but the published output and TOC should not contain topics from it.
Probably in time you will need to refactor your DITA project and extract separate submaps which define keys and are used in both maps.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 316
- Joined: Wed Jun 17, 2015 10:19 am
Re: Reusing topics that have keyrefs
Post by ann.jensen »
Hi Radu,
I added a mapref to the rootmap of my new project with processing-role="resource-only". This is the keys are defined.
I then set this map as the rootmap.
I then added in references to the project rootmap pointing to the topics that have the keydefs.
However, the keydefs are not being resolved
Regards,
Ann
I added a mapref to the rootmap of my new project with processing-role="resource-only". This is the keys are defined.
I then set this map as the rootmap.
I then added in references to the project rootmap pointing to the topics that have the keydefs.
However, the keydefs are not being resolved

Regards,
Ann
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Reusing topics that have keyrefs
Hi Ann,
How exactly did you refer to the DITA Map?
Something like:
right?
Does the "Validate and check for completeness" report any problem when validating the top level DITA Map?
Regards,
Radu
How exactly did you refer to the DITA Map?
Something like:
Code: Select all
<topicref format="ditamap" href='mapWithKeydefs.ditamap" processing-role="resource-only"'/>
Does the "Validate and check for completeness" report any problem when validating the top level DITA Map?
You should have let the top level map be the root map. Both Oxygen and the publishing process can work its way through the entire hierarchy of maps and gather keys.I then set this map as the rootmap.
Be keydefs you mean keyrefs, right? Are they not resolved on editing, on publishing or both?I then added in references to the project rootmap pointing to the topics that have the keydefs.
However, the keydefs are not being resolved
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 316
- Joined: Wed Jun 17, 2015 10:19 am
Re: Reusing topics that have keyrefs
Post by ann.jensen »
Hi Radu,
So my project has a dedicated root map i.e. rootmap.ditamap and this has a child for the map with keydefs i.e.'mapWithKeydefs.ditamap added with processing-role="resource-only".
It also has a child mapref that contains topicrefs that I actually want to be rendered in my published PDF.
Can processing resolve the keyrefs when the keydefs are in a sibling map...rather than a parent map.
rootmap
--- reference to mapwithkeydefs.ditamap
--- reference to mapwithkeyrefs.dita
Thanks,
Ann
Yes, exactly like this.<topicref format="ditamap" href='mapWithKeydefs.ditamap" processing-role="resource-only"'/>
Yes, but I have ongoing validation results reporting keydef problems where the keyrefs resolve fine.Does the "Validate and check for completeness" report any problem when validating the top level DITA Map?
Yes, keyrefs not keydefs.Be keydefs you mean keyrefs, right? Are they not resolved on editing, on publishing or both?
So my project has a dedicated root map i.e. rootmap.ditamap and this has a child for the map with keydefs i.e.'mapWithKeydefs.ditamap added with processing-role="resource-only".
It also has a child mapref that contains topicrefs that I actually want to be rendered in my published PDF.
Can processing resolve the keyrefs when the keydefs are in a sibling map...rather than a parent map.
rootmap
--- reference to mapwithkeydefs.ditamap
--- reference to mapwithkeyrefs.dita
Thanks,
Ann
-
- Posts: 316
- Joined: Wed Jun 17, 2015 10:19 am
Re: Reusing topics that have keyrefs
Post by ann.jensen »
Sorry, forgot to mention
Regards,
Ann
The following is returned in Transformation Problems where m_wf_iproperty.ditamap is mapWithKeydefs.ditamap.Does the "Validate and check for completeness" report any problem when validating the top level DITA Map?
Code: Select all
System ID: C:\DevBranches\DocService_devel\User_Guides\test_guide\test_guide.ditamap
Scenario: DITA Map PDF - Aspen
Input file: C:\DevBranches\DocService_devel\User_Guides\test_guide\test_guide.ditamap
Engine name: DITA-OT
Severity: warning
Description: [DOTJ036W] The file "file:/C:/DevBranches/DocService_devel/AGS_Documentation/system_documentation/dita_files/AGSSystems/WF_iProperty/m_wf_iproperty.ditamap" referenced by "%2" is outside the scope of the input dita/map directory.
URL: http://www.oxygenxml.com/DITA-messages.html#msgs__DOTJ036W
Ann
-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Reusing topics that have keyrefs
Hi Ann,
The DITA OT has always problems with this, we recommend two possible approaches:
https://www.oxygenxml.com/doc/versions/ ... -refs.html
Regards,
Radu
OkSo my project has a dedicated root map i.e. rootmap.ditamap and this has a child for the map with keydefs i.e.'mapWithKeydefs.ditamap added with processing-role="resource-only".
It also has a child mapref that contains topicrefs that I actually want to be rendered in my published PDF.
Yes, it should be able to do that.Can processing resolve the keyrefs when the keydefs are in a sibling map...rather than a parent map.
rootmap
--- reference to mapwithkeydefs.ditamap
--- reference to mapwithkeyrefs.dita
So this is a problem obtained when publishing. It seems that the map that you are publishing references to the m_wf_iproperty.ditamap which is in a folder path outside of the folder where the published map resides.The following is returned in Transformation Problems where m_wf_iproperty.ditamap is mapWithKeydefs.ditamap.
[DOTJ036W] The file "file:/C:/DevBranches/DocService_devel/AGS_Documentation/system_documentation/dita_files/AGSSystems/WF_iProperty/m_wf_iproperty.ditamap" referenced by "%2" is outside the scope of the input dita/map directory.
The DITA OT has always problems with this, we recommend two possible approaches:
https://www.oxygenxml.com/doc/versions/ ... -refs.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 316
- Joined: Wed Jun 17, 2015 10:19 am
Re: Reusing topics that have keyrefs
Post by ann.jensen »
Sorry again for confusion.
So mapWithKeydefs.ditamap is m_wf_iproperty.ditamap and it is a child of the root map i.e. the map that I am publishing.
It resides in a folder path outside of the folder where the published map resides...but that's the whole point of reuse I thought.
I have set fix.external.refs.com.oxygenxml to true for the transformation but that makes no difference.
I am stuck on why the root map cannot resolve keys that are defined in m_wf_iproperty.ditamap (to which it has a topic reference) when they are referenced in the other child map (mapwithkeyrefs.dita)
So mapWithKeydefs.ditamap is m_wf_iproperty.ditamap and it is a child of the root map i.e. the map that I am publishing.
It resides in a folder path outside of the folder where the published map resides...but that's the whole point of reuse I thought.
I have set fix.external.refs.com.oxygenxml to true for the transformation but that makes no difference.
I am stuck on why the root map cannot resolve keys that are defined in m_wf_iproperty.ditamap (to which it has a topic reference) when they are referenced in the other child map (mapwithkeyrefs.dita)

-
- Posts: 9446
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Reusing topics that have keyrefs
Hi,
Could you try to create a sample DITA project from your current structure and send it to us? (support@oxygenxml.com).
Regards,
Radu
I understand your use case and setting the parameter should have worked. There is probably something about your setup that I do not understand.I have set fix.external.refs.com.oxygenxml to true for the transformation but that makes no difference.
Could you try to create a sample DITA project from your current structure and send it to us? (support@oxygenxml.com).
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 316
- Joined: Wed Jun 17, 2015 10:19 am
Re: Reusing topics that have keyrefs
Post by ann.jensen »
Hi Radu,
I guess the complexity is in that (in my main project) I am reusing topics across maps where the keyrefs in the topics are resolved based on the keyscopes of the parent map.
This is making it difficult to pull out small subsets of a map and reuse it in a different project to publish a PDF for example. There are so many
dependencies in topics within my keyscoped maps.
I will try to create a sample project to demonstrate this.
Thanks again,
Ann
I guess the complexity is in that (in my main project) I am reusing topics across maps where the keyrefs in the topics are resolved based on the keyscopes of the parent map.
This is making it difficult to pull out small subsets of a map and reuse it in a different project to publish a PDF for example. There are so many
dependencies in topics within my keyscoped maps.
I will try to create a sample project to demonstrate this.
Thanks again,
Ann
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)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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