metanorma-bipm 2.2.14 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/bipm/base_convert.rb +16 -15
- data/lib/isodoc/bipm/bipm.brochure.xsl +100 -58
- data/lib/isodoc/bipm/bipm.guide.xsl +100 -58
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +100 -58
- data/lib/isodoc/bipm/bipm.rapport.xsl +100 -58
- data/lib/isodoc/bipm/doccontrol.rb +4 -4
- data/lib/isodoc/bipm/html/htmlstyle.css +6 -6
- data/lib/isodoc/bipm/html/htmlstyle.scss +6 -6
- data/lib/isodoc/bipm/html_convert.rb +3 -9
- data/lib/isodoc/bipm/init.rb +5 -2
- data/lib/isodoc/bipm/jcgm.standard.xsl +120 -47
- data/lib/isodoc/bipm/metadata.rb +4 -4
- data/lib/isodoc/bipm/presentation_blocks.rb +41 -0
- data/lib/isodoc/bipm/presentation_xml_convert.rb +15 -38
- data/lib/isodoc/bipm/xref.rb +56 -57
- data/lib/metanorma/bipm/front.rb +2 -2
- data/lib/metanorma/bipm/isodoc.rng +29 -4
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma-bipm.gemspec +2 -2
- metadata +7 -6
@@ -243,13 +243,13 @@
|
|
243
243
|
<xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from"/>
|
244
244
|
</fo:block>
|
245
245
|
<fo:block font-size="13pt" font-weight="normal" space-after="19.5mm">
|
246
|
-
<xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@type = 'provenance']"/>
|
246
|
+
<xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@type = 'title-provenance']"/>
|
247
247
|
</fo:block>
|
248
248
|
<fo:block border-bottom="1pt solid black"> </fo:block>
|
249
249
|
<fo:block font-size="16.5pt" margin-left="-0.5mm" padding-top="3.5mm" space-after="7mm" margin-right="7mm" line-height="105%" role="H1">
|
250
|
-
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'main']" mode="title"/>
|
250
|
+
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-main']" mode="title"/>
|
251
251
|
<xsl:variable name="title_part">
|
252
|
-
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'part']" mode="title"/>
|
252
|
+
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-part']" mode="title"/>
|
253
253
|
</xsl:variable>
|
254
254
|
<xsl:if test="normalize-space($title_part) != ''">
|
255
255
|
<xsl:text> — </xsl:text>
|
@@ -258,9 +258,9 @@
|
|
258
258
|
</fo:block>
|
259
259
|
<fo:block font-size="12pt" font-style="italic" line-height="140%" role="H1">
|
260
260
|
<xsl:variable name="secondLang" select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title/@language[. != $lang]"/>
|
261
|
-
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'main']" mode="title"/>
|
261
|
+
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-main']" mode="title"/>
|
262
262
|
<xsl:variable name="title_part">
|
263
|
-
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'part']" mode="title"/>
|
263
|
+
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-part']" mode="title"/>
|
264
264
|
</xsl:variable>
|
265
265
|
<xsl:if test="normalize-space($title_part) != ''">
|
266
266
|
<xsl:text> — </xsl:text>
|
@@ -297,9 +297,9 @@
|
|
297
297
|
</fo:table-body>
|
298
298
|
</fo:table>
|
299
299
|
<fo:block font-size="18pt" space-before="70mm" role="H1">
|
300
|
-
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'main']" mode="title"/>
|
300
|
+
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-main']" mode="title"/>
|
301
301
|
<xsl:variable name="title_part">
|
302
|
-
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'part']" mode="title"/>
|
302
|
+
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'title-part']" mode="title"/>
|
303
303
|
</xsl:variable>
|
304
304
|
<xsl:if test="normalize-space($title_part) != ''">
|
305
305
|
<xsl:text> — </xsl:text>
|
@@ -308,9 +308,9 @@
|
|
308
308
|
</fo:block>
|
309
309
|
<fo:block font-size="13pt" space-before="35mm" role="H1">
|
310
310
|
<xsl:variable name="secondLang" select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title/@language[. != $lang]"/>
|
311
|
-
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'main']" mode="title"/>
|
311
|
+
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-main']" mode="title"/>
|
312
312
|
<xsl:variable name="title_part">
|
313
|
-
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'part']" mode="title"/>
|
313
|
+
<xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $secondLang and @type = 'title-part']" mode="title"/>
|
314
314
|
</xsl:variable>
|
315
315
|
<xsl:if test="normalize-space($title_part) != ''">
|
316
316
|
<xsl:text> — </xsl:text>
|
@@ -397,14 +397,16 @@
|
|
397
397
|
|
398
398
|
<fo:flow flow-name="xsl-region-body" line-height="115%">
|
399
399
|
|
400
|
-
<
|
400
|
+
<xsl:if test="count(//*[local-name() = 'bipm-standard']) != 1 ">
|
401
|
+
<!-- <fo:block-container> -->
|
401
402
|
<!-- Show title -->
|
402
403
|
<!-- Example: Evaluation of measurement data — An introduction to the `Guide to the expression of uncertainty in measurement' and related documents -->
|
403
404
|
|
404
405
|
<xsl:for-each select="//*[local-name() = 'bipm-standard']">
|
405
|
-
<fo:block font-size="20pt" font-weight="bold" margin-bottom="20pt" space-before="36pt" line-height="1.1">
|
406
|
-
<xsl:variable name="curr_lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
|
407
406
|
|
407
|
+
<!-- <fo:block font-size="20pt" font-weight="bold" margin-bottom="20pt" space-before="36pt" line-height="1.1">
|
408
|
+
<xsl:variable name="curr_lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
|
409
|
+
|
408
410
|
<xsl:variable name="title-main">
|
409
411
|
<xsl:apply-templates select="./*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = $curr_lang and @type = 'main']" mode="title"/>
|
410
412
|
</xsl:variable>
|
@@ -412,7 +414,7 @@
|
|
412
414
|
<xsl:variable name="title-part">
|
413
415
|
<xsl:apply-templates select="./*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = $curr_lang and @type = 'part']" mode="title"/>
|
414
416
|
</xsl:variable>
|
415
|
-
|
417
|
+
|
416
418
|
<fo:block role="H1">
|
417
419
|
<xsl:copy-of select="$title-main"/>
|
418
420
|
<xsl:if test="normalize-space($title-main) != '' and normalize-space($title-part) != ''">
|
@@ -420,7 +422,7 @@
|
|
420
422
|
</xsl:if>
|
421
423
|
<xsl:copy-of select="$title-part"/>
|
422
424
|
</fo:block>
|
423
|
-
|
425
|
+
|
424
426
|
<xsl:variable name="edition">
|
425
427
|
<xsl:apply-templates select="./*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) = '']">
|
426
428
|
<xsl:with-param name="curr_lang" select="$curr_lang"/>
|
@@ -429,11 +431,14 @@
|
|
429
431
|
<xsl:if test="normalize-space($edition) != ''">
|
430
432
|
<fo:block margin-top="12pt"><xsl:copy-of select="$edition"/></fo:block>
|
431
433
|
</xsl:if>
|
434
|
+
|
435
|
+
</fo:block> -->
|
432
436
|
|
433
|
-
|
434
|
-
</xsl:for-each>
|
437
|
+
<xsl:apply-templates select="jcgmsections/jcgm:p[starts-with(@class, 'zzSTDTitle')]"/>
|
435
438
|
|
436
|
-
|
439
|
+
</xsl:for-each>
|
440
|
+
<!-- </fo:block-container> -->
|
441
|
+
</xsl:if>
|
437
442
|
<!-- Clause(s) -->
|
438
443
|
<fo:block>
|
439
444
|
<xsl:choose>
|
@@ -581,6 +586,32 @@
|
|
581
586
|
</fo:block>
|
582
587
|
</xsl:template>
|
583
588
|
|
589
|
+
<xsl:template match="jcgm:sections/jcgm:p[@class = 'zzSTDTitle1']" priority="4">
|
590
|
+
<fo:block font-size="20pt" font-weight="bold" margin-bottom="20pt" space-before="36pt" line-height="1.1" role="H1">
|
591
|
+
<xsl:if test="following-sibling::*[1][self::jcgm:p][starts-with(@class, 'zzSTDTitle')]">
|
592
|
+
<xsl:attribute name="margin-bottom">0</xsl:attribute>
|
593
|
+
</xsl:if>
|
594
|
+
<xsl:apply-templates/>
|
595
|
+
</fo:block>
|
596
|
+
<xsl:variable name="curr_lang" select="ancestor::jcgm:bipm-standard/*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
|
597
|
+
<xsl:variable name="edition">
|
598
|
+
<xsl:apply-templates select="ancestor::jcgm:bipm-standard/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) = '']">
|
599
|
+
<xsl:with-param name="curr_lang" select="$curr_lang"/>
|
600
|
+
</xsl:apply-templates>
|
601
|
+
</xsl:variable>
|
602
|
+
<xsl:if test="normalize-space($edition) != ''">
|
603
|
+
<fo:block font-size="20pt" font-weight="bold" margin-top="12pt" margin-bottom="20pt" line-height="1.1">
|
604
|
+
<xsl:copy-of select="$edition"/>
|
605
|
+
</fo:block>
|
606
|
+
</xsl:if>
|
607
|
+
</xsl:template>
|
608
|
+
|
609
|
+
<xsl:template match="jcgm:sections/jcgm:p[@class = 'zzSTDTitle2']" priority="4">
|
610
|
+
<fo:block font-size="20pt" font-weight="bold" margin-top="12pt" margin-bottom="20pt" line-height="1.1">
|
611
|
+
<xsl:apply-templates/>
|
612
|
+
</fo:block>
|
613
|
+
</xsl:template>
|
614
|
+
|
584
615
|
<xsl:template match="node()">
|
585
616
|
<xsl:apply-templates/>
|
586
617
|
</xsl:template>
|
@@ -2014,11 +2045,26 @@
|
|
2014
2045
|
<xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
|
2015
2046
|
</xsl:if>
|
2016
2047
|
|
2017
|
-
<xsl:
|
2048
|
+
<xsl:variable name="font_family" select="."/>
|
2018
2049
|
|
2019
|
-
<xsl:
|
2020
|
-
<xsl:
|
2021
|
-
|
2050
|
+
<xsl:choose>
|
2051
|
+
<xsl:when test="$additional_fonts = ''">
|
2052
|
+
<xsl:value-of select="$font_family"/>
|
2053
|
+
</xsl:when>
|
2054
|
+
<xsl:otherwise> <!-- $additional_fonts != '' -->
|
2055
|
+
<xsl:choose>
|
2056
|
+
<xsl:when test="contains($font_family, ',')">
|
2057
|
+
<xsl:value-of select="substring-before($font_family, ',')"/>
|
2058
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
2059
|
+
<xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
|
2060
|
+
</xsl:when>
|
2061
|
+
<xsl:otherwise>
|
2062
|
+
<xsl:value-of select="$font_family"/>
|
2063
|
+
<xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
|
2064
|
+
</xsl:otherwise>
|
2065
|
+
</xsl:choose>
|
2066
|
+
</xsl:otherwise>
|
2067
|
+
</xsl:choose>
|
2022
2068
|
</xsl:attribute>
|
2023
2069
|
</xsl:when>
|
2024
2070
|
<xsl:otherwise>
|
@@ -4615,21 +4661,21 @@
|
|
4615
4661
|
|
4616
4662
|
<xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
|
4617
4663
|
|
4618
|
-
|
4664
|
+
<fo:block xsl:use-attribute-sets="table-note-style">
|
4619
4665
|
|
4620
|
-
|
4666
|
+
<xsl:call-template name="refine_table-note-style"/>
|
4621
4667
|
|
4622
|
-
|
4623
|
-
|
4668
|
+
<!-- Table's note/example name (NOTE, for example) -->
|
4669
|
+
<fo:inline xsl:use-attribute-sets="table-note-name-style">
|
4624
4670
|
|
4625
|
-
|
4671
|
+
<xsl:call-template name="refine_table-note-name-style"/>
|
4626
4672
|
|
4627
|
-
|
4673
|
+
<xsl:apply-templates select="*[local-name() = 'name']"/>
|
4628
4674
|
|
4629
|
-
|
4675
|
+
</fo:inline>
|
4630
4676
|
|
4631
|
-
|
4632
|
-
|
4677
|
+
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
4678
|
+
</fo:block>
|
4633
4679
|
|
4634
4680
|
</xsl:template> <!-- table/note -->
|
4635
4681
|
|
@@ -5708,6 +5754,9 @@
|
|
5708
5754
|
<!-- END Definition List -->
|
5709
5755
|
<!-- ===================== -->
|
5710
5756
|
|
5757
|
+
<!-- default: ignore title in sections/p -->
|
5758
|
+
<xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
|
5759
|
+
|
5711
5760
|
<!-- ========================= -->
|
5712
5761
|
<!-- Rich text formatting -->
|
5713
5762
|
<!-- ========================= -->
|
@@ -7764,8 +7813,12 @@
|
|
7764
7813
|
<xsl:variable name="isAdded" select="../@added"/>
|
7765
7814
|
<xsl:variable name="isDeleted" select="../@deleted"/>
|
7766
7815
|
<xsl:choose>
|
7767
|
-
<xsl:when test="ancestor::*[local-name() = 'title']">
|
7816
|
+
<xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
7768
7817
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
7818
|
+
<xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
|
7819
|
+
<xsl:attribute name="padding-left">0mm</xsl:attribute>
|
7820
|
+
<xsl:attribute name="padding-right">0mm</xsl:attribute>
|
7821
|
+
</xsl:if>
|
7769
7822
|
<xsl:variable name="src">
|
7770
7823
|
<xsl:call-template name="image_src"/>
|
7771
7824
|
</xsl:variable>
|
@@ -7798,25 +7851,45 @@
|
|
7798
7851
|
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
7799
7852
|
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
7800
7853
|
|
7801
|
-
<xsl:
|
7802
|
-
<xsl:
|
7803
|
-
<xsl:
|
7804
|
-
|
7805
|
-
|
7806
|
-
</xsl:variable>
|
7854
|
+
<xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
|
7855
|
+
<xsl:attribute name="width">
|
7856
|
+
<xsl:value-of select="@width"/>
|
7857
|
+
</xsl:attribute>
|
7858
|
+
</xsl:if>
|
7807
7859
|
|
7808
|
-
<xsl:
|
7860
|
+
<xsl:if test="@height != '' and @height != 'auto'">
|
7861
|
+
<xsl:attribute name="height">
|
7862
|
+
<xsl:value-of select="@height"/>
|
7863
|
+
</xsl:attribute>
|
7864
|
+
</xsl:if>
|
7809
7865
|
|
7810
|
-
|
7866
|
+
<xsl:choose>
|
7867
|
+
<xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
|
7868
|
+
<xsl:attribute name="scaling">non-uniform</xsl:attribute>
|
7869
|
+
</xsl:when>
|
7870
|
+
<xsl:otherwise>
|
7811
7871
|
|
7812
|
-
|
7872
|
+
<xsl:variable name="img_src">
|
7873
|
+
<xsl:choose>
|
7874
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
7875
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
7876
|
+
</xsl:choose>
|
7877
|
+
</xsl:variable>
|
7813
7878
|
|
7814
|
-
|
7815
|
-
<xsl:if test="number($scale) < 100">
|
7879
|
+
<xsl:variable name="image_width_effective">
|
7816
7880
|
|
7817
|
-
|
7881
|
+
<xsl:value-of select="$width_effective"/>
|
7818
7882
|
|
7819
|
-
|
7883
|
+
</xsl:variable>
|
7884
|
+
|
7885
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
7886
|
+
<xsl:if test="number($scale) < 100">
|
7887
|
+
|
7888
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
7889
|
+
|
7890
|
+
</xsl:if>
|
7891
|
+
</xsl:otherwise>
|
7892
|
+
</xsl:choose>
|
7820
7893
|
|
7821
7894
|
</xsl:if>
|
7822
7895
|
|
@@ -11488,7 +11561,7 @@
|
|
11488
11561
|
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
|
11489
11562
|
<xsl:apply-templates mode="update_xml_step1"/>
|
11490
11563
|
</xsl:template>
|
11491
|
-
<xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
|
11564
|
+
<xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
|
11492
11565
|
<xsl:copy>
|
11493
11566
|
<xsl:copy-of select="@*"/>
|
11494
11567
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -12054,7 +12127,7 @@
|
|
12054
12127
|
<xsl:variable name="title">
|
12055
12128
|
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
12056
12129
|
|
12057
|
-
<xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'part']"/>
|
12130
|
+
<xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'title-part']"/>
|
12058
12131
|
|
12059
12132
|
</xsl:for-each>
|
12060
12133
|
</xsl:variable>
|
@@ -12077,7 +12150,7 @@
|
|
12077
12150
|
<dc:description>
|
12078
12151
|
<xsl:variable name="abstract">
|
12079
12152
|
|
12080
|
-
<xsl:value-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
|
12153
|
+
<xsl:value-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = $lang and @type = 'title-main']"/>
|
12081
12154
|
|
12082
12155
|
</xsl:variable>
|
12083
12156
|
<xsl:value-of select="normalize-space($abstract)"/>
|
data/lib/isodoc/bipm/metadata.rb
CHANGED
@@ -27,14 +27,14 @@ module IsoDoc
|
|
27
27
|
def title(isoxml, _out)
|
28
28
|
lang1, lang2 = @lang == "fr" ? %w(fr en) : %w(en fr)
|
29
29
|
set(:doctitle, @c.encode(isoxml.at(
|
30
|
-
ns("#{TITLE}[@type='main'][@language='#{lang1}']"))&.text || ""))
|
30
|
+
ns("#{TITLE}[@type='title-main'][@language='#{lang1}']"))&.text || ""))
|
31
31
|
set(:docsubtitle, @c.encode(isoxml.at(
|
32
|
-
ns("#{TITLE}[@type='main'][@language='#{lang2}']"))&.text || ""))
|
32
|
+
ns("#{TITLE}[@type='title-main'][@language='#{lang2}']"))&.text || ""))
|
33
33
|
%w(appendix annex part subtitle provenance).each do |e|
|
34
34
|
set("#{e}title".to_sym, @c.encode(isoxml.at(
|
35
|
-
ns("#{TITLE}[@type='
|
35
|
+
ns("#{TITLE}[@type='title-#{e}'][@language='#{lang1}']"))&.text || ""))
|
36
36
|
set("#{e}subtitle".to_sym, @c.encode(isoxml.at(
|
37
|
-
ns("#{TITLE}[@type='
|
37
|
+
ns("#{TITLE}[@type='title-#{e}'][@language='#{lang2}']"))&.text || ""))
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module IsoDoc
|
2
|
+
module BIPM
|
3
|
+
class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
|
4
|
+
def middle_title(docxml)
|
5
|
+
@jcgm or return nil
|
6
|
+
@iso.middle_title(docxml)
|
7
|
+
end
|
8
|
+
|
9
|
+
def table1(elem)
|
10
|
+
labelled_ancestor(elem) || elem["unnumbered"] and return
|
11
|
+
n = @xrefs.anchor(elem["id"], :label, false)
|
12
|
+
prefix_name(elem, ".<tab/>",
|
13
|
+
l10n("#{@i18n.table.capitalize} #{n}"), "name")
|
14
|
+
end
|
15
|
+
|
16
|
+
def figure1(elem)
|
17
|
+
if @jcgm
|
18
|
+
@iso.xrefs = @xrefs
|
19
|
+
@iso.figure1(elem)
|
20
|
+
else super
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# notes and remarques (list notes) are not numbered
|
25
|
+
def note1(elem)
|
26
|
+
elem.parent.name == "bibitem" || elem["notag"] == "true" and return
|
27
|
+
lbl = l10n(note_label(elem))
|
28
|
+
prefix_name(elem, "", lbl, "name")
|
29
|
+
end
|
30
|
+
|
31
|
+
def note_label(elem)
|
32
|
+
if elem.ancestors("preface").empty?
|
33
|
+
if elem.ancestors("ul, ol, dl").empty?
|
34
|
+
@i18n.note
|
35
|
+
else @i18n.listnote end
|
36
|
+
else @i18n.prefacenote
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -5,6 +5,7 @@ require_relative "init"
|
|
5
5
|
require_relative "index"
|
6
6
|
require_relative "doccontrol"
|
7
7
|
require_relative "../../relaton/render/general"
|
8
|
+
require_relative "presentation_blocks"
|
8
9
|
|
9
10
|
module IsoDoc
|
10
11
|
module BIPM
|
@@ -12,33 +13,25 @@ module IsoDoc
|
|
12
13
|
def convert1(docxml, filename, dir)
|
13
14
|
@jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/" \
|
14
15
|
"@acronym"))&.value == "JCGM"
|
15
|
-
@
|
16
|
-
|
17
|
-
i18n = @iso.i18n_init(@lang, @script, @locale, nil)
|
18
|
-
@iso.metadata_init(@lang, @script, @locale, i18n)
|
16
|
+
@xrefs.klass.jcgm = @jcgm
|
17
|
+
@jcgm and @iso = iso_processor(docxml)
|
19
18
|
super
|
20
19
|
end
|
21
20
|
|
21
|
+
def iso_processor(docxml)
|
22
|
+
iso = IsoDoc::Iso::PresentationXMLConvert
|
23
|
+
.new({ language: @lang, script: @script })
|
24
|
+
i18n = iso.i18n_init(@lang, @script, @locale, nil)
|
25
|
+
iso.metadata_init(@lang, @script, @locale, i18n)
|
26
|
+
iso.info(docxml, nil)
|
27
|
+
iso
|
28
|
+
end
|
29
|
+
|
22
30
|
def eref_localities1(opt)
|
23
31
|
@jcgm and return @iso.eref_localities1(opt)
|
24
32
|
super
|
25
33
|
end
|
26
34
|
|
27
|
-
def table1(elem)
|
28
|
-
labelled_ancestor(elem) || elem["unnumbered"] and return
|
29
|
-
n = @xrefs.anchor(elem["id"], :label, false)
|
30
|
-
prefix_name(elem, ".<tab/>",
|
31
|
-
l10n("#{@i18n.table.capitalize} #{n}"), "name")
|
32
|
-
end
|
33
|
-
|
34
|
-
def figure1(elem)
|
35
|
-
if @jcgm
|
36
|
-
@iso.xrefs = @xrefs
|
37
|
-
@iso.figure1(elem)
|
38
|
-
else super
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
35
|
def annex1(elem)
|
43
36
|
@jcgm and return super
|
44
37
|
elem["unnumbered"] == "true" and return
|
@@ -77,8 +70,8 @@ module IsoDoc
|
|
77
70
|
end
|
78
71
|
|
79
72
|
def conversions(docxml)
|
80
|
-
super
|
81
73
|
doccontrol docxml
|
74
|
+
super
|
82
75
|
end
|
83
76
|
|
84
77
|
def twitter_cldr_localiser_symbols
|
@@ -115,9 +108,9 @@ module IsoDoc
|
|
115
108
|
def bibdata_titles(bibdata)
|
116
109
|
app = bibdata.at(ns("//bibdata/ext/" \
|
117
110
|
"structuredidentifier/part")) or return
|
118
|
-
bibdata.xpath(ns("//bibdata/title[@type = 'part']")).each do |t|
|
111
|
+
bibdata.xpath(ns("//bibdata/title[@type = 'title-part']")).each do |t|
|
119
112
|
t.previous = t.dup
|
120
|
-
t["type"] = "part-with-numbering"
|
113
|
+
t["type"] = "title-part-with-numbering"
|
121
114
|
part = t["language"] == "en" ? "Part" : "Partie" # not looking up in YAML
|
122
115
|
t.children = l10n("#{part} #{app.text}: #{to_xml(t.children)}",
|
123
116
|
t["language"])
|
@@ -170,22 +163,6 @@ module IsoDoc
|
|
170
163
|
end
|
171
164
|
end
|
172
165
|
|
173
|
-
# notes and remarques (list notes) are not numbered
|
174
|
-
def note1(elem)
|
175
|
-
elem.parent.name == "bibitem" || elem["notag"] == "true" and return
|
176
|
-
lbl = l10n(note_label(elem))
|
177
|
-
prefix_name(elem, "", lbl, "name")
|
178
|
-
end
|
179
|
-
|
180
|
-
def note_label(elem)
|
181
|
-
if elem.ancestors("preface").empty?
|
182
|
-
if elem.ancestors("ul, ol, dl").empty?
|
183
|
-
@i18n.note
|
184
|
-
else @i18n.listnote end
|
185
|
-
else @i18n.prefacenote
|
186
|
-
end
|
187
|
-
end
|
188
|
-
|
189
166
|
def termsource1(elem)
|
190
167
|
# elem["status"] == "modified" and return super
|
191
168
|
while elem&.next_element&.name == "termsource"
|