lib/isodoc/itu/itu.implementers-guide.xsl in metanorma-itu-2.2.15 vs lib/isodoc/itu/itu.implementers-guide.xsl in metanorma-itu-2.3.0
- old
+ new
@@ -32,22 +32,24 @@
<item id="term-script" display="false">3.2</item>
-->
<xsl:variable name="contents_">
<contents>
<!-- <xsl:apply-templates select="/itu:itu-standard/itu:preface/node()" mode="contents"/> -->
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" mode="contents"/> <!-- @id = 'scope' -->
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" mode="contents" /> -->
<!-- Normative references -->
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" mode="contents"/> <!-- @id = 'references' -->
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" mode="contents" />
+
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" mode="contents" />
+
+ <xsl:apply-templates select="/itu:itu-standard/itu:annex" mode="contents"/> -->
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" mode="contents"/> <!-- @id != 'scope' -->
-
- <xsl:apply-templates select="/itu:itu-standard/itu:annex" mode="contents"/>
-
<!-- Bibliography -->
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]" mode="contents"/> <!-- @id = 'bibliography' -->
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]" mode="contents"/> -->
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
+
<xsl:apply-templates select="//itu:table" mode="contents"/>
<xsl:call-template name="processTablesFigures_Contents">
<xsl:with-param name="always" select="$doctype = 'technical-report' or $doctype = 'technical-paper'"/>
</xsl:call-template>
@@ -1067,76 +1069,79 @@
</xsl:otherwise>
</xsl:choose>
<fo:flow flow-name="xsl-region-body">
- <xsl:if test="$doctype != 'service-publication'">
- <fo:block-container font-size="14pt">
+ <!-- <xsl:if test="$doctype != 'service-publication' and 1 = 2">
+ <fo:block-container font-size="14pt" >
<xsl:choose>
<xsl:when test="$doctype = 'resolution'">
<fo:block text-align="center">
<xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type='resolution' and @language = $lang]"/>
</fo:block>
</xsl:when>
- <xsl:when test="$doctype = 'implementers-guide'"/>
- <xsl:when test="$doctype = 'recommendation-supplement'">
+ <xsl:when test="$doctype = 'implementers-guide'"></xsl:when>
+ <xsl:when test="$doctype = 'recommendation-supplement'">
<fo:block font-weight="bold">
<xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU-Supplement-Internal']"/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block font-weight="bold">
<xsl:value-of select="$doctypeTitle"/>
- <xsl:text> </xsl:text>
+ <xsl:text> </xsl:text>
<xsl:value-of select="$docname"/>
</fo:block>
</xsl:otherwise>
</xsl:choose>
-
+
<fo:block font-weight="bold" text-align="center" margin-top="15pt" margin-bottom="15pt" role="H1">
<xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = $lang]"/>
-
+
<xsl:variable name="subtitle" select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'subtitle' and @language = $lang]"/>
<xsl:if test="$subtitle != ''">
<fo:block margin-top="18pt" font-weight="normal" font-style="italic">
- <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
+ <xsl:if test="$lang = 'ar'">
<xsl:attribute name="font-style">normal</xsl:attribute>
</xsl:if>
<xsl:value-of select="$subtitle"/>
- </fo:block>
+ </fo:block>
</xsl:if>
-
+
<xsl:variable name="resolution-placedate" select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'resolution-placedate' and @language = $lang]"/>
<xsl:if test="$doctype = 'resolution' and $resolution-placedate != ''">
<fo:block font-size="11pt" margin-top="6pt" font-weight="normal">
<fo:inline font-style="italic">
- <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
+ <xsl:if test="$lang = 'ar'">
<xsl:attribute name="font-style">normal</xsl:attribute>
</xsl:if>
<xsl:text>(</xsl:text><xsl:value-of select="$resolution-placedate"/><xsl:text>)</xsl:text>
</fo:inline>
<xsl:apply-templates select="/itu:itu-standard/itu:bibdata/itu:note[@type = 'title-footnote']" mode="title_footnote"/>
</fo:block>
</xsl:if>
</fo:block>
</fo:block-container>
- </xsl:if>
+ </xsl:if> -->
<!-- Clause(s) -->
<fo:block>
<!-- Scope -->
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']"/> <!-- @id = 'scope' -->
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:sections/itu:clause[@type='scope']" /> -->
<!-- Normative references -->
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']"/> <!-- @id = 'references' -->
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[@normative='true']" />
+
+ <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]" />
+
+ <xsl:apply-templates select="/itu:itu-standard/itu:annex"/> -->
- <xsl:apply-templates select="/itu:itu-standard/itu:sections/*[not(@type='scope')]"/> <!-- @id != 'scope' -->
+ <!-- Bibliography -->
+ <!-- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]"/> -->
- <xsl:apply-templates select="/itu:itu-standard/itu:annex"/>
+ <xsl:call-template name="processMainSectionsDefault"/>
- <!-- Bibliography -->
- <xsl:apply-templates select="/itu:itu-standard/itu:bibliography/itu:references[not(@normative='true')]"/> <!-- @id = 'bibliography' -->
</fo:block>
</fo:flow>
</fo:page-sequence>
@@ -1284,10 +1289,41 @@
<xsl:with-param name="key">Page.sg</xsl:with-param>
</xsl:call-template>
</fo:block>
</xsl:template>
+ <xsl:template match="itu:clause[@type = 'keyword']" priority="4"/>
+
+ <xsl:template match="itu:sections/itu:p[@class = 'zzSTDTitle1']" priority="4">
+ <fo:block font-size="14pt">
+ <xsl:choose>
+ <xsl:when test="$doctype = 'resolution'">
+ <xsl:attribute name="text-align">center</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+
+ <xsl:template match="itu:sections/itu:p[@class = 'zzSTDTitle2']" priority="4">
+ <fo:block font-size="14pt" font-weight="bold" text-align="center" margin-top="15pt" margin-bottom="15pt" role="H1">
+ <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
+ <xsl:attribute name="font-style">normal</xsl:attribute>
+ </xsl:if>
+ <!-- Example: <p align="center" class="zzSTDTitle2" displayorder="4"><em>(Hammamet, 2016</em>) -->
+ <xsl:if test="@align = 'center'">
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </fo:block>
+ </xsl:template>
+
<xsl:template match="node()">
<xsl:apply-templates/>
</xsl:template>
<!-- ============================= -->
@@ -1738,29 +1774,29 @@
<!-- <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: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">
<fo:basic-link internal-destination="title_footnote_{$number}" fox:alt-text="titlefootnote {$number}">
<xsl:value-of select="$number"/>
</fo:basic-link>
- <xsl:if test="position() != last()">,</xsl:if><!-- <fo:inline baseline-shift="20%">,</fo:inline> -->
+ <xsl:if test="position() != last()">,</xsl:if>
</fo:inline>
<fo:footnote-body>
<fo:block font-size="11pt" margin-bottom="12pt" text-align="justify">
<fo:inline id="title_footnote_{$number}" font-size="85%" padding-right="2mm" keep-with-next.within-line="always" baseline-shift="30%">
<xsl:value-of select="$number"/>
</fo:inline>
- <xsl:apply-templates/>
+ <xsl:apply-templates />
</fo:block>
</fo:footnote-body>
</fo:footnote>
- </xsl:template>
+ </xsl:template> -->
<xsl:template match="*[local-name()='tt']" priority="2">
<xsl:variable name="element-name">
<xsl:choose>
<xsl:when test="$isGenerateTableIF = 'true'">fo:inline</xsl:when>
@@ -6112,10 +6148,13 @@
<xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/>
<!-- ===================== -->
<!-- END Definition List -->
<!-- ===================== -->
+ <!-- default: ignore title in sections/p -->
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
+
<!-- ========================= -->
<!-- Rich text formatting -->
<!-- ========================= -->
<xsl:template match="*[local-name()='em']">
<fo:inline font-style="italic">
@@ -8202,30 +8241,50 @@
</xsl:when>
<xsl:otherwise>
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
- <xsl:variable name="img_src">
- <xsl:choose>
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
+ <xsl:if test="@width != '' and @width != 'auto'">
+ <xsl:attribute name="width">
+ <xsl:value-of select="@width"/>
+ </xsl:attribute>
+ </xsl:if>
- <xsl:variable name="image_width_effective">
+ <xsl:if test="@height != '' and @height != 'auto'">
+ <xsl:attribute name="height">
+ <xsl:value-of select="@height"/>
+ </xsl:attribute>
+ </xsl:if>
- <xsl:value-of select="$width_effective"/>
+ <xsl:choose>
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
- </xsl:variable>
+ <xsl:variable name="img_src">
+ <xsl:choose>
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
- <xsl:if test="number($scale) < 100">
+ <xsl:variable name="image_width_effective">
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
+ <xsl:value-of select="$width_effective"/>
- </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
+ <xsl:if test="number($scale) < 100">
+
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
+
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+
</xsl:if>
</fo:external-graphic>
</xsl:otherwise>
</xsl:choose>
@@ -11909,10 +11968,10 @@
</xsl:template>
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:template>
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:copy>
</xsl:template>
\ No newline at end of file