metanorma-bipm 2.2.8 → 2.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,4 @@
1
1
  <nav>
2
- <h1 id="content">{{ labels["table_of_contents"] }}</h1>
3
2
  <div id="toc"></div>
4
3
 
5
4
  </nav>
@@ -1145,21 +1145,25 @@
1145
1145
  <!-- =================== -->
1146
1146
 
1147
1147
  <xsl:template match="jcgm:xref" priority="2">
1148
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
1149
- <xsl:choose>
1150
- <xsl:when test="@pagenumber='true'">
1151
- <fo:inline>
1152
- <xsl:if test="@id">
1153
- <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
1154
- </xsl:if>
1155
- <fo:page-number-citation ref-id="{@target}"/>
1156
- </fo:inline>
1157
- </xsl:when>
1158
- <xsl:otherwise>
1159
- <fo:inline><xsl:apply-templates/></fo:inline>
1160
- </xsl:otherwise>
1161
- </xsl:choose>
1162
- </fo:basic-link>
1148
+ <xsl:call-template name="insert_basic_link">
1149
+ <xsl:with-param name="element">
1150
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
1151
+ <xsl:choose>
1152
+ <xsl:when test="@pagenumber='true'">
1153
+ <fo:inline>
1154
+ <xsl:if test="@id">
1155
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
1156
+ </xsl:if>
1157
+ <fo:page-number-citation ref-id="{@target}"/>
1158
+ </fo:inline>
1159
+ </xsl:when>
1160
+ <xsl:otherwise>
1161
+ <fo:inline><xsl:apply-templates/></fo:inline>
1162
+ </xsl:otherwise>
1163
+ </xsl:choose>
1164
+ </fo:basic-link>
1165
+ </xsl:with-param>
1166
+ </xsl:call-template>
1163
1167
  </xsl:template>
1164
1168
 
1165
1169
  <!-- =================== -->
@@ -2416,6 +2420,7 @@
2416
2420
  </xsl:attribute-set>
2417
2421
 
2418
2422
  <xsl:attribute-set name="xref-style">
2423
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
2419
2424
 
2420
2425
  <xsl:attribute name="color">blue</xsl:attribute>
2421
2426
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -4476,9 +4481,13 @@
4476
4481
  <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4477
4482
  </xsl:if>
4478
4483
 
4479
- <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4480
- <xsl:value-of select="$current_fn_number_text"/>
4481
- </fo:basic-link>
4484
+ <xsl:call-template name="insert_basic_link">
4485
+ <xsl:with-param name="element">
4486
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4487
+ <xsl:value-of select="$current_fn_number_text"/>
4488
+ </fo:basic-link>
4489
+ </xsl:with-param>
4490
+ </xsl:call-template>
4482
4491
  </fo:inline>
4483
4492
  </xsl:variable>
4484
4493
 
@@ -4820,8 +4829,10 @@
4820
4829
  <xsl:apply-templates select="preceding-sibling::*[1][local-name() = 'p' and @keep-with-next = 'true']/node()"/>
4821
4830
  <xsl:text> </xsl:text>
4822
4831
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
4823
- <xsl:text/>
4824
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
4832
+ <xsl:if test="*[local-name()='dd']/node()[normalize-space() != ''][1][self::text()]">
4833
+ <xsl:text> </xsl:text>
4834
+ </xsl:if>
4835
+ <xsl:apply-templates select="*[local-name()='dd']/node()" mode="inline"/>
4825
4836
  </fo:block>
4826
4837
 
4827
4838
  </xsl:when> <!-- END: only one component -->
@@ -5318,8 +5329,18 @@
5318
5329
  </xsl:if>
5319
5330
  </xsl:template>
5320
5331
 
