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

Post here questions and problems related to editing and publishing DITA content.
dsharpe
Posts: 1
Joined: Tue Apr 23, 2024 10:55 pm

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

Post 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?
Radu
Posts: 9164
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply