lib/isodoc/un/un.plenary-attachment.xsl in metanorma-un-0.6.6 vs lib/isodoc/un/un.plenary-attachment.xsl in metanorma-un-0.6.7

- old
+ new

@@ -1071,107 +1071,10 @@ </fo:block-container> </fo:static-content> </xsl:template> - <xsl:template name="number-to-words"> - <xsl:param name="number"/> - <xsl:param name="first"/> - <xsl:if test="$number != ''"> - <xsl:variable name="words"> - <words> - <word cardinal="1">one-</word> - <word ordinal="1">first </word> - <word cardinal="2">two-</word> - <word ordinal="2">second </word> - <word cardinal="3">three-</word> - <word ordinal="3">third </word> - <word cardinal="4">four-</word> - <word ordinal="4">fourth </word> - <word cardinal="5">five-</word> - <word ordinal="5">fifth </word> - <word cardinal="6">six-</word> - <word ordinal="6">sixth </word> - <word cardinal="7">seven-</word> - <word ordinal="7">seventh </word> - <word cardinal="8">eight-</word> - <word ordinal="8">eighth </word> - <word cardinal="9">nine-</word> - <word ordinal="9">ninth </word> - <word ordinal="10">tenth </word> - <word ordinal="11">eleventh </word> - <word ordinal="12">twelfth </word> - <word ordinal="13">thirteenth </word> - <word ordinal="14">fourteenth </word> - <word ordinal="15">fifteenth </word> - <word ordinal="16">sixteenth </word> - <word ordinal="17">seventeenth </word> - <word ordinal="18">eighteenth </word> - <word ordinal="19">nineteenth </word> - <word cardinal="20">twenty-</word> - <word ordinal="20">twentieth </word> - <word cardinal="30">thirty-</word> - <word ordinal="30">thirtieth </word> - <word cardinal="40">forty-</word> - <word ordinal="40">fortieth </word> - <word cardinal="50">fifty-</word> - <word ordinal="50">fiftieth </word> - <word cardinal="60">sixty-</word> - <word ordinal="60">sixtieth </word> - <word cardinal="70">seventy-</word> - <word ordinal="70">seventieth </word> - <word cardinal="80">eighty-</word> - <word ordinal="80">eightieth </word> - <word cardinal="90">ninety-</word> - <word ordinal="90">ninetieth </word> - <word cardinal="100">hundred-</word> - <word ordinal="100">hundredth </word> - </words> - </xsl:variable> - - <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/> - - <xsl:variable name="value"> - <xsl:choose> - <xsl:when test="$ordinal != ''"> - <xsl:value-of select="$ordinal"/> - </xsl:when> - <xsl:otherwise> - <xsl:choose> - <xsl:when test="$number &lt; 100"> - <xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/> - <xsl:variable name="digit" select="substring($number,2)"/> - <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/> - <xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/> - </xsl:when> - <xsl:otherwise> - <!-- more 100 --> - <xsl:variable name="hundred" select="substring($number,1,1)"/> - <xsl:variable name="digits" select="number(substring($number,2))"/> - <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/> - <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/> - <xsl:call-template name="number-to-words"> - <xsl:with-param name="number" select="$digits"/> - </xsl:call-template> - </xsl:otherwise> - </xsl:choose> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <xsl:choose> - <xsl:when test="$first = 'true'"> - <xsl:call-template name="capitalize"> - <xsl:with-param name="str" select="$value"/> - </xsl:call-template> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$value"/> - </xsl:otherwise> - </xsl:choose> - </xsl:if> - </xsl:template> - <!-- convert YYYY-MM-DD to (Month YYYY) --> <xsl:template name="formatDate"> <xsl:param name="date"/> <xsl:variable name="year" select="substring($date, 1, 4)"/> <xsl:variable name="month" select="substring($date, 6, 2)"/> @@ -2323,18 +2226,23 @@ <fo:table-row> <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}"> + <!-- fn will be processed inside 'note' processing --> + + <!-- for BSI (not PAS) display Notes before footnotes --> + + <!-- except gb --> <xsl:apply-templates select="../*[local-name()='note']" mode="process"/> @@ -2356,10 +2264,14 @@ <!-- fn processing --> <xsl:call-template name="fn_display"/> + + <!-- for PAS display Notes after footnotes --> + + </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> @@ -2413,10 +2325,11 @@ </xsl:if> <xsl:if test="$parent-name = 'tfoot'"> + </xsl:if> <xsl:if test="not(*[local-name()='th'])"> <xsl:attribute name="min-height">8mm</xsl:attribute> @@ -2563,14 +2476,19 @@ + + <!-- Table's note name (NOTE, for example) --> + <fo:inline padding-right="2mm"> + + <xsl:if test="@type = 'source' or @type = 'abbreviation'"> <xsl:attribute name="font-size">9pt</xsl:attribute> <!-- <fo:inline> <xsl:call-template name="capitalize"> <xsl:with-param name="str" select="@type"/> @@ -2582,10 +2500,12 @@ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/> </fo:inline> + + <xsl:apply-templates mode="process"/> </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:apply-templates/> @@ -2601,15 +2521,17 @@ </xsl:variable> <xsl:for-each select="xalan:nodeset($references)//fn"> <xsl:variable name="reference" select="@reference"/> <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note--> <fo:block margin-bottom="12pt"> + + <fo:inline font-size="80%" padding-right="5mm" id="{@id}"> <xsl:attribute name="vertical-align">super</xsl:attribute> @@ -2620,10 +2542,11 @@ <xsl:value-of select="@reference"/> + </fo:inline> <fo:inline> <!-- <xsl:apply-templates /> --> <xsl:copy-of select="./node()"/> @@ -2769,10 +2692,11 @@ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id--> <xsl:value-of select="@reference"/> + </fo:basic-link> </fo:inline> </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']"> <fo:inline> <xsl:apply-templates/> @@ -3772,10 +3696,11 @@ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style"> + <fo:block-container margin-left="0mm"> @@ -4977,20 +4902,22 @@ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute> <xsl:attribute name="vertical-align">super</xsl:attribute> </xsl:if> - + + + <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}"> - <xsl:if test="normalize-space(@citeas) = ''"> <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute> </xsl:if> <xsl:if test="@type = 'inline'"> + <xsl:attribute name="text-decoration">underline</xsl:attribute> </xsl:if> <xsl:apply-templates/> @@ -5912,6 +5839,102 @@ <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when> <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when> <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise> </xsl:choose> </xsl:attribute> + </xsl:template><xsl:template name="number-to-words"> + <xsl:param name="number"/> + <xsl:param name="first"/> + <xsl:if test="$number != ''"> + <xsl:variable name="words"> + <words> + <word cardinal="1">One-</word> + <word ordinal="1">First </word> + <word cardinal="2">Two-</word> + <word ordinal="2">Second </word> + <word cardinal="3">Three-</word> + <word ordinal="3">Third </word> + <word cardinal="4">Four-</word> + <word ordinal="4">Fourth </word> + <word cardinal="5">Five-</word> + <word ordinal="5">Fifth </word> + <word cardinal="6">Six-</word> + <word ordinal="6">Sixth </word> + <word cardinal="7">Seven-</word> + <word ordinal="7">Seventh </word> + <word cardinal="8">Eight-</word> + <word ordinal="8">Eighth </word> + <word cardinal="9">Nine-</word> + <word ordinal="9">Ninth </word> + <word ordinal="10">Tenth </word> + <word ordinal="11">Eleventh </word> + <word ordinal="12">Twelfth </word> + <word ordinal="13">Thirteenth </word> + <word ordinal="14">Fourteenth </word> + <word ordinal="15">Fifteenth </word> + <word ordinal="16">Sixteenth </word> + <word ordinal="17">Seventeenth </word> + <word ordinal="18">Eighteenth </word> + <word ordinal="19">Nineteenth </word> + <word cardinal="20">Twenty-</word> + <word ordinal="20">Twentieth </word> + <word cardinal="30">Thirty-</word> + <word ordinal="30">Thirtieth </word> + <word cardinal="40">Forty-</word> + <word ordinal="40">Fortieth </word> + <word cardinal="50">Fifty-</word> + <word ordinal="50">Fiftieth </word> + <word cardinal="60">Sixty-</word> + <word ordinal="60">Sixtieth </word> + <word cardinal="70">Seventy-</word> + <word ordinal="70">Seventieth </word> + <word cardinal="80">Eighty-</word> + <word ordinal="80">Eightieth </word> + <word cardinal="90">Ninety-</word> + <word ordinal="90">Ninetieth </word> + <word cardinal="100">Hundred-</word> + <word ordinal="100">Hundredth </word> + </words> + </xsl:variable> + + <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/> + + <xsl:variable name="value"> + <xsl:choose> + <xsl:when test="$ordinal != ''"> + <xsl:value-of select="$ordinal"/> + </xsl:when> + <xsl:otherwise> + <xsl:choose> + <xsl:when test="$number &lt; 100"> + <xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/> + <xsl:variable name="digit" select="substring($number,2)"/> + <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/> + <xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/> + </xsl:when> + <xsl:otherwise> + <!-- more 100 --> + <xsl:variable name="hundred" select="substring($number,1,1)"/> + <xsl:variable name="digits" select="number(substring($number,2))"/> + <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/> + <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/> + <xsl:call-template name="number-to-words"> + <xsl:with-param name="number" select="$digits"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:choose> + <xsl:when test="$first = 'true'"> + <xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/> + <xsl:call-template name="capitalize"> + <xsl:with-param name="str" select="$value_lc"/> + </xsl:call-template> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$value"/> + </xsl:otherwise> + </xsl:choose> + </xsl:if> </xsl:template></xsl:stylesheet> \ No newline at end of file