Skip to main content
Rsfl
Inspiring
November 15, 2013
Question

Remove fm-ditafile and dita elements from FM output

  • November 15, 2013
  • 1 reply
  • 807 views

Is there a way to remove these elements after converting a Dita map to FM files? They clutter up the output, I would prefer a clean structure with tasks, concepts etc. as root elements for chapters.

Perhaps somebody knows a script that searches for these files and unwraps them?

Robert

This topic has been closed for replies.

1 reply

ScottPrentice
Inspiring
November 15, 2013

Hi Robert...

I'm not aware of a script to do this but it shouldn't be difficult to create using ExtendScript or XSLT.

Can you provide more info about why you want to do this? Note that even if you remove the fm-ditafile wrappers from each topic, the resulting model is not valid DITA. There are (or may be) a number of extra elements that are added durign the DITA-FMx publishing process that add features to the resulting files, but are not proper DITA structures. The fm-ditafile wrappers should not affect the formatting in any way, and are used by the publishing process to identify the source file locations.

Cheers,

...scott

Rsfl
RsflAuthor
Inspiring
November 18, 2013

Hi Scott,

> Can you provide more info about why you want to do this?

The goal is to get a tidy structure that can be edited more easily. If you use the output files as a basis for further authoring and add new topics then it is very distracting to have all those extra elements around. Topics with the same heading level with be located at different points in the structure, some wrappen in dita and fm-ditafile elements, others not.

Robert

ScottPrentice
Inspiring
November 18, 2013

Hi Robert...

The generated FM files are not intended to be round-tripped back to DITA. It's not just the fm-ditafile elements that make these files invalid DITA .. there are other elements and the references are all hard-coded to the full path not relative paths as you'd want in DITA files. These files should be considered an output format and should not be the basis for further authoring.

Any edits should be made in the source DITA files and then the FM files should be regenerated. Once you've set up a book-build INI file, that process shoujld be very simple and should always result in the same output. If you need to perform special formatting tasks, it's worth trying to automate those by creating an ExtendScript that can do the cleanup. This can be hooked into the book-build process so it's done automatically.

I discourage you from trying to round-trip the generated FM files back to DITA.

...scott