metanorma-itu 2.7.1 → 2.7.3

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.
@@ -634,7 +634,8 @@
634
634
  <xsl:variable name="date_published"><xsl:call-template name="get_date_published"/></xsl:variable>
635
635
  <xsl:variable name="annexid" select="normalize-space(/mn:metanorma/mn:bibdata/mn:ext/mn:structuredidentifier/mn:annexid)"/>
636
636
 
637
- <xsl:variable name="bureau" select="/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:bureau"/>
637
+ <!-- <xsl:variable name="bureau" select="/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:bureau"/> -->
638
+ <xsl:variable name="bureau" select="/mn:metanorma/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description = 'committee']/mn:organization/mn:subdivision[@type = 'Bureau']/mn:name"/>
638
639
 
639
640
  <xsl:variable name="docidentifier_ITU" select="/mn:metanorma/mn:bibdata/mn:docidentifier[@type = 'ITU']"/>
640
641
  <xsl:variable name="docidentifier_ITU_left_part_" select="normalize-space(substring-before($docidentifier_ITU, ' '))"/>
@@ -745,7 +746,8 @@
745
746
  <!-- Sector or Bureau name -->
746
747
  <fo:table-cell text-align="end">
747
748
  <fo:block>
748
- <xsl:variable name="sector" select="normalize-space(/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:sector)"/>
749
+ <!-- <xsl:variable name="sector" select="normalize-space(/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:sector)"/> -->
750
+ <xsl:variable name="sector" select="/mn:metanorma/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description = 'committee']/mn:organization/mn:subdivision[@type = 'Sector']/mn:name"/>
749
751
  <xsl:value-of select="$sector"/>
750
752
  <xsl:if test="$sector = ''">
751
753
  <xsl:variable name="bureau_key">
@@ -1114,7 +1116,8 @@
1114
1116
  <fo:block font-weight="bold">Question(s):</fo:block>
1115
1117
  </fo:table-cell>
1116
1118
  <fo:table-cell padding-top="3mm">
1117
- <fo:block><xsl:value-of select="/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:group/mn:name"/></fo:block>
1119
+ <!-- <fo:block><xsl:value-of select="/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:group/mn:name"/></fo:block> -->
1120
+ <fo:block><xsl:value-of select="/mn:metanorma/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description = 'committee']/mn:organization/mn:subdivision[@type = 'Group']/mn:name"/></fo:block>
1118
1121
  </fo:table-cell>
1119
1122
  <fo:table-cell padding-top="3mm">
1120
1123
  <fo:block font-weight="bold">Meeting, date:</fo:block>
@@ -1149,14 +1152,16 @@
1149
1152
  <fo:block font-weight="bold">Study Group:</fo:block>
1150
1153
  </fo:table-cell>
1151
1154
  <fo:table-cell padding-top="2mm">
1152
- <xsl:variable name="subgroup" select="/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:subgroup/mn:name"/>
1155
+ <!-- <xsl:variable name="subgroup" select="/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:subgroup/mn:name"/> -->
1156
+ <xsl:variable name="subgroup" select="/mn:metanorma/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description = 'committee']/mn:organization/mn:subdivision[@type = 'Subgroup']/mn:name"/>
1153
1157
  <fo:block><xsl:value-of select="java:replaceAll(java:java.lang.String.new($subgroup),'(.)','$1​')"/></fo:block>
1154
1158
  </fo:table-cell>
1155
1159
  <fo:table-cell padding-top="2mm">
1156
1160
  <fo:block font-weight="bold">Working Party:</fo:block>
1157
1161
  </fo:table-cell>
1158
1162
  <fo:table-cell padding-top="2mm">
1159
- <xsl:variable name="workgroup" select="/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:workgroup/mn:name"/>
1163
+ <!-- <xsl:variable name="workgroup" select="/mn:metanorma/mn:bibdata/mn:ext/mn:editorialgroup/mn:workgroup/mn:name"/> -->
1164
+ <xsl:variable name="workgroup" select="/mn:metanorma/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description = 'committee']/mn:organization/mn:subdivision[@type = 'Workgroup']/mn:name"/>
1160
1165
  <fo:block><xsl:value-of select="java:replaceAll(java:java.lang.String.new($workgroup),'(.)','$1​')"/></fo:block>
