Page 1 of 1

Custom inheritance of metadatas from maps to topics

Posted: Thu Jun 18, 2020 6:14 pm
by NicoAMP

I would like, for HTML5 output, to change behavior of inheritance of metadatas from maps to topics.
It seems that is made in move-meta-entries implemented in java.

I don't know where and how can I modify this behavior?

Thanks for any help.


Re: Custom inheritance of metadatas from maps to topics

Posted: Fri Jun 19, 2020 8:06 am
by Radu
Hi Nicolas,

I do not know much about how this works, I looked a little bit at how the "move-meta-entries" is defined in the build files:

Code: Select all

 <target name="move-meta-entries" 
    dita:extension="depends org.dita.dost.platform.InsertDependsAction"
    description="Move metadata entries">
    <pipeline message="Move metadata entries." taskname="move-meta"
      <module class="org.dita.dost.module.MoveMetaModule">
        <param name="style" location="${}/xsl/preprocess/mappull.xsl"/>
        <param name="conserve-memory" expression="${conserve-memory}" if:set="conserve-memory"/>
        <dita:extension id="dita.preprocess.mappull.param" behavior="org.dita.dost.platform.InsertAction"/>
and at the Java code for the MoveMetaModule: ...

It seems to have two stages, one which pushes content from map to topics, and one which pulls content from topics to the map:

Code: Select all

            pullTopicMetadata(input, fis);
The second step "pullTopicMetadata" which takes metadata from topics and pushes it to maps seems to call the ${}/xsl/preprocess/mappull.xsl stylesheet so this would mean you have a chance to make changes in XSLT.
But the step which takes metadata from the map and pushes it to topics is Java based:

Code: Select all

            final Map<URI, Map<String, Element>> mapSet = getMapMetadata(fis);
There is a "org.dita.dost.reader.MapMetaReader" which seems to create a map of element names which will later be pushed to each topic.


Re: Custom inheritance of metadatas from maps to topics

Posted: Tue Jun 23, 2020 3:06 pm
by NicoAMP
Hi Radu,

Thanks for these informations and for your help.

But I just saw that my expected behavior is now implemented in DITA OT 3.5:
The DITA 1.x specification defines cascade behaviors for maps such that <othermeta> and <source> do not cascade to child <topicref> elements. In earlier releases the mappull stage of processing pushed these to nested elements; that behavior is now corrected to match the specification.