metanorma-bipm 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.
@@ -80,7 +80,13 @@
80
80
  </xsl:call-template>
81
81
  </xsl:variable>
82
82
 
83
- <xsl:variable name="copyrightText" select="concat('© ', (//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym, ' ', (//mn:metanorma)[1]/mn:bibdata/mn:copyright/mn:from, ' — ', $all_rights_reserved)"/>
83
+ <xsl:variable name="committee_acronym" select="(//mn:metanorma)[1]/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description = 'committee']/mn:organization/mn:subdivision[@type = 'Committee']/mn:identifier[not(@full)]"/>
84
+
85
+ <xsl:variable name="copyright_year" select="(//mn:metanorma)[1]/mn:bibdata/mn:copyright/mn:from"/>
86
+ <!-- <xsl:variable name="copyrightText" select="concat('© ', (//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym, ' ', (//mn:metanorma)[1]/mn:bibdata/mn:copyright/mn:from, ' — ', $all_rights_reserved)"/> -->
87
+ <xsl:variable name="copyrightText" select="concat('© ', $committee_acronym, ' ', $copyright_year, ' — ', $all_rights_reserved)"/>
88
+
89
+ <xsl:variable name="docnumber" select="(//mn:metanorma)[1]/mn:bibdata/mn:docnumber"/>
84
90
 
85
91
  <!-- Example:
86
92
  <item level="1" id="Foreword" display="true">Foreword</item>
@@ -375,9 +381,10 @@
375
381
  <!-- Example © JCGM 2009 -->
376
382
  <fo:block font-size="11pt">
377
383
  <fo:inline font-family="Times New Roman" font-size="12pt"><xsl:text>© </xsl:text></fo:inline>
378
- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/>
384
+ <!-- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/> -->
385
+ <xsl:value-of select="$committee_acronym"/>
379
386
  <xsl:text> </xsl:text>
380
- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:copyright/mn:from"/>
387
+ <xsl:value-of select="$copyright_year"/>
381
388
  </fo:block>
382
389
  </fo:static-content>
383
390
  <fo:flow flow-name="xsl-region-body">
@@ -385,11 +392,12 @@
385
392
  <xsl:call-template name="insertDraftWatermark"/>
386
393
  <fo:block-container font-weight="bold">
387
394
  <fo:block font-size="16.5pt">
388
- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/>
395
+ <!-- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/> -->
396
+ <xsl:value-of select="$committee_acronym"/>
389
397
  <xsl:text> </xsl:text>
390
- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:docnumber"/>
398
+ <xsl:value-of select="$docnumber"/>
391
399
  <fo:inline font-weight="normal">:</fo:inline>
392
- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:copyright/mn:from"/>
400
+ <xsl:value-of select="$copyright_year"/>
393
401
  </fo:block>
394
402
  <fo:block font-size="13pt" font-weight="normal" space-after="19.5mm">
395
403
  <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:title[@type = 'title-provenance']"/>
@@ -435,12 +443,14 @@
435
443
  <fo:table-body>
436
444
  <fo:table-row>
437
445
  <fo:table-cell>
438
- <fo:block><xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee"/></fo:block>
446
+ <!-- <fo:block><xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee"/></fo:block> -->
447
+ <fo:block><xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:contributor[mn:role[@type = 'author']/mn:description = 'committee']/mn:organization/mn:subdivision[@type = 'Committee']/mn:name"/></fo:block>
439
448
  </fo:table-cell>
440
449
  <fo:table-cell line-height="140%">
441
- <fo:block><xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/></fo:block>
442
- <fo:block><xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:docnumber"/></fo:block>
443
- <fo:block><xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:copyright/mn:from"/></fo:block>
450
+ <!-- <fo:block><xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/></fo:block> -->
451
+ <fo:block><xsl:value-of select="$committee_acronym"/></fo:block>
452
+ <fo:block><xsl:value-of select="$docnumber"/></fo:block>
453
+ <fo:block><xsl:value-of select="$copyright_year"/></fo:block>
444
454
  </fo:table-cell>
445
455
  </fo:table-row>
446
456
  </fo:table-body>
@@ -1006,11 +1016,12 @@
1006
1016
  </xsl:template>
1007
1017
 
1008
1018
  <xsl:variable name="header_text">
1009
- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/>
1019
+ <!-- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:ext/mn:editorialgroup/mn:committee/@acronym"/>-->
1020
+ <xsl:value-of select="$committee_acronym"/>
1010
1021
  <xsl:text> </xsl:text>
