metanorma-iso 1.8.6 → 1.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2099,88 +2099,6 @@
2099
2099
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAFEAAABHCAIAAADwYjznAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAA66SURBVHhezZt5sM/VG8fNVH7JruxkSZKQ3TAYS7aGajKpFBnRxBjjkhrLrRgmYwm59hrGjC0miSmmIgoVZYu00GJtxkyMkV2/1+fzPh7nfr7fe33v/X6/9/d7/3HmOc/nLM/7PM95zjnfS6F//xc4f/786dOnXaXAUdCcjx071rt373vvvbdChQrNmzdfuXKl+1CAKFDOR44cqVWrVqFChf4T4vbbb7/zzjsnT57sPhcUCo7ztWvX2rRpc9tttxUtWvSuEAgwp/z0009dowJBwXGeM2dO4cKFRZWySJEikvF2o0aNrly54tqlHwXE+cyZM9WrV4czJMW5WLFixv+OO+6YPn26a5p+FBDnjIwM/Ak9AHMcm5mZyWY2TeXKlf/66y/XOs0oCM4HDhwoU6aMMSSqs7Kyfv75Z5jjYXmeff7yyy+7DmlGQXB+7LHHcLKFcdu2bXft2vXtt9/Onz9fS8AnVqRkyZLff/+965NOpJ3zhg0bIsQ4k7/55psvv/xy9+7dnTp1MlezLp07d3bd0on0cr569WqTJk18VlxI9uzZs3XrVjhv37597dq199xzD2vBV9aFo2vVqlWuc9qQXs6zZs2CcLCJ77oLPlWqVOEohqo4U8L/hRdesEVBeOihhy5evOj6pwdp5Pz3339Xq1ZN5xOcEV577TXiWWxVfvXVV5R+M2Jh3Lhxboj0II2chw4dqtQF5EBtY+MsgXz2xhtvKKvTknAoX7780aNH3ShpQLo4Hzx4sFSpUmLCRgUzZsyAnlEVbZXo/XOLlSLg3UBpQLo4P/HEE+ZkhPbt23MOhXwdz5C1A+fWokWLuJmxNKwRK1W8eHG2vRsr1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GvNmjVppp8NBLWXYFXgf/L1gpTs6pEjRzKsZtHejPyfvWycIz8ga6fZcII/gSANcPUQqloJYMXu4vZKHLGsrCkG4ZDMzEwtqyEcwMGq+uTDV5rMLITMgw8+yOBGZOjQoY5hiJucedzKFNoh6PbPQWIjBjOHMI2vFEwjIVJiDWHcuHFjMg2X5CpVqrzyyitGOOiWvYvBlKaPq5FMQM2cORM/iwvLyvbZv3+/42mcOZ8aNGggJ9OaCBw4cGBO6VTwlbeUEQBpBtqQ5H26ZMkSqhzXauDDevmQMhwm2/gG01CySfXH+sDRoau7d+8upsBx5v3EB9gCFoa3OAbFXkIEvyqZ0hBRxrbh2CN8IE8covc/GUyZiwAislX1mwzuVTLD4eDDDz8U2YDzyZMnK1WqpA1AC4SxY8fiZGhrFL/0BYCsqimlMfjKWBlEZFX9UjA5aJH9qzQRYH/fvn3hAiN4Ebncfy5duuQ4Dx48mLyibzRq0aLFDz/8QAIE7I28Ik+9btk4fzYAOO/bt6927dpyNYA299OAM3ncfySTvXiOjh49msvw8OHDrYxUTekj0tLgV5FVNcFgelV9+J/iNrOqfR02bNibb77JrhY1uZN3yPnz5wsdOHDA/uYmQJvPNAUSIlXBlw1xlSBux5wa+6CN38yqEoD0Bl+JAC/YQUruROYxV+jPP//UHzhDN7vbguQIctJHELdZrDIRDUhwUpBTS/T6BP8SJUrwjA32M9cj/d/zILuFV3MTBKua0qomhOoAvtJgn0yQbBogpcFpQ5jG9BEhUvpVARmO7dq141QOOF++fJk0Vq5cOb5pVf5PoLBMHvDiFtShQwf9EuzOZ3D06NFNmzbpfKI0KPUDyVZK8GUrfZjeBCsFk4MWubYJPnswvSFSFVBu3ryZJ5fj+e+//wVuVmgt0lkFPgAAAABJRU5ErkJggg==</xsl:text>
2100
2100
  </xsl:variable>
