How to insert reusable contents to multiple dita maps
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 158
- Joined: Fri Nov 10, 2017 8:16 am
How to insert reusable contents to multiple dita maps
Hi, Dear Oxygen Support
Is there a way to set reusable contents, and apply the contents to multiple dita maps?
For now, we are developing a version of our product documentation.
The firmware version is variable during the development period.
For the topics that mention the firmware version, we use the text "20.3.0.X".
In this issue, can we set a reusable content to refer to firmware version, and insert the reusable contents to multiple dita maps?
When the firmware version is confirmed, we only change one place and apply to multiple places.
Is that possible?
Thanks and Regards
Catherine
Is there a way to set reusable contents, and apply the contents to multiple dita maps?
For now, we are developing a version of our product documentation.
The firmware version is variable during the development period.
For the topics that mention the firmware version, we use the text "20.3.0.X".
In this issue, can we set a reusable content to refer to firmware version, and insert the reusable contents to multiple dita maps?
When the firmware version is confirmed, we only change one place and apply to multiple places.
Is that possible?
Thanks and Regards
Catherine
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to insert reusable contents to multiple dita maps
Hi Catherine,
I might not understand exactly the entire use case.
Did you try to create a topic containing reusable DITA elements, place it in a common folder and add content references to it in various places? Or similarly create a small DITA submap containing reusable keys again referenced in multiple main DITA Maps? Did you encounter any difficulty in doing so?
Regards,
Radu
I might not understand exactly the entire use case.
Did you try to create a topic containing reusable DITA elements, place it in a common folder and add content references to it in various places? Or similarly create a small DITA submap containing reusable keys again referenced in multiple main DITA Maps? Did you encounter any difficulty in doing so?
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 158
- Joined: Fri Nov 10, 2017 8:16 am
Re: How to insert reusable contents to multiple dita maps
Hi, Radu
I thought that the keys defined in the reusable ditamap can be used directly in multiple places.
I was wrong.
As you mentioned, I need to insert the reusable ditamap as a sub ditamap in multiple main ditamaps, so that I can reuse the keys.
I corrected my usage, now it works. Thanks for your information, Radu.
One more question, is there any way to reuse keys for the name of dita file?
I have a dita file named "v20.3.0.X.dita".
Is there any way that I can use a key to control the file name.
When the text of the key changes, the name of the dita file changes automatically.
Best Regards,
Catherine
I thought that the keys defined in the reusable ditamap can be used directly in multiple places.
I was wrong.
As you mentioned, I need to insert the reusable ditamap as a sub ditamap in multiple main ditamaps, so that I can reuse the keys.
I corrected my usage, now it works. Thanks for your information, Radu.
One more question, is there any way to reuse keys for the name of dita file?
I have a dita file named "v20.3.0.X.dita".
Is there any way that I can use a key to control the file name.
When the text of the key changes, the name of the dita file changes automatically.
Best Regards,
Catherine
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to insert reusable contents to multiple dita maps
Hi Catherine,
How about if you define a key for the "v20.3.0.X.dita":
and you refer to that topic using keyref in all other places?
In this way, depending on how you define the "whats-new" key all references would change in the published output.
For example the main "v20.3.ditamap" would do:
but the DITA Map for another version would map the "whats-new" key to another href.
Or you can do things like this:
and remove when publishing either one or the other key definition using a DITAVAL filter file.
Regards,
Radu
How about if you define a key for the "v20.3.0.X.dita":
Code: Select all
<topicref href="v20.3.0.X.dita" keys="whats-new"/>
In this way, depending on how you define the "whats-new" key all references would change in the published output.
For example the main "v20.3.ditamap" would do:
Code: Select all
<topicref href="v20.3.0.X.dita" keys="whats-new"/>
<mapref href="commonDITAMap.ditamap"/>
Or you can do things like this:
Code: Select all
<topicref href="v20.3.0.X.dita" keys="whats-new" product="v1"/>
<topicref href="v20.3.1.X.dita" keys="whats-new" product="v2"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 158
- Joined: Fri Nov 10, 2017 8:16 am
Re: How to insert reusable contents to multiple dita maps
Hi, Radu
I am sorry for my unclear description, and I guess you misunderstood my requirements.
I want to set a variable for the dita file name.
For example, [Variable-A].dita, when the [Variable-A] is set to 20.3.0.20, the dita file name changes to 20.3.0.20.dita automatically, is that possible?
If it is impossible to be achieved, is there any way to change the output file name for the dita file.
For example, the dita file is "20.3.0.X.dita", after we generate webhelp, the dita file can be changed to "20.3.0.20.html".
Any way we can control that?
Thanks,
Catherine
I am sorry for my unclear description, and I guess you misunderstood my requirements.
I want to set a variable for the dita file name.
For example, [Variable-A].dita, when the [Variable-A] is set to 20.3.0.20, the dita file name changes to 20.3.0.20.dita automatically, is that possible?
If it is impossible to be achieved, is there any way to change the output file name for the dita file.
For example, the dita file is "20.3.0.X.dita", after we generate webhelp, the dita file can be changed to "20.3.0.20.html".
Any way we can control that?
Thanks,
Catherine
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to insert reusable contents to multiple dita maps
Hi Catherine,
Please see some answers below:
?
Regards,
Radu
Please see some answers below:
No. Not out of the box anyway.For example, [Variable-A].dita, when the [Variable-A] is set to 20.3.0.20, the dita file name changes to 20.3.0.20.dita automatically, is that possible?
How about if you set the @copy-to attribute in the DITA Map like:If it is impossible to be achieved, is there any way to change the output file name for the dita file.
For example, the dita file is "20.3.0.X.dita", after we generate webhelp, the dita file can be changed to "20.3.0.20.html".
Code: Select all
<topicref href="20.3.0.X.dita" copy-to="20.3.0.20.dita"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to insert reusable contents to multiple dita maps
Hi Catherine,
You can define XML entities in the DOCTYPE declaration of the DITA Map like for example:
https://github.com/oxygenxml/userguide/ ... fs.ditamap
and then use XML entity references in attribute values like:
DITA kind of discourages the use of XML entities but they are the only way in which you can reuse content in attribute values.
Regards,
Radu
You can define XML entities in the DOCTYPE declaration of the DITA Map like for example:
https://github.com/oxygenxml/userguide/ ... fs.ditamap
Code: Select all
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd" [
<!ENTITY version "1.1">
]>
Code: Select all
<topicref href="&version;"/>
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