5321
- <xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
5322
- <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
5332
+ <xsl:template match="*[local-name()='dd']/*" mode="inline">
5333
+ <xsl:variable name="is_inline_element_after_where">
5334
+ <xsl:if test="(local-name() = 'p') and not(preceding-sibling::node()[normalize-space() != ''])">true</xsl:if>
5335
+ </xsl:variable>
5336
+ <xsl:choose>
5337
+ <xsl:when test="$is_inline_element_after_where = 'true'">
5338
+ <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
5339
+ </xsl:when>
5340
+ <xsl:otherwise>
5341
+ <xsl:apply-templates select="."/>
5342
+ </xsl:otherwise>
5343
+ </xsl:choose>
5323
5344
  </xsl:template>
5324
5345
 
5325
5346
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
@@ -6757,6 +6778,79 @@
6757
6778
  <xsl:value-of select="."/><xsl:value-of select="$zero_width_space"/>
6758
6779
  </xsl:template>
6759
6780
 
6781
+ <!-- special case for:
6782
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
6783
+ <mstyle displaystyle="true">
6784
+ <msup>
6785
+ <mi color="#00000000">C</mi>
6786
+ <mtext>R</mtext>
6787
+ </msup>
6788
+ <msubsup>
6789
+ <mtext>C</mtext>
6790
+ <mi>n</mi>
6791
+ <mi>k</mi>
6792
+ </msubsup>
6793
+ </mstyle>
6794
+ </math>
6795
+ -->
6796
+ <xsl:template match="mathml:msup/mathml:mi[. = '‌' or . = ''][not(preceding-sibling::*)][following-sibling::mathml:mtext]" mode="mathml">
6797
+ <xsl:copy>
6798
+ <xsl:copy-of select="@*"/>
6799
+ <xsl:variable name="next_mtext" select="ancestor::mathml:msup/following-sibling::*[1][self::mathml:msubsup or self::mathml:msub or self::mathml:msup]/mathml:mtext"/>
6800
+ <xsl:if test="string-length($next_mtext) != ''">
6801
+ <xsl:attribute name="color">#00000000</xsl:attribute>
6802
+ </xsl:if>
6803
+ <xsl:apply-templates/>
6804
+ <xsl:value-of select="$next_mtext"/>
6805
+ </xsl:copy>
6806
+ </xsl:template>
6807
+
6808
+ <!-- special case for:
6809
+ <msup>
6810
+ <mtext/>
6811
+ <mn>1</mn>
6812
+ </msup>
6813
+ convert to (add mspace after mtext and enclose them into mrow):
6814
+ <msup>
6815
+ <mrow>
6816
+ <mtext/>
6817
+ <mspace height="1.47ex"/>
6818
+ </mrow>
6819
+ <mn>1</mn>
6820
+ </msup>
6821
+ -->
6822
+ <xsl:template match="mathml:msup/mathml:mtext[not(preceding-sibling::*)]" mode="mathml">
6823
+ <mathml:mrow>
6824
+ <xsl:copy-of select="."/>
6825
+ <mathml:mspace height="1.47ex"/>
6826
+ </mathml:mrow>
6827
+ </xsl:template>
6828
+
6829
+ <!-- add space around vertical line -->
6830
+ <xsl:template match="mathml:mo[normalize-space(text()) = '|']" mode="mathml">
6831
+ <xsl:copy>
6832
+ <xsl:apply-templates select="@*" mode="mathml"/>
6833
+ <xsl:if test="not(@lspace)">
6834
+ <xsl:attribute name="lspace">0.4em</xsl:attribute>
6835
+ </xsl:if>
6836
+ <xsl:if test="not(@rspace)">
6837
+ <xsl:attribute name="rspace">0.4em</xsl:attribute>
6838
+ </xsl:if>
6839
+ <xsl:apply-templates mode="mathml"/>
6840
+ </xsl:copy>
6841
+ </xsl:template>
6842
+
6843
+ <!-- decrease fontsize for 'Circled Times' char -->
6844
+ <xsl:template match="mathml:mo[normalize-space(text()) = '⊗']" mode="mathml">
6845
+ <xsl:copy>
6846
+ <xsl:apply-templates select="@*" mode="mathml"/>
6847
+ <xsl:if test="not(@fontsize)">
6848
+ <xsl:attribute name="fontsize">55%</xsl:attribute>
6849
+ </xsl:if>
6850
+ <xsl:apply-templates mode="mathml"/>
6851
+ </xsl:copy>
6852
+ </xsl:template>
6853
+
6760
6854
  <!-- Examples:
