metanorma-bipm 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
 
17
- <xsl:key name="kfn" match="*[local-name()='p']/*[local-name()='fn']" use="@reference"/>
17
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
18
18
 
19
19
 
20
20
 
@@ -586,7 +586,7 @@
586
586
  <xsl:choose>
587
587
  <xsl:when test="ancestor-or-self::*[local-name()='annex'] and $level &gt;= 2">false</xsl:when>
588
588
  <xsl:when test="$section = '' and $type = 'clause'">false</xsl:when>
589
- <xsl:when test="$level &lt;= 3">true</xsl:when>
589
+ <xsl:when test="$level &lt;= $toc_level">true</xsl:when>
590
590
  <xsl:otherwise>false</xsl:otherwise>
591
591
  </xsl:choose>
592
592
  </xsl:variable>
@@ -719,66 +719,12 @@
719
719
  </xsl:if>
720
720
  </xsl:template>
721
721
 
722
-
723
- <!--
724
- <fn reference="1">
725
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
726
- </fn>
727
- -->
728
-
729
- <xsl:variable name="p_fn">
730
- <xsl:for-each select="//*[local-name()='p']/*[local-name()='fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
731
- <!-- copy unique fn -->
732
- <fn gen_id="{generate-id(.)}">
733
- <xsl:copy-of select="@*"/>
734
- <xsl:copy-of select="node()"/>
735
- </fn>
736
- </xsl:for-each>
737
- </xsl:variable>
738
-
739
- <xsl:template match="*[local-name()='p']/*[local-name()='fn']" priority="2">
740
- <xsl:variable name="gen_id" select="generate-id(.)"/>
741
- <xsl:variable name="reference" select="@reference"/>
742
- <xsl:variable name="number">
743
- <xsl:value-of select="count(xalan:nodeset($p_fn)//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
744
- </xsl:variable>
745
- <xsl:choose>
746
- <xsl:when test="xalan:nodeset($p_fn)//fn[@gen_id = $gen_id]">
747
- <fo:footnote>
748
- <fo:inline font-size="80%" keep-with-previous.within-line="always" vertical-align="super">
749
- <fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
750
- <!-- <xsl:value-of select="@reference"/> -->
751
- <xsl:value-of select="$number + count(//*[local-name()='bibitem'][ancestor::*[local-name()='references'][@normative='true']]/*[local-name()='note'])"/><xsl:text>)</xsl:text>
752
- </fo:basic-link>
753
- </fo:inline>
754
- <fo:footnote-body>
755
- <fo:block font-size="10pt" margin-bottom="12pt">
756
- <fo:inline id="footnote_{@reference}_{$number}" keep-with-next.within-line="always" padding-right="3mm"> <!-- font-size="60%" alignment-baseline="hanging" -->
757
- <xsl:value-of select="$number + count(//*[local-name()='bibitem'][ancestor::*[local-name()='references'][@normative='true']]/*[local-name()='note'])"/><xsl:text>)</xsl:text>
758
- </fo:inline>
759
- <xsl:for-each select="*[local-name()='p']">
760
- <xsl:apply-templates/>
761
- </xsl:for-each>
762
- </fo:block>
763
- </fo:footnote-body>
764
- </fo:footnote>
765
- </xsl:when>
766
- <xsl:otherwise>
767
- <fo:inline font-size="60%" keep-with-previous.within-line="always" vertical-align="super">
768
- <fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
769
- <xsl:value-of select="$number + count(//*[local-name()='bibitem']/*[local-name()='note'])"/>
770
- </fo:basic-link>
771
- </fo:inline>
772
- </xsl:otherwise>
773
- </xsl:choose>
774
- </xsl:template>
775
722
 
776
723
  <xsl:template match="*[local-name()='p']/*[local-name()='fn']/*[local-name()='p']">
777
724
  <xsl:apply-templates/>
778
725
  </xsl:template>
779
726
 
780
-
781
-
727
+
782
728
  <xsl:template match="*[local-name()='bibitem']">
