lib/isodoc/mpfa/mpfa.circular.xsl in metanorma-mpfa-0.6.6 vs lib/isodoc/mpfa/mpfa.circular.xsl in metanorma-mpfa-0.6.7

- old
+ new

@@ -1904,18 +1904,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"/> @@ -1937,10 +1942,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> @@ -1994,10 +2003,11 @@ </xsl:if> <xsl:if test="$parent-name = 'tfoot'"> + </xsl:if> @@ -2125,19 +2135,26 @@ + + <!-- Table's note name (NOTE, for example) --> + <fo:inline padding-right="2mm"> + + <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/> @@ -2153,15 +2170,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}"> @@ -2170,10 +2189,11 @@ <xsl:value-of select="@reference"/> + </fo:inline> <fo:inline> <!-- <xsl:apply-templates /> --> <xsl:copy-of select="./node()"/> @@ -2319,10 +2339,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/> @@ -3322,10 +3343,11 @@ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style"> + <fo:block-container margin-left="0mm"> @@ -4520,23 +4542,25 @@ <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="color">blue</xsl:attribute> <xsl:attribute name="text-decoration">underline</xsl:attribute> + </xsl:if> <xsl:apply-templates/> </fo:basic-link> @@ -5434,6 +5458,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