metanorma-ogc 1.5.2 → 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/asciidoctor/ogc/cleanup.rb +9 -0
  3. data/lib/asciidoctor/ogc/converter.rb +4 -2
  4. data/lib/asciidoctor/ogc/isodoc.rng +42 -17
  5. data/lib/asciidoctor/ogc/validate.rb +12 -0
  6. data/lib/isodoc/ogc/base_convert.rb +2 -1
  7. data/lib/isodoc/ogc/html/htmlstyle.css +6 -2
  8. data/lib/isodoc/ogc/html/htmlstyle.scss +6 -1
  9. data/lib/isodoc/ogc/html/ogc.css +0 -1
  10. data/lib/isodoc/ogc/html/ogc.scss +0 -1
  11. data/lib/isodoc/ogc/html/ogc_wp.css +0 -1
  12. data/lib/isodoc/ogc/html/ogc_wp.scss +0 -1
  13. data/lib/isodoc/ogc/html_convert.rb +1 -0
  14. data/lib/isodoc/ogc/metadata.rb +6 -2
  15. data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +119 -31
  16. data/lib/isodoc/ogc/ogc.best-practice.xsl +119 -31
  17. data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +119 -31
  18. data/lib/isodoc/ogc/ogc.community-practice.xsl +119 -31
  19. data/lib/isodoc/ogc/ogc.community-standard.xsl +119 -31
  20. data/lib/isodoc/ogc/ogc.discussion-paper.xsl +119 -31
  21. data/lib/isodoc/ogc/ogc.engineering-report.xsl +119 -31
  22. data/lib/isodoc/ogc/ogc.other.xsl +119 -31
  23. data/lib/isodoc/ogc/ogc.policy.xsl +119 -31
  24. data/lib/isodoc/ogc/ogc.reference-model.xsl +119 -31
  25. data/lib/isodoc/ogc/ogc.release-notes.xsl +119 -31
  26. data/lib/isodoc/ogc/ogc.standard.xsl +119 -31
  27. data/lib/isodoc/ogc/ogc.test-suite.xsl +119 -31
  28. data/lib/isodoc/ogc/ogc.user-guide.xsl +119 -31
  29. data/lib/isodoc/ogc/ogc.white-paper.xsl +29 -14
  30. data/lib/isodoc/ogc/presentation_xml_convert.rb +31 -2
  31. data/lib/isodoc/ogc/sections.rb +9 -2
  32. data/lib/isodoc/ogc/word_convert.rb +28 -4
  33. data/lib/isodoc/ogc/xref.rb +4 -2
  34. data/lib/metanorma/ogc/version.rb +1 -1
  35. data/metanorma-ogc.gemspec +1 -1
  36. metadata +7 -7
@@ -60,19 +60,70 @@
60
60
  </xsl:variable>
61
61
  <xsl:variable name="color_blue">rgb(33, 55, 92)</xsl:variable>
62
62
 