1161
1166
  </fo:table-cell>
1162
1167
  <fo:table-cell padding-top="2mm">
@@ -1846,7 +1851,7 @@
1846
1851
  </fo:block>
1847
1852
  </xsl:template>
1848
1853
 
1849
- <xsl:template match="mn:preface//mn:clause[@type = 'toc']" priority="4">
1854
+ <xsl:template match="mn:preface//mn:clause[@type = 'toc']" name="toc" priority="4">
1850
1855
  <xsl:param name="process">false</xsl:param>
1851
1856
  <xsl:param name="num"/>
1852
1857
 
@@ -2351,13 +2356,9 @@
2351
2356
  </xsl:template>
2352
2357
 
2353
2358
  <xsl:template match="mn:copyright-statement//mn:p" priority="2">
2354
- <fo:block>
2355
- <xsl:if test="not(preceding-sibling::mn:p)"> <!-- first para -->
2356
- <xsl:attribute name="text-align">center</xsl:attribute>
2357
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
2358
- <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
2359
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2360
- </xsl:if>
2359
+ <fo:block xsl:use-attribute-sets="copyright-statement-p-style">
2360
+ <xsl:call-template name="refine_copyright-statement-p-style"/>
2361
+
2361
2362
  <xsl:apply-templates/>
2362
2363
  </fo:block>
2363
2364
  </xsl:template>
@@ -4619,13 +4620,29 @@
4619
4620
  <xsl:attribute-set name="copyright-statement-style">
4620
4621
  </xsl:attribute-set> <!-- copyright-statement-style -->
4621
4622
 
4623
+ <xsl:template name="refine_copyright-statement-style">
4624
+ </xsl:template>
4625
+
4622
4626
  <xsl:attribute-set name="copyright-statement-title-style">
4623
4627
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
4624
4628
 
4629
+ <xsl:template name="refine_copyright-statement-title-style">
4630
+ </xsl:template>
4631
+
4625
4632
  <xsl:attribute-set name="copyright-statement-p-style">
4626
4633
  </xsl:attribute-set> <!-- copyright-statement-p-style -->
4627
4634
 
4628
- <xsl:attribute-set name="license-statement-style">
4635
+ <xsl:template name="refine_copyright-statement-p-style">
4636
+ <xsl:if test="not(preceding-sibling::mn:p)"> <!-- first para -->
4637
+ <xsl:attribute name="text-align">center</xsl:attribute>
4638
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
4639
+ <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
4640
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
4641
+ </xsl:if>
4642
+
4643
+ </xsl:template>
4644
+
4645
+ <xsl:attribute-set name="license-statement-style">
4629
4646
  </xsl:attribute-set> <!-- license-statement-style -->
4630
4647
 
4631
4648
  <xsl:attribute-set name="license-statement-title-style">
@@ -4637,6 +4654,10 @@
4637
4654
  <xsl:attribute-set name="license-statement-p-style">
4638
4655
  </xsl:attribute-set> <!-- license-statement-p-style -->
4639
4656
 
4657
+ <xsl:template name="refine_license-statement-p-style">
4658
+
4659
+ </xsl:template>
4660
+
4640
4661
  <xsl:attribute-set name="legal-statement-style">
4641
4662
  </xsl:attribute-set> <!-- legal-statement-style -->
4642
4663
 
@@ -4666,6 +4687,8 @@
4666
4687
  <!-- ================================= -->
4667
4688
  <xsl:template match="mn:copyright-statement">
4668
4689
  <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
4690
+ <xsl:call-template name="refine_copyright-statement-style"/>
4691
+
4669
4692
  <xsl:apply-templates/>
4670
4693
  </fo:block>
4671
4694
  </xsl:template> <!-- copyright-statement -->
@@ -5772,7 +5795,7 @@
5772
5795
  </xsl:otherwise>
5773
5796
  </xsl:choose>
5774
5797
  </xsl:variable>
5775
- <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift'">
5798
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift' or $key = 'line-height' ">
5776
5799
  <style name="{$key}"><xsl:value-of select="$value"/></style>
5777
5800
  </xsl:if>
5778
5801
  <xsl:if test="$key = 'text-indent'">
@@ -12607,7 +12630,7 @@
12607
12630
 
12608
12631
  <xsl:template name="insertFootnoteSeparatorCommon">
12609
12632
  <xsl:param name="leader_length">30%</xsl:param>
12610
- <fo:static-content flow-name="xsl-footnote-separator">
12633
+ <fo:static-content flow-name="xsl-footnote-separator" role="artifact">
12611
12634
  <fo:block>
12612
12635
  <fo:leader leader-pattern="rule" leader-length="{$leader_length}"/>
12613
12636
  </fo:block>
@@ -13420,13 +13443,31 @@
13420
13443
  <!-- skip here, see the template 'fmt-review-start' -->
13421
13444
  </xsl:when>
13422
13445
  <xsl:otherwise>
13423
- <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
13424
- <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
13425
- <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
13426
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
13446
+ <xsl:choose>
13447
+ <xsl:when test="parent::mn:example or parent::mn:termexample or parent::mn:note or parent::mn:termnote">
13448
+ <fo:block font-size="1pt" line-height="0.1">
13449
+ <xsl:call-template name="fo_inline_bookmark">
13450
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
13451
+ </xsl:call-template>
13452
+ </fo:block>
13453
+ </xsl:when>
13454
+ <xsl:otherwise>
13455
+ <xsl:call-template name="fo_inline_bookmark">
13456
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
13457
+ </xsl:call-template>
13458
+ </xsl:otherwise>
13459
+ </xsl:choose>
13427
13460
  </xsl:otherwise>
13428
13461
  </xsl:choose>
13429
13462
  </xsl:template>
13463
+
13464
+ <xsl:template name="fo_inline_bookmark">
13465
+ <xsl:param name="bookmark_id"/>
13466
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
13467
+ <fo:inline id="{@id}" font-size="1pt"><xsl:if test="preceding-sibling::node()[self::mn:fmt-annotation-start][@source = $bookmark_id] and following-sibling::node()[self::mn:fmt-annotation-end][@source = $bookmark_id]"><xsl:attribute name="line-height">0.1</xsl:attribute></xsl:if><xsl:value-of select="$hair_space"/></fo:inline>
13468
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
13469
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
13470
+ </xsl:template>
13430
13471
  <!-- =================== -->
13431
13472
  <!-- End of Index processing -->
13432
13473
  <!-- =================== -->
@@ -13533,6 +13574,9 @@
13533
13574
  <xsl:attribute name="role">H1</xsl:attribute>
13534
13575
  </xsl:attribute-set>
13535
13576
 
13577
+ <xsl:template name="refine_toc-title-style">
13578
+ </xsl:template>
13579
+
13536
13580
  <xsl:attribute-set name="toc-title-page-style">
13537
13581
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
13538
13582
  <xsl:attribute name="text-align">end</xsl:attribute>
@@ -13540,6 +13584,9 @@
13540
13584
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
13541
13585
  </xsl:attribute-set> <!-- toc-title-page-style -->
13542
13586
 
13587
+ <xsl:template name="refine_toc-title-page-style">
13588
+ </xsl:template>
13589
+
13543
13590
  <xsl:attribute-set name="toc-item-block-style">
13544
13591
  </xsl:attribute-set>
13545
13592
 
@@ -13575,6 +13622,9 @@
13575
13622
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
13576
13623
  </xsl:attribute-set>
13577
13624
 
13625
+ <xsl:template name="refine_toc-listof-title-style">
13626
+ </xsl:template>
13627
+
13578
13628
  <xsl:attribute-set name="toc-listof-item-block-style">
