metanorma-ogc 1.5.2 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -0
  3. data/lib/asciidoctor/ogc/cleanup.rb +35 -9
  4. data/lib/asciidoctor/ogc/converter.rb +6 -4
  5. data/lib/asciidoctor/ogc/isodoc.rng +61 -18
  6. data/lib/asciidoctor/ogc/validate.rb +12 -0
  7. data/lib/isodoc/ogc/base_convert.rb +2 -1
  8. data/lib/isodoc/ogc/html/htmlstyle.css +33 -14
  9. data/lib/isodoc/ogc/html/htmlstyle.scss +16 -10
  10. data/lib/isodoc/ogc/html/ogc.css +0 -1
  11. data/lib/isodoc/ogc/html/ogc.scss +0 -1
  12. data/lib/isodoc/ogc/html/ogc_wp.css +0 -1
  13. data/lib/isodoc/ogc/html/ogc_wp.scss +0 -1
  14. data/lib/isodoc/ogc/html/scripts.html +0 -1
  15. data/lib/isodoc/ogc/html/wordstyle.css +30 -18
  16. data/lib/isodoc/ogc/html/wordstyle.scss +30 -18
  17. data/lib/isodoc/ogc/html/wordstyle_wp.css +22 -12
  18. data/lib/isodoc/ogc/html/wordstyle_wp.scss +22 -12
  19. data/lib/isodoc/ogc/html_convert.rb +1 -0
  20. data/lib/isodoc/ogc/metadata.rb +7 -2
  21. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +457 -123
  22. data/lib/isodoc/ogc/ogc.best-practice.xsl +457 -123
  23. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +457 -123
  24. data/lib/isodoc/ogc/ogc.community-practice.xsl +457 -123
  25. data/lib/isodoc/ogc/ogc.community-standard.xsl +457 -123
  26. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +457 -123
  27. data/lib/isodoc/ogc/ogc.engineering-report.xsl +457 -123
  28. data/lib/isodoc/ogc/ogc.other.xsl +457 -123
  29. data/lib/isodoc/ogc/ogc.policy.xsl +457 -123
  30. data/lib/isodoc/ogc/ogc.reference-model.xsl +457 -123
  31. data/lib/isodoc/ogc/ogc.release-notes.xsl +457 -123
  32. data/lib/isodoc/ogc/ogc.standard.xsl +457 -123
  33. data/lib/isodoc/ogc/ogc.test-suite.xsl +457 -123
  34. data/lib/isodoc/ogc/ogc.user-guide.xsl +457 -123
  35. data/lib/isodoc/ogc/ogc.white-paper.xsl +334 -95
  36. data/lib/isodoc/ogc/presentation_xml_convert.rb +54 -4
  37. data/lib/isodoc/ogc/reqt.rb +1 -1
  38. data/lib/isodoc/ogc/sections.rb +9 -2
  39. data/lib/isodoc/ogc/word_convert.rb +28 -4
  40. data/lib/isodoc/ogc/xref.rb +4 -2
  41. data/lib/metanorma/ogc/version.rb +1 -1
  42. data/metanorma-ogc.gemspec +1 -1
  43. metadata +8 -8
@@ -7,6 +7,8 @@
7
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
8
  <xsl:param name="basepath"/>
9
9
 
10
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
11
+
10
12
  <xsl:variable name="pageWidth" select="215.9"/>
11
13
  <xsl:variable name="pageHeight" select="279.4"/>
12
14
  <xsl:variable name="marginLeftRight1" select="35"/>
@@ -60,19 +62,70 @@
60
62
  </xsl:variable>
61
63
  <xsl:variable name="color_blue">rgb(33, 55, 92)</xsl:variable>
62
64
 
