Custom inheritance of metadatas from maps to topics

Post here questions and problems related to editing and publishing DITA content.
NicoAMP
Posts: 97
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Custom inheritance of metadatas from maps to topics

Post by NicoAMP »

Hi,

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.

Regards,
Nicolas
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
Radu
Posts: 9018
Joined: Fri Jul 09, 2004 5:18 pm

Re: Custom inheritance of metadatas from maps to topics

Post 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:depends="{depend.preprocess.move-meta-entries.pre}"
    dita:extension="depends org.dita.dost.platform.InsertDependsAction"
    unless="preprocess.move-meta-entries.skip"
    description="Move metadata entries">
    <pipeline message="Move metadata entries." taskname="move-meta"
      inputmap="${user.input.file}">
      <module class="org.dita.dost.module.MoveMetaModule">
        <param name="style" location="${dita.plugin.org.dita.base.dir}/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"/>
      </module>
    </pipeline>
  </target>
and at the Java code for the MoveMetaModule:
https://github.com/dita-ot/dita-ot/blob ... odule.java

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

            pushMetadata(mapSet);
            pullTopicMetadata(input, fis);
The second step "pullTopicMetadata" which takes metadata from topics and pushes it to maps seems to call the ${dita.plugin.org.dita.base.dir}/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);
            pushMetadata(mapSet);
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.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
NicoAMP
Posts: 97
Joined: Tue Mar 06, 2018 2:07 pm
Contact:

Re: Custom inheritance of metadatas from maps to topics

Post 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: https://www.dita-ot.org/3.5/release-notes/.
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.
Nicolas Delobel
AmeXio
nicolas.delobel at group.amexio.net
Post Reply