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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1f053e5db384259bf7842b6ac4f1912dcc94e975734df4fa1a0771a45cf9014
4
- data.tar.gz: 32ba788fed4f41f89705f6d8800fc5e8bfa7f084007a58de5277c98e41197f21
3
+ metadata.gz: ba096aa5f1709fe1e79cf9d278bf4b2bf81490b8e46d51a3e06a9319976d7bc0
4
+ data.tar.gz: f3d1b8df07f6d1cbf638a8b332c57cd0c7cbae5b780d340dfaadfeeac6dd6507
5
5
  SHA512:
6
- metadata.gz: c87f046275ab0fad4d8a3ef0d854e642239ac2c8b84c6c51fb22043c4db5f18244889ed49397e0b6e47a43b5c63c65701ef6cc33148be912b7af8a98ef2b89a9
7
- data.tar.gz: fcf6a4cada17ef575154e74443278b911d64466c1312fa0e05c9b8a590e25752618947de282073e3be934bc4c527dd8b3eb5d222cec2a96a6c62cd576836039d
6
+ metadata.gz: dd84925e8131c832424bfc4055bba96ee16775621e79eecb38a78698f4249b56d799cfeb4bc96466101d902a44207f52b09684ba5cf8c6d38accee8b96cb78a4
7
+ data.tar.gz: 0b8ac1b19ba3be249dc26febcc4f246310e40eddd1462d7dce10bd7325e31dba4e8684d0c76dc7f3a8ca8319399576cf87ce39793b3ad79e05e95a00844ec867
@@ -49,26 +49,6 @@ module IsoDoc
49
49
  end
50
50
  end
51
51
 
52
- def deprecated_term_parse(node, out)
53
- out.p class: "DeprecatedTerms" do |p|
54
- node.children.each { |c| parse(c, p) }
55
- p << "&#xa0;"
56
- p.span class: "AdmittedLabel" do |s|
57
- s << l10n(@i18n.deprecated)
58
- end
59
- end
60
- end
61
-
62
- def admitted_term_parse(node, out)
63
- out.p class: "AltTerms" do |p|
64
- node.children.each { |c| parse(c, p) }
65
- p << "&#xa0;"
66
- p.span class: "AdmittedLabel" do |s|
67
- s << l10n(@i18n.admitted)
68
- end
69
- end
70
- end
71
-
72
52
  def example_parse(node, out)
73
53
  name = node.at(ns("./name"))
74
54
  example_name_parse(node, out, name) # if name
@@ -0,0 +1,13 @@
1
+ <preprocess-xslt>
2
+ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:mn="https://www.metanorma.org/ns/ogc" version="1.0">
3
+ <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
4
+ <xsl:preserve-space elements="*"/>
5
+ <xsl:template match="@* | node()">
6
+ <xsl:copy><xsl:apply-templates select="@* | node()"/></xsl:copy>
7
+ </xsl:template>
8
+ <xsl:template match="mn:note/mn:name">
9
+ <xsl:copy><xsl:apply-templates select="@*|node()"/><xsl:if test="normalize-space() != ''">:<mn:tab/></xsl:if></xsl:copy>
10
+ </xsl:template>
11
+ </xsl:stylesheet>
12
+ </preprocess-xslt>
13
+
@@ -0,0 +1,38 @@
1
+ sourcecode table td { padding: 5px; }
2
+ sourcecode table pre { margin: 0; }
3
+ sourcecode, sourcecode .w {
4
+ color: #444444;
5
+ }
6
+ sourcecode .cp {
7
+ color: #CC00A3;
8
+ }
9
+ sourcecode .cs {
10
+ color: #CC00A3;
11
+ }
12
+ sourcecode .c, sourcecode .ch, sourcecode .cd, sourcecode .cm, sourcecode .cpf, sourcecode .c1 {
13
+ color: #1E90FF;
14
+ }
15
+ sourcecode .kc {
16
+ color: #C34E00;
17
+ }
18
+ sourcecode .kd {
19
+ color: #0000FF;
20
+ }
21
+ sourcecode .kr {
22
+ color: #007575;
23
+ }
24
+ sourcecode .k, sourcecode .kn, sourcecode .kp, sourcecode .kt, sourcecode .kv {
25
+ color: #0000FF;
26
+ }
27
+ sourcecode .s, sourcecode .sb, sourcecode .sc, sourcecode .ld, sourcecode .sd, sourcecode .s2, sourcecode .se, sourcecode .sh, sourcecode .si, sourcecode .sx, sourcecode .sr, sourcecode .s1, sourcecode .ss {
28
+ color: #009C00;
29
+ }
30
+ sourcecode .sa {
31
+ color: #0000FF;
32
+ }
33
+ sourcecode .nb, sourcecode .bp {
34
+ color: #C34E00;
35
+ }
36
+ sourcecode .nt {
37
+ color: #0000FF;
38
+ }
@@ -46,6 +46,8 @@
46
46
  <xsl:otherwise>rgb(246, 223, 140)</xsl:otherwise>
