metanorma-bipm 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -550,8 +550,11 @@ a:hover {
550
550
  background: #6C734A;
551
551
  box-shadow: 3px 0 0 #6C734A, -3px 0 0 #6C734A; }
552
552
 
553
- ::selection,
554
- ::-moz-selection {
553
+ *::selection {
554
+ background: #6C734A;
555
+ color: white; }
556
+
557
+ *::-moz-selection {
555
558
  background: #6C734A;
556
559
  color: white; }
557
560
 
@@ -2506,6 +2506,12 @@
2506
2506
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2507
2507
  </xsl:attribute-set>
2508
2508
 
2509
+ <xsl:attribute-set name="figure-block-style">
2510
+
2511
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2512
+
2513
+ </xsl:attribute-set>
2514
+
2509
2515
  <xsl:attribute-set name="figure-style">
2510
2516
 
2511
2517
  </xsl:attribute-set>
@@ -2515,7 +2521,7 @@
2515
2521
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2516
2522
  <xsl:attribute name="text-align">center</xsl:attribute>
2517
2523
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
2518
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2524
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
2519
2525
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2520
2526
 
2521
2527
  </xsl:attribute-set>
@@ -3917,6 +3923,10 @@
3917
3923
  <xsl:with-param name="continued">true</xsl:with-param>
3918
3924
  </xsl:apply-templates>
3919
3925
 
3926
+ <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
3927
+ <fo:block/>
3928
+ </xsl:if>
3929
+
3920
3930
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3921
3931
  <xsl:call-template name="table_name_fn_display"/>
3922
3932
  </xsl:for-each>
@@ -4369,7 +4379,22 @@
4369
4379
 
4370
4380
  <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
4371
4381
  <xsl:variable name="footnote_inline">
4372
- <fo:inline xsl:use-attribute-sets="fn-num-style">
4382
+ <fo:inline>
4383
+
4384
+ <xsl:variable name="fn_styles">
4385
+ <xsl:choose>
4386
+ <xsl:when test="ancestor::*[local-name() = 'bibitem']">
4387
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
4388
+ </xsl:when>
4389
+ <xsl:otherwise>
4390
+ <fn_styles xsl:use-attribute-sets="fn-num-style"/>
4391
+ </xsl:otherwise>
4392
+ </xsl:choose>
4393
+ </xsl:variable>
4394
+
4395
+ <xsl:for-each select="xalan:nodeset($fn_styles)/fn_styles/@*">
4396
+ <xsl:copy-of select="."/>
4397
+ </xsl:for-each>
4373
4398
 
4374
4399
  <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4375
4400
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
@@ -4433,7 +4458,10 @@
4433
4458
  </xsl:for-each>
4434
4459
  <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='boilerplate']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
4435
4460
  <xsl:sort select="@displayorder" data-type="number"/>
4436
- <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4461
+ <!-- commented:
4462
+ .//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
4463
+ because 'fn' there is in biblio-tag -->
4464
+ <xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4437
4465
  <!-- copy unique fn -->
4438
4466
  <fn gen_id="{generate-id(.)}">
4439
4467
  <xsl:copy-of select="@*"/>
@@ -5301,7 +5329,7 @@
5301
5329
 
5302
5330
  <xsl:variable name="_font-size">
5303
5331
 
5304
- <!-- 10 -->
5332
+ <!-- inherit -->
5305
5333
 
5306
5334
  10
5307
5335
 
@@ -6272,6 +6300,33 @@
6272
6300
  </xsl:choose>
6273
6301
  </xsl:template>
6274
6302
 
6303
+ <xsl:template name="getLang_fromCurrentNode">
6304
+ <xsl:variable name="language_current" select="normalize-space(.//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
6305
+ <xsl:variable name="language">
6306
+ <xsl:choose>
6307
+ <xsl:when test="$language_current != ''">
6308
+ <xsl:value-of select="$language_current"/>
6309
+ </xsl:when>
6310
+ <xsl:otherwise>
6311
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
6312
+ <xsl:choose>
6313
+ <xsl:when test="$language_current_2 != ''">
6314
+ <xsl:value-of select="$language_current_2"/>
6315
+ </xsl:when>
6316
+ <xsl:otherwise>
6317
+ <xsl:value-of select=".//*[local-name()='bibdata']//*[local-name()='language']"/>
6318
+ </xsl:otherwise>
6319
+ </xsl:choose>
6320
+ </xsl:otherwise>
6321
+ </xsl:choose>
6322
+ </xsl:variable>
6323
+
6324
+ <xsl:choose>
6325
+ <xsl:when test="$language = 'English'">en</xsl:when>
6326
+ <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
6327
+ </xsl:choose>
6328
+ </xsl:template>
6329
+
6275
6330
  <xsl:template name="capitalizeWords">
6276
6331
  <xsl:param name="str"/>
6277
6332
  <xsl:variable name="str2" select="translate($str, '-', ' ')"/>
@@ -6895,7 +6950,7 @@
6895
6950
  <xsl:template match="*[local-name() = 'figure']" name="figure">
6896
6951
  <xsl:variable name="isAdded" select="@added"/>
6897
6952
  <xsl:variable name="isDeleted" select="@deleted"/>
6898
- <fo:block-container id="{@id}">
6953
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
6899
6954
 
6900
6955
  <xsl:call-template name="setTrackChangesStyles">
6901
6956
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -7881,7 +7936,13 @@
7881
7936
  </xsl:template>
7882
7937
 
7883
7938
  <xsl:template match="text()" mode="contents_item">
7884
- <xsl:call-template name="keep_together_standard_number"/>
7939
+ <xsl:variable name="text">
7940
+ <!-- to split by '_' and other chars -->
7941
+ <text><xsl:call-template name="add-zero-spaces-java"/></text>
7942
+ </xsl:variable>
7943
+ <xsl:for-each select="xalan:nodeset($text)/text/text()">
7944
+ <xsl:call-template name="keep_together_standard_number"/>
7945
+ </xsl:for-each>
7885
7946
  </xsl:template>
7886
7947
 
7887
7948
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
@@ -7892,35 +7953,53 @@
7892
7953
  <!-- =============== -->
7893
7954
  <!-- sourcecode -->
7894
7955
  <!-- =============== -->
7895
- <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
7896
7956
 
7897
- <xsl:variable name="sourcecode_attributes">
7898
- <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
7899
- <xsl:variable name="_font-size">
7957
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
7958
+ <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
7959
+ <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
7900
7960
 
7901
- <!-- 9 -->
7961
+ <xsl:template match="*[local-name() = 'property']" mode="css">
7962
+ <xsl:attribute name="{@name}">
7963
+ <xsl:value-of select="@value"/>
7964
+ </xsl:attribute>
7965
+ </xsl:template>
7902
7966
 
7903
- 9
7904
- <!-- <xsl:if test="$namespace = 'ieee'">
7905
- <xsl:if test="$current_template = 'standard'">8</xsl:if>
7906
- </xsl:if> -->
7967
+ <xsl:template name="get_sourcecode_attributes">
7968
+ <xsl:element name="sourcecode_attributes" use-attribute-sets="sourcecode-style">
7969
+ <xsl:variable name="_font-size">
7907
7970
 
7908
- </xsl:variable>
7971
+ <!-- inherit -->
7909
7972
 
7910
- <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
7911
- <xsl:if test="$font-size != ''">
7912
- <xsl:attribute name="font-size">
7913
- <xsl:choose>
7914
- <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
7915
- <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
7916
- <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
7917
- <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
7918
- </xsl:choose>
7919
- </xsl:attribute>
7920
- </xsl:if>
7921
- </xsl:element>
7973
+ 9
7974
+ <!-- <xsl:if test="$namespace = 'ieee'">
7975
+ <xsl:if test="$current_template = 'standard'">8</xsl:if>
7976
+ </xsl:if> -->
7977
+
7978
+ </xsl:variable>
7979
+
7980
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
7981
+ <xsl:if test="$font-size != ''">
7982
+ <xsl:attribute name="font-size">
7983
+ <xsl:choose>
7984
+ <xsl:when test="$font-size = 'inherit'"><xsl:value-of select="$font-size"/></xsl:when>
7985
+ <xsl:when test="contains($font-size, '%')"><xsl:value-of select="$font-size"/></xsl:when>
7986
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
7987
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
7988
+ </xsl:choose>
7989
+ </xsl:attribute>
7990
+ </xsl:if>
7991
+ <xsl:apply-templates select="$sourcecode_css//class[@name = 'sourcecode']" mode="css"/>
7992
+ </xsl:element>
7993
+ </xsl:template>
7994
+
7995
+ <xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
7996
+
7997
+ <xsl:variable name="sourcecode_attributes">
7998
+ <xsl:call-template name="get_sourcecode_attributes"/>
7922
7999
  </xsl:variable>
7923
8000
 
8001
+ <!-- <xsl:copy-of select="$sourcecode_css"/> -->
8002
+
7924
8003
  <xsl:choose>
7925
8004
  <xsl:when test="$isGenerateTableIF = 'true' and (ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])">
7926
8005
  <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*">
@@ -7974,9 +8053,10 @@
7974
8053
  </xsl:choose>
7975
8054
  </xsl:template>
7976
8055
 
7977
- <xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
8056
+ <xsl:template match="*[local-name()='sourcecode']/text() | *[local-name()='sourcecode']//*[local-name()='span']/text()" priority="2">
7978
8057
  <xsl:choose>
7979
- <xsl:when test="normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
8058
+ <!-- disabled -->
8059
+ <xsl:when test="1 = 2 and normalize-space($syntax-highlight) = 'true' and normalize-space(../@lang) != ''"> <!-- condition for turn on of highlighting -->
7980
8060
  <xsl:variable name="syntax" select="java:org.metanorma.fop.Util.syntaxHighlight(., ../@lang)"/>
7981
8061
  <xsl:choose>
7982
8062
  <xsl:when test="normalize-space($syntax) != ''"><!-- if there is highlighted result -->
@@ -7991,8 +8071,75 @@
7991
8071
  <xsl:call-template name="add_spaces_to_sourcecode"/>
7992
8072
  </xsl:otherwise>
7993
8073
  </xsl:choose>
8074
+ </xsl:template>
8075
+
8076
+ <!-- add sourcecode highlighting -->
8077
+ <xsl:template match="*[local-name()='sourcecode']//*[local-name()='span'][@class]" priority="2">
8078
+ <xsl:variable name="class" select="@class"/>
8079
+ <xsl:choose>
8080
+ <xsl:when test="$sourcecode_css//class[@name = $class]">
8081
+ <fo:inline>
8082
+ <xsl:apply-templates select="$sourcecode_css//class[@name = $class]" mode="css"/>
8083
+ <xsl:apply-templates/>
8084
+ </fo:inline>
8085
+ </xsl:when>
8086
+ <xsl:otherwise>
8087
+ <xsl:apply-templates/>
8088
+ </xsl:otherwise>
8089
+ </xsl:choose>
8090
+ </xsl:template>
7994
8091
 
8092
+ <!-- outer table with line numbers for sourcecode -->
8093
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']" priority="2">
8094
+ <fo:block>
8095
+ <fo:table width="100%" table-layout="fixed">
8096
+ <xsl:copy-of select="@id"/>
8097
+ <fo:table-column column-width="8%"/>
8098
+ <fo:table-column column-width="92%"/>
8099
+ <fo:table-body>
8100
+ <xsl:apply-templates/>
8101
+ </fo:table-body>
8102
+ </fo:table>
8103
+ </fo:block>
7995
8104
  </xsl:template>
8105
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody']" priority="2">
8106
+ <xsl:apply-templates/>
8107
+ </xsl:template>
8108
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']" priority="2">
8109
+ <fo:table-row>
8110
+ <xsl:apply-templates/>
8111
+ </fo:table-row>
8112
+ </xsl:template>
8113
+ <!-- first td with line numbers -->
8114
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2">
8115
+ <fo:table-cell>
8116
+ <fo:block>
8117
+
8118
+ <!-- set attibutes for line numbers - same as sourcecode -->
8119
+ <xsl:variable name="sourcecode_attributes">
8120
+ <xsl:for-each select="following-sibling::*[local-name() = 'td']/*[local-name() = 'sourcecode']">
8121
+ <xsl:call-template name="get_sourcecode_attributes"/>
8122
+ </xsl:for-each>
8123
+ </xsl:variable>
8124
+ <xsl:for-each select="xalan:nodeset($sourcecode_attributes)/sourcecode_attributes/@*[not(starts-with(local-name(), 'margin-') or starts-with(local-name(), 'space-'))]">
8125
+ <xsl:attribute name="{local-name()}">
8126
+ <xsl:value-of select="."/>
8127
+ </xsl:attribute>
8128
+ </xsl:for-each>
8129
+
8130
+ <xsl:apply-templates/>
8131
+ </fo:block>
8132
+ </fo:table-cell>
8133
+ </xsl:template>
8134
+ <!-- second td with sourcecode -->
8135
+ <xsl:template match="*[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2">
8136
+ <fo:table-cell>
8137
+ <fo:block>
8138
+ <xsl:apply-templates/>
8139
+ </fo:block>
8140
+ </fo:table-cell>
8141
+ </xsl:template>
8142
+ <!-- END outer table with line numbers for sourcecode -->
7996
8143
 
7997
8144
  <xsl:template name="add_spaces_to_sourcecode">
7998
8145
  <xsl:variable name="text_step1">
@@ -9685,17 +9832,17 @@
9685
9832
  <fo:block>
9686
9833
  <fo:inline>
9687
9834
 
9688
- <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
9689
- <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
9690
- <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
9691
- </xsl:if>
9692
-
9835
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9836
+ <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
9837
+ </xsl:apply-templates>
9693
9838
  </fo:inline>
9694
9839
  </fo:block>
9695
9840
  </fo:list-item-label>
9696
9841
  <fo:list-item-body start-indent="body-start()">
9697
9842
  <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
9698
- <xsl:call-template name="processBibitem"/>
9843
+ <xsl:call-template name="processBibitem">
9844
+ <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
9845
+ </xsl:call-template>
9699
9846
  </fo:block>
9700
9847
  </fo:list-item-body>
9701
9848
  </fo:list-item>
@@ -9704,168 +9851,56 @@
9704
9851
  </xsl:template> <!-- references[not(@normative='true')]/bibitem -->
9705
9852
 
9706
9853
  <xsl:template name="processBibitem">
9854
+ <xsl:param name="biblio_tag_part">both</xsl:param>
9707
9855
 
9708
- <!-- start JCGM bibitem processing -->
9709
- <xsl:variable name="docidentifier">
9710
- <xsl:choose>
9711
- <xsl:when test="*[local-name()='docidentifier']/@type = 'metanorma'"/>
9712
- <xsl:otherwise><xsl:value-of select="*[local-name()='docidentifier'][not(@type = 'metanorma-ordinal') and not(@type = 'BIPM')]"/></xsl:otherwise>
9713
- </xsl:choose>
9714
- </xsl:variable>
9715
- <xsl:value-of select="$docidentifier"/>
9856
+ <!-- start bibitem processing -->
9857
+ <xsl:if test=".//*[local-name() = 'fn']">
9858
+ <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
9859
+ </xsl:if>
9716
9860
 
9717
- <xsl:if test="*[local-name()='formattedref'] and normalize-space($docidentifier) != ''">, </xsl:if>
9718
- <xsl:apply-templates select="*[local-name()='formattedref']"/>
9861
+ <!-- move opening ace-tag before number -->
9862
+ <xsl:apply-templates select="*[local-name() = 'formattedref']/node()[1][local-name() = 'add' and contains(., '_start')]">
9863
+ <xsl:with-param name="skip">false</xsl:with-param>
9864
+ </xsl:apply-templates>
9719
9865
 
9720
- <!-- end JCGM bibitem processing -->
9866
+ <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9867
+ <xsl:with-param name="biblio_tag_part" select="$biblio_tag_part"/>
9868
+ </xsl:apply-templates>
9869
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
9870
+ <!-- end bibitem processing -->
9721
9871
 
9722
9872
  </xsl:template> <!-- processBibitem (bibitem) -->
9723
9873
 
9724
- <xsl:template name="processBibitemDocId">
9725
- <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
9726
- <xsl:choose>
9727
- <xsl:when test="normalize-space($_doc_ident) != ''">
9728
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
9729
- <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
9730
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
9731
- </xsl:if> -->
9732
- <xsl:value-of select="$_doc_ident"/>
9733
- </xsl:when>
9734
- <xsl:otherwise>
9735
- <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
9736
- <xsl:if test="$type != ''">
9737
- <xsl:value-of select="$type"/><xsl:text> </xsl:text>
9738
- </xsl:if> -->
9739
- <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma') and not(@type = 'metanorma-ordinal')]"/>
9740
- </xsl:otherwise>
9741
- </xsl:choose>
9742
- </xsl:template> <!-- processBibitemDocId -->
9874
+ <xsl:template match="*[local-name() = 'title']" mode="title">
9875
+ <fo:inline><xsl:apply-templates/></fo:inline>
9876
+ </xsl:template>
9877
+
9878
+ <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
9879
+
9880
+ <xsl:template match="*[local-name() = 'formattedref']">
9881
+ <!-- <xsl:if test="$namespace = 'unece' or $namespace = 'unece-rec'">
9882
+ <xsl:text>, </xsl:text>
9883
+ </xsl:if> -->
9884
+ <xsl:apply-templates/>
9885
+ </xsl:template>
9743
9886
 
9744
- <xsl:template name="processPersonalAuthor">
9887
+ <xsl:template match="*[local-name() = 'biblio-tag']">
9888
+ <xsl:param name="biblio_tag_part">both</xsl:param>
9745
9889
  <xsl:choose>
9746
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
9747
- <author>
9748
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
9749
- </author>
9890
+ <xsl:when test="$biblio_tag_part = 'first' and *[local-name() = 'tab']">
9891
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
9750
9892
  </xsl:when>
9751
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
9752
- <author>
9753
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
9754
- <xsl:text> </xsl:text>
9755
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
9756
- </author>
9757
- </xsl:when>
9758
- <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
9759
- <author>
9760
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
9761
- <xsl:text> </xsl:text>
9762
- <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
9763
- </author>
9893
+ <xsl:when test="$biblio_tag_part = 'last'">
9894
+ <xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
9764
9895
  </xsl:when>
9765
9896
  <xsl:otherwise>
9766
9897
  <xsl:apply-templates/>
9767
9898
  </xsl:otherwise>
9768
9899
  </xsl:choose>
9769
- </xsl:template> <!-- processPersonalAuthor -->
9770
-
9771
- <xsl:template name="renderDate">
9772
- <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
9773
- <xsl:value-of select="*[local-name() = 'on']"/>
9774
- </xsl:if>
9775
- <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
9776
- <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
9777
- </xsl:if>
9778
- </xsl:template>
9779
-
9780
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
9781
- <xsl:value-of select="translate(.,'. ','')"/>
9782
- </xsl:template>
9783
-
9784
- <xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
9785
- <xsl:value-of select="substring(.,1,1)"/>
9786
9900
  </xsl:template>
9787
9901
 
9788
- <xsl:template match="*[local-name() = 'title']" mode="title">
9789
- <fo:inline><xsl:apply-templates/></fo:inline>
9790
- </xsl:template>
9791
-
9792
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
9793
- <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
9794
- <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
9795
- <xsl:apply-templates/>
9796
- </fo:inline>
9797
- </xsl:template>
9798
-
9799
- <!-- bibitem/note renders as footnote -->
9800
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
9801
-
9802
- <!-- list of footnotes to calculate actual footnotes number -->
9803
- <xsl:variable name="p_fn_">
9804
- <xsl:call-template name="get_fn_list"/>
9805
- </xsl:variable>
9806
- <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
9807
- <xsl:variable name="gen_id" select="generate-id(.)"/>
9808
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
9809
- <!-- fn sequence number in document -->
9810
- <xsl:variable name="current_fn_number">
9811
- <xsl:choose>
9812
- <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
9813
- <xsl:otherwise>
9814
- <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
9815
- <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
9816
- </xsl:otherwise>
9817
- </xsl:choose>
9818
- </xsl:variable>
9819
- <fo:footnote>
9820
- <xsl:variable name="number">
9821
-
9822
- <xsl:value-of select="$current_fn_number"/>
9823
-
9824
- </xsl:variable>
9825
-
9826
- <xsl:variable name="current_fn_number_text">
9827
- <xsl:value-of select="$number"/>
9828
-
9829
- <xsl:text>)</xsl:text>
9830
-
9831
- </xsl:variable>
9832
-
9833
- <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
9834
- <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
9835
- <xsl:value-of select="$current_fn_number_text"/>
9836
- </fo:basic-link>
9837
- </fo:inline>
9838
- <fo:footnote-body>
9839
- <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
9840
- <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
9841
- <xsl:value-of select="$current_fn_number_text"/>
9842
- </fo:inline>
9843
- <xsl:apply-templates/>
9844
- </fo:block>
9845
- </fo:footnote-body>
9846
- </fo:footnote>
9847
- </xsl:template>
9848
-
9849
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
9850
- <xsl:text> edition </xsl:text>
9851
- <xsl:value-of select="."/>
9852
- </xsl:template>
9853
-
9854
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
9855
- <xsl:text> (</xsl:text>
9856
- <fo:inline xsl:use-attribute-sets="link-style">
9857
- <fo:basic-link external-destination="." fox:alt-text=".">
9858
- <xsl:value-of select="."/>
9859
- </fo:basic-link>
9860
- </fo:inline>
9861
- <xsl:text>)</xsl:text>
9862
- </xsl:template>
9863
-
9864
- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/>
9865
-
9866
- <xsl:template match="*[local-name() = 'formattedref']">
9867
-
9868
- <xsl:apply-templates/>
9902
+ <xsl:template match="*[local-name() = 'biblio-tag']/*[local-name() = 'tab']" priority="2">
9903
+ <xsl:text> </xsl:text>
9869
9904
  </xsl:template>