6761
6855
  <stem type="AsciiMath">x = 1</stem>
6762
6856
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6814,19 +6908,23 @@
6814
6908
  <xsl:apply-templates/>
6815
6909
  </xsl:when>
6816
6910
  <xsl:otherwise>
6817
- <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6818
- <xsl:choose>
6819
- <xsl:when test="normalize-space(.) = ''">
6820
- <xsl:call-template name="add-zero-spaces-link-java">
6821
- <xsl:with-param name="text" select="$target_text"/>
6822
- </xsl:call-template>
6823
- </xsl:when>
6824
- <xsl:otherwise>
6825
- <!-- output text from <link>text</link> -->
6826
- <xsl:apply-templates/>
6827
- </xsl:otherwise>
6828
- </xsl:choose>
6829
- </fo:basic-link>
6911
+ <xsl:call-template name="insert_basic_link">
6912
+ <xsl:with-param name="element">
6913
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
6914
+ <xsl:choose>
6915
+ <xsl:when test="normalize-space(.) = ''">
6916
+ <xsl:call-template name="add-zero-spaces-link-java">
6917
+ <xsl:with-param name="text" select="$target_text"/>
6918
+ </xsl:call-template>
6919
+ </xsl:when>
6920
+ <xsl:otherwise>
6921
+ <!-- output text from <link>text</link> -->
6922
+ <xsl:apply-templates/>
6923
+ </xsl:otherwise>
6924
+ </xsl:choose>
6925
+ </fo:basic-link>
6926
+ </xsl:with-param>
6927
+ </xsl:call-template>
6830
6928
  </xsl:otherwise>
6831
6929
  </xsl:choose>
6832
6930
  </fo:inline>
@@ -6889,12 +6987,16 @@
6889
6987
  </xsl:template>
6890
6988
 
6891
6989
  <xsl:template match="*[local-name() = 'xref']">
6892
- <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6893
- <xsl:if test="parent::*[local-name() = 'add']">
6894
- <xsl:call-template name="append_add-style"/>
6895
- </xsl:if>
6896
- <xsl:apply-templates/>
6897
- </fo:basic-link>
6990
+ <xsl:call-template name="insert_basic_link">
6991
+ <xsl:with-param name="element">
6992
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6993
+ <xsl:if test="parent::*[local-name() = 'add']">
6994
+ <xsl:call-template name="append_add-style"/>
6995
+ </xsl:if>
6996
+ <xsl:apply-templates/>
6997
+ </fo:basic-link>
6998
+ </xsl:with-param>
6999
+ </xsl:call-template>
6898
7000
  </xsl:template>
6899
7001
 
6900
7002
  <!-- ====== -->
@@ -7277,7 +7379,7 @@
7277
7379
  <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
7278
7380
  </xsl:when>
7279
7381
  <xsl:when test="not(starts-with(@src, 'data:'))">
7280
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
7382
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7281
7383
  </xsl:when>
7282
7384
  <xsl:otherwise>
7283
7385
  <xsl:value-of select="@src"/>
@@ -7299,7 +7401,7 @@
7299
7401
  </xsl:when>
7300
7402
  <xsl:when test="not(starts-with(@src, 'data:'))">
7301
7403
  <xsl:variable name="src">
7302
- <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
7404
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7303
7405
  </xsl:variable>
7304
7406
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7305
7407
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -7685,15 +7787,19 @@
7685
7787
  <xsl:param name="dest"/>