13579
13629
  </xsl:attribute-set>
13580
13630
 
@@ -13921,7 +13971,7 @@
13921
13971
  </xsl:if>
13922
13972
 
13923
13973
  <xsl:for-each select="$contents_nodes/mnx:doc">
13924
- <fo:bookmark internal-destination="{contents/mnx:item[@display = 'true'][1]/@id}" starting-state="hide">
13974
+ <fo:bookmark internal-destination="{mnx:contents/mnx:item[@display = 'true'][1]/@id}" starting-state="hide">
13925
13975
  <xsl:if test="@bundle = 'true'">
13926
13976
  <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
13927
13977
  </xsl:if>
@@ -13955,7 +14005,7 @@
13955
14005
  </xsl:choose>
13956
14006
  </fo:bookmark-title>
13957
14007
 
13958
- <xsl:apply-templates select="contents/mnx:item" mode="bookmark"/>
14008
+ <xsl:apply-templates select="mnx:contents/mnx:item" mode="bookmark"/>
13959
14009
 
13960
14010
  <xsl:call-template name="insertFigureBookmarks">
13961
14011
  <xsl:with-param name="contents" select="mnx:contents"/>
@@ -15314,11 +15364,35 @@
15314
15364
 
15315
15365
  <xsl:template match="mn:svgmap"/>
15316
15366
 
15367
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
15368
+
15317
15369
  <!-- for correct rendering combining chars, added in mode="update_xml_step2" -->
15318
15370
  <xsl:template match="*[local-name() = 'lang_none']">
15319
15371
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
15320
15372
  </xsl:template>
15321
15373
 
15374
+ <xsl:template name="addTagElementT">
15375
+ <xsl:variable name="title_">
15376
+ <xsl:apply-templates select="mn:fmt-title"/>
15377
+ </xsl:variable>
15378
+ <xsl:variable name="title__">
15379
+ <xsl:for-each select="xalan:nodeset($title_)/*/node()">
15380
+ <xsl:choose>
15381
+ <xsl:when test="self::text()"><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text></xsl:when>
15382
+ <xsl:otherwise><xsl:text> </xsl:text><xsl:copy-of select="."/><xsl:text> </xsl:text></xsl:otherwise>
15383
+ </xsl:choose>
15384
+ </xsl:for-each>
15385
+ </xsl:variable>
15386
+ <xsl:variable name="title" select="normalize-space($title__)"/>
15387
+ <xsl:if test="$title != ''">
15388
+ <xsl:attribute name="fox:title">
15389
+ <xsl:if test="ancestor::mn:sections">
15390
+ <xsl:text>Section </xsl:text>
15391
+ </xsl:if>
15392
+ <xsl:value-of select="$title"/></xsl:attribute>
15393
+ </xsl:if>
15394
+ </xsl:template>
15395
+
15322
15396
  <xsl:template name="replaceChar">
15323
15397
  <xsl:param name="text"/>
15324
15398
  <xsl:param name="replace"/>
@@ -16085,6 +16159,13 @@
16085
16159
  <xsl:with-param name="default" select="$text_align_default"/>
16086
16160
  </xsl:call-template>
16087
16161
  <xsl:call-template name="setKeepAttributes"/>
16162
+ <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
16163
+ <xsl:variable name="styles">
16164
+ <xsl:apply-templates select="*[1]"/>
16165
+ </xsl:variable>
16166
+ <!-- move attribute line-height from inline to block -->
16167
+ <xsl:attribute name="line-height"><xsl:value-of select="xalan:nodeset($styles)//*/@line-height"/></xsl:attribute>
16168
+ </xsl:if>
16088
16169
  </xsl:template>
16089
16170
 
16090
16171
  <xsl:template name="setKeepAttributes">
@@ -16110,34 +16191,41 @@
16110
16191
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
16111
16192
  <fo:block>
