lib/isodoc/un/un.recommendation.xsl in metanorma-un-0.6.3 vs lib/isodoc/un/un.recommendation.xsl in metanorma-un-0.6.4

- old
+ new

@@ -1217,10 +1217,11 @@ </xsl:attribute-set><xsl:attribute-set name="link-style"> + </xsl:attribute-set><xsl:attribute-set name="sourcecode-style"> <xsl:attribute name="white-space">pre</xsl:attribute> <xsl:attribute name="wrap-option">wrap</xsl:attribute> @@ -1275,10 +1276,11 @@ + </xsl:attribute-set><xsl:attribute-set name="example-body-style"> </xsl:attribute-set><xsl:attribute-set name="example-name-style"> @@ -1291,14 +1293,12 @@ + - - - <xsl:attribute name="font-size">10pt</xsl:attribute> <xsl:attribute name="font-weight">bold</xsl:attribute> <xsl:attribute name="margin-bottom">12pt</xsl:attribute> <xsl:attribute name="keep-with-next">always</xsl:attribute> @@ -1350,10 +1350,11 @@ <xsl:attribute name="keep-with-next">always</xsl:attribute> <xsl:attribute name="text-indent">0mm</xsl:attribute> + </xsl:attribute-set><xsl:attribute-set name="appendix-style"> </xsl:attribute-set><xsl:attribute-set name="appendix-example-style"> @@ -1363,15 +1364,17 @@ </xsl:attribute-set><xsl:attribute-set name="xref-style"> + </xsl:attribute-set><xsl:attribute-set name="eref-style"> + </xsl:attribute-set><xsl:attribute-set name="note-style"> @@ -1454,14 +1457,16 @@ + </xsl:attribute-set><xsl:attribute-set name="origin-style"> + </xsl:attribute-set><xsl:attribute-set name="term-style"> </xsl:attribute-set><xsl:attribute-set name="figure-name-style"> @@ -1528,12 +1533,14 @@ </xsl:attribute-set><xsl:attribute-set name="domain-style"> </xsl:attribute-set><xsl:attribute-set name="admitted-style"> + </xsl:attribute-set><xsl:attribute-set name="deprecates-style"> + </xsl:attribute-set><xsl:attribute-set name="definition-style"> </xsl:attribute-set><xsl:variable name="color-added-text"> @@ -2301,10 +2308,11 @@ <xsl:attribute name="text-indent">0mm</xsl:attribute> + <xsl:if test="$lang = 'ar'"> <xsl:attribute name="padding-right">1mm</xsl:attribute> </xsl:if> <xsl:if test="@colspan"> <xsl:attribute name="number-columns-spanned"> @@ -2678,10 +2686,11 @@ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always"> + <xsl:variable name="title-key"> <xsl:call-template name="getTitle"> <xsl:with-param name="name" select="'title-key'"/> @@ -2959,10 +2968,12 @@ </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']"> <fo:inline font-weight="bold"> <xsl:apply-templates/> </fo:inline> + </xsl:template><xsl:template match="*[local-name()='padding']"> + <fo:inline padding-right="{@value}"> </fo:inline> </xsl:template><xsl:template match="*[local-name()='sup']"> <fo:inline font-size="80%" vertical-align="super"> <xsl:apply-templates/> </fo:inline> </xsl:template><xsl:template match="*[local-name()='sub']"> @@ -3452,10 +3463,20 @@ </xsl:copy> <mathml:mspace width="0.5ex"/> </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link"> <xsl:variable name="target"> <xsl:choose> + <xsl:when test="@updatetype = 'true'"> + <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="normalize-space(@target)"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:variable name="target_text"> + <xsl:choose> <xsl:when test="starts-with(normalize-space(@target), 'mailto:')"> <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="normalize-space(@target)"/> @@ -3463,23 +3484,23 @@ </xsl:choose> </xsl:variable> <fo:inline xsl:use-attribute-sets="link-style"> <xsl:choose> - <xsl:when test="$target = ''"> + <xsl:when test="$target_text = ''"> <xsl:apply-templates/> </xsl:when> <xsl:otherwise> - <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}"> + <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}"> <xsl:choose> <xsl:when test="normalize-space(.) = ''"> - <!-- <xsl:value-of select="$target"/> --> <xsl:call-template name="add-zero-spaces-link-java"> - <xsl:with-param name="text" select="$target"/> + <xsl:with-param name="text" select="$target_text"/> </xsl:call-template> </xsl:when> <xsl:otherwise> + <!-- output text from <link>text</link> --> <xsl:apply-templates/> </xsl:otherwise> </xsl:choose> </fo:basic-link> </xsl:otherwise> @@ -4071,10 +4092,11 @@ </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item"> <xsl:text> </xsl:text> </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode"> <fo:block-container margin-left="0mm"> + <xsl:copy-of select="@id"/> <xsl:if test="parent::*[local-name() = 'note']"> <xsl:attribute name="margin-left"> <xsl:choose> <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when> <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise> @@ -4348,10 +4370,11 @@ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']"> <fo:inline><xsl:apply-templates/></fo:inline> </xsl:template><xsl:template match="*[local-name() = 'example']"> <fo:block id="{@id}" xsl:use-attribute-sets="example-style"> + <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/> <xsl:variable name="element"> block @@ -4571,10 +4594,11 @@ + <xsl:choose> <xsl:when test="ancestor::un:annex and $depth &gt;= 2">9.5</xsl:when> <xsl:when test="ancestor::un:sections">9.5</xsl:when> </xsl:choose> @@ -5255,10 +5279,13 @@ <xsl:variable name="level"> <xsl:choose> <xsl:when test="parent::*[local-name() = 'preface']"> <xsl:value-of select="$level_total - 1"/> </xsl:when> + <xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause --> + <xsl:value-of select="$level_total - 1"/> + </xsl:when> <xsl:when test="ancestor::*[local-name() = 'preface']"> <xsl:value-of select="$level_total - 2"/> </xsl:when> <!-- <xsl:when test="parent::*[local-name() = 'sections']"> <xsl:value-of select="$level_total - 1"/> @@ -5395,10 +5422,17 @@ <xsl:value-of select="$data_value"/> </xsl:when> <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"> <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/> </xsl:when> - <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise> + <xsl:otherwise> + <xsl:variable name="key_"> + <xsl:call-template name="capitalize"> + <xsl:with-param name="str" select="translate($key, '_', ' ')"/> + </xsl:call-template> + </xsl:variable> + <xsl:value-of select="$key_"/> + </xsl:otherwise> </xsl:choose> </xsl:template><xsl:template name="setTrackChangesStyles"> <xsl:param name="isAdded"/> <xsl:param name="isDeleted"/> \ No newline at end of file