7686
7788
  <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
7687
7789
  <fo:block font-size="1pt">
7688
- <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
7689
- <fo:inline-container inline-progression-dimension="100%">
7690
- <fo:block-container height="{$height - 1}px" width="100%">
7691
- <!-- DEBUG <xsl:if test="local-name()='polygon'">
7692
- <xsl:attribute name="background-color">magenta</xsl:attribute>
7693
- </xsl:if> -->
7694
- <fo:block> </fo:block></fo:block-container>
7695
- </fo:inline-container>
7696
- </fo:basic-link>
7790
+ <xsl:call-template name="insert_basic_link">
7791
+ <xsl:with-param name="element">
7792
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
7793
+ <fo:inline-container inline-progression-dimension="100%">
7794
+ <fo:block-container height="{$height - 1}px" width="100%">
7795
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
7796
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
7797
+ </xsl:if> -->
7798
+ <fo:block> </fo:block></fo:block-container>
7799
+ </fo:inline-container>
7800
+ </fo:basic-link>
7801
+ </xsl:with-param>
7802
+ </xsl:call-template>
7697
7803
  </fo:block>
7698
7804
  </fo:block-container>
7699
7805
  </xsl:template>
@@ -9243,14 +9349,18 @@
9243
9349
  </xsl:template>
9244
9350
 
9245
9351
  <xsl:template match="*[local-name() = 'origin']">
9246
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9247
- <xsl:if test="normalize-space(@citeas) = ''">
9248
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9249
- </xsl:if>
9250
- <fo:inline xsl:use-attribute-sets="origin-style">
9251
- <xsl:apply-templates/>
9252
- </fo:inline>
9253
- </fo:basic-link>
9352
+ <xsl:call-template name="insert_basic_link">
9353
+ <xsl:with-param name="element">
9354
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9355
+ <xsl:if test="normalize-space(@citeas) = ''">
9356
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9357
+ </xsl:if>
9358
+ <fo:inline xsl:use-attribute-sets="origin-style">
9359
+ <xsl:apply-templates/>
9360
+ </fo:inline>
9361
+ </fo:basic-link>
9362
+ </xsl:with-param>
9363
+ </xsl:call-template>
9254
9364
  </xsl:template>
9255
9365
 
9256
9366
  <!-- not using, see https://github.com/glossarist/iev-document/issues/23 -->
@@ -9334,9 +9444,13 @@
9334
9444
  <xsl:if test="../*[local-name() = 'author']">
9335
9445
  <xsl:text>, </xsl:text>
9336
9446
  </xsl:if>
9337
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9338
- <xsl:apply-templates/>
9339
- </fo:basic-link>
9447
+ <xsl:call-template name="insert_basic_link">
9448
+ <xsl:with-param name="element">
9449
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
9450
+ <xsl:apply-templates/>
9451
+ </fo:basic-link>
9452
+ </xsl:with-param>
9453
+ </xsl:call-template>
9340
9454
  </xsl:template>
9341
9455
 
9342
9456
  <xsl:template match="*[local-name() = 'author']">
@@ -9385,25 +9499,29 @@
9385
9499
  <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
9386
9500
  <xsl:variable name="text" select="normalize-space()"/>
9387
9501
 
9388
- <fo:basic-link fox:alt-text="{@citeas}">
9389
- <xsl:if test="normalize-space(@citeas) = ''">
9390
- <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
9391
- </xsl:if>
9392
- <xsl:if test="@type = 'inline'">
9502
+ <xsl:call-template name="insert_basic_link">
9503
+ <xsl:with-param name="element">
9504
+ <fo:basic-link fox:alt-text="{@citeas}">
9505
+ <xsl:if test="normalize-space(@citeas) = ''">
9506
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
9507
+ </xsl:if>
9508
+ <xsl:if test="@type = 'inline'">
9393
9509
 
9394
- </xsl:if>
9510
+ </xsl:if>
9395
9511
 
