Question

I want to write custom xsl for DITA. I have three Dita maps like book.ditamap and chapter1.ditamap, chapter2.ditamap, I want fetch just titles which I gave in this ditamaps.

My book.ditamap looks like this:

<bookmap id="pdfnntd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:bookmap.xsd">

  <booktitle>
    <booklibrary>Books about stuff</booklibrary>
    <mainbooktitle>A book about one thing</mainbooktitle>
  </booktitle>

  <chapter href="chapter1.ditamap" format="ditamap"/>
  <chapter href="chapter2.ditamap" format="ditamap"/>
</bookmap>

My chapter1.ditamaplooks like this:

<map id="pdfnnt" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLenter code hereocation="urn:oasis:names:tc:dita:xsd:map.xsd">

  <topichead>
    <topicmeta>
      <navtitle>Threads</navtitle>
    </topicmeta>
    <topicref href="task/lesson1.xml" type="task"></topicref>
    <topicref href="task/lesson2.xml" type="task"></topicref>
  </topichead>
 </map>

For these ditamaps I want to write custom xsl in DITA. I searched in your website, I tried one example but DITA is taking default xsl only. Please help me out in this.

No correct solution

OTHER TIPS

I'm assuming you're looking to create this for a PDF transform. I recommend getting a copy of either DITA for Practitioners or DITA for Print. What you need to do is create a plugin to override the base XSL and extract using XPATH to grab both mainbooktitle and topicmeta/title (the exact xpath is more complex than what I've written here).

You haven't specified precisely what you want to do with the titles, so it's difficult to come up with a meaningful example.

HTH.

The DITA for Publishers project (dita4publishers.sourceforge.net) provides a general XSLT map-processing framework that you can use to do convenient processing on maps, including getting the effective navigation titles for topic refs. The D4P distribution includes a sample plugin, net.sourceforge.dita4publishers.graphviz/, that demonstrates how to use the code in the context of a relatively simple process (generating Graphviz diagrams for the navigation tree or back-of-the-book index of DITA maps).

Be sure to download the latest 0.9.19 release candidate, not the 0.9.18 package--I'm behind in getting an official release 0.9.19 together with updated documentation and so on, but the 0.9.19 code has many bug fixes that you will want.

Cheers,

Eliot

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top