1011
- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:docnumber"/>
1022
+ <xsl:value-of select="$docnumber"/>
1012
1023
  <xsl:text>:</xsl:text>
1013
- <xsl:value-of select="(//mn:metanorma)[1]/mn:bibdata/mn:copyright/mn:from"/>
1024
+ <xsl:value-of select="$copyright_year"/>
1014
1025
  </xsl:variable>
1015
1026
 
1016
1027
  <xsl:template name="insertHeaderFooter">
@@ -1070,7 +1081,10 @@
1070
1081
 
1071
1082
  <xsl:template name="insertDraftWatermark">
1072
1083
  <xsl:param name="isDraft"/>
1073
- <xsl:if test="$isDraft = 'true' or normalize-space(//mn:metanorma/mn:bibdata/mn:version/mn:draft or contains(//mn:metanorma/mn:bibdata/mn:status/mn:stage, 'draft') or contains(//mn:metanorma/mn:bibdata/mn:status/mn:stage, 'projet')) = 'true'">
1084
+ <!-- <xsl:if test="$isDraft = 'true' or normalize-space(//mn:metanorma/mn:bibdata/mn:version/mn:draft or
1085
+ contains(//mn:metanorma/mn:bibdata/mn:status/mn:stage, 'draft') or
1086
+ contains(//mn:metanorma/mn:bibdata/mn:status/mn:stage, 'projet')) = 'true'"> -->
1087
+ <xsl:if test="$isDraft = 'true' or normalize-space(normalize-space(//mn:metanorma/mn:bibdata/mn:version/mn:draft) != '' or normalize-space(//mn:metanorma/mn:metanorma-extension/mn:semantic-metadata/mn:stage-published) = 'false') = 'true'">
1074
1088
  <!-- DRAFT -->
1075
1089
  <xsl:variable name="draft_label">
1076
1090
  <xsl:call-template name="getLocalizedString">
@@ -1227,10 +1241,10 @@
1227
1241
 
1228
1242
  <fo:flow flow-name="xsl-region-body">
1229
1243
  <fo:block id="{@id}" span="all">
1230
- <xsl:apply-templates select="mn:title"/>
1244
+ <xsl:apply-templates select="mn:fmt-title"/>
1231
1245
  </fo:block>
1232
1246
  <fo:block role="Index">
1233
- <xsl:apply-templates select="*[not(self::mn:title)]"/>
1247
+ <xsl:apply-templates select="*[not(self::mn:title or self::mn:fmt-title)]"/>
1234
1248
  </fo:block>
1235
1249
  </fo:flow>
1236
1250
  </fo:page-sequence>
@@ -3499,13 +3513,23 @@
3499
3513
  <xsl:attribute-set name="copyright-statement-style">
3500
3514
  </xsl:attribute-set> <!-- copyright-statement-style -->
3501
3515
 
3516
+ <xsl:template name="refine_copyright-statement-style">
3517
+ </xsl:template>
3518
+
3502
3519
  <xsl:attribute-set name="copyright-statement-title-style">
3503
3520
  </xsl:attribute-set> <!-- copyright-statement-title-style -->
3504
3521
 
3522
+ <xsl:template name="refine_copyright-statement-title-style">
3523
+ </xsl:template>
3524
+
3505
3525
  <xsl:attribute-set name="copyright-statement-p-style">
3506
3526
  </xsl:attribute-set> <!-- copyright-statement-p-style -->
3507
3527
 
3508
- <xsl:attribute-set name="license-statement-style">
3528
+ <xsl:template name="refine_copyright-statement-p-style">
3529
+
3530
+ </xsl:template>
3531
+
3532
+ <xsl:attribute-set name="license-statement-style">
3509
3533
  </xsl:attribute-set> <!-- license-statement-style -->
3510
3534
 
3511
3535
  <xsl:attribute-set name="license-statement-title-style">
@@ -3515,6 +3539,10 @@
3515
3539
  <xsl:attribute-set name="license-statement-p-style">
3516
3540
  </xsl:attribute-set> <!-- license-statement-p-style -->
3517
3541
 
3542
+ <xsl:template name="refine_license-statement-p-style">
3543
+
3544
+ </xsl:template>
3545
+
3518
3546
  <xsl:attribute-set name="legal-statement-style">
3519
3547
  </xsl:attribute-set> <!-- legal-statement-style -->
3520
3548
 
@@ -3542,6 +3570,8 @@
3542
3570
  <!-- ================================= -->
3543
3571
  <xsl:template match="mn:copyright-statement">
3544
3572
  <fo:block xsl:use-attribute-sets="copyright-statement-style" role="SKIP">
3573
+ <xsl:call-template name="refine_copyright-statement-style"/>
3574
+
3545
3575
  <xsl:apply-templates/>
3546
3576
  </fo:block>
3547
3577
  </xsl:template> <!-- copyright-statement -->
@@ -4637,7 +4667,7 @@
4637
4667
  </xsl:otherwise>
4638
4668
  </xsl:choose>
4639
4669
  </xsl:variable>
4640
- <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift'">
4670
+ <xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color' or $key = 'baseline-shift' or $key = 'line-height' ">
4641
4671
  <style name="{$key}"><xsl:value-of select="$value"/></style>
4642
4672
  </xsl:if>
4643
4673
  <xsl:if test="$key = 'text-indent'">
@@ -11492,7 +11522,7 @@
11492
11522
 
11493
11523
  <xsl:template name="insertFootnoteSeparatorCommon">
11494
11524
  <xsl:param name="leader_length">30%</xsl:param>
11495
- <fo:static-content flow-name="xsl-footnote-separator">
11525
+ <fo:static-content flow-name="xsl-footnote-separator" role="artifact">
11496
11526
  <fo:block>
11497
11527
  <fo:leader leader-pattern="rule" leader-length="{$leader_length}"/>
11498
11528
  </fo:block>
@@ -12267,13 +12297,31 @@
12267
12297
  <!-- skip here, see the template 'fmt-review-start' -->
12268
12298
  </xsl:when>
12269
12299
  <xsl:otherwise>
12270
- <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
12271
- <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>
12272
- <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
12273
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
12300
+ <xsl:choose>
12301
+ <xsl:when test="parent::mn:example or parent::mn:termexample or parent::mn:note or parent::mn:termnote">
12302
+ <fo:block font-size="1pt" line-height="0.1">
12303
+ <xsl:call-template name="fo_inline_bookmark">
12304
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
12305
+ </xsl:call-template>
12306
+ </fo:block>
12307
+ </xsl:when>
12308
+ <xsl:otherwise>
12309
+ <xsl:call-template name="fo_inline_bookmark">
12310
+ <xsl:with-param name="bookmark_id" select="$bookmark_id"/>
12311
+ </xsl:call-template>
12312
+ </xsl:otherwise>
12313
+ </xsl:choose>
12274
12314
  </xsl:otherwise>
12275
12315
  </xsl:choose>
12276
12316
  </xsl:template>
12317
+
12318
+ <xsl:template name="fo_inline_bookmark">
12319
+ <xsl:param name="bookmark_id"/>
12320
+ <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
12321
+ <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>
12322
+ <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
12323
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
12324
+ </xsl:template>
12277
12325
  <!-- =================== -->
12278
12326
  <!-- End of Index processing -->
12279
12327
  <!-- =================== -->
@@ -12379,9 +12427,15 @@
12379
12427
  <xsl:attribute name="role">H1</xsl:attribute>
12380
12428
  </xsl:attribute-set>
12381
12429
 
12430
+ <xsl:template name="refine_toc-title-style">
12431
+ </xsl:template>
12432
+
12382
12433
  <xsl:attribute-set name="toc-title-page-style">
12383
12434
  </xsl:attribute-set> <!-- toc-title-page-style -->
12384
12435
 
12436
+ <xsl:template name="refine_toc-title-page-style">
12437
+ </xsl:template>
12438
+
12385
12439
  <xsl:attribute-set name="toc-item-block-style">
12386
12440
  </xsl:attribute-set>
12387
12441
 
@@ -12410,6 +12464,9 @@
12410
12464
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
12411
12465
  </xsl:attribute-set>
12412
12466
 
12467
+ <xsl:template name="refine_toc-listof-title-style">
12468
+ </xsl:template>
12469
+
12413
12470
  <xsl:attribute-set name="toc-listof-item-block-style">
12414
12471
  </xsl:attribute-set>
12415
12472
 
@@ -12756,7 +12813,7 @@
12756
12813
  </xsl:if>
12757
12814
 
12758
12815
  <xsl:for-each select="$contents_nodes/mnx:doc">
12759
- <fo:bookmark internal-destination="{contents/mnx:item[@display = 'true'][1]/@id}" starting-state="hide">
12816
+ <fo:bookmark internal-destination="{mnx:contents/mnx:item[@display = 'true'][1]/@id}" starting-state="hide">
12760
12817
  <xsl:if test="@bundle = 'true'">
12761
12818
  <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
12762
12819
  </xsl:if>
@@ -12790,7 +12847,7 @@
12790
12847
  </xsl:choose>
12791
12848
  </fo:bookmark-title>
12792
12849
 
12793
- <xsl:apply-templates select="contents/mnx:item" mode="bookmark"/>
12850
+ <xsl:apply-templates select="mnx:contents/mnx:item" mode="bookmark"/>
12794
12851
 
12795
12852
  <xsl:call-template name="insertFigureBookmarks">
12796
12853
  <xsl:with-param name="contents" select="mnx:contents"/>
@@ -14144,11 +14201,35 @@
14144
14201
 
14145
14202
  <xsl:template match="mn:svgmap"/>
14146
14203
 
14204
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
14205
+
14147
14206
  <!-- for correct rendering combining chars, added in mode="update_xml_step2" -->
14148
14207
  <xsl:template match="*[local-name() = 'lang_none']">
14149
14208
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
14150
14209
  </xsl:template>
14151
14210
 
14211
+ <xsl:template name="addTagElementT">
14212
+ <xsl:variable name="title_">
14213
+ <xsl:apply-templates select="mn:fmt-title"/>
14214
+ </xsl:variable>
14215
+ <xsl:variable name="title__">
14216
+ <xsl:for-each select="xalan:nodeset($title_)/*/node()">
14217
+ <xsl:choose>
14218
+ <xsl:when test="self::text()"><xsl:text> </xsl:text><xsl:value-of select="."/><xsl:text> </xsl:text></xsl:when>
14219
+ <xsl:otherwise><xsl:text> </xsl:text><xsl:copy-of select="."/><xsl:text> </xsl:text></xsl:otherwise>
14220
+ </xsl:choose>
14221
+ </xsl:for-each>
14222
+ </xsl:variable>
14223
+ <xsl:variable name="title" select="normalize-space($title__)"/>
14224
+ <xsl:if test="$title != ''">
14225
+ <xsl:attribute name="fox:title">
14226
+ <xsl:if test="ancestor::mn:sections">
14227
+ <xsl:text>Section </xsl:text>
14228
+ </xsl:if>
14229
+ <xsl:value-of select="$title"/></xsl:attribute>
14230
+ </xsl:if>
14231
+ </xsl:template>
14232
+
14152
14233
  <xsl:template name="replaceChar">
14153
14234
  <xsl:param name="text"/>
14154
14235
  <xsl:param name="replace"/>
@@ -14914,6 +14995,13 @@
14914
14995
  <xsl:with-param name="default" select="$text_align_default"/>
14915
14996
  </xsl:call-template>
14916
14997
  <xsl:call-template name="setKeepAttributes"/>
14998
+ <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
14999
+ <xsl:variable name="styles">
15000
+ <xsl:apply-templates select="*[1]"/>
15001
+ </xsl:variable>
15002
+ <!-- move attribute line-height from inline to block -->
15003
+ <xsl:attribute name="line-height"><xsl:value-of select="xalan:nodeset($styles)//*/@line-height"/></xsl:attribute>
15004
+ </xsl:if>
14917
15005
  </xsl:template>
14918
15006
 
14919
15007
  <xsl:template name="setKeepAttributes">
@@ -14939,34 +15027,41 @@
14939
15027
  <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
14940
15028
  <fo:block>
14941
15029
  <xsl:for-each select="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image[$num]">
14942
- <xsl:choose>
14943
- <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
14944
- <fo:instream-foreign-object fox:alt-text="Image Front">
14945
- <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
14946
- <xsl:call-template name="getSVG"/>
14947
- </fo:instream-foreign-object>
14948
- </xsl:when>
14949
- <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
14950
- <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
14951
- </xsl:when>
14952
- <xsl:otherwise> <!-- bitmap image -->
14953
- <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
14954
- <xsl:if test="$coverimage_src != ''">
14955
- <xsl:variable name="coverpage">
14956
- <xsl:call-template name="getImageURL">
14957
- <xsl:with-param name="src" select="$coverimage_src"/>
14958
- </xsl:call-template>
14959
- </xsl:variable>
14960
- <!-- <xsl:variable name="coverpage" select="concat('url(file:',$basepath, 'coverpage1.png', ')')"/> --> <!-- for DEBUG -->
14961
- <fo:external-graphic src="{$coverpage}" width="{$pageWidth}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
14962
- </xsl:if>
14963
- </xsl:otherwise>
14964
- </xsl:choose>
15030
+
15031
+ <xsl:call-template name="insertPageImage"/>
15032
+
14965
15033
  </xsl:for-each>
14966
15034
  </fo:block>
14967
15035
  </fo:block-container>
14968
15036
  </xsl:template>
14969
15037
 
15038
+ <xsl:template name="insertPageImage">
15039
+ <xsl:param name="svg_content_height" select="$pageHeight"/>
15040
+ <xsl:param name="bitmap_width" select="$pageWidth"/>
15041
+ <xsl:choose>
15042
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
15043
+ <fo:instream-foreign-object fox:alt-text="Image Front">
15044
+ <xsl:attribute name="content-height"><xsl:value-of select="$svg_content_height"/>mm</xsl:attribute>
15045
+ <xsl:call-template name="getSVG"/>
15046
+ </fo:instream-foreign-object>
15047
+ </xsl:when>
15048
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
15049
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
15050
+ </xsl:when>
15051
+ <xsl:otherwise> <!-- bitmap image -->
15052
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
15053
+ <xsl:if test="$coverimage_src != ''">
15054
+ <xsl:variable name="coverpage">
15055
+ <xsl:call-template name="getImageURL">
15056
+ <xsl:with-param name="src" select="$coverimage_src"/>
15057
+ </xsl:call-template>
15058
+ </xsl:variable>
15059
+ <fo:external-graphic src="{$coverpage}" width="{$bitmap_width}mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
15060
+ </xsl:if>
15061
+ </xsl:otherwise>
15062
+ </xsl:choose>
15063
+ </xsl:template>
15064
+
14970
15065
  <xsl:template name="getImageURL">
14971
15066
  <xsl:param name="src"/>
14972
15067
  <xsl:choose>
@@ -15394,6 +15489,14 @@
15394
15489
  </xsl:attribute>
15395
15490
  </xsl:template>
15396
15491
 
15492
+ <xsl:template name="getCharByCodePoint">
15493
+ <xsl:param name="codepoint"/>
15494
+ <xsl:param name="radix">16</xsl:param>
15495
+ <xsl:variable name="codepointInt" select="java:java.lang.Integer.parseInt($codepoint,$radix)"/>
15496
+ <xsl:variable name="chars" select="java:java.lang.Character.toChars($codepointInt)"/>
15497
+ <xsl:value-of select="java:java.lang.String.new($chars)"/>
15498
+ </xsl:template>
15499
+
15397
15500
  <xsl:template name="substring-after-last">
15398
15501
  <xsl:param name="value"/>
15399
15502
  <xsl:param name="delimiter"/>
@@ -46,19 +46,22 @@ module IsoDoc
46
46
  end.join(" ")
47
47
  end
48
48
 
49
- def docid(isoxml, _out)
49
+ COMMITEE_XPATH = <<~XPATH.freeze
50
+ //bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Committee']
51
+ XPATH
52
+
53
+ def docid(xml, _out)
50
54
  super
51
- docid_part(isoxml, [@i18n.get["level2_ancillary"],
52
- @i18n.get["level2_ancillary_alt"]], "appendix", :appendixid)
53
- docid_part(isoxml, [@i18n.get["level3_ancillary"],
54
- @i18n.get["level3_ancillary_alt"]], "annexid", :annexid)
55
- docid_part(isoxml, [@i18n.get["level4_ancillary"],
56
- @i18n.get["level4_ancillary_alt"]], "part", :partid)
57
- docid_part(isoxml, [@i18n.get["level5_ancillary"],
58
- @i18n.get["level5_ancillary_alt"]], "subpart", :subpartid)
59
- set(:org_abbrev,
60
- isoxml.at(ns("//bibdata/ext/editorialgroup/committee"\
61
- "[@acronym = 'JCGM']")) ? "JCGM" : "BIPM")
55
+ [{ label: "level2", elem: "appendix", key: :appendixid },
56
+ { label: "level3", elem: "annexid", key: :annexid },
57
+ { label: "level4", elem: "part", key: :partid },
58
+ { label: "level5", elem: "subpart", key: :subpartid }].each do |m|
59
+ docid_part(xml, [@i18n.get["#{m[:label]}_ancillary"],
60
+ @i18n.get["#{m[:label]}_ancillary_alt"]], m[:elem],
61
+ m[:key])
62
+ end
63
+ c = xml.at(ns("#{COMMITEE_XPATH}/identifier[not(@type = 'full')][text() = 'JCGM']"))
64
+ set(:org_abbrev, c ? "JCGM" : "BIPM")
62
65
  end
63
66
 
64
67
  def docid_part(isoxml, labels, elem, key)
@@ -81,6 +84,7 @@ module IsoDoc
81
84
  def author(xml, _out)
82
85
  super
83
86
  authorizer(xml)
87
+ committee(xml)
84
88
  end
85
89
 
86
90
  def authorizer(xml)
@@ -93,6 +97,13 @@ module IsoDoc
93
97
  end
94
98
  ret.empty? or set(:authorizer, ret)
95
99
  end
100
+
101
+ def committee(xml)
102
+ t = xml.at(ns(COMMITEE_XPATH)) or return
103
+ n = t.at(ns("./name[@language = '#{@lang}']")) ||
104
+ t.at(ns("./name[not(@language)]"))
105
+ n and set(:tc, n.text)
106
+ end
96
107
  end
97
108
  end
98
109
  end
@@ -12,8 +12,9 @@ module IsoDoc
12
12
  module Bipm
13
13
  class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
14
14
  def convert1(docxml, filename, dir)
15
- @jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/" \
16
- "@acronym"))&.value == "JCGM"
15
+ @jcgm = docxml.at(ns(<<~XPATH))&.text == "JCGM"
16
+ //bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Committee']/identifier[not(@type = 'full')]
17
+ XPATH
17
18
  @xrefs.klass.jcgm = @jcgm
