metanorma-bipm 2.5.2 → 2.5.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -5076,6 +5076,7 @@
5076
5076
 
5077
5077
  <fo:block role="SKIP">
5078
5078
  <xsl:apply-templates/>
5079
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
5079
5080
  </fo:block>
5080
5081
  </fo:table-cell>
5081
5082
  </xsl:template> <!-- cell in table header row - 'th' -->
@@ -5139,6 +5140,8 @@
5139
5140
 
5140
5141
  <xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
5141
5142
 
5143
+ <xsl:if test="$isGenerateTableIF = 'false' and count(node()) = 0"> </xsl:if>
5144
+
5142
5145
  </fo:block>
5143
5146
  </fo:table-cell>
5144
5147
  </xsl:template> <!-- td -->
@@ -5210,7 +5213,8 @@
5210
5213
  </xsl:choose>
5211
5214
  </xsl:variable>
5212
5215
  <xsl:variable name="current_fn_number_text">
5213
- <xsl:value-of select="$current_fn_number"/>
5216
+
5217
+ <xsl:value-of select="$current_fn_number"/>
5214
5218
 
5215
5219
  </xsl:variable>
5216
5220
 
@@ -5246,8 +5250,10 @@
5246
5250
 
5247
5251
  <xsl:call-template name="insert_basic_link">
5248
5252
  <xsl:with-param name="element">
5249
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}" role="Lbl">
5250
- <xsl:copy-of select="$current_fn_number_text"/>
5253
+ <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 -->
5254
+ <fo:inline role="Lbl"> <!-- need for https://github.com/metanorma/metanorma-iso/issues/1003 -->
5255
+ <xsl:copy-of select="$current_fn_number_text"/>
5256
+ </fo:inline>
5251
5257
  </fo:basic-link>
5252
5258
  </xsl:with-param>
5253
5259
  </xsl:call-template>
@@ -5528,7 +5534,7 @@
5528
5534
 
5529
5535
  <xsl:call-template name="refine_fn-reference-style"/>
5530
5536
 
5531
- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5537
+ <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5532
5538
  <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> <!-- for footnotes in tables -->
5533
5539
  <xsl:attribute name="internal-destination">
5534
5540
  <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
@@ -6543,9 +6549,19 @@
6543
6549
  </fo:inline>
6544
6550
  </xsl:template>
6545
6551
 
6546
- <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
6552
+ <xsl:template match="text()[ancestor::*[local-name()='smallcap']]" name="smallcaps">
6553
+ <xsl:param name="txt"/>
6547
6554
  <!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
6548
- <xsl:variable name="text" select="."/>
6555
+ <xsl:variable name="text">
6556
+ <xsl:choose>
6557
+ <xsl:when test="$txt != ''">
6558
+ <xsl:value-of select="$txt"/>
6559
+ </xsl:when>
6560
+ <xsl:otherwise>
6561
+ <xsl:value-of select="."/>
6562
+ </xsl:otherwise>
6563
+ </xsl:choose>
6564
+ </xsl:variable>
6549
6565
  <xsl:variable name="ratio_">
6550
6566
  0.75
6551
6567
  </xsl:variable>
@@ -7946,14 +7962,16 @@
7946
7962
  <xsl:template match="*[local-name()='link']" name="link">
7947
7963
  <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
7948
7964
  <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
7965
+ <xsl:variable name="isLinkToEmbeddedFile" select="normalize-space(@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target])"/>
7949
7966
  <xsl:variable name="target">
7950
7967
  <xsl:choose>
7951
7968
  <xsl:when test="@updatetype = 'true'">
7952
7969
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7953
7970
  </xsl:when>
7954
7971
  <!-- link to the PDF attachment -->
7955
- <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
7956
- <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
7972
+ <xsl:when test="$isLinkToEmbeddedFile = 'true'">
7973
+ <xsl:variable name="target_file" select="java:org.metanorma.fop.Util.getFilenameFromPath(@target)"/>
7974
+ <xsl:value-of select="concat('url(embedded-file:', $target_file, ')')"/>
7957
7975
  </xsl:when>
7958
7976
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
7959
7977
  <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
@@ -7984,6 +8002,11 @@
7984
8002
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
7985
8003
  </xsl:if>
7986
8004
 
