Script to replace conrefs in DITA topics

Yves Barbion yves.barbion at gmail.com
Wed Oct 2 06:42:34 PDT 2013


Hi group

Suppose you have a bunch of topics in a DITA map or in a folder in which
you want to replace specific conrefs with an element with text. For example:

<keyword conref="!conref_library.dita#topic_2m1_vgk_3h/keyword_kqg_drd_f3"/>

needs to be replaced with:

<keyword>XYZ</keyword>

and

<keyword conref="!conref_library.dita#topic_2m1_vgk_3h/keyword_drf_tvd_f7"/>

needs to be replaced with:

<keyword>ABC</keyword>

I guess this can be automated with a Framescript or Extendscript which does
the following:

1. Collect all the conrefs in a DITA map or a folder.
2. Present the conrefs in some kind of list, for example a column in an
Excel spreadsheet.
3. In the second column, the user could then enter the text and elements
which need to replace the conref, for example:

cell A1 (find): <keyword
conref="!conref_library.dita#topic_2m1_vgk_3h/keyword_kqg_drd_f3"/>
cell B1 (replace with): <keyword>XYZ</keyword>
cell A2: <keyword
conref="!conref_library.dita#topic_2m1_vgk_3h/keyword_drf_tvd_f7"/>
cell B2: <keyword>ABC</keyword>

4. Apply this search/replace list to all topics in a given DITA map or
folder.

Any takers?

Thanks

-- 
Yves Barbion
www.scripto.nu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.frameusers.com/pipermail/framers-frameusers.com/attachments/20131002/71fd8faa/attachment.htm>


More information about the framers mailing list