2101
2101
 
2102
- <xsl:template name="number-to-words">
2103
- <xsl:param name="number"/>
2104
- <xsl:variable name="words">
2105
- <words>
2106
- <word cardinal="1">One-</word>
2107
- <word ordinal="1">First </word>
2108
- <word cardinal="2">Two-</word>
2109
- <word ordinal="2">Second </word>
2110
- <word cardinal="3">Three-</word>
2111
- <word ordinal="3">Third </word>
2112
- <word cardinal="4">Four-</word>
2113
- <word ordinal="4">Fourth </word>
2114
- <word cardinal="5">Five-</word>
2115
- <word ordinal="5">Fifth </word>
2116
- <word cardinal="6">Six-</word>
2117
- <word ordinal="6">Sixth </word>
2118
- <word cardinal="7">Seven-</word>
2119
- <word ordinal="7">Seventh </word>
2120
- <word cardinal="8">Eight-</word>
2121
- <word ordinal="8">Eighth </word>
2122
- <word cardinal="9">Nine-</word>
2123
- <word ordinal="9">Ninth </word>
2124
- <word ordinal="10">Tenth </word>
2125
- <word ordinal="11">Eleventh </word>
2126
- <word ordinal="12">Twelfth </word>
2127
- <word ordinal="13">Thirteenth </word>
2128
- <word ordinal="14">Fourteenth </word>
2129
- <word ordinal="15">Fifteenth </word>
2130
- <word ordinal="16">Sixteenth </word>
2131
- <word ordinal="17">Seventeenth </word>
2132
- <word ordinal="18">Eighteenth </word>
2133
- <word ordinal="19">Nineteenth </word>
2134
- <word cardinal="20">Twenty-</word>
2135
- <word ordinal="20">Twentieth </word>
2136
- <word cardinal="30">Thirty-</word>
2137
- <word ordinal="30">Thirtieth </word>
2138
- <word cardinal="40">Forty-</word>
2139
- <word ordinal="40">Fortieth </word>
2140
- <word cardinal="50">Fifty-</word>
2141
- <word ordinal="50">Fiftieth </word>
2142
- <word cardinal="60">Sixty-</word>
2143
- <word ordinal="60">Sixtieth </word>
2144
- <word cardinal="70">Seventy-</word>
2145
- <word ordinal="70">Seventieth </word>
2146
- <word cardinal="80">Eighty-</word>
2147
- <word ordinal="80">Eightieth </word>
2148
- <word cardinal="90">Ninety-</word>
2149
- <word ordinal="90">Ninetieth </word>
2150
- <word cardinal="100">Hundred-</word>
2151
- <word ordinal="100">Hundredth </word>
2152
- </words>
2153
- </xsl:variable>
2154
-
2155
- <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
2156
-
2157
- <xsl:choose>
2158
- <xsl:when test="$ordinal != ''">
2159
- <xsl:value-of select="$ordinal"/>
2160
- </xsl:when>
2161
- <xsl:otherwise>
2162
- <xsl:choose>
2163
- <xsl:when test="$number &lt; 100">
2164
- <xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
2165
- <xsl:variable name="digit" select="substring($number,2)"/>
2166
- <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
2167
- <xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
2168
- </xsl:when>
2169
- <xsl:otherwise>
2170
- <!-- more 100 -->
2171
- <xsl:variable name="hundred" select="substring($number,1,1)"/>
2172
- <xsl:variable name="digits" select="number(substring($number,2))"/>
2173
- <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
2174
- <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
2175
- <xsl:call-template name="number-to-words">
2176
- <xsl:with-param name="number" select="$digits"/>
2177
- </xsl:call-template>
2178
- </xsl:otherwise>
2179
- </xsl:choose>
2180
- </xsl:otherwise>
2181
- </xsl:choose>
2182
- </xsl:template>
2183
-
2184
2102
  <xsl:template name="printEdition">