63
+ <xsl:variable name="toc_recommendations_">
64
+ <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]">
65
+ <xsl:variable name="table_id" select="@id"/>
66
+ <recommendation alt-text="{.//ogc:p[@class = 'RecommendationTitle'][1]/text()}">
67
+ <xsl:copy-of select="@id"/>
68
+ <xsl:variable name="title">
69
+ <xsl:apply-templates select=".//ogc:p[@class = 'RecommendationTitle'][ancestor::ogc:table[1][@id= $table_id]]/node()"/>
70
+ </xsl:variable>
71
+ <xsl:variable name="bookmark" select="normalize-space(.//ogc:p[@class = 'RecommendationTitle'][ancestor::ogc:table[1][@id= $table_id]]/node())"/>
72
+ <xsl:variable name="regex_str" select="'^([^0-9]+) (\d+).*'"/>
73
+ <xsl:variable name="class" select="java:replaceAll(java:java.lang.String.new($bookmark), $regex_str, '$1')"/>
74
+ <xsl:variable name="num" select="java:replaceAll(java:java.lang.String.new($bookmark), $regex_str, '$2')"/>
75
+ <xsl:variable name="class_lc" select="java:toLowerCase(java:java.lang.String.new($class))"/>
76
+ <!-- <xsl:attribute name="class_str">
77
+ <xsl:value-of select="$class"/>
78
+ </xsl:attribute> -->
79
+ <xsl:attribute name="class">
80
+ <xsl:choose>
81
+ <xsl:when test="$class_lc = 'requirements class'">1</xsl:when>
82
+ <xsl:when test="$class_lc = 'requirement'">2</xsl:when>
83
+ <xsl:when test="$class_lc = 'recommendation'">3</xsl:when>
84
+ <xsl:when test="$class_lc = 'permission'">4</xsl:when>
85
+ <xsl:when test="$class_lc = 'conformance class'">5</xsl:when>
86
+ <xsl:when test="$class_lc = 'abstract test'">6</xsl:when>
87
+ <xsl:when test="$class_lc = 'requirement test'">7</xsl:when>
88
+ <xsl:when test="$class_lc = 'recommendation test'">8</xsl:when>
89
+ <xsl:when test="$class_lc = 'permission test'">9</xsl:when>
90
+ <xsl:otherwise>9999</xsl:otherwise>
91
+ </xsl:choose>
92
+ </xsl:attribute>
93
+ <xsl:attribute name="num">
94
+ <xsl:value-of select="$num"/>
95
+ </xsl:attribute>
96
+ <title>
97
+ <xsl:copy-of select="$title"/>
98
+ </title>
99
+ <bookmark>
100
+ <xsl:value-of select="$bookmark"/>
101
+ </bookmark>
102
+ </recommendation>
103
+ </xsl:for-each>
104
+ </xsl:variable>
105
+ <xsl:variable name="toc_recommendations">
106
+ <xsl:for-each select="xalan:nodeset($toc_recommendations_)/*">
107
+ <xsl:sort select="@class" data-type="number"/>
108
+ <xsl:sort select="@num" data-type="number"/>
109
+ <xsl:copy-of select="."/>
110
+ </xsl:for-each>
111
+ </xsl:variable>
112
+
63
113
  <xsl:variable name="contents">
64
114
  <contents>
65
115
 
66
116
  <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
67
117
  <!-- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*" mode="contents"/> -->
68
118
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract" mode="contents"/>
119
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'executivesummary']" mode="contents"/>
69
120
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'keywords']" mode="contents"/>
70
121
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="contents"/>
71
122
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'security']" mode="contents"/>
72
123
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'submitting_orgs']" mode="contents"/>
73
124
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters" mode="contents"/>
74
125
  <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"/>
126
+ <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
127
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:acknowledgements" mode="contents"/>
77
128
 
78
129
 
@@ -437,7 +488,7 @@
437
488
  </fo:block>
438
489
  </fo:block-container>
439
490
 
440
- <xsl:if test="//ogc:table[@id and ogc:name and contains(ogc:name, '—')]">
491
+ <xsl:if test="//ogc:table[@id and ogc:name]"> <!-- contains(ogc:name, '—') -->
441
492
  <xsl:variable name="title-list-tables">
442
493
  <xsl:call-template name="getTitle">
443
494
  <xsl:with-param name="name" select="'title-list-tables'"/>
@@ -452,7 +503,7 @@
452
503
  </fo:block-container>
453
504
  </fo:block-container>
454
505
  <fo:block-container line-height="130%">
455
- <xsl:for-each select="//ogc:table[@id and ogc:name and contains(ogc:name, '—')]">
506
+ <xsl:for-each select="//ogc:table[@id and ogc:name]"> <!-- contains(ogc:name, '—') -->
456
507
  <fo:block text-align-last="justify" margin-top="2pt" role="TOCI">
457
508
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
458
509
  <xsl:apply-templates select="ogc:name" mode="contents"/>
@@ -465,8 +516,18 @@
465
516
  </xsl:for-each>
466
517
  </fo:block-container>
467
518
  </xsl:if>
468
-
469
- <xsl:if test="//ogc:figure[@id and ogc:name and contains(ogc:name, '—')]">
519
+
520
+ <xsl:variable name="list_of_figures_">
521
+ <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] | //*[@id and starts-with(ogc:name, 'Figure ')]">
522
+ <figure id="{@id}" alt-text="{ogc:name}">
523
+ <xsl:apply-templates select="ogc:name" mode="contents"/>
524
+ </figure>
525
+ </xsl:for-each>
526
+ </xsl:variable>
527
+ <xsl:variable name="list_of_figures" select="xalan:nodeset($list_of_figures_)"/>
528
+
529
+ <!-- <xsl:if test="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] or //*[@id and starts-with(ogc:name, 'Figure ')]"> --> <!-- contains(ogc:name, '—') -->
530
+ <xsl:if test="$list_of_figures//figure">
470
531
  <xsl:variable name="title-list-figures">
471
532
  <xsl:call-template name="getTitle">
472
533
  <xsl:with-param name="name" select="'title-list-figures'"/>
@@ -481,10 +542,12 @@
481
542
  </fo:block-container>
482
543
 
483
544
  <fo:block-container line-height="130%">
484
- <xsl:for-each select="//ogc:figure[@id and ogc:name and contains(ogc:name, '')]">
545
+ <!-- <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, '—') -->
546
+ <xsl:for-each select="$list_of_figures/figure"> <!-- contains(ogc:name, '—') -->
485
547
  <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"/>
548
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{@alt-text}">
549
+ <!-- <xsl:apply-templates select="ogc:name" mode="contents"/> -->
550
+ <xsl:copy-of select="node()"/>
488
551
  <fo:inline keep-together.within-line="always">
489
552
  <fo:leader leader-pattern="dots"/>
490
553
  <fo:page-number-citation ref-id="{@id}"/>
@@ -512,12 +575,11 @@
512
575
  </fo:block-container>
513
576
 
514
577
  <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"/>
578
+ <!-- <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]"> -->
579
+ <xsl:for-each select="xalan:nodeset($toc_recommendations)/*">
518
580
  <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()"/>
581
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{@alt-text}">
582
+ <xsl:copy-of select="title/node()"/>
521
583
  <xsl:text> </xsl:text>
522
584
  <fo:inline keep-together.within-line="always">
523
585
  <fo:leader leader-pattern="dots"/>
@@ -537,6 +599,7 @@
537
599
  <fo:block line-height="125%">
538
600
  <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
539
601
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract"/>
602
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'executivesummary']"/>
540
603
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'keywords']"/>
541
604
  <xsl:if test="/ogc:ogc-standard/ogc:preface/ogc:foreword">
542
605
  <fo:block break-after="page"/>
@@ -561,7 +624,7 @@
561
624
 
562
625
 
563
626
 
564
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'security') and not(@type = 'submitting_orgs') and not(@type = 'keywords')]"/>
627
+ <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
628
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:acknowledgements"/>
566
629
  </fo:block>
567
630
  </fo:flow>
@@ -1193,7 +1256,7 @@
1193
1256
  <xsl:template match="ogc:preferred | ogc:deprecated | ogc:admitted" priority="2"/>
1194
1257
 
1195
1258
  <xsl:template match="ogc:preferred" mode="term_name">
1196
- <fo:inline font-size="18pt" padding-right="3mm"><xsl:apply-templates/></fo:inline>
1259
+ <fo:inline font-size="18pt" padding-right="3mm"><xsl:call-template name="setStyle_preferred"/><xsl:apply-templates/></fo:inline>
1197
1260
  <fo:inline padding-right="2mm"> </fo:inline>
1198
1261
  </xsl:template>
1199
1262
 
@@ -2266,7 +2329,8 @@
2266
2329
  <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
