lib/isodoc/ogc/ogc.best-practice.xsl in metanorma-ogc-2.4.3 vs lib/isodoc/ogc/ogc.best-practice.xsl in metanorma-ogc-2.4.6
- old
+ new
@@ -1136,56 +1136,80 @@
<fo:list-item-label end-indent="label-end()">
<fo:block><fo:inline font-size="18pt"><xsl:apply-templates/></fo:inline></fo:block> <!-- padding-right="1mm" -->
</fo:list-item-label>
<fo:list-item-body start-indent="body-start()">
<fo:block>
- <xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:admitted" mode="term_name"/>
+ <xsl:apply-templates select="../ogc:preferred | ../ogc:deprecated | ../ogc:deprecates | ../ogc:admitted" mode="term_name"/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
<xsl:call-template name="insertShortHorizontalLine"/>
</fo:block>
</xsl:template>
- <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" priority="2"/>
+ <xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" priority="2"/>
<!-- first preferred displays on the same line as term/name -->
<xsl:template match="ogc:preferred[not(preceding-sibling::ogc:preferred)]" mode="term_name" priority="2">
<fo:inline font-size="18pt" padding-right="3mm"><xsl:call-template name="setStyle_preferred"/><xsl:apply-templates/></fo:inline>
<fo:inline padding-right="2mm"> </fo:inline>
</xsl:template>
- <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" mode="term_name">
+ <xsl:template match="ogc:preferred | ogc:deprecated | ogc:deprecates | ogc:admitted" mode="term_name">
<xsl:choose>
- <xsl:when test="preceding-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
+ <xsl:when test="preceding-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::admitted]">
<fo:block space-before="6pt"><xsl:call-template name="displayTerm"/></fo:block> <!-- block wrapper -->
</xsl:when>
<xsl:otherwise><xsl:call-template name="displayTerm"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="displayTerm">
<fo:inline font-size="18pt" padding-right="3mm"><xsl:apply-templates/></fo:inline>
- <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
+ <!-- <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
<xsl:variable name="kind" select="local-name()"/>
<xsl:attribute name="background-color">
<xsl:choose>
<xsl:when test="$kind = 'preferred'">rgb(249, 235, 187)</xsl:when>
<xsl:when test="$kind = 'deprecated'">rgb(237, 237, 238)</xsl:when>
- <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>
+ <xsl:when test="$kind = 'admitted'">rgb(223, 236, 249)</xsl:when>
</xsl:choose>
</xsl:attribute>
<xsl:call-template name="addLetterSpacing">
<xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($kind))"/>
- </xsl:call-template>
- </fo:inline>
- <xsl:if test="following-sibling::*[self::ogc:preferred or self::deprecated or self::admitted]">
+ </xsl:call-template>
+ </fo:inline> -->
+ <xsl:if test="following-sibling::*[self::ogc:preferred or self::ogc:deprecated or self::ogc:deprecates or self::ogc:admitted]">
<fo:inline padding-right="2mm"> </fo:inline>
</xsl:if>
</xsl:template>
+ <xsl:template match="*[local-name() = 'span'][@class = 'PreferredLabel' or @class = 'DeprecatedLabel' or @class = 'AdmittedLabel']" mode="update_xml_step1" priority="2">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="ogc:span[@class = 'PreferredLabel' or @class = 'DeprecatedLabel' or @class = 'AdmittedLabel']" priority="3">
+ <fo:inline> </fo:inline>
+ <fo:inline font-size="11pt" padding="1mm" padding-bottom="0.5mm" baseline-shift="25%">
+ <xsl:variable name="kind" select="@class"/>
+ <xsl:variable name="label" select="text()"/>
+ <xsl:attribute name="background-color">
+ <xsl:choose>
+ <xsl:when test="$kind = 'PreferredLabel' or $label = 'PREFERRED'">rgb(249, 235, 187)</xsl:when>
+ <xsl:when test="$kind = 'DeprecatedLabel' or $label = 'DEPRECATED'">rgb(237, 237, 238)</xsl:when>
+ <xsl:when test="$kind = 'AdmittedLabel' or $label = 'ADMITTED'">rgb(223, 236, 249)</xsl:when>
+ </xsl:choose>
+ </xsl:attribute>
+ <xsl:call-template name="addLetterSpacing">
+ <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($label))"/>
+ </xsl:call-template>
+ </fo:inline>
+ </xsl:template>
+
<xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
<xsl:variable name="text">
<xsl:call-template name="add-zero-spaces-java"/>
</xsl:variable>
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new($text))"/>
@@ -5917,11 +5941,20 @@
<xsl:variable name="quot">"</xsl:variable>
<xsl:variable name="styles_">
<xsl:for-each select="xalan:nodeset($styles__)/item">
<xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
- <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
- <xsl:if test="$key = 'font-family' or $key = 'color'">
+ <xsl:variable name="value_" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
+ <xsl:variable name="value">
+ <xsl:choose>
+ <!-- if font-size is digits only -->
+ <xsl:when test="$key = 'font-size' and translate($value_, '0123456789', '') = ''"><xsl:value-of select="$value_"/>pt</xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value_"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
<style name="{$key}"><xsl:value-of select="$value"/></style>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
\ No newline at end of file