47
47
  </xsl:choose>
48
48
  </xsl:variable>
49
+ <xsl:variable name="color_dl_dt">rgb(215,243,255)</xsl:variable>
50
+ <xsl:variable name="color_dl_dd">rgb(242,251,255)</xsl:variable>
49
51
  <xsl:variable name="color_blue">rgb(33, 55, 92)</xsl:variable>
50
52
 
51
53
  <xsl:variable name="toc_recommendations_">
@@ -845,9 +847,8 @@
845
847
  </xsl:template>
846
848
 
847
849
  <!-- ====== -->
848
- <!-- title -->
850
+ <!-- title -->
849
851
  <!-- ====== -->
850
-
851
852
  <xsl:template match="ogc:title" name="title">
852
853
 
853
854
  <xsl:variable name="level">
@@ -957,9 +958,9 @@
957
958
  </xsl:element>
958
959
  </xsl:otherwise>
959
960
  </xsl:choose>
960
-
961
961
  </xsl:template>
962
962
  <!-- ====== -->
963
+ <!-- END: title -->
963
964
  <!-- ====== -->
964
965
 
965
966
  <xsl:template match="ogc:p" name="paragraph">
@@ -993,6 +994,9 @@
993
994
  </xsl:if>
994
995
  <xsl:if test="ancestor::ogc:dd and not(ancestor::ogc:table)">
995
996
  <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
997
+ <xsl:if test="not(ancestor::ogc:dd[1]/following-sibling::ogc:dt)">
998
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
999
+ </xsl:if>
996
1000
  </xsl:if>
997
1001
 
998
1002
  <xsl:apply-templates>
@@ -2180,6 +2184,13 @@
2180
2184
  <!-- ========================== -->
2181
2185
  <!-- Definition's list styles -->
2182
2186
  <!-- ========================== -->
2187
+
2188
+ <xsl:attribute-set name="dl-block-style">
2189
+
2190
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2191
+
2192
+ </xsl:attribute-set>
2193
+
2183
2194
  <xsl:attribute-set name="dt-row-style">
2184
2195
 
2185
2196
  <xsl:attribute name="min-height">8.5mm</xsl:attribute>
@@ -2187,6 +2198,11 @@
2187
2198
  </xsl:attribute-set>
2188
2199
 
2189
2200
  <xsl:attribute-set name="dt-cell-style">
2201
+
2202
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2203
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
2204
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
2205
+
2190
2206
  </xsl:attribute-set>
2191
2207
 
2192
2208
  <xsl:attribute-set name="dt-block-style">
@@ -2207,6 +2223,9 @@
2207
2223
 
2208
2224
  <xsl:attribute-set name="dd-cell-style">
2209
2225
  <xsl:attribute name="padding-left">2mm</xsl:attribute>
2226
+
2227
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2228
+
2210
2229
  </xsl:attribute-set>
2211
2230
 
