lib/isodoc/itu/itu.service-publication.xsl in metanorma-itu-2.0.1 vs lib/isodoc/itu/itu.service-publication.xsl in metanorma-itu-2.0.2
- old
+ new
@@ -12,12 +12,11 @@
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
<xsl:variable name="debug">false</xsl:variable>
- <xsl:variable name="pageWidth" select="210"/>
- <xsl:variable name="pageHeight" select="297"/>
+
<xsl:variable name="marginLeftRight1" select="20"/>
<xsl:variable name="marginLeftRight2" select="20"/>
<xsl:variable name="marginTop" select="20"/>
<xsl:variable name="marginBottom" select="20"/>
@@ -1594,34 +1593,25 @@
</xsl:if>
</xsl:template>
- <xsl:template match="itu:legal-statement//itu:title | itu:license-statement//itu:title">
- <xsl:variable name="level">
- <xsl:call-template name="getLevel"/>
- </xsl:variable>
- <fo:block text-align="center" margin-top="6pt" role="H{$level}">
- <xsl:apply-templates/>
- </fo:block>
- </xsl:template>
-
<!-- ====== -->
<!-- ====== -->
- <xsl:template match="itu:legal-statement//itu:p | itu:license-statement//itu:p">
+ <xsl:template match="itu:legal-statement//itu:p | itu:license-statement//itu:p" priority="2">
<fo:block margin-top="6pt">
<xsl:apply-templates/>
</fo:block>
<xsl:if test="not(following-sibling::itu:p)"> <!-- last para -->
<fo:block margin-top="6pt"> </fo:block>
<fo:block margin-top="6pt"> </fo:block>
<fo:block margin-top="6pt"> </fo:block>
</xsl:if>
</xsl:template>
- <xsl:template match="itu:copyright-statement//itu:p">
+ <xsl:template match="itu:copyright-statement//itu:p" priority="2">
<fo:block>
<xsl:if test="not(preceding-sibling::itu:p)"> <!-- first para -->
<xsl:attribute name="text-align">center</xsl:attribute>
<xsl:attribute name="margin-top">6pt</xsl:attribute>
<xsl:attribute name="margin-bottom">14pt</xsl:attribute>
@@ -1682,11 +1672,11 @@
</xsl:if>
</fo:block>
<!-- <xsl:if test="following-sibling::itu:table">
<fo:block space-after="18pt"> </fo:block>
</xsl:if> -->
- </xsl:template>
+ </xsl:template> <!-- preferred -->
<xsl:template match="itu:term[itu:preferred]/itu:termsource" priority="2"/>
<xsl:template match="itu:definition/itu:p" priority="2"/>
@@ -1705,10 +1695,14 @@
</fo:block>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
+ <xsl:template match="itu:definition/*" mode="process">
+ <xsl:apply-templates select="."/>
+ </xsl:template>
+
<!-- footnotes for title -->
<xsl:template match="itu:bibdata/itu:note[@type = 'title-footnote']" mode="title_footnote">
<xsl:variable name="number" select="position()"/>
<fo:footnote>
<fo:inline font-size="60%" keep-with-previous.within-line="always" vertical-align="super">
@@ -1778,51 +1772,46 @@
<xsl:if test="preceding-sibling::*[1][local-name() = 'title'] and $doctype != 'service-publication'">
<fo:block padding-top="-8pt" font-size="1pt"> </fo:block>
</xsl:if>
<xsl:choose>
<xsl:when test="$doctype = 'service-publication'">
- <xsl:apply-templates/>
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
</xsl:when>
<xsl:otherwise>
<fo:list-block>
<xsl:if test="$doctype = 'service-publication'">
<xsl:attribute name="provisional-distance-between-starts">0mm</xsl:attribute>
</xsl:if>
- <xsl:apply-templates/>
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
</fo:list-block>
</xsl:otherwise>
</xsl:choose>
- <xsl:apply-templates select="./itu:note" mode="process"/>
+ <xsl:apply-templates select="./itu:note"/>
<xsl:if test="../@inline-header='true'">
<fo:block><xsl:value-of select="$linebreak"/></fo:block>
</xsl:if>
</xsl:template>
- <xsl:template match="itu:ul//itu:note | itu:ol//itu:note" priority="2"/>
- <xsl:template match="itu:ul//itu:note | itu:ol//itu:note" mode="process">
+ <xsl:template match="itu:ul//itu:note | itu:ol//itu:note" priority="2">
<fo:block id="{@id}">
<xsl:apply-templates select="itu:name"/>
- <xsl:apply-templates select="node()[not(local-name() = 'name')]" mode="process"/>
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
</fo:block>
</xsl:template>
- <xsl:template match="itu:ul//itu:note/itu:name | itu:ol//itu:note/itu:name" mode="process" priority="2"/>
- <xsl:template match="itu:ul//itu:note/itu:p | itu:ol//itu:note/itu:p" mode="process" priority="2">
+
+ <xsl:template match="itu:ul//itu:note/itu:p | itu:ol//itu:note/itu:p" priority="3">
<fo:block font-size="11pt" margin-top="4pt">
<xsl:apply-templates/>
</fo:block>
</xsl:template>
- <xsl:template match="itu:ul//itu:note/* | itu:ol//itu:note/*" mode="process">
- <xsl:apply-templates select="."/>
- </xsl:template>
-
<xsl:template match="itu:li">
<xsl:choose>
<xsl:when test="$doctype = 'service-publication'">
<fo:block id="{@id}">
- <xsl:apply-templates/>
- <xsl:apply-templates select=".//itu:note" mode="process"/>
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
+ <xsl:apply-templates select="./itu:note"/>
</fo:block>
<xsl:if test="following-sibling::itu:li">
<fo:block> </fo:block>
</xsl:if>
</xsl:when>
@@ -1865,12 +1854,12 @@
<fo:block>
<!-- <xsl:if test="$doctype = 'service-publication'">
<xsl:attribute name="start-indent">7mm</xsl:attribute>
<xsl:attribute name="text-indent">7mm</xsl:attribute>
</xsl:if> -->
- <xsl:apply-templates/>
- <xsl:apply-templates select=".//itu:note" mode="process"/>
+ <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
+ <xsl:apply-templates select="./itu:note"/>
</fo:block>
</fo:block-container>
</fo:block-container>
</fo:list-item-body>
</fo:list-item>
@@ -1952,16 +1941,10 @@
</fo:table-row>
</fo:table-body>
</fo:table>
</xsl:template>
-
- <xsl:template match="itu:formula" mode="process">
- <xsl:call-template name="formula"/>
- </xsl:template>
-
-
<xsl:template name="insertHeaderFooter">
<fo:static-content flow-name="footer-even" font-family="Times New Roman" font-size="11pt" role="artifact">
<fo:block-container height="19mm" display-align="after">
<fo:table table-layout="fixed" width="100%" display-align="after">
@@ -2162,11 +2145,15 @@
<xsl:with-param name="text" select="substring($text, 2)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
-<xsl:variable name="titles_">
+<xsl:variable name="pageWidth_">
+ 210
+ </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
+ 297
+ </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="titles_">
<title-edition lang="en">
<xsl:text>Edition </xsl:text>
@@ -2265,10 +2252,63 @@
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
+
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
+
+
+ </xsl:attribute-set><xsl:attribute-set name="copyright-statement-p-style">
+
+
+
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-style">
+
+
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-title-style">
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
+
+
+
+ <xsl:attribute name="text-align">center</xsl:attribute>
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
+
+
+
+
+ </xsl:attribute-set><xsl:attribute-set name="license-statement-p-style">
+
+
+
+
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-style">
+
+
+
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-title-style">
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
+
+ <xsl:attribute name="text-align">center</xsl:attribute>
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
+
+
+
+
+
+ </xsl:attribute-set><xsl:attribute-set name="legal-statement-p-style">
+
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-style">
+
+
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-title-style">
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
+
+ </xsl:attribute-set><xsl:attribute-set name="feedback-statement-p-style">
+
+
</xsl:attribute-set><xsl:attribute-set name="link-style">
@@ -3085,10 +3125,11 @@
<xsl:attribute name="margin-top">6pt</xsl:attribute>
<xsl:attribute name="margin-left">14mm</xsl:attribute>
<xsl:attribute name="text-indent">-14mm</xsl:attribute>
+
</xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-style">
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
<xsl:attribute name="font-size">65%</xsl:attribute>
@@ -3195,10 +3236,77 @@
</xsl:for-each>
</xsl:template><xsl:template match="text()">
<xsl:value-of select="."/>
</xsl:template><xsl:template match="*[local-name()='br']">
<xsl:value-of select="$linebreak"/>
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
+ <fo:block xsl:use-attribute-sets="copyright-statement-style">
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='title']">
+
+ <!-- process in the template 'title' -->
+ <xsl:call-template name="title"/>
+
+ </xsl:template><xsl:template match="*[local-name()='copyright-statement']//*[local-name()='p']">
+
+
+ <!-- process in the template 'paragraph' -->
+ <xsl:call-template name="paragraph"/>
+
+ </xsl:template><xsl:template match="*[local-name()='license-statement']">
+ <fo:block xsl:use-attribute-sets="license-statement-style">
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='title']">
+
+ <xsl:variable name="level">
+ <xsl:call-template name="getLevel"/>
+ </xsl:variable>
+ <fo:block role="H{$level}" xsl:use-attribute-sets="license-statement-title-style">
+ <xsl:apply-templates/>
+ </fo:block>
+
+ </xsl:template><xsl:template match="*[local-name()='license-statement']//*[local-name()='p']">
+
+ <!-- process in the template 'paragraph' -->
+ <xsl:call-template name="paragraph"/>
+
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']">
+ <fo:block xsl:use-attribute-sets="legal-statement-style">
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='title']">
+
+ <!-- ogc-white-paper rsd -->
+ <xsl:variable name="level">
+ <xsl:call-template name="getLevel"/>
+ </xsl:variable>
+ <fo:block role="H{$level}" xsl:use-attribute-sets="legal-statement-title-style">
+ <xsl:apply-templates/>
+ </fo:block>
+
+
+ </xsl:template><xsl:template match="*[local-name()='legal-statement']//*[local-name()='p']">
+
+ <!-- process in the template 'paragraph' -->
+ <xsl:call-template name="paragraph"/>
+
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']">
+ <fo:block xsl:use-attribute-sets="feedback-statement-style">
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='title']">
+
+ <!-- process in the template 'title' -->
+ <xsl:call-template name="title"/>
+
+ </xsl:template><xsl:template match="*[local-name()='feedback-statement']//*[local-name()='p']">
+
+ <!-- process in the template 'paragraph' -->
+ <xsl:call-template name="paragraph"/>
+
</xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
<!-- <xsl:call-template name="add-zero-spaces"/> -->
<xsl:call-template name="add-zero-spaces-java"/>
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
@@ -3345,11 +3453,11 @@
<xsl:choose>
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
</xsl:when>
<xsl:otherwise>
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer and note that renders separaterely -->
</xsl:otherwise>
</xsl:choose>
</fo:table>
@@ -3562,11 +3670,11 @@
</xsl:for-each>
</xsl:variable>
<xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
- </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
+ </xsl:template><xsl:template match="*[local-name()='thead']">
<xsl:param name="cols-count"/>
<fo:table-header>
<xsl:apply-templates/>
@@ -3587,17 +3695,17 @@
</fo:table-row>
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
<fo:table-body>
<xsl:apply-templates/>
</fo:table-body>
- </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
+ </xsl:template><xsl:template match="*[local-name()='tfoot']">
<xsl:apply-templates/>
</xsl:template><xsl:template name="insertTableFooter">
<xsl:param name="cols-count"/>
<xsl:if test="../*[local-name()='tfoot']">
<fo:table-footer>
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
+ <xsl:apply-templates select="../*[local-name()='tfoot']"/>
</fo:table-footer>
</xsl:if>
</xsl:template><xsl:template name="insertTableFooterInSeparateTable">
<xsl:param name="table_attributes"/>
<xsl:param name="colwidths"/>
@@ -3698,11 +3806,11 @@
<!-- for BSI (not PAS) display Notes before footnotes -->
<!-- except gb and bsi -->
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
+ <xsl:apply-templates select="../*[local-name()='note']"/>
<!-- horizontal row separator -->
@@ -3736,11 +3844,11 @@
</xsl:choose>
</xsl:variable>
- <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
+ <xsl:apply-templates select="../*[local-name()='thead']">
<xsl:with-param name="cols-count" select="$cols-count"/>
</xsl:apply-templates>
<xsl:call-template name="insertTableFooter">
<xsl:with-param name="cols-count" select="$cols-count"/>
@@ -3905,11 +4013,11 @@
<xsl:apply-templates/>
</fo:block>
</fo:table-cell>
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
<fo:block xsl:use-attribute-sets="table-note-style">
@@ -3928,14 +4036,14 @@
</fo:inline>
- <xsl:apply-templates select="node()[not(local-name() = 'name')]" mode="process"/>
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
</fo:block>
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" priority="2">
<xsl:apply-templates/>
</xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
<!-- list of footnotes to calculate actual footnotes number -->
<xsl:variable name="p_fn_">
@@ -4476,11 +4584,13 @@
<td>
<xsl:apply-templates/>
</td>
<td>
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
+ <xsl:with-param name="process">true</xsl:with-param>
+ </xsl:apply-templates>
</td>
</tr>
</xsl:template><xsl:template match="*[local-name()='dt']">
@@ -4513,19 +4623,24 @@
<fo:block>
<xsl:attribute name="text-align">justify</xsl:attribute>
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
+ <xsl:with-param name="process">true</xsl:with-param>
+ </xsl:apply-templates>
</fo:block>
</fo:table-cell>
</fo:table-row>
</xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
<xsl:apply-templates/>
- </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
- <xsl:apply-templates select="@language"/>
- <xsl:apply-templates/>
+ </xsl:template><xsl:template match="*[local-name()='dd']">
+ <xsl:param name="process">false</xsl:param>
+ <xsl:if test="$process = 'true'">
+ <xsl:apply-templates select="@language"/>
+ <xsl:apply-templates/>
+ </xsl:if>
</xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
</xsl:template><xsl:template match="*[local-name()='em']">
<fo:inline font-style="italic">
<xsl:apply-templates/>
@@ -4696,11 +4811,15 @@
<xsl:if test="string-length($text) > 1">
<xsl:call-template name="recursiveSmallCaps">
<xsl:with-param name="text" select="substring($text,2)"/>
</xsl:call-template>
</xsl:if>
- </xsl:template><xsl:template name="tokenize">
+ </xsl:template><xsl:template match="*[local-name() = 'pagebreak']">
+ <fo:block break-after="page"/>
+ <fo:block> </fo:block>
+ <fo:block break-after="page"/>
+ </xsl:template><xsl:template name="tokenize">
<xsl:param name="text"/>
<xsl:param name="separator" select="' '"/>
<xsl:choose>
<xsl:when test="not(contains($text, $separator))">
<word>
@@ -5128,14 +5247,14 @@
</xsl:otherwise>
</xsl:choose>
</fo:inline>
</xsl:template><xsl:template match="*[local-name()='appendix']">
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
- <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
+ <xsl:apply-templates select="*[local-name()='title']"/>
</fo:block>
- <xsl:apply-templates/>
- </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
+ <xsl:apply-templates select="node()[not(local-name()='title')]"/>
+ </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" priority="2">
<xsl:variable name="level">
<xsl:call-template name="getLevel"/>
</xsl:variable>
<fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
</xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
@@ -5757,22 +5876,27 @@
<xsl:value-of select="."/>
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
<xsl:value-of select="."/>
</xsl:template><xsl:template match="node()" mode="contents">
<xsl:apply-templates mode="contents"/>
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="2" mode="contents">
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="2" mode="contents">
<xsl:variable name="level">
<xsl:call-template name="getLevel">
<xsl:with-param name="depth" select="@depth"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="section">
- <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
+ <xsl:choose>
+ <xsl:when test="@type = 'section-title'"/>
+ <xsl:otherwise>
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:variable>
- <xsl:variable name="type">floating-title</xsl:variable>
+ <xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable>
<xsl:variable name="display">
<xsl:choose>
<xsl:when test="normalize-space(@id) = ''">false</xsl:when>
<xsl:when test="$level <= $toc_level">true</xsl:when>
@@ -5785,11 +5909,20 @@
<xsl:if test="$skip = 'false'">
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="*[local-name() = 'tab']">
- <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
+ <xsl:choose>
+ <xsl:when test="@type = 'section-title'">
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
+ <xsl:text>: </xsl:text>
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:copy-of select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="node()"/>
</xsl:otherwise>
</xsl:choose>
@@ -7385,11 +7518,11 @@
</svg>
</fo:instream-foreign-object>
</fo:inline>
</xsl:template><xsl:template match="@language">
<xsl:copy-of select="."/>
- </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title' or @type = 'section-title']" priority="4">
<xsl:call-template name="title"/>
</xsl:template><xsl:template match="*[local-name() = 'admonition']">
@@ -7450,31 +7583,21 @@
<xsl:param name="format" select="'short'"/>
<xsl:variable name="year" select="substring($date, 1, 4)"/>
<xsl:variable name="month" select="substring($date, 6, 2)"/>
<xsl:variable name="day" select="substring($date, 9, 2)"/>
<xsl:variable name="monthStr">
- <xsl:choose>
- <xsl:when test="$month = '01'">january</xsl:when>
- <xsl:when test="$month = '02'">february</xsl:when>
- <xsl:when test="$month = '03'">march</xsl:when>
- <xsl:when test="$month = '04'">april</xsl:when>
- <xsl:when test="$month = '05'">may</xsl:when>
- <xsl:when test="$month = '06'">june</xsl:when>
- <xsl:when test="$month = '07'">july</xsl:when>
- <xsl:when test="$month = '08'">august</xsl:when>
- <xsl:when test="$month = '09'">september</xsl:when>
- <xsl:when test="$month = '10'">october</xsl:when>
- <xsl:when test="$month = '11'">november</xsl:when>
- <xsl:when test="$month = '12'">december</xsl:when>
- </xsl:choose>
+ <xsl:call-template name="getMonthByNum">
+ <xsl:with-param name="num" select="$month"/>
+ <xsl:with-param name="lowercase" select="'true'"/>
+ </xsl:call-template>
</xsl:variable>
<xsl:variable name="monthStr_localized">
<xsl:if test="normalize-space($monthStr) != ''"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_<xsl:value-of select="$monthStr"/></xsl:with-param></xsl:call-template></xsl:if>
</xsl:variable>
<xsl:variable name="result">
<xsl:choose>
- <xsl:when test="$format = 'ddMMyyyy'">
+ <xsl:when test="$format = 'ddMMyyyy'"> <!-- convert date from format 2007-04-01 to 1 April 2007 -->
<xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
<xsl:text> </xsl:text>
<xsl:value-of select="normalize-space(concat($monthStr_localized, ' ' , $year))"/>
</xsl:when>
<xsl:when test="$format = 'ddMM'">
@@ -7483,15 +7606,61 @@
</xsl:when>
<xsl:when test="$format = 'short' or $day = ''">
<xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $year))"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/>
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/> <!-- January 01, 2022 -->
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$result"/>
+ </xsl:template><xsl:template name="getMonthByNum">
+ <xsl:param name="num"/>
+ <xsl:param name="lang">en</xsl:param>
+ <xsl:param name="lowercase">false</xsl:param> <!-- return 'january' instead of 'January' -->
+ <xsl:variable name="monthStr_">
+ <xsl:choose>
+ <xsl:when test="$lang = 'fr'">
+ <xsl:choose>
+ <xsl:when test="$num = '01'">Janvier</xsl:when>
+ <xsl:when test="$num = '02'">Février</xsl:when>
+ <xsl:when test="$num = '03'">Mars</xsl:when>
+ <xsl:when test="$num = '04'">Avril</xsl:when>
+ <xsl:when test="$num = '05'">Mai</xsl:when>
+ <xsl:when test="$num = '06'">Juin</xsl:when>
+ <xsl:when test="$num = '07'">Juillet</xsl:when>
+ <xsl:when test="$num = '08'">Août</xsl:when>
+ <xsl:when test="$num = '09'">Septembre</xsl:when>
+ <xsl:when test="$num = '10'">Octobre</xsl:when>
+ <xsl:when test="$num = '11'">Novembre</xsl:when>
+ <xsl:when test="$num = '12'">Décembre</xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$num = '01'">January</xsl:when>
+ <xsl:when test="$num = '02'">February</xsl:when>
+ <xsl:when test="$num = '03'">March</xsl:when>
+ <xsl:when test="$num = '04'">April</xsl:when>
+ <xsl:when test="$num = '05'">May</xsl:when>
+ <xsl:when test="$num = '06'">June</xsl:when>
+ <xsl:when test="$num = '07'">July</xsl:when>
+ <xsl:when test="$num = '08'">August</xsl:when>
+ <xsl:when test="$num = '09'">September</xsl:when>
+ <xsl:when test="$num = '10'">October</xsl:when>
+ <xsl:when test="$num = '11'">November</xsl:when>
+ <xsl:when test="$num = '12'">December</xsl:when>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:choose>
+ <xsl:when test="normalize-space($lowercase) = 'true'">
+ <xsl:value-of select="java:toLowerCase(java:java.lang.String.new($monthStr_))"/>
+ </xsl:when>
+ <xsl:otherwise><xsl:value-of select="$monthStr_"/></xsl:otherwise>
+ </xsl:choose>
</xsl:template><xsl:template name="insertKeywords">
<xsl:param name="sorting" select="'true'"/>
<xsl:param name="charAtEnd" select="'.'"/>
<xsl:param name="charDelim" select="', '"/>
<xsl:choose>
@@ -7948,9 +8117,28 @@
<xsl:otherwise>
<xsl:value-of select="$value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
+ </xsl:template><xsl:template name="number-to-ordinal">
+ <xsl:param name="number"/>
+ <xsl:param name="curr_lang"/>
+ <xsl:choose>
+ <xsl:when test="$curr_lang = 'fr'">
+ <xsl:choose>
+ <xsl:when test="$number = '1'">re</xsl:when>
+ <xsl:otherwise>e</xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <xsl:when test="$number = 1">st</xsl:when>
+ <xsl:when test="$number = 2">nd</xsl:when>
+ <xsl:when test="$number = 3">rd</xsl:when>
+ <xsl:otherwise>th</xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template><xsl:template name="setAltText">
<xsl:param name="value"/>
<xsl:attribute name="fox:alt-text">
<xsl:choose>
<xsl:when test="normalize-space($value) != ''">
\ No newline at end of file