783
729
  <fo:block id="{@id}" margin-bottom="6pt"> <!-- 12 pt -->
784
730
  <xsl:variable name="docidentifier">
@@ -839,37 +785,7 @@
839
785
  </fo:footnote>
840
786
  </xsl:template>
841
787
 
842
-
843
- <!--
844
- <fn reference="1">
845
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
846
- </fn>
847
- -->
848
- <xsl:template match="jcgm:title//jcgm:fn | jcgm:name//jcgm:fn | jcgm:p/jcgm:fn[not(ancestor::jcgm:table)] | jcgm:p/*/jcgm:fn[not(ancestor::jcgm:table)] | jcgm:sourcecode/jcgm:fn[not(ancestor::jcgm:table)]" priority="2" name="fn">
849
- <fo:footnote keep-with-previous.within-line="always">
850
- <xsl:variable name="number">
851
- <xsl:number count="jcgm:fn[not(ancestor::jcgm:table)]" level="any"/>
852
- </xsl:variable>
853
- <xsl:variable name="gen_id" select="generate-id()"/>
854
- <xsl:variable name="lang" select="ancestor::jcgm:bipm-standard/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
855
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
856
- <fo:basic-link internal-destination="{$lang}_footnote_{@reference}_{$number}_{$gen_id}" fox:alt-text="footnote {@reference}">
857
- <xsl:value-of select="$number"/>
858
- </fo:basic-link>
859
- </fo:inline>
860
- <fo:footnote-body>
861
- <fo:block font-size="9pt" margin-bottom="12pt" font-weight="normal" text-indent="0" start-indent="0" line-height="124%" text-align="justify">
862
- <fo:inline id="{$lang}_footnote_{@reference}_{$number}_{$gen_id}" keep-with-next.within-line="always" font-size="60%" vertical-align="super" padding-right="1mm"> <!-- baseline-shift="30%" padding-right="3mm" font-size="60%" alignment-baseline="hanging" -->
863
- <xsl:value-of select="$number "/>
864
- </fo:inline>
865
- <xsl:for-each select="jcgm:p">
866
- <xsl:apply-templates/>
867
- </xsl:for-each>
868
- </fo:block>
869
- </fo:footnote-body>
870
- </fo:footnote>
871
- </xsl:template>
872
-
788
+
873
789
  <xsl:template match="jcgm:fn/jcgm:p">
874
790
  <fo:block>
875
791
  <xsl:apply-templates/>
@@ -2660,6 +2576,80 @@
2660
2576
 
2661
2577
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
2662
2578
  <xsl:attribute name="line-height">135%</xsl:attribute>
2579
+ </xsl:attribute-set><xsl:attribute-set name="fn-style">
2580
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2581
+ </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
2582
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2583
+
2584
+ <xsl:attribute name="font-size">65%</xsl:attribute>
2585
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2586
+
2587
+
2588
+
2589
+
2590
+
2591
+
2592
+
2593
+
2594
+
2595
+
2596
+
2597
+
2598
+
2599
+
2600
+
2601
+
2602
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
2603
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2604
+ <xsl:attribute name="font-style">normal</xsl:attribute>
2605
+ <xsl:attribute name="text-indent">0</xsl:attribute>
2606
+ <xsl:attribute name="start-indent">0</xsl:attribute>
2607
+
2608
+
2609
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
2610
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2611
+ <xsl:attribute name="line-height">124%</xsl:attribute>
2612
+ <xsl:attribute name="text-align">justify</xsl:attribute>
2613
+
2614
+
2615
+
2616
+
2617
+
2618
+
2619
+
2620
+
2621
+
2622
+
2623
+
2624
+
2625
+
2626
+
2627
+
2628
+
2629
+
2630
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
2631
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
2632
+
2633
+ <xsl:attribute name="font-size">60%</xsl:attribute>
2634
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2635
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
2636
+
2637
+
2638
+
2639
+
2640
+
2641
+
2642
+
2643
+
2644
+
2645
+
2646
+
2647
+
2648
+
2649
+
2650
+
2651
+
2652
+
2663
2653
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
2664
2654
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2665
2655
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -3701,6 +3691,102 @@
3701
3691
 