2330
 
2268
2331
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
2269
- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2332
+
2333
+ <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
2334
  <xsl:sort select="@displayorder" data-type="number"/>
2271
2335
  <xsl:apply-templates select="." mode="contents"/>
2272
2336
  </xsl:for-each>
@@ -2276,7 +2340,7 @@
2276
2340
  <xsl:apply-templates select="." mode="contents"/>
2277
2341
  </xsl:for-each>
2278
2342
 
2279
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2343
+ <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
2344
  <xsl:sort select="@displayorder" data-type="number"/>
2281
2345
  <xsl:apply-templates select="." mode="contents"/>
2282
2346
  </xsl:for-each>
@@ -3811,7 +3875,7 @@
3811
3875
 
3812
3876
 
3813
3877
 
3814
- 10
3878
+ 9.5
3815
3879
 
3816
3880
 
3817
3881
 
@@ -4995,12 +5059,12 @@
4995
5059
  </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
5060
  <xsl:apply-templates mode="contents"/>
4997
5061
  <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">
5062
+ </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
5063
  <xsl:apply-templates mode="bookmarks"/>
5000
5064
  <xsl:text> </xsl:text>
5001
5065
  </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
5066
  <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">
5067
+ </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
5068
  <xsl:value-of select="."/>
5005
5069
  </xsl:template><xsl:template match="node()" mode="contents">
5006
5070
  <xsl:apply-templates mode="contents"/>
@@ -5099,14 +5163,14 @@
5099
5163
 
5100
5164
 
5101
5165
  <xsl:variable name="list_of_tables_">
5102
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and contains(*[local-name() = 'name'], '—')]">
5166
+ <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']]"> <!-- contains(*[local-name() = 'name'], '—') -->
5103
5167
  <table id="{@id}"><xsl:apply-templates select="*[local-name() = 'name']" mode="bookmarks"/></table>
5104
5168
  </xsl:for-each>
5105
5169
  </xsl:variable>
5106
5170
  <xsl:variable name="list_of_tables" select="xalan:nodeset($list_of_tables_)"/>
5107
5171
 
5108
5172
  <xsl:variable name="list_of_figures_">
5109
- <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and contains(*[local-name() = 'name'], '')]">
5173
+ <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
5174
  <figure id="{@id}"><xsl:apply-templates select="*[local-name() = 'name']" mode="bookmarks"/></figure>
5111
5175
  </xsl:for-each>
5112
5176
  </xsl:variable>
@@ -5159,10 +5223,11 @@
5159
5223
  <xsl:with-param name="name" select="'title-list-recommendations'"/>
5160
5224
  </xsl:call-template>
5161
5225
  </fo:bookmark-title>
5162
- <xsl:for-each select="//*[local-name() = 'table'][.//*[local-name() = 'p'][@class = 'RecommendationTitle']]">
5226
+ <!-- <xsl:for-each select="//*[local-name() = 'table'][.//*[local-name() = 'p'][@class = 'RecommendationTitle']]"> -->
5227
+ <xsl:for-each select="xalan:nodeset($toc_recommendations)/*">
5163
5228
  <xsl:variable name="table_id" select="@id"/>
5164
5229
  <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>
5230
+ <fo:bookmark-title><xsl:value-of select="bookmark"/></fo:bookmark-title>
5166
5231
  </fo:bookmark>
5167
5232
  </xsl:for-each>
5168
5233
  </fo:bookmark>
@@ -5341,6 +5406,12 @@
5341
5406
 
5342
5407
 
5343
5408
 
5409
+
5410
+ <xsl:if test="parent::*[local-name() = 'example']">
5411
+ <fo:block font-size="1pt" line-height="10%" space-after="4pt"> </fo:block>
5412
+ </xsl:if>
5413
+
5414
+
5344
5415
  <fo:block xsl:use-attribute-sets="sourcecode-style">
5345
5416
  <xsl:variable name="_font-size">