9870
9905
 
9871
9906
  <!-- ======================= -->
@@ -10299,6 +10334,12 @@
10299
10334
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
10300
10335
  <xsl:apply-templates mode="update_xml_step1"/>
10301
10336
  </xsl:template>
10337
+ <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
10338
+ <xsl:copy>
10339
+ <xsl:copy-of select="@*"/>
10340
+ <xsl:apply-templates mode="update_xml_step1"/>
10341
+ </xsl:copy>
10342
+ </xsl:template>
10302
10343
  <!-- =========================================================================== -->
10303
10344
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10304
10345
  <!-- =========================================================================== -->
@@ -10776,6 +10817,10 @@
10776
10817
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
10777
10818
  </xsl:template>
10778
10819
 
10820
+ <xsl:template name="getDocumentId_fromCurrentNode">
10821
+ <xsl:call-template name="getLang_fromCurrentNode"/><xsl:value-of select=".//*[local-name() = 'p'][1]/@id"/>
10822
+ </xsl:template>
10823
+
10779
10824
  <xsl:template name="namespaceCheck">
10780
10825
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
10781
10826
  <xsl:variable name="XSLNS">
@@ -208,6 +208,24 @@ module IsoDoc
208
208
  elem.children = l10n("[#{@i18n.source} #{to_xml(elem.children).strip}]")
