metanorma-ogc 2.3.7 → 2.3.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1351,11 +1351,17 @@
1351
1351
  <!-- ========================== -->
1352
1352
  <!-- Definition's list styles -->
1353
1353
  <!-- ========================== -->
1354
+
1355
+ <xsl:attribute-set name="dl-block-style">
1356
+
1357
+ </xsl:attribute-set>
1358
+
1354
1359
  <xsl:attribute-set name="dt-row-style">
1355
1360
 
1356
1361
  </xsl:attribute-set>
1357
1362
 
1358
1363
  <xsl:attribute-set name="dt-cell-style">
1364
+
1359
1365
  </xsl:attribute-set>
1360
1366
 
1361
1367
  <xsl:attribute-set name="dt-block-style">
@@ -1376,6 +1382,7 @@
1376
1382
 
1377
1383
  <xsl:attribute-set name="dd-cell-style">
1378
1384
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
1385
+
1379
1386
  </xsl:attribute-set>
1380
1387
 
1381
1388
  <!-- ========================== -->
@@ -1527,6 +1534,10 @@
1527
1534
 
1528
1535
  </xsl:attribute-set>
1529
1536
 
1537
+ <xsl:attribute-set name="figure-source-style">
1538
+
1539
+ </xsl:attribute-set>
1540
+
1530
1541
  <!-- Formula's styles -->
1531
1542
  <xsl:attribute-set name="formula-style">
1532
1543
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -2079,7 +2090,7 @@
2079
2090
 
2080
2091
  <xsl:template name="processTables_Contents">
2081
2092
  <tables>
2082
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2093
+ <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2083
2094
  <table id="{@id}" alt-text="{*[local-name() = 'name']}">
2084
2095
  <xsl:copy-of select="*[local-name() = 'name']"/>
2085
2096
  </table>
@@ -2461,7 +2472,7 @@
2461
2472
  </xsl:attribute>
2462
2473
  </xsl:for-each>
2463
2474
 
2464
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2475
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
2465
2476
  <xsl:if test="$isNoteOrFnExist = 'true'">
2466
2477
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2467
2478
  </xsl:if>
@@ -2505,7 +2516,7 @@
2505
2516
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2506
2517
  </xsl:when>
2507
2518
  <xsl:otherwise>
2508
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note and dl which render separaterely -->
2519
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
2509
2520
  </xsl:otherwise>
2510
2521
  </xsl:choose>
2511
2522
 
@@ -2608,6 +2619,11 @@
2608
2619
  </xsl:if>
2609
2620
  </xsl:template> <!-- table/name -->
2610
2621
 
2622
+ <!-- SOURCE: ... -->
2623
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
2624
+ <xsl:call-template name="termsource"/>
2625
+ </xsl:template>
2626
+
2611
2627
  <xsl:template name="calculate-columns-numbers">
2612
2628
  <xsl:param name="table-row"/>
2613
2629
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -2964,7 +2980,7 @@
2964
2980
  </fo:table-header>
2965
2981
  </xsl:template> <!-- thead -->
2966
2982
 
2967
- <!-- template is using for iso, jcgm, bsi only -->
2983
+ <!-- template is using for iec, iso, jcgm, bsi only -->
2968
2984
  <xsl:template name="table-header-title">
2969
2985
  <xsl:param name="cols-count"/>
2970
2986
  <!-- row for title -->
@@ -3007,7 +3023,7 @@
3007
3023
  <xsl:param name="colwidths"/>
3008
3024
  <xsl:param name="colgroup"/>
3009
3025
 
3010
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3026
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
3011
3027
 
3012
3028
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3013
3029
 
@@ -3077,6 +3093,7 @@
3077
3093
 
3078
3094
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3079
3095
  <xsl:apply-templates select="../*[local-name()='note']"/>
3096
+ <xsl:apply-templates select="../*[local-name()='source']"/>
3080
3097
 
3081
3098
  <xsl:variable name="isDisplayRowSeparator">
3082
3099
 
