Page 1 of 1
Custom inheritance of metadatas from maps to topics
Posted: Thu Jun 18, 2020 6:14 pm
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
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: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
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:
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.