Home Forums DITA and XMetaL Discussion Enhancement request – Where Used functionality Reply To: Enhancement request – Where Used functionality

Derek Read

Reply to: Enhancement request – Where Used functionality

At the moment we're not looking at this as a feature to implement. We have at least one CMS partner (Trisoft) that already has this feature. Trisoft's integration with XMetaL Author Enterprise exposes a “where used” feature (as well as extensive search and lots of other fancy stuff) inside our product's menus. If this is a priority, and you don't have a CMS implemented yet I would put it on the list of requirements to ask of the vendor. It seems to make sense to me to implement this at the CMS level because a CMS has full control over all the files and data it contains.

I can see how such a feature might be nice to have working at the local file system level for people that do not have or have decided they do not want to use a CMS for whatever reason.

If the feature you are asking for would be basically a single purpose “find across files” feature that limits itself to finding files mentioned in href attribute values in other files, there are tools available that will help you do that today. It really depends on your needs, how you store your files and perhaps other factors.

For example, at the (very very) basic level the Windows findstr command line tool might help. The following will find all the .ditamap files in the current directory that (probably) reference the file called filename.xml (I say “probably because findstr is a string finder not an XML parser, but 99% of the time it should give you the results you want). The regular expression here is what needs to be tweaked to give you more accurate or less restrictive results.

findstr /R /N /O /C:"href=".*filename.xml"" *.ditamap

The N and O display the line and column number of the match. Type findstr/? for other options. Add /S to search subdirectories (there are also many other options).

The following will search your entire C: drive for .ditamap files that contain a reference to filename.xml:

findstr /R /N /O /S /C:"href=".*filename.xml"" C:*.ditamap

Note that running this last one will take some time on a large drive.

I'm not proposing this as a proper solution. It is just a demonstration that there are free things available (in this case already on your machine) that will give you this feature with minimal extra work. There are also probably literally hundreds of open source, freeware, and shareware tools similar to this that also provide a GUI, some of which would be XML-savvy (allowing you to search for attribute values, perhaps also with regular expressions such as the above).