metanorma-bipm 2.2.1 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/bipm/base_convert.rb +3 -3
- data/lib/isodoc/bipm/bipm.brochure.xsl +67 -24
- data/lib/isodoc/bipm/bipm.guide.xsl +67 -24
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +67 -24
- data/lib/isodoc/bipm/bipm.rapport.xsl +67 -24
- data/lib/isodoc/bipm/html/htmlstyle.css +30 -1
- data/lib/isodoc/bipm/jcgm.standard.xsl +67 -24
- data/lib/metanorma/bipm/biblio.rng +1 -1
- data/lib/metanorma/bipm/isodoc.rng +1 -1
- data/lib/metanorma/bipm/version.rb +1 -1
- metadata +2 -2
@@ -8,7 +8,7 @@
|
|
8
8
|
<xsl:param name="add_math_as_attachment">true</xsl:param>
|
9
9
|
<xsl:param name="final_transform">true</xsl:param>
|
10
10
|
|
11
|
-
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
11
|
+
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
|
12
12
|
|
13
13
|
<xsl:variable name="first_pass" select="count($index//item) = 0"/>
|
14
14
|
|
@@ -3897,14 +3897,14 @@
|
|
3897
3897
|
BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose -->
|
3898
3898
|
|
3899
3899
|
<!--
|
3900
|
-
<
|
3900
|
+
<metanorma-extension>
|
3901
3901
|
<presentation-metadata>
|
3902
3902
|
<papersize>letter</papersize>
|
3903
3903
|
</presentation-metadata>
|
3904
|
-
</
|
3904
|
+
</metanorma-extension>
|
3905
3905
|
-->
|
3906
3906
|
|
3907
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
3907
|
+
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
|
3908
3908
|
<xsl:variable name="papersize_width_">
|
3909
3909
|
<xsl:choose>
|
3910
3910
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -4023,7 +4023,7 @@
|
|
4023
4023
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
4024
4024
|
|
4025
4025
|
<xsl:variable name="title-list-tables">
|
4026
|
-
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
4026
|
+
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
4027
4027
|
<xsl:value-of select="$toc_table_title"/>
|
4028
4028
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
4029
4029
|
<xsl:call-template name="getTitle">
|
@@ -4033,7 +4033,7 @@
|
|
4033
4033
|
</xsl:variable>
|
4034
4034
|
|
4035
4035
|
<xsl:variable name="title-list-figures">
|
4036
|
-
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
4036
|
+
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
4037
4037
|
<xsl:value-of select="$toc_figure_title"/>
|
4038
4038
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
4039
4039
|
<xsl:call-template name="getTitle">
|
@@ -4043,7 +4043,7 @@
|
|
4043
4043
|
</xsl:variable>
|
4044
4044
|
|
4045
4045
|
<xsl:variable name="title-list-recommendations">
|
4046
|
-
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
4046
|
+
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
4047
4047
|
<xsl:value-of select="$toc_requirement_title"/>
|
4048
4048
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
4049
4049
|
<xsl:call-template name="getTitle">
|
@@ -4115,7 +4115,7 @@
|
|
4115
4115
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
4116
4116
|
|
4117
4117
|
<xsl:variable name="additional_fonts_">
|
4118
|
-
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = '
|
4118
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
|
4119
4119
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
4120
4120
|
</xsl:for-each>
|
4121
4121
|
</xsl:variable>
|
@@ -5181,10 +5181,10 @@
|
|
5181
5181
|
|
5182
5182
|
<xsl:template name="processTablesFigures_Contents">
|
5183
5183
|
<xsl:param name="always"/>
|
5184
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
5184
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
5185
5185
|
<xsl:call-template name="processTables_Contents"/>
|
5186
5186
|
</xsl:if>
|
5187
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
5187
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
5188
5188
|
<xsl:call-template name="processFigures_Contents"/>
|
5189
5189
|
</xsl:if>
|
5190
5190
|
</xsl:template>
|
@@ -5537,6 +5537,8 @@
|
|
5537
5537
|
<xsl:attribute name="border-bottom">0.5pt solid black</xsl:attribute>
|
5538
5538
|
</xsl:if>
|
5539
5539
|
|
5540
|
+
<xsl:call-template name="setBordersTableArray"/>
|
5541
|
+
|
5540
5542
|
</xsl:element>
|
5541
5543
|
</xsl:variable>
|
5542
5544
|
|
@@ -5678,6 +5680,10 @@
|
|
5678
5680
|
|
5679
5681
|
</xsl:template>
|
5680
5682
|
|
5683
|
+
<xsl:template name="setBordersTableArray">
|
5684
|
+
|
5685
|
+
</xsl:template>
|
5686
|
+
|
5681
5687
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
5682
5688
|
<xsl:param name="continued"/>
|
5683
5689
|
<xsl:if test="normalize-space() != ''">
|
@@ -6172,6 +6178,8 @@
|
|
6172
6178
|
<fo:table-row>
|
6173
6179
|
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
6174
6180
|
|
6181
|
+
<xsl:call-template name="setBordersTableArray"/>
|
6182
|
+
|
6175
6183
|
<!-- fn will be processed inside 'note' processing -->
|
6176
6184
|
|
6177
6185
|
<xsl:if test="count(ancestor::bipm:table//*[local-name()='note']) > 1">
|
@@ -6303,6 +6311,8 @@
|
|
6303
6311
|
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
|
6304
6312
|
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
|
6305
6313
|
|
6314
|
+
<xsl:call-template name="setBordersTableArray"/>
|
6315
|
+
|
6306
6316
|
<xsl:call-template name="setTableRowAttributes"/>
|
6307
6317
|
|
6308
6318
|
<xsl:apply-templates/>
|
@@ -6326,6 +6336,8 @@
|
|
6326
6336
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
6327
6337
|
</xsl:if>
|
6328
6338
|
|
6339
|
+
<xsl:call-template name="setBordersTableArray"/>
|
6340
|
+
|
6329
6341
|
<xsl:call-template name="setTableRowAttributes"/>
|
6330
6342
|
<xsl:apply-templates/>
|
6331
6343
|
</fo:table-row>
|
@@ -6363,6 +6375,8 @@
|
|
6363
6375
|
<xsl:attribute name="display-align">before</xsl:attribute>
|
6364
6376
|
</xsl:if>
|
6365
6377
|
|
6378
|
+
<xsl:call-template name="setBordersTableArray"/>
|
6379
|
+
|
6366
6380
|
<xsl:if test="$lang = 'ar'">
|
6367
6381
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
6368
6382
|
</xsl:if>
|
@@ -6426,6 +6440,8 @@
|
|
6426
6440
|
|
6427
6441
|
<!-- bsi -->
|
6428
6442
|
|
6443
|
+
<xsl:call-template name="setBordersTableArray"/>
|
6444
|
+
|
6429
6445
|
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
|
6430
6446
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
6431
6447
|
</xsl:if>
|
@@ -6502,7 +6518,7 @@
|
|
6502
6518
|
</fn>
|
6503
6519
|
-->
|
6504
6520
|
<!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
|
6505
|
-
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
6521
|
+
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
|
6506
6522
|
|
6507
6523
|
<!-- list of footnotes to calculate actual footnotes number -->
|
6508
6524
|
<xsl:variable name="p_fn_">
|
@@ -6559,8 +6575,7 @@
|
|
6559
6575
|
</fo:basic-link>
|
6560
6576
|
</fo:inline>
|
6561
6577
|
</xsl:variable>
|
6562
|
-
|
6563
|
-
gen_id=<xsl:value-of select="$gen_id"/> -->
|
6578
|
+
|
6564
6579
|
<xsl:choose>
|
6565
6580
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
6566
6581
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -6615,7 +6630,7 @@
|
|
6615
6630
|
<!-- commented:
|
6616
6631
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
6617
6632
|
because 'fn' there is in biblio-tag -->
|
6618
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
6633
|
+
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
6619
6634
|
<!-- copy unique fn -->
|
6620
6635
|
<fn gen_id="{generate-id(.)}">
|
6621
6636
|
<xsl:copy-of select="@*"/>
|
@@ -9230,7 +9245,9 @@
|
|
9230
9245
|
|
9231
9246
|
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
9232
9247
|
<xsl:if test="number($scale) < 100">
|
9233
|
-
|
9248
|
+
|
9249
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
9250
|
+
|
9234
9251
|
</xsl:if>
|
9235
9252
|
|
9236
9253
|
</xsl:if>
|
@@ -10170,7 +10187,7 @@
|
|
10170
10187
|
<!-- sourcecode -->
|
10171
10188
|
<!-- =============== -->
|
10172
10189
|
|
10173
|
-
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
10190
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
10174
10191
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
10175
10192
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
10176
10193
|
|
@@ -10257,6 +10274,12 @@
|
|
10257
10274
|
</xsl:attribute>
|
10258
10275
|
</xsl:for-each>
|
10259
10276
|
|
10277
|
+
<!-- remove margin between rows in the table with sourcecode line numbers -->
|
10278
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
|
10279
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
10280
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
10281
|
+
</xsl:if>
|
10282
|
+
|
10260
10283
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
10261
10284
|
</fo:block>
|
10262
10285
|
|
@@ -10305,7 +10328,7 @@
|
|
10305
10328
|
</xsl:template>
|
10306
10329
|
|
10307
10330
|
<!-- outer table with line numbers for sourcecode -->
|
10308
|
-
<xsl:template match="*[local-name()='
|
10331
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
|
10309
10332
|
<fo:block>
|
10310
10333
|
<fo:table width="100%" table-layout="fixed">
|
10311
10334
|
<xsl:copy-of select="@id"/>
|
@@ -10317,16 +10340,16 @@
|
|
10317
10340
|
</fo:table>
|
10318
10341
|
</fo:block>
|
10319
10342
|
</xsl:template>
|
10320
|
-
<xsl:template match="*[local-name()='
|
10343
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
|
10321
10344
|
<xsl:apply-templates/>
|
10322
10345
|
</xsl:template>
|
10323
|
-
<xsl:template match="*[local-name()='
|
10346
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
|
10324
10347
|
<fo:table-row>
|
10325
10348
|
<xsl:apply-templates/>
|
10326
10349
|
</fo:table-row>
|
10327
10350
|
</xsl:template>
|
10328
10351
|
<!-- first td with line numbers -->
|
10329
|
-
<xsl:template match="*[local-name()='
|
10352
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
10330
10353
|
<fo:table-cell>
|
10331
10354
|
<fo:block>
|
10332
10355
|
|
@@ -10346,8 +10369,9 @@
|
|
10346
10369
|
</fo:block>
|
10347
10370
|
</fo:table-cell>
|
10348
10371
|
</xsl:template>
|
10372
|
+
|
10349
10373
|
<!-- second td with sourcecode -->
|
10350
|
-
<xsl:template match="*[local-name()='
|
10374
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
10351
10375
|
<fo:table-cell>
|
10352
10376
|
<fo:block>
|
10353
10377
|
<xsl:apply-templates/>
|
@@ -10585,7 +10609,25 @@
|
|
10585
10609
|
<xsl:template match="*[local-name()='pre']" name="pre">
|
10586
10610
|
<fo:block xsl:use-attribute-sets="pre-style">
|
10587
10611
|
<xsl:copy-of select="@id"/>
|
10588
|
-
<xsl:
|
10612
|
+
<xsl:choose>
|
10613
|
+
|
10614
|
+
<xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
|
10615
|
+
<xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
|
10616
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
10617
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
10618
|
+
</xsl:if>
|
10619
|
+
<fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
|
10620
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
10621
|
+
<mtext><xsl:value-of select="."/></mtext>
|
10622
|
+
</math>
|
10623
|
+
</fo:instream-foreign-object>
|
10624
|
+
</xsl:when>
|
10625
|
+
|
10626
|
+
<xsl:otherwise>
|
10627
|
+
<xsl:apply-templates/>
|
10628
|
+
</xsl:otherwise>
|
10629
|
+
|
10630
|
+
</xsl:choose>
|
10589
10631
|
</fo:block>
|
10590
10632
|
</xsl:template>
|
10591
10633
|
<!-- =============== -->
|
@@ -12203,8 +12245,8 @@
|
|
12203
12245
|
|
12204
12246
|
<xsl:variable name="toc_level">
|
12205
12247
|
<!-- https://www.metanorma.org/author/ref/document-attributes/ -->
|
12206
|
-
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = '
|
12207
|
-
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = '
|
12248
|
+
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
|
12249
|
+
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
|
12208
12250
|
<xsl:choose>
|
12209
12251
|
<xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
|
12210
12252
|
<xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
|
@@ -13196,6 +13238,7 @@
|
|
13196
13238
|
<xsl:choose>
|
13197
13239
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
13198
13240
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
13241
|
+
<xsl:when test="$align = 'justified'">justify</xsl:when>
|
13199
13242
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
13200
13243
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
13201
13244
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<xsl:param name="add_math_as_attachment">true</xsl:param>
|
9
9
|
<xsl:param name="final_transform">true</xsl:param>
|
10
10
|
|
11
|
-
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
11
|
+
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure' or local-name() = 'localized-strings')] and not(ancestor::*[local-name() = 'name']))]" use="@reference"/>
|
12
12
|
|
13
13
|
<xsl:variable name="first_pass" select="count($index//item) = 0"/>
|
14
14
|
|
@@ -3897,14 +3897,14 @@
|
|
3897
3897
|
BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose -->
|
3898
3898
|
|
3899
3899
|
<!--
|
3900
|
-
<
|
3900
|
+
<metanorma-extension>
|
3901
3901
|
<presentation-metadata>
|
3902
3902
|
<papersize>letter</papersize>
|
3903
3903
|
</presentation-metadata>
|
3904
|
-
</
|
3904
|
+
</metanorma-extension>
|
3905
3905
|
-->
|
3906
3906
|
|
3907
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
3907
|
+
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
|
3908
3908
|
<xsl:variable name="papersize_width_">
|
3909
3909
|
<xsl:choose>
|
3910
3910
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -4023,7 +4023,7 @@
|
|
4023
4023
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
4024
4024
|
|
4025
4025
|
<xsl:variable name="title-list-tables">
|
4026
|
-
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
4026
|
+
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
4027
4027
|
<xsl:value-of select="$toc_table_title"/>
|
4028
4028
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
4029
4029
|
<xsl:call-template name="getTitle">
|
@@ -4033,7 +4033,7 @@
|
|
4033
4033
|
</xsl:variable>
|
4034
4034
|
|
4035
4035
|
<xsl:variable name="title-list-figures">
|
4036
|
-
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
4036
|
+
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
4037
4037
|
<xsl:value-of select="$toc_figure_title"/>
|
4038
4038
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
4039
4039
|
<xsl:call-template name="getTitle">
|
@@ -4043,7 +4043,7 @@
|
|
4043
4043
|
</xsl:variable>
|
4044
4044
|
|
4045
4045
|
<xsl:variable name="title-list-recommendations">
|
4046
|
-
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
4046
|
+
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
4047
4047
|
<xsl:value-of select="$toc_requirement_title"/>
|
4048
4048
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
4049
4049
|
<xsl:call-template name="getTitle">
|
@@ -4115,7 +4115,7 @@
|
|
4115
4115
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
4116
4116
|
|
4117
4117
|
<xsl:variable name="additional_fonts_">
|
4118
|
-
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = '
|
4118
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
|
4119
4119
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
4120
4120
|
</xsl:for-each>
|
4121
4121
|
</xsl:variable>
|
@@ -5181,10 +5181,10 @@
|
|
5181
5181
|
|
5182
5182
|
<xsl:template name="processTablesFigures_Contents">
|
5183
5183
|
<xsl:param name="always"/>
|
5184
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
5184
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
5185
5185
|
<xsl:call-template name="processTables_Contents"/>
|
5186
5186
|
</xsl:if>
|
5187
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
5187
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
5188
5188
|
<xsl:call-template name="processFigures_Contents"/>
|
5189
5189
|
</xsl:if>
|
5190
5190
|
</xsl:template>
|
@@ -5537,6 +5537,8 @@
|
|
5537
5537
|
<xsl:attribute name="border-bottom">0.5pt solid black</xsl:attribute>
|
5538
5538
|
</xsl:if>
|
5539
5539
|
|
5540
|
+
<xsl:call-template name="setBordersTableArray"/>
|
5541
|
+
|
5540
5542
|
</xsl:element>
|
5541
5543
|
</xsl:variable>
|
5542
5544
|
|
@@ -5678,6 +5680,10 @@
|
|
5678
5680
|
|
5679
5681
|
</xsl:template>
|
5680
5682
|
|
5683
|
+
<xsl:template name="setBordersTableArray">
|
5684
|
+
|
5685
|
+
</xsl:template>
|
5686
|
+
|
5681
5687
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
5682
5688
|
<xsl:param name="continued"/>
|
5683
5689
|
<xsl:if test="normalize-space() != ''">
|
@@ -6172,6 +6178,8 @@
|
|
6172
6178
|
<fo:table-row>
|
6173
6179
|
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
6174
6180
|
|
6181
|
+
<xsl:call-template name="setBordersTableArray"/>
|
6182
|
+
|
6175
6183
|
<!-- fn will be processed inside 'note' processing -->
|
6176
6184
|
|
6177
6185
|
<xsl:if test="count(ancestor::bipm:table//*[local-name()='note']) > 1">
|
@@ -6303,6 +6311,8 @@
|
|
6303
6311
|
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
|
6304
6312
|
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
|
6305
6313
|
|
6314
|
+
<xsl:call-template name="setBordersTableArray"/>
|
6315
|
+
|
6306
6316
|
<xsl:call-template name="setTableRowAttributes"/>
|
6307
6317
|
|
6308
6318
|
<xsl:apply-templates/>
|
@@ -6326,6 +6336,8 @@
|
|
6326
6336
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
6327
6337
|
</xsl:if>
|
6328
6338
|
|
6339
|
+
<xsl:call-template name="setBordersTableArray"/>
|
6340
|
+
|
6329
6341
|
<xsl:call-template name="setTableRowAttributes"/>
|
6330
6342
|
<xsl:apply-templates/>
|
6331
6343
|
</fo:table-row>
|
@@ -6363,6 +6375,8 @@
|
|
6363
6375
|
<xsl:attribute name="display-align">before</xsl:attribute>
|
6364
6376
|
</xsl:if>
|
6365
6377
|
|
6378
|
+
<xsl:call-template name="setBordersTableArray"/>
|
6379
|
+
|
6366
6380
|
<xsl:if test="$lang = 'ar'">
|
6367
6381
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
6368
6382
|
</xsl:if>
|
@@ -6426,6 +6440,8 @@
|
|
6426
6440
|
|
6427
6441
|
<!-- bsi -->
|
6428
6442
|
|
6443
|
+
<xsl:call-template name="setBordersTableArray"/>
|
6444
|
+
|
6429
6445
|
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
|
6430
6446
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
6431
6447
|
</xsl:if>
|
@@ -6502,7 +6518,7 @@
|
|
6502
6518
|
</fn>
|
6503
6519
|
-->
|
6504
6520
|
<!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
|
6505
|
-
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
6521
|
+
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
|
6506
6522
|
|
6507
6523
|
<!-- list of footnotes to calculate actual footnotes number -->
|
6508
6524
|
<xsl:variable name="p_fn_">
|
@@ -6559,8 +6575,7 @@
|
|
6559
6575
|
</fo:basic-link>
|
6560
6576
|
</fo:inline>
|
6561
6577
|
</xsl:variable>
|
6562
|
-
|
6563
|
-
gen_id=<xsl:value-of select="$gen_id"/> -->
|
6578
|
+
|
6564
6579
|
<xsl:choose>
|
6565
6580
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
6566
6581
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -6615,7 +6630,7 @@
|
|
6615
6630
|
<!-- commented:
|
6616
6631
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
6617
6632
|
because 'fn' there is in biblio-tag -->
|
6618
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
6633
|
+
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
6619
6634
|
<!-- copy unique fn -->
|
6620
6635
|
<fn gen_id="{generate-id(.)}">
|
6621
6636
|
<xsl:copy-of select="@*"/>
|
@@ -9230,7 +9245,9 @@
|
|
9230
9245
|
|
9231
9246
|
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
9232
9247
|
<xsl:if test="number($scale) < 100">
|
9233
|
-
|
9248
|
+
|
9249
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
9250
|
+
|
9234
9251
|
</xsl:if>
|
9235
9252
|
|
9236
9253
|
</xsl:if>
|
@@ -10170,7 +10187,7 @@
|
|
10170
10187
|
<!-- sourcecode -->
|
10171
10188
|
<!-- =============== -->
|
10172
10189
|
|
10173
|
-
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
10190
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
10174
10191
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
10175
10192
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
10176
10193
|
|
@@ -10257,6 +10274,12 @@
|
|
10257
10274
|
</xsl:attribute>
|
10258
10275
|
</xsl:for-each>
|
10259
10276
|
|
10277
|
+
<!-- remove margin between rows in the table with sourcecode line numbers -->
|
10278
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
|
10279
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
10280
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
10281
|
+
</xsl:if>
|
10282
|
+
|
10260
10283
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
10261
10284
|
</fo:block>
|
10262
10285
|
|
@@ -10305,7 +10328,7 @@
|
|
10305
10328
|
</xsl:template>
|
10306
10329
|
|
10307
10330
|
<!-- outer table with line numbers for sourcecode -->
|
10308
|
-
<xsl:template match="*[local-name()='
|
10331
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
|
10309
10332
|
<fo:block>
|
10310
10333
|
<fo:table width="100%" table-layout="fixed">
|
10311
10334
|
<xsl:copy-of select="@id"/>
|
@@ -10317,16 +10340,16 @@
|
|
10317
10340
|
</fo:table>
|
10318
10341
|
</fo:block>
|
10319
10342
|
</xsl:template>
|
10320
|
-
<xsl:template match="*[local-name()='
|
10343
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
|
10321
10344
|
<xsl:apply-templates/>
|
10322
10345
|
</xsl:template>
|
10323
|
-
<xsl:template match="*[local-name()='
|
10346
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
|
10324
10347
|
<fo:table-row>
|
10325
10348
|
<xsl:apply-templates/>
|
10326
10349
|
</fo:table-row>
|
10327
10350
|
</xsl:template>
|
10328
10351
|
<!-- first td with line numbers -->
|
10329
|
-
<xsl:template match="*[local-name()='
|
10352
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][not(preceding-sibling::*)]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
10330
10353
|
<fo:table-cell>
|
10331
10354
|
<fo:block>
|
10332
10355
|
|
@@ -10346,8 +10369,9 @@
|
|
10346
10369
|
</fo:block>
|
10347
10370
|
</fo:table-cell>
|
10348
10371
|
</xsl:template>
|
10372
|
+
|
10349
10373
|
<!-- second td with sourcecode -->
|
10350
|
-
<xsl:template match="*[local-name()='
|
10374
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
|
10351
10375
|
<fo:table-cell>
|
10352
10376
|
<fo:block>
|
10353
10377
|
<xsl:apply-templates/>
|
@@ -10585,7 +10609,25 @@
|
|
10585
10609
|
<xsl:template match="*[local-name()='pre']" name="pre">
|
10586
10610
|
<fo:block xsl:use-attribute-sets="pre-style">
|
10587
10611
|
<xsl:copy-of select="@id"/>
|
10588
|
-
<xsl:
|
10612
|
+
<xsl:choose>
|
10613
|
+
|
10614
|
+
<xsl:when test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name()='td'][1][not(preceding-sibling::*)]"> <!-- pre in the first td in the table with @linenums = 'true' -->
|
10615
|
+
<xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
|
10616
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
10617
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
10618
|
+
</xsl:if>
|
10619
|
+
<fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
|
10620
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
10621
|
+
<mtext><xsl:value-of select="."/></mtext>
|
10622
|
+
</math>
|
10623
|
+
</fo:instream-foreign-object>
|
10624
|
+
</xsl:when>
|
10625
|
+
|
10626
|
+
<xsl:otherwise>
|
10627
|
+
<xsl:apply-templates/>
|
10628
|
+
</xsl:otherwise>
|
10629
|
+
|
10630
|
+
</xsl:choose>
|
10589
10631
|
</fo:block>
|
10590
10632
|
</xsl:template>
|
10591
10633
|
<!-- =============== -->
|
@@ -12203,8 +12245,8 @@
|
|
12203
12245
|
|
12204
12246
|
<xsl:variable name="toc_level">
|
12205
12247
|
<!-- https://www.metanorma.org/author/ref/document-attributes/ -->
|
12206
|
-
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = '
|
12207
|
-
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = '
|
12248
|
+
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
|
12249
|
+
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
|
12208
12250
|
<xsl:choose>
|
12209
12251
|
<xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
|
12210
12252
|
<xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
|
@@ -13196,6 +13238,7 @@
|
|
13196
13238
|
<xsl:choose>
|
13197
13239
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
13198
13240
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
13241
|
+
<xsl:when test="$align = 'justified'">justify</xsl:when>
|
13199
13242
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
13200
13243
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
13201
13244
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
@@ -132,6 +132,35 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
132
132
|
color: red;
|
133
133
|
text-decoration: line-through; }
|
134
134
|
|
135
|
+
/* code highlighting with line numbers */
|
136
|
+
table.rouge-line-table td.rouge-gutter {
|
137
|
+
-moz-user-select: none;
|
138
|
+
-ms-user-select: none;
|
139
|
+
-webkit-user-select: none;
|
140
|
+
user-select: none;
|
141
|
+
padding-right: 1em; }
|
142
|
+
|
143
|
+
table.rouge-line-table td.rouge-code {
|
144
|
+
-moz-user-select: all;
|
145
|
+
-ms-user-select: all;
|
146
|
+
-webkit-user-select: all;
|
147
|
+
user-select: all; }
|
148
|
+
|
149
|
+
table.rouge-line-table,
|
150
|
+
table.rouge-line-table th,
|
151
|
+
table.rouge-line-table td {
|
152
|
+
width: auto;
|
153
|
+
border: none;
|
154
|
+
margin: 0;
|
155
|
+
padding: 0;
|
156
|
+
font-size: 100%; }
|
157
|
+
|
158
|
+
table.rouge-line-table pre {
|
159
|
+
margin: 0;
|
160
|
+
padding: 0;
|
161
|
+
overflow-x: visible;
|
162
|
+
font-size: 100%; }
|
163
|
+
|
135
164
|
#brochure-band {
|
136
165
|
background-color: #0AC442; }
|
137
166
|
|
@@ -752,7 +781,7 @@ table {
|
|
752
781
|
table th, table td {
|
753
782
|
padding: 1em; }
|
754
783
|
table td.header {
|
755
|
-
font-
|
784
|
+
font-weight: 400; }
|
756
785
|
|
757
786
|
p.TableTitle {
|
758
787
|
text-align: center;
|