9396
- <xsl:choose>
9397
- <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
9398
- <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
9399
- </xsl:when>
9400
- <xsl:otherwise>
9401
- <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9402
- </xsl:otherwise>
9403
- </xsl:choose>
9512
+ <xsl:choose>
9513
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
9514
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
9515
+ </xsl:when>
9516
+ <xsl:otherwise>
9517
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
9518
+ </xsl:otherwise>
9519
+ </xsl:choose>
9404
9520
 
9405
- <xsl:apply-templates/>
9406
- </fo:basic-link>
9521
+ <xsl:apply-templates/>
9522
+ </fo:basic-link>
9523
+ </xsl:with-param>
9524
+ </xsl:call-template>
9407
9525
 
9408
9526
  </fo:inline>
9409
9527
  </xsl:when>
@@ -9645,13 +9763,14 @@
9645
9763
  <label level="2">−</label><!-- minus sign -->
9646
9764
  <label level="3" font-size="75%">o</label> <!-- white circle -->
9647
9765
 
9648
- <label>-</label> <!-- full-width hyphen minus -->
9649
-
9650
9766
  </xsl:variable>
9651
9767
  <xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/>
9652
9768
 
9653
9769
  <xsl:template name="setULLabel">
9654
- <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9770
+ <xsl:variable name="list_level__">
9771
+ <xsl:value-of select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
9772
+ </xsl:variable>
9773
+ <xsl:variable name="list_level_" select="number($list_level__)"/>
9655
9774
  <xsl:variable name="list_level">
9656
9775
  <xsl:choose>
9657
9776
  <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
@@ -9784,9 +9903,11 @@
9784
9903
  </fo:block-container>
9785
9904
  </xsl:when>
9786
9905
  <xsl:otherwise>
9787
- <fo:block>
9788
- <xsl:apply-templates select="." mode="list"/>
9789
- </fo:block>
9906
+
9907
+ <fo:block>
9908
+ <xsl:apply-templates select="." mode="list"/>
9909
+ </fo:block>
9910
+
9790
9911
  </xsl:otherwise>
9791
9912
  </xsl:choose>
9792
9913
  </xsl:template>
@@ -10475,24 +10596,32 @@
10475
10596
  <xsl:for-each select="*[local-name() = 'tab']">
10476
10597
  <xsl:variable name="current_id" select="generate-id()"/>
10477
10598
  <fo:table-cell>
10478
- <fo:block>
10479
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10480
- <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
10481
- <xsl:choose>
10482
- <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
10483
- <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
10484
- </xsl:choose>
10485
- </xsl:for-each>
10486
- </fo:basic-link>
10599
+ <fo:block line-height-shift-adjustment="disregard-shifts">
10600
+ <xsl:call-template name="insert_basic_link">
10601
+ <xsl:with-param name="element">
10602
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10603
+ <xsl:for-each select="following-sibling::node()[not(self::*[local-name() = 'tab']) and preceding-sibling::*[local-name() = 'tab'][1][generate-id() = $current_id]]">
10604
+ <xsl:choose>
10605
+ <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
10606
+ <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
10607
+ </xsl:choose>
10608
+ </xsl:for-each>
10609
+ </fo:basic-link>
10610
+ </xsl:with-param>
10611
+ </xsl:call-template>
10487
10612
  </fo:block>
10488
10613
  </fo:table-cell>
10489
10614
  </xsl:for-each>
10490
10615
  <!-- last column - for page numbers -->
10491
10616
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
10492
10617
  <fo:block>
10493
- <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10494
- <fo:page-number-citation ref-id="{$target}"/>
10495
- </fo:basic-link>
10618
+ <xsl:call-template name="insert_basic_link">
10619
+ <xsl:with-param name="element">
10620
+ <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
10621
+ <fo:page-number-citation ref-id="{$target}"/>
10622
+ </fo:basic-link>
10623
+ </xsl:with-param>
10624
+ </xsl:call-template>
10496
10625
  </fo:block>
