Topics

Override Topic title with @navtitle #XSLT


Shaurabh
 

I have a scenario where i need to override Topic title with navtitle value in frontmatter using xslt. Being new to DITA, i am unaware of any approach to achieve it. Below is the sample given.
Title in the output file should be "Story Book"(given in navtitle) instead of title(Poem) given in dita file. Please help.

#Main.ditamap

<bookmap rev="3" dms_docid="xyz123" id="xyz123" doc_type="Story book">
    <booktitle>
        <mainbooktitle>Stories</mainbooktitle>
    </booktitle>
    <frontmatter class="- map/topicref bookmap/frontmatter ">
        <topicref navtitle="Story Book" format="dita" href="ab12_Story.dita" type="concept"
            class="- map/topicref "/>
    </frontmatter>
    <chapter navtitle="Detailed Story" locktitle="yes">
        <topicref href="UserStory1.dita"/>
    </chapter>
    <backmatter class="- map/topicref bookmap/backmatter ">
        <amendments format="dita" href="xyz123_history.dita" type="concept"
            class="- map/topicref bookmap/amendments "/>
    </backmatter>
</bookmap>


#UserStory1.dita
 
<concept id="concept_123">
    <title>Poem</title>
    <conbody>
        <section id="section_567">
            <p>This Book contains children stories aged between 5 - 8 years.</p>
        </section>
    </conbody>
</concept>


Kristen James Eberlein
 

Add lock title=“yes” to the <topicref> element. Be aware that the @alt attribute has been deprecated since 2010; you should be using <alt>.

Kris


On Mar 31, 2021, at 7:34 AM, Shaurabh via groups.io <shaurabh.prakash-ext@...> wrote:

I have a scenario where i need to override Topic title with navtitle value in frontmatter using xslt. Being new to DITA, i am unaware of any approach to achieve it. Below is the sample given.
Title in the output file should be "Story Book"(given in navtitle) instead of title(Poem) given in dita file. Please help.

#Main.ditamap

<bookmap rev="3" dms_docid="xyz123" id="xyz123" doc_type="Story book">
    <booktitle>
        <mainbooktitle>Stories</mainbooktitle>
    </booktitle>
    <frontmatter class="- map/topicref bookmap/frontmatter ">
        <topicref navtitle="Story Book" format="dita" href="ab12_Story.dita" type="concept"
            class="- map/topicref "/>
    </frontmatter>
    <chapter navtitle="Detailed Story" locktitle="yes">
        <topicref href="UserStory1.dita"/>
    </chapter>
    <backmatter class="- map/topicref bookmap/backmatter ">
        <amendments format="dita" href="xyz123_history.dita" type="concept"
            class="- map/topicref bookmap/amendments "/>
    </backmatter>
</bookmap>


#UserStory1.dita
 
<concept id="concept_123">
    <title>Poem</title>
    <conbody>
        <section id="section_567">
            <p>This Book contains children stories aged between 5 - 8 years.</p>
        </section>
    </conbody>
</concept>


Toshihiko Makita
 

Shaurabh is using @navtitle rather than @alt.

Also there is DITA-OT bug I've experienced even if you use topicmeta/navititle instead of @navtitle:

topicmeta/navtitle is overridden by topic/title even if @locktitle="yes" #3708
https://github.com/dita-ot/dita-ot/issues/3708


Kristen James Eberlein
 

So, embace the future; with DITA 2.0, @alt, @navtitle, and @locktitle are all removed. <grin/>

Shaurabh, what processor are you using? If you are using the DITA-OT, what version?

Best,
Kris

Kristen James Eberlein
Chair, OASIS DITA Technical Committee
OASIS Distinguished Contributor
Principal consultant, Eberlein Consulting LLC
www.eberleinconsulting.com
+1 919 622-1501; kriseberlein (skype)


On 3/31/2021 10:09 AM, Toshihiko Makita via groups.io wrote:
Shaurabh is using @navtitle rather than @alt.

Also there is DITA-OT bug I've experienced even if you use topicmeta/navititle instead of @navtitle:

topicmeta/navtitle is overridden by topic/title even if @locktitle="yes" #3708
https://github.com/dita-ot/dita-ot/issues/3708


ajay.soam@...
 

We are using DITA-OT 3.5.4 version. thx


Shaurabh
 

Even though Toshihiko mentioned that it seems a known bug, i thought of giving them a try. I tried few other approaches as well using XSLT, but no success. As already mentioned by Ajay, we are using DITA-OT 3.5.4 version. Please let me know if there is any other work around to achieve above mentioned scenario.

Thanks