On 01/24/2019 11:46 AM, Grundtvig Nielsen Niels wrote:
Good morning! the upgrade debate continues, but for the time being I’m
still quite happily working with 7.6.0. I’ve started looking at a
potential new project, and have a fairly clear question: when I use
<created> and <revised> in DITA topics and then generate WebHelp, what
needs to be done to display these dates in the output html?



I’m not requesting step-by-step instructions, just a pointer so I can
take the question farther in-house. Thanks in advance!



Elements critdates/created and critdates/revised are processed by XSLT template:
---
  <xsl:template name="titlePage_lastCritdate">
    <xsl:variable name="date"
select="*[contains(@class,' map/topicmeta ')]/*[contains(@class,' topic/critdates ')]/*[last()]"/>
    <xsl:if test="exists($date)">
      <xsl:variable name="lang">
        <xsl:call-template name="lang"/>
      </xsl:variable>

      <div class="last-critdate">
        <xsl:choose>
          <xsl:when test="exists($date/@golive)">
<xsl:value-of select="Date:format(string($date/@golive), $lang)"/>
          </xsl:when>
          <xsl:when test="exists($date/@modified)">
<xsl:value-of select="Date:format(string($date/@modified), $lang)"/>
          </xsl:when>
          <xsl:when test="exists($date/@date)">
<xsl:value-of select="Date:format(string($date/@date), $lang)"/>
          </xsl:when>
        </xsl:choose>
      </div>
    </xsl:if>
  </xsl:template>
---

This XSLT template is found:

* In XXE distribution: XXE_install_dir/addon/config/dita/xsl/xhtml/ditac_titlePage.xsl

* In ditac distribution: ditact_install_dir/xsl/xhtml/ditac_titlePage.xsl

This XSLT template formats the date found in very last created or revised element and adds it to the "title page" of the web help.

For example:
---
  ...
    <critdates>
      <created date="2009-09-17" golive="2009-09-23"/>
      ...
      <revised golive="2018-08-21" modified="2018-08-16"/>
      <revised golive="2018-11-29" modified="2018-11-29"/>
    </critdates>
  </bookmeta>
---

gives the following "title page":

http://www.xmlmind.com/ditac/_distrib/doc/manual/webhelp/index.html

--> If you just want to add more information to the "title page" of the web help, suffice to redefine XSLT template "titlePage_lastCritdate".

--> If you want to use created or revised elements elsewhere, then you need to understand how ditac works, for example, what is the ditac:titlePage element generated during the DITA preprocessing step. See "Chapter 11. Extensive customization", http://www.xmlmind.com/ditac/_distrib/doc/manual/howItWorks.html#howItWorks



--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to