metanorma-plateau 1.0.3 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e94f083791d6b9109aeab66250fa3237d296d3d581363b33a2110e123ff6c8c8
4
- data.tar.gz: abfe149c29ff4dad984a688cc8629d777027f2a19c7eb7532bd1538bb5165e56
3
+ metadata.gz: 1a9ed515d8944a3fe1393bd3cc0d79ab427593c75754ceb41314d8c375c4ce25
4
+ data.tar.gz: e66ac9687f1580fea492af55e69f105f1dcc0c77f3753c442fd53dc9e2d2b90a
5
5
  SHA512:
6
- metadata.gz: 0617fd45607f278f440009b943567d0de29ab6ff0ce58e82cf72e63c54fa329d482a762f1c7ce12003800f4896a1c96a357ccc78098c7ac86e6d164260d5ed1f
7
- data.tar.gz: 76c9e82eb586765f04fae1205c315af44e6c357d76263670a54bec327c9a237d9641bfdeebf79fcc292f7b0db854688d4c4c3cf4147ab982ff465b1d8d9d3ce1
6
+ metadata.gz: 7528bbd5cbdce23a406eb52ae7180b271e04ec320de3323c394bf99afb4b8beb92c820288ff93a88d322a206ba07e18cbeda9adc003f5cc5d7715663aea07081
7
+ data.tar.gz: b2e0257b4402b85348304d78a7e3a3aba9b18e2b1d69d276f62b09c01ff82fc5e7f648044dcc8983f316094228f84214f5cbb03df7dd9cb5514665795ce2b0b4
@@ -13,6 +13,19 @@ module IsoDoc
13
13
  end
14
14
  end
15
15
 
16
+ def clause_etc1(clause, out, num)
17
+ out.div **attr_code(
18
+ id: clause["id"],
19
+ class: clause.name == "definitions" ? "Symbols" : nil,
20
+ ) do |div|
21
+ num = num + 1
22
+ clause_name(clause, clause&.at(ns("./fmt-title")), div, nil)
23
+ clause.elements.each do |e|
24
+ parse(e, div) unless %w{fmt-title}.include? e.name
25
+ end
26
+ end
27
+ end
28
+
16
29
  include Init
17
30
  end
18
31
  end
@@ -1347,13 +1347,13 @@
1347
1347
  </xsl:when>
1348
1348
  <xsl:otherwise>
1349
1349
  <xsl:choose>
1350
- <xsl:when test="parent::*[local-name() = 'ul'] and ancestor::*[local-name() = 'sections'] and $list_item_label = '・' and not(ancestor::*[local-name() = 'table'])">
1350
+ <!-- <xsl:when test="parent::*[local-name() = 'ul'] and ancestor::*[local-name() = 'sections'] and $list_item_label = '・' and not(ancestor::*[local-name() = 'table'])">
1351
1351
  <fo:inline>
1352
1352
  <fo:instream-foreign-object content-width="2.5mm" fox:alt-text="ul list label">
1353
1353
  <xsl:copy-of select="$list_label_black_circle"/>
1354
1354
  </fo:instream-foreign-object>
1355
1355
  </fo:inline>
1356
- </xsl:when>
1356
+ </xsl:when> -->
1357
1357
  <xsl:when test="parent::*[local-name() = 'ul'] and $list_item_label = '→'">
1358
1358
  <fo:inline>
1359
1359
  <fo:instream-foreign-object content-width="2.5mm" fox:alt-text="ul list label">
@@ -4323,8 +4323,14 @@
4323
4323
  </xsl:choose>
4324
4324
  </xsl:variable>
4325
4325
 
4326
+ <xsl:call-template name="setNamedDestination"/>
4327
+
4326
4328
  <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
4327
4329
 
4330
+ <xsl:for-each select="*[local-name() = 'name']">
4331
+ <xsl:call-template name="setIDforNamedDestination"/>
4332
+ </xsl:for-each>
4333
+
4328
4334
  <xsl:call-template name="refine_table-container-style">
4329
4335
  <xsl:with-param name="margin-side" select="$margin-side"/>
4330
4336
  </xsl:call-template>
@@ -4530,6 +4536,7 @@
4530
4536
  <!-- table/name-->
4531
4537
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
4532
4538
  <xsl:param name="continued"/>
4539
+ <xsl:param name="cols-count"/>
4533
4540
  <xsl:if test="normalize-space() != ''">
4534
4541
 
4535
4542
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -4551,9 +4558,30 @@
4551
4558
 
4552
4559
  <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
4553
4560
  <xsl:if test="$continued = 'true'">
4554
- <fo:block text-align="right">
4555
- <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
4556
- </fo:block>
4561
+
4562
+ <!-- to prevent the error 'THead element may contain only TR elements' -->
4563
+
4564
+ <xsl:choose>
4565
+ <xsl:when test="string(number($cols-count)) != 'NaN'">
4566
+ <fo:table width="100%" table-layout="fixed" role="SKIP">
4567
+ <fo:table-body role="SKIP">
4568
+ <fo:table-row>
4569
+ <fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
4570
+ <fo:block text-align="right" role="SKIP">
4571
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
4572
+ </fo:block>
4573
+ </fo:table-cell>
4574
+ </fo:table-row>
4575
+ </fo:table-body>
4576
+ </fo:table>
4577
+ </xsl:when>
4578
+ <xsl:otherwise>
4579
+ <fo:block text-align="right">
4580
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
4581
+ </fo:block>
4582
+ </xsl:otherwise>
4583
+ </xsl:choose>
4584
+
4557
4585
  </xsl:if>
4558
4586
  <!-- </xsl:if> -->
4559
4587
 
@@ -4946,6 +4974,7 @@
4946
4974
 
4947
4975
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
4948
4976
  <xsl:with-param name="continued">true</xsl:with-param>
4977
+ <xsl:with-param name="cols-count" select="$cols-count"/>
4949
4978
  </xsl:apply-templates>
4950
4979
 