3702
3692
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
3703
3693
  <xsl:apply-templates/>
3694
+ </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
3695
+
3696
+ <!-- list of footnotes to calculate actual footnotes number -->
3697
+ <xsl:variable name="p_fn_">
3698
+ <xsl:choose>
3699
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
3700
+ <fn gen_id="{generate-id(.)}">
3701
+ <xsl:copy-of select="@*"/>
3702
+ <xsl:copy-of select="node()"/>
3703
+ </fn>
3704
+ </xsl:when>
3705
+ <xsl:otherwise>
3706
+ <!-- itetation for:
3707
+ footnotes in bibdata/title
3708
+ footnotes in bibliography
3709
+ footnotes in document's body (except table's head/body/foot and figure text)
3710
+ -->
3711
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
3712
+ <fn gen_id="{generate-id(.)}">
3713
+ <xsl:copy-of select="@*"/>
3714
+ <xsl:copy-of select="node()"/>
3715
+ </fn>
3716
+ </xsl:for-each>
3717
+ <xsl:for-each select="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']/*">
3718
+ <xsl:sort select="@displayorder" data-type="number"/>
3719
+ <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])]">
3720
+ <!-- copy unique fn -->
3721
+ <fn gen_id="{generate-id(.)}">
3722
+ <xsl:copy-of select="@*"/>
3723
+ <xsl:copy-of select="node()"/>
3724
+ </fn>
3725
+ </xsl:for-each>
3726
+ </xsl:for-each>
3727
+ </xsl:otherwise>
3728
+ </xsl:choose>
3729
+ </xsl:variable>
3730
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3731
+
3732
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
3733
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
3734
+ <xsl:variable name="reference" select="@reference"/>
3735
+ <!-- fn sequence number in document -->
3736
+ <xsl:variable name="current_fn_number">
3737
+ <xsl:choose>
3738
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
3739
+ <xsl:otherwise>
3740
+ <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
3741
+ </xsl:otherwise>
3742
+ </xsl:choose>
3743
+ </xsl:variable>
3744
+ <xsl:variable name="current_fn_number_text">
3745
+ <xsl:value-of select="$current_fn_number"/>
3746
+
3747
+
3748
+ </xsl:variable>
3749
+
3750
+ <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3751
+ <xsl:variable name="footnote_inline">
3752
+ <fo:inline xsl:use-attribute-sets="fn-num-style">
3753
+
3754
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3755
+ <xsl:value-of select="$current_fn_number_text"/>
3756
+ </fo:basic-link>
3757
+ </fo:inline>
3758
+ </xsl:variable>
3759
+ <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
3760
+ gen_id=<xsl:value-of select="$gen_id"/> -->
3761
+ <xsl:choose>
3762
+ <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
3763
+ <xsl:copy-of select="$footnote_inline"/>
3764
+ </xsl:when>
3765
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
3766
+ <fo:footnote xsl:use-attribute-sets="fn-style">
3767
+ <xsl:copy-of select="$footnote_inline"/>
3768
+ <fo:footnote-body>
3769
+
3770
+ <fo:block-container text-indent="0" start-indent="0">
3771
+
3772
+
3773
+ <fo:block xsl:use-attribute-sets="fn-body-style">
3774
+
3775
+
3776
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3777
+
3778
+ <xsl:value-of select="$current_fn_number_text"/>
3779
+ </fo:inline>
3780
+ <xsl:apply-templates/>
3781
+ </fo:block>
3782
+ </fo:block-container>
3783
+ </fo:footnote-body>
3784
+ </fo:footnote>
3785
+ </xsl:when>
3786
+ <xsl:otherwise>
3787
+ <xsl:copy-of select="$footnote_inline"/>
3788
+ </xsl:otherwise>
3789
+ </xsl:choose>
3704
3790
  </xsl:template><xsl:template name="fn_display">
3705
3791
  <xsl:variable name="references">
3706
3792
 
