Generate topic ID to match file name

Post here questions and problems related to editing and publishing DITA content.
ann.jensen
Posts: 295
Joined: Wed Jun 17, 2015 10:19 am

Generate topic ID to match file name

Post by ann.jensen »

Hi,
I am in the midst of refactoring my DITA files to set the top-level topic id to match the file name so that it is both unique and informative. I have managed to allow many duplicate topic ids proliferate over time :-|
This is proving a tedious process and I wonder is there any short-cut to achieving this rather than doing each file manually?
Thanks in advance,
Ann
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generate topic ID to match file name

Post by Radu »

Hi Ann,

We do not have right now an automated way to change a topic's ID and automatically change it in all references made to that topic. We have a registered issue and I added your feedback on it.
If you contact us via our email address (support@oxygenxml.com) I could try to give you a custom refactoring action which renames IDs in all topics to use the file name (without extension). The refactoring action will not rename also references to those IDs from other topics. So you will still need to run the "Validate and check for completeness" action and manually fix all those broken links.
Speaking of the "Validate and check for completeness" action, it can also validate each topic using a Schematron schema. So you can add schematron checks for this condition (topic ID not matching file name) and you can run the "Validate and check for completeness" action to find all the topics where you should change the ID.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
dgallo
Posts: 90
Joined: Tue Mar 31, 2015 10:43 pm

Re: Generate topic ID to match file name

Post by dgallo »

Hello,

We are also in need of a way to quickly update all of our topic id's to match the filename. Do you have a script of a quick solution for this?

Thanks,
Danielle
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generate topic ID to match file name

Post by Radu »

Hi Danielle,

Oxygen 18.1 (which we plan to release in about a week) will come bundled with a default DITA refactoring action which replaces all topic IDs with the file name. Basically, you will open the main DITA Map in the DITA Maps Manager view, right click, choose Refactoring->XML Refactoring and you will find two DITA-related predefined actions, one of which is called Change topic ID to file name. The refactoring actions also have a Preview which allow you to see what the action will be doing before making changes on disk.

If you are using Oxygen 18.0 I can also provide you this refactoring action so that you can install it in your current Oxygen installation. So if you do not want to wait for the release just drop us an email (support@oxygenxml.com)

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generate topic ID to match file name

Post by Radu »

Hi,

Oxygen 18.1 was released a couple of weeks ago and it should come bundled with this special refactoring action we discussed.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
SathyaOX
Posts: 29
Joined: Wed Oct 26, 2016 8:19 pm
Location: India

Re: Generate topic ID to match file name

Post by SathyaOX »

Hi,
Do we have a workaround for this issue in version 17.1?
-Sathya
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: Generate topic ID to match file name

Post by Radu »

Hi Sathya,

If you drop us an email (support@oxygenxml.com) I could try to give you the XML refactoring actions as separate files so that you could install them in 17.1.

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