Skip to main content
Inspiring
March 16, 2018
Answered

Find and Replace Operations on .dita files

  • March 16, 2018
  • 1 reply
  • 780 views

Hi All,

I am new to scripting.

But I would have dita maps that point to an absolute destination for each of the xml and dita files and I would like to change these to relative addressing.

I figure that a script might be the right way to do this.

Any alternate suggestions are welcome.

Appreciate it,

Myko

This topic has been closed for replies.
Correct answer Engineering Ambrell

Thanks Jang,

I have to confess that since I put this question in writing I remembered that I had "GrepWin" on my pc and when I tried it it was able to find and replace the text in all the dita files in the present folder and sub-folders in one go. Now I can port it to my local drive and operate without any trouble... as yet.

Myko

1 reply

4everJang
Legend
March 16, 2018

Hello Myko,

If you have DITA maps you should look into XSLT. That will be much easier than scripting. You could even load the map in FrameMaker XML view and do a search and replace there if the pattern you are replacing is easy enough. In the XML view you can also run an XSLT.

Jang

Engineering AmbrellAuthorCorrect answer
Inspiring
March 16, 2018

Thanks Jang,

I have to confess that since I put this question in writing I remembered that I had "GrepWin" on my pc and when I tried it it was able to find and replace the text in all the dita files in the present folder and sub-folders in one go. Now I can port it to my local drive and operate without any trouble... as yet.

Myko

frameexpert
Community Expert
Community Expert
March 16, 2018

ExtendScript has a File object and Regular Expressions so you could do this within FrameMaker as well if it is more convenient.

www.frameexpert.com