Add revised and modified date information within topic body
Posted: Sun Sep 18, 2022 1:58 pm
Hello, everyone!
I want to insert right after the main topic title the revised and modified dates values accessible from the critdates element (btw, it's for an HTML5 transtype and I have a dedicated plugin).
I want to apply my xslt to an existing template (based on the class topic/body), but I noticed two inconsistencies:
1. the created date attribute is applied for every topic even when there is no critdates declaration in it
2. the @date attribute value that is inserted in every topic is repeated whereas several topics have different dates declared... For now, my xslt uses this declaration:
Would you have any idea of the problem?
I want to insert right after the main topic title the revised and modified dates values accessible from the critdates element (btw, it's for an HTML5 transtype and I have a dedicated plugin).
I want to apply my xslt to an existing template (based on the class topic/body), but I noticed two inconsistencies:
1. the created date attribute is applied for every topic even when there is no critdates declaration in it
2. the @date attribute value that is inserted in every topic is repeated whereas several topics have different dates declared... For now, my xslt uses this declaration:
Code: Select all
<xsl:template match="*[contains(@class, ' topic/body ')]" name="topic.body">
<!-- Here is my declaration for critdates -->
<div>
<xsl:choose>
<xsl:when test="*/critdates/created/@date > 0">
Date of creation:
<xsl:value-of select="/concept/prolog/critdates/created/@date"/>
</xsl:when>
<xsl:otherwise>Error:
<xsl:value-of select="/concept/prolog/critdates/created/@date"/>
</xsl:otherwise>
</xsl:choose>
</div>
<div>
<xsl:call-template name="commonattributes"/>
<xsl:call-template name="setidaname"/>
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-startprop ')]" mode="out-of-line"/>
<xsl:apply-templates select="preceding-sibling::*[contains(@class, ' topic/abstract ')]" mode="outofline"/>
<xsl:apply-templates select="preceding-sibling::*[contains(@class, ' topic/shortdesc ')]" mode="outofline"/>
<xsl:apply-templates select="following-sibling::*[contains(@class, ' topic/related-links ')]" mode="prereqs"/>
<xsl:apply-templates/>
<xsl:apply-templates select="*[contains(@class, ' ditaot-d/ditaval-endprop ')]" mode="out-of-line"/>
</div>
</xsl:template>