18
19
  @jcgm and @iso = iso_processor(docxml)
19
20
  super
@@ -86,10 +87,13 @@ module IsoDoc
86
87
  end
87
88
  end
88
89
 
90
+ BLACKSQUARE =
91
+ '<span style="font-size:130%">&#x25a0;</span>&#xa0;&#xa0;'.freeze
92
+
89
93
  def quoted_title_render(node, elem, variant_title)
90
94
  add_id(variant_title)
91
95
  variant_title.next =
92
- fmt_caption("&#x2580;", elem, variant_title, {}, {})
96
+ fmt_caption(BLACKSQUARE, elem, variant_title, {}, {})
93
97
  if s = variant_title.next.at(ns("./semx[@element='title']"))
94
98
  s["source"] = variant_title["id"]
95
99
  end
@@ -12,8 +12,9 @@ module IsoDoc
12
12
  end
13
13
 
14
14
  def parse(docxml)
15
- @jcgm = docxml.at(ns("//bibdata/ext/editorialgroup/committee/" \
16
- "@acronym"))&.value == "JCGM"
15
+ @jcgm = docxml.at(ns(<<~XPATH))&.text == "JCGM"
16
+ //bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Committee']/identifier[not(@type = 'full')]
17
+ XPATH
17
18
  @annexlbl =
18
19
  if @jcgm then @labels["iso_annex"]
19
20
  elsif docxml.at(ns("//bibdata/ext/structuredidentifier/appendix"))
@@ -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>
@@ -65,10 +65,12 @@ module Metanorma
65
65
 
66
66
  # not language-specific, just space-delimited
67
67
  def bibdata_docidentifier_enhance(id, parts)
68
- ret = %w(appendix annexid part subpart).each_with_object([]) do |w, m|
69
- p = parts[w] and m << p
70
- end
71
- id.children = "#{id.text} #{ret.join(' ')}"
68
+ ret = ""
69
+ p = parts["part"] and ret += "-#{p}"
70
+ p = parts["subpart"] and ret += "-#{p}"
71
+ p = parts["appendix"] and ret += " A#{p}"
72
+ p = parts["annexid"] and ret += ".#{p}"
73
+ id.children = "#{id.text}#{ret}"
72
74
  end
73
75
  end
74
76
  end
@@ -80,12 +80,12 @@ module Metanorma
80
80
  def committee_validate(xml)
81
81
  committees = Array(configuration&.committees) || return
82
82
  committees.empty? and return
83
- xml.xpath("//bibdata/ext/editorialgroup/committee").each do |c|
83
+ xml.xpath("//bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Committee']/name").each do |c|
84
84
  committees.include? c.text or
85
85
  @log.add("Document Attributes", nil,
86
86
  "#{c.text} is not a recognised committee")
87
87
  end
88
- xml.xpath("//bibdata/ext/editorialgroup/committee/@acronym").each do |c|
88
+ xml.xpath("//bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Committee']/identifier[not(@type = 'full')]").each do |c|
89
89
  committees.include? c.text or
90
90
  @log.add("Document Attributes", nil,
91
91
  "#{c.text} is not a recognised committee")