metanorma-bipm 2.7.7 → 2.7.9
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/bipm.brochure.xsl +190 -103
- data/lib/isodoc/bipm/bipm.guide.xsl +190 -103
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +190 -103
- data/lib/isodoc/bipm/bipm.rapport.xsl +190 -103
- data/lib/isodoc/bipm/init.rb +2 -1
- data/lib/isodoc/bipm/jcgm.standard.xsl +162 -78
- data/lib/metanorma/bipm/biblio.rng +4 -4
- data/lib/metanorma/bipm/cleanup.rb +13 -0
- data/lib/metanorma/bipm/converter.rb +4 -4
- data/lib/metanorma/bipm/front.rb +14 -16
- data/lib/metanorma/bipm/isodoc.rng +27 -10
- data/lib/metanorma/bipm/log.rb +17 -0
- data/lib/metanorma/bipm/version.rb +1 -1
- data/lib/relaton/render/citations.rb +12 -0
- data/lib/relaton/render/config.yml +11 -11
- data/lib/relaton/render/general.rb +1 -0
- data/metanorma-bipm.gemspec +3 -2
- metadata +22 -6
|
@@ -800,18 +800,16 @@
|
|
|
800
800
|
<xsl:otherwise>fo:block</xsl:otherwise>
|
|
801
801
|
</xsl:choose>
|
|
802
802
|
</xsl:variable>
|
|
803
|
-
<xsl:element name="{$element-name}">
|
|
804
803
|
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
804
|
+
<xsl:variable name="p_styles">
|
|
805
|
+
<styles xsl:use-attribute-sets="p-style">
|
|
806
|
+
<xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
|
|
807
|
+
</styles>
|
|
808
|
+
</xsl:variable>
|
|
809
|
+
|
|
810
|
+
<xsl:element name="{$element-name}">
|
|
811
|
+
<xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
|
|
808
812
|
|
|
809
|
-
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
|
810
|
-
<xsl:if test="ancestor::*[@first or @slave]">
|
|
811
|
-
<!-- JCGM two column layout -->
|
|
812
|
-
<xsl:attribute name="widows">1</xsl:attribute>
|
|
813
|
-
<xsl:attribute name="orphans">1</xsl:attribute>
|
|
814
|
-
</xsl:if>
|
|
815
813
|
<xsl:apply-templates>
|
|
816
814
|
<xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
|
|
817
815
|
</xsl:apply-templates>
|
|
@@ -1147,21 +1145,6 @@
|
|
|
1147
1145
|
|
|
1148
1146
|
<xsl:template match="mn:fmt-title" name="title">
|
|
1149
1147
|
|
|
1150
|
-
<xsl:variable name="level">
|
|
1151
|
-
<xsl:call-template name="getLevel"/>
|
|
1152
|
-
</xsl:variable>
|
|
1153
|
-
|
|
1154
|
-
<xsl:variable name="font-size">
|
|
1155
|
-
<xsl:choose>
|
|
1156
|
-
<xsl:when test="ancestor::mn:preface">15pt</xsl:when>
|
|
1157
|
-
<xsl:when test="parent::mn:annex">15pt</xsl:when>
|
|
1158
|
-
<xsl:when test="../@inline-header = 'true' or @inline-header = 'true'">10.5pt</xsl:when>
|
|
1159
|
-
<xsl:when test="$level = 2">11.5pt</xsl:when>
|
|
1160
|
-
<xsl:when test="$level >= 3">10.5pt</xsl:when>
|
|
1161
|
-
<xsl:otherwise>13pt</xsl:otherwise><!-- level 1 -->
|
|
1162
|
-
</xsl:choose>
|
|
1163
|
-
</xsl:variable>
|
|
1164
|
-
|
|
1165
1148
|
<xsl:variable name="element-name">
|
|
1166
1149
|
<xsl:choose>
|
|
1167
1150
|
<xsl:when test="../@inline-header = 'true' or @inline-header = 'true'">fo:inline</xsl:when>
|
|
@@ -1169,53 +1152,22 @@
|
|
|
1169
1152
|
</xsl:choose>
|
|
1170
1153
|
</xsl:variable>
|
|
1171
1154
|
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
<xsl:attribute name="space-before"> <!-- margin-top -->
|
|
1176
|
-
<xsl:choose>
|
|
1155
|
+
<xsl:variable name="title_styles">
|
|
1156
|
+
<styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template></styles>
|
|
1157
|
+
</xsl:variable>
|
|
1177
1158
|
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
<xsl:when test="$level = 2">18pt</xsl:when>
|
|
1181
|
-
<xsl:when test="$level >= 3">3pt</xsl:when>
|
|
1182
|
-
<xsl:when test="$level = ''">6pt</xsl:when><!-- 13.5pt -->
|
|
1183
|
-
<xsl:otherwise>12pt</xsl:otherwise>
|
|
1184
|
-
</xsl:choose>
|
|
1185
|
-
</xsl:attribute>
|
|
1186
|
-
<xsl:attribute name="space-after">
|
|
1187
|
-
<xsl:choose>
|
|
1188
|
-
<xsl:when test="ancestor::mn:preface">12pt</xsl:when>
|
|
1189
|
-
<xsl:when test="parent::mn:annex">30pt</xsl:when>
|
|
1190
|
-
<xsl:when test="following-sibling::*[1][self::mn:fmt-admitted]">0pt</xsl:when>
|
|
1191
|
-
<!-- <xsl:otherwise>12pt</xsl:otherwise> -->
|
|
1192
|
-
<xsl:otherwise>12pt</xsl:otherwise>
|
|
1193
|
-
</xsl:choose>
|
|
1194
|
-
</xsl:attribute>
|
|
1195
|
-
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
1196
|
-
<xsl:if test="$element-name = 'fo:inline'">
|
|
1197
|
-
<xsl:attribute name="padding-right">
|
|
1198
|
-
<xsl:choose>
|
|
1199
|
-
<xsl:when test="$level = 3">6.5mm</xsl:when>
|
|
1200
|
-
<xsl:otherwise>4mm</xsl:otherwise>
|
|
1201
|
-
</xsl:choose>
|
|
1202
|
-
</xsl:attribute>
|
|
1203
|
-
</xsl:if>
|
|
1204
|
-
<xsl:if test="parent::mn:annex">
|
|
1205
|
-
<xsl:attribute name="text-align">center</xsl:attribute>
|
|
1206
|
-
<xsl:attribute name="line-height">130%</xsl:attribute>
|
|
1207
|
-
</xsl:if>
|
|
1208
|
-
<xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
|
|
1209
|
-
<xsl:apply-templates/>
|
|
1210
|
-
<xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
|
|
1211
|
-
</xsl:element>
|
|
1159
|
+
<xsl:element name="{$element-name}">
|
|
1160
|
+
<xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
|
|
1212
1161
|
|
|
1213
|
-
<xsl:
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
</fo:block>
|
|
1217
|
-
</xsl:if>
|
|
1162
|
+
<xsl:apply-templates/>
|
|
1163
|
+
<xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
|
|
1164
|
+
</xsl:element>
|
|
1218
1165
|
|
|
1166
|
+
<xsl:if test="$element-name = 'fo:inline' and not(following-sibling::mn:p)">
|
|
1167
|
+
<fo:block>
|
|
1168
|
+
<xsl:value-of select="$linebreak"/>
|
|
1169
|
+
</fo:block>
|
|
1170
|
+
</xsl:if>
|
|
1219
1171
|
</xsl:template>
|
|
1220
1172
|
|
|
1221
1173
|
<xsl:template match="mn:metanorma/mn:bibdata/mn:edition">
|
|
@@ -3950,6 +3902,10 @@
|
|
|
3950
3902
|
</xsl:element>
|
|
3951
3903
|
</xsl:template>
|
|
3952
3904
|
|
|
3905
|
+
<!-- show sourcecode's name 'before' or 'after' source code -->
|
|
3906
|
+
<xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
|
|
3907
|
+
</xsl:variable>
|
|
3908
|
+
|
|
3953
3909
|
<xsl:template match="mn:sourcecode" name="sourcecode">
|
|
3954
3910
|
|
|
3955
3911
|
<xsl:variable name="sourcecode_attributes">
|
|
@@ -3973,7 +3929,12 @@
|
|
|
3973
3929
|
|
|
3974
3930
|
<xsl:call-template name="refine_sourcecode-container-style"/>
|
|
3975
3931
|
|
|
3976
|
-
<fo:block-container margin-left="0mm" role="SKIP">
|
|
3932
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
|
3933
|
+
|
|
3934
|
+
<!-- <xsl:if test="$namespace = 'rsd'"> -->
|
|
3935
|
+
<xsl:if test="$sourcecode-name-position = 'before'">
|
|
3936
|
+
<xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
|
|
3937
|
+
</xsl:if>
|
|
3977
3938
|
|
|
3978
3939
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
|
3979
3940
|
|
|
@@ -3995,7 +3956,16 @@
|
|
|
3995
3956
|
</fo:block>
|
|
3996
3957
|
|
|
3997
3958
|
<xsl:apply-templates select="mn:dl"/> <!-- Key table -->
|
|
3998
|
-
|
|
3959
|
+
|
|
3960
|
+
<!-- <xsl:choose>
|
|
3961
|
+
<xsl:when test="$namespace = 'rsd'"></xsl:when>
|
|
3962
|
+
<xsl:otherwise>
|
|
3963
|
+
<xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
|
|
3964
|
+
<!-- </xsl:otherwise>
|
|
3965
|
+
</xsl:choose> -->
|
|
3966
|
+
<xsl:if test="$sourcecode-name-position = 'after'">
|
|
3967
|
+
<xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
|
|
3968
|
+
</xsl:if>
|
|
3999
3969
|
|
|
4000
3970
|
</fo:block-container>
|
|
4001
3971
|
</fo:block-container>
|
|
@@ -9867,6 +9837,10 @@
|
|
|
9867
9837
|
<!-- image -->
|
|
9868
9838
|
<!-- ====== -->
|
|
9869
9839
|
|
|
9840
|
+
<!-- show figure's name 'before' or 'after' image -->
|
|
9841
|
+
<xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
|
|
9842
|
+
</xsl:variable>
|
|
9843
|
+
|
|
9870
9844
|
<xsl:template match="mn:figure" name="figure">
|
|
9871
9845
|
<xsl:variable name="isAdded" select="@added"/>
|
|
9872
9846
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
|
@@ -9879,6 +9853,10 @@
|
|
|
9879
9853
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
|
9880
9854
|
</xsl:call-template>
|
|
9881
9855
|
|
|
9856
|
+
<xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
|
|
9857
|
+
<xsl:apply-templates select="mn:fmt-name"/>
|
|
9858
|
+
</xsl:if>
|
|
9859
|
+
|
|
9882
9860
|
<!-- Example: Dimensions in millimeters -->
|
|
9883
9861
|
<xsl:apply-templates select="mn:note[@type = 'units']"/>
|
|
9884
9862
|
|
|
@@ -9899,7 +9877,16 @@
|
|
|
9899
9877
|
<xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
|
|
9900
9878
|
<xsl:call-template name="showFigureKey"/>
|
|
9901
9879
|
</xsl:if>
|
|
9902
|
-
|
|
9880
|
+
|
|
9881
|
+
<!-- <xsl:choose>
|
|
9882
|
+
<xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
|
|
9883
|
+
<xsl:otherwise>
|
|
9884
|
+
<xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
|
|
9885
|
+
<!-- </xsl:otherwise>
|
|
9886
|
+
</xsl:choose> -->
|
|
9887
|
+
<xsl:if test="$figure-name-position = 'after'">
|
|
9888
|
+
<xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
|
|
9889
|
+
</xsl:if>
|
|
9903
9890
|
|
|
9904
9891
|
</fo:block-container>
|
|
9905
9892
|
</xsl:template>
|
|
@@ -11988,11 +11975,10 @@
|
|
|
11988
11975
|
<!-- END Admonition -->
|
|
11989
11976
|
<!-- ================ -->
|
|
11990
11977
|
|
|
11991
|
-
<xsl:attribute-set name="
|
|
11978
|
+
<xsl:attribute-set name="bibliography-title-style">
|
|
11992
11979
|
</xsl:attribute-set>
|
|
11993
11980
|
|
|
11994
|
-
<xsl:template name="
|
|
11995
|
-
|
|
11981
|
+
<xsl:template name="refine_bibliography-title-style">
|
|
11996
11982
|
</xsl:template>
|
|
11997
11983
|
|
|
11998
11984
|
<!-- bibitem in Normative References (references/@normative="true") -->
|
|
@@ -14056,7 +14042,14 @@
|
|
|
14056
14042
|
<!-- ===================================== -->
|
|
14057
14043
|
|
|
14058
14044
|
<xsl:attribute-set name="annex-title-style">
|
|
14059
|
-
|
|
14045
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
14046
|
+
<xsl:attribute name="font-size">15pt</xsl:attribute>
|
|
14047
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
|
14048
|
+
<xsl:attribute name="text-align">center</xsl:attribute>
|
|
14049
|
+
<xsl:attribute name="space-before">0pt</xsl:attribute>
|
|
14050
|
+
<xsl:attribute name="space-after">30pt</xsl:attribute>
|
|
14051
|
+
<xsl:attribute name="line-height">130%</xsl:attribute>
|
|
14052
|
+
</xsl:attribute-set> <!-- annex-title-style -->
|
|
14060
14053
|
|
|
14061
14054
|
<xsl:template name="refine_annex-title-style">
|
|
14062
14055
|
</xsl:template>
|
|
@@ -14067,6 +14060,84 @@
|
|
|
14067
14060
|
<xsl:template name="refine_p-zzSTDTitle1-style">
|
|
14068
14061
|
</xsl:template>
|
|
14069
14062
|
|
|
14063
|
+
<xsl:attribute-set name="p-style">
|
|
14064
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
|
14065
|
+
</xsl:attribute-set> <!-- p-style -->
|
|
14066
|
+
|
|
14067
|
+
<xsl:template name="refine_p-style">
|
|
14068
|
+
<xsl:param name="element-name"/>
|
|
14069
|
+
<xsl:param name="margin"/>
|
|
14070
|
+
<xsl:call-template name="setBlockAttributes">
|
|
14071
|
+
<xsl:with-param name="text_align_default">justify</xsl:with-param>
|
|
14072
|
+
</xsl:call-template>
|
|
14073
|
+
|
|
14074
|
+
<xsl:if test="ancestor::*[@first or @slave]">
|
|
14075
|
+
<!-- JCGM two column layout -->
|
|
14076
|
+
<xsl:attribute name="widows">1</xsl:attribute>
|
|
14077
|
+
<xsl:attribute name="orphans">1</xsl:attribute>
|
|
14078
|
+
</xsl:if>
|
|
14079
|
+
<!-- $namespace = 'jcgm' -->
|
|
14080
|
+
|
|
14081
|
+
</xsl:template> <!-- refine_p-style -->
|
|
14082
|
+
|
|
14083
|
+
<xsl:attribute-set name="title-style">
|
|
14084
|
+
<!-- Note: font-size for level 1 title -->
|
|
14085
|
+
<xsl:attribute name="font-size">13pt</xsl:attribute>
|
|
14086
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
|
14087
|
+
<xsl:attribute name="space-before">36pt</xsl:attribute>
|
|
14088
|
+
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
|
14089
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
14090
|
+
</xsl:attribute-set> <!-- title-style -->
|
|
14091
|
+
|
|
14092
|
+
<xsl:template name="refine_title-style">
|
|
14093
|
+
<xsl:param name="element-name"/>
|
|
14094
|
+
<xsl:variable name="level">
|
|
14095
|
+
<xsl:call-template name="getLevel"/>
|
|
14096
|
+
</xsl:variable>
|
|
14097
|
+
|
|
14098
|
+
<xsl:if test="$level = 2">
|
|
14099
|
+
<xsl:attribute name="font-size">11.5pt</xsl:attribute>
|
|
14100
|
+
<xsl:attribute name="space-before">18pt</xsl:attribute>
|
|
14101
|
+
</xsl:if>
|
|
14102
|
+
<xsl:if test="$level >= 3">
|
|
14103
|
+
<xsl:attribute name="font-size">10.5pt</xsl:attribute>
|
|
14104
|
+
<xsl:attribute name="space-before">3pt</xsl:attribute>
|
|
14105
|
+
</xsl:if>
|
|
14106
|
+
<xsl:if test="../@inline-header = 'true' or @inline-header = 'true'">
|
|
14107
|
+
<xsl:attribute name="font-size">10.5pt</xsl:attribute>
|
|
14108
|
+
</xsl:if>
|
|
14109
|
+
<xsl:if test="following-sibling::*[1][self::mn:fmt-admitted]">
|
|
14110
|
+
<xsl:attribute name="space-after">0pt</xsl:attribute>
|
|
14111
|
+
</xsl:if>
|
|
14112
|
+
<xsl:if test="ancestor::mn:preface">
|
|
14113
|
+
<xsl:attribute name="font-size">15pt</xsl:attribute>
|
|
14114
|
+
<xsl:attribute name="space-after">12pt</xsl:attribute>
|
|
14115
|
+
</xsl:if>
|
|
14116
|
+
|
|
14117
|
+
<xsl:if test="$element-name = 'fo:inline'">
|
|
14118
|
+
<xsl:attribute name="padding-right">
|
|
14119
|
+
<xsl:choose>
|
|
14120
|
+
<xsl:when test="$level = 3">6.5mm</xsl:when>
|
|
14121
|
+
<xsl:otherwise>4mm</xsl:otherwise>
|
|
14122
|
+
</xsl:choose>
|
|
14123
|
+
</xsl:attribute>
|
|
14124
|
+
</xsl:if>
|
|
14125
|
+
<xsl:if test="parent::mn:annex"><!-- Annex title -->
|
|
14126
|
+
<xsl:variable name="annex_title_styles">
|
|
14127
|
+
<styles xsl:use-attribute-sets="annex-title-style"><xsl:call-template name="refine_annex-title-style"/></styles>
|
|
14128
|
+
</xsl:variable>
|
|
14129
|
+
<xsl:copy-of select="xalan:nodeset($annex_title_styles)/styles/@*"/>
|
|
14130
|
+
</xsl:if>
|
|
14131
|
+
<xsl:if test="parent::mn:references[not(@normative='true')]"><!-- Bibliography section title -->
|
|
14132
|
+
<xsl:variable name="bibliography_title_styles">
|
|
14133
|
+
<styles xsl:use-attribute-sets="bibliography-title-style"><xsl:call-template name="refine_bibliography-title-style"/></styles>
|
|
14134
|
+
</xsl:variable>
|
|
14135
|
+
<xsl:copy-of select="xalan:nodeset($bibliography_title_styles)/styles/@*"/>
|
|
14136
|
+
</xsl:if>
|
|
14137
|
+
<!-- $namespace = 'jcgm' -->
|
|
14138
|
+
<xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
|
|
14139
|
+
</xsl:template> <!-- refine_title-style -->
|
|
14140
|
+
|
|
14070
14141
|
<xsl:template name="processPrefaceSectionsDefault">
|
|
14071
14142
|
<xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
|
|
14072
14143
|
<xsl:sort select="@displayorder" data-type="number"/>
|
|
@@ -14405,6 +14476,12 @@
|
|
|
14405
14476
|
</xsl:choose>
|
|
14406
14477
|
</xsl:template>
|
|
14407
14478
|
|
|
14479
|
+
<xsl:attribute-set name="reset-margins-style">
|
|
14480
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
|
14481
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
|
14482
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
|
14483
|
+
</xsl:attribute-set>
|
|
14484
|
+
|
|
14408
14485
|
<xsl:attribute-set name="clause-style">
|
|
14409
14486
|
|
|
14410
14487
|
</xsl:attribute-set>
|
|
@@ -15421,8 +15498,9 @@
|
|
|
15421
15498
|
|
|
15422
15499
|
<xsl:template name="setTextAlignment">
|
|
15423
15500
|
<xsl:param name="default">left</xsl:param>
|
|
15501
|
+
<xsl:param name="skip_default">false</xsl:param>
|
|
15424
15502
|
<xsl:variable name="align" select="normalize-space(@align)"/>
|
|
15425
|
-
<xsl:
|
|
15503
|
+
<xsl:variable name="text_align">
|
|
15426
15504
|
<xsl:choose>
|
|
15427
15505
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
|
15428
15506
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
|
@@ -15430,9 +15508,13 @@
|
|
|
15430
15508
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
|
15431
15509
|
<xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
|
|
15432
15510
|
<xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
|
|
15511
|
+
<xsl:when test="$skip_default = 'true'"/>
|
|
15433
15512
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
|
15434
15513
|
</xsl:choose>
|
|
15435
|
-
</xsl:
|
|
15514
|
+
</xsl:variable>
|
|
15515
|
+
<xsl:if test="normalize-space($text_align) != ''">
|
|
15516
|
+
<xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
|
|
15517
|
+
</xsl:if>
|
|
15436
15518
|
<xsl:if test="$align = 'indent'">
|
|
15437
15519
|
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
|
15438
15520
|
</xsl:if>
|
|
@@ -15440,8 +15522,10 @@
|
|
|
15440
15522
|
|
|
15441
15523
|
<xsl:template name="setBlockAttributes">
|
|
15442
15524
|
<xsl:param name="text_align_default">left</xsl:param>
|
|
15525
|
+
<xsl:param name="skip_text_align_default">false</xsl:param>
|
|
15443
15526
|
<xsl:call-template name="setTextAlignment">
|
|
15444
15527
|
<xsl:with-param name="default" select="$text_align_default"/>
|
|
15528
|
+
<xsl:with-param name="skip_default" select="$skip_text_align_default"/>
|
|
15445
15529
|
</xsl:call-template>
|
|
15446
15530
|
<xsl:call-template name="setKeepAttributes"/>
|
|
15447
15531
|
<xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
|
|
@@ -690,7 +690,7 @@ Examples include GRID, LEI, CrossRef, and Ringgold</a:documentation>
|
|
|
690
690
|
<define name="CitationType">
|
|
691
691
|
<attribute name="bibitemid">
|
|
692
692
|
<a:documentation>Bibliographic item that the citation applies to, referenced as the anchor of a bibliographic description</a:documentation>
|
|
693
|
-
<
|
|
693
|
+
<ref name="IdRefType"/>
|
|
694
694
|
</attribute>
|
|
695
695
|
<choice>
|
|
696
696
|
<zeroOrMore>
|
|
@@ -1296,17 +1296,17 @@ for which this claim of validity is made, if applicable</a:documentation>
|
|
|
1296
1296
|
</define>
|
|
1297
1297
|
<define name="validityBegins">
|
|
1298
1298
|
<element name="validityBegins">
|
|
1299
|
-
<ref name="
|
|
1299
|
+
<ref name="ISO8601DateTime"/>
|
|
1300
1300
|
</element>
|
|
1301
1301
|
</define>
|
|
1302
1302
|
<define name="validityEnds">
|
|
1303
1303
|
<element name="validityEnds">
|
|
1304
|
-
<ref name="
|
|
1304
|
+
<ref name="ISO8601DateTime"/>
|
|
1305
1305
|
</element>
|
|
1306
1306
|
</define>
|
|
1307
1307
|
<define name="validityRevision">
|
|
1308
1308
|
<element name="revision">
|
|
1309
|
-
<ref name="
|
|
1309
|
+
<ref name="ISO8601DateTime"/>
|
|
1310
1310
|
</element>
|
|
1311
1311
|
</define>
|
|
1312
1312
|
<define name="TypedTitleString">
|
|
@@ -72,6 +72,19 @@ module Metanorma
|
|
|
72
72
|
p = parts["annexid"] and ret += ".#{p}"
|
|
73
73
|
id.children = "#{id.text}#{ret}"
|
|
74
74
|
end
|
|
75
|
+
|
|
76
|
+
def sections_variant_title_cleanup(xml)
|
|
77
|
+
path = section_containers.map { |x| "./ancestor::#{x}" }.join(" | ")
|
|
78
|
+
xml.xpath("//p[@variant_title]").each do |p|
|
|
79
|
+
p.name = "variant-title"
|
|
80
|
+
p.delete("variant_title")
|
|
81
|
+
p.xpath("(#{path})[last()]").each do |sect|
|
|
82
|
+
p.remove
|
|
83
|
+
(ins = sect.at("./title") and ins.next = p) or
|
|
84
|
+
sect.add_first_child(p)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
75
88
|
end
|
|
76
89
|
end
|
|
77
90
|
end
|
|
@@ -82,13 +82,11 @@ module Metanorma
|
|
|
82
82
|
committees.empty? and return
|
|
83
83
|
xml.xpath("//bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Committee']/name").each do |c|
|
|
84
84
|
committees.include? c.text or
|
|
85
|
-
@log.add("
|
|
86
|
-
"#{c.text} is not a recognised committee")
|
|
85
|
+
@log.add("BIPM_1", nil, params: [c.text])
|
|
87
86
|
end
|
|
88
87
|
xml.xpath("//bibdata/contributor[role/description = 'committee']/organization/subdivision[@type = 'Committee']/identifier[not(@type = 'full')]").each do |c|
|
|
89
88
|
committees.include? c.text or
|
|
90
|
-
@log.add("
|
|
91
|
-
"#{c.text} is not a recognised committee")
|
|
89
|
+
@log.add("BIPM_1", nil, params: [c.text])
|
|
92
90
|
end
|
|
93
91
|
end
|
|
94
92
|
|
|
@@ -124,3 +122,5 @@ module Metanorma
|
|
|
124
122
|
end
|
|
125
123
|
end
|
|
126
124
|
end
|
|
125
|
+
|
|
126
|
+
require_relative "log"
|
data/lib/metanorma/bipm/front.rb
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
module Metanorma
|
|
2
2
|
module Bipm
|
|
3
3
|
class Converter < Metanorma::Generic::Converter
|
|
4
|
-
def contrib_committee_subdiv(xml,
|
|
5
|
-
contributors_committees_filter_empty?(
|
|
6
|
-
xml.subdivision **attr_code(type:
|
|
7
|
-
subtype:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
committee[:abbr] and o.abbreviation committee[:abbr]
|
|
14
|
-
committee[:ident] and o.identifier committee[:ident]
|
|
4
|
+
def contrib_committee_subdiv(xml, comm)
|
|
5
|
+
contributors_committees_filter_empty?(comm) and return
|
|
6
|
+
xml.subdivision **attr_code(type: comm[:subdivtype],
|
|
7
|
+
subtype: comm[:type]) do |o|
|
|
8
|
+
add_noko_elem(o, "name", comm[:name])
|
|
9
|
+
add_noko_elem(o, "name", comm[:name_en], language: "en")
|
|
10
|
+
add_noko_elem(o, "name", comm[:name_fr], language: "fr")
|
|
11
|
+
add_noko_elem(o, "abbreviation", comm[:abbr])
|
|
12
|
+
add_noko_elem(o, "identifier", comm[:ident])
|
|
15
13
|
end
|
|
16
14
|
end
|
|
17
15
|
|
|
@@ -68,11 +66,11 @@ module Metanorma
|
|
|
68
66
|
def relation_supersedes_self1(xml, date, edition, draft)
|
|
69
67
|
xml.relation type: "supersedes" do |r|
|
|
70
68
|
r.bibitem do |b|
|
|
71
|
-
date
|
|
72
|
-
|
|
73
|
-
|
|
69
|
+
add_noko_elem(b, "date", date,
|
|
70
|
+
type: edition ? "published" : "circulated")
|
|
71
|
+
add_noko_elem(b, "edition", edition)
|
|
74
72
|
draft and b.version do |v|
|
|
75
|
-
v
|
|
73
|
+
add_noko_elem(v, "draft", draft)
|
|
76
74
|
end
|
|
77
75
|
end
|
|
78
76
|
end
|
|
@@ -85,7 +83,7 @@ module Metanorma
|
|
|
85
83
|
role = "editor"
|
|
86
84
|
end
|
|
87
85
|
xml.role type: role.downcase do |d|
|
|
88
|
-
d << desc
|
|
86
|
+
d << desc # can be empty
|
|
89
87
|
end
|
|
90
88
|
end
|
|
91
89
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<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">
|
|
3
|
-
<!-- VERSION v2.1.
|
|
3
|
+
<!-- VERSION v2.1.4 -->
|
|
4
4
|
|
|
5
5
|
<!--
|
|
6
6
|
ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
|
|
@@ -905,15 +905,32 @@ titlecase, or lowercase</a:documentation>
|
|
|
905
905
|
</element>
|
|
906
906
|
</define>
|
|
907
907
|
<define name="image" combine="choice">
|
|
908
|
-
<
|
|
909
|
-
<
|
|
910
|
-
|
|
911
|
-
<
|
|
912
|
-
|
|
913
|
-
<
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
908
|
+
<choice>
|
|
909
|
+
<element name="image">
|
|
910
|
+
<ref name="RequiredId"/>
|
|
911
|
+
<ref name="ImageAttributes"/>
|
|
912
|
+
<optional>
|
|
913
|
+
<element name="svg">
|
|
914
|
+
<a:documentation>Allow svg in image/svg, for consistency</a:documentation>
|
|
915
|
+
<oneOrMore>
|
|
916
|
+
<choice>
|
|
917
|
+
<text/>
|
|
918
|
+
<ref name="AnyElement"/>
|
|
919
|
+
</choice>
|
|
920
|
+
</oneOrMore>
|
|
921
|
+
</element>
|
|
922
|
+
</optional>
|
|
923
|
+
</element>
|
|
924
|
+
<element name="svg">
|
|
925
|
+
<a:documentation>Add svg mark up to image</a:documentation>
|
|
926
|
+
<oneOrMore>
|
|
927
|
+
<choice>
|
|
928
|
+
<text/>
|
|
929
|
+
<ref name="AnyElement"/>
|
|
930
|
+
</choice>
|
|
931
|
+
</oneOrMore>
|
|
932
|
+
</element>
|
|
933
|
+
</choice>
|
|
917
934
|
</define>
|
|
918
935
|
<define name="ParagraphFnBody" combine="interleave">
|
|
919
936
|
<ref name="BlockSource">
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module Metanorma
|
|
2
|
+
module Bipm
|
|
3
|
+
class Converter
|
|
4
|
+
BIPM_LOG_MESSAGES = {
|
|
5
|
+
# rubocop:disable Naming/VariableNumber
|
|
6
|
+
"BIPM_1": { category: "Document Attributes",
|
|
7
|
+
error: "%s is not a recognised committee",
|
|
8
|
+
severity: 2 },
|
|
9
|
+
}.freeze
|
|
10
|
+
# rubocop:enable Naming/VariableNumber
|
|
11
|
+
|
|
12
|
+
def log_messages
|
|
13
|
+
super.merge(BIPM_LOG_MESSAGES)
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module Relaton
|
|
2
|
+
module Render
|
|
3
|
+
class Citations
|
|
4
|
+
# TODO different behaviour for JCGM = ISO
|
|
5
|
+
def use_terminator?(ref, final, cit)
|
|
6
|
+
!ref || ref.empty? and return false
|
|
7
|
+
cit[:data][:home_standard] and return false
|
|
8
|
+
!ref.end_with?(final)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -14,34 +14,34 @@ extenttemplate:
|
|
|
14
14
|
inbook: "{{ volume }}: {{ page }}"
|
|
15
15
|
misc: "<strong>{{ volume }}</strong> ({{issue}}) {{ page }}, {{ duration }}"
|
|
16
16
|
template:
|
|
17
|
-
book: "{{ creatornames }} ({{role | capitalize}}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> ,_{{ edition | capitalize_first }}
|
|
17
|
+
book: "{{ creatornames }} ({{role | capitalize}}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> ,_{{ edition | capitalize_first }}$$$ [{{medium}}] ({% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}:_{{publisher}}) {{draft}} ({{ series }}) {{ uri }}$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$$ {{size}}$$$ {{extent}}$$$"
|
|
18
18
|
# TODO: omitted: author ids, subsidiary titles, subsidiary creators, rights metadata, distributor, item attributes, relationships
|
|
19
19
|
booklet: book
|
|
20
20
|
manual: book
|
|
21
21
|
proceedings: book
|
|
22
|
-
inbook: "{{ creatornames }} ({{role | capitalize}}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} {{ title }}
|
|
22
|
+
inbook: "{{ creatornames }} ({{role | capitalize}}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} {{ title }} $$$ {{ authoritative_identifier | join: '$$$ ' }}$$$ {{ labels['in'] | capitalize }}: {{ host_creatornames}} ({{ host_role | capitalize}}) <em>{{host_title}}</em> [{{medium}}] ({% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}:_{{publisher}}) {{draft}} ({{ series }}) $$$ {{size}}$$$ {{extent}}$$$ {{ uri }}$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$$"
|
|
23
23
|
inproceedings: inbook
|
|
24
24
|
incollection: inbook
|
|
25
25
|
# TODO: omitted: author ids, additional info for component part, subsidiary titles of host resource, rights metadata, distributor, relationships
|
|
26
|
-
journal: "<em>{{ title}}</em> [{{medium}}]
|
|
26
|
+
journal: "<em>{{ title}}</em> [{{medium}}] $$$ ({% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}:_{{publisher}})$$$ ({{date}})$$$ {{size}}$$$ {{extent}}$$$ {{ authoritative_identifier | join: '$$$ ' }}$$$ {{ uri }}$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$$"
|
|
27
27
|
# TODO subsidiary titles, rights metadata, item attributes, relationships
|
|
28
|
-
article: "{{ creatornames }} ({{role | capitalize}}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} {{ title }}
|
|
28
|
+
article: "{{ creatornames }} ({{role | capitalize}}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} {{ title }}$$$ <em>{{ series }}</em>$$$ [{{medium}}] {{draft}} $$$ {{size}}$$$ {{ extent }}$$$ {{ authoritative_identifier | join: '$$$ ' }}$$$ {{ uri }}$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$$"
|
|
29
29
|
# TODO: omitted: author ids, subsidiary titles, rights metadata, distributor, item attributes, relationships; newspapers
|
|
30
|
-
software: "{{ creatornames }} ({{ role | capitalize}}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em>
|
|
30
|
+
software: "{{ creatornames }} ({{ role | capitalize}}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> $$$ {{ labels['version'] | capitalize }}_{{ edition_raw }} {{draft}} $$$ [{{medium | capitalize}}]$$$ ({% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}:_{{publisher}})$$$ {{ authoritative_identifier | join: '$$$ ' }}$$$ {{ uri }}$$$ {{size}}$$$ {{ extent}}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$$ "
|
|
31
31
|
# TODO: omitted: author ids, subsidiary titles, subsidiary creators, copyright, license, distributor, system requirements, relationships
|
|
32
32
|
electronic resource: software
|
|
33
|
-
standard: "{% if home_standard %}<em>{{title}}</em>, _{{extent}}{%else%}{% if creatornames %}{{ creatornames }} ({{ role | capitalize}}){%else%}{{ publisher}}{%endif%}
|
|
33
|
+
standard: "{% if home_standard %}<em>{{title}}</em>, _{{extent}}{%else%}{% if creatornames %}{{ creatornames }} ({{ role | capitalize}}){%else%}{{ publisher}}{%endif%} $$$ ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> ({{nistpublisher}}), {{draft }} $$$ [{{ medium | capitalize }}]$$$ {{size}}$$$ {{ extent }}$$$ {{ authoritative_identifier | join: '$$$ ' }}$$$ {{ uri }}$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$${%endif%}"
|
|
34
34
|
# TODO: omitted: author ids, subsidiary titles, rights metadata, distributor, persistent identifier, item attributes, relationships
|
|
35
|
-
techreport: "{% if creatornames %}{{ creatornames }} ({{ role | capitalize}}){%else%}{{ publisher}}{%endif%}
|
|
36
|
-
dataset: "{{ creatornames }} ({{ role | capitalize }}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em>
|
|
35
|
+
techreport: "{% if creatornames %}{{ creatornames }} ({{ role | capitalize}}){%else%}{{ publisher}}{%endif%} $$$ ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> ({{nistpublisher}}), {{draft }} $$$ [{{ medium | capitalize }}]$$$ {{size}}$$$ {{ extent }}$$$ {{ authoritative_identifier | join: '$$$ ' }}$$$ {{ uri }}$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$$"
|
|
36
|
+
dataset: "{{ creatornames }} ({{ role | capitalize }}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> $$$ {{ labels['version'] | capitalize }}_{{ edition_raw }} [{{medium }}]$$$ {{ labels['in'] | capitalize }}:_{{series}}$$$ {{ authoritative_identifier | join: '$$$ ' }}$$$ {{ uri }}$$$ {{ size }}$$$ {{ extent}}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$$ "
|
|
37
37
|
# TODO: omitted: author ids, system requirements, host archive, copyright, license, data source, distributor, usage instructions, relationships, provenance
|
|
38
|
-
website: "{{ creatornames }} ({{ role | capitalize }}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em>
|
|
38
|
+
website: "{{ creatornames }} ({{ role | capitalize }}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> $$$ {{ labels['version'] | capitalize }}_{{ edition_raw }} [{{medium }}] ({% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}:_{{publisher}}) {{ draft }} $$$ {{ authoritative_identifier | join: '$$$ ' }}$$$ {{ uri }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$$ "
|
|
39
39
|
# TODO: omitted: author ids, page title, system requirements, subsidiary creator, rights metadata, distributor, persistent identifier, archive location, archive date and time, relationships
|
|
40
40
|
webresource: website
|
|
41
41
|
# TODO: component part
|
|
42
|
-
unpublished: "{{ creatornames }} ({{ role | capitalize }}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> [{{ medium }}] {{ draft }}
|
|
42
|
+
unpublished: "{{ creatornames }} ({{ role | capitalize }}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> [{{ medium }}] {{ draft }} $$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ {{ authoritative_identifier | join: '$$$ ' }}$$$ {{ uri }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$$"
|
|
43
43
|
misc: unpublished
|
|
44
44
|
# TODO: omitted: author ids, subsidiary titles, subsidiary creators, host archive, item attributes, relationships
|
|
45
45
|
presentation: unpublished
|
|
46
|
-
thesis: "{{ creatornames }} ({{ role | capitalize }}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> [{{ medium }}] ({% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}:_{{publisher}})
|
|
46
|
+
thesis: "{{ creatornames }} ({{ role | capitalize }}) ({{date}} ({{ labels['updated'] }}_{{date_updated}}) {% if date %}){% endif %} <em>{{ title }}</em> [{{ medium }}] ({% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}:_{{publisher}})$$$ {{ labels['at'] | capitalize}}:_{{ access_location }}$$$ {{ authoritative_identifier | join: '$$$ ' }}$$$ {{ uri }}$$$ [{{ labels['viewed'] }}:_{{date_accessed}}]$$$"
|
|
47
47
|
|