metanorma-itu 2.7.3 → 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.
@@ -2384,7 +2384,7 @@
2384
2384
  <xsl:apply-templates select="ancestor::mn:term[1]/mn:fmt-name"/>
2385
2385
  </fo:inline>
2386
2386
  <fo:inline font-weight="bold">
2387
- <xsl:call-template name="setStyle_preferred"/>
2387
+ <xsl:call-template name="refine_preferred-term-style"/>
2388
2388
  <xsl:apply-templates/>
2389
2389
  </fo:inline>
2390
2390
  <xsl:if test="../mn:fmt-termsource">
@@ -4645,12 +4645,18 @@
4645
4645
  <xsl:attribute-set name="license-statement-style">
4646
4646
  </xsl:attribute-set> <!-- license-statement-style -->
4647
4647
 
4648
+ <xsl:template name="refine_license-statement-style">
4649
+ </xsl:template>
4650
+
4648
4651
  <xsl:attribute-set name="license-statement-title-style">
4649
4652
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4650
4653
  <xsl:attribute name="text-align">center</xsl:attribute>
4651
4654
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
4652
4655
  </xsl:attribute-set> <!-- license-statement-title-style -->
4653
4656
 
4657
+ <xsl:template name="refine_license-statement-title-style">
4658
+ </xsl:template>
4659
+
4654
4660
  <xsl:attribute-set name="license-statement-p-style">
4655
4661
  </xsl:attribute-set> <!-- license-statement-p-style -->
4656
4662
 
@@ -4661,25 +4667,49 @@
4661
4667
  <xsl:attribute-set name="legal-statement-style">
4662
4668
  </xsl:attribute-set> <!-- legal-statement-style -->
4663
4669
 
4670
+ <xsl:template name="refine_legal-statement-style">
4671
+ </xsl:template>
4672
+
4664
4673
  <xsl:attribute-set name="legal-statement-title-style">
4665
4674
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4666
4675
  <xsl:attribute name="text-align">center</xsl:attribute>
4667
4676
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
4668
4677
  </xsl:attribute-set> <!-- legal-statement-title-style -->
4669
4678
 
4679
+ <xsl:template name="refine_legal-statement-title-style">
4680
+ </xsl:template>
4681
+
4670
4682
  <xsl:attribute-set name="legal-statement-p-style">
4671
4683
  </xsl:attribute-set> <!-- legal-statement-p-style -->
4672
4684
 
4685
+ <xsl:template name="refine_legal-statement-p-style">
4686
+ <xsl:if test="@align">
4687
+ <xsl:attribute name="text-align">
4688
+ <xsl:value-of select="@align"/>
4689
+ </xsl:attribute>
4690
+ </xsl:if>
4691
+ </xsl:template>
4692
+
4673
4693
  <xsl:attribute-set name="feedback-statement-style">
4674
4694
  </xsl:attribute-set> <!-- feedback-statement-style -->
4675
4695
 
4696
+ <xsl:template name="refine_feedback-statement-style">
4697
+ </xsl:template>
4698
+
4676
4699
  <xsl:attribute-set name="feedback-statement-title-style">
4677
4700
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4678
4701
  </xsl:attribute-set> <!-- feedback-statement-title-style -->
4679
4702
 
4703
+ <xsl:template name="refine_feedback-statement-title-style">
4704
+
4705
+ </xsl:template>
4706
+
4680
4707
  <xsl:attribute-set name="feedback-statement-p-style">
4681
4708
  </xsl:attribute-set> <!-- feedback-statement-p-style -->
4682
4709
 
4710
+ <xsl:template name="refine_feedback-statement-p-style">
4711
+ </xsl:template>
4712
+
4683
4713
  <!-- End boilerplate sections styles -->
4684
4714
 
4685
4715
  <!-- ================================= -->
@@ -4705,6 +4735,7 @@
4705
4735
 
4706
4736
  <xsl:template match="mn:license-statement">
4707
4737
  <fo:block xsl:use-attribute-sets="license-statement-style">
4738
+ <xsl:call-template name="refine_license-statement-style"/>
4708
4739
  <xsl:apply-templates/>
4709
4740
  </fo:block>
4710
4741
  </xsl:template> <!-- license-statement -->
@@ -4714,6 +4745,7 @@
4714
4745
  <xsl:call-template name="getLevel"/>
4715
4746
  </xsl:variable>
4716
4747
  <fo:block role="H{$level}" xsl:use-attribute-sets="license-statement-title-style">
4748
+ <xsl:call-template name="refine_license-statement-title-style"/>
4717
4749
  <xsl:apply-templates/>
4718
4750
  </fo:block>
4719
4751
 
@@ -4727,6 +4759,7 @@
4727
4759
  <xsl:template match="mn:legal-statement">
4728
4760
  <xsl:param name="isLegacy">false</xsl:param>
4729
4761
  <fo:block xsl:use-attribute-sets="legal-statement-style">
4762
+ <xsl:call-template name="refine_legal-statement-style"/>
4730
4763
  <xsl:apply-templates/>
4731
4764
  </fo:block>
4732
4765
  </xsl:template> <!-- legal-statement -->
@@ -4899,6 +4932,27 @@
4899
4932
  <xsl:attribute-set name="sourcecode-container-style">
4900
4933
  </xsl:attribute-set>
4901
4934
 
4935
+ <xsl:template name="refine_sourcecode-container-style">
4936
+ <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
4937
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
4938
+ </xsl:if>
4939
+
4940
+ <xsl:if test="ancestor::mn:example">
4941
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
4942
+ </xsl:if>
4943
+
4944
+ <xsl:copy-of select="@id"/>
4945
+
4946
+ <xsl:if test="parent::mn:note">
4947
+ <xsl:attribute name="margin-left">
4948
+ <xsl:choose>
4949
+ <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
4950
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4951
+ </xsl:choose>
4952
+ </xsl:attribute>
4953
+ </xsl:if>
4954
+ </xsl:template>
4955
+
4902
4956
  <xsl:attribute-set name="sourcecode-style">
4903
4957
  <xsl:attribute name="white-space">pre</xsl:attribute>
4904
4958
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -4919,6 +4973,9 @@
4919
4973
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
4920
4974
  </xsl:attribute-set> <!-- sourcecode-name-style -->
4921
4975
 
4976
+ <xsl:template name="refine_sourcecode-name-style">
4977
+ </xsl:template>
4978
+
4922
4979
  <xsl:template name="add-zero-spaces-equal">
4923
4980
  <xsl:param name="text" select="."/>
4924
4981
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
@@ -5006,24 +5063,8 @@
5006
5063
  <xsl:otherwise>
5007
5064
  <fo:block-container xsl:use-attribute-sets="sourcecode-container-style" role="SKIP">
5008
5065
 
5009
- <xsl:if test="not(ancestor::mn:li) or ancestor::mn:example">
5010
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
5011
- </xsl:if>
5066
+ <xsl:call-template name="refine_sourcecode-container-style"/>
5012
5067
 
5013
- <xsl:if test="ancestor::mn:example">
5014
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
5015
- </xsl:if>
5016
-
5017
- <xsl:copy-of select="@id"/>
5018
-
5019
- <xsl:if test="parent::mn:note">
5020
- <xsl:attribute name="margin-left">
5021
- <xsl:choose>
5022
- <xsl:when test="not(ancestor::mn:table)"><xsl:value-of select="$note-body-indent"/></xsl:when>
5023
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
5024
- </xsl:choose>
5025
- </xsl:attribute>
5026
- </xsl:if>
5027
5068
  <fo:block-container margin-left="0mm" role="SKIP">
5028
5069
 
5029
5070
  <fo:block xsl:use-attribute-sets="sourcecode-style">
@@ -5350,6 +5391,7 @@
5350
5391
  <xsl:template match="mn:sourcecode/mn:fmt-name">
5351
5392
  <xsl:if test="normalize-space() != ''">
5352
5393
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
5394
+ <xsl:call-template name="refine_sourcecode-name-style"/>
5353
5395
  <xsl:apply-templates/>
5354
5396
  </fo:block>
5355
5397
  </xsl:if>
@@ -5397,11 +5439,30 @@
5397
5439
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
5398
5440
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
5399
5441
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
5400
- </xsl:attribute-set>
5442
+ </xsl:attribute-set> <!-- pre-style -->
5443
+
5444
+ <xsl:template name="refine_pre-style">
5445
+ </xsl:template>
5401
5446
 
5402
5447
  <xsl:attribute-set name="tt-style">
5403
5448
  </xsl:attribute-set>
5404
5449
 
5450
+ <xsl:template name="refine_tt-style">
5451
+ <xsl:variable name="_font-size"> <!-- inherit -->
5452
+ </xsl:variable>
5453
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
5454
+ <xsl:if test="$font-size != ''">
5455
+ <xsl:attribute name="font-size">
5456
+ <xsl:choose>
5457
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
5458
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
5459
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
5460
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
5461
+ </xsl:choose>
5462
+ </xsl:attribute>
5463
+ </xsl:if>
5464
+ </xsl:template>
5465
+
5405
5466
  <xsl:variable name="color-added-text">
5406
5467
  <xsl:text>rgb(0, 255, 0)</xsl:text>
5407
5468
  </xsl:variable>
@@ -5414,9 +5475,14 @@
5414
5475
  <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
5415
5476
  </xsl:attribute-set>
5416
5477
 
5478
+ <xsl:template name="refine_add-style">
5479
+ </xsl:template>
5480
+
5417
5481
  <xsl:variable name="add-style">
5418
- <add-style xsl:use-attribute-sets="add-style"/>
5419
- </xsl:variable>
5482
+ <add-style xsl:use-attribute-sets="add-style">
5483
+ <xsl:call-template name="refine_add-style"/>
5484
+ </add-style>
5485
+ </xsl:variable>
5420
5486
  <xsl:template name="append_add-style">
5421
5487
  <xsl:copy-of select="xalan:nodeset($add-style)/add-style/@*"/>
5422
5488
  </xsl:template>
@@ -5429,27 +5495,80 @@
5429
5495
  <xsl:attribute name="text-decoration">line-through</xsl:attribute>
5430
5496
  </xsl:attribute-set>
5431
5497
 
5432
- <xsl:template match="mn:br">
5433
- <xsl:value-of select="$linebreak"/>
5498
+ <xsl:template name="refine_del-style">
5434
5499
  </xsl:template>
5435
5500
 
5436
- <xsl:template match="mn:em">
5437
- <fo:inline font-style="italic">
5438
- <xsl:call-template name="refine_italic_style"/>
5439
- <xsl:apply-templates/>
5440
- </fo:inline>
5441
- </xsl:template>
5501
+ <xsl:attribute-set name="strong-style">
5502
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
5503
+ </xsl:attribute-set>
5504
+
5505
+ <xsl:template name="refine_strong_style">
5506
+ <xsl:if test="ancestor::*['preferred']">
5507
+ <xsl:attribute name="role">SKIP</xsl:attribute>
5508
+ </xsl:if>
5509
+ </xsl:template> <!-- refine_strong_style -->
5510
+
5511
+ <xsl:attribute-set name="em-style">
5512
+ <xsl:attribute name="font-style">italic</xsl:attribute>
5513
+ </xsl:attribute-set>
5442
5514
 
5443
- <xsl:template name="refine_italic_style">
5515
+ <xsl:template name="refine_em_style">
5444
5516
  <xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
5445
5517
  <xsl:attribute name="font-style">normal</xsl:attribute>
5446
5518
  </xsl:if>
5519
+ </xsl:template> <!-- refine_em_style -->
5520
+
5521
+ <xsl:attribute-set name="sup-style">
5522
+ <xsl:attribute name="font-size">80%</xsl:attribute>
5523
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
5524
+ </xsl:attribute-set>
5525
+
5526
+ <xsl:template name="refine_sup-style">
5527
+ </xsl:template>
5528
+
5529
+ <xsl:attribute-set name="sub-style">
5530
+ <xsl:attribute name="font-size">80%</xsl:attribute>
5531
+ <xsl:attribute name="vertical-align">sub</xsl:attribute>
5532
+ </xsl:attribute-set>
5533
+
5534
+ <xsl:template name="refine_sub-style">
5535
+ </xsl:template>
5536
+
5537
+ <xsl:attribute-set name="underline-style">
5538
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
5539
+ </xsl:attribute-set>
5540
+
5541
+ <xsl:template name="refine_underline-style">
5542
+ </xsl:template>
5543
+
5544
+ <xsl:attribute-set name="hi-style">
5545
+ <xsl:attribute name="background-color">yellow</xsl:attribute>
5546
+ </xsl:attribute-set>
5547
+
5548
+ <xsl:template name="refine_hi-style">
5549
+ </xsl:template>
5550
+
5551
+ <xsl:attribute-set name="strike-style">
5552
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
5553
+ </xsl:attribute-set>
5554
+
5555
+ <xsl:template name="refine_strike-style">
5556
+ </xsl:template>
5557
+
5558
+ <xsl:template match="mn:br">
5559
+ <xsl:value-of select="$linebreak"/>
5560
+ </xsl:template>
5561
+
5562
+ <xsl:template match="mn:em">
5563
+ <fo:inline xsl:use-attribute-sets="em-style">
5564
+ <xsl:call-template name="refine_em_style"/>
5565
+ <xsl:apply-templates/>
5566
+ </fo:inline>
5447
5567
  </xsl:template>
5448
5568
 
5449
5569
  <xsl:template match="mn:strong | *[local-name()='b']">
5450
5570
  <xsl:param name="split_keep-within-line"/>
5451
- <fo:inline font-weight="bold">
5452
-
5571
+ <fo:inline xsl:use-attribute-sets="strong-style">
5453
5572
  <xsl:call-template name="refine_strong_style"/>
5454
5573
 
5455
5574
  <xsl:apply-templates>
@@ -5458,44 +5577,27 @@
5458
5577
  </fo:inline>
5459
5578
  </xsl:template>
5460
5579
 
5461
- <xsl:template name="refine_strong_style">
5462
- <xsl:if test="ancestor::*['preferred']">
5463
- <xsl:attribute name="role">SKIP</xsl:attribute>
5464
- </xsl:if>
5465
- </xsl:template>
5466
-
5467
5580
  <xsl:template match="*[local-name()='padding']">
5468
5581
  <fo:inline padding-right="{@value}"> </fo:inline>
5469
5582
  </xsl:template>
5470
5583
 
5471
5584
  <xsl:template match="mn:sup">
5472
- <fo:inline font-size="80%" vertical-align="super">
5585
+ <fo:inline xsl:use-attribute-sets="sup-style">
5586
+ <xsl:call-template name="refine_sup-style"/>
5473
5587
  <xsl:apply-templates/>
5474
5588
  </fo:inline>
5475
5589
  </xsl:template>
5476
5590
 
5477
5591
  <xsl:template match="mn:sub">
5478
- <fo:inline font-size="80%" vertical-align="sub">
5592
+ <fo:inline xsl:use-attribute-sets="sub-style">
5593
+ <xsl:call-template name="refine_sub-style"/>
5479
5594
  <xsl:apply-templates/>
5480
5595
  </fo:inline>
5481
5596
  </xsl:template>
5482
5597
 
5483
5598
  <xsl:template match="mn:tt">
5484
5599
  <fo:inline xsl:use-attribute-sets="tt-style">
5485
-
5486
- <xsl:variable name="_font-size"> <!-- inherit -->
5487
- </xsl:variable>
5488
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
5489
- <xsl:if test="$font-size != ''">
5490
- <xsl:attribute name="font-size">
5491
- <xsl:choose>
5492
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
5493
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
5494
- <xsl:when test="ancestor::mn:note or ancestor::mn:example"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
5495
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
5496
- </xsl:choose>
5497
- </xsl:attribute>
5498
- </xsl:if>
5600
+ <xsl:call-template name="refine_tt-style"/>
5499
5601
  <xsl:apply-templates/>
5500
5602
  </fo:inline>
5501
5603
  </xsl:template> <!-- tt -->
@@ -5514,7 +5616,8 @@
5514
5616
  </xsl:template>
5515
5617
 
5516
5618
  <xsl:template match="mn:underline">
5517
- <fo:inline text-decoration="underline">
5619
+ <fo:inline xsl:use-attribute-sets="underline-style">
5620
+ <xsl:call-template name="refine_underline-style"/>
5518
5621
  <xsl:apply-templates/>
5519
5622
  </fo:inline>
5520
5623
  </xsl:template>
@@ -5672,6 +5775,7 @@
5672
5775
 
5673
5776
  <xsl:template match="mn:del">
5674
5777
  <fo:inline xsl:use-attribute-sets="del-style">
5778
+ <xsl:call-template name="refine_del-style"/>
5675
5779
  <xsl:apply-templates/>
5676
5780
  </fo:inline>
5677
5781
  </xsl:template>
@@ -5681,7 +5785,8 @@
5681
5785
 
5682
5786
  <!-- highlight text -->
5683
5787
  <xsl:template match="mn:hi | mn:span[@class = 'fmt-hi']" priority="3">
5684
- <fo:inline background-color="yellow">
5788
+ <fo:inline xsl:use-attribute-sets="hi-style">
5789
+ <xsl:call-template name="refine_hi-style"/>
5685
5790
  <xsl:apply-templates/>
5686
5791
  </fo:inline>
5687
5792
  </xsl:template>
@@ -5767,7 +5872,8 @@
5767
5872
  </xsl:template>
5768
5873
 
5769
5874
  <xsl:template match="mn:strike">
5770
- <fo:inline text-decoration="line-through">
5875
+ <fo:inline xsl:use-attribute-sets="strike-style">
5876
+ <xsl:call-template name="refine_strike-style"/>
5771
5877
  <xsl:apply-templates/>
5772
5878
  </fo:inline>
5773
5879
  </xsl:template>
@@ -5847,6 +5953,7 @@
5847
5953
 
5848
5954
  <xsl:template match="mn:pre" name="pre">
5849
5955
  <fo:block xsl:use-attribute-sets="pre-style">
5956
+ <xsl:call-template name="refine_pre-style"/>
5850
5957
  <xsl:copy-of select="@id"/>
5851
5958
  <xsl:choose>
5852
5959
 
@@ -5877,22 +5984,40 @@
5877
5984
  <xsl:attribute-set name="permission-style">
5878
5985
  </xsl:attribute-set>
5879
5986
 
5987
+ <xsl:template name="refine_permission-style">
5988
+ </xsl:template>
5989
+
5880
5990
  <xsl:attribute-set name="permission-name-style">
5881
5991
  </xsl:attribute-set>
5882
5992
 
5993
+ <xsl:template name="refine_permission-name-style">
5994
+ </xsl:template>
5995
+
5883
5996
  <xsl:attribute-set name="permission-label-style">
5884
5997
  </xsl:attribute-set>
5885
5998
 
5999
+ <xsl:template name="refine_permission-label-style">
6000
+ </xsl:template>
6001
+
5886
6002
  <xsl:attribute-set name="requirement-style">
5887
6003
  </xsl:attribute-set>
5888
6004
 
6005
+ <xsl:template name="refine_requirement-style">
6006
+ </xsl:template>
6007
+
5889
6008
  <xsl:attribute-set name="requirement-name-style">
5890
6009
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
5891
6010
  </xsl:attribute-set>
5892
6011
 
6012
+ <xsl:template name="refine_requirement-name-style">
6013
+ </xsl:template>
6014
+
5893
6015
  <xsl:attribute-set name="requirement-label-style">
5894
6016
  </xsl:attribute-set>
5895
6017
 
6018
+ <xsl:template name="refine_requirement-label-style">
6019
+ </xsl:template>
6020
+
5896
6021
  <xsl:attribute-set name="subject-style">
5897
6022
  </xsl:attribute-set>
5898
6023
 
@@ -5920,18 +6045,28 @@
5920
6045
  <xsl:attribute-set name="recommendation-style">
5921
6046
  </xsl:attribute-set>
5922
6047
 
6048
+ <xsl:template name="refine_recommendation-style">
6049
+ </xsl:template>
6050
+
5923
6051
  <xsl:attribute-set name="recommendation-name-style">
5924
6052
  </xsl:attribute-set>
5925
6053
 
6054
+ <xsl:template name="refine_recommendation-name-style">
6055
+ </xsl:template>
6056
+
5926
6057
  <xsl:attribute-set name="recommendation-label-style">
5927
6058
  </xsl:attribute-set>
5928
6059
 
6060
+ <xsl:template name="refine_recommendation-label-style">
6061
+ </xsl:template>
6062
+
5929
6063
  <!-- ========== -->
5930
6064
  <!-- permission -->
5931
6065
  <!-- ========== -->
5932
6066
  <xsl:template match="mn:permission">
5933
6067
  <xsl:call-template name="setNamedDestination"/>
5934
6068
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
6069
+ <xsl:call-template name="refine_permission-style"/>
5935
6070
  <xsl:apply-templates select="mn:fmt-name"/>
5936
6071
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
5937
6072
  </fo:block>
@@ -5940,6 +6075,7 @@
5940
6075
  <xsl:template match="mn:permission/mn:fmt-name">
5941
6076
  <xsl:if test="normalize-space() != ''">
5942
6077
  <fo:block xsl:use-attribute-sets="permission-name-style">
6078
+ <xsl:call-template name="refine_permission-name-style"/>
5943
6079
  <xsl:apply-templates/>
5944
6080
  </fo:block>
5945
6081
  </xsl:if>
@@ -5947,6 +6083,7 @@
5947
6083
 
5948
6084
  <xsl:template match="mn:permission/mn:label">
5949
6085
  <fo:block xsl:use-attribute-sets="permission-label-style">
6086
+ <xsl:call-template name="refine_permission-label-style"/>
5950
6087
  <xsl:apply-templates/>
5951
6088
  </fo:block>
5952
6089
  </xsl:template>
@@ -5959,6 +6096,7 @@
5959
6096
  <xsl:template match="mn:requirement">
5960
6097
  <xsl:call-template name="setNamedDestination"/>
5961
6098
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
6099
+ <xsl:call-template name="refine_requirement-style"/>
5962
6100
  <xsl:apply-templates select="mn:fmt-name"/>
5963
6101
  <xsl:apply-templates select="mn:label"/>
5964
6102
  <xsl:apply-templates select="@obligation"/>
@@ -5971,6 +6109,7 @@
5971
6109
  <xsl:if test="normalize-space() != ''">
5972
6110
 
5973
6111
  <fo:block xsl:use-attribute-sets="requirement-name-style">
6112
+ <xsl:call-template name="refine_requirement-name-style"/>
5974
6113
  <xsl:apply-templates/>
5975
6114
  </fo:block>
5976
6115
  </xsl:if>
@@ -5978,6 +6117,7 @@
5978
6117
 
5979
6118
  <xsl:template match="mn:requirement/mn:label">
5980
6119
  <fo:block xsl:use-attribute-sets="requirement-label-style">
6120
+ <xsl:call-template name="refine_requirement-label-style"/>
5981
6121
  <xsl:apply-templates/>
5982
6122
  </fo:block>
5983
6123
  </xsl:template>
@@ -6003,6 +6143,7 @@
6003
6143
  <xsl:template match="mn:recommendation">
6004
6144
  <xsl:call-template name="setNamedDestination"/>
6005
6145
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
6146
+ <xsl:call-template name="refine_recommendation-style"/>
6006
6147
  <xsl:apply-templates select="mn:fmt-name"/>
6007
6148
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
6008
6149
  </fo:block>
@@ -6012,6 +6153,7 @@
6012
6153
  <xsl:if test="normalize-space() != ''">
6013
6154
 
6014
6155
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
6156
+ <xsl:call-template name="refine_recommendation-name-style"/>
6015
6157
  <xsl:apply-templates/>
6016
6158
  </fo:block>
6017
6159
  </xsl:if>
@@ -6019,6 +6161,7 @@
6019
6161
 
6020
6162
  <xsl:template match="mn:recommendation/mn:label">
6021
6163
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
6164
+ <xsl:call-template name="refine_recommendation-label-style"/>
6022
6165
  <xsl:apply-templates/>
6023
6166
  </fo:block>
6024
6167
  </xsl:template>
@@ -6199,34 +6342,64 @@
6199
6342
  <xsl:attribute-set name="term-style">
6200
6343
  </xsl:attribute-set> <!-- term-style -->
6201
6344
 
6345
+ <xsl:template name="refine_term-style">
6346
+ </xsl:template>
6347
+
6202
6348
  <xsl:attribute-set name="term-name-style">
6203
6349
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
6204
6350
  <xsl:attribute name="font-weight">bold</xsl:attribute>
6205
6351
  </xsl:attribute-set> <!-- term-name-style -->
6206
6352
 
6207
- <xsl:attribute-set name="preferred-block-style">
6353
+ <xsl:template name="refine_term-name-style">
6354
+ </xsl:template>
6355
+
6356
+ <xsl:attribute-set name="preferred-block-style">
6208
6357
  </xsl:attribute-set> <!-- preferred-block-style -->
6209
6358
 
6359
+ <xsl:template name="refine_preferred-block-style">
6360
+ </xsl:template>
6361
+
6210
6362
  <xsl:attribute-set name="preferred-term-style">
6211
6363
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
6212
6364
  <xsl:attribute name="font-weight">bold</xsl:attribute>
6213
6365
  </xsl:attribute-set> <!-- preferred-term-style -->
6214
6366
 
6367
+ <xsl:template name="refine_preferred-term-style">
6368
+ <xsl:if test="mn:strong">
6369
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
6370
+ </xsl:if>
6371
+ </xsl:template>
6372
+
6215
6373
  <xsl:attribute-set name="domain-style">
6216
6374
  </xsl:attribute-set> <!-- domain-style -->
6217
6375
 
6376
+ <xsl:template name="refine_domain-style">
6377
+ </xsl:template>
6378
+
6218
6379
  <xsl:attribute-set name="admitted-style">
6219
6380
  </xsl:attribute-set> <!-- admitted-style -->
6220
6381
 
6382
+ <xsl:template name="refine_admitted-style">
6383
+ </xsl:template>
6384
+
6221
6385
  <xsl:attribute-set name="deprecates-style">
6222
6386
  </xsl:attribute-set> <!-- deprecates-style -->
6223
6387
 
6388
+ <xsl:template name="refine_deprecates-style">
6389
+ </xsl:template>
6390
+
6224
6391
  <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
6225
6392
  </xsl:attribute-set>
6226
6393
 
6394
+ <xsl:template name="refine_related-block-style">
6395
+ </xsl:template>
6396
+
6227
6397
  <xsl:attribute-set name="definition-style">
6228
6398
  </xsl:attribute-set> <!-- definition-style -->
6229
6399
 
6400
+ <xsl:template name="refine_definition-style">
6401
+ </xsl:template>
6402
+
6230
6403
  <xsl:attribute-set name="termsource-style">
6231
6404
  </xsl:attribute-set> <!-- termsource-style -->
6232
6405
 
@@ -6236,9 +6409,15 @@
6236
6409
  <xsl:attribute-set name="termsource-text-style">
6237
6410
  </xsl:attribute-set> <!-- termsource-text-style -->
6238
6411
 
6412
+ <xsl:template name="refine_termsource-text-style">
6413
+ </xsl:template>
6414
+
6239
6415
  <xsl:attribute-set name="origin-style">
6240
6416
  </xsl:attribute-set> <!-- origin-style -->
6241
6417
 
6418
+ <xsl:template name="refine_origin-style">
6419
+ </xsl:template>
6420
+
6242
6421
  <!-- ====== -->
6243
6422
  <!-- term -->
6244
6423
  <!-- ====== -->
@@ -6254,9 +6433,8 @@
6254
6433
  <xsl:template match="mn:term">
6255
6434
  <xsl:call-template name="setNamedDestination"/>
6256
6435
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
6436
+ <xsl:call-template name="refine_term-style"/>
6257
6437
 
6258
- <xsl:if test="parent::mn:term and not(preceding-sibling::mn:term)">
6259
- </xsl:if>
6260
6438
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
6261
6439
  </fo:block>
6262
6440
  </xsl:template>
@@ -6332,6 +6510,7 @@
6332
6510
  <!-- text SOURCE: -->
6333
6511
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
6334
6512
  <fo:inline xsl:use-attribute-sets="termsource-text-style">
6513
+ <xsl:call-template name="refine_termsource-text-style"/>
6335
6514
  <xsl:value-of select="."/>
6336
6515
  </fo:inline>
6337
6516
  </xsl:template>
@@ -6344,6 +6523,7 @@
6344
6523
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
6345
6524
  </xsl:if>
6346
6525
  <fo:inline xsl:use-attribute-sets="origin-style">
6526
+ <xsl:call-template name="refine_origin-style"/>
6347
6527
  <xsl:apply-templates/>
6348
6528
  </fo:inline>
6349
6529
  </fo:basic-link>
@@ -6393,9 +6573,12 @@
6393
6573
  </xsl:variable>
6394
6574
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
6395
6575
 
6576
+ <xsl:call-template name="refine_preferred-block-style"/>
6577
+
6396
6578
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
6397
6579
 
6398
6580
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
6581
+ <xsl:call-template name="refine_term-name-style"/>
6399
6582
 
6400
6583
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
6401
6584
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -6406,7 +6589,7 @@
6406
6589
  </xsl:if>
6407
6590
 
6408
6591
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
6409
- <xsl:call-template name="setStyle_preferred"/>
6592
+ <xsl:call-template name="refine_preferred-term-style"/>
6410
6593
 
6411
6594
  <xsl:apply-templates/>
6412
6595
  </fo:block>
@@ -6427,22 +6610,18 @@
6427
6610
 
6428
6611
  <xsl:template match="mn:fmt-admitted">
6429
6612
  <fo:block xsl:use-attribute-sets="admitted-style">
6613
+ <xsl:call-template name="refine_admitted-style"/>
6430
6614
  <xsl:apply-templates/>
6431
6615
  </fo:block>
6432
6616
  </xsl:template>
6433
6617
 
6434
6618
  <xsl:template match="mn:fmt-deprecates">
6435
6619
  <fo:block xsl:use-attribute-sets="deprecates-style">
6620
+ <xsl:call-template name="refine_deprecates-style"/>
6436
6621
  <xsl:apply-templates/>
6437
6622
  </fo:block>
6438
6623
  </xsl:template>
6439
6624
 
6440
- <xsl:template name="setStyle_preferred">
6441
- <xsl:if test="mn:strong">
6442
- <xsl:attribute name="font-weight">normal</xsl:attribute>
6443
- </xsl:if>
6444
- </xsl:template>
6445
-
6446
6625
  <!-- regarding ISO 10241-1:2011, If there is more than one preferred term, each preferred term follows the previous one on a new line. -->
6447
6626
  <!-- in metanorma xml preferred terms delimited by semicolons -->
6448
6627
  <xsl:template match="mn:fmt-preferred/text()[contains(., ';')] | mn:fmt-preferred/mn:strong/text()[contains(., ';')]">
@@ -6452,6 +6631,7 @@
6452
6631
 
6453
6632
  <xsl:template match="mn:fmt-related">
6454
6633
  <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
6634
+ <xsl:call-template name="refine_related-block-style"/>
6455
6635
  <xsl:apply-templates/>
6456
6636
  </fo:block>
6457
6637
  </xsl:template>
@@ -6466,6 +6646,7 @@
6466
6646
  <!-- ========== -->
6467
6647
  <xsl:template match="mn:fmt-definition">
6468
6648
  <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
6649
+ <xsl:call-template name="refine_definition-style"/>
6469
6650
  <xsl:apply-templates/>
6470
6651
  </fo:block>
6471
6652
  </xsl:template>
@@ -6511,6 +6692,9 @@
6511
6692
  <xsl:attribute-set name="example-body-style">
6512
6693
  </xsl:attribute-set> <!-- example-body-style -->
6513
6694
 
6695
+ <xsl:template name="refine_example-body-style">
6696
+ </xsl:template>
6697
+
6514
6698
  <xsl:attribute-set name="example-name-style">
6515
6699
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
6516
6700
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6560,6 +6744,8 @@
6560
6744
  <xsl:when test="contains($element, 'block')">
6561
6745
  <fo:block xsl:use-attribute-sets="example-p-style">
6562
6746
 
6747
+ <xsl:call-template name="refine_example-p-style"/>
6748
+
6563
6749
  <xsl:apply-templates/>
6564
6750
  </fo:block>
6565
6751
  </xsl:when>
@@ -6611,6 +6797,7 @@
6611
6797
  </fo:block>
6612
6798
 
6613
6799
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
6800
+ <xsl:call-template name="refine_example-body-style"/>
6614
6801
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6615
6802
  <xsl:variable name="example_body">
6616
6803
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]">
@@ -6673,6 +6860,7 @@
6673
6860
  <xsl:if test="*[not(self::mn:fmt-name)][position() &gt; 1]">
6674
6861
  <!-- display further elements in blocks -->
6675
6862
  <fo:block-container xsl:use-attribute-sets="example-body-style" role="SKIP">
6863
+ <xsl:call-template name="refine_example-body-style"/>
6676
6864
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6677
6865
  <xsl:apply-templates select="*[not(self::mn:fmt-name)][position() &gt; 1]">
6678
6866
  <xsl:with-param name="fo_element" select="'block'"/>
@@ -6944,6 +7132,9 @@
6944
7132
  <!-- <xsl:attribute name="padding-right">3mm</xsl:attribute> -->
6945
7133
  </xsl:attribute-set> <!-- table-fn-number-style -->
6946
7134
 
7135
+ <xsl:template name="refine_table-fn-number-style">
7136
+ </xsl:template>
7137
+
6947
7138
  <xsl:attribute-set name="table-fmt-fn-label-style">
6948
7139
  <xsl:attribute name="font-size">80%</xsl:attribute>
6949
7140
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -6953,30 +7144,12 @@
6953
7144
  <xsl:template name="refine_table-fmt-fn-label-style">
6954
7145
  </xsl:template>
6955
7146
 
6956
- <xsl:attribute-set name="fn-container-body-style">
6957
- <xsl:attribute name="text-indent">0</xsl:attribute>
6958
- <xsl:attribute name="start-indent">0</xsl:attribute>
6959
- </xsl:attribute-set>
6960
-
6961
7147
  <xsl:attribute-set name="table-fn-body-style">
6962
7148
  </xsl:attribute-set>
6963
7149
 
6964
- <xsl:attribute-set name="figure-fn-number-style">
6965
- <xsl:attribute name="padding-right">5mm</xsl:attribute>
6966
- </xsl:attribute-set> <!-- figure-fn-number-style -->
6967
-
6968
- <xsl:attribute-set name="figure-fmt-fn-label-style">
6969
- <xsl:attribute name="font-size">80%</xsl:attribute>
6970
- <xsl:attribute name="vertical-align">super</xsl:attribute>
6971
- </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
6972
-
6973
- <xsl:template name="refine_figure-fmt-fn-label-style">
7150
+ <xsl:template name="refine_table-fn-body-style">
6974
7151
  </xsl:template>
6975
7152
 
6976
- <xsl:attribute-set name="figure-fn-body-style">
6977
- <xsl:attribute name="text-align">justify</xsl:attribute>
6978
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
6979
- </xsl:attribute-set>
6980
7153
  <!-- ========================== -->
6981
7154
  <!-- END Table styles -->
6982
7155
  <!-- ========================== -->
@@ -8272,6 +8445,7 @@
8272
8445
  </xsl:apply-templates>
8273
8446
 
8274
8447
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
8448
+ <xsl:call-template name="refine_table-fn-body-style"/>
8275
8449
  <!-- <xsl:copy-of select="./node()"/> -->
8276
8450
  <xsl:apply-templates/>
8277
8451
  </fo:inline>
@@ -8290,6 +8464,7 @@
8290
8464
  <xsl:param name="process">false</xsl:param>
8291
8465
  <xsl:if test="$process = 'true'">
8292
8466
  <fo:inline xsl:use-attribute-sets="table-fn-number-style" role="SKIP">
8467
+ <xsl:call-template name="refine_table-fn-number-style"/>
8293
8468
 
8294
8469
  <!-- tab is padding-right -->
8295
8470
  <xsl:apply-templates select=".//mn:tab">
@@ -9162,9 +9337,18 @@
9162
9337
  <xsl:attribute-set name="dl-block-style">
9163
9338
  </xsl:attribute-set>
9164
9339
 
9340
+ <xsl:template name="refine_dl-block-style">
9341
+ <xsl:if test="@key = 'true' and ancestor::mn:figure">
9342
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
9343
+ </xsl:if>
9344
+ </xsl:template>
9345
+
9165
9346
  <xsl:attribute-set name="dt-row-style">
9166
9347
  </xsl:attribute-set>
9167
9348
 
9349
+ <xsl:template name="refine_dt-row-style">
9350
+ </xsl:template>
9351
+
9168
9352
  <xsl:attribute-set name="dt-cell-style">
9169
9353
  </xsl:attribute-set>
9170
9354
 
@@ -9191,6 +9375,9 @@
9191
9375
  <xsl:attribute name="font-weight">bold</xsl:attribute>
9192
9376
  </xsl:attribute-set> <!-- dl-name-style -->
9193
9377
 
9378
+ <xsl:template name="refine_dl-name-style">
9379
+ </xsl:template>
9380
+
9194
9381
  <xsl:attribute-set name="dd-cell-style">
9195
9382
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
9196
9383
  </xsl:attribute-set>
@@ -9262,9 +9449,7 @@
9262
9449
  <!-- <dl><xsl:copy-of select="."/></dl> -->
9263
9450
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
9264
9451
 
9265
- <xsl:if test="@key = 'true' and ancestor::mn:figure">
9266
- <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
9267
- </xsl:if>
9452
+ <xsl:call-template name="refine_dl-block-style"/>
9268
9453
 
9269
9454
  <xsl:call-template name="setBlockSpanAll"/>
9270
9455
  <xsl:if test="not(ancestor::mn:quote)">
@@ -9564,6 +9749,8 @@
9564
9749
  <xsl:if test="$process = 'true'">
9565
9750
  <fo:block xsl:use-attribute-sets="dl-name-style">
9566
9751
 
9752
+ <xsl:call-template name="refine_dl-name-style"/>
9753
+
9567
9754
  <xsl:apply-templates/>
9568
9755
  </fo:block>
9569
9756
  </xsl:if>
@@ -9752,6 +9939,8 @@
9752
9939
  <xsl:param name="split_keep-within-line"/>
9753
9940
 
9754
9941
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
9942
+ <xsl:call-template name="refine_dt-row-style"/>
9943
+
9755
9944
  <xsl:call-template name="insert_dt_cell">
9756
9945
  <xsl:with-param name="key_iso" select="$key_iso"/>
9757
9946
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -9962,15 +10151,22 @@
9962
10151
  <xsl:attribute-set name="appendix-style">
9963
10152
  </xsl:attribute-set>
9964
10153
 
10154
+ <xsl:template name="refine_appendix-style">
10155
+ </xsl:template>
10156
+
9965
10157
  <xsl:attribute-set name="appendix-example-style">
9966
10158
  </xsl:attribute-set>
9967
10159
 
10160
+ <xsl:template name="refine_appendix-example-style">
10161
+ </xsl:template>
10162
+
9968
10163
  <!-- ======================== -->
9969
10164
  <!-- Appendix processing -->
9970
10165
  <!-- ======================== -->
9971
10166
  <xsl:template match="mn:appendix">
9972
10167
  <xsl:call-template name="setNamedDestination"/>
9973
10168
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
10169
+ <xsl:call-template name="refine_appendix-style"/>
9974
10170
  <xsl:apply-templates select="mn:fmt-title"/>
9975
10171
  </fo:block>
9976
10172
  <xsl:apply-templates select="node()[not(self::mn:fmt-title)]"/>
@@ -9989,6 +10185,7 @@
9989
10185
  <xsl:template match="mn:appendix//mn:example" priority="2">
9990
10186
  <xsl:call-template name="setNamedDestination"/>
9991
10187
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
10188
+ <xsl:call-template name="refine_appendix-example-style"/>
9992
10189
  <xsl:apply-templates select="mn:fmt-name"/>
9993
10190
  </fo:block>
9994
10191
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
@@ -9997,7 +10194,16 @@
9997
10194
  <xsl:attribute-set name="xref-style">
9998
10195
  <xsl:attribute name="color">blue</xsl:attribute>
9999
10196
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
10000
- </xsl:attribute-set>
10197
+ </xsl:attribute-set> <!-- xref-style -->
10198
+
10199
+ <xsl:template name="refine_xref-style">
10200
+ <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])">
10201
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
10202
+ </xsl:if>
10203
+ <xsl:if test="parent::mn:add">
10204
+ <xsl:call-template name="append_add-style"/>
10205
+ </xsl:if>
10206
+ </xsl:template> <!-- refine_xref-style -->
10001
10207
 
10002
10208
  <xsl:template match="mn:fmt-xref">
10003
10209
  <xsl:call-template name="insert_basic_link">
@@ -10006,12 +10212,8 @@
10006
10212
  <xsl:call-template name="getAltText"/>
10007
10213
  </xsl:variable>
10008
10214
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
10009
- <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])">
10010
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
10011
- </xsl:if>
10012
- <xsl:if test="parent::mn:add">
10013
- <xsl:call-template name="append_add-style"/>
10014
- </xsl:if>
10215
+ <xsl:call-template name="refine_xref-style"/>
10216
+
10015
10217
  <xsl:apply-templates/>
10016
10218
  </fo:basic-link>
10017
10219
  </xsl:with-param>
@@ -10123,16 +10325,16 @@
10123
10325
  <xsl:attribute name="font-size">11pt</xsl:attribute>
10124
10326
  <xsl:attribute name="space-before">4pt</xsl:attribute>
10125
10327
  <xsl:attribute name="text-align">justify</xsl:attribute>
10126
- </xsl:attribute-set>
10328
+ </xsl:attribute-set> <!-- note-style -->
10127
10329
 
10128
10330
  <xsl:template name="refine_note-style">
10129
- </xsl:template>
10331
+ </xsl:template> <!-- refine_note-style -->
10130
10332
 
10131
10333
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
10132
10334
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
10133
10335
 
10134
10336
  <xsl:attribute-set name="note-name-style">
10135
- </xsl:attribute-set>
10337
+ </xsl:attribute-set> <!-- note-name-style -->
10136
10338
 
10137
10339
  <xsl:template name="refine_note-name-style">
10138
10340
  </xsl:template> <!-- refine_note-name-style -->
@@ -10146,17 +10348,20 @@
10146
10348
 
10147
10349
  <xsl:attribute-set name="note-p-style">
10148
10350
  <xsl:attribute name="space-before">4pt</xsl:attribute>
10149
- </xsl:attribute-set>
10351
+ </xsl:attribute-set> <!-- note-p-style -->
10352
+
10353
+ <xsl:template name="refine_note-p-style">
10354
+ </xsl:template>
10150
10355
 
10151
10356
  <xsl:attribute-set name="termnote-style">
10152
10357
  <xsl:attribute name="margin-top">4pt</xsl:attribute>
10153
- </xsl:attribute-set>
10358
+ </xsl:attribute-set> <!-- termnote-style -->
10154
10359
 
10155
10360
  <xsl:template name="refine_termnote-style">
10156
10361
  </xsl:template> <!-- refine_termnote-style -->
10157
10362
 
10158
10363
  <xsl:attribute-set name="termnote-name-style">
10159
- </xsl:attribute-set>
10364
+ </xsl:attribute-set> <!-- termnote-name-style -->
10160
10365
 
10161
10366
  <xsl:template name="refine_termnote-name-style">
10162
10367
  </xsl:template>
@@ -10164,6 +10369,9 @@
10164
10369
  <xsl:attribute-set name="termnote-p-style">
10165
10370
  </xsl:attribute-set>
10166
10371
 
10372
+ <xsl:template name="refine_termnote-p-style">
10373
+ </xsl:template>
10374
+
10167
10375
  <!-- ====== -->
10168
10376
  <!-- note -->
10169
10377
  <!-- termnote -->
@@ -10227,11 +10435,13 @@
10227
10435
  <xsl:choose>
10228
10436
  <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
10229
10437
  <fo:inline xsl:use-attribute-sets="note-p-style" role="SKIP">
10438
+ <xsl:call-template name="refine_note-p-style"/>
10230
10439
  <xsl:apply-templates/>
10231
10440
  </fo:inline>
10232
10441
  </xsl:when>
10233
10442
  <xsl:otherwise>
10234
10443
  <fo:block xsl:use-attribute-sets="note-p-style" role="SKIP">
10444
+ <xsl:call-template name="refine_note-p-style"/>
10235
10445
  <xsl:apply-templates/>
10236
10446
  </fo:block>
10237
10447
  </xsl:otherwise>
@@ -10323,11 +10533,13 @@
10323
10533
  <xsl:choose>
10324
10534
  <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
10325
10535
  <fo:inline xsl:use-attribute-sets="termnote-p-style">
10536
+ <xsl:call-template name="refine_termnote-p-style"/>
10326
10537
  <xsl:apply-templates/>
10327
10538
  </fo:inline>
10328
10539
  </xsl:when>
10329
10540
  <xsl:otherwise>
10330
10541
  <fo:block xsl:use-attribute-sets="termnote-p-style">
10542
+ <xsl:call-template name="refine_termnote-p-style"/>
10331
10543
  <xsl:apply-templates/>
10332
10544
  </fo:block>
10333
10545
  </xsl:otherwise>
@@ -10341,7 +10553,7 @@
10341
10553
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
10342
10554
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
10343
10555
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
10344
- </xsl:attribute-set>
10556
+ </xsl:attribute-set> <!-- quote-style -->
10345
10557
 
10346
10558
  <xsl:template name="refine_quote-style">
10347
10559
  </xsl:template>
@@ -10350,6 +10562,9 @@
10350
10562
  <xsl:attribute name="text-align">right</xsl:attribute>
10351
10563
  </xsl:attribute-set>
10352
10564
 
10565
+ <xsl:template name="refine_quote-source-style">
10566
+ </xsl:template>
10567
+
10353
10568
  <!-- ====== -->
10354
10569
  <!-- quote -->
10355
10570
  <!-- source -->
@@ -10378,6 +10593,7 @@
10378
10593
  </fo:block-container>
10379
10594
  <xsl:if test="mn:author or mn:fmt-source or mn:attribution">
10380
10595
  <fo:block xsl:use-attribute-sets="quote-source-style">
10596
+ <xsl:call-template name="refine_quote-source-style"/>
10381
10597
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
10382
10598
  <xsl:apply-templates select="mn:author"/>
10383
10599
  <xsl:apply-templates select="mn:fmt-source"/>
@@ -10440,6 +10656,9 @@
10440
10656
  <xsl:attribute-set name="figure-style">
10441
10657
  </xsl:attribute-set>
10442
10658
 
10659
+ <xsl:template name="refine_figure-style">
10660
+ </xsl:template>
10661
+
10443
10662
  <xsl:attribute-set name="figure-name-style">
10444
10663
  <xsl:attribute name="role">Caption</xsl:attribute>
10445
10664
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -10447,7 +10666,7 @@
10447
10666
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
10448
10667
  <xsl:attribute name="space-after">6pt</xsl:attribute>
10449
10668
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
10450
- </xsl:attribute-set>
10669
+ </xsl:attribute-set> <!-- figure-name-style -->
10451
10670
 
10452
10671
  <xsl:template name="refine_figure-name-style">
10453
10672
  </xsl:template> <!-- refine_figure-name-style -->
@@ -10455,7 +10674,7 @@
10455
10674
  <xsl:attribute-set name="image-style">
10456
10675
  <xsl:attribute name="role">SKIP</xsl:attribute>
10457
10676
  <xsl:attribute name="text-align">center</xsl:attribute>
10458
- </xsl:attribute-set>
10677
+ </xsl:attribute-set> <!-- image-style -->
10459
10678
 
10460
10679
  <xsl:template name="refine_image-style">
10461
10680
  </xsl:template>
@@ -10466,17 +10685,54 @@
10466
10685
  <xsl:attribute name="scaling">uniform</xsl:attribute>
10467
10686
  <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
10468
10687
  <xsl:attribute name="width">75%</xsl:attribute>
10469
- </xsl:attribute-set>
10688
+ </xsl:attribute-set> <!-- image-graphic-style -->
10689
+
10690
+ <xsl:template name="refine_image-graphic-style">
10691
+ </xsl:template>
10470
10692
 
10471
10693
  <xsl:attribute-set name="figure-source-style">
10472
10694
  </xsl:attribute-set>
10473
10695
 
10696
+ <xsl:template name="refine_figure-source-style">
10697
+ </xsl:template>
10698
+
10474
10699
  <xsl:attribute-set name="figure-pseudocode-p-style">
10475
10700
  <xsl:attribute name="font-size">10pt</xsl:attribute>
10476
10701
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
10477
10702
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
10478
10703
  </xsl:attribute-set>
10479
10704
 
10705
+ <xsl:template name="refine_figure-pseudocode-p-style">
10706
+ </xsl:template>
10707
+
10708
+ <xsl:attribute-set name="figure-fn-number-style">
10709
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
10710
+ </xsl:attribute-set> <!-- figure-fn-number-style -->
10711
+
10712
+ <xsl:template name="refine_figure-fn-number-style">
10713
+ </xsl:template>
10714
+
10715
+ <xsl:attribute-set name="figure-fmt-fn-label-style">
10716
+ <xsl:attribute name="font-size">80%</xsl:attribute>
10717
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
10718
+ </xsl:attribute-set> <!-- figure-fmt-fn-label-style -->
10719
+
10720
+ <xsl:template name="refine_figure-fmt-fn-label-style">
10721
+ </xsl:template>
10722
+
10723
+ <xsl:attribute-set name="figure-fn-body-style">
10724
+ <xsl:attribute name="text-align">justify</xsl:attribute>
10725
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
10726
+ </xsl:attribute-set>
10727
+
10728
+ <xsl:template name="refine_figure-fn-body-style">
10729
+ <xsl:variable name="key_iso">
10730
+ </xsl:variable>
10731
+ <xsl:if test="normalize-space($key_iso) = 'true'">
10732
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
10733
+ </xsl:if>
10734
+ </xsl:template>
10735
+
10480
10736
  <!-- ============================ -->
10481
10737
  <!-- figure's footnotes rendering -->
10482
10738
  <!-- ============================ -->
@@ -10589,9 +10845,8 @@
10589
10845
  </fo:table-cell>
10590
10846
  <fo:table-cell>
10591
10847
  <fo:block xsl:use-attribute-sets="figure-fn-body-style">
10592
- <xsl:if test="normalize-space($key_iso) = 'true'">
10593
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
10594
- </xsl:if>
10848
+ <xsl:call-template name="refine_figure-fn-body-style"/>
10849
+
10595
10850
  <!-- <xsl:copy-of select="./node()"/> -->
10596
10851
  <xsl:apply-templates/>
10597
10852
  </fo:block>
@@ -10609,6 +10864,7 @@
10609
10864
  <xsl:param name="process">false</xsl:param>
10610
10865
  <xsl:if test="$process = 'true'">
10611
10866
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style" role="SKIP">
10867
+ <xsl:call-template name="refine_figure-fn-number-style"/>
10612
10868
  <xsl:attribute name="padding-right">0mm</xsl:attribute>
10613
10869
 
10614
10870
  <!-- tab is padding-right -->
@@ -10646,6 +10902,7 @@
10646
10902
  <xsl:attribute name="font-size">10pt</xsl:attribute>
10647
10903
  </xsl:if>
10648
10904
  <fo:inline xsl:use-attribute-sets="figure-fn-number-style figure-fmt-fn-label-style"> <!-- id="{@id}" -->
10905
+ <xsl:call-template name="refine_figure-fn-number-style"/>
10649
10906
  <!-- <xsl:value-of select="@reference"/> -->
10650
10907
  <xsl:apply-templates/>
10651
10908
  </fo:inline>
@@ -10691,6 +10948,8 @@
10691
10948
 
10692
10949
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
10693
10950
 
10951
+ <xsl:call-template name="refine_figure-style"/>
10952
+
10694
10953
  <xsl:for-each select="mn:fmt-name"> <!-- set context -->
10695
10954
  <xsl:call-template name="setIDforNamedDestination"/>
10696
10955
  </xsl:for-each>
@@ -10734,6 +10993,7 @@
10734
10993
 
10735
10994
  <xsl:template match="mn:figure[@class = 'pseudocode']//mn:p">
10736
10995
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
10996
+ <xsl:call-template name="refine_figure-pseudocode-p-style"/>
10737
10997
  <xsl:apply-templates/>
10738
10998
  </fo:block>
10739
10999
  </xsl:template>
@@ -10863,6 +11123,8 @@
10863
11123
  </xsl:variable>
10864
11124
  <xsl:copy-of select="xalan:nodeset($image-graphic-style_attributes)/attributes/@*"/>
10865
11125
 
11126
+ <xsl:call-template name="refine_image-graphic-style"/>
11127
+
10866
11128
  <xsl:if test="not(@mimetype = 'image/svg+xml') and not(ancestor::mn:table)">
10867
11129
  <xsl:variable name="scale">
10868
11130
  <xsl:call-template name="getImageScale">
@@ -11563,6 +11825,9 @@
11563
11825
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
11564
11826
  </xsl:attribute-set> <!-- formula-style -->
11565
11827
 
11828
+ <xsl:template name="refine_formula-style">
11829
+ </xsl:template>
11830
+
11566
11831
  <xsl:attribute-set name="formula-stem-block-style">
11567
11832
  <xsl:attribute name="text-align">center</xsl:attribute>
11568
11833
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -11634,6 +11899,8 @@
11634
11899
  <xsl:template match="mn:formula[mn:fmt-name]/mn:fmt-stem">
11635
11900
  <fo:block xsl:use-attribute-sets="formula-style">
11636
11901
 
11902
+ <xsl:call-template name="refine_formula-style"/>
11903
+
11637
11904
  <fo:table table-layout="fixed" width="100%">
11638
11905
  <fo:table-column column-width="95%"/>
11639
11906
  <fo:table-column column-width="5%"/>
@@ -12052,6 +12319,9 @@
12052
12319
  <xsl:attribute name="font-weight">bold</xsl:attribute>
12053
12320
  </xsl:attribute-set> <!-- list-name-style -->
12054
12321
 
12322
+ <xsl:template name="refine_list-name-style">
12323
+ </xsl:template>
12324
+
12055
12325
  <xsl:attribute-set name="list-item-style">
12056
12326
  </xsl:attribute-set>
12057
12327
 
@@ -12349,6 +12619,7 @@
12349
12619
  <xsl:param name="process">false</xsl:param>
12350
12620
  <xsl:if test="$process = 'true'">
12351
12621
  <fo:block xsl:use-attribute-sets="list-name-style">
12622
+ <xsl:call-template name="refine_list-name-style"/>
12352
12623
  <xsl:apply-templates/>
12353
12624
  </fo:block>
12354
12625
  </xsl:if>
@@ -12409,26 +12680,47 @@
12409
12680
  <!-- END Lists processing -->
12410
12681
  <!-- ===================================== -->
12411
12682
 
12683
+ <xsl:attribute-set name="footnote-separator-leader-style">
12684
+ </xsl:attribute-set>
12685
+
12686
+ <xsl:template name="refine_footnote-separator-leader-style">
12687
+ </xsl:template>
12688
+
12689
+ <xsl:attribute-set name="fn-container-body-style">
12690
+ <xsl:attribute name="text-indent">0</xsl:attribute>
12691
+ <xsl:attribute name="start-indent">0</xsl:attribute>
12692
+ </xsl:attribute-set>
12693
+
12694
+ <xsl:template name="refine_fn-container-body-style">
12695
+ </xsl:template>
12696
+
12412
12697
  <xsl:attribute-set name="fn-reference-style">
12413
12698
  <xsl:attribute name="font-size">80%</xsl:attribute>
12414
12699
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
12415
12700
  <xsl:attribute name="vertical-align">super</xsl:attribute>
12416
12701
  <xsl:attribute name="color">blue</xsl:attribute>
12417
-
12418
- </xsl:attribute-set>
12702
+ </xsl:attribute-set> <!-- fn-reference-style -->
12419
12703
 
12420
12704
  <xsl:template name="refine_fn-reference-style">
12705
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
12706
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
12421
12707
  </xsl:template> <!-- refine_fn-reference-style -->
12422
12708
 
12423
12709
  <xsl:attribute-set name="fn-style">
12424
12710
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
12425
12711
  </xsl:attribute-set>
12426
12712
 
12713
+ <xsl:template name="refine_fn-style">
12714
+ </xsl:template>
12715
+
12427
12716
  <xsl:attribute-set name="fn-num-style">
12428
12717
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
12429
12718
  <xsl:attribute name="font-size">60%</xsl:attribute>
12430
12719
  <xsl:attribute name="vertical-align">super</xsl:attribute>
12431
- </xsl:attribute-set>
12720
+ </xsl:attribute-set> <!-- fn-num-style -->
12721
+
12722
+ <xsl:template name="refine_fn-num-style">
12723
+ </xsl:template>
12432
12724
 
12433
12725
  <xsl:attribute-set name="fn-body-style">
12434
12726
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -12438,7 +12730,7 @@
12438
12730
  <xsl:attribute name="font-size">11pt</xsl:attribute>
12439
12731
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12440
12732
  <xsl:attribute name="text-align">justify</xsl:attribute>
12441
- </xsl:attribute-set>
12733
+ </xsl:attribute-set> <!-- fn-body-style" -->
12442
12734
 
12443
12735
  <xsl:template name="refine_fn-body-style">
12444
12736
  <xsl:variable name="doctype" select="ancestor::mn:metanorma/mn:bibdata/mn:ext/mn:doctype[not(@language) or @language = '']"/>
@@ -12507,10 +12799,12 @@
12507
12799
  <xsl:choose>
12508
12800
  <xsl:when test="ancestor::mn:bibitem">
12509
12801
  <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
12802
+ <xsl:call-template name="refine_bibitem-note-fn-style"/>
12510
12803
  </fn_styles>
12511
12804
  </xsl:when>
12512
12805
  <xsl:otherwise>
12513
12806
  <fn_styles xsl:use-attribute-sets="fn-num-style">
12807
+ <xsl:call-template name="refine_fn-num-style"/>
12514
12808
  </fn_styles>
12515
12809
  </xsl:otherwise>
12516
12810
  </xsl:choose>
@@ -12520,9 +12814,12 @@
12520
12814
  <xsl:copy-of select="."/>
12521
12815
  </xsl:for-each>
12522
12816
 
12523
- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
12817
+ <!-- https://github.com/metanorma/metanorma-ieee/issues/595 -->
12818
+ <!-- <xsl:if test="following-sibling::node()[normalize-space() != ''][1][self::mn:fn]">
12524
12819
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
12525
- </xsl:if>
12820
+ </xsl:if> -->
12821
+
12822
+ <xsl:if test="preceding-sibling::node()[normalize-space() != ''][1][self::mn:fn]">,</xsl:if>
12526
12823
 
12527
12824
  <xsl:call-template name="insert_basic_link">
12528
12825
  <xsl:with-param name="element">
@@ -12545,10 +12842,12 @@
12545
12842
  <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
12546
12843
 
12547
12844
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
12845
+ <xsl:call-template name="refine_fn-style"/>
12548
12846
  <xsl:copy-of select="$footnote_inline"/>
12549
12847
  <fo:footnote-body role="Note">
12550
12848
 
12551
12849
  <fo:block-container xsl:use-attribute-sets="fn-container-body-style" role="SKIP">
12850
+ <xsl:call-template name="refine_fn-container-body-style"/>
12552
12851
 
12553
12852
  <xsl:variable name="fn_block">
12554
12853
  <xsl:call-template name="refine_fn-body-style"/>
@@ -12648,6 +12947,9 @@
12648
12947
  <xsl:attribute name="space-after">12pt</xsl:attribute>
12649
12948
  </xsl:attribute-set> <!-- admonition-style -->
12650
12949
 
12950
+ <xsl:template name="refine_admonition-style">
12951
+ </xsl:template>
12952
+
12651
12953
  <xsl:attribute-set name="admonition-container-style">
12652
12954
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
12653
12955
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -12655,6 +12957,9 @@
12655
12957
  <xsl:attribute name="padding-top">3mm</xsl:attribute>
12656
12958
  </xsl:attribute-set> <!-- admonition-container-style -->
12657
12959
 
12960
+ <xsl:template name="refine_admonition-container-style">
12961
+ </xsl:template>
12962
+
12658
12963
  <xsl:attribute-set name="admonition-name-style">
12659
12964
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
12660
12965
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -12662,8 +12967,15 @@
12662
12967
  <xsl:attribute name="font-weight">bold</xsl:attribute>
12663
12968
  </xsl:attribute-set> <!-- admonition-name-style -->
12664
12969
 
12970
+ <xsl:template name="refine_admonition-name-style">
12971
+ </xsl:template>
12972
+
12665
12973
  <xsl:attribute-set name="admonition-p-style">
12666
12974
  </xsl:attribute-set> <!-- admonition-p-style -->
12975
+
12976
+ <xsl:template name="refine_admonition-p-style">
12977
+ </xsl:template>
12978
+
12667
12979
  <!-- end admonition -->
12668
12980
 
12669
12981
  <!-- ================ -->
@@ -12673,12 +12985,18 @@
12673
12985
  <xsl:call-template name="setNamedDestination"/>
12674
12986
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
12675
12987
 
12988
+ <xsl:call-template name="refine_admonition-style"/>
12989
+
12676
12990
  <xsl:call-template name="setBlockSpanAll"/>
12677
12991
  <fo:block-container xsl:use-attribute-sets="admonition-container-style" role="SKIP">
12992
+
12993
+ <xsl:call-template name="refine_admonition-container-style"/>
12678
12994
  <fo:block xsl:use-attribute-sets="admonition-name-style">
12995
+ <xsl:call-template name="refine_admonition-name-style"/>
12679
12996
  <xsl:call-template name="displayAdmonitionName"/>
12680
12997
  </fo:block>
12681
12998
  <fo:block xsl:use-attribute-sets="admonition-p-style">
12999
+ <xsl:call-template name="refine_admonition-p-style"/>
12682
13000
  <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
12683
13001
  </fo:block>
12684
13002
 
@@ -12732,6 +13050,7 @@
12732
13050
 
12733
13051
  <xsl:template match="mn:admonition/mn:p">
12734
13052
  <fo:block xsl:use-attribute-sets="admonition-p-style">
13053
+ <xsl:call-template name="refine_admonition-p-style"/>
12735
13054
 
12736
13055
  <xsl:apply-templates/>
12737
13056
  </fo:block>
@@ -12741,6 +13060,13 @@
12741
13060
  <!-- END Admonition -->
12742
13061
  <!-- ================ -->
12743
13062
 
13063
+ <xsl:attribute-set name="references-non-normative-title-style">
13064
+ </xsl:attribute-set>
13065
+
13066
+ <xsl:template name="refine_references-non-normative-title-style">
13067
+
13068
+ </xsl:template>
13069
+
12744
13070
  <!-- bibitem in Normative References (references/@normative="true") -->
12745
13071
  <xsl:attribute-set name="bibitem-normative-style">
12746
13072
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -12748,26 +13074,41 @@
12748
13074
  <xsl:attribute name="text-indent">-14mm</xsl:attribute>
12749
13075
  </xsl:attribute-set> <!-- bibitem-normative-style -->
12750
13076
 
13077
+ <xsl:template name="refine_bibitem-normative-style">
13078
+ </xsl:template>
13079
+
12751
13080
  <!-- bibitem in Normative References (references/@normative="true"), renders as list -->
12752
13081
  <xsl:attribute-set name="bibitem-normative-list-style">
12753
13082
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
12754
13083
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12755
13084
  </xsl:attribute-set> <!-- bibitem-normative-list-style -->
12756
13085
 
13086
+ <xsl:template name="refine_bibitem-normative-list-style">
13087
+ </xsl:template>
13088
+
12757
13089
  <xsl:attribute-set name="bibitem-non-normative-style">
12758
13090
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
12759
13091
  </xsl:attribute-set> <!-- bibitem-non-normative-style -->
12760
13092
 
13093
+ <xsl:template name="refine_bibitem-non-normative-style">
13094
+ </xsl:template>
13095
+
12761
13096
  <!-- bibitem in bibliography section (references/@normative="false"), renders as list -->
12762
13097
  <xsl:attribute-set name="bibitem-non-normative-list-style">
12763
13098
  <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
12764
13099
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12765
13100
  </xsl:attribute-set> <!-- bibitem-non-normative-list-style -->
12766
13101
 
13102
+ <xsl:template name="refine_bibitem-non-normative-list-style">
13103
+ </xsl:template>
13104
+
12767
13105
  <xsl:attribute-set name="bibitem-non-normative-list-item-style">
12768
13106
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
12769
13107
  </xsl:attribute-set>
12770
13108
 
13109
+ <xsl:template name="refine_bibitem-non-normative-list-item-style">
13110
+ </xsl:template>
13111
+
12771
13112
  <!-- bibitem in bibliography section (references/@normative="false"), list body -->
12772
13113
  <xsl:attribute-set name="bibitem-normative-list-body-style">
12773
13114
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -12775,12 +13116,18 @@
12775
13116
  <xsl:attribute name="text-indent">-14mm</xsl:attribute>
12776
13117
  </xsl:attribute-set>
12777
13118
 
13119
+ <xsl:template name="refine_bibitem-normative-list-body-style">
13120
+ </xsl:template>
13121
+
12778
13122
  <xsl:attribute-set name="bibitem-non-normative-list-body-style">
12779
13123
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
12780
13124
  <xsl:attribute name="margin-left">14mm</xsl:attribute>
12781
13125
  <xsl:attribute name="text-indent">-14mm</xsl:attribute>
12782
13126
  </xsl:attribute-set> <!-- bibitem-non-normative-list-body-style -->
12783
13127
 
13128
+ <xsl:template name="refine_bibitem-non-normative-list-body-style">
13129
+ </xsl:template>
13130
+
12784
13131
  <!-- footnote reference number for bibitem, in the text -->
12785
13132
  <xsl:attribute-set name="bibitem-note-fn-style">
12786
13133
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
@@ -12789,6 +13136,9 @@
12789
13136
  <xsl:attribute name="baseline-shift">30%</xsl:attribute>
12790
13137
  </xsl:attribute-set> <!-- bibitem-note-fn-style -->
12791
13138
 
13139
+ <xsl:template name="refine_bibitem-note-fn-style">
13140
+ </xsl:template>
13141
+
12792
13142
  <!-- footnote number on the page bottom -->
12793
13143
  <xsl:attribute-set name="bibitem-note-fn-number-style">
12794
13144
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
@@ -12807,6 +13157,9 @@
12807
13157
  <xsl:attribute-set name="references-non-normative-style">
12808
13158
  </xsl:attribute-set> <!-- references-non-normative-style -->
12809
13159
 
13160
+ <xsl:template name="refine_references-non-normative-style">
13161
+ </xsl:template>
13162
+
12810
13163
  <!-- ======================= -->
12811
13164
  <!-- Bibliography rendering -->
12812
13165
  <!-- ======================= -->
@@ -12848,6 +13201,7 @@
12848
13201
  <xsl:apply-templates select="mn:fmt-title[@columns = 1]"/>
12849
13202
 
12850
13203
  <fo:block xsl:use-attribute-sets="references-non-normative-style">
13204
+ <xsl:call-template name="refine_references-non-normative-style"/>
12851
13205
  <xsl:apply-templates select="node()[not(self::mn:fmt-title and @columns = 1)]"/>
12852
13206
  </fo:block>
12853
13207
  </xsl:template> <!-- references -->
@@ -12864,6 +13218,7 @@
12864
13218
  <xsl:otherwise>
12865
13219
  <xsl:call-template name="setNamedDestination"/>
12866
13220
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
13221
+ <xsl:call-template name="refine_bibitem-normative-style"/>
12867
13222
  <xsl:call-template name="processBibitem"/>
12868
13223
  </fo:block>
12869
13224
  </xsl:otherwise>
@@ -12872,13 +13227,14 @@
12872
13227
  </xsl:template> <!-- bibitem -->
12873
13228
 
12874
13229
  <!-- Bibliography (non-normative references) -->
12875
- <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem | mn:references[not(@normative='true')]/mn:note" name="bibitem_non_normative" priority="2">
13230
+ <xsl:template match="mn:references[not(@normative='true')]/mn:bibitem" name="bibitem_non_normative" priority="2">
12876
13231
  <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 -->
12877
13232
  <xsl:choose>
12878
13233
  <xsl:when test="$skip = 'true'"><!-- skip bibitem --></xsl:when>
12879
13234
  <xsl:otherwise>
12880
13235
  <xsl:call-template name="setNamedDestination"/>
12881
13236
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-style">
13237
+ <xsl:call-template name="refine_bibitem-non-normative-style"/>
12882
13238
  <xsl:call-template name="processBibitem"/>
12883
13239
  </fo:block>
12884
13240
  </xsl:otherwise>
@@ -12886,12 +13242,17 @@
12886
13242
 
12887
13243
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
12888
13244
 
13245
+ <!-- bibitem's notes will be processing in 'processBibitemFollowingNotes' -->
13246
+ <xsl:template match="mn:references/mn:note" priority="2"/> <!-- [not(@normative='true')] -->
13247
+
12889
13248
  <xsl:template name="insertListItem_Bibitem">
12890
13249
  <xsl:choose>
12891
13250
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
12892
13251
  <xsl:otherwise>
12893
13252
  <xsl:call-template name="setNamedDestination"/>
12894
13253
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
13254
+ <xsl:call-template name="refine_bibitem-non-normative-list-item-style"/>
13255
+
12895
13256
  <fo:list-item-label end-indent="label-end()">
12896
13257
  <fo:block role="SKIP">
12897
13258
  <fo:inline role="SKIP">
@@ -12902,16 +13263,18 @@
12902
13263
  </fo:block>
12903
13264
  </fo:list-item-label>
12904
13265
  <fo:list-item-body start-indent="body-start()">
12905
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
13266
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style"> <!-- role="SKIP" -->
13267
+ <xsl:call-template name="refine_bibitem-non-normative-list-body-style"/>
12906
13268
  <xsl:call-template name="processBibitem">
12907
13269
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
12908
13270
  </xsl:call-template>
12909
13271
  </fo:block>
13272
+ <xsl:call-template name="processBibitemFollowingNotes"/>
12910
13273
  </fo:list-item-body>
12911
13274
  </fo:list-item>
12912
13275
  </xsl:otherwise>
12913
13276
  </xsl:choose>
12914
- <xsl:apply-templates select="following-sibling::*[1]"> <!-- [self::mn:bibitem] -->
13277
+ <xsl:apply-templates select="following-sibling::*[self::mn:bibitem][1]">
12915
13278
  <xsl:with-param name="skip">false</xsl:with-param>
12916
13279
  </xsl:apply-templates>
12917
13280
  </xsl:template>
@@ -12939,6 +13302,7 @@
12939
13302
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
12940
13303
  </xsl:apply-templates>
12941
13304
  <xsl:apply-templates select="mn:formattedref"/>
13305
+ <xsl:call-template name="processBibitemFollowingNotes"/>
12942
13306
  </xsl:variable>
12943
13307
 
12944
13308
  <xsl:choose>
@@ -12972,6 +13336,7 @@
12972
13336
  <fo:block>
12973
13337
  <xsl:copy-of select="$bibitem_body"/>
12974
13338
  </fo:block>
13339
+ <xsl:call-template name="processBibitemFollowingNotes"/>
12975
13340
  </fo:list-item-body>
12976
13341
  </fo:list-item>
12977
13342
  </fo:list-block>
@@ -12979,23 +13344,14 @@
12979
13344
  </xsl:choose>
12980
13345
  <!-- end ITU bibitem processing -->
12981
13346
 
12982
- <xsl:call-template name="processBibliographyNote"/>
12983
13347
  </xsl:template> <!-- processBibitem (bibitem) -->
12984
13348
 
12985
- <xsl:template name="processBibliographyNote">
12986
- <xsl:if test="self::mn:note">
12987
- <xsl:variable name="note_node">
12988
- <xsl:element name="{local-name(..)}" namespace="{$namespace_full}"> <!-- save parent context node for determining styles -->
12989
- <xsl:copy> <!-- skip @id -->
12990
- <xsl:copy-of select="node()"/>
12991
- </xsl:copy>
12992
- </xsl:element>
12993
- </xsl:variable>
12994
- <!-- <xsl:for-each select="xalan:nodeset($note_node)//mn:note">
12995
- <xsl:call-template name="note"/>
12996
- </xsl:for-each> -->
13349
+ <xsl:template name="processBibitemFollowingNotes">
13350
+ <!-- current context is bibitem element -->
13351
+ <xsl:variable name="bibitem_id" select="@id"/>
13352
+ <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]]">
12997
13353
  <xsl:call-template name="note"/>
12998
- </xsl:if>
13354
+ </xsl:for-each>
12999
13355
  </xsl:template>
13000
13356
 
13001
13357
  <xsl:template match="mn:title" mode="title">
@@ -13195,11 +13551,17 @@
13195
13551
  <!-- Index section styles -->
13196
13552
  <xsl:attribute-set name="indexsect-title-style">
13197
13553
  <xsl:attribute name="role">H1</xsl:attribute>
13198
- </xsl:attribute-set>
13554
+ </xsl:attribute-set> <!-- indexsect-title-style -->
13555
+
13556
+ <xsl:template name="refine_indexsect-title-style">
13557
+ </xsl:template>
13199
13558
 
13200
13559
  <xsl:attribute-set name="indexsect-clause-title-style">
13201
13560
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
13202
- </xsl:attribute-set>
13561
+ </xsl:attribute-set> <!-- indexsect-clause-title-style -->
13562
+
13563
+ <xsl:template name="refine_indexsect-clause-title-style">
13564
+ </xsl:template>
13203
13565
  <!-- End Index section styles -->
13204
13566
 
13205
13567
  <!-- =================== -->
@@ -13393,6 +13755,7 @@
13393
13755
 
13394
13756
  <xsl:template match="mn:indexsect/mn:fmt-title | mn:indexsect/mn:title" priority="4">
13395
13757
  <fo:block xsl:use-attribute-sets="indexsect-title-style">
13758
+ <xsl:call-template name="refine_indexsect-title-style"/>
13396
13759
  <!-- Index -->
13397
13760
  <xsl:apply-templates/>
13398
13761
  </fo:block>
@@ -13401,6 +13764,7 @@
13401
13764
  <xsl:template match="mn:indexsect/mn:clause/mn:fmt-title | mn:indexsect/mn:clause/mn:title" priority="4">
13402
13765
  <!-- Letter A, B, C, ... -->
13403
13766
  <fo:block xsl:use-attribute-sets="indexsect-clause-title-style">
13767
+ <xsl:call-template name="refine_indexsect-clause-title-style"/>
13404
13768
  <xsl:apply-templates/>
13405
13769
  </fo:block>
13406
13770
  </xsl:template>
@@ -13611,9 +13975,15 @@
13611
13975
  <xsl:attribute name="leader-pattern">dots</xsl:attribute>
13612
13976
  </xsl:attribute-set> <!-- END: toc-leader-style -->
13613
13977
 
13978
+ <xsl:template name="refine_toc-leader-style">
13979
+ </xsl:template>
13980
+
13614
13981
  <xsl:attribute-set name="toc-pagenumber-style">
13615
13982
  </xsl:attribute-set>
13616
13983
 
13984
+ <xsl:template name="refine_toc-pagenumber-style">
13985
+ </xsl:template>
13986
+
13617
13987
  <!-- List of Figures, Tables -->
13618
13988
  <xsl:attribute-set name="toc-listof-title-style">
13619
13989
  <xsl:attribute name="space-before">36pt</xsl:attribute>
@@ -13628,12 +13998,18 @@
13628
13998
  <xsl:attribute-set name="toc-listof-item-block-style">
13629
13999
  </xsl:attribute-set>
13630
14000
 
14001
+ <xsl:template name="refine_toc-listof-item-block-style">
14002
+ </xsl:template>
14003
+
13631
14004
  <xsl:attribute-set name="toc-listof-item-style">
13632
14005
  <xsl:attribute name="role">TOCI</xsl:attribute>
13633
14006
  <xsl:attribute name="text-align-last">justify</xsl:attribute>
13634
14007
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
13635
14008
  </xsl:attribute-set>
13636
14009
 
14010
+ <xsl:template name="refine_toc-listof-item-style">
14011
+ </xsl:template>
14012
+
13637
14013
  <xsl:template name="processPrefaceSectionsDefault_Contents">
13638
14014
  <xsl:variable name="nodes_preface_">
13639
14015
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
@@ -14747,23 +15123,55 @@
14747
15123
  <!-- Ruby text (CJK languages) rendering -->
14748
15124
  <!-- ===================================== -->
14749
15125
  <!-- ===================================== -->
15126
+
15127
+ <xsl:attribute-set name="ruby-style">
15128
+ <xsl:attribute name="text-indent">0mm</xsl:attribute>
15129
+ <xsl:attribute name="last-line-end-indent">0mm</xsl:attribute>
15130
+ </xsl:attribute-set>
15131
+
15132
+ <xsl:template name="refine_ruby-style">
15133
+ <xsl:if test="not(ancestor::mn:ruby)">
15134
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
15135
+ </xsl:if>
15136
+ <xsl:variable name="rt_text" select="mn:rt"/>
15137
+ <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
15138
+ <!-- Example: width="2em" -->
15139
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
15140
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
15141
+ <xsl:variable name="text_width">
15142
+ <xsl:choose>
15143
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
15144
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
15145
+ </xsl:choose>
15146
+ </xsl:variable>
15147
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
15148
+ </xsl:template> <!-- refine_ruby-style -->
15149
+
15150
+ <xsl:attribute-set name="rb-style">
15151
+ <xsl:attribute name="line-height">1em</xsl:attribute>
15152
+ <xsl:attribute name="text-align">center</xsl:attribute>
15153
+ </xsl:attribute-set>
15154
+
15155
+ <xsl:template name="refine_rb-style">
15156
+ </xsl:template>
15157
+
15158
+ <xsl:attribute-set name="rt-style">
15159
+ <xsl:attribute name="font-size">0.5em</xsl:attribute>
15160
+ <xsl:attribute name="text-align">center</xsl:attribute>
15161
+ <xsl:attribute name="line-height">1.2em</xsl:attribute>
15162
+ <xsl:attribute name="space-before">-1.4em</xsl:attribute>
15163
+ <xsl:attribute name="space-before.conditionality">retain</xsl:attribute>
15164
+ </xsl:attribute-set>
15165
+
15166
+ <xsl:template name="refine_rt-style">
15167
+ <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
15168
+ <xsl:attribute name="space-before">0em</xsl:attribute>
15169
+ </xsl:if>
15170
+ </xsl:template>
15171
+
14750
15172
  <xsl:template match="mn:ruby">
14751
- <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
14752
- <xsl:if test="not(ancestor::mn:ruby)">
14753
- <xsl:attribute name="alignment-baseline">central</xsl:attribute>
14754
- </xsl:if>
14755
- <xsl:variable name="rt_text" select="mn:rt"/>
14756
- <xsl:variable name="rb_text" select=".//mn:rb[not(mn:ruby)]"/>
14757
- <!-- Example: width="2em" -->
14758
- <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
14759
- <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
14760
- <xsl:variable name="text_width">
14761
- <xsl:choose>
14762
- <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
14763
- <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
14764
- </xsl:choose>
14765
- </xsl:variable>
14766
- <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
15173
+ <fo:inline-container xsl:use-attribute-sets="ruby-style">
15174
+ <xsl:call-template name="refine_ruby-style"/>
14767
15175
 
14768
15176
  <xsl:choose>
14769
15177
  <xsl:when test="ancestor::mn:ruby">
@@ -14781,17 +15189,14 @@
14781
15189
  </xsl:template>
14782
15190
 
14783
15191
  <xsl:template match="mn:rb">
14784
- <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
15192
+ <fo:block xsl:use-attribute-sets="rb-style"><xsl:call-template name="refine_rb-style"/><xsl:apply-templates/></fo:block>
14785
15193
  </xsl:template>
14786
15194
 
14787
15195
  <xsl:template match="mn:rt">
14788
- <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
14789
- <xsl:if test="ancestor::mn:ruby[last()]//mn:ruby or ancestor::mn:rb">
14790
- <xsl:attribute name="space-before">0em</xsl:attribute>
14791
- </xsl:if>
15196
+ <fo:block xsl:use-attribute-sets="rt-style"> <!-- -->
15197
+ <xsl:call-template name="refine_rt-style"/>
14792
15198
  <xsl:apply-templates/>
14793
15199
  </fo:block>
14794
-
14795
15200
  </xsl:template>
14796
15201
 
14797
15202
  <!-- ===================================== -->
@@ -14800,6 +15205,18 @@
14800
15205
  <!-- ===================================== -->
14801
15206
  <!-- ===================================== -->
14802
15207
 
15208
+ <xsl:attribute-set name="annex-title-style">
15209
+ </xsl:attribute-set>
15210
+
15211
+ <xsl:template name="refine_annex-title-style">
15212
+ </xsl:template>
15213
+
15214
+ <xsl:attribute-set name="p-zzSTDTitle1-style">
15215
+ </xsl:attribute-set>
15216
+
15217
+ <xsl:template name="refine_p-zzSTDTitle1-style">
15218
+ </xsl:template>
15219
+
14803
15220
  <xsl:template name="processPrefaceSectionsDefault">
14804
15221
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
14805
15222
  <xsl:sort select="@displayorder" data-type="number"/>