metanorma-iso 1.8.5 → 1.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -1
- data/lib/asciidoctor/iso/cleanup.rb +0 -1
- data/lib/asciidoctor/iso/isodoc.rng +62 -8
- data/lib/asciidoctor/iso/isostandard.rng +7 -3
- data/lib/asciidoctor/iso/section.rb +3 -0
- data/lib/asciidoctor/iso/validate.rb +4 -17
- data/lib/asciidoctor/iso/validate_section.rb +50 -34
- data/lib/asciidoctor/iso/validate_style.rb +3 -3
- data/lib/isodoc/iso/base_convert.rb +31 -6
- data/lib/isodoc/iso/iso.amendment.xsl +492 -377
- data/lib/isodoc/iso/iso.international-standard.xsl +492 -377
- data/lib/isodoc/iso/isosts_convert.rb +12 -13
- data/lib/isodoc/iso/presentation_xml_convert.rb +62 -9
- data/lib/isodoc/iso/sts_convert.rb +4 -5
- data/lib/isodoc/iso/xref.rb +17 -1
- data/lib/metanorma/iso/version.rb +1 -1
- data/metanorma-iso.gemspec +3 -3
- data/spec/asciidoctor/blocks_spec.rb +2 -2
- data/spec/asciidoctor/cleanup_spec.rb +2 -2
- data/spec/asciidoctor/section_spec.rb +128 -7
- data/spec/asciidoctor/validate_spec.rb +15 -15
- data/spec/isodoc/amd_spec.rb +2 -2
- data/spec/isodoc/inline_spec.rb +470 -0
- data/spec/isodoc/section_spec.rb +195 -72
- metadata +7 -7
@@ -23,13 +23,6 @@
|
|
23
23
|
<xsl:variable name="marginTop" select="27.4"/>
|
24
24
|
<xsl:variable name="marginBottom" select="13"/>
|
25
25
|
|
26
|
-
<xsl:variable name="figure_name_height">14</xsl:variable>
|
27
|
-
<xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><!-- paper width minus margins -->
|
28
|
-
<xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><!-- paper height minus margins and title height -->
|
29
|
-
<xsl:variable name="image_dpi" select="96"/>
|
30
|
-
<xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/>
|
31
|
-
<xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/>
|
32
|
-
|
33
26
|
<xsl:variable name="docidentifierISO" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
|
34
27
|
|
35
28
|
<xsl:variable name="all_rights_reserved">
|
@@ -1915,257 +1908,6 @@
|
|
1915
1908
|
</fo:block>
|
1916
1909
|
</xsl:template>
|
1917
1910
|
|
1918
|
-
<!-- =================== -->
|
1919
|
-
<!-- SVG images processing -->
|
1920
|
-
<!-- =================== -->
|
1921
|
-
<xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/>
|
1922
|
-
<xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
|
1923
|
-
<xsl:param name="name"/>
|
1924
|
-
|
1925
|
-
<xsl:variable name="svg_content">
|
1926
|
-
<xsl:apply-templates select="." mode="svg_update"/>
|
1927
|
-
</xsl:variable>
|
1928
|
-
|
1929
|
-
<xsl:variable name="alt-text">
|
1930
|
-
<xsl:choose>
|
1931
|
-
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
1932
|
-
<xsl:value-of select="../*[local-name() = 'name']"/>
|
1933
|
-
</xsl:when>
|
1934
|
-
<xsl:when test="normalize-space($name) != ''">
|
1935
|
-
<xsl:value-of select="$name"/>
|
1936
|
-
</xsl:when>
|
1937
|
-
<xsl:otherwise>Figure</xsl:otherwise>
|
1938
|
-
</xsl:choose>
|
1939
|
-
</xsl:variable>
|
1940
|
-
|
1941
|
-
<xsl:choose>
|
1942
|
-
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
1943
|
-
<fo:block>
|
1944
|
-
<xsl:variable name="width" select="@width"/>
|
1945
|
-
<xsl:variable name="height" select="@height"/>
|
1946
|
-
|
1947
|
-
<xsl:variable name="scale_x">
|
1948
|
-
<xsl:choose>
|
1949
|
-
<xsl:when test="$width > $width_effective_px">
|
1950
|
-
<xsl:value-of select="$width_effective_px div $width"/>
|
1951
|
-
</xsl:when>
|
1952
|
-
<xsl:otherwise>1</xsl:otherwise>
|
1953
|
-
</xsl:choose>
|
1954
|
-
</xsl:variable>
|
1955
|
-
|
1956
|
-
<xsl:variable name="scale_y">
|
1957
|
-
<xsl:choose>
|
1958
|
-
<xsl:when test="$height * $scale_x > $height_effective_px">
|
1959
|
-
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
1960
|
-
</xsl:when>
|
1961
|
-
<xsl:otherwise>1</xsl:otherwise>
|
1962
|
-
</xsl:choose>
|
1963
|
-
</xsl:variable>
|
1964
|
-
|
1965
|
-
<xsl:variable name="scale">
|
1966
|
-
<xsl:choose>
|
1967
|
-
<xsl:when test="$scale_y != 1">
|
1968
|
-
<xsl:value-of select="$scale_x * $scale_y"/>
|
1969
|
-
</xsl:when>
|
1970
|
-
<xsl:otherwise>
|
1971
|
-
<xsl:value-of select="$scale_x"/>
|
1972
|
-
</xsl:otherwise>
|
1973
|
-
</xsl:choose>
|
1974
|
-
</xsl:variable>
|
1975
|
-
|
1976
|
-
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
1977
|
-
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
1978
|
-
|
1979
|
-
<fo:table table-layout="fixed" width="100%">
|
1980
|
-
<fo:table-column column-width="proportional-column-width(1)"/>
|
1981
|
-
<fo:table-column column-width="{$width_scale}px"/>
|
1982
|
-
<fo:table-column column-width="proportional-column-width(1)"/>
|
1983
|
-
<fo:table-body>
|
1984
|
-
<fo:table-row>
|
1985
|
-
<fo:table-cell column-number="2">
|
1986
|
-
<fo:block>
|
1987
|
-
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
1988
|
-
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
1989
|
-
<fo:block line-height="0" font-size="0">
|
1990
|
-
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
1991
|
-
<xsl:call-template name="bookmark"/>
|
1992
|
-
</xsl:for-each>
|
1993
|
-
</fo:block>
|
1994
|
-
</xsl:if>
|
1995
|
-
<fo:block text-depth="0" line-height="0" font-size="0">
|
1996
|
-
|
1997
|
-
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
1998
|
-
<xsl:attribute name="width">100%</xsl:attribute>
|
1999
|
-
<xsl:attribute name="content-height">100%</xsl:attribute>
|
2000
|
-
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
2001
|
-
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
2002
|
-
|
2003
|
-
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
2004
|
-
</fo:instream-foreign-object>
|
2005
|
-
</fo:block>
|
2006
|
-
|
2007
|
-
<xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
|
2008
|
-
<xsl:with-param name="scale" select="$scale"/>
|
2009
|
-
</xsl:apply-templates>
|
2010
|
-
</fo:block-container>
|
2011
|
-
</fo:block>
|
2012
|
-
</fo:table-cell>
|
2013
|
-
</fo:table-row>
|
2014
|
-
</fo:table-body>
|
2015
|
-
</fo:table>
|
2016
|
-
</fo:block>
|
2017
|
-
|
2018
|
-
</xsl:when>
|
2019
|
-
<xsl:otherwise>
|
2020
|
-
<fo:block xsl:use-attribute-sets="image-style">
|
2021
|
-
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
2022
|
-
<xsl:attribute name="width">100%</xsl:attribute>
|
2023
|
-
<xsl:attribute name="content-height">100%</xsl:attribute>
|
2024
|
-
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
2025
|
-
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
2026
|
-
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
2027
|
-
<!-- effective height / width = 1.48, 1.4 - with title -->
|
2028
|
-
<xsl:if test="@height > (@width * 1.4)"> <!-- for images with big height -->
|
2029
|
-
<xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
|
2030
|
-
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
2031
|
-
</xsl:if>
|
2032
|
-
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
2033
|
-
<xsl:copy-of select="$svg_content"/>
|
2034
|
-
</fo:instream-foreign-object>
|
2035
|
-
</fo:block>
|
2036
|
-
</xsl:otherwise>
|
2037
|
-
</xsl:choose>
|
2038
|
-
</xsl:template>
|
2039
|
-
|
2040
|
-
<xsl:template match="@*|node()" mode="svg_update">
|
2041
|
-
<xsl:copy>
|
2042
|
-
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
2043
|
-
</xsl:copy>
|
2044
|
-
</xsl:template>
|
2045
|
-
|
2046
|
-
<xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
2047
|
-
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
2048
|
-
<xsl:value-of select="."/>
|
2049
|
-
</xsl:attribute>
|
2050
|
-
</xsl:template>
|
2051
|
-
|
2052
|
-
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
2053
|
-
<xsl:variable name="svg_content" select="document(@src)"/>
|
2054
|
-
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
2055
|
-
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
2056
|
-
<xsl:call-template name="image_svg">
|
2057
|
-
<xsl:with-param name="name" select="$name"/>
|
2058
|
-
</xsl:call-template>
|
2059
|
-
</xsl:for-each>
|
2060
|
-
</xsl:template>
|
2061
|
-
|
2062
|
-
<xsl:template match="@*|node()" mode="svg_remove_a">
|
2063
|
-
<xsl:copy>
|
2064
|
-
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
2065
|
-
</xsl:copy>
|
2066
|
-
</xsl:template>
|
2067
|
-
|
2068
|
-
<xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
2069
|
-
<xsl:apply-templates mode="svg_remove_a"/>
|
2070
|
-
</xsl:template>
|
2071
|
-
|
2072
|
-
<xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
2073
|
-
<xsl:param name="scale"/>
|
2074
|
-
<xsl:variable name="dest">
|
2075
|
-
<xsl:choose>
|
2076
|
-
<xsl:when test="starts-with(@href, '#')">
|
2077
|
-
<xsl:value-of select="substring-after(@href, '#')"/>
|
2078
|
-
</xsl:when>
|
2079
|
-
<xsl:otherwise>
|
2080
|
-
<xsl:value-of select="@href"/>
|
2081
|
-
</xsl:otherwise>
|
2082
|
-
</xsl:choose>
|
2083
|
-
</xsl:variable>
|
2084
|
-
<xsl:for-each select="./*[local-name() = 'rect']">
|
2085
|
-
<xsl:call-template name="insertSVGMapLink">
|
2086
|
-
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
2087
|
-
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
2088
|
-
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
2089
|
-
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
2090
|
-
<xsl:with-param name="dest" select="$dest"/>
|
2091
|
-
</xsl:call-template>
|
2092
|
-
</xsl:for-each>
|
2093
|
-
|
2094
|
-
<xsl:for-each select="./*[local-name() = 'polygon']">
|
2095
|
-
<xsl:variable name="points">
|
2096
|
-
<xsl:call-template name="split">
|
2097
|
-
<xsl:with-param name="pText" select="@points"/>
|
2098
|
-
</xsl:call-template>
|
2099
|
-
</xsl:variable>
|
2100
|
-
<xsl:variable name="x_coords">
|
2101
|
-
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
2102
|
-
<xsl:sort select="." data-type="number"/>
|
2103
|
-
<x><xsl:value-of select="."/></x>
|
2104
|
-
</xsl:for-each>
|
2105
|
-
</xsl:variable>
|
2106
|
-
<xsl:variable name="y_coords">
|
2107
|
-
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
2108
|
-
<xsl:sort select="." data-type="number"/>
|
2109
|
-
<y><xsl:value-of select="."/></y>
|
2110
|
-
</xsl:for-each>
|
2111
|
-
</xsl:variable>
|
2112
|
-
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
2113
|
-
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
2114
|
-
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
2115
|
-
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
2116
|
-
<xsl:call-template name="insertSVGMapLink">
|
2117
|
-
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
2118
|
-
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
2119
|
-
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
2120
|
-
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
2121
|
-
<xsl:with-param name="dest" select="$dest"/>
|
2122
|
-
</xsl:call-template>
|
2123
|
-
</xsl:for-each>
|
2124
|
-
|
2125
|
-
<xsl:for-each select="./*[local-name() = 'circle']">
|
2126
|
-
<xsl:call-template name="insertSVGMapLink">
|
2127
|
-
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
2128
|
-
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
2129
|
-
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
2130
|
-
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
2131
|
-
<xsl:with-param name="dest" select="$dest"/>
|
2132
|
-
</xsl:call-template>
|
2133
|
-
</xsl:for-each>
|
2134
|
-
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
2135
|
-
<xsl:call-template name="insertSVGMapLink">
|
2136
|
-
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
2137
|
-
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
2138
|
-
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
2139
|
-
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
2140
|
-
<xsl:with-param name="dest" select="$dest"/>
|
2141
|
-
</xsl:call-template>
|
2142
|
-
</xsl:for-each>
|
2143
|
-
</xsl:template>
|
2144
|
-
|
2145
|
-
<xsl:template name="insertSVGMapLink">
|
2146
|
-
<xsl:param name="left"/>
|
2147
|
-
<xsl:param name="top"/>
|
2148
|
-
<xsl:param name="width"/>
|
2149
|
-
<xsl:param name="height"/>
|
2150
|
-
<xsl:param name="dest"/>
|
2151
|
-
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
2152
|
-
<fo:block font-size="1pt">
|
2153
|
-
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
2154
|
-
<fo:inline-container inline-progression-dimension="100%">
|
2155
|
-
<fo:block-container height="{$height - 1}px" width="100%">
|
2156
|
-
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
2157
|
-
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
2158
|
-
</xsl:if> -->
|
2159
|
-
<fo:block> </fo:block></fo:block-container>
|
2160
|
-
</fo:inline-container>
|
2161
|
-
</fo:basic-link>
|
2162
|
-
</fo:block>
|
2163
|
-
</fo:block-container>
|
2164
|
-
</xsl:template>
|
2165
|
-
|
2166
|
-
<!-- =================== -->
|
2167
|
-
<!-- End SVG images processing -->
|
2168
|
-
<!-- =================== -->
|
2169
1911
|
|
2170
1912
|
<!-- For express listings PDF attachments -->
|
2171
1913
|
<xsl:template match="*[local-name() = 'eref'][contains(@bibitemid, '.exp')]" priority="2">
|
@@ -2357,88 +2099,6 @@
|
|
2357
2099
|
<xsl:text>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</xsl:text>
|
2358
2100
|
</xsl:variable>
|
2359
2101
|
|
2360
|
-
<xsl:template name="number-to-words">
|
2361
|
-
<xsl:param name="number"/>
|
2362
|
-
<xsl:variable name="words">
|
2363
|
-
<words>
|
2364
|
-
<word cardinal="1">One-</word>
|
2365
|
-
<word ordinal="1">First </word>
|
2366
|
-
<word cardinal="2">Two-</word>
|
2367
|
-
<word ordinal="2">Second </word>
|
2368
|
-
<word cardinal="3">Three-</word>
|
2369
|
-
<word ordinal="3">Third </word>
|
2370
|
-
<word cardinal="4">Four-</word>
|
2371
|
-
<word ordinal="4">Fourth </word>
|
2372
|
-
<word cardinal="5">Five-</word>
|
2373
|
-
<word ordinal="5">Fifth </word>
|
2374
|
-
<word cardinal="6">Six-</word>
|
2375
|
-
<word ordinal="6">Sixth </word>
|
2376
|
-
<word cardinal="7">Seven-</word>
|
2377
|
-
<word ordinal="7">Seventh </word>
|
2378
|
-
<word cardinal="8">Eight-</word>
|
2379
|
-
<word ordinal="8">Eighth </word>
|
2380
|
-
<word cardinal="9">Nine-</word>
|
2381
|
-
<word ordinal="9">Ninth </word>
|
2382
|
-
<word ordinal="10">Tenth </word>
|
2383
|
-
<word ordinal="11">Eleventh </word>
|
2384
|
-
<word ordinal="12">Twelfth </word>
|
2385
|
-
<word ordinal="13">Thirteenth </word>
|
2386
|
-
<word ordinal="14">Fourteenth </word>
|
2387
|
-
<word ordinal="15">Fifteenth </word>
|
2388
|
-
<word ordinal="16">Sixteenth </word>
|
2389
|
-
<word ordinal="17">Seventeenth </word>
|
2390
|
-
<word ordinal="18">Eighteenth </word>
|
2391
|
-
<word ordinal="19">Nineteenth </word>
|
2392
|
-
<word cardinal="20">Twenty-</word>
|
2393
|
-
<word ordinal="20">Twentieth </word>
|
2394
|
-
<word cardinal="30">Thirty-</word>
|
2395
|
-
<word ordinal="30">Thirtieth </word>
|
2396
|
-
<word cardinal="40">Forty-</word>
|
2397
|
-
<word ordinal="40">Fortieth </word>
|
2398
|
-
<word cardinal="50">Fifty-</word>
|
2399
|
-
<word ordinal="50">Fiftieth </word>
|
2400
|
-
<word cardinal="60">Sixty-</word>
|
2401
|
-
<word ordinal="60">Sixtieth </word>
|
2402
|
-
<word cardinal="70">Seventy-</word>
|
2403
|
-
<word ordinal="70">Seventieth </word>
|
2404
|
-
<word cardinal="80">Eighty-</word>
|
2405
|
-
<word ordinal="80">Eightieth </word>
|
2406
|
-
<word cardinal="90">Ninety-</word>
|
2407
|
-
<word ordinal="90">Ninetieth </word>
|
2408
|
-
<word cardinal="100">Hundred-</word>
|
2409
|
-
<word ordinal="100">Hundredth </word>
|
2410
|
-
</words>
|
2411
|
-
</xsl:variable>
|
2412
|
-
|
2413
|
-
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
2414
|
-
|
2415
|
-
<xsl:choose>
|
2416
|
-
<xsl:when test="$ordinal != ''">
|
2417
|
-
<xsl:value-of select="$ordinal"/>
|
2418
|
-
</xsl:when>
|
2419
|
-
<xsl:otherwise>
|
2420
|
-
<xsl:choose>
|
2421
|
-
<xsl:when test="$number < 100">
|
2422
|
-
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
2423
|
-
<xsl:variable name="digit" select="substring($number,2)"/>
|
2424
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
2425
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
2426
|
-
</xsl:when>
|
2427
|
-
<xsl:otherwise>
|
2428
|
-
<!-- more 100 -->
|
2429
|
-
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
2430
|
-
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
2431
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
2432
|
-
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
2433
|
-
<xsl:call-template name="number-to-words">
|
2434
|
-
<xsl:with-param name="number" select="$digits"/>
|
2435
|
-
</xsl:call-template>
|
2436
|
-
</xsl:otherwise>
|
2437
|
-
</xsl:choose>
|
2438
|
-
</xsl:otherwise>
|
2439
|
-
</xsl:choose>
|
2440
|
-
</xsl:template>
|
2441
|
-
|
2442
2102
|
<xsl:template name="printEdition">
|
2443
2103
|
<xsl:variable name="edition" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:edition)"/>
|
2444
2104
|
<xsl:text> </xsl:text>
|
@@ -2783,7 +2443,9 @@
|
|
2783
2443
|
|
2784
2444
|
|
2785
2445
|
|
2786
|
-
</xsl:attribute-set><xsl:
|
2446
|
+
</xsl:attribute-set><xsl:variable name="table-border_">
|
2447
|
+
|
2448
|
+
</xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
|
2787
2449
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
2788
2450
|
|
2789
2451
|
|
@@ -2839,6 +2501,7 @@
|
|
2839
2501
|
|
2840
2502
|
|
2841
2503
|
|
2504
|
+
|
2842
2505
|
</xsl:attribute-set><xsl:attribute-set name="note-style">
|
2843
2506
|
|
2844
2507
|
|
@@ -3059,14 +2722,15 @@
|
|
3059
2722
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
3060
2723
|
|
3061
2724
|
<!-- Normative references -->
|
3062
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
2725
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
|
3063
2726
|
<!-- Terms and definitions -->
|
3064
2727
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
|
3065
2728
|
<!-- Another main sections -->
|
3066
2729
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
|
3067
2730
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
3068
2731
|
<!-- Bibliography -->
|
3069
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
2732
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
2733
|
+
|
3070
2734
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
3071
2735
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
3072
2736
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -3109,6 +2773,8 @@
|
|
3109
2773
|
<fo:block> </fo:block>
|
3110
2774
|
</xsl:if> -->
|
3111
2775
|
|
2776
|
+
|
2777
|
+
<!-- Display table's name before table as standalone block -->
|
3112
2778
|
<!-- $namespace = 'iso' or -->
|
3113
2779
|
|
3114
2780
|
|
@@ -3187,6 +2853,12 @@
|
|
3187
2853
|
|
3188
2854
|
|
3189
2855
|
|
2856
|
+
|
2857
|
+
|
2858
|
+
|
2859
|
+
<!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
|
2860
|
+
|
2861
|
+
|
3190
2862
|
<xsl:variable name="table_width">
|
3191
2863
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
3192
2864
|
100%
|
@@ -3207,6 +2879,7 @@
|
|
3207
2879
|
</xsl:if>
|
3208
2880
|
|
3209
2881
|
|
2882
|
+
|
3210
2883
|
<xsl:if test="ancestor::*[local-name() = 'table']">
|
3211
2884
|
<!-- for internal table in table cell -->
|
3212
2885
|
<attribute name="border">0.5pt solid black</attribute>
|
@@ -3656,6 +3329,8 @@
|
|
3656
3329
|
</xsl:choose>
|
3657
3330
|
</xsl:for-each>
|
3658
3331
|
|
3332
|
+
|
3333
|
+
|
3659
3334
|
<xsl:choose>
|
3660
3335
|
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
3661
3336
|
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
@@ -3680,6 +3355,7 @@
|
|
3680
3355
|
<fo:table-row>
|
3681
3356
|
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
3682
3357
|
|
3358
|
+
|
3683
3359
|
<xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
|
3684
3360
|
|
3685
3361
|
|
@@ -3692,6 +3368,11 @@
|
|
3692
3368
|
|
3693
3369
|
|
3694
3370
|
|
3371
|
+
|
3372
|
+
|
3373
|
+
<!-- for BSI (not PAS) display Notes before footnotes -->
|
3374
|
+
|
3375
|
+
|
3695
3376
|
<!-- except gb -->
|
3696
3377
|
|
3697
3378
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
@@ -3717,6 +3398,10 @@
|
|
3717
3398
|
<!-- fn processing -->
|
3718
3399
|
<xsl:call-template name="fn_display"/>
|
3719
3400
|
|
3401
|
+
|
3402
|
+
<!-- for PAS display Notes after footnotes -->
|
3403
|
+
|
3404
|
+
|
3720
3405
|
</fo:table-cell>
|
3721
3406
|
</fo:table-row>
|
3722
3407
|
</fo:table-body>
|
@@ -3761,12 +3446,17 @@
|
|
3761
3446
|
|
3762
3447
|
<fo:table-body>
|
3763
3448
|
|
3764
|
-
<xsl:variable name="
|
3449
|
+
<xsl:variable name="title_continued_">
|
3765
3450
|
<xsl:call-template name="getTitle">
|
3766
3451
|
<xsl:with-param name="name" select="'title-continued'"/>
|
3767
3452
|
</xsl:call-template>
|
3768
3453
|
</xsl:variable>
|
3769
3454
|
|
3455
|
+
<xsl:variable name="title_continued">
|
3456
|
+
<xsl:value-of select="$title_continued_"/>
|
3457
|
+
|
3458
|
+
</xsl:variable>
|
3459
|
+
|
3770
3460
|
<xsl:variable name="title_start" select="ancestor::*[local-name()='table'][1]/*[local-name()='name']/node()[1][self::text()]"/>
|
3771
3461
|
<xsl:variable name="table_number" select="substring-before($title_start, '—')"/>
|
3772
3462
|
|
@@ -3822,9 +3512,12 @@
|
|
3822
3512
|
|
3823
3513
|
|
3824
3514
|
|
3515
|
+
|
3516
|
+
|
3825
3517
|
</xsl:if>
|
3826
3518
|
<xsl:if test="$parent-name = 'tfoot'">
|
3827
3519
|
|
3520
|
+
|
3828
3521
|
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3829
3522
|
<xsl:attribute name="border-left">solid black 1pt</xsl:attribute>
|
3830
3523
|
<xsl:attribute name="border-right">solid black 1pt</xsl:attribute>
|
@@ -3839,6 +3532,8 @@
|
|
3839
3532
|
|
3840
3533
|
|
3841
3534
|
|
3535
|
+
|
3536
|
+
|
3842
3537
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
3843
3538
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
3844
3539
|
</xsl:if> -->
|
@@ -3920,6 +3615,7 @@
|
|
3920
3615
|
|
3921
3616
|
|
3922
3617
|
|
3618
|
+
|
3923
3619
|
<xsl:if test="ancestor::*[local-name() = 'tfoot']">
|
3924
3620
|
<xsl:attribute name="border">solid black 0</xsl:attribute>
|
3925
3621
|
</xsl:if>
|
@@ -3959,6 +3655,7 @@
|
|
3959
3655
|
|
3960
3656
|
<fo:block font-size="10pt" margin-bottom="12pt">
|
3961
3657
|
|
3658
|
+
|
3962
3659
|
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
3963
3660
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
3964
3661
|
|
@@ -3967,8 +3664,13 @@
|
|
3967
3664
|
|
3968
3665
|
|
3969
3666
|
|
3667
|
+
|
3668
|
+
<!-- Table's note name (NOTE, for example) -->
|
3669
|
+
|
3970
3670
|
<fo:inline padding-right="2mm">
|
3971
3671
|
|
3672
|
+
|
3673
|
+
|
3972
3674
|
|
3973
3675
|
|
3974
3676
|
|
@@ -3976,6 +3678,8 @@
|
|
3976
3678
|
|
3977
3679
|
</fo:inline>
|
3978
3680
|
|
3681
|
+
|
3682
|
+
|
3979
3683
|
<xsl:apply-templates mode="process"/>
|
3980
3684
|
</fo:block>
|
3981
3685
|
|
@@ -3995,6 +3699,8 @@
|
|
3995
3699
|
<xsl:variable name="reference" select="@reference"/>
|
3996
3700
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
3997
3701
|
<fo:block margin-bottom="12pt">
|
3702
|
+
|
3703
|
+
|
3998
3704
|
|
3999
3705
|
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
4000
3706
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
@@ -4013,9 +3719,11 @@
|
|
4013
3719
|
|
4014
3720
|
|
4015
3721
|
|
3722
|
+
|
4016
3723
|
<xsl:value-of select="@reference"/>
|
4017
3724
|
|
4018
3725
|
|
3726
|
+
|
4019
3727
|
</fo:inline>
|
4020
3728
|
<fo:inline>
|
4021
3729
|
|
@@ -4151,6 +3859,8 @@
|
|
4151
3859
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
4152
3860
|
<fo:inline font-size="80%" keep-with-previous.within-line="always">
|
4153
3861
|
|
3862
|
+
|
3863
|
+
|
4154
3864
|
<xsl:if test="ancestor::*[local-name()='td']">
|
4155
3865
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
4156
3866
|
<!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
|
@@ -4163,11 +3873,13 @@
|
|
4163
3873
|
|
4164
3874
|
|
4165
3875
|
|
3876
|
+
|
4166
3877
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
4167
3878
|
|
4168
3879
|
|
4169
3880
|
<xsl:value-of select="@reference"/>
|
4170
3881
|
|
3882
|
+
|
4171
3883
|
</fo:basic-link>
|
4172
3884
|
</fo:inline>
|
4173
3885
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -5085,6 +4797,7 @@
|
|
5085
4797
|
<fo:inline xsl:use-attribute-sets="link-style">
|
5086
4798
|
|
5087
4799
|
|
4800
|
+
|
5088
4801
|
<xsl:choose>
|
5089
4802
|
<xsl:when test="$target_text = ''">
|
5090
4803
|
<xsl:apply-templates/>
|
@@ -5193,6 +4906,7 @@
|
|
5193
4906
|
|
5194
4907
|
|
5195
4908
|
|
4909
|
+
|
5196
4910
|
<fo:block-container margin-left="0mm">
|
5197
4911
|
|
5198
4912
|
|
@@ -5367,7 +5081,24 @@
|
|
5367
5081
|
</fo:instream-foreign-object>
|
5368
5082
|
</xsl:when>
|
5369
5083
|
<xsl:otherwise>
|
5370
|
-
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"
|
5084
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
5085
|
+
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
5086
|
+
|
5087
|
+
<xsl:variable name="img_src">
|
5088
|
+
<xsl:choose>
|
5089
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
5090
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
5091
|
+
</xsl:choose>
|
5092
|
+
</xsl:variable>
|
5093
|
+
|
5094
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
5095
|
+
<xsl:if test="number($scale) < 100">
|
5096
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
5097
|
+
</xsl:if>
|
5098
|
+
|
5099
|
+
</xsl:if>
|
5100
|
+
|
5101
|
+
</fo:external-graphic>
|
5371
5102
|
</xsl:otherwise>
|
5372
5103
|
</xsl:choose>
|
5373
5104
|
|
@@ -5435,6 +5166,253 @@
|
|
5435
5166
|
<xsl:param name="height"/>
|
5436
5167
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
5437
5168
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
5169
|
+
</xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
|
5170
|
+
<xsl:param name="name"/>
|
5171
|
+
|
5172
|
+
<xsl:variable name="svg_content">
|
5173
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
5174
|
+
</xsl:variable>
|
5175
|
+
|
5176
|
+
<xsl:variable name="alt-text">
|
5177
|
+
<xsl:choose>
|
5178
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
5179
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
5180
|
+
</xsl:when>
|
5181
|
+
<xsl:when test="normalize-space($name) != ''">
|
5182
|
+
<xsl:value-of select="$name"/>
|
5183
|
+
</xsl:when>
|
5184
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
5185
|
+
</xsl:choose>
|
5186
|
+
</xsl:variable>
|
5187
|
+
|
5188
|
+
<xsl:choose>
|
5189
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
5190
|
+
<fo:block>
|
5191
|
+
<xsl:variable name="width" select="@width"/>
|
5192
|
+
<xsl:variable name="height" select="@height"/>
|
5193
|
+
|
5194
|
+
<xsl:variable name="scale_x">
|
5195
|
+
<xsl:choose>
|
5196
|
+
<xsl:when test="$width > $width_effective_px">
|
5197
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
5198
|
+
</xsl:when>
|
5199
|
+
<xsl:otherwise>1</xsl:otherwise>
|
5200
|
+
</xsl:choose>
|
5201
|
+
</xsl:variable>
|
5202
|
+
|
5203
|
+
<xsl:variable name="scale_y">
|
5204
|
+
<xsl:choose>
|
5205
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
5206
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
5207
|
+
</xsl:when>
|
5208
|
+
<xsl:otherwise>1</xsl:otherwise>
|
5209
|
+
</xsl:choose>
|
5210
|
+
</xsl:variable>
|
5211
|
+
|
5212
|
+
<xsl:variable name="scale">
|
5213
|
+
<xsl:choose>
|
5214
|
+
<xsl:when test="$scale_y != 1">
|
5215
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
5216
|
+
</xsl:when>
|
5217
|
+
<xsl:otherwise>
|
5218
|
+
<xsl:value-of select="$scale_x"/>
|
5219
|
+
</xsl:otherwise>
|
5220
|
+
</xsl:choose>
|
5221
|
+
</xsl:variable>
|
5222
|
+
|
5223
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
5224
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
5225
|
+
|
5226
|
+
<fo:table table-layout="fixed" width="100%">
|
5227
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
5228
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
5229
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
5230
|
+
<fo:table-body>
|
5231
|
+
<fo:table-row>
|
5232
|
+
<fo:table-cell column-number="2">
|
5233
|
+
<fo:block>
|
5234
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
5235
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
5236
|
+
<fo:block line-height="0" font-size="0">
|
5237
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
5238
|
+
<xsl:call-template name="bookmark"/>
|
5239
|
+
</xsl:for-each>
|
5240
|
+
</fo:block>
|
5241
|
+
</xsl:if>
|
5242
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
5243
|
+
|
5244
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
5245
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5246
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5247
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5248
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5249
|
+
|
5250
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
5251
|
+
</fo:instream-foreign-object>
|
5252
|
+
</fo:block>
|
5253
|
+
|
5254
|
+
<xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
|
5255
|
+
<xsl:with-param name="scale" select="$scale"/>
|
5256
|
+
</xsl:apply-templates>
|
5257
|
+
</fo:block-container>
|
5258
|
+
</fo:block>
|
5259
|
+
</fo:table-cell>
|
5260
|
+
</fo:table-row>
|
5261
|
+
</fo:table-body>
|
5262
|
+
</fo:table>
|
5263
|
+
</fo:block>
|
5264
|
+
|
5265
|
+
</xsl:when>
|
5266
|
+
<xsl:otherwise>
|
5267
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
5268
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
5269
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5270
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5271
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5272
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
5273
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
5274
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
5275
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
5276
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
5277
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
5278
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
5279
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
5280
|
+
</xsl:if>
|
5281
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5282
|
+
<xsl:copy-of select="$svg_content"/>
|
5283
|
+
</fo:instream-foreign-object>
|
5284
|
+
</fo:block>
|
5285
|
+
</xsl:otherwise>
|
5286
|
+
</xsl:choose>
|
5287
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
5288
|
+
<xsl:copy>
|
5289
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
5290
|
+
</xsl:copy>
|
5291
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
5292
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
5293
|
+
<xsl:value-of select="."/>
|
5294
|
+
</xsl:attribute>
|
5295
|
+
</xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
|
5296
|
+
<xsl:copy>
|
5297
|
+
<xsl:apply-templates select="@*" mode="svg_update"/>
|
5298
|
+
<xsl:variable name="viewbox">
|
5299
|
+
<xsl:call-template name="split">
|
5300
|
+
<xsl:with-param name="pText" select="@viewBox"/>
|
5301
|
+
<xsl:with-param name="sep" select="' '"/>
|
5302
|
+
</xsl:call-template>
|
5303
|
+
</xsl:variable>
|
5304
|
+
<xsl:attribute name="width">
|
5305
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
|
5306
|
+
</xsl:attribute>
|
5307
|
+
<xsl:attribute name="height">
|
5308
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
|
5309
|
+
</xsl:attribute>
|
5310
|
+
<xsl:apply-templates mode="svg_update"/>
|
5311
|
+
</xsl:copy>
|
5312
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
5313
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
5314
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
5315
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
5316
|
+
<xsl:call-template name="image_svg">
|
5317
|
+
<xsl:with-param name="name" select="$name"/>
|
5318
|
+
</xsl:call-template>
|
5319
|
+
</xsl:for-each>
|
5320
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
5321
|
+
<xsl:copy>
|
5322
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
5323
|
+
</xsl:copy>
|
5324
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
5325
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
5326
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
5327
|
+
<xsl:param name="scale"/>
|
5328
|
+
<xsl:variable name="dest">
|
5329
|
+
<xsl:choose>
|
5330
|
+
<xsl:when test="starts-with(@href, '#')">
|
5331
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
5332
|
+
</xsl:when>
|
5333
|
+
<xsl:otherwise>
|
5334
|
+
<xsl:value-of select="@href"/>
|
5335
|
+
</xsl:otherwise>
|
5336
|
+
</xsl:choose>
|
5337
|
+
</xsl:variable>
|
5338
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
5339
|
+
<xsl:call-template name="insertSVGMapLink">
|
5340
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
5341
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
5342
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
5343
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
5344
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5345
|
+
</xsl:call-template>
|
5346
|
+
</xsl:for-each>
|
5347
|
+
|
5348
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
5349
|
+
<xsl:variable name="points">
|
5350
|
+
<xsl:call-template name="split">
|
5351
|
+
<xsl:with-param name="pText" select="@points"/>
|
5352
|
+
</xsl:call-template>
|
5353
|
+
</xsl:variable>
|
5354
|
+
<xsl:variable name="x_coords">
|
5355
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
5356
|
+
<xsl:sort select="." data-type="number"/>
|
5357
|
+
<x><xsl:value-of select="."/></x>
|
5358
|
+
</xsl:for-each>
|
5359
|
+
</xsl:variable>
|
5360
|
+
<xsl:variable name="y_coords">
|
5361
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
5362
|
+
<xsl:sort select="." data-type="number"/>
|
5363
|
+
<y><xsl:value-of select="."/></y>
|
5364
|
+
</xsl:for-each>
|
5365
|
+
</xsl:variable>
|
5366
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
5367
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
5368
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
5369
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
5370
|
+
<xsl:call-template name="insertSVGMapLink">
|
5371
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
5372
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
5373
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
5374
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
5375
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5376
|
+
</xsl:call-template>
|
5377
|
+
</xsl:for-each>
|
5378
|
+
|
5379
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
5380
|
+
<xsl:call-template name="insertSVGMapLink">
|
5381
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
5382
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
5383
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
5384
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
5385
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5386
|
+
</xsl:call-template>
|
5387
|
+
</xsl:for-each>
|
5388
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
5389
|
+
<xsl:call-template name="insertSVGMapLink">
|
5390
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
5391
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
5392
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
5393
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
5394
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5395
|
+
</xsl:call-template>
|
5396
|
+
</xsl:for-each>
|
5397
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
5398
|
+
<xsl:param name="left"/>
|
5399
|
+
<xsl:param name="top"/>
|
5400
|
+
<xsl:param name="width"/>
|
5401
|
+
<xsl:param name="height"/>
|
5402
|
+
<xsl:param name="dest"/>
|
5403
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
5404
|
+
<fo:block font-size="1pt">
|
5405
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
5406
|
+
<fo:inline-container inline-progression-dimension="100%">
|
5407
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
5408
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
5409
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
5410
|
+
</xsl:if> -->
|
5411
|
+
<fo:block> </fo:block></fo:block-container>
|
5412
|
+
</fo:inline-container>
|
5413
|
+
</fo:basic-link>
|
5414
|
+
</fo:block>
|
5415
|
+
</fo:block-container>
|
5438
5416
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
5439
5417
|
<xsl:apply-templates mode="contents"/>
|
5440
5418
|
<xsl:text> </xsl:text>
|
@@ -5463,28 +5441,39 @@
|
|
5463
5441
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
5464
5442
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
5465
5443
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
5444
|
+
<xsl:if test="@bundle = 'true'">
|
5445
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
5446
|
+
</xsl:if>
|
5466
5447
|
<fo:bookmark-title>
|
5467
|
-
<xsl:variable name="bookmark-title_">
|
5468
|
-
<xsl:call-template name="getLangVersion">
|
5469
|
-
<xsl:with-param name="lang" select="@lang"/>
|
5470
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
5471
|
-
<xsl:with-param name="title" select="@title-part"/>
|
5472
|
-
</xsl:call-template>
|
5473
|
-
</xsl:variable>
|
5474
5448
|
<xsl:choose>
|
5475
|
-
<xsl:when test="normalize-space(
|
5476
|
-
<xsl:
|
5477
|
-
|
5478
|
-
|
5449
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
5450
|
+
<xsl:variable name="bookmark-title_">
|
5451
|
+
<xsl:call-template name="getLangVersion">
|
5452
|
+
<xsl:with-param name="lang" select="@lang"/>
|
5453
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
5454
|
+
<xsl:with-param name="title" select="@title-part"/>
|
5455
|
+
</xsl:call-template>
|
5456
|
+
</xsl:variable>
|
5479
5457
|
<xsl:choose>
|
5480
|
-
<xsl:when test="
|
5481
|
-
|
5482
|
-
|
5483
|
-
<xsl:otherwise
|
5458
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
5459
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
5460
|
+
</xsl:when>
|
5461
|
+
<xsl:otherwise>
|
5462
|
+
<xsl:choose>
|
5463
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
5464
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
5465
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
5466
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
5467
|
+
</xsl:choose>
|
5468
|
+
</xsl:otherwise>
|
5484
5469
|
</xsl:choose>
|
5470
|
+
</xsl:when>
|
5471
|
+
<xsl:otherwise>
|
5472
|
+
<xsl:value-of select="@title-part"/>
|
5485
5473
|
</xsl:otherwise>
|
5486
5474
|
</xsl:choose>
|
5487
5475
|
</fo:bookmark-title>
|
5476
|
+
|
5488
5477
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
5489
5478
|
|
5490
5479
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -5583,16 +5572,23 @@
|
|
5583
5572
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
5584
5573
|
</xsl:choose>
|
5585
5574
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
5586
|
-
<
|
5587
|
-
|
5588
|
-
|
5589
|
-
|
5590
|
-
<xsl:
|
5591
|
-
|
5592
|
-
|
5593
|
-
|
5594
|
-
|
5595
|
-
|
5575
|
+
<xsl:choose>
|
5576
|
+
<xsl:when test="@id != ''">
|
5577
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
5578
|
+
<fo:bookmark-title>
|
5579
|
+
<xsl:if test="@section != ''">
|
5580
|
+
<xsl:value-of select="@section"/>
|
5581
|
+
<xsl:text> </xsl:text>
|
5582
|
+
</xsl:if>
|
5583
|
+
<xsl:value-of select="normalize-space(title)"/>
|
5584
|
+
</fo:bookmark-title>
|
5585
|
+
<xsl:apply-templates mode="bookmark"/>
|
5586
|
+
</fo:bookmark>
|
5587
|
+
</xsl:when>
|
5588
|
+
<xsl:otherwise>
|
5589
|
+
<xsl:apply-templates mode="bookmark"/>
|
5590
|
+
</xsl:otherwise>
|
5591
|
+
</xsl:choose>
|
5596
5592
|
</xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
|
5597
5593
|
<xsl:if test="normalize-space() != ''">
|
5598
5594
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
@@ -6154,7 +6150,9 @@
|
|
6154
6150
|
|
6155
6151
|
|
6156
6152
|
</xsl:if>
|
6157
|
-
|
6153
|
+
|
6154
|
+
|
6155
|
+
|
6158
6156
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
6159
6157
|
<xsl:if test="normalize-space(@citeas) = ''">
|
6160
6158
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
@@ -6163,6 +6161,7 @@
|
|
6163
6161
|
|
6164
6162
|
|
6165
6163
|
|
6164
|
+
|
6166
6165
|
</xsl:if>
|
6167
6166
|
|
6168
6167
|
<xsl:apply-templates/>
|
@@ -7032,20 +7031,40 @@
|
|
7032
7031
|
</xsl:call-template>
|
7033
7032
|
</xsl:if>
|
7034
7033
|
</xsl:template><xsl:template name="getLocalizedString">
|
7035
|
-
<xsl:param name="key"/>
|
7034
|
+
<xsl:param name="key"/>
|
7035
|
+
<xsl:param name="formatted">false</xsl:param>
|
7036
7036
|
|
7037
7037
|
<xsl:variable name="curr_lang">
|
7038
7038
|
<xsl:call-template name="getLang"/>
|
7039
7039
|
</xsl:variable>
|
7040
7040
|
|
7041
|
-
<xsl:variable name="data_value"
|
7041
|
+
<xsl:variable name="data_value">
|
7042
|
+
<xsl:choose>
|
7043
|
+
<xsl:when test="$formatted = 'true'">
|
7044
|
+
<xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
7045
|
+
</xsl:when>
|
7046
|
+
<xsl:otherwise>
|
7047
|
+
<xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
7048
|
+
</xsl:otherwise>
|
7049
|
+
</xsl:choose>
|
7050
|
+
</xsl:variable>
|
7042
7051
|
|
7043
7052
|
<xsl:choose>
|
7044
|
-
<xsl:when test="$data_value != ''">
|
7045
|
-
<xsl:
|
7053
|
+
<xsl:when test="normalize-space($data_value) != ''">
|
7054
|
+
<xsl:choose>
|
7055
|
+
<xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
|
7056
|
+
<xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
|
7057
|
+
</xsl:choose>
|
7046
7058
|
</xsl:when>
|
7047
7059
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
7048
|
-
<xsl:
|
7060
|
+
<xsl:choose>
|
7061
|
+
<xsl:when test="$formatted = 'true'">
|
7062
|
+
<xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
7063
|
+
</xsl:when>
|
7064
|
+
<xsl:otherwise>
|
7065
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
7066
|
+
</xsl:otherwise>
|
7067
|
+
</xsl:choose>
|
7049
7068
|
</xsl:when>
|
7050
7069
|
<xsl:otherwise>
|
7051
7070
|
<xsl:variable name="key_">
|
@@ -7056,7 +7075,7 @@
|
|
7056
7075
|
<xsl:value-of select="$key_"/>
|
7057
7076
|
</xsl:otherwise>
|
7058
7077
|
</xsl:choose>
|
7059
|
-
|
7078
|
+
|
7060
7079
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
7061
7080
|
<xsl:param name="isAdded"/>
|
7062
7081
|
<xsl:param name="isDeleted"/>
|
@@ -7107,4 +7126,100 @@
|
|
7107
7126
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
7108
7127
|
</xsl:choose>
|
7109
7128
|
</xsl:attribute>
|
7129
|
+
</xsl:template><xsl:template name="number-to-words">
|
7130
|
+
<xsl:param name="number"/>
|
7131
|
+
<xsl:param name="first"/>
|
7132
|
+
<xsl:if test="$number != ''">
|
7133
|
+
<xsl:variable name="words">
|
7134
|
+
<words>
|
7135
|
+
<word cardinal="1">One-</word>
|
7136
|
+
<word ordinal="1">First </word>
|
7137
|
+
<word cardinal="2">Two-</word>
|
7138
|
+
<word ordinal="2">Second </word>
|
7139
|
+
<word cardinal="3">Three-</word>
|
7140
|
+
<word ordinal="3">Third </word>
|
7141
|
+
<word cardinal="4">Four-</word>
|
7142
|
+
<word ordinal="4">Fourth </word>
|
7143
|
+
<word cardinal="5">Five-</word>
|
7144
|
+
<word ordinal="5">Fifth </word>
|
7145
|
+
<word cardinal="6">Six-</word>
|
7146
|
+
<word ordinal="6">Sixth </word>
|
7147
|
+
<word cardinal="7">Seven-</word>
|
7148
|
+
<word ordinal="7">Seventh </word>
|
7149
|
+
<word cardinal="8">Eight-</word>
|
7150
|
+
<word ordinal="8">Eighth </word>
|
7151
|
+
<word cardinal="9">Nine-</word>
|
7152
|
+
<word ordinal="9">Ninth </word>
|
7153
|
+
<word ordinal="10">Tenth </word>
|
7154
|
+
<word ordinal="11">Eleventh </word>
|
7155
|
+
<word ordinal="12">Twelfth </word>
|
7156
|
+
<word ordinal="13">Thirteenth </word>
|
7157
|
+
<word ordinal="14">Fourteenth </word>
|
7158
|
+
<word ordinal="15">Fifteenth </word>
|
7159
|
+
<word ordinal="16">Sixteenth </word>
|
7160
|
+
<word ordinal="17">Seventeenth </word>
|
7161
|
+
<word ordinal="18">Eighteenth </word>
|
7162
|
+
<word ordinal="19">Nineteenth </word>
|
7163
|
+
<word cardinal="20">Twenty-</word>
|
7164
|
+
<word ordinal="20">Twentieth </word>
|
7165
|
+
<word cardinal="30">Thirty-</word>
|
7166
|
+
<word ordinal="30">Thirtieth </word>
|
7167
|
+
<word cardinal="40">Forty-</word>
|
7168
|
+
<word ordinal="40">Fortieth </word>
|
7169
|
+
<word cardinal="50">Fifty-</word>
|
7170
|
+
<word ordinal="50">Fiftieth </word>
|
7171
|
+
<word cardinal="60">Sixty-</word>
|
7172
|
+
<word ordinal="60">Sixtieth </word>
|
7173
|
+
<word cardinal="70">Seventy-</word>
|
7174
|
+
<word ordinal="70">Seventieth </word>
|
7175
|
+
<word cardinal="80">Eighty-</word>
|
7176
|
+
<word ordinal="80">Eightieth </word>
|
7177
|
+
<word cardinal="90">Ninety-</word>
|
7178
|
+
<word ordinal="90">Ninetieth </word>
|
7179
|
+
<word cardinal="100">Hundred-</word>
|
7180
|
+
<word ordinal="100">Hundredth </word>
|
7181
|
+
</words>
|
7182
|
+
</xsl:variable>
|
7183
|
+
|
7184
|
+
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
7185
|
+
|
7186
|
+
<xsl:variable name="value">
|
7187
|
+
<xsl:choose>
|
7188
|
+
<xsl:when test="$ordinal != ''">
|
7189
|
+
<xsl:value-of select="$ordinal"/>
|
7190
|
+
</xsl:when>
|
7191
|
+
<xsl:otherwise>
|
7192
|
+
<xsl:choose>
|
7193
|
+
<xsl:when test="$number < 100">
|
7194
|
+
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
7195
|
+
<xsl:variable name="digit" select="substring($number,2)"/>
|
7196
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
7197
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
7198
|
+
</xsl:when>
|
7199
|
+
<xsl:otherwise>
|
7200
|
+
<!-- more 100 -->
|
7201
|
+
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
7202
|
+
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
7203
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
7204
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
7205
|
+
<xsl:call-template name="number-to-words">
|
7206
|
+
<xsl:with-param name="number" select="$digits"/>
|
7207
|
+
</xsl:call-template>
|
7208
|
+
</xsl:otherwise>
|
7209
|
+
</xsl:choose>
|
7210
|
+
</xsl:otherwise>
|
7211
|
+
</xsl:choose>
|
7212
|
+
</xsl:variable>
|
7213
|
+
<xsl:choose>
|
7214
|
+
<xsl:when test="$first = 'true'">
|
7215
|
+
<xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
|
7216
|
+
<xsl:call-template name="capitalize">
|
7217
|
+
<xsl:with-param name="str" select="$value_lc"/>
|
7218
|
+
</xsl:call-template>
|
7219
|
+
</xsl:when>
|
7220
|
+
<xsl:otherwise>
|
7221
|
+
<xsl:value-of select="$value"/>
|
7222
|
+
</xsl:otherwise>
|
7223
|
+
</xsl:choose>
|
7224
|
+
</xsl:if>
|
7110
7225
|
</xsl:template></xsl:stylesheet>
|