DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Enhancement request – Where Used functionality

  • jbcampo

    Enhancement request – Where Used functionality

    Participants 1
    Replies 2
    Last Activity 13 years, 3 months ago

    I would like XMetaL DITA to have the ability to show me if a topic is called in any ditamap, and if yes, which ditamap.

    For example, I created an xml file a while ago. Now I revisit the topic and make edits, but I cannot remember if I ever added this topic to any ditamap. I check the most logical ditamap and it is not there. I want to search all ditamaps in my directory to see if this topic is referenced.

    Yes, I read the tutorial about using PSPad to do this, but I think this functionality should be directly in XMetaL. Can it be that hard? Our RoboHelp HTML 2002 has this functionality!

    If I've missed something, please let me know. Otherwise, I'd like to add this as an enhancement request. Thanks.


    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).


    Derek Read

    Reply to: Enhancement request – Where Used functionality

    If you have Visual Studio available (ie: you're a developer type) it has a Find in Files feature.

    The regular expression support in that tool is better than the basic findstr DOS command line tool mentioned previously (note that the feature in VS2005 is not XML savvy either). It might be a better option. The following kind of regular expression (together with other settings in the tool) will more closely pinpoint only those files containing specific references to files in href values:


    The main advantage here is that this allows you to find filename.xml with or without a path due to the grouping capabilities and the OR "|" character available in this tool.

    The other settings required for VS2005 are included in the screen capture VisualStudio2005_FindInFiles.jpg

    You then end up with a report that looks similar to this:
    [code]Find all "  C:1.ditamap(12):

      Matching lines: 2    Matching files: 2    Total files searched: 16[/code]


  • You must be logged in to reply to this topic.

Lost Your Password?