2212
2231
  <!-- ========================== -->
@@ -2352,6 +2371,10 @@
2352
2371
 
2353
2372
  </xsl:attribute-set>
2354
2373
 
2374
+ <xsl:attribute-set name="figure-source-style">
2375
+
2376
+ </xsl:attribute-set>
2377
+
2355
2378
  <!-- Formula's styles -->
2356
2379
  <xsl:attribute-set name="formula-style">
2357
2380
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -2904,7 +2927,7 @@
2904
2927
 
2905
2928
  <xsl:template name="processTables_Contents">
2906
2929
  <tables>
2907
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2930
+ <xsl:for-each select="//*[local-name() = 'table'][not(ancestor::*[local-name() = 'metanorma-extension'])][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2908
2931
  <table id="{@id}" alt-text="{*[local-name() = 'name']}">
2909
2932
  <xsl:copy-of select="*[local-name() = 'name']"/>
2910
2933
  </table>
@@ -3271,7 +3294,7 @@
3271
3294
  </xsl:attribute>
3272
3295
  </xsl:for-each>
3273
3296
 
3274
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
3297
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
3275
3298
  <xsl:if test="$isNoteOrFnExist = 'true'">
3276
3299
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3277
3300
  </xsl:if>
@@ -3315,7 +3338,7 @@
3315
3338
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3316
3339
  </xsl:when>
3317
3340
  <xsl:otherwise>
3318
- <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 -->
3341
+ <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 -->
3319
3342
  </xsl:otherwise>
3320
3343
  </xsl:choose>
3321
3344
 
@@ -3416,6 +3439,11 @@
3416
3439
  </xsl:if>
3417
3440
  </xsl:template> <!-- table/name -->
3418
3441
 
3442
+ <!-- SOURCE: ... -->
3443
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
3444
+ <xsl:call-template name="termsource"/>
3445
+ </xsl:template>
3446
+
3419
3447
  <xsl:template name="calculate-columns-numbers">
3420
3448
  <xsl:param name="table-row"/>
3421
3449
  <xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -3772,7 +3800,7 @@
3772
3800
  </fo:table-header>
3773
3801
  </xsl:template> <!-- thead -->
3774
3802
 
3775
- <!-- template is using for iso, jcgm, bsi only -->
3803
+ <!-- template is using for iec, iso, jcgm, bsi only -->
3776
3804
  <xsl:template name="table-header-title">
3777
3805
  <xsl:param name="cols-count"/>
3778
3806
  <!-- row for title -->
@@ -3815,7 +3843,7 @@
3815
3843
  <xsl:param name="colwidths"/>
3816
3844
  <xsl:param name="colgroup"/>
3817
3845
 
3818
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3846
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
3819
3847
 
3820
3848
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3821
3849
 
@@ -3885,6 +3913,7 @@
3885
3913
 
3886
3914
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3887
3915
  <xsl:apply-templates select="../*[local-name()='note']"/>
3916
+ <xsl:apply-templates select="../*[local-name()='source']"/>
3888
3917
 
3889
3918
  <xsl:variable name="isDisplayRowSeparator">
3890
3919
 
@@ -4542,7 +4571,7 @@
4542
4571
  <xsl:variable name="isAdded" select="@added"/>
4543
4572
  <xsl:variable name="isDeleted" select="@deleted"/>
4544
4573
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4545
- <fo:block-container>
4574
+ <fo:block-container xsl:use-attribute-sets="dl-block-style">
4546
4575
 
4547
4576
  <xsl:call-template name="setBlockSpanAll"/>
4548
4577
 
@@ -4550,6 +4579,18 @@
4550
4579
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
4551
4580
  </xsl:if>
4552
4581
 