65
+ <xsl:variable name="toc_recommendations_">
66
+ <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]">
67
+ <xsl:variable name="table_id" select="@id"/>
68
+ <recommendation alt-text="{.//ogc:p[@class = 'RecommendationTitle'][1]/text()}">
69
+ <xsl:copy-of select="@id"/>
70
+ <xsl:variable name="title">
71
+ <xsl:apply-templates select=".//ogc:p[@class = 'RecommendationTitle'][ancestor::ogc:table[1][@id= $table_id]]/node()"/>
72
+ </xsl:variable>
73
+ <xsl:variable name="bookmark" select="normalize-space(.//ogc:p[@class = 'RecommendationTitle'][ancestor::ogc:table[1][@id= $table_id]]/node())"/>
74
+ <xsl:variable name="regex_str" select="'^([^0-9]+) (\d+).*'"/>
75
+ <xsl:variable name="class" select="java:replaceAll(java:java.lang.String.new($bookmark), $regex_str, '$1')"/>
76
+ <xsl:variable name="num" select="java:replaceAll(java:java.lang.String.new($bookmark), $regex_str, '$2')"/>
77
+ <xsl:variable name="class_lc" select="java:toLowerCase(java:java.lang.String.new($class))"/>
78
+ <!-- <xsl:attribute name="class_str">
79
+ <xsl:value-of select="$class"/>
80
+ </xsl:attribute> -->
81
+ <xsl:attribute name="class">
82
+ <xsl:choose>
83
+ <xsl:when test="$class_lc = 'requirements class'">1</xsl:when>
84
+ <xsl:when test="$class_lc = 'requirement'">2</xsl:when>
85
+ <xsl:when test="$class_lc = 'recommendation'">3</xsl:when>
86
+ <xsl:when test="$class_lc = 'permission'">4</xsl:when>
87
+ <xsl:when test="$class_lc = 'conformance class'">5</xsl:when>
88
+ <xsl:when test="$class_lc = 'abstract test'">6</xsl:when>
89
+ <xsl:when test="$class_lc = 'requirement test'">7</xsl:when>
90
+ <xsl:when test="$class_lc = 'recommendation test'">8</xsl:when>
91
+ <xsl:when test="$class_lc = 'permission test'">9</xsl:when>
92
+ <xsl:otherwise>9999</xsl:otherwise>
93
+ </xsl:choose>
94
+ </xsl:attribute>
95
+ <xsl:attribute name="num">
96
+ <xsl:value-of select="$num"/>
97
+ </xsl:attribute>
98
+ <title>
99
+ <xsl:copy-of select="$title"/>
100
+ </title>
101
+ <bookmark>
102
+ <xsl:value-of select="$bookmark"/>
103
+ </bookmark>
104
+ </recommendation>
105
+ </xsl:for-each>
106
+ </xsl:variable>
107
+ <xsl:variable name="toc_recommendations">
108
+ <xsl:for-each select="xalan:nodeset($toc_recommendations_)/*">
109
+ <xsl:sort select="@class" data-type="number"/>
110
+ <xsl:sort select="@num" data-type="number"/>
111
+ <xsl:copy-of select="."/>
112
+ </xsl:for-each>
113
+ </xsl:variable>
114
+
63
115
  <xsl:variable name="contents">
64
116
  <contents>
65
117
 
66
118
  <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
67
119
  <!-- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*" mode="contents"/> -->
68
120
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract" mode="contents"/>
121
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'executivesummary']" mode="contents"/>
69
122
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'keywords']" mode="contents"/>
70
123
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="contents"/>
71
124
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'security']" mode="contents"/>
72
125
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'submitting_orgs']" mode="contents"/>
73
126
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters" mode="contents"/>
74
127
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="contents"/>
75
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'security') and not(@type = 'submitting_orgs') and not(@type = 'keywords')]" mode="contents"/>
128
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'executivesummary') and not(@type = 'security') and not(@type = 'submitting_orgs') and not(@type = 'keywords')]" mode="contents"/>
76
129
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:acknowledgements" mode="contents"/>
77
130
 
78
131
 
@@ -372,7 +425,7 @@
372
425
 
373
426
  <fo:block-container line-height="130%">
374
427
  <fo:block role="TOC">
375
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
428
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true' and normalize-space(@id) != '']">
376
429
 
377
430
  <fo:block role="TOCI">
378
431
  <xsl:if test="@level = 1">
@@ -381,7 +434,7 @@
381
434
  <xsl:if test="@level = 1 or @parent = 'annex'">
382
435
  <xsl:attribute name="font-size">12pt</xsl:attribute>
383
436
  </xsl:if>
384
- <xsl:if test="@level = 2 and not(@parent = 'annex')">
437
+ <xsl:if test="@level &gt;= 2 and not(@parent = 'annex')">
385
438
  <xsl:attribute name="font-size">10pt</xsl:attribute>
386
439
  </xsl:if>
387
440
 
@@ -399,7 +452,10 @@
399
452
  </fo:list-item-label>
400
453
  <fo:list-item-body start-indent="body-start()">
401
454
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
402
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
455
+ <fo:basic-link internal-destination="{@id}">
456
+ <xsl:call-template name="setAltText">
457
+ <xsl:with-param name="value" select="text()"/>
458
+ </xsl:call-template>
403
459
  <xsl:variable name="sectionTitle">
404
460
  <xsl:apply-templates select="title"/>
405
461
  </xsl:variable>
@@ -416,8 +472,17 @@
416
472
  </fo:list-block>
417
473
  </xsl:when>
418
474
  <xsl:otherwise>
419
- <fo:block text-align-last="justify" margin-left="8mm">
420
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
475
+ <xsl:variable name="margin-left">
476
+ <xsl:choose>
477
+ <xsl:when test="number(@level) != 'NaN'"><xsl:value-of select="(@level - 1) * 8"/></xsl:when>
478
+ <xsl:otherwise>8</xsl:otherwise>
479
+ </xsl:choose>
480
+ </xsl:variable>
481
+ <fo:block text-align-last="justify" margin-left="{$margin-left}mm">
482
+ <fo:basic-link internal-destination="{@id}">
483
+ <xsl:call-template name="setAltText">
484
+ <xsl:with-param name="value" select="text()"/>
485
+ </xsl:call-template>
421
486
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@section))"/>
422
487
  <xsl:text> </xsl:text>
423
488
  <xsl:apply-templates select="title"/>
@@ -437,7 +502,7 @@
437
502
  </fo:block>
438
503
  </fo:block-container>
439
504
 
440
- <xsl:if test="//ogc:table[@id and ogc:name and contains(ogc:name, '—')]">
505
+ <xsl:if test="//ogc:table[@id and ogc:name]"> <!-- contains(ogc:name, '—') -->
441
506
  <xsl:variable name="title-list-tables">
