Page 1 of 1

Consider branch filtering in "Validate and Check for Completeness"

Posted: Wed Oct 26, 2022 12:49 am
by chrispitude
We have topics that are reused in multiple books. Books apply different profiling conditions so that these reused topics include only the content relevant to that book:

Code: Select all

<topic id="topic_shared">
  <title>My Shared Topic</title>
  <body>
    <p>This is some text.</p>
    <p product="A">For details, see <xref keyref="topic_A"/>.</p>
    <p product="B">For details, see <xref keyref="topic_B"/>.</p>
  </body>
</topic>
Our WebHelp map applies profiling conditions to the book submaps using branch filtering (<ditavalref>):

Code: Select all

<map>
  <title>Online Help</title>
  <topichead navtitle="Books for Product A">
    <topicref format="ditamap" href="dita/bookA.ditamap" keyscope="bookA">
      <ditavalref href="ditaval/filter_A.ditaval"/>
    </topicref>
  </topichead>
  <topichead navtitle="Books for Product B">
    <topicref format="ditamap" href="dita/bookB.ditamap" keyscope="bookB">
      <ditavalref href="ditaval/filter_B.ditaval"/>
    </topicref>
  </topichead>
</map>
When the WebHelp map is published, the DITA-OT applies branch filtering. Only the topic A link is published in book A, only the topic B link is published in book B, and publishing completes successfully with no unresolved key messages.

But when we run Validate and Check for Completeness on the WebHelp map, validation does not consider branch filtering (I think) and both profiled key references are considered in both topic-reuse instances:

Code: Select all

Cannot find definition for key "topic_B". Key Scopes:[[bookA]]. Keys are gathered from: OPENME2.ditamap.
Cannot find definition for key "topic_A". Key Scopes:[[bookB]]. Keys are gathered from: OPENME2.ditamap.
This feature request is to consider branch filtering during Validate and Check for Completeness. Please let us know the issue ID so we can track this on our side.

Applying a global profiling condition as a proxy for branch filtering is a partial workaround, but different books have different branch filtering conditions, and so it is impossible to replicate all branch filtering at once. Another workaround is to run a transformation on the map and look for unresolved key messages, although these are information messages that can get lost among many other messages and require directed effort to look for.

Testcase:
oxygen_validate_completeness_branch_filtering.zip

Re: Consider branch filtering in "Validate and Check for Completeness"

Posted: Thu Oct 27, 2022 10:32 am
by Radu
Hi Chris,

We have a previous registere internal issue to make the Validate and Check for Completeness work with branch filtering:

EXM-34203 Validate and check for completeness with branch filtering

I added your contact details and suggestions to it.
I'm afraid I do not have a time estimate for this as I do not have a good idea about how to make this work.

Regards,
Radu

Re: Consider branch filtering in "Validate and Check for Completeness"

Posted: Fri Nov 11, 2022 9:44 pm
by kj_rk
Yes, this is something that we are looking forward to as well.
Today, because we have a bookmap for each product, writers have to run the validation check with the correct ditaval file and many times they have to do this for multiple bookmaps. This is error prone and causing lot of validation issues for our team.
If we can get the validation engine (DITA MAP completeness check) to honor the ditavalref, that would be ideal!

Thanks

Re: Consider branch filtering in "Validate and Check for Completeness"

Posted: Fri Nov 11, 2022 10:01 pm
by kj_rk
Is there any other workaround for this?
For example, can we add some logic to the ditaval file to use a set of <prop> elements for a certain ditamap and use another set for a different ditamap?

Re: Consider branch filtering in "Validate and Check for Completeness"

Posted: Sat Nov 12, 2022 12:11 am
by Radu
Hi,

I added your feedback on the opened issue, if we manage to fix it we'll update this forum thread.
I do not have other workarounds right now.

Regards,
Radu

Re: Consider branch filtering in "Validate and Check for Completeness"

Posted: Sun Nov 13, 2022 3:14 am
by chrispitude
Hi kj_rk,

Do you use DITA-OT project files and profiling contexts? If so, you might also be interested in this enhancement:

Consider DITA-OT project file contexts in "Validate and Check for Completeness"

Re: Consider branch filtering in "Validate and Check for Completeness"

Posted: Fri Mar 17, 2023 8:51 am
by Radu
Hi,

As an update we released Oxygen 25.1 and it should take ditaval branch filters into account when "Validate and check for completeness" is used in the DITA Maps Manager view.

Regards,
Radu

Re: Consider branch filtering in "Validate and Check for Completeness"

Posted: Thu Dec 07, 2023 11:02 pm
by kj_rk
Thanks Radu!
This is working great. Now we don't need to specify multiple ditaval files in our Validation and completeness check dialog box to validate the different bookmaps.
The problem though is, we are seeing TOPIC_DUP_ID errors as a result of validation. I am not sure why the topic IDs are being flagged duplicates because we are just referencing the same topic in different maps. They are not 2 different topics with the same ID. Just the same topic being referenced in 2 or 3 different maps results in the TOPIC_DUP_ID error.
Is there a resolution for this?

Thanks

Re: Consider branch filtering in "Validate and Check for Completeness"

Posted: Fri Dec 08, 2023 8:05 am
by Radu
Hi,
I remember I fixed some similar problem in Oxygen 26. What version of Oxygen are you using?
Regards,
Radu