Finding the processed primary map?

4 views
Skip to first unread message

Alan Houser

unread,
Oct 4, 2022, 9:13:12 AM10/4/22
to DITA-OT Users
Colleagues,

I have a custom plugin that uses the "dita" transform to apply filtering and resolve conrefs. The plugin then converts individual topics to a proprietary XML format, and aggregates the topics into a single XML file based on the order and hierarchy specified by the primary map.

I had been using the original source map to guide the aggregation of topics in the "temp" folder (relative href paths remain valid there). But ... if my DITA source includes any topics outside (above) the primary map folder, I can no longer predict the structure of "temp" or "out". (At least not without some heavy-duty processing of the primary map, I think).

I think I need to base my aggregation on the processed primary map. But I'm not sure how to get a handle on this processed map. I know its name, but not its location, in the generated folder hierarchy.

If I'm missing an Ant task (or a DITA-OT property) to find the processed primary map, or some heuristic to find it, I would be grateful to know it!

-Alan Houser

Alan Houser

unread,
Oct 4, 2022, 12:17:37 PM10/4/22
to DITA-OT Users
For solving problems, I acknowledge the power of posting one's problem to a public list ...

I was able to get a handle on the processed primary map with the directives below.

-Alan

    <!-- ${args.input} is the primary DITA Map -->
    <echo>PRIMARY MAP FULL PATH: ${args.input}</echo>
   
    <!-- Get the primary map basename -->
    <basename property="primarymap.name" file="${args.input}"/>  
    <echo>PRIMARY MAP BASENAME: ${primarymap.name}</echo>

    <!-- Find the primary map in the out folder -->
    <fileset dir="${output.dir}" id="primarymap.processed">
      <include name="**/${primarymap.name}"/>
    </fileset>

    <!-- Save the primary map relative path as an Ant property -->
    <property name="primarymap.fullpath" value="${toString:primarymap.processed}"/>
    <echo>PROCESSED PRIMARY MAP: ${primarymap.fullpath}</echo>
Reply all
Reply to author
Forward
0 new messages