Page 1 of 1

Scripting a multi-step search and replace

Posted: Tue Mar 09, 2021 10:46 pm
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.

Re: Scripting a multi-step search and replace

Posted: Wed Mar 10, 2021 1:38 pm
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