4951
4980
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
@@ -5325,8 +5354,8 @@
5325
5354
  <xsl:for-each select="xalan:nodeset($styles__)/item">
5326
5355
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
5327
5356
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
5328
- <xsl:if test="$key = 'color' or $key = 'background-color'">
5329
- <style name="{$key}"><xsl:value-of select="$value"/></style>
5357
+ <xsl:if test="$key = 'color' or $key = 'background-color' or $key = 'border' or $key = 'border-top' or $key = 'border-right' or $key = 'border-left' or $key = 'border-bottom' or $key = 'border-style' or $key = 'border-width' or $key = 'border-color' or $key = 'border-top-style' or $key = 'border-top-width' or $key = 'border-top-color' or $key = 'border-right-style' or $key = 'border-right-width' or $key = 'border-right-color' or $key = 'border-left-style' or $key = 'border-left-width' or $key = 'border-left-color' or $key = 'border-bottom-style' or $key = 'border-bottom-width' or $key = 'border-bottom-color'">
5358
+ <style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
5330
5359
  </xsl:if>
5331
5360
  </xsl:for-each>
5332
5361
  </xsl:variable>
@@ -5390,6 +5419,7 @@
5390
5419
  <!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
5391
5420
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example'] | *[local-name()='table']/*[local-name()='tfoot']//*[local-name()='note' or local-name() = 'example']" priority="2">
5392
5421
 
5422
+ <xsl:call-template name="setNamedDestination"/>
5393
5423
  <fo:block xsl:use-attribute-sets="table-note-style">
5394
5424
  <xsl:copy-of select="@id"/>
5395
5425
 
@@ -6020,6 +6050,10 @@
6020
6050
  <!-- <dl><xsl:copy-of select="."/></dl> -->
6021
6051
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
6022
6052
 
6053
+ <xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
6054
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
6055
+ </xsl:if>
6056
+
6023
6057
  <xsl:call-template name="setBlockSpanAll"/>
6024
6058
 
6025
6059
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -6347,7 +6381,7 @@
6347
6381
 
6348
6382
  <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
6349
6383
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
6350
- <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
6384
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
6351
6385
  <xsl:call-template name="refine_figure_key_style"/>
6352
6386
  <xsl:apply-templates/>
6353
6387
  </fo:block>
@@ -6604,6 +6638,7 @@
6604
6638
 
6605
6639
  <xsl:call-template name="refine_dt-cell-style"/>
6606
6640
 
6641
+ <xsl:call-template name="setNamedDestination"/>
6607
6642
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
6608
6643
 
6609
6644
  <xsl:choose>
@@ -7038,7 +7073,7 @@
7038
7073
  <!-- ================= -->
7039
7074
 
7040
7075
  <!-- highlight text -->
7041
- <xsl:template match="*[local-name()='hi']">
7076
+ <xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
7042
7077
  <fo:inline background-color="yellow">
7043
7078
  <xsl:apply-templates/>
7044
7079
  </fo:inline>
@@ -8633,6 +8668,7 @@
8633
8668
  <!-- Appendix processing -->
8634
8669
  <!-- ======================== -->
8635
8670
  <xsl:template match="*[local-name()='appendix']">
8671
+ <xsl:call-template name="setNamedDestination"/>
8636
8672
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
8637
8673
  <xsl:apply-templates select="*[local-name()='title']"/>
8638
8674
  </fo:block>
@@ -8643,13 +8679,14 @@
8643
8679
  <xsl:variable name="level">
8644
8680
  <xsl:call-template name="getLevel"/>
8645
8681
  </xsl:variable>
8646
- <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
8682
+ <fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
8647
8683
  </xsl:template>
8648
8684
  <!-- ======================== -->
8649
8685
  <!-- END Appendix processing -->
8650
8686
  <!-- ======================== -->
8651
8687
 
8652
8688
  <xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
8689
+ <xsl:call-template name="setNamedDestination"/>
8653
8690
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
8654
8691
  <xsl:apply-templates select="*[local-name()='name']"/>
8655
8692
  </fo:block>
@@ -8679,6 +8716,7 @@
8679
8716
  <xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
8680
8717
  <xsl:param name="callout"/>
8681
8718
  <fo:inline id="{@id}">
8719
+ <xsl:call-template name="setNamedDestination"/>
8682
8720
  <!-- for first p in annotation, put <x> -->
8683
8721
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
8684
8722
  <xsl:apply-templates/>
@@ -8725,6 +8763,7 @@
8725
8763
 
8726
8764
  </xsl:if>
8727
8765
  <fo:block-container margin-left="0mm" role="SKIP">
8766
+ <xsl:call-template name="setNamedDestination"/>
8728
8767
  <fo:block id="{@id}">
8729
8768
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
8730
8769
  </fo:block>
@@ -8770,8 +8809,13 @@
8770
8809
  </fo:block>
8771
8810
  </fo:table-cell>
8772
8811
  <fo:table-cell display-align="center">
8812
+
8773
8813
  <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
8774
8814
 
8815
+ <xsl:for-each select="../*[local-name() = 'name']">
8816
+ <xsl:call-template name="setIDforNamedDestination"/>
8817
+ </xsl:for-each>
8818
+
8775
8819
  <xsl:call-template name="refine_formula-stem-number-style"/>
8776
8820
 
8777
8821
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
@@ -8806,6 +8850,8 @@
8806
8850
 
8807
8851
  <xsl:template match="*[local-name() = 'note']" name="note">
8808
8852
 
8853
+ <xsl:call-template name="setNamedDestination"/>
8854
+
8809
8855
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8810
8856
 
8811
8857
  <xsl:call-template name="setBlockSpanAll"/>
@@ -8874,6 +8920,7 @@
8874
8920
  </xsl:template>
8875
8921
 
8876
8922
  <xsl:template match="*[local-name() = 'termnote']">
8923
+ <xsl:call-template name="setNamedDestination"/>
8877
8924
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
8878
8925
 
8879
8926
  <xsl:call-template name="setBlockSpanAll"/>
@@ -8980,12 +9027,14 @@
8980
9027
 
8981
9028
  <xsl:template match="*[local-name() = 'terms']">
8982
9029
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
9030
+ <xsl:call-template name="setNamedDestination"/>
8983
9031
  <fo:block id="{@id}">
8984
9032
  <xsl:apply-templates/>
8985
9033
  </fo:block>
8986
9034
  </xsl:template>
8987
9035
 
8988
9036
  <xsl:template match="*[local-name() = 'term']">
9037
+ <xsl:call-template name="setNamedDestination"/>
8989
9038
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
8990
9039
 
8991
9040
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
@@ -9017,6 +9066,7 @@
9017
9066
  <xsl:template match="*[local-name() = 'figure']" name="figure">
9018
9067
  <xsl:variable name="isAdded" select="@added"/>
9019
9068
  <xsl:variable name="isDeleted" select="@deleted"/>
9069
+ <xsl:call-template name="setNamedDestination"/>
9020
9070
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
9021
9071
  <xsl:call-template name="refine_figure-block-style"/>
9022
9072
 
@@ -9033,6 +9083,11 @@
9033
9083
  </xsl:variable>
9034
9084
 
9035
9085
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
9086
+
9087
+ <xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
9088
+ <xsl:call-template name="setIDforNamedDestination"/>
9089
+ </xsl:for-each>
9090
+
9036
9091
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
9037
9092
  </fo:block>
9038
9093
 
@@ -9065,6 +9120,7 @@
9065
9120
  </xsl:template>
9066
9121
 
9067
9122
  <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
9123
+ <xsl:call-template name="setNamedDestination"/>
9068
9124
  <fo:block id="{@id}">
9069
9125
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
9070
9126
  </fo:block>
@@ -9078,6 +9134,7 @@
9078
9134
  </xsl:template>
9079
9135
 
9080
9136
  <!-- SOURCE: ... -->
9137
+ <!-- figure/source -->
9081
9138
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
9082
9139
 
9083
9140
  <xsl:call-template name="termsource"/>
@@ -10310,6 +10367,7 @@
10310
10367
  <xsl:template match="title" mode="bookmark"/>
10311
10368
  <xsl:template match="text()" mode="bookmark"/>
10312
10369
 
10370
+ <!-- figure/name -->
10313
10371
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
10314
10372
  <xsl:if test="normalize-space() != ''">
10315
10373
  <fo:block xsl:use-attribute-sets="figure-name-style">
@@ -10322,11 +10380,11 @@
10322
10380
  </xsl:template>
10323
10381
 
10324
10382
  <!-- figure/fn -->
10325
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
10383
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
10326
10384
  <!-- figure/note -->
10327
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
10385
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
10328
10386
  <!-- figure/example -->
10329
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
10387
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
10330
10388
 
10331
10389
  <!-- figure/note[@type = 'units'] -->
10332
10390
  <!-- image/note[@type = 'units'] -->
@@ -11024,6 +11082,7 @@
11024
11082
  <!-- permission -->
11025
11083
  <!-- ========== -->
11026
11084
  <xsl:template match="*[local-name() = 'permission']">
11085
+ <xsl:call-template name="setNamedDestination"/>
11027
11086
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
11028
11087
  <xsl:apply-templates select="*[local-name()='name']"/>
11029
11088
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -11032,10 +11091,12 @@
11032
11091
 
11033
11092
  <xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
11034
11093
  <xsl:if test="normalize-space() != ''">
11035
- <fo:block xsl:use-attribute-sets="permission-name-style">
11036
- <xsl:apply-templates/>
11037
11094
 
11038
- </fo:block>
11095
+ <fo:block xsl:use-attribute-sets="permission-name-style">
11096
+ <xsl:apply-templates/>
11097
+
11098
+ </fo:block>
11099
+
11039
11100
  </xsl:if>
11040
11101
  </xsl:template>
11041
11102
 
@@ -11051,6 +11112,7 @@
11051
11112
  <!-- requirement -->
11052
11113
  <!-- ========== -->
11053
11114
  <xsl:template match="*[local-name() = 'requirement']">
11115
+ <xsl:call-template name="setNamedDestination"/>
11054
11116
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
11055
11117
  <xsl:apply-templates select="*[local-name()='name']"/>
11056
11118
  <xsl:apply-templates select="*[local-name()='label']"/>
@@ -11062,11 +11124,13 @@
11062
11124
 
11063
11125
  <xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
11064
11126
  <xsl:if test="normalize-space() != ''">
11065
- <fo:block xsl:use-attribute-sets="requirement-name-style">
11066
11127
 
11067
- <xsl:apply-templates/>
11128
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
11129
+
11130
+ <xsl:apply-templates/>
11131
+
11132
+ </fo:block>
11068
11133
 
11069
- </fo:block>
11070
11134
  </xsl:if>
11071
11135
  </xsl:template>
11072
11136
 
@@ -11095,6 +11159,7 @@
11095
11159
  <!-- recommendation -->
11096
11160
  <!-- ========== -->
11097
11161
  <xsl:template match="*[local-name() = 'recommendation']">
11162
+ <xsl:call-template name="setNamedDestination"/>
11098
11163
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
11099
11164
  <xsl:apply-templates select="*[local-name()='name']"/>
11100
11165
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -11103,10 +11168,12 @@
11103
11168
 
11104
11169
  <xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
11105
11170
  <xsl:if test="normalize-space() != ''">
11106
- <fo:block xsl:use-attribute-sets="recommendation-name-style">
11107
- <xsl:apply-templates/>
11108
11171
 
11109
- </fo:block>
11172
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
11173
+ <xsl:apply-templates/>
11174
+
11175
+ </fo:block>
11176
+
11110
11177
  </xsl:if>
11111
11178
  </xsl:template>
11112
11179
 
@@ -11185,6 +11252,7 @@
11185
11252
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
11186
11253
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
11187
11254
  </xsl:if>
11255
+ <xsl:call-template name="setNamedDestination"/>
11188
11256
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11189
11257
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
11190
11258
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -11294,6 +11362,7 @@
11294
11362
  <!-- termexample -->
11295
11363
  <!-- ====== -->
11296
11364
  <xsl:template match="*[local-name() = 'termexample']">
11365
+ <xsl:call-template name="setNamedDestination"/>
11297
11366
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
11298
11367
  <xsl:call-template name="refine_termexample-style"/>
11299
11368
  <xsl:call-template name="setBlockSpanAll"/>
@@ -11348,6 +11417,7 @@
11348
11417
  -->
11349
11418
  <xsl:template match="*[local-name() = 'example']" name="example">
11350
11419
 
11420
+ <xsl:call-template name="setNamedDestination"/>
11351
11421
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
11352
11422
 
11353
11423
  <xsl:call-template name="setBlockSpanAll"/>
@@ -11859,8 +11929,13 @@
11859
11929
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
11860
11930
 
11861
11931
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
11932
+
11862
11933
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
11863
11934
 
11935
+ <xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
11936
+ <xsl:call-template name="setIDforNamedDestination"/>
11937
+ </xsl:for-each>
11938
+
11864
11939
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
11865
11940
  </fo:block>
11866
11941
  </xsl:if>
@@ -11980,6 +12055,7 @@
11980
12055
  <!-- main sections -->
11981
12056
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
11982
12057
 
12058
+ <xsl:call-template name="setNamedDestination"/>
11983
12059
  <fo:block>
11984
12060
  <xsl:call-template name="setId"/>
11985
12061
 
@@ -12020,6 +12096,7 @@
12020
12096
 
12021
12097
  <fo:block break-after="page"/>
12022
12098
 
12099
+ <xsl:call-template name="setNamedDestination"/>
12023
12100
  <fo:block>
12024
12101
  <xsl:call-template name="setId"/>
12025
12102
  <xsl:call-template name="addReviewHelper"/>
@@ -12048,6 +12125,7 @@
12048
12125
  </xsl:template>
12049
12126
 
12050
12127
  <xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
12128
+ <xsl:call-template name="setNamedDestination"/>
12051
12129
  <fo:block>
12052
12130
  <xsl:if test="parent::*[local-name() = 'copyright-statement']">
12053
12131
  <xsl:attribute name="role">SKIP</xsl:attribute>
@@ -12070,6 +12148,7 @@
12070
12148
  </xsl:template> <!-- refine_clause_style -->
12071
12149
 
12072
12150
  <xsl:template match="*[local-name() = 'definitions']">
12151
+ <xsl:call-template name="setNamedDestination"/>
12073
12152
  <fo:block id="{@id}">
12074
12153
  <xsl:apply-templates/>
12075
12154
  </fo:block>
@@ -12085,6 +12164,8 @@
12085
12164
  <xsl:otherwise>
12086
12165
 
12087
12166
  <fo:block break-after="page"/>
12167
+ <xsl:call-template name="setNamedDestination"/>
12168
+
12088
12169
  <fo:block id="{@id}">
12089
12170
 
12090
12171
  <xsl:call-template name="setBlockSpanAll"/>
@@ -12156,6 +12237,7 @@
12156
12237
  <!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
12157
12238
  following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
12158
12239
  <!-- <fo:block id="{$source}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$source}" fox:alt-text="Annot___{$source}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block> -->
12240
+ <xsl:call-template name="setNamedDestination"/>
12159
12241
  <fo:block id="{@id}" font-size="1pt" role="SKIP" keep-with-next="always" line-height="0.1"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
12160
12242
  <!-- </xsl:if> -->
12161
12243
  </xsl:if>
@@ -12881,6 +12963,7 @@
12881
12963
  <!-- Normative references -->
12882
12964
  <xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
12883
12965
 
12966
+ <xsl:call-template name="setNamedDestination"/>
12884
12967
  <fo:block id="{@id}">
12885
12968
  <xsl:apply-templates/>
12886
12969
 
@@ -12901,6 +12984,7 @@
12901
12984
  </xsl:if>
12902
12985
  </xsl:if> -->
12903
12986
 
12987
+ <xsl:call-template name="setNamedDestination"/>
12904
12988
  <fo:block id="{@id}"/>
12905
12989
 
12906
12990
  <xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
@@ -12920,6 +13004,7 @@
12920
13004
  <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
12921
13005
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
12922
13006
 
13007
+ <xsl:call-template name="setNamedDestination"/>
12923
13008
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
12924
13009
 
12925
13010
  <xsl:call-template name="processBibitem"/>
@@ -12933,6 +13018,7 @@
12933
13018
  <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
12934
13019
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
12935
13020
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
13021
+ <xsl:call-template name="setNamedDestination"/>
12936
13022
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
12937
13023
 
12938
13024
  <fo:list-item>
@@ -12962,6 +13048,7 @@
12962
13048
  <xsl:choose>
12963
13049
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
12964
13050
  <xsl:otherwise>
13051
+ <xsl:call-template name="setNamedDestination"/>
12965
13052
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
12966
13053
 
12967
13054
  <fo:list-item-label end-indent="label-end()">
@@ -13356,6 +13443,7 @@
13356
13443
  <xsl:template match="*[local-name() = 'admonition']">
13357
13444
 
13358
13445
  <!-- text in the box -->
13446
+ <xsl:call-template name="setNamedDestination"/>
13359
13447
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
13360
13448
 
13361
13449
  <xsl:call-template name="setBlockSpanAll"/>
@@ -13611,7 +13699,7 @@
13611
13699
  </xsl:template>
13612
13700
 
13613
13701
  <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
13614
- <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
13702
+ <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'fmt-hi' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
13615
13703
  <xsl:copy>
13616
13704
  <xsl:copy-of select="@*"/>
13617
13705
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -13643,28 +13731,56 @@
13643
13731
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
13644
13732
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
13645
13733
 
13646
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
13734
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
13647
13735
  <xsl:element name="stem" namespace="{$namespace_full}">
13648
13736
  <xsl:copy-of select="@*"/>
13649
13737
  <xsl:choose>
13650
13738
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
13651
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
13739
+ <xsl:choose>
13740
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
13741
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
13742
+ </xsl:when>
13743
+ <xsl:otherwise>
13744
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
13745
+ </xsl:otherwise>
13746
+ </xsl:choose>
13652
13747
  </xsl:when>
13653
13748
  <xsl:otherwise>
13654
- <xsl:copy-of select="node()"/>
13749
+ <xsl:choose>
13750
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
13751
+ <xsl:copy-of select="node()"/>
13752
+ </xsl:when>
13753
+ <xsl:otherwise>
13754
+ <xsl:apply-templates select="node()" mode="update_xml_step1"/>
13755
+ </xsl:otherwise>
13756
+ </xsl:choose>
13655
13757
  </xsl:otherwise>
13656
13758
  </xsl:choose>
13657
13759
  </xsl:element>
13658
13760
  </xsl:template>
13659
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
13761
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
13660
13762
  <xsl:element name="stem" namespace="{$namespace_full}">
13661
13763
  <xsl:copy-of select="@*"/>
13662
13764
  <xsl:choose>
13663
13765
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
13664
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
13766
+ <xsl:choose>
13767
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
13768
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
13769
+ </xsl:when>
13770
+ <xsl:otherwise>
13771
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
13772
+ </xsl:otherwise>
13773
+ </xsl:choose>
13665
13774
  </xsl:when>
13666
13775
  <xsl:otherwise>
13667
- <xsl:copy-of select="node()"/>
13776
+ <xsl:choose>
13777
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
13778
+ <xsl:copy-of select="node()"/>
13779
+ </xsl:when>
13780
+ <xsl:otherwise>
13781
+ <xsl:apply-templates select="node()" mode="update_xml_pres"/>
13782
+ </xsl:otherwise>
13783
+ </xsl:choose>
13668
13784
  </xsl:otherwise>
13669
13785
  </xsl:choose>
13670
13786
  </xsl:element>
@@ -13759,6 +13875,9 @@
13759
13875
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
13760
13876
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
13761
13877
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
13878
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
13879
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
13880
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
13762
13881
 
13763
13882
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
13764
13883
  <xsl:copy>
@@ -13893,16 +14012,24 @@
13893
14012
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
13894
14013
  <xsl:element name="title" namespace="{$namespace_full}">
13895
14014
  <xsl:copy-of select="@*"/>
14015
+ <xsl:call-template name="addNamedDestinationAttribute"/>
14016
+
13896
14017
  <xsl:apply-templates mode="update_xml_step1"/>
13897
14018
  </xsl:element>
13898
14019
  </xsl:template>
13899
14020
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
13900
14021
  <xsl:element name="title" namespace="{$namespace_full}">
13901
14022
  <xsl:copy-of select="@*"/>
14023
+ <xsl:call-template name="addNamedDestinationAttribute"/>
14024
+
13902
14025
  <xsl:apply-templates mode="update_xml_pres"/>
13903
14026
  </xsl:element>
13904
14027
  </xsl:template>
13905
14028
 
14029
+ <xsl:template name="addNamedDestinationAttribute">
14030
+
14031
+ </xsl:template>
14032
+
13906
14033
  <xsl:template match="*[local-name() = 'fmt-name']"/>
13907
14034
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
13908
14035
  <xsl:choose>
@@ -13912,6 +14039,8 @@
13912
14039
  <xsl:otherwise>
13913
14040
  <xsl:element name="name" namespace="{$namespace_full}">
13914
14041
  <xsl:copy-of select="@*"/>
14042
+ <xsl:call-template name="addNamedDestinationAttribute"/>
14043
+
13915
14044
  <xsl:apply-templates mode="update_xml_step1"/>
13916
14045
  </xsl:element>
13917
14046
  </xsl:otherwise>
@@ -13925,6 +14054,8 @@
13925
14054
  <xsl:otherwise>
13926
14055
  <xsl:element name="name" namespace="{$namespace_full}">
13927
14056
  <xsl:copy-of select="@*"/>
14057
+ <xsl:call-template name="addNamedDestinationAttribute"/>
14058
+
13928
14059
  <xsl:apply-templates mode="update_xml_pres"/>
13929
14060
  </xsl:element>
13930
14061
  </xsl:otherwise>
@@ -14029,6 +14160,20 @@
14029
14160
  </xsl:element>
14030
14161
  </xsl:template>
14031
14162
 
14163
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
14164
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
14165
+ <xsl:element name="source" namespace="{$namespace_full}">
14166
+ <xsl:copy-of select="@*"/>
14167
+ <xsl:apply-templates mode="update_xml_step1"/>
14168
+ </xsl:element>
14169
+ </xsl:template>
14170
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
14171
+ <xsl:element name="source" namespace="{$namespace_full}">
14172
+ <xsl:copy-of select="@*"/>
14173
+ <xsl:apply-templates mode="update_xml_pres"/>
14174
+ </xsl:element>
14175
+ </xsl:template>
14176
+
14032
14177
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
14033
14178
  <xsl:apply-templates mode="update_xml_step1"/>
14034
14179
  </xsl:template>
@@ -15494,6 +15639,30 @@
15494
15639
  </xsl:attribute>
15495
15640
  </xsl:template>
15496
15641
 
15642
+ <xsl:template name="setIDforNamedDestination">
15643
+ <xsl:if test="@named_dest">
15644
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
15645
+ </xsl:if>
15646
+ </xsl:template>
15647
+
15648
+ <xsl:template name="setIDforNamedDestinationInline">
15649
+ <xsl:if test="@named_dest">
15650
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
15651
+ </xsl:if>
15652
+ </xsl:template>
15653
+
15654
+ <xsl:template name="setNamedDestination">
15655
+ <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
15656
+ <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
15657
+ <fox:destination internal-destination="{@id}"/>
15658
+ </xsl:if>
15659
+ <xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
15660
+ <xsl:if test="@named_dest">
15661
+ <fox:destination internal-destination="{@named_dest}"/>
15662
+ </xsl:if>
15663
+ </xsl:for-each>
15664
+ </xsl:template>
15665
+
15497
15666
  <xsl:template name="add-letter-spacing">
