metanorma-bipm 2.5.3 → 2.5.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -5213,7 +5213,8 @@
5213
5213
  </xsl:choose>
5214
5214
  </xsl:variable>
5215
5215
  <xsl:variable name="current_fn_number_text">
5216
- <xsl:value-of select="$current_fn_number"/>
5216
+
5217
+ <xsl:value-of select="$current_fn_number"/>
5217
5218
 
5218
5219
  </xsl:variable>
5219
5220
 
@@ -5231,10 +5232,14 @@
5231
5232
  <xsl:variable name="fn_styles">
5232
5233
  <xsl:choose>
5233
5234
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
5234
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
5235
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
5236
+
5237
+ </fn_styles>
5235
5238
  </xsl:when>
5236
5239
  <xsl:otherwise>
5237
- <fn_styles xsl:use-attribute-sets="fn-num-style"/>
5240
+ <fn_styles xsl:use-attribute-sets="fn-num-style">
5241
+
5242
+ </fn_styles>
5238
5243
  </xsl:otherwise>
5239
5244
  </xsl:choose>
5240
5245
  </xsl:variable>
@@ -5249,8 +5254,10 @@
5249
5254
 
5250
5255
  <xsl:call-template name="insert_basic_link">
5251
5256
  <xsl:with-param name="element">
5252
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
5253
- <xsl:copy-of select="$current_fn_number_text"/>
5257
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}"> <!-- note: role="Lbl" removed in https://github.com/metanorma/mn2pdf/issues/291 -->
5258
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
5259
+ <xsl:copy-of select="$current_fn_number_text"/>
5260
+ </fo:inline>
5254
5261
  </fo:basic-link>
5255
5262
  </xsl:with-param>
5256
5263
  </xsl:call-template>
@@ -5531,7 +5538,7 @@
5531
5538
 
5532
5539
  <xsl:call-template name="refine_fn-reference-style"/>
5533
5540
 
5534
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5541
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5535
5542
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
5536
5543
  <xsl:attribute name="internal-destination">
5537
5544
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -6546,9 +6553,19 @@
6546
6553
  </fo:inline>
6547
6554
  </xsl:template>
6548
6555
 
6549
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
6556
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
6557
+ <xsl:param name="txt"/>
6550
6558
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
6551
- <xsl:variable name="text" select="."/>
6559
+ <xsl:variable name="text">
6560
+ <xsl:choose>
6561
+ <xsl:when test="$txt != ''">
6562
+ <xsl:value-of select="$txt"/>
6563
+ </xsl:when>
6564
+ <xsl:otherwise>
6565
+ <xsl:value-of select="."/>
6566
+ </xsl:otherwise>
6567
+ </xsl:choose>
6568
+ </xsl:variable>
6552
6569
  <xsl:variable name="ratio_">
6553
6570
  0.75
6554
6571
  </xsl:variable>
@@ -8001,9 +8018,12 @@
8001
8018
  <xsl:apply-templates/>
8002
8019
  </xsl:when>
8003
8020
  <xsl:otherwise>
8021
+ <xsl:variable name="alt_text">
8022
+ <xsl:call-template name="getAltText"/>
8023
+ </xsl:variable>
8004
8024
  <xsl:call-template name="insert_basic_link">
8005
8025
  <xsl:with-param name="element">
8006
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
8026
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
8007
8027
  <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8008
8028
  <xsl:attribute name="role">Annot</xsl:attribute>
8009
8029
  </xsl:if>
@@ -8030,6 +8050,14 @@
8030
8050
  </fo:inline>
8031
8051
  </xsl:template> <!-- link -->
8032
8052
 
8053
+ <xsl:template name="getAltText">
8054
+ <xsl:choose>
8055
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
8056
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
8057
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
8058
+ </xsl:choose>
8059
+ </xsl:template>
8060
+
8033
8061
  <!-- ======================== -->
8034
8062
  <!-- Appendix processing -->
8035
8063
  <!-- ======================== -->
@@ -8060,7 +8088,7 @@
8060
8088
  <xsl:template match="*[local-name() = 'callout']">
