metanorma-bipm 2.1.9 → 2.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/automerge.yml +31 -0
- data/lib/isodoc/bipm/bipm.brochure.xsl +75 -42
- data/lib/isodoc/bipm/bipm.guide.xsl +75 -42
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +75 -42
- data/lib/isodoc/bipm/bipm.rapport.xsl +75 -42
- data/lib/isodoc/bipm/html/htmlstyle.css +1 -1
- data/lib/isodoc/bipm/i18n-en.yaml +4 -0
- data/lib/isodoc/bipm/i18n-fr.yaml +5 -1
- data/lib/isodoc/bipm/jcgm.standard.xsl +16 -4
- data/lib/isodoc/bipm/presentation_xml_convert.rb +45 -7
- data/lib/metanorma/bipm/basicdoc.rng +0 -27
- data/lib/metanorma/bipm/biblio-standoc.rng +164 -0
- data/lib/metanorma/bipm/biblio.rng +45 -18
- data/lib/metanorma/bipm/bipm.rng +1 -130
- data/lib/metanorma/bipm/isodoc.rng +31 -194
- data/lib/metanorma/bipm/relaton-bipm.rng +138 -0
- data/lib/metanorma/bipm/version.rb +1 -1
- metadata +5 -2
@@ -1193,10 +1193,10 @@
|
|
1193
1193
|
|
1194
1194
|
</fo:block>
|
1195
1195
|
|
1196
|
-
<xsl:variable name="part_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/>
|
1197
|
-
<xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']">
|
1196
|
+
<!-- <xsl:variable name="part_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/> -->
|
1197
|
+
<xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part-with-numbering']">
|
1198
1198
|
<fo:block role="H2">
|
1199
|
-
<xsl:if test="$part_num != ''">
|
1199
|
+
<!-- <xsl:if test="$part_num != ''">
|
1200
1200
|
<xsl:call-template name="getLocalizedString">
|
1201
1201
|
<xsl:with-param name="key">Part.sg</xsl:with-param>
|
1202
1202
|
<xsl:with-param name="lang" select="$curr_lang"/>
|
@@ -1204,18 +1204,18 @@
|
|
1204
1204
|
<xsl:text> </xsl:text>
|
1205
1205
|
<xsl:value-of select="$part_num"/>
|
1206
1206
|
</xsl:if>
|
1207
|
-
<xsl:text>: </xsl:text>
|
1208
|
-
<xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']" mode="title"/>
|
1207
|
+
<xsl:text>: </xsl:text> -->
|
1208
|
+
<xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part-with-numbering']" mode="title"/>
|
1209
1209
|
</fo:block>
|
1210
1210
|
</xsl:if>
|
1211
|
-
<xsl:variable name="subpart_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
|
1212
|
-
<xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart']">
|
1211
|
+
<!-- <xsl:variable name="subpart_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/> -->
|
1212
|
+
<xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart-with-numbering']">
|
1213
1213
|
<fo:block role="H3">
|
1214
|
-
<xsl:if test="$subpart_num != ''">
|
1214
|
+
<!-- <xsl:if test="$subpart_num != ''">
|
1215
1215
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang=$curr_lang]),'#',$subpart_num)"/>
|
1216
1216
|
</xsl:if>
|
1217
|
-
<xsl:text>: </xsl:text>
|
1218
|
-
<xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart']" mode="title"/>
|
1217
|
+
<xsl:text>: </xsl:text> -->
|
1218
|
+
<xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart-with-numbering']" mode="title"/>
|
1219
1219
|
</fo:block>
|
1220
1220
|
</xsl:if>
|
1221
1221
|
|
@@ -2927,16 +2927,18 @@
|
|
2927
2927
|
<xsl:template match="bipm:note[not(ancestor::bipm:preface)]/bipm:name" priority="2">
|
2928
2928
|
<xsl:choose>
|
2929
2929
|
<xsl:when test="not(../preceding-sibling::bipm:note) and not((../following-sibling::bipm:note))">
|
2930
|
-
<xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
2930
|
+
<!-- <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
2931
2931
|
<xsl:choose>
|
2932
2932
|
<xsl:when test="$curr_lang = 'fr'">
|
2933
2933
|
<xsl:choose>
|
2934
|
-
<xsl:when test="ancestor::bipm:li">Remarque
|
2935
|
-
<xsl:otherwise>Note
|
2934
|
+
<xsl:when test="ancestor::bipm:li">Remarque : </xsl:when>
|
2935
|
+
<xsl:otherwise>Note : </xsl:otherwise>
|
2936
2936
|
</xsl:choose>
|
2937
2937
|
</xsl:when>
|
2938
2938
|
<xsl:otherwise>Note: </xsl:otherwise>
|
2939
|
-
</xsl:choose>
|
2939
|
+
</xsl:choose> -->
|
2940
|
+
<xsl:apply-templates/>
|
2941
|
+
<xsl:text> </xsl:text>
|
2940
2942
|
</xsl:when>
|
2941
2943
|
<xsl:when test="ancestor::bipm:table and count(ancestor::bipm:table//bipm:note) > 0">
|
2942
2944
|
<xsl:variable name="table_id" select="ancestor::bipm:table/@id"/>
|
@@ -2968,6 +2970,10 @@
|
|
2968
2970
|
</xsl:choose>
|
2969
2971
|
</xsl:template>
|
2970
2972
|
|
2973
|
+
<xsl:template match="*[local-name() = 'name']/text()" priority="2">
|
2974
|
+
<xsl:value-of select="."/>
|
2975
|
+
</xsl:template>
|
2976
|
+
|
2971
2977
|
<xsl:template match="*[local-name() = 'sup_fn']">
|
2972
2978
|
<fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
|
2973
2979
|
<xsl:apply-templates/>
|
@@ -4330,8 +4336,8 @@
|
|
4330
4336
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
4331
4337
|
<xsl:attribute name="text-align">left</xsl:attribute>
|
4332
4338
|
<xsl:attribute name="margin-top">24pt</xsl:attribute>
|
4333
|
-
<xsl:attribute name="margin-left">25mm</xsl:attribute>
|
4334
|
-
<xsl:attribute name="text-indent">-25mm</xsl:attribute>
|
4339
|
+
<!-- <xsl:attribute name="margin-left">25mm</xsl:attribute>
|
4340
|
+
<xsl:attribute name="text-indent">-25mm</xsl:attribute> -->
|
4335
4341
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
4336
4342
|
|
4337
4343
|
</xsl:attribute-set> <!-- table-name-style -->
|
@@ -5605,25 +5611,38 @@
|
|
5605
5611
|
<xsl:param name="continued"/>
|
5606
5612
|
<xsl:if test="normalize-space() != ''">
|
5607
5613
|
|
5608
|
-
<fo:block xsl:use-attribute-sets="table-name-style">
|
5609
|
-
|
5610
|
-
<xsl:if test="not(*[local-name()='tab'])"> <!-- table without number -->
|
5611
|
-
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
5612
|
-
</xsl:if>
|
5613
|
-
<xsl:if test="not(../preceding-sibling::*) and ancestor::node()[@orientation]">
|
5614
|
-
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
5615
|
-
</xsl:if>
|
5614
|
+
<fo:list-block xsl:use-attribute-sets="table-name-style">
|
5616
5615
|
|
5617
|
-
<xsl:
|
5618
|
-
<xsl:
|
5616
|
+
<xsl:if test="not(*[local-name()='tab'])"> <!-- table without number -->
|
5617
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
5618
|
+
</xsl:if>
|
5619
|
+
<xsl:if test="not(../preceding-sibling::*) and ancestor::node()[@orientation]">
|
5620
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
5621
|
+
</xsl:if>
|
5619
5622
|
|
5620
|
-
|
5621
|
-
<xsl:otherwise>
|
5622
|
-
<xsl:apply-templates/>
|
5623
|
-
</xsl:otherwise>
|
5624
|
-
</xsl:choose>
|
5623
|
+
<xsl:attribute name="provisional-distance-between-starts">25mm</xsl:attribute>
|
5625
5624
|
|
5626
|
-
|
5625
|
+
<fo:list-item>
|
5626
|
+
<fo:list-item-label end-indent="label-end()">
|
5627
|
+
<fo:block>
|
5628
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
5629
|
+
</fo:block>
|
5630
|
+
</fo:list-item-label>
|
5631
|
+
<fo:list-item-body start-indent="body-start()">
|
5632
|
+
<fo:block>
|
5633
|
+
<xsl:choose>
|
5634
|
+
<xsl:when test="./*[local-name() = 'tab']">
|
5635
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
|
5636
|
+
</xsl:when>
|
5637
|
+
<xsl:otherwise>
|
5638
|
+
<xsl:apply-templates/>
|
5639
|
+
</xsl:otherwise>
|
5640
|
+
</xsl:choose>
|
5641
|
+
</fo:block>
|
5642
|
+
</fo:list-item-body>
|
5643
|
+
</fo:list-item>
|
5644
|
+
</fo:list-block>
|
5645
|
+
<!-- bipm -->
|
5627
5646
|
|
5628
5647
|
</xsl:if>
|
5629
5648
|
</xsl:template> <!-- table/name -->
|
@@ -7323,8 +7342,17 @@
|
|
7323
7342
|
</fo:inline>
|
7324
7343
|
</xsl:template> <!-- tt -->
|
7325
7344
|
|
7345
|
+
<xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
|
7326
7346
|
<xsl:template match="*[local-name()='tt']/text()" priority="2">
|
7327
|
-
<xsl:
|
7347
|
+
<xsl:choose>
|
7348
|
+
<xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
|
7349
|
+
<!-- url -->
|
7350
|
+
<xsl:call-template name="add-zero-spaces-link-java"/>
|
7351
|
+
</xsl:when>
|
7352
|
+
<xsl:otherwise>
|
7353
|
+
<xsl:call-template name="add_spaces_to_sourcecode"/>
|
7354
|
+
</xsl:otherwise>
|
7355
|
+
</xsl:choose>
|
7328
7356
|
</xsl:template>
|
7329
7357
|
|
7330
7358
|
<xsl:template match="*[local-name()='underline']">
|
@@ -7680,8 +7708,11 @@
|
|
7680
7708
|
|
7681
7709
|
<xsl:template name="add-zero-spaces-link-java">
|
7682
7710
|
<xsl:param name="text" select="."/>
|
7711
|
+
|
7712
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
|
7713
|
+
<xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
|
7683
7714
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
7684
|
-
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($
|
7715
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1')"/>
|
7685
7716
|
</xsl:template>
|
7686
7717
|
|
7687
7718
|
<!-- add zero space after dash character (for table's entries) -->
|
@@ -8714,11 +8745,12 @@
|
|
8714
8745
|
</xsl:when>
|
8715
8746
|
<xsl:otherwise>
|
8716
8747
|
|
8717
|
-
<xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
8748
|
+
<!-- <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
8718
8749
|
<xsl:choose>
|
8719
|
-
<xsl:when test="$curr_lang = 'fr'"><xsl:text
|
8750
|
+
<xsl:when test="$curr_lang = 'fr'"><xsl:text> : </xsl:text></xsl:when>
|
8720
8751
|
<xsl:otherwise><xsl:text>: </xsl:text></xsl:otherwise>
|
8721
|
-
</xsl:choose>
|
8752
|
+
</xsl:choose> -->
|
8753
|
+
<xsl:text> </xsl:text>
|
8722
8754
|
|
8723
8755
|
</xsl:otherwise>
|
8724
8756
|
</xsl:choose>
|
@@ -8738,11 +8770,12 @@
|
|
8738
8770
|
</xsl:when>
|
8739
8771
|
<xsl:otherwise>
|
8740
8772
|
|
8741
|
-
<xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
8773
|
+
<!-- <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
8742
8774
|
<xsl:choose>
|
8743
|
-
<xsl:when test="$curr_lang = 'fr'"><xsl:text
|
8775
|
+
<xsl:when test="$curr_lang = 'fr'"><xsl:text> : </xsl:text></xsl:when>
|
8744
8776
|
<xsl:otherwise><xsl:text>: </xsl:text></xsl:otherwise>
|
8745
|
-
</xsl:choose>
|
8777
|
+
</xsl:choose> -->
|
8778
|
+
<xsl:text> </xsl:text>
|
8746
8779
|
|
8747
8780
|
</xsl:otherwise>
|
8748
8781
|
</xsl:choose>
|
@@ -10707,7 +10740,7 @@
|
|
10707
10740
|
<!-- ====== -->
|
10708
10741
|
<!-- eref -->
|
10709
10742
|
<!-- ====== -->
|
10710
|
-
<xsl:template match="*[local-name() = 'eref']">
|
10743
|
+
<xsl:template match="*[local-name() = 'eref']" name="eref">
|
10711
10744
|
<xsl:variable name="current_bibitemid" select="@bibitemid"/>
|
10712
10745
|
<!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
|
10713
10746
|
<xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
|
@@ -12181,7 +12214,7 @@
|
|
12181
12214
|
|
12182
12215
|
<xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
|
12183
12216
|
|
12184
|
-
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or
|
12217
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
12185
12218
|
|
12186
12219
|
<!-- enclose standard's number into tag 'keep-together_within-line' -->
|
12187
12220
|
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
@@ -1193,10 +1193,10 @@
|
|
1193
1193
|
|
1194
1194
|
</fo:block>
|
1195
1195
|
|
1196
|
-
<xsl:variable name="part_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/>
|
1197
|
-
<xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']">
|
1196
|
+
<!-- <xsl:variable name="part_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:part)"/> -->
|
1197
|
+
<xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part-with-numbering']">
|
1198
1198
|
<fo:block role="H2">
|
1199
|
-
<xsl:if test="$part_num != ''">
|
1199
|
+
<!-- <xsl:if test="$part_num != ''">
|
1200
1200
|
<xsl:call-template name="getLocalizedString">
|
1201
1201
|
<xsl:with-param name="key">Part.sg</xsl:with-param>
|
1202
1202
|
<xsl:with-param name="lang" select="$curr_lang"/>
|
@@ -1204,18 +1204,18 @@
|
|
1204
1204
|
<xsl:text> </xsl:text>
|
1205
1205
|
<xsl:value-of select="$part_num"/>
|
1206
1206
|
</xsl:if>
|
1207
|
-
<xsl:text>: </xsl:text>
|
1208
|
-
<xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part']" mode="title"/>
|
1207
|
+
<xsl:text>: </xsl:text> -->
|
1208
|
+
<xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'part-with-numbering']" mode="title"/>
|
1209
1209
|
</fo:block>
|
1210
1210
|
</xsl:if>
|
1211
|
-
<xsl:variable name="subpart_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/>
|
1212
|
-
<xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart']">
|
1211
|
+
<!-- <xsl:variable name="subpart_num" select="normalize-space(/bipm:bipm-standard/bipm:bibdata/bipm:ext/bipm:structuredidentifier/bipm:subpart)"/> -->
|
1212
|
+
<xsl:if test="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart-with-numbering']">
|
1213
1213
|
<fo:block role="H3">
|
1214
|
-
<xsl:if test="$subpart_num != ''">
|
1214
|
+
<!-- <xsl:if test="$subpart_num != ''">
|
1215
1215
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-subpart[@lang=$curr_lang]),'#',$subpart_num)"/>
|
1216
1216
|
</xsl:if>
|
1217
|
-
<xsl:text>: </xsl:text>
|
1218
|
-
<xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart']" mode="title"/>
|
1217
|
+
<xsl:text>: </xsl:text> -->
|
1218
|
+
<xsl:apply-templates select="/bipm:bipm-standard/bipm:bibdata/bipm:title[@language = $curr_lang and @type = 'subpart-with-numbering']" mode="title"/>
|
1219
1219
|
</fo:block>
|
1220
1220
|
</xsl:if>
|
1221
1221
|
|
@@ -2927,16 +2927,18 @@
|
|
2927
2927
|
<xsl:template match="bipm:note[not(ancestor::bipm:preface)]/bipm:name" priority="2">
|
2928
2928
|
<xsl:choose>
|
2929
2929
|
<xsl:when test="not(../preceding-sibling::bipm:note) and not((../following-sibling::bipm:note))">
|
2930
|
-
<xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
2930
|
+
<!-- <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
2931
2931
|
<xsl:choose>
|
2932
2932
|
<xsl:when test="$curr_lang = 'fr'">
|
2933
2933
|
<xsl:choose>
|
2934
|
-
<xsl:when test="ancestor::bipm:li">Remarque
|
2935
|
-
<xsl:otherwise>Note
|
2934
|
+
<xsl:when test="ancestor::bipm:li">Remarque : </xsl:when>
|
2935
|
+
<xsl:otherwise>Note : </xsl:otherwise>
|
2936
2936
|
</xsl:choose>
|
2937
2937
|
</xsl:when>
|
2938
2938
|
<xsl:otherwise>Note: </xsl:otherwise>
|
2939
|
-
</xsl:choose>
|
2939
|
+
</xsl:choose> -->
|
2940
|
+
<xsl:apply-templates/>
|
2941
|
+
<xsl:text> </xsl:text>
|
2940
2942
|
</xsl:when>
|
2941
2943
|
<xsl:when test="ancestor::bipm:table and count(ancestor::bipm:table//bipm:note) > 0">
|
2942
2944
|
<xsl:variable name="table_id" select="ancestor::bipm:table/@id"/>
|
@@ -2968,6 +2970,10 @@
|
|
2968
2970
|
</xsl:choose>
|
2969
2971
|
</xsl:template>
|
2970
2972
|
|
2973
|
+
<xsl:template match="*[local-name() = 'name']/text()" priority="2">
|
2974
|
+
<xsl:value-of select="."/>
|
2975
|
+
</xsl:template>
|
2976
|
+
|
2971
2977
|
<xsl:template match="*[local-name() = 'sup_fn']">
|
2972
2978
|
<fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
|
2973
2979
|
<xsl:apply-templates/>
|
@@ -4330,8 +4336,8 @@
|
|
4330
4336
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
4331
4337
|
<xsl:attribute name="text-align">left</xsl:attribute>
|
4332
4338
|
<xsl:attribute name="margin-top">24pt</xsl:attribute>
|
4333
|
-
<xsl:attribute name="margin-left">25mm</xsl:attribute>
|
4334
|
-
<xsl:attribute name="text-indent">-25mm</xsl:attribute>
|
4339
|
+
<!-- <xsl:attribute name="margin-left">25mm</xsl:attribute>
|
4340
|
+
<xsl:attribute name="text-indent">-25mm</xsl:attribute> -->
|
4335
4341
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
4336
4342
|
|
4337
4343
|
</xsl:attribute-set> <!-- table-name-style -->
|
@@ -5605,25 +5611,38 @@
|
|
5605
5611
|
<xsl:param name="continued"/>
|
5606
5612
|
<xsl:if test="normalize-space() != ''">
|
5607
5613
|
|
5608
|
-
<fo:block xsl:use-attribute-sets="table-name-style">
|
5609
|
-
|
5610
|
-
<xsl:if test="not(*[local-name()='tab'])"> <!-- table without number -->
|
5611
|
-
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
5612
|
-
</xsl:if>
|
5613
|
-
<xsl:if test="not(../preceding-sibling::*) and ancestor::node()[@orientation]">
|
5614
|
-
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
5615
|
-
</xsl:if>
|
5614
|
+
<fo:list-block xsl:use-attribute-sets="table-name-style">
|
5616
5615
|
|
5617
|
-
<xsl:
|
5618
|
-
<xsl:
|
5616
|
+
<xsl:if test="not(*[local-name()='tab'])"> <!-- table without number -->
|
5617
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
5618
|
+
</xsl:if>
|
5619
|
+
<xsl:if test="not(../preceding-sibling::*) and ancestor::node()[@orientation]">
|
5620
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
5621
|
+
</xsl:if>
|
5619
5622
|
|
5620
|
-
|
5621
|
-
<xsl:otherwise>
|
5622
|
-
<xsl:apply-templates/>
|
5623
|
-
</xsl:otherwise>
|
5624
|
-
</xsl:choose>
|
5623
|
+
<xsl:attribute name="provisional-distance-between-starts">25mm</xsl:attribute>
|
5625
5624
|
|
5626
|
-
|
5625
|
+
<fo:list-item>
|
5626
|
+
<fo:list-item-label end-indent="label-end()">
|
5627
|
+
<fo:block>
|
5628
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
|
5629
|
+
</fo:block>
|
5630
|
+
</fo:list-item-label>
|
5631
|
+
<fo:list-item-body start-indent="body-start()">
|
5632
|
+
<fo:block>
|
5633
|
+
<xsl:choose>
|
5634
|
+
<xsl:when test="./*[local-name() = 'tab']">
|
5635
|
+
<xsl:apply-templates select="./*[local-name() = 'tab'][1]/following-sibling::node()"/>
|
5636
|
+
</xsl:when>
|
5637
|
+
<xsl:otherwise>
|
5638
|
+
<xsl:apply-templates/>
|
5639
|
+
</xsl:otherwise>
|
5640
|
+
</xsl:choose>
|
5641
|
+
</fo:block>
|
5642
|
+
</fo:list-item-body>
|
5643
|
+
</fo:list-item>
|
5644
|
+
</fo:list-block>
|
5645
|
+
<!-- bipm -->
|
5627
5646
|
|
5628
5647
|
</xsl:if>
|
5629
5648
|
</xsl:template> <!-- table/name -->
|
@@ -7323,8 +7342,17 @@
|
|
7323
7342
|
</fo:inline>
|
7324
7343
|
</xsl:template> <!-- tt -->
|
7325
7344
|
|
7345
|
+
<xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
|
7326
7346
|
<xsl:template match="*[local-name()='tt']/text()" priority="2">
|
7327
|
-
<xsl:
|
7347
|
+
<xsl:choose>
|
7348
|
+
<xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
|
7349
|
+
<!-- url -->
|
7350
|
+
<xsl:call-template name="add-zero-spaces-link-java"/>
|
7351
|
+
</xsl:when>
|
7352
|
+
<xsl:otherwise>
|
7353
|
+
<xsl:call-template name="add_spaces_to_sourcecode"/>
|
7354
|
+
</xsl:otherwise>
|
7355
|
+
</xsl:choose>
|
7328
7356
|
</xsl:template>
|
7329
7357
|
|
7330
7358
|
<xsl:template match="*[local-name()='underline']">
|
@@ -7680,8 +7708,11 @@
|
|
7680
7708
|
|
7681
7709
|
<xsl:template name="add-zero-spaces-link-java">
|
7682
7710
|
<xsl:param name="text" select="."/>
|
7711
|
+
|
7712
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
|
7713
|
+
<xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
|
7683
7714
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
7684
|
-
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($
|
7715
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1')"/>
|
7685
7716
|
</xsl:template>
|
7686
7717
|
|
7687
7718
|
<!-- add zero space after dash character (for table's entries) -->
|
@@ -8714,11 +8745,12 @@
|
|
8714
8745
|
</xsl:when>
|
8715
8746
|
<xsl:otherwise>
|
8716
8747
|
|
8717
|
-
<xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
8748
|
+
<!-- <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
8718
8749
|
<xsl:choose>
|
8719
|
-
<xsl:when test="$curr_lang = 'fr'"><xsl:text
|
8750
|
+
<xsl:when test="$curr_lang = 'fr'"><xsl:text> : </xsl:text></xsl:when>
|
8720
8751
|
<xsl:otherwise><xsl:text>: </xsl:text></xsl:otherwise>
|
8721
|
-
</xsl:choose>
|
8752
|
+
</xsl:choose> -->
|
8753
|
+
<xsl:text> </xsl:text>
|
8722
8754
|
|
8723
8755
|
</xsl:otherwise>
|
8724
8756
|
</xsl:choose>
|
@@ -8738,11 +8770,12 @@
|
|
8738
8770
|
</xsl:when>
|
8739
8771
|
<xsl:otherwise>
|
8740
8772
|
|
8741
|
-
<xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
8773
|
+
<!-- <xsl:variable name="curr_lang" select="ancestor::bipm:bipm-standard/bipm:bibdata/bipm:language[@current = 'true']"/>
|
8742
8774
|
<xsl:choose>
|
8743
|
-
<xsl:when test="$curr_lang = 'fr'"><xsl:text
|
8775
|
+
<xsl:when test="$curr_lang = 'fr'"><xsl:text> : </xsl:text></xsl:when>
|
8744
8776
|
<xsl:otherwise><xsl:text>: </xsl:text></xsl:otherwise>
|
8745
|
-
</xsl:choose>
|
8777
|
+
</xsl:choose> -->
|
8778
|
+
<xsl:text> </xsl:text>
|
8746
8779
|
|
8747
8780
|
</xsl:otherwise>
|
8748
8781
|
</xsl:choose>
|
@@ -10707,7 +10740,7 @@
|
|
10707
10740
|
<!-- ====== -->
|
10708
10741
|
<!-- eref -->
|
10709
10742
|
<!-- ====== -->
|
10710
|
-
<xsl:template match="*[local-name() = 'eref']">
|
10743
|
+
<xsl:template match="*[local-name() = 'eref']" name="eref">
|
10711
10744
|
<xsl:variable name="current_bibitemid" select="@bibitemid"/>
|
10712
10745
|
<!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
|
10713
10746
|
<xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
|
@@ -12181,7 +12214,7 @@
|
|
12181
12214
|
|
12182
12215
|
<xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
|
12183
12216
|
|
12184
|
-
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or
|
12217
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
12185
12218
|
|
12186
12219
|
<!-- enclose standard's number into tag 'keep-together_within-line' -->
|
12187
12220
|
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
@@ -3,7 +3,7 @@ appendix: Appendice
|
|
3
3
|
iso_annex: Annexe
|
4
4
|
see: voir
|
5
5
|
see_also: voir aussi
|
6
|
-
clause:
|
6
|
+
clause: chapitre
|
7
7
|
subclause: section
|
8
8
|
clause_jcgm: Article
|
9
9
|
subclause_jcgm: Article
|
@@ -42,3 +42,7 @@ norm_with_refs_pref:
|
|
42
42
|
all_rights_reserved: Tous droits réservés
|
43
43
|
table_of_contents: Table des matières
|
44
44
|
source: Adapté de
|
45
|
+
note: "Note:"
|
46
|
+
prefacenote: "NOTE:"
|
47
|
+
listnote: "Remarque:"
|
48
|
+
termnote: "Note % à l’article:"
|
@@ -5242,8 +5242,17 @@
|
|
5242
5242
|
</fo:inline>
|
5243
5243
|
</xsl:template> <!-- tt -->
|
5244
5244
|
|
5245
|
+
<xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
|
5245
5246
|
<xsl:template match="*[local-name()='tt']/text()" priority="2">
|
5246
|
-
<xsl:
|
5247
|
+
<xsl:choose>
|
5248
|
+
<xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
|
5249
|
+
<!-- url -->
|
5250
|
+
<xsl:call-template name="add-zero-spaces-link-java"/>
|
5251
|
+
</xsl:when>
|
5252
|
+
<xsl:otherwise>
|
5253
|
+
<xsl:call-template name="add_spaces_to_sourcecode"/>
|
5254
|
+
</xsl:otherwise>
|
5255
|
+
</xsl:choose>
|
5247
5256
|
</xsl:template>
|
5248
5257
|
|
5249
5258
|
<xsl:template match="*[local-name()='underline']">
|
@@ -5599,8 +5608,11 @@
|
|
5599
5608
|
|
5600
5609
|
<xsl:template name="add-zero-spaces-link-java">
|
5601
5610
|
<xsl:param name="text" select="."/>
|
5611
|
+
|
5612
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
|
5613
|
+
<xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
|
5602
5614
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
5603
|
-
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($
|
5615
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1')"/>
|
5604
5616
|
</xsl:template>
|
5605
5617
|
|
5606
5618
|
<!-- add zero space after dash character (for table's entries) -->
|
@@ -8574,7 +8586,7 @@
|
|
8574
8586
|
<!-- ====== -->
|
8575
8587
|
<!-- eref -->
|
8576
8588
|
<!-- ====== -->
|
8577
|
-
<xsl:template match="*[local-name() = 'eref']">
|
8589
|
+
<xsl:template match="*[local-name() = 'eref']" name="eref">
|
8578
8590
|
<xsl:variable name="current_bibitemid" select="@bibitemid"/>
|
8579
8591
|
<!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
|
8580
8592
|
<xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
|
@@ -10035,7 +10047,7 @@
|
|
10035
10047
|
|
10036
10048
|
<xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
|
10037
10049
|
|
10038
|
-
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or
|
10050
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
|
10039
10051
|
|
10040
10052
|
<!-- enclose standard's number into tag 'keep-together_within-line' -->
|
10041
10053
|
<xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
|
@@ -104,6 +104,7 @@ module IsoDoc
|
|
104
104
|
def bibdata_i18n(bibdata)
|
105
105
|
super
|
106
106
|
bibdata_dates(bibdata)
|
107
|
+
bibdata_titles(bibdata)
|
107
108
|
end
|
108
109
|
|
109
110
|
def bibdata_dates(bibdata)
|
@@ -116,6 +117,20 @@ module IsoDoc
|
|
116
117
|
pubdate.next.children = meta.monthyr(pubdate.text)
|
117
118
|
end
|
118
119
|
|
120
|
+
def bibdata_titles(bibdata)
|
121
|
+
return unless app = bibdata.at(ns("//bibdata/ext/"\
|
122
|
+
"structuredidentifier/part"))
|
123
|
+
|
124
|
+
bibdata.xpath(ns("//bibdata/title[@type = 'part']")).each do |t|
|
125
|
+
t.previous = t.dup
|
126
|
+
t["type"] = "part-with-numbering"
|
127
|
+
part = t["language"] == "en" ? "Part" : "Partie"
|
128
|
+
# not looking up in YAML
|
129
|
+
t.children = l10n("#{part} #{app.text}: #{t.children.to_xml}",
|
130
|
+
t["language"])
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
119
134
|
def eref(docxml)
|
120
135
|
super
|
121
136
|
jcgm_eref(docxml, "//eref")
|
@@ -148,13 +163,13 @@ module IsoDoc
|
|
148
163
|
def extract_brackets(node)
|
149
164
|
start = node.at("./text()[1]")
|
150
165
|
finish = node.at("./text()[last()]")
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
166
|
+
(/^\[/.match?(start.text) && /\]$/.match?(finish.text)) or return
|
167
|
+
|
168
|
+
start.replace(start.text[1..-1])
|
169
|
+
node.previous = "["
|
170
|
+
finish = node.at("./text()[last()]")
|
171
|
+
finish.replace(finish.text[0..-2])
|
172
|
+
node.next = "]"
|
158
173
|
end
|
159
174
|
|
160
175
|
def quotedtitles(docxml)
|
@@ -164,6 +179,29 @@ module IsoDoc
|
|
164
179
|
end
|
165
180
|
end
|
166
181
|
|
182
|
+
# notes and remarques (list notes) are not numbered
|
183
|
+
def note1(elem)
|
184
|
+
return if elem.parent.name == "bibitem" || elem["notag"] == "true"
|
185
|
+
|
186
|
+
# n = @xrefs.get[elem["id"]]
|
187
|
+
lbl = l10n(note_label(elem))
|
188
|
+
# (n.nil? || n[:label].nil? || n[:label].empty?) or
|
189
|
+
# lbl = l10n("#{lbl} #{n[:label]}")
|
190
|
+
prefix_name(elem, "", lbl, "name")
|
191
|
+
end
|
192
|
+
|
193
|
+
def note_label(elem)
|
194
|
+
if elem.ancestors("preface").empty?
|
195
|
+
if elem.ancestors("ul, ol, dl").empty?
|
196
|
+
@i18n.note
|
197
|
+
else
|
198
|
+
@i18n.listnote
|
199
|
+
end
|
200
|
+
else
|
201
|
+
@i18n.prefacenote
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
167
205
|
def termsource1(elem)
|
168
206
|
while elem&.next_element&.name == "termsource"
|
169
207
|
elem << "; #{elem.next_element.remove.children.to_xml}"
|
@@ -1,10 +1,5 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
2
|
<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
3
|
-
<include href="biblio.rng">
|
4
|
-
<start>
|
5
|
-
<ref name="document"/>
|
6
|
-
</start>
|
7
|
-
</include>
|
8
3
|
<define name="document">
|
9
4
|
<element name="document">
|
10
5
|
<optional>
|
@@ -1125,26 +1120,4 @@
|
|
1125
1120
|
</zeroOrMore>
|
1126
1121
|
</element>
|
1127
1122
|
</define>
|
1128
|
-
<define name="ext">
|
1129
|
-
<element name="ext">
|
1130
|
-
<ref name="BibDataExtensionType"/>
|
1131
|
-
</element>
|
1132
|
-
</define>
|
1133
|
-
<define name="BibDataExtensionType">
|
1134
|
-
<ref name="doctype"/>
|
1135
|
-
</define>
|
1136
|
-
<define name="doctype">
|
1137
|
-
<element name="doctype">
|
1138
|
-
<ref name="DocumentType"/>
|
1139
|
-
</element>
|
1140
|
-
</define>
|
1141
|
-
<define name="DocumentType">
|
1142
|
-
<value>document</value>
|
1143
|
-
</define>
|
1144
|
-
<define name="BibData">
|
1145
|
-
<ref name="BibliographicItem"/>
|
1146
|
-
<optional>
|
1147
|
-
<ref name="ext"/>
|
1148
|
-
</optional>
|
1149
|
-
</define>
|
1150
1123
|
</grammar>
|