lib/isodoc/ogc/ogc.best-practice.xsl in metanorma-ogc-2.5.0 vs lib/isodoc/ogc/ogc.best-practice.xsl in metanorma-ogc-2.5.1
- old
+ new
@@ -47,10 +47,11 @@
</xsl:choose>
</xsl:variable>
<xsl:variable name="color_dl_dt">rgb(215,243,255)</xsl:variable>
<xsl:variable name="color_dl_dd">rgb(242,251,255)</xsl:variable>
<xsl:variable name="color_blue">rgb(33, 55, 92)</xsl:variable>
+ <xsl:variable name="color_background_blue">rgb(33,60,107)</xsl:variable>
<xsl:variable name="toc_recommendations_">
<xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]">
<xsl:variable name="table_id" select="@id"/>
<recommendation alt-text="{.//ogc:p[@class = 'RecommendationTitle'][1]/text()}">
@@ -190,10 +191,14 @@
</fo:block>
</fo:static-content>
<fo:flow flow-name="xsl-region-body" color="white">
+ <xsl:variable name="curr_lang" select="/ogc:ogc-standard/ogc:bibdata/ogc:language[@current = 'true']"/>
+ <xsl:variable name="stage" select="/ogc:ogc-standard/ogc:bibdata/ogc:status/ogc:stage[@language = $curr_lang] | /ogc:ogc-standard/ogc:bibdata/ogc:status/ogc:stage[not(@language)]"/>
+ <xsl:variable name="isLegacy" select="normalize-space($stage = 'deprecated' or $stage = 'legacy' or $stage = 'retired' or $stage = 'rescinded')"/>
+
<!-- background image -->
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0">
<fo:block>
<fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Cover-Background))}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
</fo:block>
@@ -265,11 +270,11 @@
</fo:block>
<fo:block-container width="22.5mm" border-bottom="2pt solid {$color_design}" margin-bottom="24pt">
<fo:block margin-top="4pt"> </fo:block>
</fo:block-container>
<fo:block color="{$color_design}">
- <fo:block font-size="17pt" margin-bottom="14pt">
+ <fo:block font-size="17pt">
<xsl:call-template name="addLetterSpacing">
<xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($doctype))"/>
</xsl:call-template>
<xsl:value-of select="$linebreak"/>
<xsl:variable name="docsubtype" select="normalize-space(/ogc:ogc-standard/ogc:bibdata/ogc:ext/ogc:subdoctype)"/>
@@ -289,17 +294,35 @@
<xsl:call-template name="addLetterSpacing">
<xsl:with-param name="text" select="$docsubtype_str"/>
<xsl:with-param name="letter-spacing" select="0.25"/>
</xsl:call-template>
</fo:block>
- <fo:block font-size="12pt" font-weight="bold">
- <xsl:variable name="curr_lang" select="/ogc:ogc-standard/ogc:bibdata/ogc:language[@current = 'true']"/>
- <xsl:variable name="stage" select="java:toUpperCase(java:java.lang.String.new(/ogc:ogc-standard/ogc:bibdata/ogc:status/ogc:stage[@language = $curr_lang]))"/>
- <xsl:call-template name="addLetterSpacing">
- <xsl:with-param name="text" select="$stage"/>
- </xsl:call-template>
- </fo:block>
+ <xsl:variable name="stage_uc" select="java:toUpperCase(java:java.lang.String.new($stage))"/>
+
+ <xsl:choose>
+ <xsl:when test="$isLegacy = 'true'">
+ <fo:block-container font-size="17pt" background-color="{$color_background_blue}" margin-left="-2.5mm" height="11.5mm" width="56mm" display-align="center" margin-top="0.5mm">
+ <fo:block-container margin-left="2.5mm">
+ <fo:block-container margin-left="0mm">
+ <fo:block margin-top="1mm">
+ <xsl:call-template name="addLetterSpacing">
+ <xsl:with-param name="text" select="$stage_uc"/>
+ </xsl:call-template>
+ </fo:block>
+ </fo:block-container>
+ </fo:block-container>
+ </fo:block-container>
+ </xsl:when>
+ <xsl:otherwise>
+ <fo:block font-size="12pt" font-weight="bold" margin-top="14pt">
+ <xsl:call-template name="addLetterSpacing">
+ <xsl:with-param name="text" select="$stage_uc"/>
+ </xsl:call-template>
+ </fo:block>
+ </xsl:otherwise>
+ </xsl:choose>
+
</fo:block>
</fo:block-container>
</fo:block-container>
<fo:block-container absolute-position="fixed" left="16.5mm" top="204mm" height="60mm" width="180mm" display-align="after" font-size="10pt">
@@ -387,11 +410,28 @@
</fo:block>
</xsl:if>
</fo:block>
</fo:block>
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement"/>
+ <xsl:choose>
+ <xsl:when test="$isLegacy = 'true'">
+ <fo:block-container margin-left="-7mm" color="{$color_design}" background-color="{$color_background_blue}" width="202mm">
+ <fo:block-container margin-left="2.5mm" margin-right="1mm" padding-top="0.5mm" padding-bottom="0.5mm">
+ <fo:block-container margin-left="0mm" margin-right="0mm">
+ <fo:block>
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement">
+ <xsl:with-param name="isLegacy" select="$isLegacy"/>
+ </xsl:apply-templates>
+ </fo:block>
+ </fo:block-container>
+ </fo:block-container>
+ </fo:block-container>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:boilerplate/ogc:legal-statement"/>
+ </xsl:otherwise>
+ </xsl:choose>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
@@ -3427,11 +3467,17 @@
</fo:block>
</xsl:template> <!-- license-statement/p -->
<xsl:template match="*[local-name()='legal-statement']">
+ <xsl:param name="isLegacy">false</xsl:param>
<fo:block xsl:use-attribute-sets="legal-statement-style">
+
+ <xsl:if test="$isLegacy = 'true'">
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
+ </xsl:if>
+
<xsl:apply-templates/>
</fo:block>
</xsl:template> <!-- legal-statement -->
<xsl:template match="*[local-name()='legal-statement']//*[local-name()='title']">
@@ -5716,30 +5762,51 @@
</xsl:template>
<!-- ================= -->
<!-- Added,deleted text -->
<!-- ================= -->
- <xsl:template match="*[local-name()='add']" name="tag_add">
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
<xsl:param name="skip">true</xsl:param>
<xsl:param name="block">false</xsl:param>
<xsl:param name="type"/>
<xsl:param name="text-align"/>
<xsl:choose>
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
+ <xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
<xsl:choose>
<xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
<xsl:otherwise>
<xsl:variable name="tag">
<xsl:call-template name="insertTag">
<xsl:with-param name="type">
<xsl:choose>
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
<xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
<xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
</xsl:choose>
</xsl:with-param>
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
+ <xsl:with-param name="kind">
+ <xsl:choose>
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
+ <xsl:value-of select="text()"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+ <xsl:with-param name="value">
+ <xsl:choose>
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
+ <xsl:value-of select="*[local-name() = 'sub']"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="$block = 'false'">
<fo:inline>
@@ -7947,15 +8014,21 @@
</fo:block>
</xsl:when>
<xsl:otherwise>
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
+
<xsl:variable name="element">
<xsl:choose>
<xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
<fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
</xsl:when>
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
+ </xsl:when>
<xsl:otherwise>
<fo:block xsl:use-attribute-sets="image-style">
<xsl:if test="ancestor::*[local-name() = 'dt']">
<xsl:attribute name="text-align">left</xsl:attribute>
</xsl:if>
@@ -7967,14 +8040,28 @@
<xsl:for-each select="xalan:nodeset($element)/*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<!-- <fo:block xsl:use-attribute-sets="image-style"> -->
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
- <xsl:if test="$isGenerateTableIF = 'false'">
- <xsl:attribute name="width">100%</xsl:attribute>
- </xsl:if>
- <xsl:attribute name="content-height">100%</xsl:attribute>
+
+ <xsl:choose>
+ <xsl:when test="$image_class = 'corrigenda-tag'">
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
+ <xsl:if test="$ancestor_table_cell = 'true'">
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:if test="$isGenerateTableIF = 'false'">
+ <xsl:attribute name="width">100%</xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="content-height">100%</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
@@ -10224,17 +10311,23 @@
<!-- if there isn't the attribute '@from', then -->
<xsl:when test="$id_from = ''">
<fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
</xsl:when>
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
<fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
</xsl:when>
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
+ </xsl:when>
</xsl:choose>
</xsl:template>
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
+
<xsl:template match="*[local-name() = 'name']/text()">
<!-- 0xA0 to space replacement -->
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
</xsl:template>
@@ -11833,10 +11926,10 @@
<fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
</xsl:template>
<xsl:template name="printEdition">
<xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
- <xsl:text> </xsl:text>
+
<xsl:choose>
<xsl:when test="$edition_i18n != ''">
<!-- Example: <edition language="fr">deuxième édition</edition> -->
<xsl:call-template name="capitalize">
<xsl:with-param name="str" select="$edition_i18n"/>
\ No newline at end of file