10497
10626
  </fo:table-cell>
10498
10627
  </xsl:template>
@@ -10534,6 +10663,27 @@
10534
10663
  <!-- End Table of Contents (ToC) processing -->
10535
10664
  <!-- =================== -->
10536
10665
 
10666
+ <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
10667
+ <xsl:template name="insert_basic_link">
10668
+ <xsl:param name="element"/>
10669
+ <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
10670
+ <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
10671
+ <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
10672
+ <xsl:choose>
10673
+ <xsl:when test="$external-destination = 'true' or $internal-destination = 'true'">
10674
+ <xsl:copy-of select="$element_node"/>
10675
+ </xsl:when>
10676
+ <xsl:otherwise>
10677
+ <fo:inline>
10678
+ <xsl:for-each select="$element_node/fo:basic-link/@*[local-name() != 'external-destination' and local-name() != 'internal-destination' and local-name() != 'alt-text']">
10679
+ <xsl:attribute name="{local-name()}"><xsl:value-of select="."/></xsl:attribute>
10680
+ </xsl:for-each>
10681
+ <xsl:copy-of select="$element_node/fo:basic-link/node()"/>
10682
+ </fo:inline>
10683
+ </xsl:otherwise>
10684
+ </xsl:choose>
10685
+ </xsl:template>
10686
+
10537
10687
  <xsl:template match="*[local-name() = 'variant-title']"/> <!-- [@type = 'sub'] -->
10538
10688
  <xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
10539
10689
  <fo:inline padding-right="5mm"> </fo:inline>
@@ -1,6 +1,7 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/bipm" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar ns='https://www.metanorma.org/ns/bipm' xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!--
4
+ VERSION v1.2.1
4
5
  Currently we inherit from a namespaced grammar, isostandard. Until we inherit from isodoc,
5
6
  we cannot have a new default namespace: we will end up with a grammar with two different
6
7
  namespaces, one for isostandard and one for csand additions. And we do not want that.
@@ -196,13 +197,7 @@
196
197
  </include>
197
198
  <define name="bipm-standard">
198
199
  <element name="bipm-standard">
199
- <attribute name="version"/>
200
- <attribute name="type">
201
- <choice>
202
- <value>semantic</value>
203
- <value>presentation</value>
204
- </choice>
205
- </attribute>
200
+ <ref name="Root-Attributes"/>
206
201
  <ref name="bibdata"/>
207
202
  <zeroOrMore>
208
203
  <ref name="termdocsource"/>
@@ -17,6 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
+ <!-- VERSION v1.2.1 -->
20
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
22
  <include href="reqt.rng"/>
22
23
  <include href="basicdoc.rng">
@@ -1349,15 +1350,19 @@
1349
1350
  </choice>
1350
1351
  </element>
1351
1352
  </define>
1353
+ <define name="Root-Attributes">
1354
+ <attribute name="version"/>
1355
+ <attribute name="schema-version"/>
1356
+ <attribute name="type">
1357
+ <choice>
1358
+ <value>semantic</value>
1359
+ <value>presentation</value>
1360
+ </choice>
1361
+ </attribute>
1362
+ </define>
1352
1363
  <define name="standard-document">
1353
1364
  <element name="standard-document">
1354
- <attribute name="version"/>
1355
- <attribute name="type">
1356
- <choice>
1357
- <value>semantic</value>
1358
- <value>presentation</value>
1359
- </choice>
1360
- </attribute>
1365
+ <ref name="Root-Attributes"/>
1361
1366
  <ref name="bibdata"/>
1362
1367
  <optional>
1363
1368
  <ref name="misccontainer"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module BIPM
3
- VERSION = "2.2.8".freeze
3
+ VERSION = "2.2.9".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.8
4
+ version: 2.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-04-10 00:00:00.000000000 Z
11
+ date: 2023-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic