Page 1 of 1

renaming certain <b> elements with <uicontrol>

Posted: Mon Apr 30, 2018 6:21 pm
by Ronser

After migrating to DITA, all strong formatting was transposed as a <b> element. Some of these are ok to remain as <b>, but some of this content should be refactored as <uicontrol>. What would be the quickest way to search through the content, and easily refactor <b> elements as <uicontrol> where desired?

The quickest method I've found is to use the xpath "//b[1]" to find all bold elements, and then manually change the tags to <uicontrol> where needed. I was just wondering if there was a quicker way anyone could think of?

Re: renaming certain <b> elements with <uicontrol>

Posted: Wed May 02, 2018 8:57 am
by Radu

In the Oxygen Tools main menu there is an "XML Refactoring" action which has a "Rename element" possibility. There is a preview which could be used to see all matched places and possibly also exclude certain resources. Unfortunately you can exclude entire topics but not exclude individual renames from inside a topic. Maybe you could duplicate your entire project to some other folder, use the XML Refactoring rename to rename all matches in the duplicate project and then use Oxygen's "Compare directories" to decide which renames to keep and which to revert.