2185
2103
  <xsl:variable name="edition" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:edition)"/>
2186
2104
  <xsl:text> </xsl:text>
@@ -2409,7 +2327,7 @@
2409
2327
  <xsl:attribute name="white-space">pre</xsl:attribute>
2410
2328
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2411
2329
 
2412
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2330
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2413
2331
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2414
2332
 
2415
2333
 
@@ -2500,6 +2418,7 @@
2500
2418
 
2501
2419
 
2502
2420
 
2421
+
2503
2422
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2504
2423
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
2505
2424
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
@@ -2525,7 +2444,9 @@
2525
2444
 
2526
2445
 
2527
2446
 
2528
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
2447
+ </xsl:attribute-set><xsl:variable name="table-border_">
2448
+
2449
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
2529
2450
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2530
2451
 
2531
2452
 
@@ -2745,7 +2666,7 @@
2745
2666
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
2746
2667
 
2747
2668
 
2748
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2669
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2749
2670
 
2750
2671
 
2751
2672
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
@@ -2853,6 +2774,8 @@
2853
2774
  <fo:block>&#xA0;</fo:block>
2854
2775
  </xsl:if> -->
2855
2776
 
2777
+
2778
+ <!-- Display table's name before table as standalone block -->
2856
2779
  <!-- $namespace = 'iso' or -->
2857
2780
 
2858
2781
 
@@ -2931,6 +2854,12 @@
2931
2854
 
2932
2855
 
2933
2856
 
2857
+
2858
+
2859
+
2860
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2861
+
2862
+
2934
2863
  <xsl:variable name="table_width">
2935
2864
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2936
2865
  100%
@@ -2951,6 +2880,7 @@
2951
2880
  </xsl:if>
2952
2881
 
2953
2882
 
2883
+
2954
2884
  <xsl:if test="ancestor::*[local-name() = 'table']">
2955
2885
  <!-- for internal table in table cell -->
2956
2886
  <attribute name="border">0.5pt solid black</attribute>
@@ -2985,6 +2915,8 @@
2985
2915
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2986
2916
  </xsl:if>
2987
2917
 
2918
+
2919
+
2988
2920
  <xsl:choose>
2989
2921
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2990
2922
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -3280,9 +3212,13 @@
3280
3212
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3281
3213
  <xsl:with-param name="continued">true</xsl:with-param>
3282
3214
  </xsl:apply-templates>
3283
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3284
- <xsl:call-template name="fn_name_display"/>
3285
- </xsl:for-each>
3215
+
3216
+
3217
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3218
+ <xsl:call-template name="fn_name_display"/>
3219
+ </xsl:for-each>
3220
+
3221
+
3286
3222
 
3287
3223
  <fo:block text-align="right" font-style="italic">
3288
3224
  <xsl:text> </xsl:text>
@@ -3371,7 +3307,11 @@
3371
3307
 
3372
3308
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3373
3309
 
3374
- <xsl:if test="$isNoteOrFnExist = 'true'">
3310
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
3311
+
3312
+ </xsl:variable>
3313
+
3314
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
3375
3315
 
3376
3316
  <xsl:variable name="cols-count">
3377
3317
  <xsl:choose>
@@ -3400,6 +3340,8 @@
3400
3340
  </xsl:choose>
3401
3341
  </xsl:for-each>
3402
3342
 
3343
+
3344
+
3403
3345
  <xsl:choose>
3404
3346
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3405
3347
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -3424,6 +3366,7 @@
3424
3366
  <fo:table-row>
3425
3367
  <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
3426
3368
 
3369
+
3427
3370
  <xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
3428
3371
 
3429
3372
 
@@ -3436,6 +3379,11 @@
3436
3379
 
3437
3380
 
3438
3381
 
3382
+
3383
+
3384
+ <!-- for BSI (not PAS) display Notes before footnotes -->
3385
+
3386
+
3439
3387
  <!-- except gb -->
3440
3388
 
3441
3389
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
@@ -3461,6 +3409,10 @@
3461
3409
  <!-- fn processing -->
3462
3410
  <xsl:call-template name="fn_display"/>
3463
3411
 
3412
+
3413
+ <!-- for PAS display Notes after footnotes -->
3414
+
3415
+
3464
3416
  </fo:table-cell>
3465
3417
  </fo:table-row>
3466
3418
  </fo:table-body>
@@ -3505,21 +3457,29 @@
3505
3457
 
3506
3458
  <fo:table-body>
3507
3459
 
3508
- <xsl:variable name="title_continued">
3460
+ <xsl:variable name="title_continued_">
3509
3461
  <xsl:call-template name="getTitle">
3510
3462
  <xsl:with-param name="name" select="'title-continued'"/>
3511
3463
  </xsl:call-template>
3512
3464
  </xsl:variable>
3513
3465
 
3466
+ <xsl:variable name="title_continued">
3467
+ <xsl:value-of select="$title_continued_"/>
3468
+
3469
+ </xsl:variable>
3470
+
3514
3471
  <xsl:variable name="title_start" select="ancestor::*[local-name()='table'][1]/*[local-name()='name']/node()[1][self::text()]"/>
3515
3472
  <xsl:variable name="table_number" select="substring-before($title_start, '—')"/>
3516
3473
 
3517
3474
  <fo:table-row height="0" keep-with-next.within-page="always">
3518
3475
  <fo:table-cell>
3476
+
3477
+
3519
3478
 
3520
3479
 
3521
3480
  <fo:marker marker-class-name="table_continued"/>
3522
3481
 
3482
+
3523
3483
  <fo:block/>
3524
3484
  </fo:table-cell>
3525
3485
  </fo:table-row>
@@ -3539,6 +3499,19 @@
3539
3499
 
3540
3500
  </fo:table-body>
3541
3501
 
3502
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
3503
+ <xsl:choose>
3504
+ <xsl:when test="substring-after(., '—') != ''">
3505
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
3506
+ </xsl:when>
3507
+ <xsl:otherwise>
3508
+ <xsl:value-of select="."/>
3509
+ </xsl:otherwise>
3510
+ </xsl:choose>
3511
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
3512
+ <xsl:apply-templates mode="presentation_name"/>
3513
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
3514
+ <xsl:apply-templates select="."/>
3542
3515
  </xsl:template><xsl:template match="*[local-name()='tr']">
3543
3516
  <xsl:variable name="parent-name" select="local-name(..)"/>
3544
3517
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -3566,9 +3539,12 @@
3566
3539
 
3567
3540
 
3568
3541
 
3542
+
3543
+
3569
3544
  </xsl:if>
3570
3545
  <xsl:if test="$parent-name = 'tfoot'">
3571
3546
 
3547
+
3572
3548
  <xsl:attribute name="font-size">9pt</xsl:attribute>
3573
3549
  <xsl:attribute name="border-left">solid black 1pt</xsl:attribute>
3574
3550
  <xsl:attribute name="border-right">solid black 1pt</xsl:attribute>
@@ -3583,6 +3559,8 @@
3583
3559
 
3584
3560
 
3585
3561
 
3562
+
3563
+
3586
3564
  <!-- <xsl:if test="$namespace = 'bipm'">
3587
3565
  <xsl:attribute name="height">8mm</xsl:attribute>
3588
3566
  </xsl:if> -->
@@ -3704,6 +3682,7 @@
3704
3682
 
3705
3683
  <fo:block font-size="10pt" margin-bottom="12pt">
3706
3684
 
3685
+
3707
3686
  <xsl:attribute name="font-size">9pt</xsl:attribute>
3708
3687
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3709
3688
 
@@ -3713,8 +3692,12 @@
3713
3692
 
3714
3693
 
3715
3694
 
3695
+ <!-- Table's note name (NOTE, for example) -->
3696
+
3716
3697
  <fo:inline padding-right="2mm">
3717
3698
 
3699
+
3700
+
3718
3701
 
3719
3702
 
3720
3703
 
@@ -3722,6 +3705,8 @@
3722
3705
 
3723
3706
  </fo:inline>
3724
3707
 
3708
+
3709
+
3725
3710
  <xsl:apply-templates mode="process"/>
3726
3711
  </fo:block>
3727
3712
 
@@ -3729,18 +3714,18 @@
3729
3714
  <xsl:apply-templates/>
3730
3715
  </xsl:template><xsl:template name="fn_display">
3731
3716
  <xsl:variable name="references">
3717
+
3732
3718
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
3733
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3734
-
3735
-
3736
- <xsl:apply-templates/>
3737
- </fn>
3719
+ <xsl:call-template name="create_fn"/>
3738
3720
  </xsl:for-each>
3739
3721
  </xsl:variable>
3722
+
3740
3723
  <xsl:for-each select="xalan:nodeset($references)//fn">
3741
3724
  <xsl:variable name="reference" select="@reference"/>
3742
3725
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
3743
3726
  <fo:block margin-bottom="12pt">
3727
+
3728
+
3744
3729
 
3745
3730
  <xsl:attribute name="font-size">9pt</xsl:attribute>
3746
3731
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -3763,6 +3748,7 @@
3763
3748
  <xsl:value-of select="@reference"/>
3764
3749
 
3765
3750
 
3751
+
3766
3752
  </fo:inline>
3767
3753
  <fo:inline>
3768
3754
 
@@ -3772,6 +3758,12 @@
3772
3758
  </fo:block>
3773
3759
  </xsl:if>
3774
3760
  </xsl:for-each>
3761
+ </xsl:template><xsl:template name="create_fn">
3762
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3763
+
3764
+
3765
+ <xsl:apply-templates/>
3766
+ </fn>
3775
3767
  </xsl:template><xsl:template name="fn_name_display">
3776
3768
  <!-- <xsl:variable name="references">
3777
3769
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -3900,7 +3892,7 @@
3900
3892
 
3901
3893
 
3902
3894
 
3903
- <xsl:if test="ancestor::*[local-name()='td']">
3895
+ <xsl:if test="ancestor::*[local-name()='table']">
3904
3896
  <xsl:attribute name="font-weight">normal</xsl:attribute>
3905
3897
  <!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
3906
3898
  <xsl:attribute name="baseline-shift">15%</xsl:attribute>
@@ -3918,6 +3910,7 @@
3918
3910
 
3919
3911
  <xsl:value-of select="@reference"/>
3920
3912
 
3913
+
3921
3914
  </fo:basic-link>
3922
3915
  </fo:inline>
3923
3916
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -4798,19 +4791,6 @@
4798
4791
  <!-- replace start and end spaces to non-break space -->
4799
4792
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4800
4793
  </xsl:copy>
4801
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4802
- <xsl:copy>
4803
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
4804
- </xsl:copy>
4805
- <xsl:choose>
4806
- <!-- if in msub, then don't add space -->
4807
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
4808
- <!-- if next char in digit, don't add space -->
4809
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
4810
- <xsl:otherwise>
4811
- <mathml:mspace width="0.5ex"/>
4812
- </xsl:otherwise>
4813
- </xsl:choose>
4814
4794
  </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">
4815
4795
  <xsl:variable name="target">
4816
4796
  <xsl:choose>
@@ -4944,6 +4924,7 @@
4944
4924
 
4945
4925
 
4946
4926
 
4927
+
4947
4928
  <fo:block-container margin-left="0mm">
4948
4929
 
4949
4930
 
@@ -5118,7 +5099,24 @@
5118
5099
  </fo:instream-foreign-object>
5119
5100
  </xsl:when>
5120
5101
  <xsl:otherwise>
5121
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
5102
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
5103
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
5104
+
5105
+ <xsl:variable name="img_src">
5106
+ <xsl:choose>
5107
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
5108
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
5109
+ </xsl:choose>
5110
+ </xsl:variable>
5111
+
5112
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
5113
+ <xsl:if test="number($scale) &lt; 100">
5114
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
5115
+ </xsl:if>
5116
+
5117
+ </xsl:if>
5118
+
5119
+ </fo:external-graphic>
5122
5120
  </xsl:otherwise>
5123
5121
  </xsl:choose>
5124
5122
 
@@ -5289,11 +5287,13 @@
5289
5287
  <xsl:attribute name="width">100%</xsl:attribute>
5290
5288
  <xsl:attribute name="content-height">100%</xsl:attribute>
5291
5289
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5290
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
5291
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
5292
5292
  <!-- effective height 297 - 27.4 - 13 = 256.6 -->
5293
5293
  <!-- effective width 210 - 12.5 - 25 = 172.5 -->
5294
5294
  <!-- effective height / width = 1.48, 1.4 - with title -->
5295
- <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
5296
- <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
5295
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
5296
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
5297
5297
  <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
5298
5298
  </xsl:if>
5299
5299
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -5310,6 +5310,23 @@
5310
5310
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
5311
5311
  <xsl:value-of select="."/>
5312
5312
  </xsl:attribute>
5313
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
5314
+ <xsl:copy>
5315
+ <xsl:apply-templates select="@*" mode="svg_update"/>
5316
+ <xsl:variable name="viewbox">
5317
+ <xsl:call-template name="split">
5318
+ <xsl:with-param name="pText" select="@viewBox"/>
5319
+ <xsl:with-param name="sep" select="' '"/>
5320
+ </xsl:call-template>
5321
+ </xsl:variable>
5322
+ <xsl:attribute name="width">
5323
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
5324
+ </xsl:attribute>
5325
+ <xsl:attribute name="height">
5326
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
5327
+ </xsl:attribute>
5328
+ <xsl:apply-templates mode="svg_update"/>
5329
+ </xsl:copy>
5313
5330
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5314
5331
  <xsl:variable name="svg_content" select="document(@src)"/>
5315
5332
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5955,7 +5972,19 @@
5955
5972
  </fo:inline>
5956
5973
  </xsl:if>
5957
5974
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
5958
- <fo:inline><xsl:apply-templates/></fo:inline>
5975
+ <xsl:variable name="element">inline
5976
+
5977
+ </xsl:variable>
5978
+ <xsl:choose>
5979
+ <xsl:when test="contains($element, 'block')">
5980
+ <fo:block xsl:use-attribute-sets="example-p-style">
5981
+ <xsl:apply-templates/>
5982
+ </fo:block>
5983
+ </xsl:when>
5984
+ <xsl:otherwise>
5985
+ <fo:inline><xsl:apply-templates/></fo:inline>
5986
+ </xsl:otherwise>
5987
+ </xsl:choose>
5959
5988
  </xsl:template><xsl:template match="*[local-name() = 'example']">
5960
5989
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
5961
5990
 
@@ -6151,9 +6180,10 @@
6151
6180
 
6152
6181
 
6153
6182
  </xsl:if>
6154
-
6183
+
6184
+
6185
+
6155
6186
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6156
-
6157
6187
  <xsl:if test="normalize-space(@citeas) = ''">
6158
6188
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
6159
6189
  </xsl:if>
@@ -6161,6 +6191,7 @@
6161
6191
 
6162
6192
 
6163
6193
 
6194
+
6164
6195
  </xsl:if>
6165
6196
 
6166
6197
  <xsl:apply-templates/>
@@ -6539,7 +6570,6 @@
6539
6570
  </xsl:template><xsl:template name="processBibitem">
6540
6571
 
6541
6572
 
6542
- <!-- end BIPM bibitem processing-->
6543
6573
 
6544
6574
 
6545
6575
 
@@ -7030,20 +7060,40 @@
7030
7060
  </xsl:call-template>
7031
7061
  </xsl:if>
7032
7062
  </xsl:template><xsl:template name="getLocalizedString">
7033
- <xsl:param name="key"/>
7063
+ <xsl:param name="key"/>
7064
+ <xsl:param name="formatted">false</xsl:param>
7034
7065
 
7035
7066
  <xsl:variable name="curr_lang">
7036
7067
  <xsl:call-template name="getLang"/>
7037
7068
  </xsl:variable>
7038
7069
 
7039
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
7070
+ <xsl:variable name="data_value">
7071
+ <xsl:choose>
7072
+ <xsl:when test="$formatted = 'true'">
7073
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7074
+ </xsl:when>
7075
+ <xsl:otherwise>
7076
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
7077
+ </xsl:otherwise>
7078
+ </xsl:choose>
7079
+ </xsl:variable>
7040
7080
 
7041
7081
  <xsl:choose>
7042
- <xsl:when test="$data_value != ''">
7043
- <xsl:value-of select="$data_value"/>
7082
+ <xsl:when test="normalize-space($data_value) != ''">
7083
+ <xsl:choose>
7084
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
7085
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
7086
+ </xsl:choose>
7044
7087
  </xsl:when>
7045
7088
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
7046
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7089
+ <xsl:choose>
7090
+ <xsl:when test="$formatted = 'true'">
7091
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7092
+ </xsl:when>
7093
+ <xsl:otherwise>
7094
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7095
+ </xsl:otherwise>
7096
+ </xsl:choose>
7047
7097
  </xsl:when>
7048
7098
  <xsl:otherwise>
7049
7099
  <xsl:variable name="key_">
@@ -7054,7 +7104,7 @@
7054
7104
  <xsl:value-of select="$key_"/>
7055
7105
  </xsl:otherwise>
7056
7106
  </xsl:choose>
7057
-
7107
+
7058
7108
  </xsl:template><xsl:template name="setTrackChangesStyles">
7059
7109
  <xsl:param name="isAdded"/>
7060
7110
  <xsl:param name="isDeleted"/>
@@ -7105,4 +7155,100 @@
7105
7155
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
7106
7156
  </xsl:choose>
7107
7157
  </xsl:attribute>
7158
+ </xsl:template><xsl:template name="number-to-words">
7159
+ <xsl:param name="number"/>
7160
+ <xsl:param name="first"/>
7161
+ <xsl:if test="$number != ''">
7162
+ <xsl:variable name="words">
7163
+ <words>
7164
+ <word cardinal="1">One-</word>
7165
+ <word ordinal="1">First </word>
7166
+ <word cardinal="2">Two-</word>
7167
+ <word ordinal="2">Second </word>
7168
+ <word cardinal="3">Three-</word>
7169
+ <word ordinal="3">Third </word>
7170
+ <word cardinal="4">Four-</word>
7171
+ <word ordinal="4">Fourth </word>
7172
+ <word cardinal="5">Five-</word>
7173
+ <word ordinal="5">Fifth </word>
7174
+ <word cardinal="6">Six-</word>
7175
+ <word ordinal="6">Sixth </word>
7176
+ <word cardinal="7">Seven-</word>
7177
+ <word ordinal="7">Seventh </word>
7178
+ <word cardinal="8">Eight-</word>
7179
+ <word ordinal="8">Eighth </word>
7180
+ <word cardinal="9">Nine-</word>
7181
+ <word ordinal="9">Ninth </word>
7182
+ <word ordinal="10">Tenth </word>
7183
+ <word ordinal="11">Eleventh </word>
7184
+ <word ordinal="12">Twelfth </word>
7185
+ <word ordinal="13">Thirteenth </word>
7186
+ <word ordinal="14">Fourteenth </word>
7187
+ <word ordinal="15">Fifteenth </word>
7188
+ <word ordinal="16">Sixteenth </word>
7189
+ <word ordinal="17">Seventeenth </word>
7190
+ <word ordinal="18">Eighteenth </word>
7191
+ <word ordinal="19">Nineteenth </word>
7192
+ <word cardinal="20">Twenty-</word>
7193
+ <word ordinal="20">Twentieth </word>
7194
+ <word cardinal="30">Thirty-</word>
7195
+ <word ordinal="30">Thirtieth </word>
7196
+ <word cardinal="40">Forty-</word>
7197
+ <word ordinal="40">Fortieth </word>
7198
+ <word cardinal="50">Fifty-</word>
7199
+ <word ordinal="50">Fiftieth </word>
7200
+ <word cardinal="60">Sixty-</word>
7201
+ <word ordinal="60">Sixtieth </word>
7202
+ <word cardinal="70">Seventy-</word>
7203
+ <word ordinal="70">Seventieth </word>
7204
+ <word cardinal="80">Eighty-</word>
7205
+ <word ordinal="80">Eightieth </word>
7206
+ <word cardinal="90">Ninety-</word>
7207
+ <word ordinal="90">Ninetieth </word>
7208
+ <word cardinal="100">Hundred-</word>
7209
+ <word ordinal="100">Hundredth </word>
7210
+ </words>
7211
+ </xsl:variable>
7212
+
7213
+ <xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
7214
+
7215
+ <xsl:variable name="value">
7216
+ <xsl:choose>
7217
+ <xsl:when test="$ordinal != ''">
7218
+ <xsl:value-of select="$ordinal"/>
7219
+ </xsl:when>
7220
+ <xsl:otherwise>
7221
+ <xsl:choose>
7222
+ <xsl:when test="$number &lt; 100">
7223
+ <xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
7224
+ <xsl:variable name="digit" select="substring($number,2)"/>
7225
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
7226
+ <xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
7227
+ </xsl:when>
7228
+ <xsl:otherwise>
7229
+ <!-- more 100 -->
7230
+ <xsl:variable name="hundred" select="substring($number,1,1)"/>
7231
+ <xsl:variable name="digits" select="number(substring($number,2))"/>
7232
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
7233
+ <xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
7234
+ <xsl:call-template name="number-to-words">
7235
+ <xsl:with-param name="number" select="$digits"/>
7236
+ </xsl:call-template>
7237
+ </xsl:otherwise>
7238
+ </xsl:choose>
7239
+ </xsl:otherwise>
7240
+ </xsl:choose>
7241
+ </xsl:variable>
7242
+ <xsl:choose>
7243
+ <xsl:when test="$first = 'true'">
7244
+ <xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
7245
+ <xsl:call-template name="capitalize">
7246
+ <xsl:with-param name="str" select="$value_lc"/>
7247
+ </xsl:call-template>
7248
+ </xsl:when>
7249
+ <xsl:otherwise>
7250
+ <xsl:value-of select="$value"/>
7251
+ </xsl:otherwise>
7252
+ </xsl:choose>
7253
+ </xsl:if>
7108
7254
  </xsl:template></xsl:stylesheet>