0

I use the DITA Open Toolkit to convert my DITA files into CHM (HTML Help Worskhop) and tocjs (HTML) format.

I need to copy the content of 1 topic into all the others topics of my map (like a header file for example).

I tested to create a header template :

<xsl:template name="ShortDescriptionTemplate">
<p class="Dx:ShortDescription">
 <!--<xsl:apply-templates select="*[contains(@class,' topic/shortdesc ')]"/>-->
  <xsl:variable name="shortDv1"><xsl:apply-templates select="shortdesc"/></xsl:variable>
  <xsl:value-of select="normalize-space($shortDv1)"/>
</p><xsl:value-of select="$newline"/>   
</xsl:template>
<xsl:template match="/|node()|@*" mode="gen-user-header">
<div id="header">
  <xsl:if test="contains(@class,' topic/topic ')">
     <xsl:text>Bonjour 1</xsl:text><!-- Works!!! Displays on all topics -->
      <xsl:call-template name="ShortDescriptionTemplate"/>
     <!-- Doesn't Works!!! Displays on my shortdesc topic but nothing in the others topics-->
    <xsl:copy-of select="shortdesc"/> <!-- nothing in the others topics-->
</div>
</xsl:template>

Someone to help me ?

Thanks,

jelovirt
  • 5,844
  • 8
  • 38
  • 49
Tchob
  • 1

1 Answers1

0

See the documentation at http://dita-ot.sourceforge.net/1.6/

I don't use the latest version, but as recently as 1.6, you could set up a running header by using the parameter "args.hdr". Might be the same on the new one. See the topic on Ant parameters.

If you want to go another route you could use @conref. See " content inclusion" in the DITA specification at http://docs.oasis-open.org/dita/v1.2/os/spec/DITA1.2-spec.html

  • With the parameter "args.hdr", the type *.xml is mandatory ? Or I can use *.html, *.xslt ? Because I need to recover a data with a template xslt – Tchob Aug 18 '14 at 13:06
  • I created a header *.xml but nothing changed. I need to copy the content of 1 topic (the first topic) into all the others topics of my map. How I can do it to recover this text of this topic into a *.xml file ? I use the version 1.8.M2 – Tchob Aug 20 '14 at 15:04