@@ -3902,6 +3988,8 @@
3902
3988
 
3903
3989
  </fo:basic-link>
3904
3990
  </fo:inline>
3991
+ </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
3992
+ <fo:inline><xsl:value-of select="."/></fo:inline>
3905
3993
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
3906
3994
  <fo:inline>
3907
3995
  <xsl:apply-templates/>
@@ -4908,22 +4996,6 @@
4908
4996
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
4909
4997
  <xsl:apply-templates/>
4910
4998
  </fo:inline>
4911
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
4912
- <xsl:variable name="title-modified">
4913
-
4914
- <xsl:call-template name="getLocalizedString">
4915
- <xsl:with-param name="key">modified</xsl:with-param>
4916
- </xsl:call-template>
4917
-
4918
-
4919
- </xsl:variable>
4920
-
4921
- <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4922
- <xsl:choose>
4923
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
4924
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
4925
- </xsl:choose>
4926
- <xsl:apply-templates/>
4927
4999
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
4928
5000
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
4929
5001
 
@@ -6162,60 +6234,69 @@
6162
6234
  <xsl:variable name="termsource_text">
6163
6235
  <xsl:apply-templates/>
6164
6236
  </xsl:variable>
6165
-
6166
- <xsl:choose>
6237
+ <xsl:copy-of select="$termsource_text"/>
6238
+ <!-- <xsl:choose>
6167
6239
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
6168
- <!-- <xsl:apply-templates /> -->
6169
6240
  <xsl:copy-of select="$termsource_text"/>
6170
6241
  </xsl:when>
6171
6242
  <xsl:otherwise>
6172
-
6173
-
6243
+ <xsl:if test="$namespace = 'bsi'">
6244
+ <xsl:choose>
6245
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
6246
+ <xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
6247
+ </xsl:choose>
6248
+ </xsl:if>
6249
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
6174
6250
  <xsl:text>[</xsl:text>
6175
-
6176
- <!-- <xsl:apply-templates /> -->
6251
+ </xsl:if>
6177
6252
  <xsl:copy-of select="$termsource_text"/>
6178
-
6179
-
6253
+ <xsl:if test="$namespace = 'bsi'">
6254
+ <xsl:choose>
6255
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
6256
+ <xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
6257
+ </xsl:choose>
6258
+ </xsl:if>
6259
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
6180
6260
  <xsl:text>]</xsl:text>
6181
-
6261
+ </xsl:if>
6182
6262
  </xsl:otherwise>
6183
- </xsl:choose>
6263
+ </xsl:choose> -->
6184
6264
  </fo:block>
6185
6265
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
6186
6266
  <xsl:if test="normalize-space() != ''">
6187
6267
  <xsl:value-of select="."/>
6188
6268
  </xsl:if>
6189
- </xsl:template><xsl:variable name="localized.source">
6190
- <xsl:call-template name="getLocalizedString">
6191
- <xsl:with-param name="key">source</xsl:with-param>
6192
- </xsl:call-template>
6193
- </xsl:variable><xsl:template match="*[local-name() = 'origin']">
6269
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
6270
+ <fo:inline>
6271
+
6272
+
6273
+ <xsl:value-of select="."/>
6274
+ </fo:inline>
6275
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
6194
6276
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6195
6277
  <xsl:if test="normalize-space(@citeas) = ''">
6196
6278
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
6197
6279
  </xsl:if>
6198
-
6199
-
6200
- <fo:inline>
6201
-
6202
-
6203
-
6204
-
6205
-
6206
-
6207
- <xsl:value-of select="$localized.source"/>
6208
- <xsl:text> </xsl:text>
6209
-
6210
-
6211
-
6212
- </fo:inline>
6213
-
6214
6280
  <fo:inline xsl:use-attribute-sets="origin-style">
6215
6281
  <xsl:apply-templates/>
6216
6282
  </fo:inline>
6283
+ </fo:basic-link>
6284
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
6285
+ <xsl:variable name="title-modified">
6217
6286
 
