"Replace All References with Content" Question

Posts: 4

"Replace All References with Content" Question

Wed Jan 02, 2019 3:01 am

I am looking to perform this action on a set of files - like an entire ditamap. Is that possible, or do I have to do it by opening each file?

The description here
says this...
>Resolve References
>A new action called "Replace All References with Content" is available when editing DITA documents. It replaces all referenced
>fragments (keyrefs, conrefs, or conkeyrefs) in the current document with the actual referenced content.

which makes it sound like it only works on the current document.
Posts: 5930

Re: "Replace All References with Content" Question

Mon Jan 07, 2019 10:13 am


The action works right now only on the current opened DITA topic.
Possibly a plugin for Oxygen could be implemented to achieve what you want (batch apply the action on a set of topics). If we manage to find the time to implement such a plugin we'll update this thread. Or if you are a Java developer I could try to give you more details about how to use our Oxygen SDK to implement such a plugin.
Can you tell me more about your use case?

Radu Coravu
<oXygen/> XML Editor
Posts: 4

Re: "Replace All References with Content" Question

Mon Jan 07, 2019 8:53 pm

Hi Radu,

I am not a Java developer but always willing to learn. My team have been able to make some plugins in the past.

The use case is for localization. The content is sent out for localization in the DITA source format.
Our authors use variables for product names and conref the product names into titles and phrases.

The localization folks have informed us that some of the titles and phrases are not exactly translated correctly because they translate the product names in the variables file separately from the surrounding text in the title or phrase. They have asked that the source content be sent to them with the conrefs already resolved, so that they can translate the entire phrase at once.

I have been able to write a python script that pulls in the variables and replaces them based on making a dictionary of the variables file and search and replace as needed, but that is a bit of a hack in the elegance of our tool workflow, so being able to do it in Oxygen would be preferable.

Also, it is easy-ish to do with the variables file. I haven't thought about what it would take to do with bigger conrefs.
Also, full disclosure, we will probably go to using keys in 2019, but in the big picture I think the issue is the same.

Cosmin Duna
Posts: 3

Re: "Replace All References with Content" Question

Thu Jan 10, 2019 4:37 pm


We created a sample javascript plugin that can help you:
https://github.com/oxygenxml/wsaccess-j ... tResources
For install this, you should copy the 'performAuthorActionOnProjectResources' folder in the 'plugins' directory from the Oxygen.

You have the information in the 'README.md' section for customize this.


Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: Bing [Bot] and 2 guests