@@ -3720,7 +3737,7 @@
3720
3737
  <xsl:variable name="isAdded" select="@added"/>
3721
3738
  <xsl:variable name="isDeleted" select="@deleted"/>
3722
3739
  <!-- <dl><xsl:copy-of select="."/></dl> -->
3723
- <fo:block-container>
3740
+ <fo:block-container xsl:use-attribute-sets="dl-block-style">
3724
3741
 
3725
3742
  <xsl:call-template name="setBlockSpanAll"/>
3726
3743
 
@@ -3728,6 +3745,18 @@
3728
3745
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
3729
3746
  </xsl:if>
3730
3747
 
3748
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']">
3749
+ <!-- set font-size as sourcecode font-size -->
3750
+ <xsl:variable name="sourcecode_attributes">
3751
+ <xsl:call-template name="get_sourcecode_attributes"/>
3752
+ </xsl:variable>
3753
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@font-size">
3754
+ <xsl:attribute name="{local-name()}">
3755
+ <xsl:value-of select="."/>
3756
+ </xsl:attribute>
3757
+ </xsl:for-each>
3758
+ </xsl:if>
3759
+
3731
3760
  <xsl:if test="parent::*[local-name() = 'note']">
3732
3761
  <xsl:attribute name="margin-left">
3733
3762
  <xsl:choose>
@@ -4161,6 +4190,7 @@
4161
4190
  <xsl:param name="split_keep-within-line"/>
4162
4191
 
4163
4192
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
4193
+
4164
4194
  <xsl:call-template name="insert_dt_cell">
4165
4195
  <xsl:with-param name="key_iso" select="$key_iso"/>
4166
4196
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -4182,6 +4212,7 @@
4182
4212
  <!-- border is mandatory, to calculate real width -->
4183
4213
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4184
4214
  <xsl:attribute name="text-align">left</xsl:attribute>
4215
+
4185
4216
  </xsl:if>
4186
4217
 
4187
4218
  <fo:block xsl:use-attribute-sets="dt-block-style">
@@ -4629,6 +4660,7 @@
4629
4660
  <fo:inline>
4630
4661
  <xsl:for-each select="$styles/style">
4631
4662
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
4663
+
4632
4664
  </xsl:for-each>
4633
4665
  <xsl:apply-templates/>
4634
4666
  </fo:inline>
@@ -6132,6 +6164,13 @@
6132
6164
  </fo:block>
6133
6165
  </xsl:template>
6134
6166
 
6167
+ <!-- SOURCE: ... -->
6168
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
6169
+
6170
+ <xsl:call-template name="termsource"/>
6171
+
6172
+ </xsl:template>
6173
+
6135
6174
  <xsl:template match="*[local-name() = 'image']">
6136
6175
  <xsl:variable name="isAdded" select="../@added"/>
6137
6176
  <xsl:variable name="isDeleted" select="../@deleted"/>
@@ -7261,9 +7300,11 @@
7261
7300
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7262
7301
  </xsl:if>
7263
7302
 
7264
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7303
+ <xsl:apply-templates select="node()[not(local-name() = 'name' or local-name() = 'dl')]"/>
7265
7304
  </fo:block>
7266
7305
 
7306
+ <xsl:apply-templates select="*[local-name() = 'dl']"/> <!-- Key table -->
7307
+
7267
7308
  <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
7268
7309
 
7269
7310
  </fo:block-container>
@@ -7295,11 +7336,22 @@
7295
7336
  <!-- add sourcecode highlighting -->
7296
7337
  <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
7297
7338
  <xsl:variable name="class" select="@class"/>
7339
+
7340
+ <!-- Example: <1> -->
7341
+ <xsl:variable name="is_callout">
7342
+ <xsl:if test="parent::*[local-name() = 'dt']">
7343
+ <xsl:variable name="dt_id" select="../@id"/>
7344
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']//*[local-name() = 'callout'][@target = $dt_id]">true</xsl:if>
7345
+ </xsl:if>
7346
+ </xsl:variable>
7347
+
7298
7348
  <xsl:choose>
7299
7349
  <xsl:when test="$sourcecode_css//class[@name = $class]">
7300
7350
  <fo:inline>
7301
7351
  <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
7352
+ <xsl:if test="$is_callout = 'true'">&lt;</xsl:if>
7302
7353
  <xsl:apply-templates/>
7354
+ <xsl:if test="$is_callout = 'true'">&gt;</xsl:if>
7303
7355
  </fo:inline>
7304
7356
  </xsl:when>
7305
7357
  <xsl:otherwise>
@@ -7731,6 +7783,10 @@
7731
7783
  </fo:block>
7732
7784
  </xsl:template>
7733
7785
 
7786
+ <xsl:template match="*[local-name() = 'div']">
7787
+ <fo:block><xsl:apply-templates/></fo:block>
7788
+ </xsl:template>
7789
+
7734
7790
  <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
7735
7791
  <fo:block xsl:use-attribute-sets="inherit-style">
7736
7792
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
@@ -8449,13 +8505,8 @@
8449
8505
  </xsl:template>
8450
8506
 
8451
8507
  <xsl:template match="*[local-name() = 'deprecates']">
8452
- <xsl:variable name="title-deprecated">
8453
- <xsl:call-template name="getLocalizedString">
8454
- <xsl:with-param name="key">deprecated</xsl:with-param>
8455
- </xsl:call-template>
8456
- </xsl:variable>
8457
8508
  <fo:block xsl:use-attribute-sets="deprecates-style">
8458
- <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
8509
+ <xsl:apply-templates/>
8459
8510
  </fo:block>
8460
8511
  </xsl:template>
8461
8512
 
@@ -9678,6 +9729,23 @@
9678
9729
  <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
9679
9730
  <xsl:copy-of select="."/>
9680
9731
  </xsl:template>
9732
+
9733
+ <!-- add @id, redundant for table auto-layout algorithm -->
9734
+ <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
9735
+ <xsl:copy>
9736
+ <xsl:copy-of select="@*"/>
9737
+ <xsl:call-template name="add_id"/>
9738
+ <xsl:apply-templates mode="update_xml_step1"/>
9739
+ </xsl:copy>
9740
+ </xsl:template>
9741
+
9742
+ <xsl:template name="add_id">
9743
+ <xsl:if test="not(@id)">
9744
+ <!-- add @id - first element with @id plus '_element_name' -->
9745
+ <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
9746
+ </xsl:if>
9747
+ </xsl:template>
9748
+
9681
9749
  <!-- =========================================================================== -->
9682
9750
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9683
9751
  <!-- =========================================================================== -->
@@ -5,12 +5,21 @@ require_relative "../../relaton/render/general"
5
5
  module IsoDoc
6
6
  module Ogc
7
7
  class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
8
+ def initialize(options)
9
+ @libdir = File.dirname(__FILE__)
10
+ super
11
+ end
12
+
8
13
  def convert1(docxml, filename, dir)
9
14
  info docxml, nil
10
15
  insert_preface_sections(docxml)
11
16
  super
12
17
  end
13
18
 
19
+ def rouge_css_location
20
+ File.read(File.join(@libdir, "html", "rouge.css"))
21
+ end
22
+
14
23
  def insert_preface_sections(doc)
15
24
  preface_insert(doc.at(ns("//preface/clause" \
16
25
  "[@type = 'executivesummary']")),
@@ -215,6 +224,14 @@ module IsoDoc
215
224
  prefix_bracketed_ref("#{ret}#{datefn}")
216
225
  end
217
226
 
227
+ def deprecates(elem)
228
+ elem << "&#xa0;<span class='AdmittedLabel'>#{@i18n.deprecated}</span>"
229
+ end
230
+
231
+ def admits(elem)
232
+ elem << "&#xa0;<span class='AdmittedLabel'>#{@i18n.admitted}</span>"
233
+ end
234
+
218
235
  include Init
219
236
  end
220
237
  end
@@ -93,6 +93,17 @@ module IsoDoc
93
93
 
94
94
  @anchors[ref["id"]] = { xref: "#{@anchors[ref['id']][:xref]} (draft)" }
95
95
  end
96
+
97
+ def sequential_permission_body(id, block, label, klass, model)
98
+ @anchors[block["id"]] = model.postprocess_anchor_struct(
99
+ block, anchor_struct(id, nil,
100
+ label, klass, block["unnumbered"])
101
+ )
102
+ model.permission_parts(block, id, label, klass).each do |n|
103
+ @anchors[n[:id]] = anchor_struct(n[:number], nil, n[:label],
104
+ n[:klass], false)
105
+ end
106
+ end
96
107
  end
97
108
  end
98
109
  end
@@ -382,6 +382,9 @@
382
382
  <optional>
383
383
  <ref name="dl"/>
384
384
  </optional>
385
+ <optional>
386
+ <ref name="source"/>
387
+ </optional>
385
388
  </element>
386
389
  </define>
387
390
  <define name="figure">
@@ -404,9 +407,6 @@
404
407
  <attribute name="class"/>
405
408
  </optional>
406
409
  <ref name="BlockAttributes"/>
407
- <optional>
408
- <ref name="source"/>
409
- </optional>
410
410
  <optional>
411
411
  <ref name="tname"/>
412
412
  </optional>
@@ -431,6 +431,20 @@
431
431
  <zeroOrMore>
432
432
  <ref name="note"/>
433
433
  </zeroOrMore>
434
+ <optional>
435
+ <ref name="source"/>
436
+ </optional>
437
+ </element>
438
+ </define>
439
+ <define name="source">
440
+ <element name="source">
441
+ <attribute name="status">
442
+ <ref name="SourceStatusType"/>
443
+ </attribute>
444
+ <ref name="origin"/>
445
+ <optional>
446
+ <ref name="modification"/>
447
+ </optional>
434
448
  </element>
435
449
  </define>
436
450
  <define name="sourcecode">
@@ -2099,10 +2113,7 @@
2099
2113
  <define name="termsource">
2100
2114
  <element name="termsource">
2101
2115
  <attribute name="status">
2102
- <choice>
2103
- <value>identical</value>
2104
- <value>modified</value>
2105
- </choice>
2116
+ <ref name="SourceStatusType"/>
2106
2117
  </attribute>
2107
2118
  <attribute name="type">
2108
2119
  <choice>
@@ -2116,6 +2127,17 @@
2116
2127
  </optional>
2117
2128
  </element>
2118
2129
  </define>
2130
+ <define name="SourceStatusType">
2131
+ <choice>
2132
+ <value>identical</value>
2133
+ <value>modified</value>
2134
+ <value>restyled</value>
2135
+ <value>context-added</value>
2136
+ <value>generalisation</value>
2137
+ <value>specialisation</value>
2138
+ <value>unspecified</value>
2139
+ </choice>
2140
+ </define>
2119
2141
  <define name="origin">
2120
2142
  <element name="origin">
2121
2143
  <choice>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.3.7".freeze
3
+ VERSION = "2.3.8".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "iso-639"
29
- spec.add_dependency "metanorma-standoc", "~> 2.4.0"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.4.2"
30
30
 
31
31
  spec.add_development_dependency "debug"
32
32
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ogc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.7
4
+ version: 2.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-27 00:00:00.000000000 Z
11
+ date: 2023-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.4.0
33
+ version: 2.4.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.4.0
40
+ version: 2.4.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: debug
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -238,6 +238,8 @@ files:
238
238
  - lib/isodoc/ogc/html/ogc.scss
239
239
  - lib/isodoc/ogc/html/ogc_wp.css
240
240
  - lib/isodoc/ogc/html/ogc_wp.scss
241
+ - lib/isodoc/ogc/html/preprocess.xslt
242
+ - lib/isodoc/ogc/html/rouge.css
241
243
  - lib/isodoc/ogc/html/scripts.html
242
244
  - lib/isodoc/ogc/html/word_ogc_intro.html
243
245
  - lib/isodoc/ogc/html/word_ogc_intro_wp.html