6218
- </fo:basic-link>
6287
+ <xsl:call-template name="getLocalizedString">
6288
+ <xsl:with-param name="key">modified</xsl:with-param>
6289
+ </xsl:call-template>
6290
+
6291
+
6292
+ </xsl:variable>
6293
+
6294
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
6295
+ <xsl:choose>
6296
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
6297
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
6298
+ </xsl:choose>
6299
+ <xsl:apply-templates/>
6219
6300
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
6220
6301
  <fo:inline><xsl:apply-templates/></fo:inline>
6221
6302
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
@@ -6832,7 +6913,31 @@
6832
6913
  <fo:block-container border="1pt solid black" width="50%">
6833
6914
  <fo:block> </fo:block>
6834
6915
  </fo:block-container>
6835
- </xsl:template><xsl:template match="*[local-name() = 'toc']">
6916
+ </xsl:template><xsl:variable name="toc_level">
6917
+ <xsl:choose>
6918
+ <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
6919
+ <xsl:otherwise><!-- default value -->
6920
+
6921
+
6922
+
6923
+
6924
+
6925
+
6926
+
6927
+
6928
+ 3
6929
+
6930
+
6931
+
6932
+
6933
+
6934
+
6935
+
6936
+
6937
+
6938
+ </xsl:otherwise>
6939
+ </xsl:choose>
6940
+ </xsl:variable><xsl:template match="*[local-name() = 'toc']">
6836
6941
  <xsl:param name="colwidths"/>
6837
6942
  <xsl:variable name="colwidths_">
6838
6943
  <xsl:choose>
@@ -7469,4 +7574,14 @@
7469
7574
  </xsl:otherwise>
7470
7575
  </xsl:choose>
7471
7576
  </xsl:if>
7577
+ </xsl:template><xsl:template name="setAltText">
7578
+ <xsl:param name="value"/>
7579
+ <xsl:attribute name="fox:alt-text">
7580
+ <xsl:choose>
7581
+ <xsl:when test="normalize-space($value) != ''">
7582
+ <xsl:value-of select="$value"/>
7583
+ </xsl:when>
7584
+ <xsl:otherwise>_</xsl:otherwise>
7585
+ </xsl:choose>
7586
+ </xsl:attribute>
7472
7587
  </xsl:template></xsl:stylesheet>
@@ -71,11 +71,11 @@ module IsoDoc
71
71
  unless name = node.at(ns("./#{elem}[not(@type = 'quoted')]"))
72
72
  return if node.at(ns("./#{elem}[@type = 'quoted']"))
73
73
 
74
- node.children.empty? and node.add_child("<#{elem}></#{elem}>") or
74
+ (node.children.empty? and node.add_child("<#{elem}></#{elem}>")) or
75
75
  node.children.first.previous = "<#{elem}></#{elem}>"
76
76
  name = node.children.first
77
77
  end
78
- if name.children.empty? then name.add_child(number)
78
+ if name.children.empty? then name.add_child(cleanup_entities(number))
79
79
  else (name.children.first.previous = "#{number}#{delim}")
80
80
  end
81
81
  end
@@ -250,6 +250,12 @@ module IsoDoc
250
250
  end
251
251
  end
252
252
 
253
+ def termsource1(elem)
254
+ while elem&.next_element&.name == "termsource"
255
+ elem << "; #{elem.next_element.remove.children.to_xml}"
256
+ end
257
+ elem.children = l10n("[#{@i18n.source} #{elem.children.to_xml.strip}]")
258
+ end
253
259
  include Init
254
260
  end
255
261
  end
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module BIPM
3
- VERSION = "1.2.3".freeze
3
+ VERSION = "1.2.4".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: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-29 00:00:00.000000000 Z
11
+ date: 2021-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  - !ruby/object:Gem::Version
272
272
  version: '0'
273
273
  requirements: []
274
- rubygems_version: 3.2.22
274
+ rubygems_version: 3.2.32
275
275
  signing_key:
276
276
  specification_version: 4
277
277
  summary: metanorma-bipm lets you write BIPM standards in Metanorma.