Transformation scenarios for parent map and submaps

Grolribasi
Posts: 2
Joined: Tue Apr 06, 2021 3:44 pm

Transformation scenarios for parent map and submaps

Post by Grolribasi » Tue Apr 06, 2021 4:19 pm

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]"
    xml:lang="ru-ru">
    <title>Document title</title>
    <topicmeta>
        <prodinfo>
            <prodname>Our product</prodname>
            <prognum>1.0</prognum>
        </prodinfo>
        <othermeta name="docver" content="1.0"/>
    </topicmeta>
    ...
    </map>
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:
https://gifyu.com/image/YFP1

Unexpected behavior in Case 2:
https://gifyu.com/image/YFPB

Radu
Posts: 7428
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transformation scenarios for parent map and submaps

Post by Radu » Wed Apr 07, 2021 1:12 pm

Hi,

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:
https://github.com/dita-ot/dita-ot/pull/2739

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.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Grolribasi
Posts: 2
Joined: Tue Apr 06, 2021 3:44 pm

Re: Transformation scenarios for parent map and submaps

Post by Grolribasi » Thu Apr 08, 2021 10:15 am

Thank you for the detailed reply! Now I understand the issue better.

Radu
Posts: 7428
Joined: Fri Jul 09, 2004 5:18 pm

Re: Transformation scenarios for parent map and submaps

Post by Radu » Fri May 07, 2021 8:34 am

Hi,

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.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply