metanorma-iso 2.2.4 → 2.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -326,31 +326,31 @@
326
326
  <!-- contents pages -->
327
327
  <!-- odd pages -->
328
328
  <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
329
- <fo:region-body margin-top="27.4mm" margin-bottom="{$marginBottom + 2}mm" margin-left="19mm" margin-right="19mm"/>
329
+ <fo:region-body margin-top="27.4mm" margin-bottom="{$marginBottom}mm" margin-left="19mm" margin-right="19mm"/>
330
330
  <fo:region-before region-name="header-odd" extent="27.4mm"/> <!-- display-align="center" -->
331
- <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
331
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom - 2}mm"/>
332
332
  <fo:region-start region-name="left-region" extent="19mm"/>
333
333
  <fo:region-end region-name="right-region" extent="19mm"/>
334
334
  </fo:simple-page-master>
335
335
  <fo:simple-page-master master-name="odd-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
336
- <fo:region-body margin-top="27.4mm" margin-bottom="{$marginBottom + 2}mm" margin-left="19mm" margin-right="19mm"/>
336
+ <fo:region-body margin-top="27.4mm" margin-bottom="{$marginBottom}mm" margin-left="19mm" margin-right="19mm"/>
337
337
  <fo:region-before region-name="header-odd" extent="27.4mm"/>
338
- <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
338
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom - 2}mm"/>
339
339
  <fo:region-start region-name="left-region" extent="19mm"/>
340
340
  <fo:region-end region-name="right-region" extent="19mm"/>
341
341
  </fo:simple-page-master>
342
342
  <!-- even pages -->
343
343
  <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
344
- <fo:region-body margin-top="27.4mm" margin-bottom="{$marginBottom + 2}mm" margin-left="19mm" margin-right="19mm"/>
344
+ <fo:region-body margin-top="27.4mm" margin-bottom="{$marginBottom}mm" margin-left="19mm" margin-right="19mm"/>
345
345
  <fo:region-before region-name="header-even" extent="27.4mm"/> <!-- display-align="center" -->
346
- <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
346
+ <fo:region-after region-name="footer-even" extent="{$marginBottom - 2}mm"/>
347
347
  <fo:region-start region-name="left-region" extent="19mm"/>
348
348
  <fo:region-end region-name="right-region" extent="19mm"/>
349
349
  </fo:simple-page-master>
350
350
  <fo:simple-page-master master-name="even-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
351
- <fo:region-body margin-top="27.4mm" margin-bottom="{$marginBottom + 2}mm" margin-left="19mm" margin-right="19mm"/>
351
+ <fo:region-body margin-top="27.4mm" margin-bottom="{$marginBottom}mm" margin-left="19mm" margin-right="19mm"/>
352
352
  <fo:region-before region-name="header-even" extent="27.4mm"/> <!-- display-align="center" -->
353
- <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
353
+ <fo:region-after region-name="footer-even" extent="{$marginBottom - 2}mm"/>
354
354
  <fo:region-start region-name="left-region" extent="19mm"/>
355
355
  <fo:region-end region-name="right-region" extent="19mm"/>
356
356
  </fo:simple-page-master>
@@ -381,46 +381,46 @@
381
381
 
382
382
  <!-- first page -->
383
383
  <fo:simple-page-master master-name="first-publishedISO" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
384
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom + 2}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
384
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
385
385
  <fo:region-before region-name="header-first" extent="{$marginTop}mm"/> <!-- display-align="center" -->
386
- <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
386
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom - 2}mm"/>
387
387
  <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
388
388
  <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
389
389
  </fo:simple-page-master>
390
390
  <!-- odd pages -->
391
391
  <fo:simple-page-master master-name="odd-publishedISO" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
392
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom + 2}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
392
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
393
393
  <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/> <!-- display-align="center" -->
394
- <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
394
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom - 2}mm"/>
395
395
  <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
396
396
  <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
397
397
  </fo:simple-page-master>
398
398
  <fo:simple-page-master master-name="odd-publishedISO-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
399
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom + 2}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
399
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
400
400
  <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/> <!-- display-align="center" -->
401
- <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
401
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom - 2}mm"/>
402
402
  <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
403
403
  <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
404
404
  </fo:simple-page-master>
405
405
  <!-- even pages -->
406
406
  <fo:simple-page-master master-name="even-publishedISO" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
407
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom + 2}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
407
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
408
408
  <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
409
- <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
409
+ <fo:region-after region-name="footer-even" extent="{$marginBottom - 2}mm"/>
410
410
  <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
411
411
  <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
412
412
  </fo:simple-page-master>
413
413
  <fo:simple-page-master master-name="even-publishedISO-landscape" page-width="{$pageHeight}mm" page-height="{$pageWidth}mm">
414
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom + 2}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
414
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
415
415
  <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
416
- <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
416
+ <fo:region-after region-name="footer-even" extent="{$marginBottom - 2}mm"/>
417
417
  <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
418
418
  <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
419
419
  </fo:simple-page-master>
420
420
  <fo:simple-page-master master-name="blankpage" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
421
- <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom + 2}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
421
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
422
422
  <fo:region-before region-name="header" extent="{$marginTop}mm"/>
423
- <fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
423
+ <fo:region-after region-name="footer" extent="{$marginBottom - 2}mm"/>
424
424
  <fo:region-start region-name="left" extent="{$marginLeftRight2}mm"/>
425
425
  <fo:region-end region-name="right" extent="{$marginLeftRight1}mm"/>
426
426
  </fo:simple-page-master>
@@ -457,7 +457,7 @@
457
457
  <fo:simple-page-master master-name="last-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
458
458
  <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
459
459
  <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
460
- <fo:region-after region-name="last-page-footer" extent="{$marginBottom}mm"/>
460
+ <fo:region-after region-name="last-page-footer" extent="{$marginBottom - 2}mm"/>
461
461
  <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
462
462
  <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
463
463
  </fo:simple-page-master>
@@ -466,14 +466,14 @@
466
466
  <fo:simple-page-master master-name="index-odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
467
467
  <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm" column-count="2" column-gap="10mm"/>
468
468
  <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
469
- <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
469
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom - 2}mm"/>
470
470
  <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
471
471
  <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
472
472
  </fo:simple-page-master>
473
473
  <fo:simple-page-master master-name="index-even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
474
474
  <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm" column-count="2" column-gap="10mm"/>
475
475
  <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
476
- <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
476
+ <fo:region-after region-name="footer-even" extent="{$marginBottom - 2}mm"/>
477
477
  <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
478
478
  <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
479
479
  </fo:simple-page-master>
@@ -2390,7 +2390,7 @@
2390
2390
  <xsl:variable name="marginTop" select="normalize-space($marginTop_)"/>
2391
2391
 
2392
2392
  <xsl:variable name="marginBottom_">
2393
- 13
2393
+ 15
2394
2394
  </xsl:variable>
2395
2395
  <xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/>
2396
2396
 
@@ -3110,6 +3110,12 @@
3110
3110
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3111
3111
  </xsl:attribute-set>
3112
3112
 
3113
+ <xsl:attribute-set name="figure-block-style">
3114
+
3115
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
3116
+
3117
+ </xsl:attribute-set>
3118
+
3113
3119
  <xsl:attribute-set name="figure-style">
3114
3120
 
3115
3121
  </xsl:attribute-set>
@@ -3119,7 +3125,7 @@
3119
3125
  <xsl:attribute name="font-weight">bold</xsl:attribute>
3120
3126
  <xsl:attribute name="text-align">center</xsl:attribute>
3121
3127
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
3122
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
3128
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
3123
3129
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
3124
3130
 
3125
3131
  </xsl:attribute-set>
@@ -4544,6 +4550,10 @@
4544
4550
  <xsl:with-param name="continued">true</xsl:with-param>
4545
4551
  </xsl:apply-templates>
4546
4552
 
4553
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
4554
+ <fo:block/>
4555
+ </xsl:if>
4556
+
4547
4557
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
4548
4558
  <xsl:call-template name="table_name_fn_display"/>
4549
4559
  </xsl:for-each>
@@ -4831,7 +4841,7 @@
4831
4841
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
4832
4842
  </xsl:if>
4833
4843
 
4834
- <xsl:if test="position() = 1 and not(ancestor::*[local-name() = 'table']/*[local-name() = 'thead'])">
4844
+ <xsl:if test="position() = 1 and not(ancestor::*[local-name() = 'table']/*[local-name() = 'thead']) and ancestor::*[local-name() = 'table']/*[local-name() = 'name']">
4835
4845
  <xsl:attribute name="border-top"><xsl:value-of select="$table-border"/></xsl:attribute>
4836
4846
  </xsl:if>
4837
4847
 
@@ -5009,7 +5019,26 @@
5009
5019
 
5010
5020
  <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
5011
5021
  <xsl:variable name="footnote_inline">
5012
- <fo:inline xsl:use-attribute-sets="fn-num-style">
5022
+ <fo:inline>
5023
+
5024
+ <xsl:variable name="fn_styles">
5025
+ <xsl:choose>
5026
+ <xsl:when test="ancestor::*[local-name() = 'bibitem']">
5027
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
5028
+ </xsl:when>
5029
+ <xsl:otherwise>
5030
+ <fn_styles xsl:use-attribute-sets="fn-num-style"/>
5031
+ </xsl:otherwise>
5032
+ </xsl:choose>
5033
+ </xsl:variable>
5034
+
5035
+ <xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
5036
+ <xsl:copy-of select="."/>
5037
+ </xsl:for-each>
5038
+
5039
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
5040
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
5041
+ </xsl:if>
5013
5042
 
5014
5043
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
5015
5044
  <xsl:value-of select="$current_fn_number_text"/>
@@ -5069,7 +5098,10 @@
5069
5098
  </xsl:for-each>
5070
5099
  <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='boilerplate']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
5071
5100
  <xsl:sort select="@displayorder" data-type="number"/>
5072
- <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
5101
+ <!-- commented:
5102
+ .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
5103
+ because 'fn' there is in biblio-tag -->
5104
+ <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
5073
5105
  <!-- copy unique fn -->
5074
5106
  <fn gen_id="{generate-id(.)}">
5075
5107
  <xsl:copy-of select="@*"/>
@@ -5941,7 +5973,7 @@
5941
5973
 
5942
5974
  <xsl:variable name="_font-size">
5943
5975
 
5944
- inherit <!-- 10 -->
5976
+ 9 <!-- inherit -->
5945
5977
 
5946
5978
  </xsl:variable>
5947
5979
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -6251,6 +6283,23 @@
6251
6283
  <xsl:apply-templates/>
6252
6284
  </xsl:template>
6253
6285
 
6286
+ <!-- Don't break standard's numbers -->
6287
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
6288
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
6289
+ <xsl:choose>
6290
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
6291
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
6292
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
6293
+ </xsl:when>
6294
+ <xsl:otherwise>
6295
+ <xsl:apply-templates/>
6296
+ </xsl:otherwise>
6297
+ </xsl:choose>
6298
+ </xsl:template>
6299
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
6300
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
6301
+ </xsl:template>
6302
+
6254
6303
  <!-- ========================= -->
6255
6304
  <!-- END Rich text formatting -->
6256
6305
  <!-- ========================= -->
@@ -6646,7 +6695,7 @@
6646
6695
  <xsl:choose>
6647
6696
  <xsl:when test="@colspan">
6648
6697
  <xsl:variable name="td">
6649
- <xsl:element name="td">
6698
+ <xsl:element name="{local-name()}">
6650
6699
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
6651
6700
  <xsl:if test="local-name()='th'">
6652
6701
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6661,7 +6710,7 @@
6661
6710
  </xsl:call-template>
6662
6711
  </xsl:when>
6663
6712
  <xsl:otherwise>
6664
- <xsl:element name="td">
6713
+ <xsl:element name="{local-name()}">
6665
6714
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
6666
6715
  <xsl:if test="local-name()='th'">
6667
6716
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6728,7 +6777,7 @@
6728
6777
  <xsl:variable name="currentRow" select="."/>
6729
6778
 
6730
6779
  <xsl:variable name="normalizedTDs">
6731
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
6780
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
6732
6781
  <xsl:choose>
6733
6782
  <xsl:when test="@rowspan &gt; 1">
6734
6783
  <xsl:copy>
@@ -6740,7 +6789,7 @@
6740
6789
  </xsl:copy>
6741
6790
  </xsl:when>
6742
6791
  <xsl:otherwise>
6743
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
6792
+ <xsl:copy-of select="$currentRow/*[self::td or self::th][1 + count(current()/preceding-sibling::*[self::td or self::th][not(@rowspan) or (@rowspan = 1)])]"/>
6744
6793
  </xsl:otherwise>
6745
6794
  </xsl:choose>
6746
6795
  </xsl:for-each>
@@ -6961,6 +7010,33 @@
6961
7010
  </xsl:choose>
6962
7011
  </xsl:template>
6963
7012
 
7013
+ <xsl:template name="getLang_fromCurrentNode">
7014
+ <xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
7015
+ <xsl:variable name="language">
7016
+ <xsl:choose>
7017
+ <xsl:when test="$language_current != ''">
7018
+ <xsl:value-of select="$language_current"/>
7019
+ </xsl:when>
7020
+ <xsl:otherwise>
7021
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
7022
+ <xsl:choose>
7023
+ <xsl:when test="$language_current_2 != ''">
7024
+ <xsl:value-of select="$language_current_2"/>
7025
+ </xsl:when>
7026
+ <xsl:otherwise>
7027
+ <xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
7028
+ </xsl:otherwise>
7029
+ </xsl:choose>
7030
+ </xsl:otherwise>
7031
+ </xsl:choose>
7032
+ </xsl:variable>
7033
+
7034
+ <xsl:choose>
7035
+ <xsl:when test="$language = 'English'">en</xsl:when>
7036
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
7037
+ </xsl:choose>
7038
+ </xsl:template>
7039
+
6964
7040
  <xsl:template name="capitalizeWords">
6965
7041
  <xsl:param name="str"/>
6966
7042
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
@@ -7421,12 +7497,6 @@
7421
7497
 
7422
7498
  <fo:block-container margin-left="0mm">
7423
7499
 
7424
- <!-- <xsl:if test="$namespace = 'iho'">
7425
- <xsl:if test="ancestor::iho:td">
7426
- <xsl:attribute name="font-size">12pt</xsl:attribute>
7427
- </xsl:if>
7428
- </xsl:if> -->
7429
-
7430
7500
  <fo:block>
7431
7501
 
7432
7502
  <fo:inline xsl:use-attribute-sets="note-name-style">
@@ -7600,7 +7670,7 @@
7600
7670
  <xsl:template match="*[local-name() = 'figure']" name="figure">
7601
7671
  <xsl:variable name="isAdded" select="@added"/>
7602
7672
  <xsl:variable name="isDeleted" select="@deleted"/>
7603
- <fo:block-container id="{@id}">
7673
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
7604
7674
 
7605
7675
  <xsl:call-template name="setTrackChangesStyles">
7606
7676
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -7936,6 +8006,31 @@
7936
8006
  <xsl:apply-templates mode="svg_update"/>
7937
8007
  </xsl:copy>
7938
8008
  </xsl:template>
8009
+
8010
+ <!-- regex for 'display: inline-block;' -->
8011
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
8012
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
8013
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
8014
+ </xsl:template>
8015
+
8016
+ <!-- replace
8017
+ stroke="rgba(r, g, b, alpha)" to
8018
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
8019
+ fill="rgba(r, g, b, alpha)" to
8020
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
8021
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
8022
+ <xsl:variable name="components_">
8023
+ <xsl:call-template name="split">
8024
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
8025
+ <xsl:with-param name="sep" select="','"/>
8026
+ </xsl:call-template>
8027
+ </xsl:variable>
8028
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
8029
+ <xsl:variable name="att_name" select="local-name()"/>
8030
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
8031
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
8032
+ </xsl:template>
8033
+
7939
8034
  <!-- ============== -->
7940
8035
  <!-- END: svg_update -->
7941
8036
  <!-- ============== -->
@@ -8561,7 +8656,13 @@
8561
8656
  </xsl:template>
8562
8657
 
8563
8658
  <xsl:template match="text()" mode="contents_item">
8564
- <xsl:call-template name="keep_together_standard_number"/>
8659
+ <xsl:variable name="text">
8660
+ <!-- to split by '_' and other chars -->
8661
+ <text><xsl:call-template name="add-zero-spaces-java"/></text>
8662
+ </xsl:variable>
8663
+ <xsl:for-each select="xalan:nodeset($text)/text/text()">
8664
+ <xsl:call-template name="keep_together_standard_number"/>
8665
+ </xsl:for-each>
8565
8666
  </xsl:template>
8566
8667
 
8567
8668
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
@@ -8572,34 +8673,52 @@
8572
8673
  <!-- =============== -->
8573
8674
  <!-- sourcecode -->
8574
8675
  <!-- =============== -->
8575
- <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
8576
8676
 
8577
- <xsl:variable name="sourcecode_attributes">
8578
- <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
8579
- <xsl:variable name="_font-size">
8677
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
8678
+ <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
8679
+ <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
8580
8680
 
8581
- inherit<!-- 9 -->
8681
+ <xsl:template match="*[local-name() = 'property']" mode="css">
8682
+ <xsl:attribute name="{@name}">
8683
+ <xsl:value-of select="@value"/>
8684
+ </xsl:attribute>
8685
+ </xsl:template>
8582
8686
 
8583
- <!-- <xsl:if test="$namespace = 'ieee'">
8584
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
8585
- </xsl:if> -->
8687
+ <xsl:template name="get_sourcecode_attributes">
8688
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
8689
+ <xsl:variable name="_font-size">
8586
8690
 
8587
- </xsl:variable>
8691
+ 9<!-- inherit -->
8588
8692
 
8589
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
8590
- <xsl:if test="$font-size != ''">
8591
- <xsl:attribute name="font-size">
8592
- <xsl:choose>
8593
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
8594
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
8595
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
8596
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
8597
- </xsl:choose>
8598
- </xsl:attribute>
8599
- </xsl:if>
8600
- </xsl:element>
8693
+ <!-- <xsl:if test="$namespace = 'ieee'">
8694
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
8695
+ </xsl:if> -->
8696
+
8697
+ </xsl:variable>
8698
+
8699
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
8700
+ <xsl:if test="$font-size != ''">
8701
+ <xsl:attribute name="font-size">
8702
+ <xsl:choose>
8703
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
8704
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
8705
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
8706
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
8707
+ </xsl:choose>
8708
+ </xsl:attribute>
8709
+ </xsl:if>
8710
+ <xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
8711
+ </xsl:element>
8712
+ </xsl:template>
8713
+
8714
+ <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
8715
+
8716
+ <xsl:variable name="sourcecode_attributes">
8717
+ <xsl:call-template name="get_sourcecode_attributes"/>
8601
8718
  </xsl:variable>
8602
8719
 
8720
+ <!-- <xsl:copy-of select="$sourcecode_css"/> -->
8721
+
8603
8722
  <xsl:choose>
8604
8723
  <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
8605
8724
  <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
@@ -8653,9 +8772,10 @@
8653
8772
  </xsl:choose>
8654
8773
  </xsl:template>
8655
8774
 
8656
- <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
8775
+ <xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
8657
8776
  <xsl:choose>
8658
- <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
8777
+ <!-- disabled -->
8778
+ <xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
8659
8779
  <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
8660
8780
  <xsl:choose>
8661
8781
  <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
@@ -8670,8 +8790,75 @@
8670
8790
  <xsl:call-template name="add_spaces_to_sourcecode"/>
8671
8791
  </xsl:otherwise>
8672
8792
  </xsl:choose>
8793
+ </xsl:template>
8794
+
8795
+ <!-- add sourcecode highlighting -->
8796
+ <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
8797
+ <xsl:variable name="class" select="@class"/>
8798
+ <xsl:choose>
8799
+ <xsl:when test="$sourcecode_css//class[@name = $class]">
8800
+ <fo:inline>
8801
+ <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
8802
+ <xsl:apply-templates/>
8803
+ </fo:inline>
8804
+ </xsl:when>
8805
+ <xsl:otherwise>
8806
+ <xsl:apply-templates/>
8807
+ </xsl:otherwise>
8808
+ </xsl:choose>
8809
+ </xsl:template>
8810
+
8811
+ <!-- outer table with line numbers for sourcecode -->
8812
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
8813
+ <fo:block>
8814
+ <fo:table width="100%" table-layout="fixed">
8815
+ <xsl:copy-of select="@id"/>
8816
+ <fo:table-column column-width="8%"/>
8817
+ <fo:table-column column-width="92%"/>
8818
+ <fo:table-body>
8819
+ <xsl:apply-templates/>
8820
+ </fo:table-body>
8821
+ </fo:table>
8822
+ </fo:block>
8823
+ </xsl:template>
8824
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
8825
+ <xsl:apply-templates/>
8826
+ </xsl:template>
8827
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
8828
+ <fo:table-row>
8829
+ <xsl:apply-templates/>
8830
+ </fo:table-row>
8831
+ </xsl:template>
8832
+ <!-- first td with line numbers -->
8833
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
8834
+ <fo:table-cell>
8835
+ <fo:block>
8836
+
8837
+ <!-- set attibutes for line numbers - same as sourcecode -->
8838
+ <xsl:variable name="sourcecode_attributes">
8839
+ <xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
8840
+ <xsl:call-template name="get_sourcecode_attributes"/>
8841
+ </xsl:for-each>
8842
+ </xsl:variable>
8843
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
8844
+ <xsl:attribute name="{local-name()}">
8845
+ <xsl:value-of select="."/>
8846
+ </xsl:attribute>
8847
+ </xsl:for-each>
8673
8848
 
8849
+ <xsl:apply-templates/>
8850
+ </fo:block>
8851
+ </fo:table-cell>
8852
+ </xsl:template>
8853
+ <!-- second td with sourcecode -->
8854
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
8855
+ <fo:table-cell>
8856
+ <fo:block>
8857
+ <xsl:apply-templates/>
8858
+ </fo:block>
8859
+ </fo:table-cell>
8674
8860
  </xsl:template>
8861
+ <!-- END outer table with line numbers for sourcecode -->
8675
8862
 
8676
8863
  <xsl:template name="add_spaces_to_sourcecode">
8677
8864
  <xsl:variable name="text_step1">
@@ -10359,17 +10546,17 @@
10359
10546
  <fo:block>
10360
10547
  <fo:inline>
10361
10548
 
10362
- <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
10363
- <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
10364
- <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
10365
- </xsl:if>
10366
-
10549
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
10550
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
10551
+ </xsl:apply-templates>
10367
10552
  </fo:inline>
10368
10553
  </fo:block>
10369
10554
  </fo:list-item-label>
10370
10555
  <fo:list-item-body start-indent="body-start()">
10371
10556
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
10372
- <xsl:call-template name="processBibitem"/>
10557
+ <xsl:call-template name="processBibitem">
10558
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10559
+ </xsl:call-template>
10373
10560
  </fo:block>
10374
10561
  </fo:list-item-body>
10375
10562
  </fo:list-item>
@@ -10378,178 +10565,51 @@
10378
10565
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
10379
10566
 
10380
10567
  <xsl:template name="processBibitem">
10568
+ <xsl:param name="biblio_tag_part">both</xsl:param>
10381
10569
 
10382
10570
  <!-- start bibitem processing -->
10383
10571
  <xsl:if test=".//*[local-name() = 'fn']">
10384
10572
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
10385
10573
  </xsl:if>
10386
10574
 
10387
- <!-- display document identifier, not number [1] -->
10388
- <xsl:variable name="docidentifier">
10389
- <xsl:choose>
10390
- <xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
10391
- <xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
10392
- </xsl:choose>
10393
- </xsl:variable>
10394
- <xsl:value-of select="$docidentifier"/>
10395
-
10396
- <xsl:apply-templates select="*[local-name() = 'note']"/>
10397
-
10398
- <xsl:if test="normalize-space($docidentifier) != '' and *[local-name() = 'formattedref']">
10399
- <xsl:text>,</xsl:text>
10400
- <xsl:text> </xsl:text>
10401
- </xsl:if>
10402
-
10575
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
10576
+ <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
10577
+ </xsl:apply-templates>
10403
10578
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
10404
10579
  <!-- end bibitem processing -->
10405
10580
 
10406
10581
  </xsl:template> <!-- processBibitem (bibitem) -->
10407
10582
 
10408
- <xsl:template name="processBibitemDocId">
10409
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
10410
- <xsl:choose>
10411
- <xsl:when test="normalize-space($_doc_ident) != ''">
10412
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
10413
- <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
10414
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
10415
- </xsl:if> -->
10416
- <xsl:value-of select="$_doc_ident"/>
10417
- </xsl:when>
10418
- <xsl:otherwise>
10419
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
10420
- <xsl:if test="$type != ''">
10421
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
10422
- </xsl:if> -->
10423
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
10424
- </xsl:otherwise>
10425
- </xsl:choose>
10426
- </xsl:template> <!-- processBibitemDocId -->
10583
+ <xsl:template match="*[local-name() = 'title']" mode="title">
10584
+ <fo:inline><xsl:apply-templates/></fo:inline>
10585
+ </xsl:template>
10586
+
10587
+ <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
10588
+
10589
+ <xsl:template match="*[local-name() = 'formattedref']">
10590
+ <!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
10591
+ <xsl:text>, </xsl:text>
10592
+ </xsl:if> -->
10593
+ <xsl:apply-templates/>
10594
+ </xsl:template>
10427
10595
 
10428
- <xsl:template name="processPersonalAuthor">
10596
+ <xsl:template match="*[local-name() = 'biblio-tag']">
10597
+ <xsl:param name="biblio_tag_part">both</xsl:param>
10429
10598
  <xsl:choose>
10430
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
10431
- <author>
10432
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
10433
- </author>
10434
- </xsl:when>
10435
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
10436
- <author>
10437
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
10438
- <xsl:text> </xsl:text>
10439
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
10440
- </author>
10599
+ <xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
10600
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
10441
10601
  </xsl:when>
10442
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
10443
- <author>
10444
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
10445
- <xsl:text> </xsl:text>
10446
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
10447
- </author>
10602
+ <xsl:when test="$biblio_tag_part = 'last'">
10603
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
10448
10604
  </xsl:when>
10449
10605
  <xsl:otherwise>
10450
10606
  <xsl:apply-templates/>
10451
10607
  </xsl:otherwise>
10452
10608
  </xsl:choose>
10453
- </xsl:template> <!-- processPersonalAuthor -->
10454
-
10455
- <xsl:template name="renderDate">
10456
- <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
10457
- <xsl:value-of select="*[local-name() = 'on']"/>
10458
- </xsl:if>
10459
- <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
10460
- <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
10461
- </xsl:if>
10462
- </xsl:template>
10463
-
10464
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
10465
- <xsl:value-of select="translate(.,'. ','')"/>
10466
- </xsl:template>
10467
-
10468
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
10469
- <xsl:value-of select="substring(.,1,1)"/>
10470
- </xsl:template>
10471
-
10472
- <xsl:template match="*[local-name() = 'title']" mode="title">
10473
- <fo:inline><xsl:apply-templates/></fo:inline>
10474
10609
  </xsl:template>
10475
10610
 
10476
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
10477
- <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
10478
- <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
10479
- <xsl:apply-templates/>
10480
- </fo:inline>
10481
- </xsl:template>
10482
-
10483
- <!-- bibitem/note renders as footnote -->
10484
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
10485
-
10486
- <!-- list of footnotes to calculate actual footnotes number -->
10487
- <xsl:variable name="p_fn_">
10488
- <xsl:call-template name="get_fn_list"/>
10489
- </xsl:variable>
10490
- <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10491
- <xsl:variable name="gen_id" select="generate-id(.)"/>
10492
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
10493
- <!-- fn sequence number in document -->
10494
- <xsl:variable name="current_fn_number">
10495
- <xsl:choose>
10496
- <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
10497
- <xsl:otherwise>
10498
- <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
10499
- <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
10500
- </xsl:otherwise>
10501
- </xsl:choose>
10502
- </xsl:variable>
10503
- <fo:footnote>
10504
- <xsl:variable name="number">
10505
-
10506
- <xsl:value-of select="$current_fn_number"/>
10507
-
10508
- </xsl:variable>
10509
-
10510
- <xsl:variable name="current_fn_number_text">
10511
- <xsl:value-of select="$number"/>
10512
-
10513
- <xsl:text>)</xsl:text>
10514
-
10515
- </xsl:variable>
10516
-
10517
- <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
10518
- <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
10519
- <xsl:value-of select="$current_fn_number_text"/>
10520
- </fo:basic-link>
10521
- </fo:inline>
10522
- <fo:footnote-body>
10523
- <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
10524
- <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
10525
- <xsl:value-of select="$current_fn_number_text"/>
10526
- </fo:inline>
10527
- <xsl:apply-templates/>
10528
- </fo:block>
10529
- </fo:footnote-body>
10530
- </fo:footnote>
10531
- </xsl:template>
10532
-
10533
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
10534
- <xsl:text> edition </xsl:text>
10535
- <xsl:value-of select="."/>
10536
- </xsl:template>
10537
-
10538
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
10539
- <xsl:text> (</xsl:text>
10540
- <fo:inline xsl:use-attribute-sets="link-style">
10541
- <fo:basic-link external-destination="." fox:alt-text=".">
10542
- <xsl:value-of select="."/>
10543
- </fo:basic-link>
10544
- </fo:inline>
10545
- <xsl:text>)</xsl:text>
10546
- </xsl:template>
10547
-
10548
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
10549
-
10550
- <xsl:template match="*[local-name() = 'formattedref']">
10551
-
10552
- <xsl:apply-templates/>
10611
+ <xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
10612
+ <xsl:text> </xsl:text>
10553
10613
  </xsl:template>
10554
10614
 
10555
10615
  <!-- ======================= -->
@@ -10886,7 +10946,9 @@
10886
10946
  <!-- Update xml -->
10887
10947
  <!-- ===================================== -->
10888
10948
  <!-- =========================================================================== -->
10889
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10949
+ <!-- STEP1: -->
10950
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
10951
+ <!-- - Ignore 'span' without style -->
10890
10952
  <!-- =========================================================================== -->
10891
10953
  <xsl:template match="@*|node()" mode="update_xml_step1">
10892
10954
  <xsl:copy>
@@ -10969,7 +11031,8 @@
10969
11031
  </xsl:copy>
10970
11032
  </xsl:template>
10971
11033
 
10972
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
11034
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
11035
+ <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
10973
11036
  <xsl:copy>
10974
11037
  <xsl:copy-of select="@*"/>
10975
11038
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -10979,6 +11042,12 @@
10979
11042
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10980
11043
  <xsl:apply-templates mode="update_xml_step1"/>
10981
11044
  </xsl:template>
11045
+ <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11046
+ <xsl:copy>
11047
+ <xsl:copy-of select="@*"/>
11048
+ <xsl:apply-templates mode="update_xml_step1"/>
11049
+ </xsl:copy>
11050
+ </xsl:template>
10982
11051
  <!-- =========================================================================== -->
10983
11052
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10984
11053
  <!-- =========================================================================== -->
@@ -11052,17 +11121,17 @@
11052
11121
  </xsl:template>
11053
11122
 
11054
11123
  <!-- add @reference for bibitem/note, similar to fn/reference -->
11055
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" mode="update_xml_step2">
11124
+ <!-- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" mode="update_xml_step2">
11056
11125
  <xsl:copy>
11057
11126
  <xsl:apply-templates select="@*" mode="update_xml_step2"/>
11058
-
11127
+
11059
11128
  <xsl:attribute name="reference">
11060
11129
  <xsl:value-of select="concat('bibitem_', ../@id, '_', count(preceding-sibling::*[local-name() = 'note']))"/>
11061
11130
  </xsl:attribute>
11062
-
11131
+
11063
11132
  <xsl:apply-templates select="node()" mode="update_xml_step2"/>
11064
11133
  </xsl:copy>
11065
- </xsl:template>
11134
+ </xsl:template> -->
11066
11135
 
11067
11136
  <!-- enclose sequence of 'char x' + 'combining char y' to <lang_none>xy</lang_none> -->
11068
11137
  <xsl:variable name="regex_combining_chars">(.[̀-ͯ])</xsl:variable>
@@ -11567,6 +11636,10 @@
11567
11636
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
11568
11637
  </xsl:template>
11569
11638
 
11639
+ <xsl:template name="getDocumentId_fromCurrentNode">
11640
+ <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
11641
+ </xsl:template>
11642
+
11570
11643
  <xsl:template name="namespaceCheck">
11571
11644
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
11572
11645
  <xsl:variable name="XSLNS">