Re: Displaying links between DITA topics as a diagram


ekimber@contrext.com
 

Our content currently does not use keys for cross references, so if you don’t specify only-topic-in-map, OT chases down all the topic-to-topic links, wherever they might lead.

 

For keys in topics that are not referenced from the map the correct thing to do is refuse to resolve them, which is what newer versions of Open Toolkit does.

 

Cheers,

 

E.

 

--

Eliot Kimber

http://contrext.com

 

 

 

Hi Eliot,

I'm curious - how are you getting more topics in your output than exist in your map?

Let's say I have bookA that references bookB as a peer map:

<?xml version="1.0" encoding="UTF-8"?>

<?xml-model href="urn:oasis:names:tc:dita:rng:map.rng" schematypens="http://relaxng.org/ns/structure/1.0"?>

<map>

    <title>Book A</title>

    <mapref href="bookB.ditamap" keyscope="bookB" processing-role="resource-only" scope="peer"/>

    <topicref href="bookA/topic1.dita" keys="bookA_topic1"/>

    <topicref href="bookA/topic2.dita" keys="bookA_topic2"/>

</map>


Now let's say I have a bookA topic that has a cross-book link to "topic3" in bookB. If that cross-book link uses  @keyref:

<p>For details, see <xref keyref="bookB.topic3">Topic 3 in Book B</xref>.</p>


then the published output has only the bookA topics:

$ ls -1 out/*/*.html

out/bookA/topic1.html

out/bookA/topic2.html


But if I try to create the cross-book link as an @href instead:

<p>For details, see <xref href="../bookB/topic3.dita">Topic 3 in Book B</xref>.</p>


then the target topic is included in the published output, which is not correct behavior for a peer map:

$ ls -1 out/*/*.html

out/bookA/topic1.html

out/bookA/topic2.html

out/bookB/topic3.html


I wonder if you have cross-book links that use @href instead of @keyref, thus causing transformation to promiscuously include the target topics in the output?

(There is another issue with "cross-book" @href links, in that Oxygen's validator traces into them during validation but in the original book's key scope, which tends to cause spurious "unresolved key" validation errors in target topic content.)

 - Chris

Join main@dita-users.groups.io to automatically receive all group messages.