metanorma-iho 0.7.1 → 0.7.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/iho/html/htmlstyle.css +30 -1
- data/lib/isodoc/iho/iho.specification.xsl +67 -24
- data/lib/isodoc/iho/iho.standard.xsl +67 -24
- data/lib/metanorma/iho/biblio.rng +1 -1
- data/lib/metanorma/iho/isodoc.rng +1 -1
- data/lib/metanorma/iho/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a137dd467445fb393d8a881bc76eea63242e9fab3f3fdebb262ddb9b1eae733e
|
4
|
+
data.tar.gz: 4683826cc6b08cac50d04a9016780173a404d49644597871537f4a497d2dc925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c32afd0aae009e2aa94247131d6431a24948eb405eafb2eb8252f300837064e24a87fb18a9ee44d60f85968e8d8817b504dd901eca20c8d1a451b99eed92407
|
7
|
+
data.tar.gz: 77aa720b82ba2ed1c0056390d1b30bff38c7da9a0e94e5c0a9966c843da4b5ab6b5ddc6812e018e3d503b2e2cbb34a050e47ecec11400198c7bb56ebeb836b82
|
@@ -131,6 +131,35 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
131
131
|
color: red;
|
132
132
|
text-decoration: line-through; }
|
133
133
|
|
134
|
+
/* code highlighting with line numbers */
|
135
|
+
table.rouge-line-table td.rouge-gutter {
|
136
|
+
-moz-user-select: none;
|
137
|
+
-ms-user-select: none;
|
138
|
+
-webkit-user-select: none;
|
139
|
+
user-select: none;
|
140
|
+
padding-right: 1em; }
|
141
|
+
|
142
|
+
table.rouge-line-table td.rouge-code {
|
143
|
+
-moz-user-select: all;
|
144
|
+
-ms-user-select: all;
|
145
|
+
-webkit-user-select: all;
|
146
|
+
user-select: all; }
|
147
|
+
|
148
|
+
table.rouge-line-table,
|
149
|
+
table.rouge-line-table th,
|
150
|
+
table.rouge-line-table td {
|
151
|
+
width: auto;
|
152
|
+
border: none;
|
153
|
+
margin: 0;
|
154
|
+
padding: 0;
|
155
|
+
font-size: 100%; }
|
156
|
+
|
157
|
+
table.rouge-line-table pre {
|
158
|
+
margin: 0;
|
159
|
+
padding: 0;
|
160
|
+
overflow-x: visible;
|
161
|
+
font-size: 100%; }
|
162
|
+
|
134
163
|
#standard-band {
|
135
164
|
background-color: #0AC442; }
|
136
165
|
|
@@ -789,7 +818,7 @@ table {
|
|
789
818
|
table th, table td {
|
790
819
|
padding: 1em; }
|
791
820
|
table td.header {
|
792
|
-
font-
|
821
|
+
font-weight: 400; }
|
793
822
|
|
794
823
|
p.TableTitle {
|
795
824
|
text-align: center;
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
|
4
4
|
|
5
|
-
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
5
|
+
<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"/>
|
6
6
|
|
7
7
|
<xsl:variable name="debug">false</xsl:variable>
|
8
8
|
|
@@ -892,14 +892,14 @@
|
|
892
892
|
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 -->
|
893
893
|
|
894
894
|
<!--
|
895
|
-
<
|
895
|
+
<metanorma-extension>
|
896
896
|
<presentation-metadata>
|
897
897
|
<papersize>letter</papersize>
|
898
898
|
</presentation-metadata>
|
899
|
-
</
|
899
|
+
</metanorma-extension>
|
900
900
|
-->
|
901
901
|
|
902
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
902
|
+
<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'])))"/>
|
903
903
|
<xsl:variable name="papersize_width_">
|
904
904
|
<xsl:choose>
|
905
905
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -1016,7 +1016,7 @@
|
|
1016
1016
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
1017
1017
|
|
1018
1018
|
<xsl:variable name="title-list-tables">
|
1019
|
-
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1019
|
+
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
1020
1020
|
<xsl:value-of select="$toc_table_title"/>
|
1021
1021
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
1022
1022
|
<xsl:call-template name="getTitle">
|
@@ -1026,7 +1026,7 @@
|
|
1026
1026
|
</xsl:variable>
|
1027
1027
|
|
1028
1028
|
<xsl:variable name="title-list-figures">
|
1029
|
-
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1029
|
+
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
1030
1030
|
<xsl:value-of select="$toc_figure_title"/>
|
1031
1031
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
1032
1032
|
<xsl:call-template name="getTitle">
|
@@ -1036,7 +1036,7 @@
|
|
1036
1036
|
</xsl:variable>
|
1037
1037
|
|
1038
1038
|
<xsl:variable name="title-list-recommendations">
|
1039
|
-
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1039
|
+
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
1040
1040
|
<xsl:value-of select="$toc_requirement_title"/>
|
1041
1041
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
1042
1042
|
<xsl:call-template name="getTitle">
|
@@ -1108,7 +1108,7 @@
|
|
1108
1108
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
1109
1109
|
|
1110
1110
|
<xsl:variable name="additional_fonts_">
|
1111
|
-
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = '
|
1111
|
+
<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']">
|
1112
1112
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
1113
1113
|
</xsl:for-each>
|
1114
1114
|
</xsl:variable>
|
@@ -2208,10 +2208,10 @@
|
|
2208
2208
|
|
2209
2209
|
<xsl:template name="processTablesFigures_Contents">
|
2210
2210
|
<xsl:param name="always"/>
|
2211
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2211
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
2212
2212
|
<xsl:call-template name="processTables_Contents"/>
|
2213
2213
|
</xsl:if>
|
2214
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2214
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
2215
2215
|
<xsl:call-template name="processFigures_Contents"/>
|
2216
2216
|
</xsl:if>
|
2217
2217
|
</xsl:template>
|
@@ -2540,6 +2540,8 @@
|
|
2540
2540
|
|
2541
2541
|
<xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
|
2542
2542
|
|
2543
|
+
<xsl:call-template name="setBordersTableArray"/>
|
2544
|
+
|
2543
2545
|
</xsl:element>
|
2544
2546
|
</xsl:variable>
|
2545
2547
|
|
@@ -2684,6 +2686,10 @@
|
|
2684
2686
|
|
2685
2687
|
</xsl:template>
|
2686
2688
|
|
2689
|
+
<xsl:template name="setBordersTableArray">
|
2690
|
+
|
2691
|
+
</xsl:template>
|
2692
|
+
|
2687
2693
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
2688
2694
|
<xsl:param name="continued"/>
|
2689
2695
|
<xsl:if test="normalize-space() != ''">
|
@@ -3158,6 +3164,8 @@
|
|
3158
3164
|
<fo:table-row>
|
3159
3165
|
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
3160
3166
|
|
3167
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3168
|
+
|
3161
3169
|
<!-- fn will be processed inside 'note' processing -->
|
3162
3170
|
|
3163
3171
|
<!-- for BSI (not PAS) display Notes before footnotes -->
|
@@ -3279,6 +3287,8 @@
|
|
3279
3287
|
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
|
3280
3288
|
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
|
3281
3289
|
|
3290
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3291
|
+
|
3282
3292
|
<xsl:call-template name="setTableRowAttributes"/>
|
3283
3293
|
|
3284
3294
|
<xsl:apply-templates/>
|
@@ -3302,6 +3312,8 @@
|
|
3302
3312
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
3303
3313
|
</xsl:if>
|
3304
3314
|
|
3315
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3316
|
+
|
3305
3317
|
<xsl:call-template name="setTableRowAttributes"/>
|
3306
3318
|
<xsl:apply-templates/>
|
3307
3319
|
</fo:table-row>
|
@@ -3321,6 +3333,8 @@
|
|
3321
3333
|
<xsl:with-param name="default">center</xsl:with-param>
|
3322
3334
|
</xsl:call-template>
|
3323
3335
|
|
3336
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3337
|
+
|
3324
3338
|
<xsl:if test="$lang = 'ar'">
|
3325
3339
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3326
3340
|
</xsl:if>
|
@@ -3373,6 +3387,8 @@
|
|
3373
3387
|
|
3374
3388
|
<!-- bsi -->
|
3375
3389
|
|
3390
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3391
|
+
|
3376
3392
|
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
|
3377
3393
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3378
3394
|
</xsl:if>
|
@@ -3427,7 +3443,7 @@
|
|
3427
3443
|
</fn>
|
3428
3444
|
-->
|
3429
3445
|
<!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
|
3430
|
-
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
3446
|
+
<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">
|
3431
3447
|
|
3432
3448
|
<!-- list of footnotes to calculate actual footnotes number -->
|
3433
3449
|
<xsl:variable name="p_fn_">
|
@@ -3484,8 +3500,7 @@
|
|
3484
3500
|
</fo:basic-link>
|
3485
3501
|
</fo:inline>
|
3486
3502
|
</xsl:variable>
|
3487
|
-
|
3488
|
-
gen_id=<xsl:value-of select="$gen_id"/> -->
|
3503
|
+
|
3489
3504
|
<xsl:choose>
|
3490
3505
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
3491
3506
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -3540,7 +3555,7 @@
|
|
3540
3555
|
<!-- commented:
|
3541
3556
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
3542
3557
|
because 'fn' there is in biblio-tag -->
|
3543
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
3558
|
+
<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])]">
|
3544
3559
|
<!-- copy unique fn -->
|
3545
3560
|
<fn gen_id="{generate-id(.)}">
|
3546
3561
|
<xsl:copy-of select="@*"/>
|
@@ -6154,7 +6169,9 @@
|
|
6154
6169
|
|
6155
6170
|
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
6156
6171
|
<xsl:if test="number($scale) < 100">
|
6157
|
-
|
6172
|
+
|
6173
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
6174
|
+
|
6158
6175
|
</xsl:if>
|
6159
6176
|
|
6160
6177
|
</xsl:if>
|
@@ -7080,7 +7097,7 @@
|
|
7080
7097
|
<!-- sourcecode -->
|
7081
7098
|
<!-- =============== -->
|
7082
7099
|
|
7083
|
-
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
7100
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
7084
7101
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
7085
7102
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
7086
7103
|
|
@@ -7168,6 +7185,12 @@
|
|
7168
7185
|
</xsl:attribute>
|
7169
7186
|
</xsl:for-each>
|
7170
7187
|
|
7188
|
+
<!-- remove margin between rows in the table with sourcecode line numbers -->
|
7189
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
|
7190
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
7191
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
7192
|
+
</xsl:if>
|
7193
|
+
|
7171
7194
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
7172
7195
|
</fo:block>
|
7173
7196
|
|
@@ -7216,7 +7239,7 @@
|
|
7216
7239
|
</xsl:template>
|
7217
7240
|
|
7218
7241
|
<!-- outer table with line numbers for sourcecode -->
|
7219
|
-
<xsl:template match="*[local-name()='
|
7242
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
|
7220
7243
|
<fo:block>
|
7221
7244
|
<fo:table width="100%" table-layout="fixed">
|
7222
7245
|
<xsl:copy-of select="@id"/>
|
@@ -7228,16 +7251,16 @@
|
|
7228
7251
|
</fo:table>
|
7229
7252
|
</fo:block>
|
7230
7253
|
</xsl:template>
|
7231
|
-
<xsl:template match="*[local-name()='
|
7254
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
|
7232
7255
|
<xsl:apply-templates/>
|
7233
7256
|
</xsl:template>
|
7234
|
-
<xsl:template match="*[local-name()='
|
7257
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
|
7235
7258
|
<fo:table-row>
|
7236
7259
|
<xsl:apply-templates/>
|
7237
7260
|
</fo:table-row>
|
7238
7261
|
</xsl:template>
|
7239
7262
|
<!-- first td with line numbers -->
|
7240
|
-
<xsl:template match="*[local-name()='
|
7263
|
+
<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'] -->
|
7241
7264
|
<fo:table-cell>
|
7242
7265
|
<fo:block>
|
7243
7266
|
|
@@ -7257,8 +7280,9 @@
|
|
7257
7280
|
</fo:block>
|
7258
7281
|
</fo:table-cell>
|
7259
7282
|
</xsl:template>
|
7283
|
+
|
7260
7284
|
<!-- second td with sourcecode -->
|
7261
|
-
<xsl:template match="*[local-name()='
|
7285
|
+
<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'] -->
|
7262
7286
|
<fo:table-cell>
|
7263
7287
|
<fo:block>
|
7264
7288
|
<xsl:apply-templates/>
|
@@ -7496,7 +7520,25 @@
|
|
7496
7520
|
<xsl:template match="*[local-name()='pre']" name="pre">
|
7497
7521
|
<fo:block xsl:use-attribute-sets="pre-style">
|
7498
7522
|
<xsl:copy-of select="@id"/>
|
7499
|
-
<xsl:
|
7523
|
+
<xsl:choose>
|
7524
|
+
|
7525
|
+
<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' -->
|
7526
|
+
<xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
|
7527
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
7528
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
7529
|
+
</xsl:if>
|
7530
|
+
<fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
|
7531
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
7532
|
+
<mtext><xsl:value-of select="."/></mtext>
|
7533
|
+
</math>
|
7534
|
+
</fo:instream-foreign-object>
|
7535
|
+
</xsl:when>
|
7536
|
+
|
7537
|
+
<xsl:otherwise>
|
7538
|
+
<xsl:apply-templates/>
|
7539
|
+
</xsl:otherwise>
|
7540
|
+
|
7541
|
+
</xsl:choose>
|
7500
7542
|
</fo:block>
|
7501
7543
|
</xsl:template>
|
7502
7544
|
<!-- =============== -->
|
@@ -9114,8 +9156,8 @@
|
|
9114
9156
|
|
9115
9157
|
<xsl:variable name="toc_level">
|
9116
9158
|
<!-- https://www.metanorma.org/author/ref/document-attributes/ -->
|
9117
|
-
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = '
|
9118
|
-
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = '
|
9159
|
+
<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:-->
|
9160
|
+
<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 -->
|
9119
9161
|
<xsl:choose>
|
9120
9162
|
<xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
|
9121
9163
|
<xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
|
@@ -10104,6 +10146,7 @@
|
|
10104
10146
|
<xsl:choose>
|
10105
10147
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
10106
10148
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
10149
|
+
<xsl:when test="$align = 'justified'">justify</xsl:when>
|
10107
10150
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
10108
10151
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
10109
10152
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
<xsl:output method="xml" encoding="UTF-8" indent="no"/>
|
4
4
|
|
5
|
-
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
5
|
+
<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"/>
|
6
6
|
|
7
7
|
<xsl:variable name="debug">false</xsl:variable>
|
8
8
|
|
@@ -892,14 +892,14 @@
|
|
892
892
|
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 -->
|
893
893
|
|
894
894
|
<!--
|
895
|
-
<
|
895
|
+
<metanorma-extension>
|
896
896
|
<presentation-metadata>
|
897
897
|
<papersize>letter</papersize>
|
898
898
|
</presentation-metadata>
|
899
|
-
</
|
899
|
+
</metanorma-extension>
|
900
900
|
-->
|
901
901
|
|
902
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
902
|
+
<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'])))"/>
|
903
903
|
<xsl:variable name="papersize_width_">
|
904
904
|
<xsl:choose>
|
905
905
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -1016,7 +1016,7 @@
|
|
1016
1016
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
1017
1017
|
|
1018
1018
|
<xsl:variable name="title-list-tables">
|
1019
|
-
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1019
|
+
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
1020
1020
|
<xsl:value-of select="$toc_table_title"/>
|
1021
1021
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
1022
1022
|
<xsl:call-template name="getTitle">
|
@@ -1026,7 +1026,7 @@
|
|
1026
1026
|
</xsl:variable>
|
1027
1027
|
|
1028
1028
|
<xsl:variable name="title-list-figures">
|
1029
|
-
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1029
|
+
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
1030
1030
|
<xsl:value-of select="$toc_figure_title"/>
|
1031
1031
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
1032
1032
|
<xsl:call-template name="getTitle">
|
@@ -1036,7 +1036,7 @@
|
|
1036
1036
|
</xsl:variable>
|
1037
1037
|
|
1038
1038
|
<xsl:variable name="title-list-recommendations">
|
1039
|
-
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1039
|
+
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
1040
1040
|
<xsl:value-of select="$toc_requirement_title"/>
|
1041
1041
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
1042
1042
|
<xsl:call-template name="getTitle">
|
@@ -1108,7 +1108,7 @@
|
|
1108
1108
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
1109
1109
|
|
1110
1110
|
<xsl:variable name="additional_fonts_">
|
1111
|
-
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = '
|
1111
|
+
<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']">
|
1112
1112
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
1113
1113
|
</xsl:for-each>
|
1114
1114
|
</xsl:variable>
|
@@ -2208,10 +2208,10 @@
|
|
2208
2208
|
|
2209
2209
|
<xsl:template name="processTablesFigures_Contents">
|
2210
2210
|
<xsl:param name="always"/>
|
2211
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2211
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
2212
2212
|
<xsl:call-template name="processTables_Contents"/>
|
2213
2213
|
</xsl:if>
|
2214
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
2214
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
2215
2215
|
<xsl:call-template name="processFigures_Contents"/>
|
2216
2216
|
</xsl:if>
|
2217
2217
|
</xsl:template>
|
@@ -2540,6 +2540,8 @@
|
|
2540
2540
|
|
2541
2541
|
<xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
|
2542
2542
|
|
2543
|
+
<xsl:call-template name="setBordersTableArray"/>
|
2544
|
+
|
2543
2545
|
</xsl:element>
|
2544
2546
|
</xsl:variable>
|
2545
2547
|
|
@@ -2684,6 +2686,10 @@
|
|
2684
2686
|
|
2685
2687
|
</xsl:template>
|
2686
2688
|
|
2689
|
+
<xsl:template name="setBordersTableArray">
|
2690
|
+
|
2691
|
+
</xsl:template>
|
2692
|
+
|
2687
2693
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
2688
2694
|
<xsl:param name="continued"/>
|
2689
2695
|
<xsl:if test="normalize-space() != ''">
|
@@ -3158,6 +3164,8 @@
|
|
3158
3164
|
<fo:table-row>
|
3159
3165
|
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
3160
3166
|
|
3167
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3168
|
+
|
3161
3169
|
<!-- fn will be processed inside 'note' processing -->
|
3162
3170
|
|
3163
3171
|
<!-- for BSI (not PAS) display Notes before footnotes -->
|
@@ -3279,6 +3287,8 @@
|
|
3279
3287
|
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
|
3280
3288
|
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
|
3281
3289
|
|
3290
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3291
|
+
|
3282
3292
|
<xsl:call-template name="setTableRowAttributes"/>
|
3283
3293
|
|
3284
3294
|
<xsl:apply-templates/>
|
@@ -3302,6 +3312,8 @@
|
|
3302
3312
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
3303
3313
|
</xsl:if>
|
3304
3314
|
|
3315
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3316
|
+
|
3305
3317
|
<xsl:call-template name="setTableRowAttributes"/>
|
3306
3318
|
<xsl:apply-templates/>
|
3307
3319
|
</fo:table-row>
|
@@ -3321,6 +3333,8 @@
|
|
3321
3333
|
<xsl:with-param name="default">center</xsl:with-param>
|
3322
3334
|
</xsl:call-template>
|
3323
3335
|
|
3336
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3337
|
+
|
3324
3338
|
<xsl:if test="$lang = 'ar'">
|
3325
3339
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3326
3340
|
</xsl:if>
|
@@ -3373,6 +3387,8 @@
|
|
3373
3387
|
|
3374
3388
|
<!-- bsi -->
|
3375
3389
|
|
3390
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3391
|
+
|
3376
3392
|
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
|
3377
3393
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3378
3394
|
</xsl:if>
|
@@ -3427,7 +3443,7 @@
|
|
3427
3443
|
</fn>
|
3428
3444
|
-->
|
3429
3445
|
<!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
|
3430
|
-
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
3446
|
+
<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">
|
3431
3447
|
|
3432
3448
|
<!-- list of footnotes to calculate actual footnotes number -->
|
3433
3449
|
<xsl:variable name="p_fn_">
|
@@ -3484,8 +3500,7 @@
|
|
3484
3500
|
</fo:basic-link>
|
3485
3501
|
</fo:inline>
|
3486
3502
|
</xsl:variable>
|
3487
|
-
|
3488
|
-
gen_id=<xsl:value-of select="$gen_id"/> -->
|
3503
|
+
|
3489
3504
|
<xsl:choose>
|
3490
3505
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
3491
3506
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -3540,7 +3555,7 @@
|
|
3540
3555
|
<!-- commented:
|
3541
3556
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
3542
3557
|
because 'fn' there is in biblio-tag -->
|
3543
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
3558
|
+
<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])]">
|
3544
3559
|
<!-- copy unique fn -->
|
3545
3560
|
<fn gen_id="{generate-id(.)}">
|
3546
3561
|
<xsl:copy-of select="@*"/>
|
@@ -6154,7 +6169,9 @@
|
|
6154
6169
|
|
6155
6170
|
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
6156
6171
|
<xsl:if test="number($scale) < 100">
|
6157
|
-
|
6172
|
+
|
6173
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
6174
|
+
|
6158
6175
|
</xsl:if>
|
6159
6176
|
|
6160
6177
|
</xsl:if>
|
@@ -7080,7 +7097,7 @@
|
|
7080
7097
|
<!-- sourcecode -->
|
7081
7098
|
<!-- =============== -->
|
7082
7099
|
|
7083
|
-
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
7100
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
7084
7101
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
7085
7102
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
7086
7103
|
|
@@ -7168,6 +7185,12 @@
|
|
7168
7185
|
</xsl:attribute>
|
7169
7186
|
</xsl:for-each>
|
7170
7187
|
|
7188
|
+
<!-- remove margin between rows in the table with sourcecode line numbers -->
|
7189
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
|
7190
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
7191
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
7192
|
+
</xsl:if>
|
7193
|
+
|
7171
7194
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
7172
7195
|
</fo:block>
|
7173
7196
|
|
@@ -7216,7 +7239,7 @@
|
|
7216
7239
|
</xsl:template>
|
7217
7240
|
|
7218
7241
|
<!-- outer table with line numbers for sourcecode -->
|
7219
|
-
<xsl:template match="*[local-name()='
|
7242
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
|
7220
7243
|
<fo:block>
|
7221
7244
|
<fo:table width="100%" table-layout="fixed">
|
7222
7245
|
<xsl:copy-of select="@id"/>
|
@@ -7228,16 +7251,16 @@
|
|
7228
7251
|
</fo:table>
|
7229
7252
|
</fo:block>
|
7230
7253
|
</xsl:template>
|
7231
|
-
<xsl:template match="*[local-name()='
|
7254
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
|
7232
7255
|
<xsl:apply-templates/>
|
7233
7256
|
</xsl:template>
|
7234
|
-
<xsl:template match="*[local-name()='
|
7257
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
|
7235
7258
|
<fo:table-row>
|
7236
7259
|
<xsl:apply-templates/>
|
7237
7260
|
</fo:table-row>
|
7238
7261
|
</xsl:template>
|
7239
7262
|
<!-- first td with line numbers -->
|
7240
|
-
<xsl:template match="*[local-name()='
|
7263
|
+
<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'] -->
|
7241
7264
|
<fo:table-cell>
|
7242
7265
|
<fo:block>
|
7243
7266
|
|
@@ -7257,8 +7280,9 @@
|
|
7257
7280
|
</fo:block>
|
7258
7281
|
</fo:table-cell>
|
7259
7282
|
</xsl:template>
|
7283
|
+
|
7260
7284
|
<!-- second td with sourcecode -->
|
7261
|
-
<xsl:template match="*[local-name()='
|
7285
|
+
<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'] -->
|
7262
7286
|
<fo:table-cell>
|
7263
7287
|
<fo:block>
|
7264
7288
|
<xsl:apply-templates/>
|
@@ -7496,7 +7520,25 @@
|
|
7496
7520
|
<xsl:template match="*[local-name()='pre']" name="pre">
|
7497
7521
|
<fo:block xsl:use-attribute-sets="pre-style">
|
7498
7522
|
<xsl:copy-of select="@id"/>
|
7499
|
-
<xsl:
|
7523
|
+
<xsl:choose>
|
7524
|
+
|
7525
|
+
<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' -->
|
7526
|
+
<xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
|
7527
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
7528
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
7529
|
+
</xsl:if>
|
7530
|
+
<fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
|
7531
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
7532
|
+
<mtext><xsl:value-of select="."/></mtext>
|
7533
|
+
</math>
|
7534
|
+
</fo:instream-foreign-object>
|
7535
|
+
</xsl:when>
|
7536
|
+
|
7537
|
+
<xsl:otherwise>
|
7538
|
+
<xsl:apply-templates/>
|
7539
|
+
</xsl:otherwise>
|
7540
|
+
|
7541
|
+
</xsl:choose>
|
7500
7542
|
</fo:block>
|
7501
7543
|
</xsl:template>
|
7502
7544
|
<!-- =============== -->
|
@@ -9114,8 +9156,8 @@
|
|
9114
9156
|
|
9115
9157
|
<xsl:variable name="toc_level">
|
9116
9158
|
<!-- https://www.metanorma.org/author/ref/document-attributes/ -->
|
9117
|
-
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = '
|
9118
|
-
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = '
|
9159
|
+
<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:-->
|
9160
|
+
<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 -->
|
9119
9161
|
<xsl:choose>
|
9120
9162
|
<xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
|
9121
9163
|
<xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
|
@@ -10104,6 +10146,7 @@
|
|
10104
10146
|
<xsl:choose>
|
10105
10147
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
10106
10148
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
10149
|
+
<xsl:when test="$align = 'justified'">justify</xsl:when>
|
10107
10150
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
10108
10151
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
10109
10152
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
@@ -1316,7 +1316,7 @@
|
|
1316
1316
|
<value>commentaryOf</value>
|
1317
1317
|
<value>hasCommentary</value>
|
1318
1318
|
<value>related</value>
|
1319
|
-
<value>
|
1319
|
+
<value>hasComplement</value>
|
1320
1320
|
<value>complementOf</value>
|
1321
1321
|
<value>obsoletes</value>
|
1322
1322
|
<value>obsoletedBy</value>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-iho
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|