442
507
  <xsl:call-template name="getTitle">
443
508
  <xsl:with-param name="name" select="'title-list-tables'"/>
@@ -452,9 +517,12 @@
452
517
  </fo:block-container>
453
518
  </fo:block-container>
454
519
  <fo:block-container line-height="130%">
455
- <xsl:for-each select="//ogc:table[@id and ogc:name and contains(ogc:name, '—')]">
520
+ <xsl:for-each select="//ogc:table[@id and ogc:name and normalize-space(@id) != '']"> <!-- contains(ogc:name, '—') -->
456
521
  <fo:block text-align-last="justify" margin-top="2pt" role="TOCI">
457
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
522
+ <fo:basic-link internal-destination="{@id}">
523
+ <xsl:call-template name="setAltText">
524
+ <xsl:with-param name="value" select="ogc:name"/>
525
+ </xsl:call-template>
458
526
  <xsl:apply-templates select="ogc:name" mode="contents"/>
459
527
  <fo:inline keep-together.within-line="always">
460
528
  <fo:leader leader-pattern="dots"/>
@@ -465,8 +533,18 @@
465
533
  </xsl:for-each>
466
534
  </fo:block-container>
467
535
  </xsl:if>
468
-
469
- <xsl:if test="//ogc:figure[@id and ogc:name and contains(ogc:name, '—')]">
536
+
537
+ <xsl:variable name="list_of_figures_">
538
+ <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(ogc:name, 'Figure ') and normalize-space(@id) != '']">
539
+ <figure id="{@id}" alt-text="{ogc:name}">
540
+ <xsl:apply-templates select="ogc:name" mode="contents"/>
541
+ </figure>
542
+ </xsl:for-each>
543
+ </xsl:variable>
544
+ <xsl:variable name="list_of_figures" select="xalan:nodeset($list_of_figures_)"/>
545
+
546
+ <!-- <xsl:if test="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] or //*[@id and starts-with(ogc:name, 'Figure ')]"> --> <!-- contains(ogc:name, '—') -->
547
+ <xsl:if test="$list_of_figures//figure">
470
548
  <xsl:variable name="title-list-figures">
471
549
  <xsl:call-template name="getTitle">
472
550
  <xsl:with-param name="name" select="'title-list-figures'"/>
@@ -481,10 +559,15 @@
481
559
  </fo:block-container>
482
560
 
483
561
  <fo:block-container line-height="130%">
484
- <xsl:for-each select="//ogc:figure[@id and ogc:name and contains(ogc:name, '')]">
562
+ <!-- <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] or //*[@id and starts-with(ogc:name, 'Figure ')]"> --> <!-- contains(ogc:name, '—') -->
563
+ <xsl:for-each select="$list_of_figures/figure"> <!-- contains(ogc:name, '—') -->
485
564
  <fo:block text-align-last="justify" margin-top="2pt" role="TOCI">
486
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
487
- <xsl:apply-templates select="ogc:name" mode="contents"/>
565
+ <fo:basic-link internal-destination="{@id}">
566
+ <xsl:call-template name="setAltText">
567
+ <xsl:with-param name="value" select="@alt-text"/>
568
+ </xsl:call-template>
569
+ <!-- <xsl:apply-templates select="ogc:name" mode="contents"/> -->
570
+ <xsl:copy-of select="node()"/>
488
571
  <fo:inline keep-together.within-line="always">
489
572
  <fo:leader leader-pattern="dots"/>
490
573
  <fo:page-number-citation ref-id="{@id}"/>
@@ -512,12 +595,14 @@
512
595
  </fo:block-container>
513
596
 
514
597
  <fo:block-container line-height="130%">
515
- <!-- <xsl:for-each select="//ogc:permission[@id and ogc:name] | //ogc:recommendation[@id and ogc:name] | //ogc:requirement[@id and ogc:name]"> -->
516
- <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]">
517
- <xsl:variable name="table_id" select="@id"/>
598
+ <!-- <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]"> -->
599
+ <xsl:for-each select="xalan:nodeset($toc_recommendations)/*[normalize-space(@id) != '']">
518
600
  <fo:block text-align-last="justify" margin-top="6pt" role="TOCI">
519
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{.//ogc:p[@class = 'RecommendationTitle'][1]/text()}">
520
- <xsl:apply-templates select=".//ogc:p[@class = 'RecommendationTitle'][ancestor::ogc:table[1][@id= $table_id]]/node()"/>
601
+ <fo:basic-link internal-destination="{@id}">
602
+ <xsl:call-template name="setAltText">
603
+ <xsl:with-param name="value" select="@alt-text"/>
604
+ </xsl:call-template>
605
+ <xsl:copy-of select="title/node()"/>
521
606
  <xsl:text> </xsl:text>
522
607
  <fo:inline keep-together.within-line="always">
523
608
  <fo:leader leader-pattern="dots"/>
@@ -537,6 +622,7 @@
537
622
  <fo:block line-height="125%">
538
623
  <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
539
624
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract"/>
625
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'executivesummary']"/>
540
626
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'keywords']"/>
541
627
  <xsl:if test="/ogc:ogc-standard/ogc:preface/ogc:foreword">
542
628
  <fo:block break-after="page"/>
@@ -561,7 +647,7 @@
561
647
 
562
648
 
563
649
 
564
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'security') and not(@type = 'submitting_orgs') and not(@type = 'keywords')]"/>
650
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'executivesummary') and not(@type = 'security') and not(@type = 'submitting_orgs') and not(@type = 'keywords')]"/>
565
651
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:acknowledgements"/>
566
652
  </fo:block>
567
653
  </fo:flow>
@@ -695,7 +781,7 @@
695
781
 
696
782
  <xsl:variable name="display">
697
783
  <xsl:choose>
698
- <xsl:when test="$level &gt;= 3">false</xsl:when>
784
+ <xsl:when test="$level &gt; $toc_level">false</xsl:when>
699
785
  <xsl:otherwise>true</xsl:otherwise>
700
786
  </xsl:choose>
701
787
  </xsl:variable>
@@ -837,7 +923,7 @@
837
923
  </fo:block>
838
924
  </xsl:template>
839
925
 
840
- <xsl:template match="ogc:title">
926
+ <xsl:template match="ogc:title" name="title">
841
927
 
842
928
  <xsl:variable name="level">
843
929
  <xsl:call-template name="getLevel"/>
@@ -1003,32 +1089,6 @@
1003
1089
  </xsl:if>
1004
1090
  </xsl:template>
1005
1091
 
1006
- <!--
1007
- <fn reference="1">
1008
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
1009
- </fn>
1010
- -->
1011
- <xsl:template match="ogc:title//ogc:fn | ogc:name//ogc:fn | ogc:p/ogc:fn[not(ancestor::ogc:table)] | ogc:p/*/ogc:fn[not(ancestor::ogc:table)] | ogc:sourcecode/ogc:fn[not(ancestor::ogc:table)]" priority="2" name="fn">
1012
- <fo:footnote keep-with-previous.within-line="always">
1013
- <xsl:variable name="number" select="@reference"/>
1014
-
1015
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
1016
- <fo:basic-link internal-destination="footnote_{@reference}" fox:alt-text="footnote {@reference}">
1017
- <xsl:value-of select="$number"/><!-- + count(//ogc:bibitem/ogc:note) -->
1018
- </fo:basic-link>
1019
- </fo:inline>
1020
- <fo:footnote-body>
1021
- <fo:block font-size="10pt" margin-bottom="12pt" font-weight="normal" text-indent="0" start-indent="0" color="{$color_main}" line-height="124%" text-align="justify">
1022
- <fo:inline id="footnote_{@reference}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"> <!-- baseline-shift="30%" padding-right="3mm" font-size="60%" alignment-baseline="hanging" -->
1023
- <xsl:value-of select="$number "/><!-- + count(//ogc:bibitem/ogc:note) -->
1024
- </fo:inline>
1025
- <xsl:for-each select="ogc:p">
1026
- <xsl:apply-templates/>
1027
- </xsl:for-each>
1028
- </fo:block>
1029
- </fo:footnote-body>
1030
- </fo:footnote>
1031
- </xsl:template>
1032
1092
 
1033
1093
  <xsl:template match="ogc:fn/ogc:p">
1034
1094
  <fo:block>
@@ -1113,13 +1173,10 @@
1113
1173
  <fo:list-item id="{@id}">
1114
1174
  <fo:list-item-label end-indent="label-end()">
1115
1175
  <fo:block>
1116
- <xsl:if test="local-name(..) = 'ul'">
1117
- <xsl:attribute name="color">
1118
- <xsl:value-of select="$color_design"/>
1119
- </xsl:attribute>
1120
- </xsl:if>
1121
1176
  <xsl:choose>
1122
- <xsl:when test="local-name(..) = 'ul'">•</xsl:when> <!-- &#x2014; dash -->
1177
+ <xsl:when test="local-name(..) = 'ul'">
1178
+ <xsl:call-template name="setULLabel"/>
1179
+ </xsl:when>
1123
1180
  <xsl:otherwise> <!-- for ordered lists -->
1124
1181
  <xsl:choose>
1125
1182
  <xsl:when test="../@class = 'steps'">
@@ -1193,7 +1250,7 @@
1193
1250
  <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" priority="2"/>
1194
1251
 
1195
1252
  <xsl:template match="ogc:preferred" mode="term_name">
1196
- <fo:inline font-size="18pt" padding-right="3mm"><xsl:apply-templates/></fo:inline>
1253
+ <fo:inline font-size="18pt" padding-right="3mm"><xsl:call-template name="setStyle_preferred"/><xsl:apply-templates/></fo:inline>
1197
1254
  <fo:inline padding-right="2mm"> </fo:inline>
1198
1255
  </xsl:template>
1199
1256
 
@@ -2241,6 +2298,80 @@
2241
2298
 
2242
2299
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
2243
2300
  <xsl:attribute name="line-height">135%</xsl:attribute>
2301
+ </xsl:attribute-set><xsl:attribute-set name="fn-style">
2302
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2303
+ </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
2304
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2305
+
2306
+
2307
+
2308
+
2309
+
2310
+
2311
+
2312
+
2313
+
2314
+
2315
+
2316
+
2317
+
2318
+ <xsl:attribute name="font-size">65%</xsl:attribute>
2319
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2320
+
2321
+
2322
+
2323
+
2324
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
2325
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2326
+ <xsl:attribute name="font-style">normal</xsl:attribute>
2327
+ <xsl:attribute name="text-indent">0</xsl:attribute>
2328
+ <xsl:attribute name="start-indent">0</xsl:attribute>
2329
+
2330
+
2331
+
2332
+
2333
+
2334
+
2335
+
2336
+
2337
+
2338
+
2339
+
2340
+
2341
+
2342
+
2343
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2344
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2345
+ <xsl:attribute name="color"><xsl:value-of select="$color_main"/></xsl:attribute>
2346
+ <xsl:attribute name="line-height">124%</xsl:attribute>
2347
+ <xsl:attribute name="text-align">justify</xsl:attribute>
2348
+
2349
+
2350
+
2351
+
2352
+
2353
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
2354
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
2355
+
2356
+
2357
+
2358
+
2359
+
2360
+
2361
+
2362
+
2363
+
2364
+
2365
+
2366
+
2367
+
2368
+
2369
+ <xsl:attribute name="font-size">60%</xsl:attribute>
2370
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2371
+
2372
+
2373
+
2374
+
2244
2375
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
2245
2376
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2246
2377
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -2266,7 +2397,8 @@
2266
2397
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
2267
2398
 
2268
2399
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2269
- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2400
+
2401
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
2270
2402
  <xsl:sort select="@displayorder" data-type="number"/>
2271
2403
  <xsl:apply-templates select="." mode="contents"/>
2272
2404
  </xsl:for-each>
@@ -2276,7 +2408,7 @@
2276
2408
  <xsl:apply-templates select="." mode="contents"/>
2277
2409
  </xsl:for-each>
2278
2410
 
2279
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2411
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2280
2412
  <xsl:sort select="@displayorder" data-type="number"/>
2281
2413
  <xsl:apply-templates select="." mode="contents"/>
2282
2414
  </xsl:for-each>
@@ -3207,6 +3339,102 @@
3207
3339
 
3208
3340
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
3209
3341
  <xsl:apply-templates/>
3342
+ </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
3343
+
3344
+ <!-- list of footnotes to calculate actual footnotes number -->
3345
+ <xsl:variable name="p_fn_">
3346
+ <xsl:choose>
3347
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
3348
+ <fn gen_id="{generate-id(.)}">
3349
+ <xsl:copy-of select="@*"/>
3350
+ <xsl:copy-of select="node()"/>
3351
+ </fn>
3352
+ </xsl:when>
3353
+ <xsl:otherwise>
3354
+ <!-- itetation for:
3355
+ footnotes in bibdata/title
3356
+ footnotes in bibliography
3357
+ footnotes in document's body (except table's head/body/foot and figure text)
3358
+ -->
3359
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
3360
+ <fn gen_id="{generate-id(.)}">
3361
+ <xsl:copy-of select="@*"/>
3362
+ <xsl:copy-of select="node()"/>
3363
+ </fn>
3364
+ </xsl:for-each>
3365
+ <xsl:for-each select="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']/*">
3366
+ <xsl:sort select="@displayorder" data-type="number"/>
3367
+ <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])]">
3368
+ <!-- copy unique fn -->
3369
+ <fn gen_id="{generate-id(.)}">
3370
+ <xsl:copy-of select="@*"/>
3371
+ <xsl:copy-of select="node()"/>
3372
+ </fn>
3373
+ </xsl:for-each>
3374
+ </xsl:for-each>
3375
+ </xsl:otherwise>
3376
+ </xsl:choose>
3377
+ </xsl:variable>
3378
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3379
+
3380
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
3381
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
3382
+ <xsl:variable name="reference" select="@reference"/>
3383
+ <!-- fn sequence number in document -->
3384
+ <xsl:variable name="current_fn_number">
3385
+ <xsl:choose>
3386
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
3387
+ <xsl:otherwise>
3388
+ <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
3389
+ </xsl:otherwise>
3390
+ </xsl:choose>
3391
+ </xsl:variable>
3392
+ <xsl:variable name="current_fn_number_text">
3393
+ <xsl:value-of select="$current_fn_number"/>
3394
+
3395
+
3396
+ </xsl:variable>
3397
+
3398
+ <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3399
+ <xsl:variable name="footnote_inline">
3400
+ <fo:inline xsl:use-attribute-sets="fn-num-style">
3401
+
3402
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3403
+ <xsl:value-of select="$current_fn_number_text"/>
3404
+ </fo:basic-link>
3405
+ </fo:inline>
3406
+ </xsl:variable>
3407
+ <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
3408
+ gen_id=<xsl:value-of select="$gen_id"/> -->
3409
+ <xsl:choose>
3410
+ <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
3411
+ <xsl:copy-of select="$footnote_inline"/>
3412
+ </xsl:when>
3413
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
3414
+ <fo:footnote xsl:use-attribute-sets="fn-style">
3415
+ <xsl:copy-of select="$footnote_inline"/>
3416
+ <fo:footnote-body>
3417
+
3418
+ <fo:block-container text-indent="0" start-indent="0">
3419
+
3420
+
3421
+ <fo:block xsl:use-attribute-sets="fn-body-style">
3422
+
3423
+
3424
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3425
+
3426
+ <xsl:value-of select="$current_fn_number_text"/>
3427
+ </fo:inline>
3428
+ <xsl:apply-templates/>
3429
+ </fo:block>
3430
+ </fo:block-container>
3431
+ </fo:footnote-body>
3432
+ </fo:footnote>
3433
+ </xsl:when>
3434
+ <xsl:otherwise>
3435
+ <xsl:copy-of select="$footnote_inline"/>
3436
+ </xsl:otherwise>
3437
+ </xsl:choose>
3210
3438
  </xsl:template><xsl:template name="fn_display">
3211
3439
  <xsl:variable name="references">
3212
3440
 
@@ -3412,6 +3640,8 @@
3412
3640
 
3413
3641
  </fo:basic-link>
3414
3642
  </fo:inline>
3643
+ </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
3644
+ <fo:inline><xsl:value-of select="."/></fo:inline>
3415
3645
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
3416
3646
  <fo:inline>
3417
3647
  <xsl:apply-templates/>
@@ -3774,6 +4004,7 @@
3774
4004
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3775
4005
  <xsl:apply-templates/>
3776
4006
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
4007
+ <xsl:apply-templates select="@language"/>
3777
4008
  <xsl:apply-templates/>
3778
4009
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3779
4010
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
@@ -3811,7 +4042,7 @@
3811
4042
 
3812
4043
 
3813
4044
 
3814
- 10
4045
+ 9.5
3815
4046
 
3816
4047
 
3817
4048
 
@@ -4407,22 +4638,6 @@
4407
4638
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
4408
4639
  <xsl:apply-templates/>
4409
4640
  </fo:inline>
4410
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
4411
- <xsl:variable name="title-modified">
4412
-
4413
-
4414
- <xsl:call-template name="getTitle">
4415
- <xsl:with-param name="name" select="'title-modified'"/>
4416
- </xsl:call-template>
4417
-
4418
- </xsl:variable>
4419
-
4420
- <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4421
- <xsl:choose>
4422
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
4423
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
4424
- </xsl:choose>
4425
- <xsl:apply-templates/>
4426
4641
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
4427
4642
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
4428
4643
 
@@ -4995,12 +5210,12 @@
4995
5210
  </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
4996
5211
  <xsl:apply-templates mode="contents"/>
4997
5212
  <xsl:text> </xsl:text>
4998
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
5213
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
4999
5214
  <xsl:apply-templates mode="bookmarks"/>
5000
5215
  <xsl:text> </xsl:text>
5001
5216
  </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
5002
5217
  <xsl:value-of select="."/>
5003
- </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
5218
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
5004
5219
  <xsl:value-of select="."/>
5005
5220
  </xsl:template><xsl:template match="node()" mode="contents">
5006
5221
  <xsl:apply-templates mode="contents"/>
@@ -5099,14 +5314,14 @@
5099
5314
 
5100
5315
 
5101
5316
  <xsl:variable name="list_of_tables_">
5102
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and contains(*[local-name() = 'name'], '—')]">
5317
+ <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']]"> <!-- contains(*[local-name() = 'name'], '—') -->
5103
5318
  <table id="{@id}"><xsl:apply-templates select="*[local-name() = 'name']" mode="bookmarks"/></table>
5104
5319
  </xsl:for-each>
5105
5320
  </xsl:variable>
5106
5321
  <xsl:variable name="list_of_tables" select="xalan:nodeset($list_of_tables_)"/>
5107
5322
 
5108
5323
  <xsl:variable name="list_of_figures_">
5109
- <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and contains(*[local-name() = 'name'], '')]">
5324
+ <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true')] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ')]"> <!-- contains(*[local-name() = 'name'], '—') -->
5110
5325
  <figure id="{@id}"><xsl:apply-templates select="*[local-name() = 'name']" mode="bookmarks"/></figure>
5111
5326
  </xsl:for-each>
5112
5327
  </xsl:variable>
@@ -5159,10 +5374,11 @@
5159
5374
  <xsl:with-param name="name" select="'title-list-recommendations'"/>
5160
5375
  </xsl:call-template>
5161
5376
  </fo:bookmark-title>
5162
- <xsl:for-each select="//*[local-name() = 'table'][.//*[local-name() = 'p'][@class = 'RecommendationTitle']]">
5377
+ <!-- <xsl:for-each select="//*[local-name() = 'table'][.//*[local-name() = 'p'][@class = 'RecommendationTitle']]"> -->
5378
+ <xsl:for-each select="xalan:nodeset($toc_recommendations)/*">
5163
5379
  <xsl:variable name="table_id" select="@id"/>
5164
5380
  <fo:bookmark internal-destination="{@id}">
5165
- <fo:bookmark-title><xsl:value-of select=".//*[local-name() = 'p'][@class = 'RecommendationTitle'][ancestor::*[local-name() = 'table'][1][@id= $table_id]]/node()"/></fo:bookmark-title>
5381
+ <fo:bookmark-title><xsl:value-of select="bookmark"/></fo:bookmark-title>
5166
5382
  </fo:bookmark>
5167
5383
  </xsl:for-each>
5168
5384
  </fo:bookmark>
@@ -5341,6 +5557,12 @@
5341
5557
 
5342
5558
 
5343
5559
 
5560
+
5561
+ <xsl:if test="parent::*[local-name() = 'example']">
5562
+ <fo:block font-size="1pt" line-height="10%" space-after="4pt"> </fo:block>
5563
+ </xsl:if>
5564
+
5565
+
5344
5566
  <fo:block xsl:use-attribute-sets="sourcecode-style">
5345
5567
  <xsl:variable name="_font-size">
5346
5568
 
@@ -5355,7 +5577,7 @@
5355
5577
 
5356
5578
 
5357
5579
 
5358
-
5580
+ 9.5
5359
5581
 
5360
5582
 
5361
5583
 
@@ -5374,13 +5596,25 @@
5374
5596
 
5375
5597
 
5376
5598
 
5599
+
5600
+ <xsl:if test="parent::*[local-name() = 'example']">
5601
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
5602
+ </xsl:if>
5603
+
5604
+
5377
5605
  <xsl:apply-templates/>
5378
5606
  </fo:block>
5379
-
5607
+
5380
5608
 
5381
5609
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5382
5610
 
5383
5611
 
5612
+
5613
+ <xsl:if test="parent::*[local-name() = 'example']">
5614
+ <fo:block font-size="1pt" line-height="10%" space-before="6pt"> </fo:block>
5615
+ </xsl:if>
5616
+
5617
+
5384
5618
  </fo:block-container>
5385
5619
  </fo:block-container>
5386
5620
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -5737,59 +5971,71 @@
5737
5971
  <xsl:variable name="termsource_text">
5738
5972
  <xsl:apply-templates/>
5739
5973
  </xsl:variable>
5740
-
5741
- <xsl:choose>
5974
+ <xsl:copy-of select="$termsource_text"/>
5975
+ <!-- <xsl:choose>
5742
5976
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
5743
- <!-- <xsl:apply-templates /> -->
5744
5977
  <xsl:copy-of select="$termsource_text"/>
5745
5978
  </xsl:when>
5746
5979
  <xsl:otherwise>
5747
-
5748
-
5749
- <!-- <xsl:apply-templates /> -->
5980
+ <xsl:if test="$namespace = 'bsi'">
5981
+ <xsl:choose>
5982
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
5983
+ <xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
5984
+ </xsl:choose>
5985
+ </xsl:if>
5986
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
5987
+ <xsl:text>[</xsl:text>
5988
+ </xsl:if>
5750
5989
  <xsl:copy-of select="$termsource_text"/>
5751
-
5752
-
5990
+ <xsl:if test="$namespace = 'bsi'">
5991
+ <xsl:choose>
5992
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
5993
+ <xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
5994
+ </xsl:choose>
5995
+ </xsl:if>
5996
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
5997
+ <xsl:text>]</xsl:text>
5998
+ </xsl:if>
5753
5999
  </xsl:otherwise>
5754
- </xsl:choose>
6000
+ </xsl:choose> -->
5755
6001
  </fo:block>
5756
6002
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
5757
6003
  <xsl:if test="normalize-space() != ''">
5758
6004
  <xsl:value-of select="."/>
5759
6005
  </xsl:if>
5760
- </xsl:template><xsl:variable name="localized.source">
5761
- <xsl:call-template name="getLocalizedString">
5762
- <xsl:with-param name="key">source</xsl:with-param>
5763
- </xsl:call-template>
5764
- </xsl:variable><xsl:template match="*[local-name() = 'origin']">
6006
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
6007
+ <fo:inline>
6008
+
6009
+
6010
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
6011
+
6012
+ <xsl:value-of select="."/>
6013
+ </fo:inline>
6014
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
5765
6015
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5766
6016
  <xsl:if test="normalize-space(@citeas) = ''">
5767
6017
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5768
6018
  </xsl:if>
5769
-
5770
- <xsl:text>[</xsl:text>
5771
- <fo:inline>
5772
-
5773
- <xsl:attribute name="font-weight">bold</xsl:attribute>
5774
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
5775
-
5776
-
5777
-
5778
-
5779
-
5780
- <xsl:value-of select="$localized.source"/>
5781
- <xsl:text>: </xsl:text>
5782
-
5783
-
5784
-
5785
-
5786
- </fo:inline>
5787
-
5788
6019
  <fo:inline xsl:use-attribute-sets="origin-style">
5789
6020
  <xsl:apply-templates/>
5790
6021
  </fo:inline>
5791
- <xsl:text>]</xsl:text>
5792
- </fo:basic-link>
6022
+ </fo:basic-link>
6023
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
6024
+ <xsl:variable name="title-modified">
6025
+
6026
+
6027
+ <xsl:call-template name="getTitle">
6028
+ <xsl:with-param name="name" select="'title-modified'"/>
6029
+ </xsl:call-template>
6030
+
6031
+ </xsl:variable>
6032
+
6033
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
6034
+ <xsl:choose>
6035
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
6036
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
6037
+ </xsl:choose>
6038
+ <xsl:apply-templates/>
5793
6039
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
5794
6040
  <fo:inline><xsl:apply-templates/></fo:inline>
5795
6041
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
@@ -5972,24 +6218,29 @@
5972
6218
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5973
6219
  <xsl:variable name="title-deprecated">
5974
6220
 
5975
-
5976
- <xsl:call-template name="getTitle">
5977
- <xsl:with-param name="name" select="'title-deprecated'"/>
6221
+ <xsl:call-template name="getLocalizedString">
6222
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5978
6223
  </xsl:call-template>
5979
6224
 
6225
+
5980
6226
  </xsl:variable>
5981
6227
  <fo:block xsl:use-attribute-sets="deprecates-style">
5982
6228
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
5983
6229
  </fo:block>
6230
+ </xsl:template><xsl:template name="setStyle_preferred">
6231
+ <xsl:if test="*[local-name() = 'strong']">
6232
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
6233
+ </xsl:if>
5984
6234
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
5985
6235
  <fo:block xsl:use-attribute-sets="definition-style">
5986
6236
  <xsl:apply-templates/>
5987
6237
  </fo:block>
5988
6238
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
5989
6239
  <xsl:apply-templates/>
5990
- </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
6240
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
5991
6241
  <fo:inline> <xsl:apply-templates/></fo:inline>
5992
- <fo:block> </fo:block>
6242
+ <!-- <fo:block>&#xA0;</fo:block> -->
6243
+ <fo:block/>
5993
6244
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
5994
6245
 
5995
6246
  <fo:block>
@@ -6050,6 +6301,51 @@
6050
6301
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
6051
6302
  <!-- 0xA0 to space replacement -->
6052
6303
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
6304
+ </xsl:template><xsl:variable name="ul_labels_">
6305
+
6306
+
6307
+
6308
+
6309
+
6310
+
6311
+
6312
+
6313
+
6314
+
6315
+
6316
+
6317
+
6318
+ <label color="{$color_design}">•</label>
6319
+
6320
+
6321
+
6322
+
6323
+
6324
+ </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
6325
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
6326
+ <xsl:variable name="list_level">
6327
+ <xsl:choose>
6328
+ <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
6329
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
6330
+ </xsl:choose>
6331
+ </xsl:variable>
6332
+ <xsl:choose>
6333
+ <xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
6334
+ <xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
6335
+ </xsl:when>
6336
+ <xsl:when test="$list_level mod 3 = 0">
6337
+ <xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
6338
+ </xsl:when>
6339
+ <xsl:when test="$list_level mod 2 = 0">
6340
+ <xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
6341
+ </xsl:when>
6342
+ <xsl:otherwise>
6343
+ <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
6344
+ </xsl:otherwise>
6345
+ </xsl:choose>
6346
+ </xsl:template><xsl:template match="label" mode="ul_labels">
6347
+ <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
6348
+ <xsl:value-of select="."/>
6053
6349
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
6054
6350
  <xsl:choose>
6055
6351
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -6530,7 +6826,31 @@
6530
6826
  <fo:block-container border="1pt solid black" width="50%">
6531
6827
  <fo:block> </fo:block>
6532
6828
  </fo:block-container>
6533
- </xsl:template><xsl:template match="*[local-name() = 'toc']">
6829
+ </xsl:template><xsl:variable name="toc_level">
6830
+ <xsl:choose>
6831
+ <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
6832
+ <xsl:otherwise><!-- default value -->
6833
+
6834
+
6835
+
6836
+
6837
+
6838
+
6839
+
6840
+
6841
+
6842
+
6843
+
6844
+
6845
+
6846
+ 2
6847
+
6848
+
6849
+
6850
+
6851
+ </xsl:otherwise>
6852
+ </xsl:choose>
6853
+ </xsl:variable><xsl:template match="*[local-name() = 'toc']">
6534
6854
  <xsl:param name="colwidths"/>
6535
6855
  <xsl:variable name="colwidths_">
6536
6856
  <xsl:choose>
@@ -6621,6 +6941,10 @@
6621
6941
  </svg>
6622
6942
  </fo:instream-foreign-object>
6623
6943
  </fo:inline>
6944
+ </xsl:template><xsl:template match="@language">
6945
+ <xsl:copy-of select="."/>
6946
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
6947
+ <xsl:call-template name="title"/>
6624
6948
  </xsl:template><xsl:template name="convertDate">
6625
6949
  <xsl:param name="date"/>
6626
6950
  <xsl:param name="format" select="'short'"/>
@@ -7170,4 +7494,14 @@
7170
7494
  </xsl:otherwise>
7171
7495
  </xsl:choose>
7172
7496
  </xsl:if>
7497
+ </xsl:template><xsl:template name="setAltText">
7498
+ <xsl:param name="value"/>
7499
+ <xsl:attribute name="fox:alt-text">
7500
+ <xsl:choose>
7501
+ <xsl:when test="normalize-space($value) != ''">
7502
+ <xsl:value-of select="$value"/>
7503
+ </xsl:when>
7504
+ <xsl:otherwise>_</xsl:otherwise>
7505
+ </xsl:choose>
7506
+ </xsl:attribute>
7173
7507
  </xsl:template></xsl:stylesheet>