5346
5417
 
@@ -5355,7 +5426,7 @@
5355
5426
 
5356
5427
 
5357
5428
 
5358
-
5429
+ 9.5
5359
5430
 
5360
5431
 
5361
5432
 
@@ -5374,13 +5445,25 @@
5374
5445
 
5375
5446
 
5376
5447
 
5448
+
5449
+ <xsl:if test="parent::*[local-name() = 'example']">
5450
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
5451
+ </xsl:if>
5452
+
5453
+
5377
5454
  <xsl:apply-templates/>
5378
5455
  </fo:block>
5379
-
5456
+
5380
5457
 
5381
5458
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5382
5459
 
5383
5460
 
5461
+
5462
+ <xsl:if test="parent::*[local-name() = 'example']">
5463
+ <fo:block font-size="1pt" line-height="10%" space-before="6pt"> </fo:block>
5464
+ </xsl:if>
5465
+
5466
+
5384
5467
  </fo:block-container>
5385
5468
  </fo:block-container>
5386
5469
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -5972,24 +6055,29 @@
5972
6055
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5973
6056
  <xsl:variable name="title-deprecated">
5974
6057
 
5975
-
5976
- <xsl:call-template name="getTitle">
5977
- <xsl:with-param name="name" select="'title-deprecated'"/>
6058
+ <xsl:call-template name="getLocalizedString">
6059
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5978
6060
  </xsl:call-template>
5979
6061
 
6062
+
5980
6063
  </xsl:variable>
5981
6064
  <fo:block xsl:use-attribute-sets="deprecates-style">
5982
6065
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
5983
6066
  </fo:block>
6067
+ </xsl:template><xsl:template name="setStyle_preferred">
6068
+ <xsl:if test="*[local-name() = 'strong']">
6069
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
6070
+ </xsl:if>
5984
6071
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
5985
6072
  <fo:block xsl:use-attribute-sets="definition-style">
5986
6073
  <xsl:apply-templates/>
5987
6074
  </fo:block>
5988
6075
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
5989
6076
  <xsl:apply-templates/>
5990
- </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
6077
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
5991
6078
  <fo:inline> <xsl:apply-templates/></fo:inline>
5992
- <fo:block> </fo:block>
6079
+ <!-- <fo:block>&#xA0;</fo:block> -->
6080
+ <fo:block/>
5993
6081
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
5994
6082
 
5995
6083
  <fo:block>
@@ -88,12 +88,13 @@
88
88
  <!-- Abstract, Keywords, Preface, Submitting Organizations, Submitters -->
89
89
  <!-- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/*" mode="contents"/> -->
90
90
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract" mode="contents"/>
91
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'executivesummary']" mode="contents"/>
91
92
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'keyword']" mode="contents"/>
92
93
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:foreword" mode="contents"/>
93
94
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:introduction" mode="contents"/>
94
95
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'submitting_orgs']" mode="contents"/>
95
96
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters" mode="contents"/>
96
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'submitting_orgs') and not(@type = 'keyword')]" mode="contents"/>
97
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'executivesummary') and not(@type = 'submitting_orgs') and not(@type = 'keyword')]" mode="contents"/>
97
98
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:acknowledgements" mode="contents"/>
98
99
 
99
100
 
@@ -287,6 +288,7 @@
287
288
  <fo:block break-after="page"/>
288
289
  </xsl:if>
289
290
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:abstract"/>
291
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'executivesummary']"/>
290
292
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'keyword']"/>
291
293
  <xsl:if test="/ogc:ogc-standard/ogc:preface/ogc:foreword">
292
294
  <fo:block break-after="page"/>
@@ -299,7 +301,7 @@
299
301
 
300
302
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[@type = 'submitting_orgs']"/>
301
303
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:submitters"/>
302
- <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'submitting_orgs') and not(@type = 'keyword')]"/>
304
+ <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:clause[not(@type = 'executivesummary') and not(@type = 'submitting_orgs') and not(@type = 'keyword')]"/>
303
305
  <xsl:apply-templates select="/ogc:ogc-standard/ogc:preface/ogc:acknowledgements"/>
304
306
 
305
307
  </fo:flow>
@@ -798,6 +800,7 @@
798
800
  <xsl:apply-templates select="ancestor::ogc:term[1]/ogc:name" mode="presentation"/>
799
801
  </fo:block>
800
802
  <fo:block font-weight="bold" keep-with-next="always" line-height="1">
803
+ <xsl:call-template name="setStyle_preferred"/>
801
804
  <xsl:apply-templates/>
802
805
  </fo:block>
803
806
  </fo:block>
@@ -1618,7 +1621,8 @@
1618
1621
  <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"/>
1619
1622
 
1620
1623
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1621
- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1624
+
1625
+ <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']]">
1622
1626
  <xsl:sort select="@displayorder" data-type="number"/>
1623
1627
  <xsl:apply-templates select="." mode="contents"/>
1624
1628
  </xsl:for-each>
@@ -1628,7 +1632,7 @@
1628
1632
  <xsl:apply-templates select="." mode="contents"/>
1629
1633
  </xsl:for-each>
1630
1634
 
1631
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1635
+ <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')]]">
1632
1636
  <xsl:sort select="@displayorder" data-type="number"/>
1633
1637
  <xsl:apply-templates select="." mode="contents"/>
1634
1638
  </xsl:for-each>
@@ -3149,7 +3153,7 @@
3149
3153
 
3150
3154
 
3151
3155
 
3152
- 10
3156
+ 9.5
3153
3157
 
3154
3158
 
3155
3159
  </xsl:variable>
@@ -4330,12 +4334,12 @@
4330
4334
  </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">
4331
4335
  <xsl:apply-templates mode="contents"/>
4332
4336
  <xsl:text> </xsl:text>
4333
- </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">
4337
+ </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">
4334
4338
  <xsl:apply-templates mode="bookmarks"/>
4335
4339
  <xsl:text> </xsl:text>
4336
4340
  </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">
4337
4341
  <xsl:value-of select="."/>
4338
- </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">
4342
+ </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">
4339
4343
  <xsl:value-of select="."/>
4340
4344
  </xsl:template><xsl:template match="node()" mode="contents">
4341
4345
  <xsl:apply-templates mode="contents"/>
@@ -4638,6 +4642,8 @@
4638
4642
 
4639
4643
 
4640
4644
 
4645
+
4646
+
4641
4647
  <fo:block xsl:use-attribute-sets="sourcecode-style">
4642
4648
  <xsl:variable name="_font-size">
4643
4649
 
@@ -4653,7 +4659,7 @@
4653
4659
 
4654
4660
 
4655
4661
 
4656
- 10
4662
+ 9.5
4657
4663
 
4658
4664
 
4659
4665
  </xsl:variable>
@@ -4671,13 +4677,17 @@
4671
4677
 
4672
4678
 
4673
4679
 
4680
+
4681
+
4674
4682
  <xsl:apply-templates/>
4675
4683
  </fo:block>
4676
-
4684
+
4677
4685
 
4678
4686
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4679
4687
 
4680
4688
 
4689
+
4690
+
4681
4691
  </fo:block-container>
4682
4692
  </fo:block-container>
4683
4693
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -5278,24 +5288,29 @@
5278
5288
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
5279
5289
  <xsl:variable name="title-deprecated">
5280
5290
 
5281
-
5282
- <xsl:call-template name="getTitle">
5283
- <xsl:with-param name="name" select="'title-deprecated'"/>
5291
+ <xsl:call-template name="getLocalizedString">
5292
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5284
5293
  </xsl:call-template>
5285
5294
 
5295
+
5286
5296
  </xsl:variable>
5287
5297
  <fo:block xsl:use-attribute-sets="deprecates-style">
5288
5298
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
5289
5299
  </fo:block>
5300
+ </xsl:template><xsl:template name="setStyle_preferred">
5301
+ <xsl:if test="*[local-name() = 'strong']">
5302
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
5303
+ </xsl:if>
5290
5304
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
5291
5305
  <fo:block xsl:use-attribute-sets="definition-style">
5292
5306
  <xsl:apply-templates/>
5293
5307
  </fo:block>
5294
5308
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
5295
5309
  <xsl:apply-templates/>
5296
- </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
5310
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
5297
5311
  <fo:inline> <xsl:apply-templates/></fo:inline>
5298
- <fo:block> </fo:block>
5312
+ <!-- <fo:block>&#xA0;</fo:block> -->
5313
+ <fo:block/>
5299
5314
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
5300
5315
 
5301
5316
  <fo:block>
@@ -13,9 +13,10 @@ module IsoDoc
13
13
  end
14
14
 
15
15
  def insert_preface_sections(docxml)
16
- insert_keywords(docxml)
16
+ insert_executivesummary(docxml)
17
17
  insert_submitting_orgs(docxml)
18
18
  insert_security(docxml)
19
+ insert_keywords(docxml)
19
20
  end
20
21
 
21
22
  def preface_init_insert_pt(docxml)
@@ -42,6 +43,17 @@ module IsoDoc
42
43
  end
43
44
  end
44
45
 
46
+ def insert_executivesummary(docxml)
47
+ s = docxml&.at(ns("//preface/clause[@type = 'executivesummary']"))
48
+ &.remove or return
49
+ if a = docxml.at(ns("//preface/abstract"))
50
+ a.next = s
51
+ else
52
+ preface_init_insert_pt(docxml)&.children&.first
53
+ &.add_previous_sibling(s)
54
+ end
55
+ end
56
+
45
57
  def insert_submitting_orgs(docxml)
46
58
  orgs = docxml.xpath(ns(submittingorgs_path))
47
59
  .each_with_object([]) do |org, m|
@@ -81,7 +93,9 @@ module IsoDoc
81
93
  def insert_keywords(docxml)
82
94
  kw = @meta.get[:keywords]
83
95
  kw.empty? and return
84
- if abstract = docxml.at(ns("//preface/abstract"))
96
+ if abstract =
97
+ docxml.at(ns("//preface/clause[@type = 'executivesummary']")) ||
98
+ docxml.at(ns("//preface/abstract"))
85
99
  abstract.next = keyword_clause(kw)
86
100
  else
87
101
  preface_init_insert_pt(docxml)&.children&.first
@@ -157,6 +171,7 @@ module IsoDoc
157
171
  def block(docxml)
158
172
  super
159
173
  recommendation_to_table(docxml)
174
+ ol docxml
160
175
  end
161
176
 
162
177
  def section(docxml)
@@ -184,6 +199,20 @@ module IsoDoc
184
199
  super
185
200
  end
186
201
 
202
+ def ol(docxml)
203
+ docxml.xpath(ns("//ol")).each do |f|
204
+ ol1(f)
205
+ end
206
+ end
207
+
208
+ def ol1(elem)
209
+ return unless elem["class"] == "steps"
210
+
211
+ idx = elem.xpath("./ancestor-or-self::xmlns:ol[@class = 'steps']").size
212
+ elem["type"] = %w(arabic alphabet roman alphabet_upper
213
+ roman_upper)[(idx - 1) % 5]
214
+ end
215
+
187
216
  include Init
188
217
  end
189
218
  end
@@ -20,7 +20,13 @@ module IsoDoc
20
20
  end
21
21
 
22
22
  def security(docxml, out)
23
- f = docxml.at(ns("//preface/clause[@type = 'security']")) || return
23
+ f = docxml.at(ns("//preface/clause[@type = 'security']")) or return
24
+ intro_clause(f, out)
25
+ end
26
+
27
+ def executivesummary(docxml, out)
28
+ f = docxml.at(ns("//preface/clause[@type = 'executivesummary']")) or
29
+ return
24
30
  intro_clause(f, out)
25
31
  end
26
32
 
@@ -31,7 +37,8 @@ module IsoDoc
31
37
 
32
38
  def preface(isoxml, out)
33
39
  isoxml.xpath(ns("//preface/clause[not(@type = 'keywords' or "\
34
- "@type = 'submitting_orgs' or @type = 'security')]"))
40
+ "@type = 'submitting_orgs' or @type = 'security' or "\
41
+ "@type = 'executivesummary')]"))
35
42
  .each do |f|
36
43
  intro_clause(f, out)
37
44
  end
@@ -86,7 +86,7 @@ module IsoDoc
86
86
  <span lang="EN-GB"><span
87
87
  style='mso-element:field-begin'></span><span
88
88
  style='mso-spacerun:yes'>&#xA0;</span>TOC
89
- \\h \\z \\t &quot;RecommendationTitle,recommendationtitle&quot;#{' '}
89
+ \\h \\z \\t &quot;RecommendationTitle,RecommendationTestTitle,recommendationtitle,recommendationtesttitle&quot;#{' '}
90
90
  <span style='mso-element:field-separator'></span></span>
91
91
  TOC
92
92
 
@@ -131,13 +131,37 @@ module IsoDoc
131
131
 
132
132
  def make_RecommendationWordToC(docxml)
133
133
  toc = ""
134
- docxml.xpath("//p[@class = 'RecommendationTitle']").each do |h|
134
+ docxml.xpath("//p[@class = 'RecommendationTitle' or @class = 'RecommendationTestTitle']").sort_by do |h|
135
+ recommmendation_sort_key(h.text)
136
+ end.each do |h|
135
137
  toc += word_toc_entry(1, header_strip(h))
136
138
  end
137
139
  toc.sub(/(<p class="MsoToc1">)/,
138
140
  %{\\1#{WORD_TOC_RECOMMENDATION_PREFACE1}}) + WORD_TOC_SUFFIX1
139
141
  end
140
142
 
143
+ def recommmendation_sort_key(header)
144
+ m = /^([^0-9]+) (\d+)/.match(header) || /^([^:]+)/.match(header)
145
+ "#{recommmendation_sort_key1(m[1])}::#{'%04d' % m[2].to_i}"
146
+ end
147
+
148
+ def recommmendation_sort_key1(type)
149
+ case type.downcase
150
+ when "requirements class" then "01"
151
+ when "recommendations class" then "02"
152
+ when "permissions class" then "03"
153
+ when "requirement" then "04"
154
+ when "recommendation" then "05"
155
+ when "permission" then "06"
156
+ when "conformance class" then "07"
157
+ when "abstract test" then "08"
158
+ when "requirements test" then "09"
159
+ when "recommendations test" then "10"
160
+ when "permissions test" then "11"
161
+ else "z"
162
+ end
163
+ end
164
+
141
165
  def make_body2(body, docxml)
142
166
  body.div **{ class: "WordSection2" } do |div2|
143
167
  @prefacenum = 0
@@ -145,6 +169,7 @@ module IsoDoc
145
169
  boilerplate docxml, div2
146
170
  preface_block docxml, div2
147
171
  abstract docxml, div2
172
+ executivesummary docxml, div2
148
173
  keywords docxml, div2
149
174
  foreword docxml, div2
150
175
  introduction docxml, div2
@@ -211,8 +236,7 @@ module IsoDoc
211
236
  @wordstylesheet = wordstylesheet_update
212
237
  Html2Doc.process(
213
238
  result,
214
- filename: filename,
215
- imagedir: @localdir,
239
+ filename: filename, imagedir: @localdir,
216
240
  stylesheet: @wordstylesheet&.path,
217
241
  header_file: header&.path, dir: dir,
218
242
  asciimathdelims: [@openmathdelim, @closemathdelim],