209
209
  end
210
210
 
211
+ def norm_ref_entry_code(_ordinal, identifiers, _ids, _standard, datefn)
212
+ ret = (identifiers[0] || identifiers[1])
213
+ ret += " #{identifiers[1]}" if identifiers[0] && identifiers[1]
214
+ "#{ret}#{datefn} "
215
+ end
216
+
217
+ def biblio_ref_entry_code(ordinal, ids, _id, standard, datefn)
218
+ standard and id = nil
219
+ ret = (ids[:ordinal] || ids[:metanorma] || "[#{ordinal}]")
220
+ if ids[:sdo]
221
+ ret = prefix_bracketed_ref(ret)
222
+ ret += "#{ids[:sdo]}#{datefn} "
223
+ else
224
+ ret = prefix_bracketed_ref("#{ret}#{datefn}")
225
+ end
226
+ ret
227
+ end
228
+
211
229
  include Init
212
230
  end
213
231
  end
@@ -571,6 +571,11 @@
571
571
  <ref name="MultilingualRenderingType"/>
572
572
  </attribute>
573
573
  </optional>
574
+ <optional>
575
+ <attribute name="linenums">
576
+ <data type="boolean"/>
577
+ </attribute>
578
+ </optional>
574
579
  <optional>
575
580
  <ref name="tname"/>
576
581
  </optional>
@@ -1238,6 +1243,11 @@
1238
1243
  </define>
1239
1244
  <define name="concept">
1240
1245
  <element name="concept">
1246
+ <optional>
1247
+ <attribute name="bold">
1248
+ <data type="boolean"/>
1249
+ </attribute>
1250
+ </optional>
1241
1251
  <optional>
1242
1252
  <attribute name="ital">
1243
1253
  <data type="boolean"/>
@@ -2653,7 +2663,7 @@
2653
2663
  <value>full</value>
2654
2664
  <value>short</value>
2655
2665
  <value>id</value>
2656
- <value>modspec</value>
2666
+ <text/>
2657
2667
  </choice>
2658
2668
  </define>
2659
2669
  <define name="erefTypeWithConnective">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module BIPM
3
- VERSION = "2.2.0".freeze
3
+ VERSION = "2.2.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-bipm
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-05 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic