Scripting a multi-step search and replace

Post here questions and problems related to editing and publishing DITA content.
jeff_hooker
Posts: 15
Joined: Tue Jun 11, 2019 9:01 pm

Scripting a multi-step search and replace

Post by jeff_hooker »

Hi folks,

I've got roughly 200 different character entities that I need to search for and replace with different entities across a document set of roughly 15000 topics. Is there any way of defining the search/replace terms as a set of comma separated values or something for the multi-file search feature and then running the whole search at once?

Thanks,
Jeff.
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: Scripting a multi-step search and replace

Post by Radu »

Hi Jeff,

Oxygen has support to create and apply custom XML refactoring operations over multiple files:
https://www.oxygenxml.com/doc/versions/ ... tools.html

We have a sample Github project with various XSLT-based XML Refactoring operations:
https://github.com/oxygenxml/dita-refactoring-examples

I created there a folder with a sample XML refactoring operation which replaces two entity references with two equivalents:
https://github.com/oxygenxml/dita-refac ... References

maybe you can use that as a starting point for what you want and make extra changes to the XSLT stylesheet.

In the Oxygen Preferences->"XML Refactoring" page you can add a reference to a custom folder containing refactoring operations.
Then in the main Oxygen menu Tools->"XML Refactoring" dialog you should find the new "Replace entities" XML refactoring action.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply