metanorma-iec 2.7.2 → 2.7.4

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.
@@ -36,6 +36,9 @@
36
36
  <xsl:variable name="substage" select="number(//mn:metanorma/mn:bibdata/mn:status/mn:substage)"/>
37
37
  <xsl:variable name="stagename" select="normalize-space(//mn:metanorma/mn:bibdata/mn:ext/mn:stagename)"/>
38
38
  <xsl:variable name="abbreviation" select="normalize-space(//mn:metanorma/mn:bibdata/mn:status/mn:stage/@abbreviation)"/>
39
+ <!-- https://github.com/metanorma/metanorma-csa/issues/329 -->
40
+ <!-- if stage >= 60 -->
41
+ <xsl:variable name="stage_published" select="normalize-space(//mn:metanorma/mn:metanorma-extension/mn:semantic-metadata/mn:stage-published)"/>
39
42
 
40
43
  <xsl:variable name="stage-abbreviation">
41
44
  <xsl:choose>
@@ -292,8 +295,29 @@
292
295
  </xsl:template>
293
296
 
294
297
  <xsl:template name="cover-page">
298
+
299
+ <xsl:variable name="document1_boilerplate">
300
+ <xsl:copy-of select="(//mn:metanorma)[1]/mn:boilerplate"/>
301
+ </xsl:variable>
302
+ <xsl:variable name="updated_document1_boilerplate_">
303
+ <xsl:for-each select="xalan:nodeset($document1_boilerplate)">
304
+ <xsl:call-template name="updateXML"/>
305
+ </xsl:for-each>
306
+ </xsl:variable>
307
+ <xsl:variable name="updated_document1_boilerplate" select="xalan:nodeset($updated_document1_boilerplate_)"/>
308
+
309
+ <xsl:variable name="document2_boilerplate">
310
+ <xsl:copy-of select="(//mn:metanorma)[2]/mn:boilerplate"/>
311
+ </xsl:variable>
312
+ <xsl:variable name="updated_document2_boilerplate_">
313
+ <xsl:for-each select="xalan:nodeset($document2_boilerplate)">
314
+ <xsl:call-template name="updateXML"/>
315
+ </xsl:for-each>
316
+ </xsl:variable>
317
+ <xsl:variable name="updated_document2_boilerplate" select="xalan:nodeset($updated_document2_boilerplate_)"/>
318
+
295
319
  <!-- For 'Published' documents insert two cover pages -->
296
- <xsl:if test="$stage &gt;= 60">
320
+ <xsl:if test="$stage_published = 'true'">
297
321
 
298
322
  <!-- 1st Cover Page -->
299
323
  <fo:page-sequence master-reference="cover" force-page-count="no-force">
@@ -335,7 +359,7 @@
335
359
  <fo:block margin-bottom="3pt">THIS PUBLICATION IS COPYRIGHT PROTECTED</fo:block>
336
360
  <fo:block margin-bottom="10pt">
337
361
  <!-- Example: Copyright © 2014 IEC, Geneva, Switzerland -->
338
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-year')]"/>
362
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-year')]"/>
339
363
  </fo:block>
340
364
  </fo:table-cell>
341
365
  </fo:table-row>
@@ -348,7 +372,7 @@
348
372
  either IEC or IEC's member National Committee in the country of the requester. If you have any questions about IEC
349
373
  copyright or have an enquiry about obtaining additional rights to this publication, please contact the address below or
350
374
  your local IEC member National Committee for further information. -->
351
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-message')]"/>
375
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-message')]"/>
352
376
  </fo:block>
353
377
  <!-- Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne peut être reproduite
354
378
  ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie
@@ -356,10 +380,10 @@
356
380
  questions sur le copyright de l'IEC ou si vous désirez obtenir des droits supplémentaires sur cette publication, utilisez
357
381
  les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pays de résidence. -->
358
382
  <fo:block margin-bottom="8pt" text-align="justify">
359
- <xsl:apply-templates select="(//mn:metanorma)[2]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-message')]"/>
383
+ <xsl:apply-templates select="$updated_document2_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-message')]"/>
360
384
  </fo:block>
361
385
 
362
- <xsl:variable name="telpos" select="count((//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/text()[contains(., 'Tel.')]/preceding-sibling::node())"/>
386
+ <xsl:variable name="telpos" select="count($updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/text()[contains(., 'Tel.')]/preceding-sibling::node())"/>
363
387
  <fo:table table-layout="fixed" width="100%">
364
388
  <fo:table-column column-width="59mm"/>
365
389
  <fo:table-column column-width="90mm"/>
@@ -371,13 +395,13 @@
371
395
  3, rue de Varembé
372
396
  CH-1211 Geneva 20
373
397
  Switzerland -->
374
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-name')]" mode="coverpage"/>
398
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-name')]" mode="coverpage"/>
375
399
  <xsl:choose>
376
400
  <xsl:when test="$telpos != 0">
377
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/node()[position() &lt; $telpos]" mode="coverpage"/>
401
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/node()[position() &lt; $telpos]" mode="coverpage"/>
378
402
  </xsl:when>
379
403
  <xsl:otherwise>
380
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]" mode="coverpage"/>
404
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]" mode="coverpage"/>
381
405
  </xsl:otherwise>
382
406
  </xsl:choose>
383
407
  </fo:block>
@@ -390,7 +414,7 @@
390
414
  www.iec.ch -->
391
415
  <xsl:choose>
392
416
  <xsl:when test="$telpos != 0">
393
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/node()[position() &gt; $telpos]" mode="coverpage"/>
417
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/node()[position() &gt; $telpos]" mode="coverpage"/>
394
418
  </xsl:when>
395
419
  <xsl:otherwise> </xsl:otherwise>
396
420
  </xsl:choose>
@@ -406,7 +430,7 @@
406
430
  </fo:block-container>
407
431
  </fo:block>
408
432
 
409
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:feedback-statement"/> <!-- //mn:clause[not(@id) or @id != 'boilerplate-cenelec-attention'] -->
433
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:feedback-statement"/> <!-- //mn:clause[not(@id) or @id != 'boilerplate-cenelec-attention'] -->
410
434
  <fo:block span="all" border-bottom="0.5pt solid black"/>
411
435
  <!-- About the IEC
412
436
  The International Electrotechnical Commission (IEC) is the leading global organization that prepares and publishes
@@ -416,8 +440,8 @@
416
440
  latest edition, a corrigenda or an amendment might have been published.
417
441
  ...
418
442
  -->
419
- <xsl:if test="(//mn:metanorma)[2]/mn:boilerplate/mn:feedback-statement">
420
- <xsl:apply-templates select="(//mn:metanorma)[2]/mn:boilerplate/mn:feedback-statement"/>
443
+ <xsl:if test="$updated_document2_boilerplate/mn:boilerplate/mn:feedback-statement">
444
+ <xsl:apply-templates select="$updated_document2_boilerplate/mn:boilerplate/mn:feedback-statement"/>
421
445
  <fo:block span="all"/>
422
446
  </xsl:if>
423
447
 
@@ -427,7 +451,7 @@
427
451
  <xsl:variable name="lang_second" select="(//mn:metanorma)[2]/mn:bibdata/mn:language[@current = 'true']"/>
428
452
  <!-- For 'Published' documents insert 3rd Cover Page
429
453
  OR insert first Cover Page for FDIS -->
430
- <xsl:if test="$stage &gt;= 60 or $stage-abbreviation = 'FDIS'">
454
+ <xsl:if test="$stage_published = 'true' or $stage-abbreviation = 'FDIS'">
431
455
  <fo:page-sequence master-reference="cover" force-page-count="no-force">
432
456
  <fo:flow flow-name="xsl-region-body">
433
457
  <xsl:call-template name="insertCoverPart1"/>
@@ -552,7 +576,7 @@
552
576
  <fo:block-container background-color="rgb(236, 232, 232)" padding="2mm" border="1.5pt solid white">
553
577
  <fo:block font-size="8pt" margin-bottom="6pt">
554
578
 
555
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[not(@id)]"/>
579
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[not(@id)]"/>
556
580
 
557
581
  </fo:block>
558
582
  </fo:block-container>
@@ -661,7 +685,7 @@
661
685
  <fo:table-row height="4mm">
662
686
  <fo:table-cell number-columns-spanned="2" border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
663
687
  <xsl:variable name="contributor_author_">
664
- <xsl:copy-of select="//mn:metanorma/mn:bibdata/mn:contributor[mn:role[@type = 'author' and mn:description[normalize-space(@language) = ''] = 'Technical committee']]/node()"/>
688
+ <xsl:copy-of select="//mn:metanorma/mn:bibdata/mn:contributor[mn:role[@type = 'author' and mn:description[normalize-space(@language) = ''] = 'committee']]/node()"/>
665
689
  </xsl:variable>
666
690
  <xsl:variable name="contributor_author" select="xalan:nodeset($contributor_author_)"/>
667
691
  <!-- https://github.com/metanorma/metanorma-iec/issues/440 -->
@@ -714,7 +738,8 @@
714
738
  </fo:block>
715
739
  <fo:block font-size="9pt">
716
740
  <xsl:call-template name="addLetterSpacing">
717
- <xsl:with-param name="text" select="//mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:secretariat"/>
741
+ <!-- <xsl:with-param name="text" select="//mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:secretariat"/> -->
742
+ <xsl:with-param name="text" select="normalize-space(//mn:metanorma/mn:bibdata/mn:contributor[mn:role/mn:description = 'secretariat']/mn:organization/mn:subdivision)"/>
718
743
  </xsl:call-template>
719
744
  </fo:block>
720
745
  </fo:table-cell>
@@ -872,7 +897,7 @@
872
897
  </xsl:call-template>
873
898
  </fo:block>
874
899
 
875
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:feedback-statement/mn:clause[@id = 'boilerplate-cenelec-attention']"/>
900
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:feedback-statement/mn:clause[@id = 'boilerplate-cenelec-attention']"/>
876
901
 
877
902
  </fo:table-cell>
878
903
  <fo:table-cell border="1.5pt solid {$border-color}" padding="1.5mm" padding-bottom="0mm">
@@ -899,7 +924,7 @@
899
924
 
900
925
  <fo:block-container font-size="8pt" background-color="rgb(236, 232, 232)" margin-top="5mm" padding="2mm" text-align="justify" border="1.5pt solid white">
901
926
  <fo:block>
902
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:license-statement" mode="cover-page-internal"/>
927
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:license-statement" mode="cover-page-internal"/>
903
928
  </fo:block>
904
929
  </fo:block-container>
905
930
 
@@ -984,7 +1009,7 @@
984
1009
  <xsl:call-template name="outputLogo"/>
985
1010
  <fo:inline font-size="8pt" padding-left="0.5mm" color="rgb(88, 88, 90)">
986
1011
  <xsl:choose>
987
- <xsl:when test="count((//mn:metanorma)[1]/mn:bibdata/mn:copyright) = 1 and count((//mn:metanorma)[1]/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description[normalize-space(@language) = ''] = 'Technical committee']) &lt;=1">®</xsl:when>
1012
+ <xsl:when test="count((//mn:metanorma)[1]/mn:bibdata/mn:copyright) = 1 and count((//mn:metanorma)[1]/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description[normalize-space(@language) = ''] = 'committee']) &lt;=1">®</xsl:when>
988
1013
  <xsl:otherwise><xsl:attribute name="padding-left">1mm</xsl:attribute> </xsl:otherwise>
989
1014
  </xsl:choose>
990
1015
  </fo:inline>
@@ -1019,7 +1044,7 @@
1019
1044
  <fo:block-container font-size="30pt" font-weight="bold" height="56mm" margin-left="7.5mm" line-height="115%">
1020
1045
  <fo:block-container margin-left="0mm">
1021
1046
  <fo:block-container height="25mm" display-align="after">
1022
- <xsl:if test="$stage &gt;= 60">
1047
+ <xsl:if test="$stage_published = 'true'">
1023
1048
  <xsl:attribute name="width">100mm</xsl:attribute>
1024
1049
  </xsl:if>
1025
1050
  <fo:block color="{$color_blue}">
@@ -1027,7 +1052,7 @@
1027
1052
  <xsl:when test="$stage-abbreviation = 'FDIS'">
1028
1053
  <xsl:text>PRE-RELEASE VERSION (FDIS)</xsl:text>
1029
1054
  </xsl:when>
1030
- <xsl:when test="$stage &gt;= 60">
1055
+ <xsl:when test="$stage_published = 'true'">
1031
1056
  <xsl:variable name="doctype_uppercased" select="java:toUpperCase(java:java.lang.String.new((//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:doctype[@language = $lang]))"/>
1032
1057
  <xsl:value-of select="$doctype_uppercased"/>
1033
1058
  </xsl:when>
@@ -1041,11 +1066,11 @@
1041
1066
 
1042
1067
  <xsl:if test="//mn:metanorma/mn:bibdata/mn:title[@language = $lang_second]">
1043
1068
  <fo:block-container height="26mm" margin-top="10pt" display-align="after">
1044
- <xsl:if test="$stage &gt;= 60">
1069
+ <xsl:if test="$stage_published = 'true'">
1045
1070
  <xsl:attribute name="width">100mm</xsl:attribute>
1046
1071
  </xsl:if>
1047
1072
  <fo:block color="{$color_gray}">
1048
- <xsl:if test="$stage &gt;= 60">
1073
+ <xsl:if test="$stage_published = 'true'">
1049
1074
  <!-- <xsl:text>NORME INTERNATIONALE</xsl:text> -->
1050
1075
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(//mn:metanorma/mn:bibdata/mn:ext/mn:doctype[@language = $lang_second]))"/>
1051
1076
  </xsl:if>
@@ -1183,9 +1208,9 @@
1183
1208
  <xsl:template name="outputLogo">
1184
1209
  <!-- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo-IEC))}" width="18mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Logo IEC"/> -->
1185
1210
  <xsl:choose>
1186
- <xsl:when test="(//mn:metanorma)[1]/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description[normalize-space(@language) = ''] = 'Technical committee']/mn:organization/mn:abbreviation">
1211
+ <xsl:when test="(//mn:metanorma)[1]/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description[normalize-space(@language) = ''] = 'committee']/mn:organization/mn:abbreviation">
1187
1212
  <!-- https://github.com/metanorma/metanorma-iec/issues/190#issuecomment-3122029444 -->
1188
- <xsl:for-each select="(//mn:metanorma)[1]/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description[normalize-space(@language) = ''] = 'Technical committee']/mn:organization/mn:abbreviation">
1213
+ <xsl:for-each select="(//mn:metanorma)[1]/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description[normalize-space(@language) = ''] = 'committee']/mn:organization/mn:abbreviation">
1189
1214
  <xsl:variable name="copyright_year" select="ancestor::mn:bibdata/mn:copyright/mn:from"/>
1190
1215
  <xsl:variable name="items">
1191
1216
  <xsl:choose>
@@ -1730,13 +1755,9 @@
1730
1755
  </xsl:template>
1731
1756
 
1732
1757
  <xsl:template match="mn:copyright-statement//mn:p" priority="2">
1733
- <fo:block>
1734
- <xsl:if test="following-sibling::mn:p">
1735
- <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
1736
- </xsl:if>
1737
- <xsl:if test="not(following-sibling::mn:p)">
1738
- <xsl:attribute name="margin-left">4mm</xsl:attribute>
1739
- </xsl:if>
1758
+ <fo:block xsl:use-attribute-sets="copyright-statement-p-style">
1759
+ <xsl:call-template name="refine_copyright-statement-p-style"/>
1760
+
1740
1761
  <xsl:apply-templates/>
1741
1762
  </fo:block>
1742
1763
  </xsl:template>
@@ -2046,7 +2067,7 @@
2046
2067
  </xsl:template>
2047
2068
 
2048
2069
  <xsl:template name="back-page">
2049
- <xsl:if test="$stage &gt;= 60">
2070
+ <xsl:if test="$stage_published = 'true'">
2050
2071
  <fo:page-sequence master-reference="blank-page">
2051
2072
  <fo:flow flow-name="xsl-region-body">
2052
2073
  <fo:block> </fo:block>
@@ -2076,16 +2097,25 @@
2076
2097
  Fax: + 41 22 919 03 00
2077
2098
  info@iec.ch
2078
2099
  www.iec.ch -->
2079
- <xsl:variable name="telpos" select="count((//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/text()[contains(., 'Tel.')]/preceding-sibling::node())"/>
2100
+ <xsl:variable name="document1_boilerplate">
2101
+ <xsl:copy-of select="(//mn:metanorma)[1]/mn:boilerplate"/>
2102
+ </xsl:variable>
2103
+ <xsl:variable name="updated_document1_boilerplate_">
2104
+ <xsl:for-each select="xalan:nodeset($document1_boilerplate)">
2105
+ <xsl:call-template name="updateXML"/>
2106
+ </xsl:for-each>
2107
+ </xsl:variable>
2108
+ <xsl:variable name="updated_document1_boilerplate" select="xalan:nodeset($updated_document1_boilerplate_)"/>
2109
+ <xsl:variable name="telpos" select="count($updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/text()[contains(., 'Tel.')]/preceding-sibling::node())"/>
2080
2110
  <xsl:choose>
2081
2111
  <xsl:when test="$telpos != 0">
2082
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/node()[position() &lt;= $telpos]" mode="coverpage"/>
2083
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/node()[position() &gt;= $telpos]" mode="coverpage">
2112
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/node()[position() &lt;= $telpos]" mode="coverpage"/>
2113
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]/node()[position() &gt;= $telpos]" mode="coverpage">
2084
2114
  <xsl:with-param name="lastpage">true</xsl:with-param>
2085
2115
  </xsl:apply-templates>
2086
2116
  </xsl:when>
2087
2117
  <xsl:otherwise>
2088
- <xsl:apply-templates select="(//mn:metanorma)[1]/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]" mode="coverpage"/>
2118
+ <xsl:apply-templates select="$updated_document1_boilerplate/mn:boilerplate/mn:copyright-statement/mn:clause/mn:p[contains(@id, 'boilerplate-address')]" mode="coverpage"/>
2089
2119
  </xsl:otherwise>
2090
2120
  </xsl:choose>
2091
2121
  </fo:block>
@@ -3814,44 +3844,94 @@
3814
3844
  <xsl:attribute-set name="copyright-statement-style">
3815
3845
  </xsl:attribute-set> <!-- copyright-statement-style -->
3816
3846
 
3847
+ <xsl:template name="refine_copyright-statement-style">
3848
+ </xsl:template>
3849
+
3817
3850
  <xsl:attribute-set name="copyright-statement-title-style">
3818
3851
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
3819
3852
 
3853
+ <xsl:template name="refine_copyright-statement-title-style">
3854
+ </xsl:template>
3855
+
3820
3856
  <xsl:attribute-set name="copyright-statement-p-style">
3821
3857
  </xsl:attribute-set> <!-- copyright-statement-p-style -->
3822
3858
 
3823
- <xsl:attribute-set name="license-statement-style">
3859
+ <xsl:template name="refine_copyright-statement-p-style">
3860
+ <xsl:if test="following-sibling::mn:p">
3861
+ <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
3862
+ </xsl:if>
3863
+ <xsl:if test="not(following-sibling::mn:p)">
3864
+ <xsl:attribute name="margin-left">4mm</xsl:attribute>
3865
+ </xsl:if>
3866
+
3867
+ </xsl:template>
3868
+
3869
+ <xsl:attribute-set name="license-statement-style">
3824
3870
  </xsl:attribute-set> <!-- license-statement-style -->
3825
3871
 
3872
+ <xsl:template name="refine_license-statement-style">
3873
+ </xsl:template>
3874
+
3826
3875
  <xsl:attribute-set name="license-statement-title-style">
3827
3876
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3828
3877
  </xsl:attribute-set> <!-- license-statement-title-style -->
3829
3878
 
3879
+ <xsl:template name="refine_license-statement-title-style">
3880
+ </xsl:template>
3881
+
3830
3882
  <xsl:attribute-set name="license-statement-p-style">
3831
3883
  </xsl:attribute-set> <!-- license-statement-p-style -->
3832
3884
 
3885
+ <xsl:template name="refine_license-statement-p-style">
3886
+
3887
+ </xsl:template>
3888
+
3833
3889
  <xsl:attribute-set name="legal-statement-style">
3834
3890
  </xsl:attribute-set> <!-- legal-statement-style -->
3835
3891
 
3892
+ <xsl:template name="refine_legal-statement-style">
3893
+ </xsl:template>
3894
+
3836
3895
  <xsl:attribute-set name="legal-statement-title-style">
3837
3896
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3838
3897
  </xsl:attribute-set> <!-- legal-statement-title-style -->
3839
3898
 
3899
+ <xsl:template name="refine_legal-statement-title-style">
3900
+ </xsl:template>
3901
+
3840
3902
  <xsl:attribute-set name="legal-statement-p-style">
3841
3903
  </xsl:attribute-set> <!-- legal-statement-p-style -->
3842
3904
 
3905
+ <xsl:template name="refine_legal-statement-p-style">
3906
+ <xsl:if test="@align">
3907
+ <xsl:attribute name="text-align">
3908
+ <xsl:value-of select="@align"/>
3909
+ </xsl:attribute>
3910
+ </xsl:if>
3911
+ </xsl:template>
3912
+
3843
3913
  <xsl:attribute-set name="feedback-statement-style">
3844
3914
  </xsl:attribute-set> <!-- feedback-statement-style -->
3845
3915
 
3916
+ <xsl:template name="refine_feedback-statement-style">
3917
+ </xsl:template>
3918
+
3846
3919
  <xsl:attribute-set name="feedback-statement-title-style">
3847
3920
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3848
3921
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3849
3922
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
3850
3923
 
3924
+ <xsl:template name="refine_feedback-statement-title-style">
3925
+
3926
+ </xsl:template>
3927
+
3851
3928
  <xsl:attribute-set name="feedback-statement-p-style">
3852
3929
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3853
3930
  </xsl:attribute-set> <!-- feedback-statement-p-style -->
3854
3931
 
3932
+ <xsl:template name="refine_feedback-statement-p-style">
3933
+ </xsl:template>
3934
+
3855
3935
  <!-- End boilerplate sections styles -->
3856
3936
 
3857
3937
  <!-- ================================= -->
@@ -3859,6 +3939,8 @@
3859
3939
  <!-- ================================= -->
3860
3940
  <xsl:template match="mn:copyright-statement">
3861
3941
  <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
3942
+ <xsl:call-template name="refine_copyright-statement-style"/>
3943
+
3862
3944
  <xsl:apply-templates/>
3863
3945
  </fo:block>
3864
3946
  </xsl:template> <!-- copyright-statement -->
@@ -3875,6 +3957,7 @@
3875
3957
 
3876
3958
  <xsl:template match="mn:license-statement">
3877
3959
  <fo:block xsl:use-attribute-sets="license-statement-style">
3960
+ <xsl:call-template name="refine_license-statement-style"/>
3878
3961
  <xsl:apply-templates/>
3879
3962
  </fo:block>
3880
3963
  </xsl:template> <!-- license-statement -->
@@ -3892,6 +3975,7 @@
3892
3975
  <xsl:template match="mn:legal-statement">
3893
3976
  <xsl:param name="isLegacy">false</xsl:param>
3894
3977
  <fo:block xsl:use-attribute-sets="legal-statement-style">
3978
+ <xsl:call-template name="refine_legal-statement-style"/>
3895
3979
  <xsl:apply-templates/>
3896
3980
  </fo:block>
3897
3981
  </xsl:template> <!-- legal-statement -->
@@ -3921,6 +4005,7 @@
3921
4005
  <xsl:call-template name="getLevel"/>
3922
4006
  </xsl:variable>
3923
4007
  <fo:block role="H{$level}" xsl:use-attribute-sets="feedback-statement-title-style">
4008
+ <xsl:call-template name="refine_feedback-statement-title-style"/>
3924
4009
  <xsl:apply-templates/>
3925
4010
  </fo:block>
3926
4011
 
@@ -3929,6 +4014,8 @@
3929
4014
  <xsl:template match="mn:feedback-statement//mn:p">
3930
4015
  <xsl:param name="margin"/>
3931
4016
  <fo:block xsl:use-attribute-sets="feedback-statement-p-style">
4017
+ <xsl:call-template name="refine_feedback-statement-p-style"/>
4018
+ <!-- <xsl:copy-of select="@id"/> -->
3932
4019
  <xsl:apply-templates/>
3933
4020
  </fo:block>
3934
4021
 
@@ -4067,6 +4154,27 @@
4067
4154
  <xsl:attribute-set name="sourcecode-container-style">
4068
4155
  </xsl:attribute-set>
4069
4156
 
4157
+ <xsl:template name="refine_sourcecode-container-style">
4158
+ <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
4159
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
4160
+ </xsl:if>
4161
+
4162
+ <xsl:if test="ancestor::mn:example">
4163
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
4164
+ </xsl:if>
4165
+
4166
+ <xsl:copy-of select="@id"/>
4167
+
4168
+ <xsl:if test="parent::mn:note">
4169
+ <xsl:attribute name="margin-left">
4170
+ <xsl:choose>
4171
+ <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
4172
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4173
+ </xsl:choose>
4174
+ </xsl:attribute>
4175
+ </xsl:if>
4176
+ </xsl:template>
4177
+
4070
4178
  <xsl:attribute-set name="sourcecode-style">
4071
4179
  <xsl:attribute name="white-space">pre</xsl:attribute>
4072
4180
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -4087,6 +4195,9 @@
4087
4195
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
4088
4196
  </xsl:attribute-set> <!-- sourcecode-name-style -->
4089
4197
 
4198
+ <xsl:template name="refine_sourcecode-name-style">
4199
+ </xsl:template>
4200
+
4090
4201
  <xsl:template name="add-zero-spaces-equal">
4091
4202
  <xsl:param name="text" select="."/>
4092
4203
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
@@ -4174,24 +4285,8 @@
4174
4285
  <xsl:otherwise>
4175
4286
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
4176
4287
 
4177
- <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
4178
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
4179
- </xsl:if>
4288
+ <xsl:call-template name="refine_sourcecode-container-style"/>
4180
4289
 
4181
- <xsl:if test="ancestor::mn:example">
4182
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
4183
- </xsl:if>
4184
-
4185
- <xsl:copy-of select="@id"/>
4186
-
4187
- <xsl:if test="parent::mn:note">
4188
- <xsl:attribute name="margin-left">
4189
- <xsl:choose>
4190
- <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
4191
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4192
- </xsl:choose>
4193
- </xsl:attribute>
4194
- </xsl:if>
4195
4290
  <fo:block-container margin-left="0mm" role="SKIP">
4196
4291
 
4197
4292
  <fo:block xsl:use-attribute-sets="sourcecode-style">
@@ -4518,6 +4613,7 @@
4518
4613
  <xsl:template match="mn:sourcecode/mn:fmt-name">
4519
4614
  <xsl:if test="normalize-space() != ''">
4520
4615
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4616
+ <xsl:call-template name="refine_sourcecode-name-style"/>
4521
4617
  <xsl:apply-templates/>
4522
4618
  </fo:block>
4523
4619
  </xsl:if>
@@ -4566,12 +4662,31 @@
4566
4662
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
4567
4663
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
4568
4664
  <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
4569
- </xsl:attribute-set>
4665
+ </xsl:attribute-set> <!-- pre-style -->
4666
+
4667
+ <xsl:template name="refine_pre-style">
4668
+ </xsl:template>
4570
4669
 
4571
4670
  <xsl:attribute-set name="tt-style">
4572
4671
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
4573
4672
  </xsl:attribute-set>
4574
4673
 
4674
+ <xsl:template name="refine_tt-style">
4675
+ <xsl:variable name="_font-size">10 <!-- inherit -->
4676
+ </xsl:variable>
4677
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4678
+ <xsl:if test="$font-size != ''">
4679
+ <xsl:attribute name="font-size">
4680
+ <xsl:choose>
4681
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4682
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4683
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4684
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4685
+ </xsl:choose>
4686
+ </xsl:attribute>
4687
+ </xsl:if>
4688
+ </xsl:template>
4689
+
4575
4690
  <xsl:variable name="color-added-text">
4576
4691
  <xsl:text>rgb(0, 255, 0)</xsl:text>
4577
4692
  </xsl:variable>
@@ -4584,9 +4699,14 @@
4584
4699
  <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
4585
4700
  </xsl:attribute-set>
4586
4701
 
4702
+ <xsl:template name="refine_add-style">
4703
+ </xsl:template>
4704
+
4587
4705
  <xsl:variable name="add-style">
4588
- <add-style xsl:use-attribute-sets="add-style"/>
4589
- </xsl:variable>
4706
+ <add-style xsl:use-attribute-sets="add-style">
4707
+ <xsl:call-template name="refine_add-style"/>
4708
+ </add-style>
4709
+ </xsl:variable>
4590
4710
  <xsl:template name="append_add-style">
4591
4711
  <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
4592
4712
  </xsl:template>
@@ -4599,24 +4719,77 @@
4599
4719
  <xsl:attribute name="text-decoration">line-through</xsl:attribute>
4600
4720
  </xsl:attribute-set>
4601
4721
 
4722
+ <xsl:template name="refine_del-style">
4723
+ </xsl:template>
4724
+
4725
+ <xsl:attribute-set name="strong-style">
4726
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
4727
+ </xsl:attribute-set>
4728
+
4729
+ <xsl:template name="refine_strong_style">
4730
+ <xsl:if test="ancestor::*['preferred']">
4731
+ <xsl:attribute name="role">SKIP</xsl:attribute>
4732
+ </xsl:if>
4733
+ </xsl:template> <!-- refine_strong_style -->
4734
+
4735
+ <xsl:attribute-set name="em-style">
4736
+ <xsl:attribute name="font-style">italic</xsl:attribute>
4737
+ </xsl:attribute-set>
4738
+
4739
+ <xsl:template name="refine_em_style">
4740
+ </xsl:template> <!-- refine_em_style -->
4741
+
4742
+ <xsl:attribute-set name="sup-style">
4743
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4744
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4745
+ </xsl:attribute-set>
4746
+
4747
+ <xsl:template name="refine_sup-style">
4748
+ </xsl:template>
4749
+
4750
+ <xsl:attribute-set name="sub-style">
4751
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4752
+ <xsl:attribute name="vertical-align">sub</xsl:attribute>
4753
+ </xsl:attribute-set>
4754
+
4755
+ <xsl:template name="refine_sub-style">
4756
+ </xsl:template>
4757
+
4758
+ <xsl:attribute-set name="underline-style">
4759
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4760
+ </xsl:attribute-set>
4761
+
4762
+ <xsl:template name="refine_underline-style">
4763
+ </xsl:template>
4764
+
4765
+ <xsl:attribute-set name="hi-style">
4766
+ <xsl:attribute name="background-color">yellow</xsl:attribute>
4767
+ </xsl:attribute-set>
4768
+
4769
+ <xsl:template name="refine_hi-style">
4770
+ </xsl:template>
4771
+
4772
+ <xsl:attribute-set name="strike-style">
4773
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
4774
+ </xsl:attribute-set>
4775
+
4776
+ <xsl:template name="refine_strike-style">
4777
+ </xsl:template>
4778
+
4602
4779
  <xsl:template match="mn:br">
4603
4780
  <xsl:value-of select="$linebreak"/>
4604
4781
  </xsl:template>
4605
4782
 
4606
- <xsl:template match="mn:em">
4607
- <fo:inline font-style="italic">
4608
- <xsl:call-template name="refine_italic_style"/>
4783
+ <xsl:template match="mn:em">
4784
+ <fo:inline xsl:use-attribute-sets="em-style">
4785
+ <xsl:call-template name="refine_em_style"/>
4609
4786
  <xsl:apply-templates/>
4610
4787
  </fo:inline>
4611
4788
  </xsl:template>
4612
4789
 
4613
- <xsl:template name="refine_italic_style">
4614
- </xsl:template>
4615
-
4616
4790
  <xsl:template match="mn:strong | *[local-name()='b']">
4617
4791
  <xsl:param name="split_keep-within-line"/>
4618
- <fo:inline font-weight="bold">
4619
-
4792
+ <fo:inline xsl:use-attribute-sets="strong-style">
4620
4793
  <xsl:call-template name="refine_strong_style"/>
4621
4794
 
4622
4795
  <xsl:apply-templates>
@@ -4625,44 +4798,27 @@
4625
4798
  </fo:inline>
4626
4799
  </xsl:template>
4627
4800
 
4628
- <xsl:template name="refine_strong_style">
4629
- <xsl:if test="ancestor::*['preferred']">
4630
- <xsl:attribute name="role">SKIP</xsl:attribute>
4631
- </xsl:if>
4632
- </xsl:template>
4633
-
4634
4801
  <xsl:template match="*[local-name()='padding']">
4635
4802
  <fo:inline padding-right="{@value}"> </fo:inline>
4636
4803
  </xsl:template>
4637
4804
 
4638
4805
  <xsl:template match="mn:sup">
4639
- <fo:inline font-size="80%" vertical-align="super">
4806
+ <fo:inline xsl:use-attribute-sets="sup-style">
4807
+ <xsl:call-template name="refine_sup-style"/>
4640
4808
  <xsl:apply-templates/>
4641
4809
  </fo:inline>
4642
4810
  </xsl:template>
4643
4811
 
4644
4812
  <xsl:template match="mn:sub">
4645
- <fo:inline font-size="80%" vertical-align="sub">
4813
+ <fo:inline xsl:use-attribute-sets="sub-style">
4814
+ <xsl:call-template name="refine_sub-style"/>
4646
4815
  <xsl:apply-templates/>
4647
4816
  </fo:inline>
4648
4817
  </xsl:template>
4649
4818
 
4650
4819
  <xsl:template match="mn:tt">
4651
4820
  <fo:inline xsl:use-attribute-sets="tt-style">
4652
-
4653
- <xsl:variable name="_font-size">10 <!-- inherit -->
4654
- </xsl:variable>
4655
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4656
- <xsl:if test="$font-size != ''">
4657
- <xsl:attribute name="font-size">
4658
- <xsl:choose>
4659
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
4660
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
4661
- <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
4662
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
4663
- </xsl:choose>
4664
- </xsl:attribute>
4665
- </xsl:if>
4821
+ <xsl:call-template name="refine_tt-style"/>
4666
4822
  <xsl:apply-templates/>
4667
4823
  </fo:inline>
4668
4824
  </xsl:template> <!-- tt -->
@@ -4681,7 +4837,8 @@
4681
4837
  </xsl:template>
4682
4838
 
4683
4839
  <xsl:template match="mn:underline">
4684
- <fo:inline text-decoration="underline">
4840
+ <fo:inline xsl:use-attribute-sets="underline-style">
4841
+ <xsl:call-template name="refine_underline-style"/>
4685
4842
  <xsl:apply-templates/>
4686
4843
  </fo:inline>
4687
4844
  </xsl:template>
@@ -4839,6 +4996,7 @@
4839
4996
 
4840
4997
  <xsl:template match="mn:del">
4841
4998
  <fo:inline xsl:use-attribute-sets="del-style">
4999
+ <xsl:call-template name="refine_del-style"/>
4842
5000
  <xsl:apply-templates/>
4843
5001
  </fo:inline>
4844
5002
  </xsl:template>
@@ -4848,7 +5006,8 @@
4848
5006
 
4849
5007
  <!-- highlight text -->
4850
5008
  <xsl:template match="mn:hi | mn:span[@class = 'fmt-hi']" priority="3">
4851
- <fo:inline background-color="yellow">
5009
+ <fo:inline xsl:use-attribute-sets="hi-style">
5010
+ <xsl:call-template name="refine_hi-style"/>
4852
5011
  <xsl:apply-templates/>
4853
5012
  </fo:inline>
4854
5013
  </xsl:template>
@@ -4934,7 +5093,8 @@
4934
5093
  </xsl:template>
4935
5094
 
4936
5095
  <xsl:template match="mn:strike">
4937
- <fo:inline text-decoration="line-through">
5096
+ <fo:inline xsl:use-attribute-sets="strike-style">
5097
+ <xsl:call-template name="refine_strike-style"/>
4938
5098
  <xsl:apply-templates/>
4939
5099
  </fo:inline>
4940
5100
  </xsl:template>
@@ -4962,7 +5122,7 @@
4962
5122
  </xsl:otherwise>
4963
5123
  </xsl:choose>
4964
5124
  </xsl:variable>
4965
- <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift'">
5125
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift' or $key = 'line-height' ">
4966
5126
  <style name="{$key}"><xsl:value-of select="$value"/></style>
4967
5127
  </xsl:if>
4968
5128
  <xsl:if test="$key = 'text-indent'">
@@ -5014,6 +5174,7 @@
5014
5174
 
5015
5175
  <xsl:template match="mn:pre" name="pre">
5016
5176
  <fo:block xsl:use-attribute-sets="pre-style">
5177
+ <xsl:call-template name="refine_pre-style"/>
5017
5178
  <xsl:copy-of select="@id"/>
5018
5179
  <xsl:choose>
5019
5180
 
@@ -5044,22 +5205,40 @@
5044
5205
  <xsl:attribute-set name="permission-style">
5045
5206
  </xsl:attribute-set>
5046
5207
 
5208
+ <xsl:template name="refine_permission-style">
5209
+ </xsl:template>
5210
+
5047
5211
  <xsl:attribute-set name="permission-name-style">
5048
5212
  </xsl:attribute-set>
5049
5213
 
5214
+ <xsl:template name="refine_permission-name-style">
5215
+ </xsl:template>
5216
+
5050
5217
  <xsl:attribute-set name="permission-label-style">
5051
5218
  </xsl:attribute-set>
5052
5219
 
5220
+ <xsl:template name="refine_permission-label-style">
5221
+ </xsl:template>
5222
+
5053
5223
  <xsl:attribute-set name="requirement-style">
5054
5224
  </xsl:attribute-set>
5055
5225
 
5226
+ <xsl:template name="refine_requirement-style">
5227
+ </xsl:template>
5228
+
5056
5229
  <xsl:attribute-set name="requirement-name-style">
5057
5230
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5058
5231
  </xsl:attribute-set>
5059
5232
 
5233
+ <xsl:template name="refine_requirement-name-style">
5234
+ </xsl:template>
5235
+
5060
5236
  <xsl:attribute-set name="requirement-label-style">
5061
5237
  </xsl:attribute-set>
5062
5238
 
5239
+ <xsl:template name="refine_requirement-label-style">
5240
+ </xsl:template>
5241
+
5063
5242
  <xsl:attribute-set name="subject-style">
5064
5243
  </xsl:attribute-set>
5065
5244
 
@@ -5087,18 +5266,28 @@
5087
5266
  <xsl:attribute-set name="recommendation-style">
5088
5267
  </xsl:attribute-set>
5089
5268
 
5269
+ <xsl:template name="refine_recommendation-style">
5270
+ </xsl:template>
5271
+
5090
5272
  <xsl:attribute-set name="recommendation-name-style">
5091
5273
  </xsl:attribute-set>
5092
5274
 
5275
+ <xsl:template name="refine_recommendation-name-style">
5276
+ </xsl:template>
5277
+
5093
5278
  <xsl:attribute-set name="recommendation-label-style">
5094
5279
  </xsl:attribute-set>
5095
5280
 
5281
+ <xsl:template name="refine_recommendation-label-style">
5282
+ </xsl:template>
5283
+
5096
5284
  <!-- ========== -->
5097
5285
  <!-- permission -->
5098
5286
  <!-- ========== -->
5099
5287
  <xsl:template match="mn:permission">
5100
5288
  <xsl:call-template name="setNamedDestination"/>
5101
5289
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
5290
+ <xsl:call-template name="refine_permission-style"/>
5102
5291
  <xsl:apply-templates select="mn:fmt-name"/>
5103
5292
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
5104
5293
  </fo:block>
@@ -5107,6 +5296,7 @@
5107
5296
  <xsl:template match="mn:permission/mn:fmt-name">
5108
5297
  <xsl:if test="normalize-space() != ''">
5109
5298
  <fo:block xsl:use-attribute-sets="permission-name-style">
5299
+ <xsl:call-template name="refine_permission-name-style"/>
5110
5300
  <xsl:apply-templates/>
5111
5301
  </fo:block>
5112
5302
  </xsl:if>
@@ -5114,6 +5304,7 @@
5114
5304
 
5115
5305
  <xsl:template match="mn:permission/mn:label">
5116
5306
  <fo:block xsl:use-attribute-sets="permission-label-style">
5307
+ <xsl:call-template name="refine_permission-label-style"/>
5117
5308
  <xsl:apply-templates/>
5118
5309
  </fo:block>
5119
5310
  </xsl:template>
@@ -5126,6 +5317,7 @@
5126
5317
  <xsl:template match="mn:requirement">
5127
5318
  <xsl:call-template name="setNamedDestination"/>
5128
5319
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
5320
+ <xsl:call-template name="refine_requirement-style"/>
5129
5321
  <xsl:apply-templates select="mn:fmt-name"/>
5130
5322
  <xsl:apply-templates select="mn:label"/>
5131
5323
  <xsl:apply-templates select="@obligation"/>
@@ -5138,6 +5330,7 @@
5138
5330
  <xsl:if test="normalize-space() != ''">
5139
5331
 
5140
5332
  <fo:block xsl:use-attribute-sets="requirement-name-style">
5333
+ <xsl:call-template name="refine_requirement-name-style"/>
5141
5334
  <xsl:apply-templates/>
5142
5335
  </fo:block>
5143
5336
  </xsl:if>
@@ -5145,6 +5338,7 @@
5145
5338
 
5146
5339
  <xsl:template match="mn:requirement/mn:label">
5147
5340
  <fo:block xsl:use-attribute-sets="requirement-label-style">
5341
+ <xsl:call-template name="refine_requirement-label-style"/>
5148
5342
  <xsl:apply-templates/>
5149
5343
  </fo:block>
5150
5344
  </xsl:template>
@@ -5170,6 +5364,7 @@
5170
5364
  <xsl:template match="mn:recommendation">
5171
5365
  <xsl:call-template name="setNamedDestination"/>
5172
5366
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
5367
+ <xsl:call-template name="refine_recommendation-style"/>
5173
5368
  <xsl:apply-templates select="mn:fmt-name"/>
5174
5369
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
5175
5370
  </fo:block>
@@ -5179,6 +5374,7 @@
5179
5374
  <xsl:if test="normalize-space() != ''">
5180
5375
 
5181
5376
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
5377
+ <xsl:call-template name="refine_recommendation-name-style"/>
5182
5378
  <xsl:apply-templates/>
5183
5379
  </fo:block>
5184
5380
  </xsl:if>
@@ -5186,6 +5382,7 @@
5186
5382
 
5187
5383
  <xsl:template match="mn:recommendation/mn:label">
5188
5384
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
5385
+ <xsl:call-template name="refine_recommendation-label-style"/>
5189
5386
  <xsl:apply-templates/>
5190
5387
  </fo:block>
5191
5388
  </xsl:template>
@@ -5366,40 +5563,73 @@
5366
5563
  <xsl:attribute-set name="term-style">
5367
5564
  </xsl:attribute-set> <!-- term-style -->
5368
5565
 
5566
+ <xsl:template name="refine_term-style">
5567
+ </xsl:template>
5568
+
5369
5569
  <xsl:attribute-set name="term-name-style">
5370
5570
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5371
5571
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5372
5572
  </xsl:attribute-set> <!-- term-name-style -->
5373
5573
 
5374
- <xsl:attribute-set name="preferred-block-style">
5574
+ <xsl:template name="refine_term-name-style">
5575
+ </xsl:template>
5576
+
5577
+ <xsl:attribute-set name="preferred-block-style">
5375
5578
  <xsl:attribute name="line-height">1.1</xsl:attribute>
5376
5579
  <xsl:attribute name="space-before">14pt</xsl:attribute>
5377
5580
  </xsl:attribute-set> <!-- preferred-block-style -->
5378
5581
 
5582
+ <xsl:template name="refine_preferred-block-style">
5583
+ <xsl:if test="preceding-sibling::*[1][self::mn:fmt-preferred]">
5584
+ <xsl:attribute name="space-before">1pt</xsl:attribute>
5585
+ </xsl:if>
5586
+ </xsl:template>
5587
+
5379
5588
  <xsl:attribute-set name="preferred-term-style">
5380
5589
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5381
5590
  <xsl:attribute name="font-weight">bold</xsl:attribute>
5382
5591
  </xsl:attribute-set> <!-- preferred-term-style -->
5383
5592
 
5593
+ <xsl:template name="refine_preferred-term-style">
5594
+ <xsl:if test="mn:strong">
5595
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
5596
+ </xsl:if>
5597
+ </xsl:template>
5598
+
5384
5599
  <xsl:attribute-set name="domain-style">
5385
5600
  </xsl:attribute-set> <!-- domain-style -->
5386
5601
 
5602
+ <xsl:template name="refine_domain-style">
5603
+ </xsl:template>
5604
+
5387
5605
  <xsl:attribute-set name="admitted-style">
5388
5606
  </xsl:attribute-set> <!-- admitted-style -->
5389
5607
 
5608
+ <xsl:template name="refine_admitted-style">
5609
+ </xsl:template>
5610
+
5390
5611
  <xsl:attribute-set name="deprecates-style">
5391
5612
  <xsl:attribute name="font-size">8pt</xsl:attribute>
5392
5613
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
5393
5614
  <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
5394
5615
  </xsl:attribute-set> <!-- deprecates-style -->
5395
5616
 
5617
+ <xsl:template name="refine_deprecates-style">
5618
+ </xsl:template>
5619
+
5396
5620
  <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
5397
5621
  </xsl:attribute-set>
5398
5622
 
5623
+ <xsl:template name="refine_related-block-style">
5624
+ </xsl:template>
5625
+
5399
5626
  <xsl:attribute-set name="definition-style">
5400
5627
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5401
5628
  </xsl:attribute-set> <!-- definition-style -->
5402
5629
 
5630
+ <xsl:template name="refine_definition-style">
5631
+ </xsl:template>
5632
+
5403
5633
  <xsl:attribute-set name="termsource-style">
5404
5634
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
5405
5635
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
@@ -5411,9 +5641,15 @@
5411
5641
  <xsl:attribute-set name="termsource-text-style">
5412
5642
  </xsl:attribute-set> <!-- termsource-text-style -->
5413
5643
 
5644
+ <xsl:template name="refine_termsource-text-style">
5645
+ </xsl:template>
5646
+
5414
5647
  <xsl:attribute-set name="origin-style">
5415
5648
  </xsl:attribute-set> <!-- origin-style -->
5416
5649
 
5650
+ <xsl:template name="refine_origin-style">
5651
+ </xsl:template>
5652
+
5417
5653
  <!-- ====== -->
5418
5654
  <!-- term -->
5419
5655
  <!-- ====== -->
@@ -5429,9 +5665,8 @@
5429
5665
  <xsl:template match="mn:term">
5430
5666
  <xsl:call-template name="setNamedDestination"/>
5431
5667
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5668
+ <xsl:call-template name="refine_term-style"/>
5432
5669
 
5433
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
5434
- </xsl:if>
5435
5670
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
5436
5671
  </fo:block>
5437
5672
  </xsl:template>
@@ -5507,6 +5742,7 @@
5507
5742
  <!-- text SOURCE: -->
5508
5743
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
5509
5744
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
5745
+ <xsl:call-template name="refine_termsource-text-style"/>
5510
5746
  <xsl:value-of select="."/>
5511
5747
  </fo:inline>
5512
5748
  </xsl:template>
@@ -5519,6 +5755,7 @@
5519
5755
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5520
5756
  </xsl:if>
5521
5757
  <fo:inline xsl:use-attribute-sets="origin-style">
5758
+ <xsl:call-template name="refine_origin-style"/>
5522
5759
  <xsl:apply-templates/>
5523
5760
  </fo:inline>
5524
5761
  </fo:basic-link>
@@ -5567,13 +5804,13 @@
5567
5804
  <xsl:call-template name="getLevelTermName"/>
5568
5805
  </xsl:variable>
5569
5806
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
5570
- <xsl:if test="preceding-sibling::*[1][self::mn:fmt-preferred]">
5571
- <xsl:attribute name="space-before">1pt</xsl:attribute>
5572
- </xsl:if>
5807
+
5808
+ <xsl:call-template name="refine_preferred-block-style"/>
5573
5809
 
5574
5810
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
5575
5811
 
5576
5812
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
5813
+ <xsl:call-template name="refine_term-name-style"/>
5577
5814
 
5578
5815
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
5579
5816
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -5584,7 +5821,7 @@
5584
5821
  </xsl:if>
5585
5822
 
5586
5823
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
5587
- <xsl:call-template name="setStyle_preferred"/>
5824
+ <xsl:call-template name="refine_preferred-term-style"/>
5588
5825
 
5589
5826
  <xsl:apply-templates/>
5590
5827
  </fo:block>
@@ -5605,22 +5842,18 @@
5605
5842
 
5606
5843
  <xsl:template match="mn:fmt-admitted">
5607
5844
  <fo:block xsl:use-attribute-sets="admitted-style">
5845
+ <xsl:call-template name="refine_admitted-style"/>
5608
5846
  <xsl:apply-templates/>
5609
5847
  </fo:block>
5610
5848
  </xsl:template>
5611
5849
 
5612
5850
  <xsl:template match="mn:fmt-deprecates">
5613
5851
  <fo:block xsl:use-attribute-sets="deprecates-style">
5852
+ <xsl:call-template name="refine_deprecates-style"/>
5614
5853
  <xsl:apply-templates/>
5615
5854
  </fo:block>
5616
5855
  </xsl:template>
5617
5856
 
5618
- <xsl:template name="setStyle_preferred">
5619
- <xsl:if test="mn:strong">
5620
- <xsl:attribute name="font-weight">normal</xsl:attribute>
5621
- </xsl:if>
5622
- </xsl:template>
5623
-
5624
5857
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
5625
5858
  <!-- in metanorma xml preferred terms delimited by semicolons -->
5626
5859
  <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
@@ -5630,6 +5863,7 @@
5630
5863
 
5631
5864
  <xsl:template match="mn:fmt-related">
5632
5865
  <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
5866
+ <xsl:call-template name="refine_related-block-style"/>
5633
5867
  <xsl:apply-templates/>
5634
5868
  </fo:block>
5635
5869
  </xsl:template>
@@ -5644,6 +5878,7 @@
5644
5878
  <!-- ========== -->
5645
5879
  <xsl:template match="mn:fmt-definition">
5646
5880
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
5881
+ <xsl:call-template name="refine_definition-style"/>
5647
5882
  <xsl:apply-templates/>
5648
5883
  </fo:block>
5649
5884
  </xsl:template>
@@ -5693,6 +5928,9 @@
5693
5928
  <xsl:attribute name="margin-left">10mm</xsl:attribute>
5694
5929
  </xsl:attribute-set> <!-- example-body-style -->
5695
5930
 
5931
+ <xsl:template name="refine_example-body-style">
5932
+ </xsl:template>
5933
+
5696
5934
  <xsl:attribute-set name="example-name-style">
5697
5935
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5698
5936
  <xsl:attribute name="padding-right">9mm</xsl:attribute>
@@ -5740,6 +5978,8 @@
5740
5978
  <xsl:when test="contains($element, 'block')">
5741
5979
  <fo:block xsl:use-attribute-sets="example-p-style">
5742
5980
 
5981
+ <xsl:call-template name="refine_example-p-style"/>
5982
+
5743
5983
  <xsl:apply-templates/>
5744
5984
  </fo:block>
5745
5985
  </xsl:when>
@@ -5797,6 +6037,7 @@
5797
6037
  </fo:block>
5798
6038
 
5799
6039
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
6040
+ <xsl:call-template name="refine_example-body-style"/>
5800
6041
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
5801
6042
  <xsl:variable name="example_body">
5802
6043
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
@@ -5859,6 +6100,7 @@
5859
6100
  <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
5860
6101
  <!-- display further elements in blocks -->
5861
6102
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
6103
+ <xsl:call-template name="refine_example-body-style"/>
5862
6104
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
5863
6105
  <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
5864
6106
  <xsl:with-param name="fo_element" select="'block'"/>
@@ -6122,6 +6364,9 @@
6122
6364
  <!-- <xsl:attribute name="padding-right">5mm</xsl:attribute> -->
6123
6365
  </xsl:attribute-set> <!-- table-fn-number-style -->
6124
6366
 
6367
+ <xsl:template name="refine_table-fn-number-style">
6368
+ </xsl:template>
6369
+
6125
6370
  <xsl:attribute-set name="table-fmt-fn-label-style">
6126
6371
  <xsl:attribute name="font-size">80%</xsl:attribute>
6127
6372
  <xsl:attribute name="baseline-shift">30%</xsl:attribute>
@@ -6131,33 +6376,12 @@
6131
6376
  <xsl:template name="refine_table-fmt-fn-label-style">
6132
6377
  </xsl:template>
6133
6378
 
6134
- <xsl:attribute-set name="fn-container-body-style">
6135
- <xsl:attribute name="text-indent">0</xsl:attribute>
6136
- <xsl:attribute name="start-indent">0</xsl:attribute>
6137
- </xsl:attribute-set>
6138
-
6139
6379
  <xsl:attribute-set name="table-fn-body-style">
6140
6380
  </xsl:attribute-set>
6141
6381
 
6142
- <xsl:attribute-set name="figure-fn-number-style">
6143
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
6144
- </xsl:attribute-set> <!-- figure-fn-number-style -->
6145
-
6146
- <xsl:attribute-set name="figure-fmt-fn-label-style">
6147
- <xsl:attribute name="font-size">80%</xsl:attribute>
6148
- <xsl:attribute name="vertical-align">super</xsl:attribute>
6149
- <xsl:attribute name="baseline-shift">65%</xsl:attribute>
6150
- </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
6151
-
6152
- <xsl:template name="refine_figure-fmt-fn-label-style">
6382
+ <xsl:template name="refine_table-fn-body-style">
6153
6383
  </xsl:template>
6154
6384
 
6155
- <xsl:attribute-set name="figure-fn-body-style">
6156
- <xsl:attribute name="text-align">justify</xsl:attribute>
6157
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
6158
- <xsl:attribute name="margin-top">5pt</xsl:attribute>
6159
- <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
6160
- </xsl:attribute-set>
6161
6385
  <!-- ========================== -->
6162
6386
  <!-- END Table styles -->
6163
6387
  <!-- ========================== -->
@@ -7496,6 +7720,7 @@
7496
7720
  </xsl:apply-templates>
7497
7721
 
7498
7722
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
7723
+ <xsl:call-template name="refine_table-fn-body-style"/>
7499
7724
  <!-- <xsl:copy-of select="./node()"/> -->
7500
7725
  <xsl:apply-templates/>
7501
7726
  </fo:inline>
@@ -7514,6 +7739,7 @@
7514
7739
  <xsl:param name="process">false</xsl:param>
7515
7740
  <xsl:if test="$process = 'true'">
7516
7741
  <fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
7742
+ <xsl:call-template name="refine_table-fn-number-style"/>
7517
7743
 
7518
7744
  <!-- tab is padding-right -->
7519
7745
  <xsl:apply-templates select=".//mn:tab">
@@ -8385,9 +8611,18 @@
8385
8611
  <xsl:attribute-set name="dl-block-style">
8386
8612
  </xsl:attribute-set>
8387
8613
 
8614
+ <xsl:template name="refine_dl-block-style">
8615
+ <xsl:if test="@key = 'true' and ancestor::mn:figure">
8616
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
8617
+ </xsl:if>
8618
+ </xsl:template>
8619
+
8388
8620
  <xsl:attribute-set name="dt-row-style">
8389
8621
  </xsl:attribute-set>
8390
8622
 
8623
+ <xsl:template name="refine_dt-row-style">
8624
+ </xsl:template>
8625
+
8391
8626
  <xsl:attribute-set name="dt-cell-style">
8392
8627
  </xsl:attribute-set>
8393
8628
 
@@ -8407,6 +8642,9 @@
8407
8642
  <xsl:attribute name="font-weight">bold</xsl:attribute>
8408
8643
  </xsl:attribute-set> <!-- dl-name-style -->
8409
8644
 
8645
+ <xsl:template name="refine_dl-name-style">
8646
+ </xsl:template>
8647
+
8410
8648
  <xsl:attribute-set name="dd-cell-style">
8411
8649
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
8412
8650
  </xsl:attribute-set>
@@ -8445,9 +8683,7 @@
8445
8683
  <!-- <dl><xsl:copy-of select="."/></dl> -->
8446
8684
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
8447
8685
 
8448
- <xsl:if test="@key = 'true' and ancestor::mn:figure">
8449
- <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
8450
- </xsl:if>
8686
+ <xsl:call-template name="refine_dl-block-style"/>
8451
8687
 
8452
8688
  <xsl:call-template name="setBlockSpanAll"/>
8453
8689
  <xsl:if test="not(ancestor::mn:quote)">
@@ -8747,6 +8983,8 @@
8747
8983
  <xsl:if test="$process = 'true'">
8748
8984
  <fo:block xsl:use-attribute-sets="dl-name-style">
8749
8985
 
8986
+ <xsl:call-template name="refine_dl-name-style"/>
8987
+
8750
8988
  <xsl:apply-templates/>
8751
8989
  </fo:block>
8752
8990
  </xsl:if>
@@ -8935,6 +9173,8 @@
8935
9173
  <xsl:param name="split_keep-within-line"/>
8936
9174
 
8937
9175
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
9176
+ <xsl:call-template name="refine_dt-row-style"/>
9177
+
8938
9178
  <xsl:call-template name="insert_dt_cell">
8939
9179
  <xsl:with-param name="key_iso" select="$key_iso"/>
8940
9180
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -9147,17 +9387,24 @@
9147
9387
  <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
9148
9388
  </xsl:attribute-set>
9149
9389
 
9390
+ <xsl:template name="refine_appendix-style">
9391
+ </xsl:template>
9392
+
9150
9393
  <xsl:attribute-set name="appendix-example-style">
9151
9394
  <xsl:attribute name="margin-top">14pt</xsl:attribute>
9152
9395
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
9153
9396
  </xsl:attribute-set>
9154
9397
 
9398
+ <xsl:template name="refine_appendix-example-style">
9399
+ </xsl:template>
9400
+
9155
9401
  <!-- ======================== -->
9156
9402
  <!-- Appendix processing -->
9157
9403
  <!-- ======================== -->
9158
9404
  <xsl:template match="mn:appendix">
9159
9405
  <xsl:call-template name="setNamedDestination"/>
9160
9406
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
9407
+ <xsl:call-template name="refine_appendix-style"/>
9161
9408
  <xsl:apply-templates select="mn:fmt-title"/>
9162
9409
  </fo:block>
9163
9410
  <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
@@ -9176,13 +9423,23 @@
9176
9423
  <xsl:template match="mn:appendix//mn:example" priority="2">
9177
9424
  <xsl:call-template name="setNamedDestination"/>
9178
9425
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
9426
+ <xsl:call-template name="refine_appendix-example-style"/>
9179
9427
  <xsl:apply-templates select="mn:fmt-name"/>
9180
9428
  </fo:block>
9181
9429
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
9182
9430
  </xsl:template>
9183
9431
 
9184
9432
  <xsl:attribute-set name="xref-style">
9185
- </xsl:attribute-set>
9433
+ </xsl:attribute-set> <!-- xref-style -->
9434
+
9435
+ <xsl:template name="refine_xref-style">
9436
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[self::mn:table or self::mn:dl])">
9437
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
9438
+ </xsl:if>
9439
+ <xsl:if test="parent::mn:add">
9440
+ <xsl:call-template name="append_add-style"/>
9441
+ </xsl:if>
9442
+ </xsl:template> <!-- refine_xref-style -->
9186
9443
 
9187
9444
  <xsl:template match="mn:fmt-xref">
9188
9445
  <xsl:call-template name="insert_basic_link">
@@ -9191,12 +9448,8 @@
9191
9448
  <xsl:call-template name="getAltText"/>
9192
9449
  </xsl:variable>
9193
9450
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
9194
- <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[self::mn:table or self::mn:dl])">
9195
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
9196
- </xsl:if>
9197
- <xsl:if test="parent::mn:add">
9198
- <xsl:call-template name="append_add-style"/>
9199
- </xsl:if>
9451
+ <xsl:call-template name="refine_xref-style"/>
9452
+
9200
9453
  <xsl:apply-templates/>
9201
9454
  </fo:basic-link>
9202
9455
  </xsl:with-param>
@@ -9306,17 +9559,17 @@
9306
9559
  <xsl:attribute name="font-size">8pt</xsl:attribute>
9307
9560
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
9308
9561
  <xsl:attribute name="margin-bottom">9pt</xsl:attribute>
9309
- </xsl:attribute-set>
9562
+ </xsl:attribute-set> <!-- note-style -->
9310
9563
 
9311
9564
  <xsl:template name="refine_note-style">
9312
- </xsl:template>
9565
+ </xsl:template> <!-- refine_note-style -->
9313
9566
 
9314
9567
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
9315
9568
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
9316
9569
 
9317
9570
  <xsl:attribute-set name="note-name-style">
9318
9571
  <xsl:attribute name="padding-right">6mm</xsl:attribute>
9319
- </xsl:attribute-set>
9572
+ </xsl:attribute-set> <!-- note-name-style -->
9320
9573
 
9321
9574
  <xsl:template name="refine_note-name-style">
9322
9575
  </xsl:template> <!-- refine_note-name-style -->
@@ -9330,19 +9583,22 @@
9330
9583
 
9331
9584
  <xsl:attribute-set name="note-p-style">
9332
9585
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
9333
- </xsl:attribute-set>
9586
+ </xsl:attribute-set> <!-- note-p-style -->
9587
+
9588
+ <xsl:template name="refine_note-p-style">
9589
+ </xsl:template>
9334
9590
 
9335
9591
  <xsl:attribute-set name="termnote-style">
9336
9592
  <xsl:attribute name="font-size">8pt</xsl:attribute>
9337
9593
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
9338
9594
  <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
9339
- </xsl:attribute-set>
9595
+ </xsl:attribute-set> <!-- termnote-style -->
9340
9596
 
9341
9597
  <xsl:template name="refine_termnote-style">
9342
9598
  </xsl:template> <!-- refine_termnote-style -->
9343
9599
 
9344
9600
  <xsl:attribute-set name="termnote-name-style">
9345
- </xsl:attribute-set>
9601
+ </xsl:attribute-set> <!-- termnote-name-style -->
9346
9602
 
9347
9603
  <xsl:template name="refine_termnote-name-style">
9348
9604
  </xsl:template>
@@ -9350,6 +9606,9 @@
9350
9606
  <xsl:attribute-set name="termnote-p-style">
9351
9607
  </xsl:attribute-set>
9352
9608
 
9609
+ <xsl:template name="refine_termnote-p-style">
9610
+ </xsl:template>
9611
+
9353
9612
  <!-- ====== -->
9354
9613
  <!-- note -->
9355
9614
  <!-- termnote -->
@@ -9410,11 +9669,13 @@
9410
9669
  <xsl:choose>
9411
9670
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
9412
9671
  <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
9672
+ <xsl:call-template name="refine_note-p-style"/>
9413
9673
  <xsl:apply-templates/>
9414
9674
  </fo:inline>
9415
9675
  </xsl:when>
9416
9676
  <xsl:otherwise>
9417
9677
  <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
9678
+ <xsl:call-template name="refine_note-p-style"/>
9418
9679
  <xsl:apply-templates/>
9419
9680
  </fo:block>
9420
9681
  </xsl:otherwise>
@@ -9506,11 +9767,13 @@
9506
9767
  <xsl:choose>
9507
9768
  <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
9508
9769
  <fo:inline xsl:use-attribute-sets="termnote-p-style">
9770
+ <xsl:call-template name="refine_termnote-p-style"/>
9509
9771
  <xsl:apply-templates/>
9510
9772
  </fo:inline>
9511
9773
  </xsl:when>
9512
9774
  <xsl:otherwise>
9513
9775
  <fo:block xsl:use-attribute-sets="termnote-p-style">
9776
+ <xsl:call-template name="refine_termnote-p-style"/>
9514
9777
  <xsl:apply-templates/>
9515
9778
  </fo:block>
9516
9779
  </xsl:otherwise>
@@ -9525,7 +9788,7 @@
9525
9788
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
9526
9789
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
9527
9790
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
9528
- </xsl:attribute-set>
9791
+ </xsl:attribute-set> <!-- quote-style -->
9529
9792
 
9530
9793
  <xsl:template name="refine_quote-style">
9531
9794
  </xsl:template>
@@ -9537,6 +9800,9 @@
9537
9800
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
9538
9801
  </xsl:attribute-set>
9539
9802
 
9803
+ <xsl:template name="refine_quote-source-style">
9804
+ </xsl:template>
9805
+
9540
9806
  <!-- ====== -->
9541
9807
  <!-- quote -->
9542
9808
  <!-- source -->
@@ -9565,6 +9831,7 @@
9565
9831
  </fo:block-container>
9566
9832
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
9567
9833
  <fo:block xsl:use-attribute-sets="quote-source-style">
9834
+ <xsl:call-template name="refine_quote-source-style"/>
9568
9835
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
9569
9836
  <xsl:apply-templates select="mn:author"/>
9570
9837
  <xsl:apply-templates select="mn:fmt-source"/>
@@ -9627,6 +9894,9 @@
9627
9894
  <xsl:attribute-set name="figure-style">
9628
9895
  </xsl:attribute-set>
9629
9896
 
9897
+ <xsl:template name="refine_figure-style">
9898
+ </xsl:template>
9899
+
9630
9900
  <xsl:attribute-set name="figure-name-style">
9631
9901
  <xsl:attribute name="role">Caption</xsl:attribute>
9632
9902
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -9634,7 +9904,7 @@
9634
9904
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
9635
9905
  <xsl:attribute name="space-after">12pt</xsl:attribute>
9636
9906
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
9637
- </xsl:attribute-set>
9907
+ </xsl:attribute-set> <!-- figure-name-style -->
9638
9908
 
9639
9909
  <xsl:template name="refine_figure-name-style">
9640
9910
  </xsl:template> <!-- refine_figure-name-style -->
@@ -9642,7 +9912,7 @@
9642
9912
  <xsl:attribute-set name="image-style">
9643
9913
  <xsl:attribute name="role">SKIP</xsl:attribute>
9644
9914
  <xsl:attribute name="text-align">center</xsl:attribute>
9645
- </xsl:attribute-set>
9915
+ </xsl:attribute-set> <!-- image-style -->
9646
9916
 
9647
9917
  <xsl:template name="refine_image-style">
9648
9918
  </xsl:template>
@@ -9653,7 +9923,10 @@
9653
9923
  <xsl:attribute name="scaling">uniform</xsl:attribute>
9654
9924
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
9655
9925
  <xsl:attribute name="width">75%</xsl:attribute>
9656
- </xsl:attribute-set>
9926
+ </xsl:attribute-set> <!-- image-graphic-style -->
9927
+
9928
+ <xsl:template name="refine_image-graphic-style">
9929
+ </xsl:template>
9657
9930
 
9658
9931
  <xsl:attribute-set name="figure-source-style">
9659
9932
  <xsl:attribute name="font-size">6pt</xsl:attribute>
@@ -9661,9 +9934,45 @@
9661
9934
  <xsl:attribute name="text-align">right</xsl:attribute>
9662
9935
  </xsl:attribute-set>
9663
9936
 
9937
+ <xsl:template name="refine_figure-source-style">
9938
+ </xsl:template>
9939
+
9664
9940
  <xsl:attribute-set name="figure-pseudocode-p-style">
9665
9941
  </xsl:attribute-set>
9666
9942
 
9943
+ <xsl:template name="refine_figure-pseudocode-p-style">
9944
+ </xsl:template>
9945
+
9946
+ <xsl:attribute-set name="figure-fn-number-style">
9947
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
9948
+ </xsl:attribute-set> <!-- figure-fn-number-style -->
9949
+
9950
+ <xsl:template name="refine_figure-fn-number-style">
9951
+ </xsl:template>
9952
+
9953
+ <xsl:attribute-set name="figure-fmt-fn-label-style">
9954
+ <xsl:attribute name="font-size">80%</xsl:attribute>
9955
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
9956
+ <xsl:attribute name="baseline-shift">65%</xsl:attribute>
9957
+ </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
9958
+
9959
+ <xsl:template name="refine_figure-fmt-fn-label-style">
9960
+ </xsl:template>
9961
+
9962
+ <xsl:attribute-set name="figure-fn-body-style">
9963
+ <xsl:attribute name="text-align">justify</xsl:attribute>
9964
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
9965
+ <xsl:attribute name="margin-top">5pt</xsl:attribute>
9966
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
9967
+ </xsl:attribute-set>
9968
+
9969
+ <xsl:template name="refine_figure-fn-body-style">
9970
+ <xsl:variable name="key_iso">true
9971
+ </xsl:variable>
9972
+ <xsl:if test="normalize-space($key_iso) = 'true'">
9973
+ </xsl:if>
9974
+ </xsl:template>
9975
+
9667
9976
  <!-- ============================ -->
9668
9977
  <!-- figure's footnotes rendering -->
9669
9978
  <!-- ============================ -->
@@ -9777,8 +10086,8 @@
9777
10086
  </fo:table-cell>
9778
10087
  <fo:table-cell>
9779
10088
  <fo:block xsl:use-attribute-sets="figure-fn-body-style">
9780
- <xsl:if test="normalize-space($key_iso) = 'true'">
9781
- </xsl:if>
10089
+ <xsl:call-template name="refine_figure-fn-body-style"/>
10090
+
9782
10091
  <!-- <xsl:copy-of select="./node()"/> -->
9783
10092
  <xsl:apply-templates/>
9784
10093
  </fo:block>
@@ -9796,6 +10105,7 @@
9796
10105
  <xsl:param name="process">false</xsl:param>
9797
10106
  <xsl:if test="$process = 'true'">
9798
10107
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
10108
+ <xsl:call-template name="refine_figure-fn-number-style"/>
9799
10109
  <xsl:attribute name="padding-right">0mm</xsl:attribute>
9800
10110
 
9801
10111
  <!-- tab is padding-right -->
@@ -9834,6 +10144,7 @@
9834
10144
  <xsl:attribute name="font-size">8pt</xsl:attribute>
9835
10145
  </xsl:if>
9836
10146
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
10147
+ <xsl:call-template name="refine_figure-fn-number-style"/>
9837
10148
  <!-- <xsl:value-of select="@reference"/> -->
9838
10149
  <xsl:apply-templates/>
9839
10150
  </fo:inline>
@@ -9881,6 +10192,8 @@
9881
10192
 
9882
10193
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
9883
10194
 
10195
+ <xsl:call-template name="refine_figure-style"/>
10196
+
9884
10197
  <xsl:for-each select="mn:fmt-name"> <!-- set context -->
9885
10198
  <xsl:call-template name="setIDforNamedDestination"/>
9886
10199
  </xsl:for-each>
@@ -9924,6 +10237,7 @@
9924
10237
 
9925
10238
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
9926
10239
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
10240
+ <xsl:call-template name="refine_figure-pseudocode-p-style"/>
9927
10241
  <xsl:apply-templates/>
9928
10242
  </fo:block>
9929
10243
  </xsl:template>
@@ -9932,6 +10246,7 @@
9932
10246
  <!-- figure/source -->
9933
10247
  <xsl:template match="mn:figure/mn:fmt-source" priority="2">
9934
10248
  <fo:block xsl:use-attribute-sets="figure-source-style">
10249
+ <xsl:call-template name="refine_figure-source-style"/>
9935
10250
  <xsl:apply-templates/>
9936
10251
  </fo:block>
9937
10252
 
@@ -10056,6 +10371,8 @@
10056
10371
  </xsl:variable>
10057
10372
  <xsl:copy-of select="xalan:nodeset($image-graphic-style_attributes)/attributes/@*"/>
10058
10373
 
10374
+ <xsl:call-template name="refine_image-graphic-style"/>
10375
+
10059
10376
  <xsl:if test="not(@mimetype = 'image/svg+xml') and not(ancestor::mn:table)">
10060
10377
  <xsl:variable name="scale">
10061
10378
  <xsl:call-template name="getImageScale">
@@ -10755,6 +11072,9 @@
10755
11072
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10756
11073
  </xsl:attribute-set> <!-- formula-style -->
10757
11074
 
11075
+ <xsl:template name="refine_formula-style">
11076
+ </xsl:template>
11077
+
10758
11078
  <xsl:attribute-set name="formula-stem-block-style">
10759
11079
  <xsl:attribute name="text-align">center</xsl:attribute>
10760
11080
  </xsl:attribute-set> <!-- formula-stem-block-style -->
@@ -10827,6 +11147,8 @@
10827
11147
  <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
10828
11148
  <fo:block xsl:use-attribute-sets="formula-style">
10829
11149
 
11150
+ <xsl:call-template name="refine_formula-style"/>
11151
+
10830
11152
  <fo:table table-layout="fixed" width="100%">
10831
11153
  <fo:table-column column-width="95%"/>
10832
11154
  <fo:table-column column-width="5%"/>
@@ -11250,6 +11572,9 @@
11250
11572
  <xsl:attribute name="font-weight">bold</xsl:attribute>
11251
11573
  </xsl:attribute-set> <!-- list-name-style -->
11252
11574
 
11575
+ <xsl:template name="refine_list-name-style">
11576
+ </xsl:template>
11577
+
11253
11578
  <xsl:attribute-set name="list-item-style">
11254
11579
  </xsl:attribute-set>
11255
11580
 
@@ -11551,6 +11876,7 @@
11551
11876
  <xsl:param name="process">false</xsl:param>
11552
11877
  <xsl:if test="$process = 'true'">
11553
11878
  <fo:block xsl:use-attribute-sets="list-name-style">
11879
+ <xsl:call-template name="refine_list-name-style"/>
11554
11880
  <xsl:apply-templates/>
11555
11881
  </fo:block>
11556
11882
  </xsl:if>
@@ -11611,28 +11937,49 @@
11611
11937
  <!-- END Lists processing -->
11612
11938
  <!-- ===================================== -->
11613
11939
 
11940
+ <xsl:attribute-set name="footnote-separator-leader-style">
11941
+ </xsl:attribute-set>
11942
+
11943
+ <xsl:template name="refine_footnote-separator-leader-style">
11944
+ </xsl:template>
11945
+
11946
+ <xsl:attribute-set name="fn-container-body-style">
11947
+ <xsl:attribute name="text-indent">0</xsl:attribute>
11948
+ <xsl:attribute name="start-indent">0</xsl:attribute>
11949
+ </xsl:attribute-set>
11950
+
11951
+ <xsl:template name="refine_fn-container-body-style">
11952
+ </xsl:template>
11953
+
11614
11954
  <xsl:attribute-set name="fn-reference-style">
11615
11955
  <xsl:attribute name="font-size">80%</xsl:attribute>
11616
11956
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
11617
-
11618
- </xsl:attribute-set>
11957
+ </xsl:attribute-set> <!-- fn-reference-style -->
11619
11958
 
11620
11959
  <xsl:template name="refine_fn-reference-style">
11621
11960
  <xsl:if test="ancestor::*[local-name()='table']">
11622
11961
  <xsl:attribute name="font-weight">normal</xsl:attribute>
11623
11962
  <xsl:attribute name="baseline-shift">15%</xsl:attribute>
11624
11963
  </xsl:if>
11964
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
11965
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
11625
11966
  </xsl:template> <!-- refine_fn-reference-style -->
11626
11967
 
11627
11968
  <xsl:attribute-set name="fn-style">
11628
11969
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
11629
11970
  </xsl:attribute-set>
11630
11971
 
11972
+ <xsl:template name="refine_fn-style">
11973
+ </xsl:template>
11974
+
11631
11975
  <xsl:attribute-set name="fn-num-style">
11632
11976
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
11633
11977
  <xsl:attribute name="font-size">8pt</xsl:attribute>
11634
11978
  <xsl:attribute name="baseline-shift">15%</xsl:attribute>
11635
- </xsl:attribute-set>
11979
+ </xsl:attribute-set> <!-- fn-num-style -->
11980
+
11981
+ <xsl:template name="refine_fn-num-style">
11982
+ </xsl:template>
11636
11983
 
11637
11984
  <xsl:attribute-set name="fn-body-style">
11638
11985
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -11641,7 +11988,7 @@
11641
11988
  <xsl:attribute name="start-indent">0</xsl:attribute>
11642
11989
  <xsl:attribute name="font-size">8pt</xsl:attribute>
11643
11990
  <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
11644
- </xsl:attribute-set>
11991
+ </xsl:attribute-set> <!-- fn-body-style" -->
11645
11992
 
11646
11993
  <xsl:template name="refine_fn-body-style">
11647
11994
  </xsl:template> <!-- refine_fn-body-style -->
@@ -11705,10 +12052,12 @@
11705
12052
  <xsl:choose>
11706
12053
  <xsl:when test="ancestor::mn:bibitem">
11707
12054
  <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
12055
+ <xsl:call-template name="refine_bibitem-note-fn-style"/>
11708
12056
  </fn_styles>
11709
12057
  </xsl:when>
11710
12058
  <xsl:otherwise>
11711
12059
  <fn_styles xsl:use-attribute-sets="fn-num-style">
12060
+ <xsl:call-template name="refine_fn-num-style"/>
11712
12061
  </fn_styles>
11713
12062
  </xsl:otherwise>
11714
12063
  </xsl:choose>
@@ -11718,9 +12067,12 @@
11718
12067
  <xsl:copy-of select="."/>
11719
12068
  </xsl:for-each>
11720
12069
 
11721
- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
12070
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
12071
+ <!-- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
11722
12072
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
11723
- </xsl:if>
12073
+ </xsl:if> -->
12074
+
12075
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
11724
12076
 
11725
12077
  <xsl:call-template name="insert_basic_link">
11726
12078
  <xsl:with-param name="element">
@@ -11743,10 +12095,12 @@
11743
12095
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
11744
12096
 
11745
12097
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
12098
+ <xsl:call-template name="refine_fn-style"/>
11746
12099
  <xsl:copy-of select="$footnote_inline"/>
11747
12100
  <fo:footnote-body role="Note">
11748
12101
 
11749
12102
  <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
12103
+ <xsl:call-template name="refine_fn-container-body-style"/>
11750
12104
 
11751
12105
  <xsl:variable name="fn_block">
11752
12106
  <xsl:call-template name="refine_fn-body-style"/>
@@ -11848,6 +12202,9 @@
11848
12202
  <xsl:attribute name="space-after">12pt</xsl:attribute>
11849
12203
  </xsl:attribute-set> <!-- admonition-style -->
11850
12204
 
12205
+ <xsl:template name="refine_admonition-style">
12206
+ </xsl:template>
12207
+
11851
12208
  <xsl:attribute-set name="admonition-container-style">
11852
12209
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
11853
12210
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -11856,12 +12213,22 @@
11856
12213
  <xsl:attribute name="padding-top">2mm</xsl:attribute>
11857
12214
  </xsl:attribute-set> <!-- admonition-container-style -->
11858
12215
 
12216
+ <xsl:template name="refine_admonition-container-style">
12217
+ </xsl:template>
12218
+
11859
12219
  <xsl:attribute-set name="admonition-name-style">
11860
12220
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
11861
12221
  </xsl:attribute-set> <!-- admonition-name-style -->
11862
12222
 
12223
+ <xsl:template name="refine_admonition-name-style">
12224
+ </xsl:template>
12225
+
11863
12226
  <xsl:attribute-set name="admonition-p-style">
11864
12227
  </xsl:attribute-set> <!-- admonition-p-style -->
12228
+
12229
+ <xsl:template name="refine_admonition-p-style">
12230
+ </xsl:template>
12231
+
11865
12232
  <!-- end admonition -->
11866
12233
 
11867
12234
  <!-- ================ -->
@@ -11871,8 +12238,12 @@
11871
12238
  <xsl:call-template name="setNamedDestination"/>
11872
12239
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
11873
12240
 
12241
+ <xsl:call-template name="refine_admonition-style"/>
12242
+
11874
12243
  <xsl:call-template name="setBlockSpanAll"/>
11875
12244
  <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
12245
+
12246
+ <xsl:call-template name="refine_admonition-container-style"/>
11876
12247
  <fo:block text-align="justify">
11877
12248
  <fo:inline>
11878
12249
  <xsl:call-template name="displayAdmonitionName"/>
@@ -11939,12 +12310,22 @@
11939
12310
  <!-- END Admonition -->
11940
12311
  <!-- ================ -->
11941
12312
 
12313
+ <xsl:attribute-set name="references-non-normative-title-style">
12314
+ </xsl:attribute-set>
12315
+
12316
+ <xsl:template name="refine_references-non-normative-title-style">
12317
+
12318
+ </xsl:template>
12319
+
11942
12320
  <!-- bibitem in Normative References (references/@normative="true") -->
11943
12321
  <xsl:attribute-set name="bibitem-normative-style">
11944
12322
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
11945
12323
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
11946
12324
  </xsl:attribute-set> <!-- bibitem-normative-style -->
11947
12325
 
12326
+ <xsl:template name="refine_bibitem-normative-style">
12327
+ </xsl:template>
12328
+
11948
12329
  <!-- bibitem in Normative References (references/@normative="true"), renders as list -->
11949
12330
  <xsl:attribute-set name="bibitem-normative-list-style">
11950
12331
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -11953,9 +12334,15 @@
11953
12334
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
11954
12335
  </xsl:attribute-set> <!-- bibitem-normative-list-style -->
11955
12336
 
12337
+ <xsl:template name="refine_bibitem-normative-list-style">
12338
+ </xsl:template>
12339
+
11956
12340
  <xsl:attribute-set name="bibitem-non-normative-style">
11957
12341
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
11958
12342
 
12343
+ <xsl:template name="refine_bibitem-non-normative-style">
12344
+ </xsl:template>
12345
+
11959
12346
  <!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
11960
12347
  <xsl:attribute-set name="bibitem-non-normative-list-style">
11961
12348
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
@@ -11964,19 +12351,31 @@
11964
12351
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
11965
12352
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
11966
12353
 
12354
+ <xsl:template name="refine_bibitem-non-normative-list-style">
12355
+ </xsl:template>
12356
+
11967
12357
  <xsl:attribute-set name="bibitem-non-normative-list-item-style">
11968
12358
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
11969
12359
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
11970
12360
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
11971
12361
  </xsl:attribute-set>
11972
12362
 
12363
+ <xsl:template name="refine_bibitem-non-normative-list-item-style">
12364
+ </xsl:template>
12365
+
11973
12366
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
11974
12367
  <xsl:attribute-set name="bibitem-normative-list-body-style">
11975
12368
  </xsl:attribute-set>
11976
12369
 
12370
+ <xsl:template name="refine_bibitem-normative-list-body-style">
12371
+ </xsl:template>
12372
+
11977
12373
  <xsl:attribute-set name="bibitem-non-normative-list-body-style">
11978
12374
  </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style -->
11979
12375
 
12376
+ <xsl:template name="refine_bibitem-non-normative-list-body-style">
12377
+ </xsl:template>
12378
+
11980
12379
  <!-- footnote reference number for bibitem, in the text -->
11981
12380
  <xsl:attribute-set name="bibitem-note-fn-style">
11982
12381
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
@@ -11985,6 +12384,9 @@
11985
12384
  <xsl:attribute name="baseline-shift">15%</xsl:attribute>
11986
12385
  </xsl:attribute-set> <!-- bibitem-note-fn-style -->
11987
12386
 
12387
+ <xsl:template name="refine_bibitem-note-fn-style">
12388
+ </xsl:template>
12389
+
11988
12390
  <!-- footnote number on the page bottom -->
11989
12391
  <xsl:attribute-set name="bibitem-note-fn-number-style">
11990
12392
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
@@ -12004,6 +12406,9 @@
12004
12406
  <xsl:attribute-set name="references-non-normative-style">
12005
12407
  </xsl:attribute-set> <!-- references-non-normative-style -->
12006
12408
 
12409
+ <xsl:template name="refine_references-non-normative-style">
12410
+ </xsl:template>
12411
+
12007
12412
  <!-- ======================= -->
12008
12413
  <!-- Bibliography rendering -->
12009
12414
  <!-- ======================= -->
@@ -12045,6 +12450,7 @@
12045
12450
  <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
12046
12451
 
12047
12452
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
12453
+ <xsl:call-template name="refine_references-non-normative-style"/>
12048
12454
  <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
12049
12455
  </fo:block>
12050
12456
  <!-- horizontal line -->
@@ -12062,18 +12468,22 @@
12062
12468
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first -->
12063
12469
  <xsl:call-template name="setNamedDestination"/>
12064
12470
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
12471
+ <xsl:call-template name="refine_bibitem-normative-style"/>
12472
+
12065
12473
  <xsl:call-template name="processBibitem"/>
12066
12474
  </fo:block>
12067
12475
 
12068
12476
  </xsl:template> <!-- bibitem -->
12069
12477
 
12070
12478
  <!-- Bibliography (non-normative references) -->
12071
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
12479
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
12072
12480
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[not(self::mn:note)][1][self::mn:bibitem] and 1 = 1)"/> <!-- current bibiitem is non-first --> <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
12073
12481
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
12074
12482
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
12075
12483
  <xsl:call-template name="setNamedDestination"/>
12076
12484
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
12485
+ <xsl:call-template name="refine_bibitem-non-normative-list-style"/>
12486
+
12077
12487
  <fo:list-item>
12078
12488
  <fo:list-item-label end-indent="label-end()">
12079
12489
  <fo:block role="SKIP">
@@ -12086,6 +12496,7 @@
12086
12496
  </fo:list-item-label>
12087
12497
  <fo:list-item-body start-indent="body-start()">
12088
12498
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
12499
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
12089
12500
  <xsl:call-template name="processBibitem">
12090
12501
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
12091
12502
  </xsl:call-template>
@@ -12096,12 +12507,17 @@
12096
12507
 
12097
12508
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
12098
12509
 
12510
+ <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
12511
+ <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
12512
+
12099
12513
  <xsl:template name="insertListItem_Bibitem">
12100
12514
  <xsl:choose>
12101
12515
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
12102
12516
  <xsl:otherwise>
12103
12517
  <xsl:call-template name="setNamedDestination"/>
12104
12518
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
12519
+ <xsl:call-template name="refine_bibitem-non-normative-list-item-style"/>
12520
+
12105
12521
  <fo:list-item-label end-indent="label-end()">
12106
12522
  <fo:block role="SKIP">
12107
12523
  <fo:inline role="SKIP">
@@ -12112,16 +12528,18 @@
12112
12528
  </fo:block>
12113
12529
  </fo:list-item-label>
12114
12530
  <fo:list-item-body start-indent="body-start()">
12115
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
12531
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style"> <!-- role="SKIP" -->
12532
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
12116
12533
  <xsl:call-template name="processBibitem">
12117
12534
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
12118
12535
  </xsl:call-template>
12119
12536
  </fo:block>
12537
+ <xsl:call-template name="processBibitemFollowingNotes"/>
12120
12538
  </fo:list-item-body>
12121
12539
  </fo:list-item>
12122
12540
  </xsl:otherwise>
12123
12541
  </xsl:choose>
12124
- <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
12542
+ <xsl:apply-templates select="following-sibling::*[self::mn:bibitem][1]">
12125
12543
  <xsl:with-param name="skip">false</xsl:with-param>
12126
12544
  </xsl:apply-templates>
12127
12545
  </xsl:template>
@@ -12137,25 +12555,16 @@
12137
12555
  <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
12138
12556
  </xsl:apply-templates>
12139
12557
  <xsl:apply-templates select="mn:formattedref"/>
12558
+ <xsl:call-template name="processBibitemFollowingNotes"/>
12140
12559
  <!-- end bibitem processing -->
12141
-
12142
- <xsl:call-template name="processBibliographyNote"/>
12143
12560
  </xsl:template> <!-- processBibitem (bibitem) -->
12144
12561
 
12145
- <xsl:template name="processBibliographyNote">
12146
- <xsl:if test="self::mn:note">
12147
- <xsl:variable name="note_node">
12148
- <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
12149
- <xsl:copy> <!-- skip @id -->
12150
- <xsl:copy-of select="node()"/>
12151
- </xsl:copy>
12152
- </xsl:element>
12153
- </xsl:variable>
12154
- <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
12155
- <xsl:call-template name="note"/>
12156
- </xsl:for-each> -->
12562
+ <xsl:template name="processBibitemFollowingNotes">
12563
+ <!-- current context is bibitem element -->
12564
+ <xsl:variable name="bibitem_id" select="@id"/>
12565
+ <xsl:for-each select="following-sibling::mn:note[preceding-sibling::mn:bibitem[1][@id = $bibitem_id] and preceding-sibling::*[1][self::mn:note or self::mn:bibitem]]">
12157
12566
  <xsl:call-template name="note"/>
12158
- </xsl:if>
12567
+ </xsl:for-each>
12159
12568
  </xsl:template>
12160
12569
 
12161
12570
  <xsl:template match="mn:title" mode="title">
@@ -12358,14 +12767,20 @@
12358
12767
  <xsl:attribute name="font-size">12pt</xsl:attribute>
12359
12768
  <xsl:attribute name="font-weight">bold</xsl:attribute>
12360
12769
  <xsl:attribute name="margin-bottom">84pt</xsl:attribute>
12361
- </xsl:attribute-set>
12770
+ </xsl:attribute-set> <!-- indexsect-title-style -->
12771
+
12772
+ <xsl:template name="refine_indexsect-title-style">
12773
+ </xsl:template>
12362
12774
 
12363
12775
  <xsl:attribute-set name="indexsect-clause-title-style">
12364
12776
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
12365
12777
  <xsl:attribute name="font-size">10pt</xsl:attribute>
12366
12778
  <xsl:attribute name="font-weight">bold</xsl:attribute>
12367
12779
  <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
12368
- </xsl:attribute-set>
12780
+ </xsl:attribute-set> <!-- indexsect-clause-title-style -->
12781
+
12782
+ <xsl:template name="refine_indexsect-clause-title-style">
12783
+ </xsl:template>
12369
12784
  <!-- End Index section styles -->
12370
12785
 
12371
12786
  <!-- =================== -->
@@ -12559,6 +12974,7 @@
12559
12974
 
12560
12975
  <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
12561
12976
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
12977
+ <xsl:call-template name="refine_indexsect-title-style"/>
12562
12978
  <!-- Index -->
12563
12979
  <xsl:apply-templates/>
12564
12980
  </fo:block>
@@ -12567,6 +12983,7 @@
12567
12983
  <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
12568
12984
  <!-- Letter A, B, C, ... -->
12569
12985
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
12986
+ <xsl:call-template name="refine_indexsect-clause-title-style"/>
12570
12987
  <xsl:apply-templates/>
12571
12988
  </fo:block>
12572
12989
  </xsl:template>
@@ -12609,13 +13026,31 @@
12609
13026
  <!-- skip here, see the template 'fmt-review-start' -->
12610
13027
  </xsl:when>
12611
13028
  <xsl:otherwise>
12612
- <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
12613
- <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
12614
- <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
12615
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
13029
+ <xsl:choose>
13030
+ <xsl:when test="parent::mn:example or parent::mn:termexample or parent::mn:note or parent::mn:termnote">
13031
+ <fo:block font-size="1pt" line-height="0.1">
13032
+ <xsl:call-template name="fo_inline_bookmark">
13033
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
13034
+ </xsl:call-template>
13035
+ </fo:block>
13036
+ </xsl:when>
13037
+ <xsl:otherwise>
13038
+ <xsl:call-template name="fo_inline_bookmark">
13039
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
13040
+ </xsl:call-template>
13041
+ </xsl:otherwise>
13042
+ </xsl:choose>
12616
13043
  </xsl:otherwise>
12617
13044
  </xsl:choose>
12618
13045
  </xsl:template>
13046
+
13047
+ <xsl:template name="fo_inline_bookmark">
13048
+ <xsl:param name="bookmark_id"/>
13049
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
13050
+ <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
13051
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
13052
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
13053
+ </xsl:template>
12619
13054
  <!-- =================== -->
12620
13055
  <!-- End of Index processing -->
12621
13056
  <!-- =================== -->
@@ -12780,9 +13215,15 @@
12780
13215
  <xsl:attribute name="leader-pattern">dots</xsl:attribute>
12781
13216
  </xsl:attribute-set> <!-- END: toc-leader-style -->
12782
13217
 
13218
+ <xsl:template name="refine_toc-leader-style">
13219
+ </xsl:template>
13220
+
12783
13221
  <xsl:attribute-set name="toc-pagenumber-style">
12784
13222
  </xsl:attribute-set>
12785
13223
 
13224
+ <xsl:template name="refine_toc-pagenumber-style">
13225
+ </xsl:template>
13226
+
12786
13227
  <!-- List of Figures, Tables -->
12787
13228
  <xsl:attribute-set name="toc-listof-title-style">
12788
13229
  </xsl:attribute-set>
@@ -12793,6 +13234,9 @@
12793
13234
  <xsl:attribute-set name="toc-listof-item-block-style">
12794
13235
  </xsl:attribute-set>
12795
13236
 
13237
+ <xsl:template name="refine_toc-listof-item-block-style">
13238
+ </xsl:template>
13239
+
12796
13240
  <xsl:attribute-set name="toc-listof-item-style">
12797
13241
  <xsl:attribute name="role">TOCI</xsl:attribute>
12798
13242
  <xsl:attribute name="text-align-last">justify</xsl:attribute>
@@ -12801,6 +13245,9 @@
12801
13245
  <xsl:attribute name="text-indent">-8mm</xsl:attribute>
12802
13246
  </xsl:attribute-set>
12803
13247
 
13248
+ <xsl:template name="refine_toc-listof-item-style">
13249
+ </xsl:template>
13250
+
12804
13251
  <xsl:template name="processPrefaceSectionsDefault_Contents">
12805
13252
  <xsl:variable name="nodes_preface_">
12806
13253
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -13923,23 +14370,55 @@
13923
14370
  <!-- Ruby text (CJK languages) rendering -->
13924
14371
  <!-- ===================================== -->
13925
14372
  <!-- ===================================== -->
14373
+
14374
+ <xsl:attribute-set name="ruby-style">
14375
+ <xsl:attribute name="text-indent">0mm</xsl:attribute>
14376
+ <xsl:attribute name="last-line-end-indent">0mm</xsl:attribute>
14377
+ </xsl:attribute-set>
14378
+
14379
+ <xsl:template name="refine_ruby-style">
14380
+ <xsl:if test="not(ancestor::mn:ruby)">
14381
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
14382
+ </xsl:if>
14383
+ <xsl:variable name="rt_text" select="mn:rt"/>
14384
+ <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
14385
+ <!-- Example: width="2em" -->
14386
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
14387
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
14388
+ <xsl:variable name="text_width">
14389
+ <xsl:choose>
14390
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
14391
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
14392
+ </xsl:choose>
14393
+ </xsl:variable>
14394
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
14395
+ </xsl:template> <!-- refine_ruby-style -->
14396
+
14397
+ <xsl:attribute-set name="rb-style">
14398
+ <xsl:attribute name="line-height">1em</xsl:attribute>
14399
+ <xsl:attribute name="text-align">center</xsl:attribute>
14400
+ </xsl:attribute-set>
14401
+
14402
+ <xsl:template name="refine_rb-style">
14403
+ </xsl:template>
14404
+
14405
+ <xsl:attribute-set name="rt-style">
14406
+ <xsl:attribute name="font-size">0.5em</xsl:attribute>
14407
+ <xsl:attribute name="text-align">center</xsl:attribute>
14408
+ <xsl:attribute name="line-height">1.2em</xsl:attribute>
14409
+ <xsl:attribute name="space-before">-1.4em</xsl:attribute>
14410
+ <xsl:attribute name="space-before.conditionality">retain</xsl:attribute>
14411
+ </xsl:attribute-set>
14412
+
14413
+ <xsl:template name="refine_rt-style">
14414
+ <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
14415
+ <xsl:attribute name="space-before">0em</xsl:attribute>
14416
+ </xsl:if>
14417
+ </xsl:template>
14418
+
13926
14419
  <xsl:template match="mn:ruby">
13927
- <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
13928
- <xsl:if test="not(ancestor::mn:ruby)">
13929
- <xsl:attribute name="alignment-baseline">central</xsl:attribute>
13930
- </xsl:if>
13931
- <xsl:variable name="rt_text" select="mn:rt"/>
13932
- <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
13933
- <!-- Example: width="2em" -->
13934
- <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
13935
- <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
13936
- <xsl:variable name="text_width">
13937
- <xsl:choose>
13938
- <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
13939
- <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
13940
- </xsl:choose>
13941
- </xsl:variable>
13942
- <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
14420
+ <fo:inline-container xsl:use-attribute-sets="ruby-style">
14421
+ <xsl:call-template name="refine_ruby-style"/>
13943
14422
 
13944
14423
  <xsl:choose>
13945
14424
  <xsl:when test="ancestor::mn:ruby">
@@ -13957,17 +14436,14 @@
13957
14436
  </xsl:template>
13958
14437
 
13959
14438
  <xsl:template match="mn:rb">
13960
- <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
14439
+ <fo:block xsl:use-attribute-sets="rb-style"><xsl:call-template name="refine_rb-style"/><xsl:apply-templates/></fo:block>
13961
14440
  </xsl:template>
13962
14441
 
13963
14442
  <xsl:template match="mn:rt">
13964
- <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
13965
- <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
13966
- <xsl:attribute name="space-before">0em</xsl:attribute>
13967
- </xsl:if>
14443
+ <fo:block xsl:use-attribute-sets="rt-style"> <!-- -->
14444
+ <xsl:call-template name="refine_rt-style"/>
13968
14445
  <xsl:apply-templates/>
13969
14446
  </fo:block>
13970
-
13971
14447
  </xsl:template>
13972
14448
 
13973
14449
  <!-- ===================================== -->
@@ -13976,6 +14452,18 @@
13976
14452
  <!-- ===================================== -->
13977
14453
  <!-- ===================================== -->
13978
14454
 
14455
+ <xsl:attribute-set name="annex-title-style">
14456
+ </xsl:attribute-set>
14457
+
14458
+ <xsl:template name="refine_annex-title-style">
14459
+ </xsl:template>
14460
+
14461
+ <xsl:attribute-set name="p-zzSTDTitle1-style">
14462
+ </xsl:attribute-set>
14463
+
14464
+ <xsl:template name="refine_p-zzSTDTitle1-style">
14465
+ </xsl:template>
14466
+
13979
14467
  <xsl:template name="processPrefaceSectionsDefault">
13980
14468
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
13981
14469
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -14531,11 +15019,35 @@
14531
15019
 
14532
15020
  <xsl:template match="mn:svgmap"/>
14533
15021
 
15022
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
15023
+
14534
15024
  <!-- for correct rendering combining chars, added in mode="update_xml_step2" -->
14535
15025
  <xsl:template match="*[local-name() = 'lang_none']">
14536
15026
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
14537
15027
  </xsl:template>
14538
15028
 
15029
+ <xsl:template name="addTagElementT">
15030
+ <xsl:variable name="title_">
15031
+ <xsl:apply-templates select="mn:fmt-title"/>
15032
+ </xsl:variable>
15033
+ <xsl:variable name="title__">
15034
+ <xsl:for-each select="xalan:nodeset($title_)/*/node()">
15035
+ <xsl:choose>
15036
+ <xsl:when test="self::text()"><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text></xsl:when>
15037
+ <xsl:otherwise><xsl:text> </xsl:text><xsl:copy-of select="."/><xsl:text> </xsl:text></xsl:otherwise>
15038
+ </xsl:choose>
15039
+ </xsl:for-each>
15040
+ </xsl:variable>
15041
+ <xsl:variable name="title" select="normalize-space($title__)"/>
15042
+ <xsl:if test="$title != ''">
15043
+ <xsl:attribute name="fox:title">
15044
+ <xsl:if test="ancestor::mn:sections">
15045
+ <xsl:text>Section </xsl:text>
15046
+ </xsl:if>
15047
+ <xsl:value-of select="$title"/></xsl:attribute>
15048
+ </xsl:if>
15049
+ </xsl:template>
15050
+
14539
15051
  <xsl:template name="replaceChar">
14540
15052
  <xsl:param name="text"/>
14541
15053
  <xsl:param name="replace"/>
@@ -15326,6 +15838,13 @@
15326
15838
  <xsl:with-param name="default" select="$text_align_default"/>
15327
15839
  </xsl:call-template>
15328
15840
  <xsl:call-template name="setKeepAttributes"/>
15841
+ <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
15842
+ <xsl:variable name="styles">
15843
+ <xsl:apply-templates select="*[1]"/>
15844
+ </xsl:variable>
15845
+ <!-- move attribute line-height from inline to block -->
15846
+ <xsl:attribute name="line-height"><xsl:value-of select="xalan:nodeset($styles)//*/@line-height"/></xsl:attribute>
15847
+ </xsl:if>
15329
15848
  </xsl:template>
15330
15849
 
15331
15850
  <xsl:template name="setKeepAttributes">
@@ -15351,34 +15870,41 @@
15351
15870
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
15352
15871
  <fo:block>
15353
15872
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image[$num]">
15354
- <xsl:choose>
15355
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
15356
- <fo:instream-foreign-object fox:alt-text="Image Front">
15357
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
15358
- <xsl:call-template name="getSVG"/>
15359
- </fo:instream-foreign-object>
15360
- </xsl:when>
15361
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
15362
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
15363
- </xsl:when>
15364
- <xsl:otherwise> <!-- bitmap image -->
15365
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
15366
- <xsl:if test="$coverimage_src != ''">
15367
- <xsl:variable name="coverpage">
15368
- <xsl:call-template name="getImageURL">
15369
- <xsl:with-param name="src" select="$coverimage_src"/>
15370
- </xsl:call-template>
15371
- </xsl:variable>
15372
- <!-- <xsl:variable name="coverpage" select="concat('url(file:',$basepath, 'coverpage1.png', ')')"/> --> <!-- for DEBUG -->
15373
- <fo:external-graphic src="{$coverpage}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
15374
- </xsl:if>
15375
- </xsl:otherwise>
15376
- </xsl:choose>
15873
+
15874
+ <xsl:call-template name="insertPageImage"/>
15875
+
15377
15876
  </xsl:for-each>
15378
15877
  </fo:block>
15379
15878
  </fo:block-container>
15380
15879
  </xsl:template>
15381
15880
 
15881
+ <xsl:template name="insertPageImage">
15882
+ <xsl:param name="svg_content_height" select="$pageHeight"/>
15883
+ <xsl:param name="bitmap_width" select="$pageWidth"/>
15884
+ <xsl:choose>
15885
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
15886
+ <fo:instream-foreign-object fox:alt-text="Image Front">
15887
+ <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
15888
+ <xsl:call-template name="getSVG"/>
15889
+ </fo:instream-foreign-object>
15890
+ </xsl:when>
15891
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
15892
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
15893
+ </xsl:when>
15894
+ <xsl:otherwise> <!-- bitmap image -->
15895
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
15896
+ <xsl:if test="$coverimage_src != ''">
15897
+ <xsl:variable name="coverpage">
15898
+ <xsl:call-template name="getImageURL">
15899
+ <xsl:with-param name="src" select="$coverimage_src"/>
15900
+ </xsl:call-template>
15901
+ </xsl:variable>
15902
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
15903
+ </xsl:if>
15904
+ </xsl:otherwise>
15905
+ </xsl:choose>
15906
+ </xsl:template>
15907
+
15382
15908
  <xsl:template name="getImageURL">
15383
15909
  <xsl:param name="src"/>
15384
15910
  <xsl:choose>
@@ -15806,6 +16332,14 @@
15806
16332
  </xsl:attribute>
15807
16333
  </xsl:template>
15808
16334
 
16335
+ <xsl:template name="getCharByCodePoint">
16336
+ <xsl:param name="codepoint"/>
16337
+ <xsl:param name="radix">16</xsl:param>
16338
+ <xsl:variable name="codepointInt" select="java:java.lang.Integer.parseInt($codepoint,$radix)"/>
16339
+ <xsl:variable name="chars" select="java:java.lang.Character.toChars($codepointInt)"/>
16340
+ <xsl:value-of select="java:java.lang.String.new($chars)"/>
16341
+ </xsl:template>
16342
+
15809
16343
  <xsl:template name="substring-after-last">
15810
16344
  <xsl:param name="value"/>
15811
16345
  <xsl:param name="delimiter"/>