Page 1 of 1

Transformation scenarios for parent map and submaps

Posted: Tue Apr 06, 2021 4:19 pm
by Grolribasi
Hello, Oxygen Team!
I am new to DITA and Oxygen, so I wanted to ask for your assistance in solving the issue. I don't exactly understand if this is an Oxygen-related issue or our DITA-OT plugin-related.

When using Oxygen 22.1 there is some unexpected behavior for output transformation.

Thereare two maps with metainformation. They have the following structure:

Code: Select all

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

<map title="Maptitle" xtrc="/w:document/w:body[1]/w:p[1]"
    <title>Document title</title>
            <prodname>Our product</prodname>
        <othermeta name="docver" content="1.0"/>
Case 1. A DITA-OT pdf plugin configured to handle this metainformation and to put it on the title page. When publishing output with the plugin from the map, the result is 100% correct.

Case 2. But there is a problem when publishing output from the parent map that includes two submaps.
Scenario: I created a parent map that includes two submaps. Then profiled each of the two submaps to be a different output pdf file. When I apply a transformation scenario, none of the metainformation is included on the title page of the output pdf.

The transformation scenarios are the same for both cases. DITA-OT configuration is the same for both cases. The only difference is that the first case transformation scenario is applied from the submap directly, and the second case transformation scenario is applied from the parent map.
My question is: can the Case 1 behavior be achieved in Case 2 with the current version of Oxygen? Or maybe it's not an Oxygen-related issue and I should look for errors on the DITA-OT plugin side?

See attached images displaying the behavior.

Expected behavior in Case 1:

Unexpected behavior in Case 2:

Re: Transformation scenarios for parent map and submaps

Posted: Wed Apr 07, 2021 1:12 pm
by Radu

In general when in a DITA Map you refer to other DITA Maps, when publishing topic references from those submaps get brought together in the main DITA Map. In this process metadata information in those submaps might be lost as they are treated as transparent containers of topic references.
You can try an experiment, in the transformation scenario set in the Parameters list the "clean.temp" parameter to "no".
Publish the main DITA Map (which references the submaps) to PDF, then look in the transformation temporary folder, open from there the "mainDITAMapFileName_MERGED.xml", you will see that all the content from the submaps is now part of that merged file. The PDF plugin XSLT stylesheets get applied on the "_MERGED.xml" which has lost the metadata defined in the submaps.
Robert Anderson, the DITA Open Toolkit project manager worked on trying to preserve the submaps metadata when merging them in the main DITA Map:

but there is a step in one of the pre-processing stylesheets "OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/org.dita.base/xsl/preprocess/clean-map.xsl"

which filters out all those extra container elements from being used further on:

Code: Select all

  <xsl:template match="*[contains(@class, ' ditaot-d/submap-title ')]"/>
  <xsl:template match="*[contains(@class, ' ditaot-d/submap-topicmeta ')]"/>
  <xsl:template match="*[contains(@class, ' ditaot-d/submap-topicmeta-container ')]"/>
I think you could also ask on the DITA Users List, maybe Robert sees the question and has further info on that.


Re: Transformation scenarios for parent map and submaps

Posted: Thu Apr 08, 2021 10:15 am
by Grolribasi
Thank you for the detailed reply! Now I understand the issue better.

Re: Transformation scenarios for parent map and submaps

Posted: Fri May 07, 2021 8:34 am
by Radu

Coming back to this after a recent Slack discussion on the DITA OT Slack Channel, it seems you can add the property preprocess.clean-map-check.skip=true in the Oxygen transformation scenario Parameters list and the container elements which contain metadata for the sub maps will remain in the merged DITA Map and can be accessed from the XSLT customization.