Page 1 of 1

Is there a way to replace all IDs in a file at once?

Posted: Tue Apr 23, 2024 11:03 pm
by dsharpe
Just as the title says. I often need to make copies of large dita files with many IDs and then need to replace each of the IDs one by one. I know Oxygen has the "Generate IDs" function, but is there a way to replace all IDs in a file with newly generated IDs?

Re: Is there a way to replace all IDs in a file at once?

Posted: Wed Apr 24, 2024 7:08 am
by Radu
Hi,
With the DITA XML standard the IDs of elements need to be unique in the context of the current topic. If you have two topics, each can have inside it elements with the same ID without any problems. So I do not quite understand your use case.
In the Oxygen main menu "Tools->XML Refactoring" dialog we have a "Generate IDs" action which can batch generate IDs on elements which do not have them either in a single topic file or in multiple topics. We also have an XML refactoring action named "Delete attribute" if you want to delete ID attributes in an entire file. Or you can create your own XML refactoring action: https://www.oxygenxml.com/doc/ug-editor ... tions.html
Regards,
Radu