4582
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']">
4583
+ <!-- set font-size as sourcecode font-size -->
4584
+ <xsl:variable name="sourcecode_attributes">
4585
+ <xsl:call-template name="get_sourcecode_attributes"/>
4586
+ </xsl:variable>
4587
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@font-size">
4588
+ <xsl:attribute name="{local-name()}">
4589
+ <xsl:value-of select="."/>
4590
+ </xsl:attribute>
4591
+ </xsl:for-each>
4592
+ </xsl:if>
4593
+
4553
4594
  <xsl:if test="parent::*[local-name() = 'note']">
4554
4595
  <xsl:attribute name="margin-left">
4555
4596
  <xsl:choose>
@@ -4983,6 +5024,11 @@
4983
5024
  <xsl:param name="split_keep-within-line"/>
4984
5025
 
4985
5026
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
5027
+
5028
+ <xsl:if test="not(following-sibling::ogc:dt) or ancestor::ogc:sourcecode"> <!-- last item -->
5029
+ <xsl:attribute name="min-height">3mm</xsl:attribute>
5030
+ </xsl:if>
5031
+
4986
5032
  <xsl:call-template name="insert_dt_cell">
4987
5033
  <xsl:with-param name="key_iso" select="$key_iso"/>
4988
5034
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -5004,8 +5050,17 @@
5004
5050
  <!-- border is mandatory, to calculate real width -->
5005
5051
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5006
5052
  <xsl:attribute name="text-align">left</xsl:attribute>
5053
+
5054
+ <xsl:attribute name="padding-left">6mm</xsl:attribute>
5055
+ <!-- <xsl:attribute name="padding-left">6.5mm</xsl:attribute> -->
5056
+
5007
5057
  </xsl:if>
5008
5058
 
5059
+ <xsl:if test="not(ancestor::ogc:sourcecode)">
5060
+ <!-- <xsl:attribute name="border-left">1pt solid <xsl:value-of select="$color_design"/></xsl:attribute> -->
5061
+ <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dt"/></xsl:attribute>
5062
+ </xsl:if>
5063
+
5009
5064
  <fo:block xsl:use-attribute-sets="dt-block-style">
5010
5065
  <xsl:copy-of select="@id"/>
5011
5066
 
@@ -5013,6 +5068,13 @@
5013
5068
  <xsl:attribute name="margin-top">0</xsl:attribute>
5014
5069
  </xsl:if>
5015
5070
 
5071
+ <xsl:if test="ancestor::ogc:sourcecode">
5072
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
5073
+ </xsl:if>
5074
+ <xsl:if test="not(following-sibling::ogc:dt)"> <!-- last dt -->
5075
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
5076
+ </xsl:if>
5077
+
5016
5078
  <xsl:apply-templates>
5017
5079
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
5018
5080
  </xsl:apply-templates>
@@ -5032,6 +5094,10 @@
5032
5094
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
5033
5095
  </xsl:if>
5034
5096
 
5097
+ <xsl:if test="not(ancestor::ogc:sourcecode)">
5098
+ <xsl:attribute name="background-color"><xsl:value-of select="$color_dl_dd"/></xsl:attribute>
5099
+ </xsl:if>
5100
+
5035
5101
  <fo:block>
5036
5102
 
5037
5103
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -5451,6 +5517,7 @@
5451
5517
  <fo:inline>
5452
5518
  <xsl:for-each select="$styles/style">
5453
5519
  <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
5520
+
5454
5521
  </xsl:for-each>
5455
5522
  <xsl:apply-templates/>
5456
5523
  </fo:inline>
@@ -6960,6 +7027,13 @@
6960
7027
  </fo:block>
6961
7028
  </xsl:template>
6962
7029
 
7030
+ <!-- SOURCE: ... -->
7031
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
7032
+
7033
+ <xsl:call-template name="termsource"/>
7034
+
7035
+ </xsl:template>
7036
+
6963
7037
  <xsl:template match="*[local-name() = 'image']">
6964
7038
  <xsl:variable name="isAdded" select="../@added"/>
6965
7039
  <xsl:variable name="isDeleted" select="../@deleted"/>
@@ -8120,9 +8194,11 @@
8120
8194
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
8121
8195
  </xsl:if>
8122
8196
 
8123
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8197
+ <xsl:apply-templates select="node()[not(local-name() = 'name' or local-name() = 'dl')]"/>
8124
8198
  </fo:block>
8125
8199
 
8200
+ <xsl:apply-templates select="*[local-name() = 'dl']"/> <!-- Key table -->
8201
+
8126
8202
  <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
8127
8203
 
8128
8204
  <xsl:if test="parent::*[local-name() = 'example']">
@@ -8158,11 +8234,22 @@
8158
8234
  <!-- add sourcecode highlighting -->
8159
8235
  <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
8160
8236
  <xsl:variable name="class" select="@class"/>
8237
+
8238
+ <!-- Example: <1> -->
8239
+ <xsl:variable name="is_callout">
8240
+ <xsl:if test="parent::*[local-name() = 'dt']">
8241
+ <xsl:variable name="dt_id" select="../@id"/>
8242
+ <xsl:if test="ancestor::*[local-name() = 'sourcecode']//*[local-name() = 'callout'][@target = $dt_id]">true</xsl:if>
8243
+ </xsl:if>
8244
+ </xsl:variable>
8245
+
8161
8246
  <xsl:choose>
8162
8247
  <xsl:when test="$sourcecode_css//class[@name = $class]">
8163
8248
  <fo:inline>
8164
8249
  <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
8250
+ <xsl:if test="$is_callout = 'true'">&lt;</xsl:if>
8165
8251
  <xsl:apply-templates/>
8252
+ <xsl:if test="$is_callout = 'true'">&gt;</xsl:if>
8166
8253
  </fo:inline>
8167
8254
  </xsl:when>
8168
8255
  <xsl:otherwise>
@@ -8594,6 +8681,10 @@
8594
8681
  </fo:block>
8595
8682
  </xsl:template>
8596
8683
 
8684
+ <xsl:template match="*[local-name() = 'div']">
8685
+ <fo:block><xsl:apply-templates/></fo:block>
8686
+ </xsl:template>
8687
+
8597
8688
  <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']">
8598
8689
  <fo:block xsl:use-attribute-sets="inherit-style">
8599
8690
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
@@ -9300,13 +9391,8 @@
9300
9391
  </xsl:template>
9301
9392
 
9302
9393
  <xsl:template match="*[local-name() = 'deprecates']">
9303
- <xsl:variable name="title-deprecated">
9304
- <xsl:call-template name="getLocalizedString">
9305
- <xsl:with-param name="key">deprecated</xsl:with-param>
9306
- </xsl:call-template>
9307
- </xsl:variable>
9308
9394
  <fo:block xsl:use-attribute-sets="deprecates-style">
9309
- <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
9395
+ <xsl:apply-templates/>
9310
9396
  </fo:block>
9311
9397
  </xsl:template>
9312
9398
 
@@ -10537,6 +10623,23 @@
10537
10623
  <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image']" mode="update_xml_step1">
10538
10624
  <xsl:copy-of select="."/>
10539
10625
  </xsl:template>
10626
+
10627
+ <!-- add @id, redundant for table auto-layout algorithm -->
10628
+ <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
10629
+ <xsl:copy>
10630
+ <xsl:copy-of select="@*"/>
10631
+ <xsl:call-template name="add_id"/>
10632
+ <xsl:apply-templates mode="update_xml_step1"/>
10633
+ </xsl:copy>
10634
+ </xsl:template>
10635
+
10636
+ <xsl:template name="add_id">
10637
+ <xsl:if test="not(@id)">
10638
+ <!-- add @id - first element with @id plus '_element_name' -->
10639
+ <xsl:attribute name="id"><xsl:value-of select="(.//*[@id])[1]/@id"/>_<xsl:value-of select="local-name()"/></xsl:attribute>
10640
+ </xsl:if>
10641
+ </xsl:template>
10642
+
10540
10643
  <!-- =========================================================================== -->
10541
10644
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10542
10645
  <!-- =========================================================================== -->