16112
16193
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image[$num]">
16113
- <xsl:choose>
16114
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
16115
- <fo:instream-foreign-object fox:alt-text="Image Front">
16116
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
16117
- <xsl:call-template name="getSVG"/>
16118
- </fo:instream-foreign-object>
16119
- </xsl:when>
16120
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
16121
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
16122
- </xsl:when>
16123
- <xsl:otherwise> <!-- bitmap image -->
16124
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
16125
- <xsl:if test="$coverimage_src != ''">
16126
- <xsl:variable name="coverpage">
16127
- <xsl:call-template name="getImageURL">
16128
- <xsl:with-param name="src" select="$coverimage_src"/>
16129
- </xsl:call-template>
16130
- </xsl:variable>
16131
- <!-- <xsl:variable name="coverpage" select="concat('url(file:',$basepath, 'coverpage1.png', ')')"/> --> <!-- for DEBUG -->
16132
- <fo:external-graphic src="{$coverpage}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
16133
- </xsl:if>
16134
- </xsl:otherwise>
16135
- </xsl:choose>
16194
+
16195
+ <xsl:call-template name="insertPageImage"/>
16196
+
16136
16197
  </xsl:for-each>
16137
16198
  </fo:block>
16138
16199
  </fo:block-container>
16139
16200
  </xsl:template>
16140
16201
 
16202
+ <xsl:template name="insertPageImage">
16203
+ <xsl:param name="svg_content_height" select="$pageHeight"/>
16204
+ <xsl:param name="bitmap_width" select="$pageWidth"/>
16205
+ <xsl:choose>
16206
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
16207
+ <fo:instream-foreign-object fox:alt-text="Image Front">
16208
+ <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
16209
+ <xsl:call-template name="getSVG"/>
16210
+ </fo:instream-foreign-object>
16211
+ </xsl:when>
16212
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
16213
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
16214
+ </xsl:when>
16215
+ <xsl:otherwise> <!-- bitmap image -->
16216
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
16217
+ <xsl:if test="$coverimage_src != ''">
16218
+ <xsl:variable name="coverpage">
16219
+ <xsl:call-template name="getImageURL">
16220
+ <xsl:with-param name="src" select="$coverimage_src"/>
16221
+ </xsl:call-template>
16222
+ </xsl:variable>
16223
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
16224
+ </xsl:if>
16225
+ </xsl:otherwise>
16226
+ </xsl:choose>
16227
+ </xsl:template>
16228
+
16141
16229
  <xsl:template name="getImageURL">
16142
16230
  <xsl:param name="src"/>
16143
16231
  <xsl:choose>
@@ -16565,6 +16653,14 @@
16565
16653
  </xsl:attribute>
16566
16654
  </xsl:template>
16567
16655
 
16656
+ <xsl:template name="getCharByCodePoint">
16657
+ <xsl:param name="codepoint"/>
16658
+ <xsl:param name="radix">16</xsl:param>
16659
+ <xsl:variable name="codepointInt" select="java:java.lang.Integer.parseInt($codepoint,$radix)"/>
16660
+ <xsl:variable name="chars" select="java:java.lang.Character.toChars($codepointInt)"/>
16661
+ <xsl:value-of select="java:java.lang.String.new($chars)"/>
16662
+ </xsl:template>
16663
+
16568
16664
  <xsl:template name="substring-after-last">
16569
16665
  <xsl:param name="value"/>
16570
16666
  <xsl:param name="delimiter"/>
@@ -61,25 +61,26 @@ module IsoDoc
61
61
  nil
62
62
  end
63
63
 
64
+ COMMITTEE_XPATH = "//bibdata/contributor[role/description = 'committee']/" \
65
+ "organization/subdivision".freeze
66
+
64
67
  def author(xml, _out)
65
- sector = xml.at(ns("//bibdata/ext/editorialgroup/sector"))
68
+ sector = xml.at(ns("#{COMMITTEE_XPATH}[@type='Sector']/name"))
66
69
  set(:sector, sector.text) if sector
67
70
  bureau(xml)
68
- tc = xml.at(ns("//bibdata/ext/editorialgroup/committee"))
69
- set(:tc, tc.text) if tc
70
- tc = xml.at(ns("//bibdata/ext/editorialgroup/group/name"))
71
+ tc = xml.at(ns("#{COMMITTEE_XPATH}[@type='Group']/name"))
71
72
  set(:group, tc.text) if tc
72
- tc = xml.at(ns("//bibdata/ext/editorialgroup/group/acronym"))
73
+ tc = xml.at(ns("#{COMMITTEE_XPATH}[@type='Group']/identifier"))
73
74
  set(:group_acronym, tc.text) if tc
74
- start1 = xml.at(ns("//bibdata/ext/editorialgroup/group/period/start"))
75
- end1 = xml.at(ns("//bibdata/ext/editorialgroup/group/period/end"))
75
+ start1 = xml.at(ns("//bibdata/ext/studyperiod/start"))
76
+ end1 = xml.at(ns("//bibdata/ext/studyperiod/end"))
76
77
  if start1
77
78
  set(:study_group_period,
78
79
  @i18n.l10n("#{start1.text}–#{end1.text}"))
79
80
  end
80
- tc = xml.at(ns("//bibdata/ext/editorialgroup/subgroup/name"))
81
+ tc = xml.at(ns("#{COMMITTEE_XPATH}[@type='Subgroup']/name"))
81
82
  set(:subgroup, tc.text) if tc
82
- tc = xml.at(ns("//bibdata/ext/editorialgroup/workgroup/name"))
83
+ tc = xml.at(ns("#{COMMITTEE_XPATH}[@type='Workgroup']/name"))
83
84
  set(:workgroup, tc.text) if tc
84
85
  super
85
86
  authors = xml.xpath(ns("//bibdata/contributor[role/@type = 'author' " \
@@ -88,7 +89,7 @@ module IsoDoc
88
89
  end
89
90
 
90
91
  def bureau(xml)
91
- if bureau = xml.at(ns("//bibdata/ext/editorialgroup/bureau"))
92
+ if bureau = xml.at(ns("#{COMMITTEE_XPATH}[@type='Bureau']/name"))
92
93
  set(:bureau, bureau.text)
93
94
  case bureau.text
94
95
  when "T" then set(:bureau_full, @i18n.tsb_full)
@@ -136,10 +137,6 @@ module IsoDoc
136
137
  @i18n.l10n("#{@labels['corrigendum']} #{dn.text}"))
137
138
  end
138
139
 
139
- def unpublished(status)
140
- %w(in-force-prepublished draft).include? status.downcase
141
- end
142
-
143
140
  def bibdate(xml, _out)
144
141
  d = xml.at(ns("//bibdata/date[not(@format)][@type = 'published']"))
145
142
  d and set(:pubdate_monthyear, monthyr(d.text))
@@ -1291,13 +1291,13 @@ Restricted recursively to contain only other such inline elements with no identi
1291
1291
  <ref name="pure_strike"/>
1292
1292
  <ref name="pure_smallcap"/>
1293
1293
  <ref name="br"/>
1294
+ <ref name="stem"/>
1294
1295
  </choice>
1295
1296
  </define>
1296
1297
  <define name="NestedTextElement">
1297
1298
  <a:documentation>Contents of TextElement tags: leaves out tags that should occur only at top level of block: bookmark image hr pagebreak</a:documentation>
1298
1299
  <choice>
1299
1300
  <ref name="PureTextElement"/>
1300
- <ref name="stem"/>
1301
1301
  <ref name="eref"/>
1302
1302
  <ref name="xref"/>
1303
1303
  <ref name="hyperlink"/>
@@ -76,12 +76,6 @@ from other documents in the same doctype</a:documentation>
76
76
  <ref name="flavor">
77
77
  <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
78
78
  </ref>
79
- <optional>
80
- <ref name="editorialgroup">
81
- <a:documentation>Groups associated with the production of the standards document, typically within
82
- a standards definition organization</a:documentation>
83
- </ref>
84
- </optional>
85
79
  <zeroOrMore>
86
80
  <ref name="ics">
87
81
  <a:documentation>Classification of the document contents taken from the International Classification of Standards</a:documentation>
@@ -130,49 +124,6 @@ a standards definition organization</a:documentation>
130
124
  However we prefer not to hardcode it, given ongoing extension.</a:documentation>
131
125
  <text/>
132
126
  </define>
133
- <define name="editorialgroup">
134
- <a:documentation>A group associated with the production of the standards document, typically within
135
- a standards definition organization</a:documentation>
136
- <element name="editorialgroup">
137
- <oneOrMore>
138
- <ref name="technical-committee">
139
- <a:documentation>A technical committee associated with the production of the standards document</a:documentation>
140
- </ref>
141
- </oneOrMore>
142
- </element>
143
- </define>
144
- <define name="technical-committee">
145
- <a:documentation>Technical committee associated with the production of a standards document</a:documentation>
146
- <element name="technical-committee">
147
- <ref name="IsoWorkgroup"/>
148
- </element>
149
- </define>
150
- <define name="IsoWorkgroup">
151
- <optional>
152
- <attribute name="number">
153
- <a:documentation>Numeric identifier of the technical committee</a:documentation>
154
- </attribute>
155
- </optional>
156
- <optional>
157
- <attribute name="type">
158
- <a:documentation>Type of the technical committee, used in identifying the technical committee</a:documentation>
159
- </attribute>
160
- </optional>
161
- <optional>
162
- <attribute name="identifier">
163
- <a:documentation>Non-numeric, complete identifier of the technical committee</a:documentation>
164
- </attribute>
165
- </optional>
166
- <optional>
167
- <attribute name="prefix">
168
- <a:documentation>Disambiguating prefix added to number to form the identifier of the technical committee,
169
- typically indicating its type</a:documentation>
170
- </attribute>
171
- </optional>
172
- <text>
173
- <a:documentation>Name of the technical committee</a:documentation>
174
- </text>
175
- </define>
176
127
  <define name="ics">
177
128
  <a:documentation>Classification taken from the International Classification of Standards.
178
129
  ICS is defined by ISO here -- https://www.iso.org/publication/PUB100033.html</a:documentation>
@@ -242,6 +242,8 @@ Detailed in https://www.relaton.org/model/creator/</a:documentation>
242
242
  </choice>
243
243
  </define>
244
244
  <define name="roledescription">
245
+ <a:documentation>A more detailed description of the role of the contributor
246
+ Some descriptions are reserved words; in particular, the editorial committee of a standard has the role description "committee"</a:documentation>
245
247
  <element name="description">
246
248
  <ref name="LocalizedMarkedUpString"/>
247
249
  </element>
@@ -443,7 +445,10 @@ real names (if the person is named with a pseudonym or user name); previous lega
443
445
  </oneOrMore>
444
446
  <zeroOrMore>
445
447
  <ref name="subdivision">
446
- <a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item</a:documentation>
448
+ <a:documentation>The subdivision of the organization directly involved with the production of the bibliographic item.
449
+ Multiple subdivisions can be specified for an organization, with no implication of hierarchical
450
+ relation between them
451
+ Editorial and advisory groups are represented as consecutive subdivisions of the SDO</a:documentation>
447
452
  </ref>
448
453
  </zeroOrMore>
449
454
  <optional>
@@ -485,6 +490,11 @@ real names (if the person is named with a pseudonym or user name); previous lega
485
490
  <a:documentation>The type of subdivision</a:documentation>
486
491
  </attribute>
487
492
  </optional>
493
+ <optional>
494
+ <attribute name="subtype">
495
+ <a:documentation>The subtype of subdivision; e.g. different types of technical committee</a:documentation>
496
+ </attribute>
497
+ </optional>
488
498
  <ref name="OrganizationType">
489
499
  <a:documentation>The subdivision, modelled recursively as an organization</a:documentation>
490
500
  </ref>
@@ -82,6 +82,10 @@ module Metanorma
82
82
  biblio_reorder1(r)
83
83
  end
84
84
  end
85
+
86
+ def published?(status, _xmldoc)
87
+ !%w(in-force-prepublished draft).include?(status.downcase)
88
+ end
85
89
  end
86
90
  end
87
91
  end
@@ -1,5 +1,6 @@
1
1
  require "fileutils"
2
2
  require_relative "./front_id"
3
+ require_relative "./front_contrib"
3
4
 
4
5
  module Metanorma
5
6
  module Itu
@@ -64,44 +65,6 @@ module Metanorma
64
65
  end
65
66
  end
66
67
 
67
- def default_publisher
68
- @i18n.get["ITU"] || @i18n.international_telecommunication_union
69
- end
70
-
71
- def org_abbrev
72
- if @i18n.get["ITU"]
73
- { @i18n.international_telecommunication_union => @i18n.get["ITU"] }
74
- else {} end
75
- end
76
-
77
- def metadata_committee(node, xml)
78
- hyphenate_node_attributes(node)
79
- metadata_sector(node, xml)
80
- metadata_committee1(node, xml, "")
81
- suffix = 2
82
- while node.attr("bureau_#{suffix}")
83
- metadata_committee1(node, xml, "_#{suffix}")
84
- suffix += 1
85
- end
86
- end
87
-
88
- def hyphenate_node_attributes(node)
89
- a = node.attributes.dup
90
- a.each do |k, v|
91
- /group(type|acronym)/.match?(k) and
92
- node.set_attr(k.sub(/group(type|acronym)/, "group-\\1"), v)
93
- /group(yearstart|yearend)/.match?(k) and
94
- node.set_attr(k.sub(/groupyear(start|end)/, "group-year-\\1"), v)
95
- end
96
- end
97
-
98
- def metadata_sector(node, xml)
99
- s = node.attr("sector") or return
100
- xml.editorialgroup do |a|
101
- a.sector { |x| x << s }
102
- end
103
- end
104
-
105
68
  def metadata_question(node, xml)
106
69
  vals = csv_split(node.attr("question"), ",").map do |s1|
107
70
  t, v = s1.split(":", 2).map(&:strip)
@@ -115,29 +78,6 @@ module Metanorma
115
78
  end
116
79
  end
117
80
 
118
- def metadata_committee1(node, xml, suffix)
119
- xml.editorialgroup do |a|
120
- a.bureau ( node.attr("bureau#{suffix}") || "T")
121
- ["", "sub", "work"].each do |p|
122
- node.attr("#{p}group#{suffix}") or next
123
- type = node.attr("#{p}group-type#{suffix}")
124
- a.send "#{p}group", **attr_code(type: type) do |g|
125
- metadata_committee2(node, g, suffix, p)
126
- end
127
- end
128
- end
129
- end
130
-
131
- def metadata_committee2(node, group, suffix, prefix)
132
- group.name node.attr("#{prefix}group#{suffix}")
133
- a = node.attr("#{prefix}group-acronym#{suffix}") and group.acronym a
134
- s, e = group_period(node, prefix, suffix)
135
- group.period do |p|
136
- p.start s
137
- p.end e
138
- end
139
- end
140
-
141
81
  def group_period(node, prefix, suffix)
142
82
  s = node.attr("#{prefix}group-year-start#{suffix}") ||
143
83
  Date.today.year - (Date.today.year % 2)
@@ -213,11 +153,20 @@ module Metanorma
213
153
  end
214
154
  end
215
155
 
156
+ def metadata_studyperiod(node, xml)
157
+ s, e = group_period(node, "", "")
158
+ xml.studyperiod do |p|
159
+ p.start s
160
+ p.end e
161
+ end
162
+ end
163
+
216
164
  def metadata_ext(node, xml)
217
165
  super
218
166
  metadata_question(node, xml)
219
167
  metadata_recommendationstatus(node, xml)
220
168
  metadata_ip_notice(node, xml)
169
+ metadata_studyperiod(node, xml)
221
170
  metadata_techreport(node, xml)
222
171
  metadata_contribution(node, xml)
223
172
  end