15498
15667
  <xsl:param name="text"/>
15499
15668
  <xsl:param name="letter-spacing" select="'0.15'"/>
@@ -24,29 +24,27 @@ module IsoDoc
24
24
  ret
25
25
  end
26
26
 
27
- def source(docxml)
27
+ def source_types(docxml)
28
28
  super
29
- docxml.xpath(ns("//p/source")).each { |f| parasource(f) }
30
- docxml.xpath(ns("//ul/source")).each { |f| listsource(f) }
31
- docxml.xpath(ns("//ol/source")).each { |f| listsource(f) }
32
- docxml.xpath(ns("//dl/source")).each { |f| listsource(f) }
29
+ docxml.xpath(ns("//p/fmt-source")).each { |f| parasource(f) }
30
+ docxml.xpath(ns("//ul/fmt-source")).each { |f| listsource(f, :ul) }
31
+ docxml.xpath(ns("//ol/fmt-source")).each { |f| listsource(f, :ol) }
32
+ docxml.xpath(ns("//dl/fmt-source")).each { |f| listsource(f, :dl) }
33
33
  end
34
34
 
35
35
  def parasource(elem)
36
- source1(elem)
36
+ source1(elem, :para)
37
37
  # if we haven't already removed it...
38
38
  elem.parent or return
39
- elem.name = "p"
40
- elem.delete("status")
41
- elem.parent.next = elem
39
+ #elem.parent.next = "<p>#{to_xml(elem.remove)}</p>"
40
+ elem.parent.next = elem.remove
42
41
  end
43
42
 
44
- def listsource(elem)
45
- source1(elem)
43
+ def listsource(elem, ancestor)
44
+ source1(elem, ancestor)
46
45
  elem.parent or return
47
- elem.name = "p"
48
- elem.delete("status")
49
- elem.parent.next = elem
46
+ #elem.parent.next = "<p>#{to_xml(elem.remove)}</p>"
47
+ elem.parent.next = elem.remove
50
48
  end
51
49
 
52
50
  def middle_title(docxml); end
@@ -124,14 +122,14 @@ module IsoDoc
124
122
 
125
123
  def table1(node)
126
124
  super
127
- # move dl, notes, footnotes, source, fmt-footnote-container inside tfoot
125
+ # move dl, notes, footnotes, fmt-source, fmt-footnote-container inside tfoot
128
126
  if node.at(ns("./dl"))
129
127
  tf = initial_tfoot_cell(node)
130
128
  node.xpath(ns("./dl")).reverse_each do |x|
131
129
  tf.children.first.previous = x.remove
132
130
  end
133
131
  end
134
- if node.at(ns("./note | ./source | ./example | ./fmt-footnote-container"))
132
+ if node.at(ns("./note | ./fmt-source | ./example | ./fmt-footnote-container"))
135
133
  tf = final_tfoot_cell(node)
136
134
  node.xpath(ns("./example")).each do |x|
137
135
  tf.children.last.next = x.remove
@@ -140,7 +138,7 @@ module IsoDoc
140
138
  node.xpath(ns("./fmt-footnote-container")).each do |x|
141
139
  tf.children.last.next = x.remove
142
140
  end
143
- node.xpath(ns("./source")).each do |x|
141
+ node.xpath(ns("./fmt-source")).each do |x|
144
142
  tf.children.last.next = x.remove
145
143
  end
146
144
  end
@@ -267,6 +267,10 @@ in a document (e.g. sourcecode annotations)</a:documentation>
267
267
  <value>justified</value>
268
268
  </choice>
269
269
  </define>
270
+ <define name="IdRefType">
271
+ <a:documentation>Type of cross-references to elements. In BasicDoc, these always point to id { xsd:ID } </a:documentation>
272
+ <data type="IDREF"/>
273
+ </define>
270
274
  <define name="RequiredId">
271
275
  <a:documentation>Mandatory anchor of element, to be used for cross-references within the document</a:documentation>
272
276
  <attribute name="id">
@@ -409,13 +413,13 @@ in a document (e.g. sourcecode annotations)</a:documentation>
409
413
  <attribute name="from">
410
414
  <a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
411
415
  If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
412
- <data type="IDREF"/>
416
+ <ref name="IdRefType"/>
413
417
  </attribute>
414
418
  </optional>
415
419
  <optional>
416
420
  <attribute name="to">
417
421
  <a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
418
- <data type="IDREF"/>
422
+ <ref name="IdRefType"/>
419
423
  </attribute>
420
424
  </optional>
421
425
  </define>
@@ -1504,7 +1508,7 @@ Restricted recursively to contain only other such inline elements with no identi
1504
1508
  <attribute name="to">
1505
1509
  <a:documentation>A reference to an anchor element (typically a bookmark),
1506
1510
  to indicate that the index range covers a range of locations between the current index element and the `to` anchor</a:documentation>
1507
- <data type="IDREF"/>
1511
+ <ref name="IdRefType"/>
1508
1512
  </attribute>
1509
1513
  </optional>
1510
1514
  <ref name="index-primary">
@@ -1662,7 +1666,7 @@ which can be bookmarks as well as block or section references</a:documentation>
1662
1666
  <define name="XrefAttributes">
1663
1667
  <attribute name="target">
1664
1668
  <a:documentation>The identifier of a section, block or inlined element being referenced</a:documentation>
1665
- <data type="IDREF"/>
1669
+ <ref name="IdRefType"/>
1666
1670
  </attribute>
1667
1671
  <optional>
1668
1672
  <attribute name="type">
@@ -1723,7 +1727,7 @@ The target of a footnote is the location it is embedded in within the text</a:do
1723
1727
  <attribute name="target">
1724
1728
  <a:documentation>The target of the callout is understood to be the location of the callout within the source code;
1725
1729
  the extent of the target is not expressed overtly</a:documentation>
1726
- <data type="IDREF"/>
1730
+ <ref name="IdRefType"/>
1727
1731
  </attribute>
1728
1732
  <text>
1729
1733
  <a:documentation>The label of the callout, used to identify its target within the source code</a:documentation>
@@ -2,10 +2,9 @@ module Metanorma
2
2
  module Plateau
3
3
  class Converter < Jis::Converter
4
4
  def blocksource_cleanup(xmldoc)
5
- xmldoc.xpath("//termsource").each do |s|
5
+ xmldoc.xpath("//source").each do |s|
6
6
  p = s.previous_element or next
7
7
  %w[p ol ul dl].include? p.name or next
8
- s.name = "source"
9
8
  s.delete("type")
10
9
  s.parent = p
11
10
  end
@@ -6,9 +6,6 @@ module Metanorma
6
6
  class Converter < Jis::Converter
7
7
  register_for "plateau"
8
8
 
9
- XML_ROOT_TAG = "plateau-standard".freeze
10
- XML_NAMESPACE = "https://www.metanorma.org/ns/plateau".freeze
11
-
12
9
  def default_requirement_model
13
10
  "ogc"
14
11
  end
@@ -25,6 +22,10 @@ module Metanorma
25
22
  "MLIT"
26
23
  end
27
24
 
25
+ def boilerplate_file(_x_orig)
26
+ nil
27
+ end
28
+
28
29
  def init_misc(node)
29
30
  super
30
31
  @default_doctype = "technical-report"
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- VERSION v2.0.3 -->
3
+ <!-- VERSION v2.0.5 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -36,6 +36,12 @@
36
36
  </zeroOrMore>
37
37
  </element>
38
38
  </define>
39
+ <define name="IdRefType">
40
+ <a:documentation>Cross-references are not normalised to xsd:IDREF in Semantic XML: that is deferred to Presentation XML.
41
+ All IdRefType instances point not to `@id` in Semantic XML, which is the Content GUID for an element,
42
+ but to `@anchor`, the user-supplied cross-reference</a:documentation>
43
+ <text/>
44
+ </define>
39
45
  <define name="index-primary">
40
46
  <element name="primary">
41
47
  <oneOrMore>
@@ -238,7 +244,7 @@
238
244
  <a:documentation>Notes specific to this block</a:documentation>
239
245
  </ref>
240
246
  </zeroOrMore>
241
- <ref name="TermSource">
247
+ <ref name="BlockSource">
242
248
  <a:documentation>A source for the table</a:documentation>
243
249
  </ref>
244
250
  </define>
@@ -262,10 +268,112 @@ and is intended to be referenced by a callout within the source code</a:document
262
268
  <a:documentation>Notes whose scope is the current block</a:documentation>
263
269
  </ref>
264
270
  </zeroOrMore>
265
- <ref name="TermSource">
271
+ <ref name="BlockSource">
272
+ <a:documentation>A source for the block</a:documentation>
273
+ </ref>
274
+ </define>
275
+ <define name="FigureBody">
276
+ <optional>
277
+ <ref name="tname">
278
+ <a:documentation>The caption of the block</a:documentation>
279
+ </ref>
280
+ </optional>
281
+ <choice>
282
+ <a:documentation>Content of the figure</a:documentation>
283
+ <ref name="image"/>
284
+ <ref name="video"/>
285
+ <ref name="audio"/>
286
+ <ref name="pre"/>
287
+ <oneOrMore>
288
+ <ref name="paragraph-with-footnote"/>
289
+ </oneOrMore>
290
+ <zeroOrMore>
291
+ <ref name="figure"/>
292
+ </zeroOrMore>
293
+ </choice>
294
+ <zeroOrMore>
295
+ <ref name="fn">
296
+ <a:documentation>Footnotes specific to the figure</a:documentation>
297
+ </ref>
298
+ </zeroOrMore>
299
+ <optional>
300
+ <ref name="dl">
301
+ <a:documentation>An optional definitions list defining any symbols used in the figure</a:documentation>
302
+ </ref>
303
+ </optional>
304
+ <zeroOrMore>
305
+ <ref name="note">
306
+ <a:documentation>Notes whose scope is the current block</a:documentation>
307
+ </ref>
308
+ </zeroOrMore>
309
+ <ref name="BlockSource">
266
310
  <a:documentation>A source for the block</a:documentation>
267
311
  </ref>
268
312
  </define>
313
+ <define name="FigureNoIdBody">
314
+ <optional>
315
+ <ref name="source">
316
+ <a:documentation>A URI or other reference intended to link to an externally hosted image (or equivalent)</a:documentation>
317
+ </ref>
318
+ </optional>
319
+ <optional>
320
+ <ref name="tname">
321
+ <a:documentation>The caption of the block</a:documentation>
322
+ </ref>
323
+ </optional>
324
+ <choice>
325
+ <a:documentation>Content of the figure</a:documentation>
326
+ <ref name="image-no-id"/>
327
+ <ref name="video-no-id"/>
328
+ <ref name="audio-no-id"/>
329
+ <ref name="pre-no-id"/>
330
+ <oneOrMore>
331
+ <ref name="paragraph-with-footnote-no-id"/>
332
+ </oneOrMore>
333
+ <zeroOrMore>
334
+ <ref name="figure-no-id"/>
335
+ </zeroOrMore>
336
+ </choice>
337
+ <zeroOrMore>
338
+ <ref name="fn">
339
+ <a:documentation>Footnotes specific to the figure</a:documentation>
340
+ </ref>
341
+ </zeroOrMore>
342
+ <optional>
343
+ <ref name="dl-no-id">
344
+ <a:documentation>An optional definitions list defining any symbols used in the figure</a:documentation>
345
+ </ref>
346
+ </optional>
347
+ <zeroOrMore>
348
+ <ref name="note-no-id">
349
+ <a:documentation>Notes whose scope is the current block</a:documentation>
350
+ </ref>
351
+ </zeroOrMore>
352
+ <ref name="BlockSource">
353
+ <a:documentation>A source for the block</a:documentation>
354
+ </ref>
355
+ </define>
356
+ <define name="source">
357
+ <element name="source">
358
+ <attribute name="status">
359
+ <a:documentation>The status of the term as it is used in this document, relative to its definition in the original document</a:documentation>
360
+ <ref name="SourceStatusType"/>
361
+ </attribute>
362
+ <attribute name="type">
363
+ <a:documentation>The type of the managed term in the present context</a:documentation>
364
+ <ref name="SourceTypeType"/>
365
+ </attribute>
366
+ <ref name="origin">
367
+ <a:documentation>The original document and location where the term definition has been obtained from</a:documentation>
368
+ </ref>
369
+ <optional>
370
+ <ref name="modification">
371
+ <a:documentation>Any changes that the definition of the term has undergone relative to the original document,
372
+ in order to be applicable in this standardisation document</a:documentation>
373
+ </ref>
374
+ </optional>
375
+ </element>
376
+ </define>
269
377
  <define name="sourcecodebody">
270
378
  <a:documentation>The computer code or other such text presented in the block, as a single unformatted string.
271
379
  (The string should be treated as pre-formatted text, with whitespace treated as significant)</a:documentation>
@@ -687,6 +795,20 @@ titlecase, or lowercase</a:documentation>
687
795
  </attribute>
688
796
  </optional>
689
797
  </define>
798
+ <define name="RequiredId" combine="interleave">
799
+ <optional>
800
+ <attribute name="anchor">
801
+ <a:documentation>User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
802
+ </attribute>
803
+ </optional>
804
+ </define>
805
+ <define name="OptionalId" combine="interleave">
806
+ <optional>
807
+ <attribute name="anchor">
808
+ <a:documentation> User-supplied anchor of element; replaced by content-based id, with all references to the anchor updated accordingly</a:documentation>
809
+ </attribute>
810
+ </optional>
811
+ </define>
690
812
  <define name="ObligationType">
691
813
  <a:documentation>The force of a clause in a standard document: whether it has normative or informative effect</a:documentation>
692
814
  <choice>
@@ -1081,7 +1203,7 @@ That concept may be defined as a term within the current document, or it may be
1081
1203
  <element name="label">
1082
1204
  <!-- Identifier of form input element that this element is a label of -->
1083
1205
  <attribute name="for">
1084
- <data type="IDREF"/>
1206
+ <ref name="IdRefType"/>
1085
1207
  </attribute>
1086
1208
  <zeroOrMore>
1087
1209
  <ref name="PureTextElement"/>
@@ -1328,6 +1450,7 @@ numbers</a:documentation>
1328
1450
  <ref name="foreword"/>
1329
1451
  <ref name="introduction"/>
1330
1452
  <ref name="acknowledgements"/>
1453
+ <ref name="executivesummary"/>
1331
1454
  </choice>
1332
1455
  </oneOrMore>
1333
1456
  </element>
@@ -1351,6 +1474,11 @@ numbers</a:documentation>
1351
1474
  <ref name="Content-Section"/>
1352
1475
  </element>
1353
1476
  </define>
1477
+ <define name="executivesummary">
1478
+ <element name="executivesummary">
1479
+ <ref name="Content-Section"/>
1480
+ </element>
1481
+ </define>
1354
1482
  <define name="indexsect">
1355
1483
  <element name="indexsect">
1356
1484
  <ref name="Content-Section"/>
@@ -1576,6 +1704,15 @@ used in document amendments</a:documentation>
1576
1704
  <define name="annex">
1577
1705
  <element name="annex">
1578
1706
  <ref name="Annex-Section"/>
1707
+ <zeroOrMore>
1708
+ <ref name="annex-appendix"/>
1709
+ </zeroOrMore>
1710
+ </element>
1711
+ </define>
1712
+ <define name="annex-appendix">
1713
+ <a:documentation>Appendix, distinct subclause type for annexes (annex to annex, rather than subclause to annex)</a:documentation>
1714
+ <element name="appendix">
1715
+ <ref name="Clause-Section"/>
1579
1716
  </element>
1580
1717
  </define>
1581
1718
  <define name="terms">
@@ -2106,7 +2243,7 @@ used in document amendments</a:documentation>
2106
2243
  </define>
2107
2244
  <define name="termsource">
2108
2245
  <a:documentation>The bibliographic source where a term is defined in the sense applicable in this standardisation document</a:documentation>
2109
- <element name="termsource">
2246
+ <element name="source">
2110
2247
  <attribute name="status">
2111
2248
  <a:documentation>The status of the term as it is used in this document, relative to its definition in the original document</a:documentation>
2112
2249
  <ref name="SourceStatusType"/>
@@ -2488,6 +2625,11 @@ Normative References contents contain normative references, but as a clause in t
2488
2625
  <ref name="termsource"/>
2489
2626
  </zeroOrMore>
2490
2627
  </define>
2628
+ <define name="BlockSource">
2629
+ <zeroOrMore>
2630
+ <ref name="source"/>
2631
+ </zeroOrMore>
2632
+ </define>
2491
2633
  <start>
2492
2634
  <ref name="standard-document"/>
2493
2635
  </start>
@@ -162,9 +162,4 @@
162
162
  </zeroOrMore>
163
163
  </element>
164
164
  </define>
165
- <define name="annex-appendix">
166
- <element name="appendix">
167
- <ref name="Clause-Section"/>
168
- </element>
169
- </define>
170
165
  </grammar>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Plateau
3
- VERSION = "1.0.3".freeze
3
+ VERSION = "1.0.6".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-plateau
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-15 00:00:00.000000000 Z
11
+ date: 2025-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-jis