List of images referenced in a DITA map

Post here questions and problems related to editing and publishing DITA content.
susannecm
Posts: 109
Joined: Wed Mar 17, 2010 1:04 pm

List of images referenced in a DITA map

Post by susannecm »

I've just migrated a large manual to DITA and i believe that my images directory now contains quite a few images that are no longer used. I would like to clean this up, but it seems very cumbersome to search for the name of every image file.

What I would like to have is an alphabetically sorted list of href attributes in image elements. This would be useful for translation projects as well.

Is there a way to do this in oXygen? Maybe the result list of "Find in files" could be a starting point. On the other hand, maybe it's possible to include this information in the Metrics report.

Thanks for any suggestions

Susanne
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: List of images referenced in a DITA map

Post by sorin_ristache »

Hello,

I suggest the following 2 steps:
  • Run the transformation DITA Map XHTML or DITA Map WebHelp on the DITA map.
  • Run Diff Directories tool to find the image files that are present in the images sub-directory of the XML source directory but absent in the images sub-directory of the XHTML output directory.
You can start the Diff Directories tool either from the Oxygen window from menu Tools or as a separate tool from the shortcut created by the Oxygen installer (or using the diffDirs.bat/diffDirs.sh/diffDirsMac.bat command line script). This tool will find the set of files that are different between two specified directories (and their sub-directories recursively), in your case the files that are present in the source image directory (in a sub-directory of the directory with the DITA map file) and are absent from the XHTML output directory.


Regards,
Sorin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: List of images referenced in a DITA map

Post by sorin_ristache »

Hello,

Other option: you can find a list of all the image files that are used in the transformed DITA map in the file image.list from the temporary directory of the transformation. That is set the clean.temp parameter to no in the DITA Map XHTML transformation, run the DITA transformation and after it is finished look in the file [DITA-map-directory]/temp/xhtml/image.list.


Regards,
Sorin
susannecm
Posts: 109
Joined: Wed Mar 17, 2010 1:04 pm

Re: List of images referenced in a DITA map

Post by susannecm »

Thanks - I completely forgot DIFF directories ...
Post Reply