8061
8089
  <xsl:choose>
8062
8090
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
8063
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
8091
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
8064
8092
  </xsl:choose>
8065
8093
  </xsl:template>
8066
8094
 
@@ -8089,10 +8117,14 @@
8089
8117
  <xsl:template match="*[local-name() = 'xref']">
8090
8118
  <xsl:call-template name="insert_basic_link">
8091
8119
  <xsl:with-param name="element">
8092
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
8120
+ <xsl:variable name="alt_text">
8121
+ <xsl:call-template name="getAltText"/>
8122
+ </xsl:variable>
8123
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
8093
8124
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
8094
8125
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8095
8126
  </xsl:if>
8127
+
8096
8128
  <xsl:if test="parent::*[local-name() = 'add']">
8097
8129
  <xsl:call-template name="append_add-style"/>
8098
8130
  </xsl:if>
@@ -8201,44 +8233,44 @@
8201
8233
 
8202
8234
  <xsl:template match="*[local-name() = 'note']" name="note">
8203
8235
 
8204
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8236
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
8205
8237
 
8206
- <xsl:call-template name="setBlockSpanAll"/>
8238
+ <xsl:call-template name="setBlockSpanAll"/>
8207
8239
 
8208
- <xsl:call-template name="refine_note-style"/>
8240
+ <xsl:call-template name="refine_note-style"/>
8209
8241
 
8210
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8242
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
8211
8243
 
8212
- <fo:block>
8244
+ <fo:block>
8213
8245
 
8214
- <xsl:call-template name="refine_note_block_style"/>
8246
+ <xsl:call-template name="refine_note_block_style"/>
8215
8247
 
8216
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8248
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
8217
8249
 
8218
- <xsl:call-template name="refine_note-name-style"/>
8250
+ <xsl:call-template name="refine_note-name-style"/>
8219
8251
 
8220
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8221
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8222
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8223
- <xsl:call-template name="append_add-style"/>
8224
- </xsl:if>
8252
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
8253
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
8254
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
8255
+ <xsl:call-template name="append_add-style"/>
8256
+ </xsl:if>
8225
8257
 
8226
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8227
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8228
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8229
- <xsl:with-param name="skip">false</xsl:with-param>
8230
- </xsl:apply-templates>
8231
- </xsl:if>
8258
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
8259
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8260
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
8261
+ <xsl:with-param name="skip">false</xsl:with-param>
8262
+ </xsl:apply-templates>
8263
+ </xsl:if>
8232
8264
 
8233
- <xsl:apply-templates select="*[local-name() = 'name']"/>
8265
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
8234
8266
 
8235
- </fo:inline>
8267
+ </fo:inline>
8236
8268
 
8237
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8238
- </fo:block>
8269
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8270
+ </fo:block>
8239
8271
 
8240
- </fo:block-container>
8241
- </fo:block-container>
8272
+ </fo:block-container>
8273
+ </fo:block-container>
8242
8274
 
8243
8275
  </xsl:template>
8244
8276
 
@@ -10570,12 +10602,14 @@
10570
10602
 
10571
10603
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
10572
10604
 
10573
- <xsl:variable name="provisional_distance_between_starts">
10605
+ <xsl:variable name="provisional_distance_between_starts_">
10574
10606
  7
10575
10607
  </xsl:variable>
10576
- <xsl:variable name="indent">
10608
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
10609
+ <xsl:variable name="indent_">
10577
10610
  0
10578
10611
  </xsl:variable>
10612
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
10579
10613
 
10580
10614
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
10581
10615
  <fo:list-item>
@@ -10639,6 +10673,7 @@
10639
10673
  </xsl:when>
10640
10674
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
10641
10675
  <fo:block xsl:use-attribute-sets="example-name-style">
10676
+
10642
10677
  <xsl:apply-templates/>
10643
10678
  </fo:block>
10644
10679
  </xsl:when>
@@ -10654,6 +10689,7 @@
10654
10689
 
10655
10690
  <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
10656
10691
  <fo:inline xsl:use-attribute-sets="example-name-style">
10692
+
10657
10693
  <xsl:apply-templates/>
10658
10694
  </fo:inline>
10659
10695
  </xsl:template>
@@ -11031,12 +11067,14 @@
11031
11067
 
11032
11068
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
11033
11069
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
11070
+
11034
11071
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
11035
11072
  </fo:block>
11036
11073
  </xsl:if>
11037
11074
 
11038
11075
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
11039
11076
  <xsl:call-template name="setStyle_preferred"/>
11077
+
11040
11078
  <xsl:apply-templates/>
11041
11079
  </fo:block>
11042
11080
  </fo:block>
@@ -11309,14 +11347,17 @@
11309
11347
  </xsl:when>
11310
11348
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
11311
11349
 
11312
- <xsl:variable name="label">
11350
+ <xsl:variable name="type" select="../@type"/>
11313
11351
 
11314
- <xsl:variable name="type" select="../@type"/>
11352
+ <xsl:variable name="label">
11315
11353
 
11316
11354
  <xsl:variable name="style_prefix_">
11317
11355
  <xsl:if test="$type = 'roman'">
11318
11356
  <!-- Example: (i) -->
11319
11357
  </xsl:if>
11358
+ <xsl:if test="$type = 'alphabet'">
11359
+
11360
+ </xsl:if>
11320
11361
  </xsl:variable>
11321
11362
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
11322
11363
 
@@ -11342,13 +11383,15 @@
11342
11383
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
11343
11384
  <xsl:value-of select="$style_prefix"/>
11344
11385
  </xsl:if>
11386
+
11345
11387
  <xsl:value-of select="@label"/>
11388
+
11346
11389
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
11347
11390
  <xsl:value-of select="$style_suffix"/>
11348
11391
  </xsl:if>
11349
11392
  </xsl:variable>
11350
11393
 
11351
- <xsl:value-of select="normalize-space($label)"/>
11394
+ <xsl:value-of select="normalize-space($label)"/>
11352
11395
 
11353
11396
  </xsl:when>
11354
11397
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -13553,7 +13596,8 @@
13553
13596
  <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
13554
13597
  <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
13555
13598
  <!-- Todo: need update -->
13556
- <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13599
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13600
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13557
13601
 
13558
13602
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
13559
13603
  <xsl:attribute name="src">
@@ -13574,6 +13618,9 @@
13574
13618
  <xsl:if test="$afrelationship != ''">
13575
13619
  <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13576
13620
  </xsl:if>
13621
+ <xsl:if test="$volatile != ''">
13622
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13623
+ </xsl:if>
13577
13624
  </pdf:embedded-file>
13578
13625
  </xsl:for-each>
13579
13626
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
@@ -13584,14 +13631,18 @@
13584
13631
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13585
13632
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13586
13633
  <!-- Todo: need update -->
13587
- <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
13634
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13635
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13588
13636
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
13589
13637
  <xsl:if test="$description != ''">
13590
13638
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13591
13639
  </xsl:if>
13592
13640
  <xsl:if test="$afrelationship != ''">
13593
- <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13594
- </xsl:if>
13641
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13642
+ </xsl:if>
13643
+ <xsl:if test="$volatile != ''">
13644
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13645
+ </xsl:if>
13595
13646
  </pdf:embedded-file>
13596
13647
  </xsl:for-each>
13597
13648
  </xsl:if>
@@ -13638,10 +13689,31 @@
13638
13689
  <xsl:value-of select="$level_total - 2"/>
13639
13690
  </xsl:when>
13640
13691
  <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
13641
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
13692
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
13693
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
13694
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
13695
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
13696
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
13697
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
13698
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
13699
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
13700
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
13701
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
13702
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
13642
13703
  <xsl:choose>
13643
- <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13644
- <xsl:value-of select="number($upper_clause_depth + 1)"/>
13704
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
13705
+ <xsl:value-of select="number($curr_clause_depth)"/>
13706
+ </xsl:when>
13707
+ <xsl:otherwise>
13708
+ <xsl:value-of select="$level_total - 2"/>
13709
+ </xsl:otherwise>
13710
+ </xsl:choose>
13711
+ </xsl:when>
13712
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
13713
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13714
+ <xsl:choose>
13715
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
13716
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
13645
13717
  </xsl:when>
13646
13718
  <xsl:otherwise>
13647
13719
  <xsl:value-of select="$level_total - 2"/>
@@ -13649,7 +13721,7 @@
13649
13721
  </xsl:choose>
13650
13722
  </xsl:when>
13651
13723
  <xsl:when test="ancestor::*[local-name() = 'sections']">
13652
- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][1]/*[local-name() = 'title']/@depth)"/>
13724
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13653
13725
  <xsl:choose>
13654
13726
  <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13655
13727
  <xsl:value-of select="number($upper_clause_depth + 1)"/>
@@ -13966,9 +14038,10 @@
13966
14038
  <xsl:template name="insertBackgroundPageImage">
13967
14039
  <xsl:param name="number">1</xsl:param>
13968
14040
  <xsl:param name="name">coverpage-image</xsl:param>
14041
+ <xsl:param name="suffix"/>
13969
14042
  <xsl:variable name="num" select="number($number)"/>
13970
14043
  <!-- background image -->
13971
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
14044
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
13972
14045
  <fo:block>
13973
14046
  <xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
13974
14047
  <xsl:choose>
@@ -14034,16 +14107,29 @@
14034
14107
 
14035
14108
  <!-- END: insert cover page image -->
14036
14109
 
14110
+ <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
14037
14111
  <xsl:template name="insertVerticalChar">
14038
14112
  <xsl:param name="str"/>
14113
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
14114
+ <xsl:param name="reference-orientation">90</xsl:param>
14039
14115
  <xsl:if test="string-length($str) &gt; 0">
14040
- <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14116
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
14117
+ <xsl:if test="normalize-space($writing-mode) != ''">
14118
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
14119
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
14120
+ </xsl:if>
14121
+ <xsl:variable name="char" select="substring($str,1,1)"/>
14122
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
14123
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
14124
+ </xsl:if>
14041
14125
  <fo:block-container width="1em">
14042
- <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
14126
+ <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
14043
14127
  </fo:block-container>
14044
14128
  </fo:inline-container>
14045
14129
  <xsl:call-template name="insertVerticalChar">
14046
14130
  <xsl:with-param name="str" select="substring($str, 2)"/>
14131
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
14132
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
14047
14133
  </xsl:call-template>
14048
14134
  </xsl:if>
14049
14135
  </xsl:template>
@@ -1,10 +1,10 @@
1
1
  require "isodoc"
2
2
 
3
3
  module IsoDoc
4
- module BIPM
4
+ module Bipm
5
5
  class Metadata < IsoDoc::Generic::Metadata
6
6
  def configuration
7
- Metanorma::BIPM.configuration
7
+ Metanorma::Bipm.configuration
8
8
  end
9
9
 
10
10
  SI_ASPECT = %w(A_e_deltanu A_e cd_Kcd_h_deltanu cd_Kcd full K_k_deltanu
@@ -3,7 +3,7 @@ require "metanorma-generic"
3
3
  require_relative "base_convert"
4
4
 
5
5
  module IsoDoc
6
- module BIPM
6
+ module Bipm
7
7
  class PdfConvert < IsoDoc::Generic::PdfConvert
8
8
  def initialize(options)
9
9
  super
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module BIPM
2
+ module Bipm
3
3
  class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
4
4
  def middle_title(docxml)
5
5
  @jcgm or return nil
@@ -8,7 +8,7 @@ require_relative "../../relaton/render/general"
8
8
  require_relative "presentation_blocks"
9
9
 
10
10
  module IsoDoc
11
- module BIPM
11
+ module Bipm
12
12
  class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
13
13
  def convert1(docxml, filename, dir)
14
14
  @jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/" \
@@ -1,5 +1,5 @@
1
1
  module IsoDoc
2
- module BIPM
2
+ module Bipm
3
3
  class Counter < IsoDoc::XrefGen::Counter
4
4
  end
5
5
 
@@ -80,7 +80,7 @@ module IsoDoc
80
80
  clause.nil? and return num
81
81
  num.increment(clause)
82
82
  @anchors[clause["id"]] = section_name_anchors(clause, num, lvl)
83
- i = Counter.new(0, prefix: "#{num.print}.")
83
+ i = Counter.new(0, prefix: num.print)
84
84
  clause.xpath(ns(NUMBERED_SUBCLAUSES)).each do |c|
85
85
  section_names1(c, i.increment(c).print, lvl + 1)
86
86
  end
@@ -109,7 +109,7 @@ module IsoDoc
109
109
 
110
110
  def section_names1(clause, num, level)
111
111
  @anchors[clause["id"]] = section_name1_anchors(clause, num, level)
112
- i = Counter.new(0, prefix: "#{num}.")
112
+ i = Counter.new(0, prefix: num)
113
113
  clause.xpath(ns(NUMBERED_SUBCLAUSES)).each do |c|
114
114
  section_names1(c, i.increment(c).print, level + 1)
115
115
  end
@@ -157,7 +157,7 @@ module IsoDoc
157
157
  num.to_s, 1)
158
158
  else
159
159
  prefix = @jcgm ? "" : "A"
160
- i = Counter.new(0, prefix: "#{prefix}#{num}.")
160
+ i = Counter.new(0, prefix: "#{prefix}#{num}")
161
161
  clause.xpath(ns(NUMBERED_SUBCLAUSES)).each do |c|
162
162
  annex_names1(c, i.increment(c).print, 2)
163
163
  end
@@ -193,7 +193,7 @@ module IsoDoc
193
193
 
194
194
  def annex_names1(clause, num, level)
195
195
  @anchors[clause["id"]] = annex_names1_anchors(num, level)
196
- i = Counter.new(0, prefix: "#{num}.")
196
+ i = Counter.new(0, prefix: num)
197
197
  clause.xpath(ns(NUMBERED_SUBCLAUSES)).each do |c|
198
198
  annex_names1(c, i.increment(c).print, level + 1)
199
199
  end
data/lib/isodoc/bipm.rb CHANGED
@@ -4,6 +4,6 @@ require "isodoc/bipm/pdf_convert"
4
4
  require "isodoc/bipm/presentation_xml_convert"
5
5
 
6
6
  module IsoDoc
7
- module BIPM
7
+ module Bipm
8
8
  end
9
9
  end
@@ -72,6 +72,9 @@ standards defining organization, and that is rendered in a distinct manner</a:do
72
72
  from other documents in the same doctype</a:documentation>
73
73
  </ref>
74
74
  </optional>
75
+ <ref name="flavor">
76
+ <a:documentation>Flavour of Metanorma used to process this document</a:documentation>
77
+ </ref>
75
78
  <optional>
76
79
  <ref name="editorialgroup">
77
80
  <a:documentation>Groups associated with the production of the standards document, typically within
@@ -113,6 +116,16 @@ a standards definition organization</a:documentation>
113
116
  <define name="DocumentSubtype">
114
117
  <text/>
115
118
  </define>
119
+ <define name="flavor">
120
+ <element name="flavor">
121
+ <ref name="MetanormaFlavor"/>
122
+ </element>
123
+ </define>
124
+ <define name="MetanormaFlavor">
125
+ <a:documentation>This is in fact an enum, as of this writing: standoc iso generic ietf ieee itu nist ogc csa cc iho ribose jis iec bsi bipm plateau.
126
+ However we prefer not to hardcode it, given ongoing extension.</a:documentation>
127
+ <text/>
128
+ </define>
116
129
  <define name="editorialgroup">
117
130
  <a:documentation>A group associated with the production of the standards document, typically within
118
131
  a standards definition organization</a:documentation>
@@ -1382,18 +1382,7 @@ Applies whether the resource has already been created or not, and whether it is
1382
1382
  <define name="bdate">
1383
1383
  <a:documentation>Significant date in the lifecycle of the bibliographic item, including its production and its access</a:documentation>
1384
1384
  <element name="date">
1385
- <attribute name="type">
1386
- <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1387
- <choice>
1388
- <ref name="BibliographicDateType"/>
1389
- <text/>
1390
- </choice>
1391
- </attribute>
1392
- <optional>
1393
- <attribute name="text">
1394
- <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1395
- </attribute>
1396
- </optional>
1385
+ <ref name="bDateAttributes"/>
1397
1386
  <optional>
1398
1387
  <choice>
1399
1388
  <group>
@@ -1416,6 +1405,20 @@ Applies whether the resource has already been created or not, and whether it is
1416
1405
  </optional>
1417
1406
  </element>
1418
1407
  </define>
1408
+ <define name="bDateAttributes">
1409
+ <attribute name="type">
1410
+ <a:documentation>The phase of the production of or access to a bibliographic item</a:documentation>
1411
+ <choice>
1412
+ <ref name="BibliographicDateType"/>
1413
+ <text/>
1414
+ </choice>
1415
+ </attribute>
1416
+ <optional>
1417
+ <attribute name="text">
1418
+ <a:documentation>An optional textual description of the date, especially when a Gregorian date is not applicable</a:documentation>
1419
+ </attribute>
1420
+ </optional>
1421
+ </define>
1419
1422
  <define name="docidentifier">
1420
1423
  <a:documentation>An identifier of a bibliographic item in an international standard scheme</a:documentation>
1421
1424
  <element name="docidentifier">
@@ -1884,6 +1887,10 @@ Detailed in https://www.relaton.org/model/relations/</a:documentation>
1884
1887
  <value>hasAnnotation</value>
1885
1888
  <value>draftOf</value>
1886
1889
  <value>hasDraft</value>
1890
+ <value>preliminaryDraftOf</value>
1891
+ <value>hasPreliminaryDraft</value>
1892
+ <value>revisionDraftOf</value>
1893
+ <value>hasRevisionDraft</value>
1887
1894
  <value>editionOf</value>
1888
1895
  <value>hasEdition</value>
1889
1896
  <value>updates</value>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
- module BIPM
2
+ module Bipm
3
3
  class Converter < Metanorma::Generic::Converter
4
4
  def boilerplate_file(_xmldoc)
5
5
  if @jcgm
@@ -4,12 +4,12 @@ require_relative "front"
4
4
  require_relative "cleanup"
5
5
 
6
6
  module Metanorma
7
- module BIPM
7
+ module Bipm
8
8
  class Converter < Metanorma::Generic::Converter
9
9
  register_for "bipm"
10
10
 
11
11
  def configuration
12
- Metanorma::BIPM.configuration
12
+ Metanorma::Bipm.configuration
13
13
  end
14
14
 
15
15
  def org_name_long
@@ -112,19 +112,19 @@ module Metanorma
112
112
  end
113
113
 
114
114
  def html_converter(node)
115
- IsoDoc::BIPM::HtmlConvert.new(html_extract_attributes(node))
115
+ IsoDoc::Bipm::HtmlConvert.new(html_extract_attributes(node))
116
116
  end
117
117
 
118
118
  def presentation_xml_converter(node)
119
- IsoDoc::BIPM::PresentationXMLConvert
119
+ IsoDoc::Bipm::PresentationXMLConvert
120
120
  .new(html_extract_attributes(node)
121
- .merge(output_formats: ::Metanorma::BIPM::Processor.new
121
+ .merge(output_formats: ::Metanorma::Bipm::Processor.new
122
122
  .output_formats))
123
123
  end
124
124
 
125
125
  def pdf_converter(node)
126
126
  node.attr("no-pdf") and return nil
127
- IsoDoc::BIPM::PdfConvert.new(pdf_extract_attributes(node))
127
+ IsoDoc::Bipm::PdfConvert.new(pdf_extract_attributes(node))
128
128
  end
129
129
  end
130
130
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
- module BIPM
2
+ module Bipm
3
3
  class Converter < Metanorma::Generic::Converter
4
4
  def metadata_committee(node, xml)
5
5
  return unless node.attr("committee-en") || node.attr("committee-fr")