metanorma-ogc 2.3.3 → 2.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -2422,6 +2422,7 @@
2422
2422
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2423
2423
 
2424
2424
  <xsl:choose>
2425
+ <xsl:when test="@width = 'full-page-width' or @width = 'text-width'">100%</xsl:when>
2425
2426
  <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
2426
2427
  <xsl:otherwise><xsl:value-of select="$table_width_default"/></xsl:otherwise>
2427
2428
  </xsl:choose>
@@ -2540,7 +2541,7 @@
2540
2541
  <xsl:variable name="isDeleted" select="@deleted"/>
2541
2542
 
2542
2543
  <xsl:choose>
2543
- <xsl:when test="@width">
2544
+ <xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
2544
2545
 
2545
2546
  <!-- centered table when table name is centered (see table-name-style) -->
2546
2547
 
@@ -2862,6 +2863,7 @@
2862
2863
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2863
2864
  <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
2864
2865
  <!-- difference between the available space and the minimum table width -->
2866
+ <_width_min><xsl:value-of select="@width_min"/></_width_min>
2865
2867
  <xsl:variable name="W" select="$page_width - @width_min"/>
2866
2868
  <W><xsl:value-of select="$W"/></W>
2867
2869
  <!-- difference between maximum and minimum width of the table -->
@@ -3479,17 +3481,20 @@
3479
3481
  <xsl:for-each select="xalan:nodeset($references)//fn">
3480
3482
  <xsl:variable name="reference" select="@reference"/>
3481
3483
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
3482
- <fo:block xsl:use-attribute-sets="table-fn-style">
3483
3484
 
3484
- <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
3485
+ <fo:block xsl:use-attribute-sets="table-fn-style">
3485
3486
 
3486
- <xsl:value-of select="@reference"/>
3487
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
3488
+
3489
+ <xsl:value-of select="@reference"/>
3490
+
3491
+ </fo:inline>
3492
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
3493
+ <xsl:copy-of select="./node()"/>
3494
+ </fo:inline>
3495
+
3496
+ </fo:block>
3487
3497
 
3488
- </fo:inline>
3489
- <fo:inline xsl:use-attribute-sets="table-fn-body-style">
3490
- <xsl:copy-of select="./node()"/>
3491
- </fo:inline>
3492
- </fo:block>
3493
3498
  </xsl:if>
3494
3499
  </xsl:for-each>
3495
3500
  </xsl:template>
@@ -4441,12 +4446,12 @@
4441
4446
  <xsl:param name="value"/>
4442
4447
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
4443
4448
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
4444
- <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
4445
- <xsl:attribute name="height">5mm</xsl:attribute>
4449
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
4450
+ <xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
4446
4451
  <xsl:attribute name="content-width">100%</xsl:attribute>
4447
4452
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4448
4453
  <xsl:attribute name="scaling">uniform</xsl:attribute>
4449
- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4454
+ <!-- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4450
4455
  <g>
4451
4456
  <xsl:if test="$type = 'closing' or $type = 'end'">
4452
4457
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
@@ -4460,6 +4465,27 @@
4460
4465
  </xsl:if>
4461
4466
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
4462
4467
  </text>
4468
+ </svg> -->
4469
+ <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4470
+ <g>
4471
+ <xsl:if test="$type = 'closing' or $type = 'end'">
4472
+ <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
4473
+ </xsl:if>
4474
+ <polyline points="0,2.5 {$maxwidth},2.5 {$maxwidth + 20},40 {$maxwidth},77.5 0,77.5" stroke="black" stroke-width="5" fill="white"/>
4475
+ <line x1="9.5" y1="0" x2="9.5" y2="80" stroke="black" stroke-width="19"/>
4476
+ </g>
4477
+ <xsl:variable name="text_x">
4478
+ <xsl:choose>
4479
+ <xsl:when test="$type = 'closing' or $type = 'end'">28</xsl:when>
4480
+ <xsl:otherwise>22</xsl:otherwise>
4481
+ </xsl:choose>
4482
+ </xsl:variable>
4483
+ <text font-family="Arial" x="{$text_x}" y="50" font-size="40pt">
4484
+ <xsl:value-of select="$kind"/>
4485
+ </text>
4486
+ <text font-family="Arial" x="{$text_x + 33}" y="65" font-size="38pt">
4487
+ <xsl:value-of select="$value"/>
4488
+ </text>
4463
4489
  </svg>
4464
4490
  </fo:instream-foreign-object>
4465
4491
  </xsl:template>
@@ -4714,18 +4740,23 @@
4714
4740
 
4715
4741
  <xsl:template name="add-zero-spaces-java">
4716
4742
  <xsl:param name="text" select="."/>
4717
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
4718
- <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1​')"/>
4743
+
4744
+ <!-- add zero-width space (#x200B) after dot with next non-digit -->
4745
+ <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(\.)([^\d\s])','$1​$2')"/>
4746
+ <!-- add zero-width space (#x200B) after characters: dash, equal, underscore, em dash, thin space, arrow right -->
4747
+ <xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1),'(-|=|_|—| |→)','$1​')"/>
4748
+ <!-- add zero-width space (#x200B) after characters: colon, if there aren't digits after -->
4749
+ <xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2),'(:)(\D)','$1​$2')"/>
4719
4750
  <!-- add zero-width space (#x200B) after characters: 'great than' -->
4720
- <xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1), '(\u003e)(?!\u003e)', '$1​')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
4751
+ <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(\u003e)(?!\u003e)', '$1​')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
4721
4752
  <!-- add zero-width space (#x200B) before characters: 'less than' -->
4722
- <xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2), '(?&lt;!\u003c)(\u003c)', '​$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
4753
+ <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(?&lt;!\u003c)(\u003c)', '​$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
4723
4754
  <!-- add zero-width space (#x200B) before character: { -->
4724
- <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
4755
+ <xsl:variable name="text6" select="java:replaceAll(java:java.lang.String.new($text5), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
4725
4756
  <!-- add zero-width space (#x200B) after character: , -->
4726
- <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
4757
+ <xsl:variable name="text7" select="java:replaceAll(java:java.lang.String.new($text6), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
4727
4758
 
4728
- <xsl:value-of select="$text5"/>
4759
+ <xsl:value-of select="$text7"/>
4729
4760
  </xsl:template>
4730
4761
 
4731
4762
  <xsl:template name="add-zero-spaces-link-java">
@@ -4734,7 +4765,9 @@
4734
4765
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
4735
4766
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
4736
4767
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4737
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
4768
+ <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
4769
+ <!-- remove zero-width space at the end -->
4770
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
4738
4771
  </xsl:template>
4739
4772
 
4740
4773
  <!-- add zero space after dash character (for table's entries) -->
@@ -4871,7 +4904,7 @@
4871
4904
  </xsl:copy>
4872
4905
  </xsl:template>
4873
4906
 
4874
- <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode'])]" mode="table-without-br">
4907
+ <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode']) and not(*[local-name()='ul']) and not(*[local-name()='ol'])]" mode="table-without-br">
4875
4908
  <xsl:copy>
4876
4909
  <xsl:copy-of select="@*"/>
4877
4910
  <p>
@@ -4947,6 +4980,14 @@
4947
4980
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
4948
4981
  </xsl:template>
4949
4982
 
4983
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'ol' or local-name() = 'ul']" mode="table-without-br">
4984
+ <xsl:apply-templates mode="table-without-br"/>
4985
+ </xsl:template>
4986
+
4987
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'li']" mode="table-without-br">
4988
+ <xsl:apply-templates mode="table-without-br"/>
4989
+ </xsl:template>
4990
+
4950
4991
  <!-- mode="table-without-br" -->
4951
4992
  <!-- ================================== -->
4952
4993
  <!-- END: Step 0. replace <br/> to <p>...</p> -->
@@ -5764,7 +5805,7 @@
5764
5805
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
5765
5806
  </xsl:if>
5766
5807
 
5767
- <fo:block-container margin-left="0mm">
5808
+ <fo:block-container margin-left="0mm" margin-right="0mm">
5768
5809
 
5769
5810
  <fo:block>
5770
5811
 
@@ -5940,11 +5981,14 @@
5940
5981
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
5941
5982
  </xsl:call-template>
5942
5983
 
5984
+ <!-- Example: Dimensions in millimeters -->
5985
+ <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
5986
+
5943
5987
  <fo:block xsl:use-attribute-sets="figure-style">
5944
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5988
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
5945
5989
  </fo:block>
5946
5990
  <xsl:call-template name="fn_display_figure"/>
5947
- <xsl:for-each select="*[local-name() = 'note']">
5991
+ <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
5948
5992
  <xsl:call-template name="note"/>
5949
5993
  </xsl:for-each>
5950
5994
 
@@ -6201,24 +6245,47 @@
6201
6245
 
6202
6246
  </xsl:when>
6203
6247
  <xsl:otherwise>
6204
- <fo:block xsl:use-attribute-sets="image-style">
6205
- <fo:instream-foreign-object fox:alt-text="{$alt-text}">
6206
- <xsl:attribute name="width">100%</xsl:attribute>
6207
- <xsl:attribute name="content-height">100%</xsl:attribute>
6208
- <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6209
- <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
6210
- <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
6211
- <!-- effective height 297 - 27.4 - 13 = 256.6 -->
6212
- <!-- effective width 210 - 12.5 - 25 = 172.5 -->
6213
- <!-- effective height / width = 1.48, 1.4 - with title -->
6214
- <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
6215
- <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
6216
- <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
6217
- </xsl:if>
6218
- <xsl:attribute name="scaling">uniform</xsl:attribute>
6219
- <xsl:copy-of select="$svg_content"/>
6220
- </fo:instream-foreign-object>
6221
- </fo:block>
6248
+
6249
+ <xsl:variable name="element">
6250
+ <xsl:choose>
6251
+ <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
6252
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
6253
+ </xsl:when>
6254
+ <xsl:otherwise>
6255
+ <fo:block xsl:use-attribute-sets="image-style">
6256
+ <xsl:if test="ancestor::*[local-name() = 'dt']">
6257
+ <xsl:attribute name="text-align">left</xsl:attribute>
6258
+ </xsl:if>
6259
+ </fo:block>
6260
+ </xsl:otherwise>
6261
+ </xsl:choose>
6262
+ </xsl:variable>
6263
+
6264
+ <xsl:for-each select="xalan:nodeset($element)/*">
6265
+ <xsl:copy>
6266
+ <xsl:copy-of select="@*"/>
6267
+ <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
6268
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
6269
+ <xsl:if test="$isGenerateTableIF = 'false'">
6270
+ <xsl:attribute name="width">100%</xsl:attribute>
6271
+ </xsl:if>
6272
+ <xsl:attribute name="content-height">100%</xsl:attribute>
6273
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6274
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
6275
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
6276
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
6277
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
6278
+ <!-- effective height / width = 1.48, 1.4 - with title -->
6279
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
6280
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
6281
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
6282
+ </xsl:if>
6283
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
6284
+ <xsl:copy-of select="$svg_content"/>
6285
+ </fo:instream-foreign-object>
6286
+ <!-- </fo:block> -->
6287
+ </xsl:copy>
6288
+ </xsl:for-each>
6222
6289
  </xsl:otherwise>
6223
6290
  </xsl:choose>
6224
6291
  </xsl:template>
@@ -6310,6 +6377,13 @@
6310
6377
  </xsl:for-each>
6311
6378
  </xsl:template>
6312
6379
 
6380
+ <!-- For the structures like: <dt><image src="" mimetype="image/svg+xml" height="" width=""><svg xmlns="http://www.w3.org/2000/svg" ... -->
6381
+ <xsl:template match="*[local-name() != 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
6382
+ <xsl:for-each select="*[local-name() = 'svg']">
6383
+ <xsl:call-template name="image_svg"/>
6384
+ </xsl:for-each>
6385
+ </xsl:template>
6386
+
6313
6387
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
6314
6388
  <xsl:variable name="svg_content" select="document(@src)"/>
6315
6389
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -6448,6 +6522,8 @@
6448
6522
  <xsl:value-of select="."/>
6449
6523
  </xsl:template>
6450
6524
 
6525
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="bookmarks" priority="3"/>
6526
+
6451
6527
  <xsl:template match="node()" mode="contents">
6452
6528
  <xsl:apply-templates mode="contents"/>
6453
6529
  </xsl:template>
@@ -6750,7 +6826,15 @@
6750
6826
  <xsl:value-of select="@section"/>
6751
6827
  <xsl:text> </xsl:text>
6752
6828
  </xsl:if>
6753
- <xsl:value-of select="normalize-space(title)"/>
6829
+ <xsl:variable name="title">
6830
+ <xsl:for-each select="title/node()">
6831
+ <xsl:choose>
6832
+ <xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
6833
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
6834
+ </xsl:choose>
6835
+ </xsl:for-each>
6836
+ </xsl:variable>
6837
+ <xsl:value-of select="normalize-space($title)"/>
6754
6838
  </fo:bookmark-title>
6755
6839
  <xsl:apply-templates mode="bookmark"/>
6756
6840
  </fo:bookmark>
@@ -6776,6 +6860,12 @@
6776
6860
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
6777
6861
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/>
6778
6862
 
6863
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
6864
+ <fo:block text-align="right" keep-with-next="always">
6865
+ <xsl:apply-templates/>
6866
+ </fo:block>
6867
+ </xsl:template>
6868
+
6779
6869
  <!-- ====== -->
6780
6870
  <!-- ====== -->
6781
6871
  <xsl:template match="*[local-name() = 'title']" mode="contents_item">
@@ -6925,6 +7015,10 @@
6925
7015
  </xsl:for-each>
6926
7016
  </xsl:template>
6927
7017
 
7018
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="contents_item" priority="2">
7019
+ <xsl:value-of select="."/>
7020
+ </xsl:template>
7021
+
6928
7022
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
6929
7023
  <xsl:template match="*[local-name() = 'span']" mode="contents_item">
6930
7024
  <xsl:apply-templates mode="contents_item"/>
@@ -203,13 +203,13 @@ module IsoDoc
203
203
  display_order_xpath(docxml, "//indexsect", i)
204
204
  end
205
205
 
206
- def norm_ref_entry_code(_ordinal, _idents, _ids, _standard, _datefn)
206
+ def norm_ref_entry_code(_ordinal, _idents, _ids, _standard, _datefn, _bib)
207
207
  ""
208
208
  end
209
209
 
210
210
  # if ids is just a number, only use that ([1] Non-Standard)
211
211
  # else, use both ordinal, as prefix, and ids
212
- def biblio_ref_entry_code(ordinal, ids, _id, standard, datefn)
212
+ def biblio_ref_entry_code(ordinal, ids, _id, standard, datefn, _bib)
213
213
  standard and return "[#{ordinal}]<tab/>"
214
214
  ret = (ids[:ordinal] || ids[:metanorma] || "[#{ordinal}]")
215
215
  prefix_bracketed_ref("#{ret}#{datefn}")
@@ -522,7 +522,6 @@
522
522
  <value>tip</value>
523
523
  <value>important</value>
524
524
  <value>caution</value>
525
- <value>statement</value>
526
525
  </choice>
527
526
  </define>
528
527
  <define name="figure">
@@ -216,6 +216,9 @@
216
216
  <optional>
217
217
  <ref name="fullname"/>
218
218
  </optional>
219
+ <zeroOrMore>
220
+ <ref name="credential"/>
221
+ </zeroOrMore>
219
222
  <zeroOrMore>
220
223
  <ref name="affiliation"/>
221
224
  </zeroOrMore>
@@ -232,6 +235,11 @@
232
235
  <ref name="FullNameType"/>
233
236
  </element>
234
237
  </define>
238
+ <define name="credential">
239
+ <element name="credential">
240
+ <text/>
241
+ </element>
242
+ </define>
235
243
  <define name="FullNameType">
236
244
  <choice>
237
245
  <group>
@@ -305,7 +313,9 @@
305
313
  <zeroOrMore>
306
314
  <ref name="affiliationdescription"/>
307
315
  </zeroOrMore>
308
- <ref name="organization"/>
316
+ <optional>
317
+ <ref name="organization"/>
318
+ </optional>
309
319
  </element>
310
320
  </define>
311
321
  <define name="affiliationname">
@@ -16,7 +16,7 @@ module Metanorma
16
16
  csv_split(HTMLEntities.new
17
17
  .decode(node.attr("submitting-organizations")), ";")&.each do |org|
18
18
  xml.contributor do |c|
19
- c.role **{ type: "author" }
19
+ c.role type: "author"
20
20
  c.organization do |a|
21
21
  a.name org
22
22
  end
@@ -39,12 +39,12 @@ module Metanorma
39
39
  def personal_role(node, contrib, suffix)
40
40
  type = node.attr("role#{suffix}")&.downcase || "editor"
41
41
  if type == "contributor"
42
- contrib.role **{ type: "author" } do |r|
42
+ contrib.role type: "author" do |r|
43
43
  r.description do |d|
44
44
  d << type
45
45
  end
46
46
  end
47
- else contrib.role **{ type: type }
47
+ else contrib.role type: type
48
48
  end
49
49
  end
50
50
 
@@ -52,7 +52,7 @@ module Metanorma
52
52
  return unless node.attr("editor")
53
53
 
54
54
  xml.contributor do |c|
55
- c.role **{ type: "editor" }
55
+ c.role type: "editor"
56
56
  c.person do |p|
57
57
  p.name do |n|
58
58
  n.completename node.attr("editor")
@@ -114,14 +114,13 @@ module Metanorma
114
114
  end
115
115
 
116
116
  def metadata_id(node, xml)
117
- e = externalid(node) and xml.docidentifier e, **{ type: "ogc-external" }
117
+ e = externalid(node) and xml.docidentifier e, type: "ogc-external"
118
118
  node.attr("referenceurlid") and
119
- xml.docidentifier externalurl(node), **{ type: "ogc-external" }
119
+ xml.docidentifier externalurl(node), type: "ogc-external"
120
120
  docnumber = node.attr("docnumber") || node.attr("docreference")
121
- if docnumber
122
- xml.docidentifier docnumber, **{ type: "ogc-internal" }
123
- xml.docnumber docnumber
124
- end
121
+ id = node.attr("docidentifier") || docnumber
122
+ xml.docidentifier id, type: "ogc-internal"
123
+ docnumber and xml.docnumber docnumber
125
124
  end
126
125
 
127
126
  def externalurl(node)
@@ -153,7 +152,7 @@ module Metanorma
153
152
 
154
153
  def ogc_date(node, xml, ogcname, metanormaname)
155
154
  if node.attr(ogcname)
156
- xml.date **{ type: metanormaname } do |d|
155
+ xml.date type: metanormaname do |d|
157
156
  d.on node.attr(ogcname)
158
157
  end
159
158
  end
@@ -66,6 +66,7 @@
66
66
  <value>caution</value>
67
67
  <value>statement</value>
68
68
  <value>editorial</value>
69
+ <value>box</value>
69
70
  </choice>
70
71
  </define>
71
72
  <define name="index">
@@ -1577,6 +1578,9 @@
1577
1578
  <zeroOrMore>
1578
1579
  <ref name="indexsect"/>
1579
1580
  </zeroOrMore>
1581
+ <optional>
1582
+ <ref name="colophon"/>
1583
+ </optional>
1580
1584
  </element>
1581
1585
  </define>
1582
1586
  <define name="misccontainer">
@@ -1599,6 +1603,13 @@
1599
1603
  </oneOrMore>
1600
1604
  </element>
1601
1605
  </define>
1606
+ <define name="colophon">
1607
+ <element name="colophon">
1608
+ <oneOrMore>
1609
+ <ref name="content"/>
1610
+ </oneOrMore>
1611
+ </element>
1612
+ </define>
1602
1613
  <define name="foreword">
1603
1614
  <element name="foreword">
1604
1615
  <ref name="Content-Section"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.3.3".freeze
3
+ VERSION = "2.3.4".freeze
4
4
  end
5
5
  end
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.3
4
+ version: 2.3.4
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-01-24 00:00:00.000000000 Z
11
+ date: 2023-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639