8005
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8006
+ <xsl:attribute name="color">inherit</xsl:attribute>
8007
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
8008
+ </xsl:if>
8009
+
7987
8010
  <xsl:call-template name="refine_link-style"/>
7988
8011
 
7989
8012
  <xsl:choose>
@@ -7991,9 +8014,15 @@
7991
8014
  <xsl:apply-templates/>
7992
8015
  </xsl:when>
7993
8016
  <xsl:otherwise>
8017
+ <xsl:variable name="alt_text">
8018
+ <xsl:call-template name="getAltText"/>
8019
+ </xsl:variable>
7994
8020
  <xsl:call-template name="insert_basic_link">
7995
8021
  <xsl:with-param name="element">
7996
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
8022
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$alt_text}">
8023
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8024
+ <xsl:attribute name="role">Annot</xsl:attribute>
8025
+ </xsl:if>
7997
8026
  <xsl:choose>
7998
8027
  <xsl:when test="normalize-space(.) = ''">
7999
8028
  <xsl:call-template name="add-zero-spaces-link-java">
@@ -8006,6 +8035,10 @@
8006
8035
  </xsl:otherwise>
8007
8036
  </xsl:choose>
8008
8037
  </fo:basic-link>
8038
+ <xsl:if test="$isLinkToEmbeddedFile = 'true'">
8039
+ <!-- reserve space at right for PaperClip icon -->
8040
+ <fo:inline keep-with-previous.within-line="always">        </fo:inline>
8041
+ </xsl:if>
8009
8042
  </xsl:with-param>
8010
8043
  </xsl:call-template>
8011
8044
  </xsl:otherwise>
@@ -8013,6 +8046,14 @@
8013
8046
  </fo:inline>
8014
8047
  </xsl:template> <!-- link -->
8015
8048
 
8049
+ <xsl:template name="getAltText">
8050
+ <xsl:choose>
8051
+ <xsl:when test="normalize-space(.) = ''"><xsl:value-of select="@target"/></xsl:when>
8052
+ <xsl:otherwise><xsl:value-of select="normalize-space(translate(normalize-space(), ' —', ' -'))"/></xsl:otherwise>
8053
+ <!-- <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise> -->
8054
+ </xsl:choose>
8055
+ </xsl:template>
8056
+
8016
8057
  <!-- ======================== -->
8017
8058
  <!-- Appendix processing -->
8018
8059
  <!-- ======================== -->
@@ -8043,7 +8084,7 @@
8043
8084
  <xsl:template match="*[local-name() = 'callout']">
8044
8085
  <xsl:choose>
8045
8086
  <xsl:when test="normalize-space(@target) = ''">&lt;<xsl:apply-templates/>&gt;</xsl:when>
8046
- <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
8087
+ <xsl:otherwise><fo:basic-link internal-destination="{@target}" fox:alt-text="{normalize-space()}">&lt;<xsl:apply-templates/>&gt;</fo:basic-link></xsl:otherwise>
8047
8088
  </xsl:choose>
8048
8089
  </xsl:template>
8049
8090
 
@@ -8072,7 +8113,10 @@
8072
8113
  <xsl:template match="*[local-name() = 'xref']">
8073
8114
  <xsl:call-template name="insert_basic_link">
8074
8115
  <xsl:with-param name="element">
8075
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
8116
+ <xsl:variable name="alt_text">
8117
+ <xsl:call-template name="getAltText"/>
8118
+ </xsl:variable>
8119
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{$alt_text}" xsl:use-attribute-sets="xref-style">
8076
8120
  <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'])">
8077
8121
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
8078
8122
  </xsl:if>
@@ -10553,12 +10597,14 @@
10553
10597
 
10554
10598
  <xsl:when test="contains(normalize-space($fo_element), 'list')">
10555
10599
 
10556
- <xsl:variable name="provisional_distance_between_starts">
10600
+ <xsl:variable name="provisional_distance_between_starts_">
10557
10601
  7
10558
10602
  </xsl:variable>
10559
- <xsl:variable name="indent">
10603
+ <xsl:variable name="provisional_distance_between_starts" select="normalize-space($provisional_distance_between_starts_)"/>
10604
+ <xsl:variable name="indent_">
10560
10605
  0
10561
10606
  </xsl:variable>
10607
+ <xsl:variable name="indent" select="normalize-space($indent_)"/>
10562
10608
 
10563
10609
  <fo:list-block provisional-distance-between-starts="{$provisional_distance_between_starts}mm">
10564
10610
  <fo:list-item>
@@ -11292,14 +11338,17 @@
11292
11338
  </xsl:when>
11293
11339
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
11294
11340
 
11295
- <xsl:variable name="label">
11341
+ <xsl:variable name="type" select="../@type"/>
11296
11342
 
11297
- <xsl:variable name="type" select="../@type"/>
11343
+ <xsl:variable name="label">
11298
11344
 
11299
11345
  <xsl:variable name="style_prefix_">
11300
11346
  <xsl:if test="$type = 'roman'">
11301
11347
  <!-- Example: (i) -->
11302
11348
  </xsl:if>
11349
+ <xsl:if test="$type = 'alphabet'">
11350
+
11351
+ </xsl:if>
11303
11352
  </xsl:variable>
11304
11353
  <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
11305
11354
 
@@ -11325,13 +11374,15 @@
11325
11374
  <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
11326
11375
  <xsl:value-of select="$style_prefix"/>
11327
11376
  </xsl:if>
11377
+
11328
11378
  <xsl:value-of select="@label"/>
11379
+
11329
11380
  <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
11330
11381
  <xsl:value-of select="$style_suffix"/>
11331
11382
  </xsl:if>
11332
11383
  </xsl:variable>
11333
11384
 
11334
- <xsl:value-of select="normalize-space($label)"/>
11385
+ <xsl:value-of select="normalize-space($label)"/>
11335
11386
 
11336
11387
  </xsl:when>
11337
11388
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
@@ -13531,9 +13582,15 @@
13531
13582
  </x:xmpmeta>
13532
13583
  <!-- add attachments -->
13533
13584
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
13534
- <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
13535
-
13536
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
13585
+ <xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
13586
+ <xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
13587
+ <xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
13588
+ <xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
13589
+ <!-- Todo: need update -->
13590
+ <xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13591
+ <xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13592
+
13593
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
13537
13594
  <xsl:attribute name="src">
13538
13595
  <xsl:choose>
13539
13596
  <xsl:when test="normalize-space() != ''">
@@ -13549,18 +13606,34 @@
13549
13606
  <xsl:if test="$description != ''">
13550
13607
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13551
13608
  </xsl:if>
13609
+ <xsl:if test="$afrelationship != ''">
13610
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13611
+ </xsl:if>
13612
+ <xsl:if test="$volatile != ''">
13613
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13614
+ </xsl:if>
13552
13615
  </pdf:embedded-file>
13553
13616
  </xsl:for-each>
13554
13617
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
13555
13618
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
13556
13619
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
13557
13620
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
13621
+ <xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
13558
13622
  <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13559
13623
  <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13560
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
13624
+ <!-- Todo: need update -->
13625
+ <xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
13626
+ <xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
13627
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
13561
13628
  <xsl:if test="$description != ''">
13562
13629
  <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13563
13630
  </xsl:if>
13631
+ <xsl:if test="$afrelationship != ''">
13632
+ <xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
13633
+ </xsl:if>
13634
+ <xsl:if test="$volatile != ''">
13635
+ <xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
13636
+ </xsl:if>
13564
13637
  </pdf:embedded-file>
13565
13638
  </xsl:for-each>
13566
13639
  </xsl:if>
@@ -13580,6 +13653,12 @@
13580
13653
  <!-- Get or calculate depth of the element -->
13581
13654
  <xsl:template name="getLevel">
13582
13655
  <xsl:param name="depth"/>
13656
+ <!-- <xsl:message>
13657
+ <xsl:choose>
13658
+ <xsl:when test="local-name() = 'title'">title=<xsl:value-of select="."/></xsl:when>
13659
+ <xsl:when test="local-name() = 'clause'">clause/title=<xsl:value-of select="*[local-name() = 'title']"/></xsl:when>
13660
+ </xsl:choose>
13661
+ </xsl:message> -->
13583
13662
  <xsl:choose>
13584
13663
  <xsl:when test="normalize-space(@depth) != ''">
13585
13664
  <xsl:value-of select="@depth"/>
@@ -13600,8 +13679,48 @@
13600
13679
  <xsl:when test="ancestor::*[local-name() = 'preface']">
13601
13680
  <xsl:value-of select="$level_total - 2"/>
13602
13681
  </xsl:when>
13682
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'title']">
13683
+ <!-- determine 'depth' depends on upper clause with title/@depth -->
13684
+ <!-- <xsl:message>title=<xsl:value-of select="."/></xsl:message> -->
13685
+ <xsl:variable name="clause_with_depth_depth" select="ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/*[local-name() = 'title']/@depth"/>
13686
+ <!-- <xsl:message>clause_with_depth_depth=<xsl:value-of select="$clause_with_depth_depth"/></xsl:message> -->
13687
+ <xsl:variable name="clause_with_depth_level" select="count(ancestor::*[local-name() = 'clause'][*[local-name() = 'title']/@depth][1]/ancestor::*)"/>
13688
+ <!-- <xsl:message>clause_with_depth_level=<xsl:value-of select="$clause_with_depth_level"/></xsl:message> -->
13689
+ <xsl:variable name="curr_level" select="count(ancestor::*) - 1"/>
13690
+ <!-- <xsl:message>curr_level=<xsl:value-of select="$curr_level"/></xsl:message> -->
13691
+ <!-- <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/> -->
13692
+ <xsl:variable name="curr_clause_depth" select="number($clause_with_depth_depth) + (number($curr_level) - number($clause_with_depth_level)) "/>
13693
+ <!-- <xsl:message>curr_clause_depth=<xsl:value-of select="$curr_clause_depth"/></xsl:message> -->
13694
+ <xsl:choose>
13695
+ <xsl:when test="string(number($curr_clause_depth)) != 'NaN'">
13696
+ <xsl:value-of select="number($curr_clause_depth)"/>
13697
+ </xsl:when>
13698
+ <xsl:otherwise>
13699
+ <xsl:value-of select="$level_total - 2"/>
13700
+ </xsl:otherwise>
13701
+ </xsl:choose>
13702
+ </xsl:when>
13703
+ <xsl:when test="ancestor::*[local-name() = 'sections'] and self::*[local-name() = 'name'] and parent::*[local-name() = 'term']">
13704
+ <xsl:variable name="upper_terms_depth" select="normalize-space(ancestor::*[local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13705
+ <xsl:choose>
13706
+ <xsl:when test="string(number($upper_terms_depth)) != 'NaN'">
13707
+ <xsl:value-of select="number($upper_terms_depth + 1)"/>
13708
+ </xsl:when>
13709
+ <xsl:otherwise>
13710
+ <xsl:value-of select="$level_total - 2"/>
13711
+ </xsl:otherwise>
13712
+ </xsl:choose>
13713
+ </xsl:when>
13603
13714
  <xsl:when test="ancestor::*[local-name() = 'sections']">
13604
- <xsl:value-of select="$level_total - 1"/>
13715
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause' or local-name() = 'terms'][1]/*[local-name() = 'title']/@depth)"/>
13716
+ <xsl:choose>
13717
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13718
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
13719
+ </xsl:when>
13720
+ <xsl:otherwise>
13721
+ <xsl:value-of select="$level_total - 1"/>
13722
+ </xsl:otherwise>
13723
+ </xsl:choose>
13605
13724
  </xsl:when>
13606
13725
  <xsl:when test="ancestor::*[local-name() = 'bibliography']">
13607
13726
  <xsl:value-of select="$level_total - 1"/>
@@ -13609,6 +13728,17 @@
13609
13728
  <xsl:when test="parent::*[local-name() = 'annex']">
13610
13729
  <xsl:value-of select="$level_total - 1"/>
13611
13730
  </xsl:when>
13731
+ <xsl:when test="ancestor::*[local-name() = 'annex'] and self::*[local-name() = 'title']">
13732
+ <xsl:variable name="upper_clause_depth" select="normalize-space(ancestor::*[local-name() = 'clause'][2]/*[local-name() = 'title']/@depth)"/>
13733
+ <xsl:choose>
13734
+ <xsl:when test="string(number($upper_clause_depth)) != 'NaN'">
13735
+ <xsl:value-of select="number($upper_clause_depth + 1)"/>
13736
+ </xsl:when>
13737
+ <xsl:otherwise>
13738
+ <xsl:value-of select="$level_total - 1"/>
13739
+ </xsl:otherwise>
13740
+ </xsl:choose>
13741
+ </xsl:when>
13612
13742
  <xsl:when test="ancestor::*[local-name() = 'annex']">
13613
13743
  <xsl:value-of select="$level_total"/>
13614
13744
  </xsl:when>
@@ -13967,6 +14097,20 @@
13967
14097
 
13968
14098
  <!-- END: insert cover page image -->
13969
14099
 
14100
+ <xsl:template name="insertVerticalChar">
14101
+ <xsl:param name="str"/>
14102
+ <xsl:if test="string-length($str) &gt; 0">
14103
+ <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">
14104
+ <fo:block-container width="1em">
14105
+ <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
14106
+ </fo:block-container>
14107
+ </fo:inline-container>
14108
+ <xsl:call-template name="insertVerticalChar">
14109
+ <xsl:with-param name="str" select="substring($str, 2)"/>
14110
+ </xsl:call-template>
14111
+ </xsl:if>
14112
+ </xsl:template>
14113
+
13970
14114
  <xsl:template name="number-to-words">
13971
14115
  <xsl:param name="number"/>
13972
14116
  <xsl:param name="first"/>
@@ -14254,4 +14398,18 @@
14254
14398
  </xsl:if>
14255
14399
  </xsl:template>
14256
14400
 
14401
+ <xsl:template match="@*|node()" mode="set_table_role_skip">
14402
+ <xsl:copy>
14403
+ <xsl:apply-templates select="@*|node()" mode="set_table_role_skip"/>
14404
+ </xsl:copy>
14405
+ </xsl:template>
14406
+
14407
+ <xsl:template match="*[starts-with(local-name(), 'table')]" mode="set_table_role_skip">
14408
+ <xsl:copy>
14409
+ <xsl:apply-templates select="@*" mode="set_table_role_skip"/>
14410
+ <xsl:attribute name="role">SKIP</xsl:attribute>
14411
+ <xsl:apply-templates select="node()" mode="set_table_role_skip"/>
14412
+ </xsl:copy>
14413
+ </xsl:template>
14414
+
14257
14415
  </xsl:stylesheet>
@@ -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
 
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")
@@ -1,10 +1,10 @@
1
1
  require "metanorma/processor"
2
2
 
3
3
  module Metanorma
4
- module BIPM
4
+ module Bipm
5
5
  class Processor < Metanorma::Generic::Processor
6
6
  def configuration
7
- Metanorma::BIPM.configuration
7
+ Metanorma::Bipm.configuration
8
8
  end
9
9
 
10
10
  def output_formats
@@ -15,20 +15,20 @@ module Metanorma
15
15
  end
16
16
 
17
17
  def version
18
- "Metanorma::BIPM #{Metanorma::BIPM::VERSION}"
18
+ "Metanorma::Bipm #{Metanorma::Bipm::VERSION}"
19
19
  end
20
20
 
21
21
  def output(isodoc_node, inname, outname, format, options = {})
22
22
  options_preprocess(options)
23
23
  case format
24
24
  when :html
25
- IsoDoc::BIPM::HtmlConvert.new(options)
25
+ IsoDoc::Bipm::HtmlConvert.new(options)
26
26
  .convert(inname, isodoc_node, nil, outname)
27
27
  when :presentation
28
- IsoDoc::BIPM::PresentationXMLConvert.new(options)
28
+ IsoDoc::Bipm::PresentationXMLConvert.new(options)
29
29
  .convert(inname, isodoc_node, nil, outname)
30
30
  when :pdf
31
- IsoDoc::BIPM::PdfConvert.new(options)
31
+ IsoDoc::Bipm::PdfConvert.new(options)
32
32
  .convert(inname, isodoc_node, nil, outname)
33
33
  else
34
34
  super
@@ -54,6 +54,7 @@
54
54
  <optional>
55
55
  <ref name="docsubtype"/>
56
56
  </optional>
57
+ <ref name="flavor"/>
57
58
  <ref name="editorialgroup"/>
58
59
  <optional>
59
60
  <ref name="comment-period"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
- module BIPM
3
- VERSION = "2.5.2".freeze
2
+ module Bipm
3
+ VERSION = "2.5.4".freeze
4
4
  end
5
5
  end