metanorma-m3aawg 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/m3aawg/html/htmlstyle.css +30 -1
- data/lib/isodoc/m3aawg/m3aawg.policy.xsl +67 -24
- data/lib/isodoc/m3aawg/m3aawg.report.xsl +67 -24
- data/lib/metanorma/m3aawg/biblio.rng +1 -1
- data/lib/metanorma/m3aawg/isodoc.rng +1 -1
- data/lib/metanorma/m3aawg/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: daee9c6cb2f4a9ca2f0ba3848ff1b40c876d891781c03c65ea9a439154db640d
|
4
|
+
data.tar.gz: d5e1cafea8eab1a2b4169c32b96be652aa6befdeb12f3eb85594fc69c8859ebd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38608fd80156d3152c9c1e8ea86bed27e719cc608123f8dc1f6bcb5e5cccd86bb884144b26e069d617ddb90d18f352d75d0d8793745bc3eb891dd67a78616afb
|
7
|
+
data.tar.gz: 24d9bb5565baeaea25991ed54a4f13cac425fb23618a371279eac9e62f9fdc5e30ae0cf2d31245bc4d4a409862f31894257f3ed8400b5df392ae2119a002886d
|
@@ -138,6 +138,35 @@ a.FootnoteRef + a.FootnoteRef:before {
|
|
138
138
|
color: red;
|
139
139
|
text-decoration: line-through; }
|
140
140
|
|
141
|
+
/* code highlighting with line numbers */
|
142
|
+
table.rouge-line-table td.rouge-gutter {
|
143
|
+
-moz-user-select: none;
|
144
|
+
-ms-user-select: none;
|
145
|
+
-webkit-user-select: none;
|
146
|
+
user-select: none;
|
147
|
+
padding-right: 1em; }
|
148
|
+
|
149
|
+
table.rouge-line-table td.rouge-code {
|
150
|
+
-moz-user-select: all;
|
151
|
+
-ms-user-select: all;
|
152
|
+
-webkit-user-select: all;
|
153
|
+
user-select: all; }
|
154
|
+
|
155
|
+
table.rouge-line-table,
|
156
|
+
table.rouge-line-table th,
|
157
|
+
table.rouge-line-table td {
|
158
|
+
width: auto;
|
159
|
+
border: none;
|
160
|
+
margin: 0;
|
161
|
+
padding: 0;
|
162
|
+
font-size: 100%; }
|
163
|
+
|
164
|
+
table.rouge-line-table pre {
|
165
|
+
margin: 0;
|
166
|
+
padding: 0;
|
167
|
+
overflow-x: visible;
|
168
|
+
font-size: 100%; }
|
169
|
+
|
141
170
|
#standard-band {
|
142
171
|
background-color: #0AC442; }
|
143
172
|
|
@@ -800,7 +829,7 @@ table {
|
|
800
829
|
table th, table td {
|
801
830
|
padding: 1em; }
|
802
831
|
table td.header {
|
803
|
-
font-
|
832
|
+
font-weight: 400; }
|
804
833
|
table th,
|
805
834
|
table td {
|
806
835
|
border: none !important;
|
@@ -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
|
|
@@ -705,14 +705,14 @@
|
|
705
705
|
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 -->
|
706
706
|
|
707
707
|
<!--
|
708
|
-
<
|
708
|
+
<metanorma-extension>
|
709
709
|
<presentation-metadata>
|
710
710
|
<papersize>letter</papersize>
|
711
711
|
</presentation-metadata>
|
712
|
-
</
|
712
|
+
</metanorma-extension>
|
713
713
|
-->
|
714
714
|
|
715
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
715
|
+
<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'])))"/>
|
716
716
|
<xsl:variable name="papersize_width_">
|
717
717
|
<xsl:choose>
|
718
718
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -829,7 +829,7 @@
|
|
829
829
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
830
830
|
|
831
831
|
<xsl:variable name="title-list-tables">
|
832
|
-
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
832
|
+
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
833
833
|
<xsl:value-of select="$toc_table_title"/>
|
834
834
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
835
835
|
<xsl:call-template name="getTitle">
|
@@ -839,7 +839,7 @@
|
|
839
839
|
</xsl:variable>
|
840
840
|
|
841
841
|
<xsl:variable name="title-list-figures">
|
842
|
-
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
842
|
+
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
843
843
|
<xsl:value-of select="$toc_figure_title"/>
|
844
844
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
845
845
|
<xsl:call-template name="getTitle">
|
@@ -849,7 +849,7 @@
|
|
849
849
|
</xsl:variable>
|
850
850
|
|
851
851
|
<xsl:variable name="title-list-recommendations">
|
852
|
-
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
852
|
+
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
853
853
|
<xsl:value-of select="$toc_requirement_title"/>
|
854
854
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
855
855
|
<xsl:call-template name="getTitle">
|
@@ -921,7 +921,7 @@
|
|
921
921
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
922
922
|
|
923
923
|
<xsl:variable name="additional_fonts_">
|
924
|
-
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = '
|
924
|
+
<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']">
|
925
925
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
926
926
|
</xsl:for-each>
|
927
927
|
</xsl:variable>
|
@@ -1965,10 +1965,10 @@
|
|
1965
1965
|
|
1966
1966
|
<xsl:template name="processTablesFigures_Contents">
|
1967
1967
|
<xsl:param name="always"/>
|
1968
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1968
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
1969
1969
|
<xsl:call-template name="processTables_Contents"/>
|
1970
1970
|
</xsl:if>
|
1971
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1971
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
1972
1972
|
<xsl:call-template name="processFigures_Contents"/>
|
1973
1973
|
</xsl:if>
|
1974
1974
|
</xsl:template>
|
@@ -2311,6 +2311,8 @@
|
|
2311
2311
|
<xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
|
2312
2312
|
</xsl:if>
|
2313
2313
|
|
2314
|
+
<xsl:call-template name="setBordersTableArray"/>
|
2315
|
+
|
2314
2316
|
</xsl:element>
|
2315
2317
|
</xsl:variable>
|
2316
2318
|
|
@@ -2455,6 +2457,10 @@
|
|
2455
2457
|
|
2456
2458
|
</xsl:template>
|
2457
2459
|
|
2460
|
+
<xsl:template name="setBordersTableArray">
|
2461
|
+
|
2462
|
+
</xsl:template>
|
2463
|
+
|
2458
2464
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
2459
2465
|
<xsl:param name="continued"/>
|
2460
2466
|
<xsl:if test="normalize-space() != ''">
|
@@ -2929,6 +2935,8 @@
|
|
2929
2935
|
<fo:table-row>
|
2930
2936
|
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
2931
2937
|
|
2938
|
+
<xsl:call-template name="setBordersTableArray"/>
|
2939
|
+
|
2932
2940
|
<!-- fn will be processed inside 'note' processing -->
|
2933
2941
|
|
2934
2942
|
<!-- for BSI (not PAS) display Notes before footnotes -->
|
@@ -3050,6 +3058,8 @@
|
|
3050
3058
|
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
|
3051
3059
|
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
|
3052
3060
|
|
3061
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3062
|
+
|
3053
3063
|
<xsl:call-template name="setTableRowAttributes"/>
|
3054
3064
|
|
3055
3065
|
<xsl:apply-templates/>
|
@@ -3073,6 +3083,8 @@
|
|
3073
3083
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
3074
3084
|
</xsl:if>
|
3075
3085
|
|
3086
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3087
|
+
|
3076
3088
|
<xsl:call-template name="setTableRowAttributes"/>
|
3077
3089
|
<xsl:apply-templates/>
|
3078
3090
|
</fo:table-row>
|
@@ -3092,6 +3104,8 @@
|
|
3092
3104
|
<xsl:with-param name="default">center</xsl:with-param>
|
3093
3105
|
</xsl:call-template>
|
3094
3106
|
|
3107
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3108
|
+
|
3095
3109
|
<xsl:if test="$lang = 'ar'">
|
3096
3110
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3097
3111
|
</xsl:if>
|
@@ -3144,6 +3158,8 @@
|
|
3144
3158
|
|
3145
3159
|
<!-- bsi -->
|
3146
3160
|
|
3161
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3162
|
+
|
3147
3163
|
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
|
3148
3164
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3149
3165
|
</xsl:if>
|
@@ -3198,7 +3214,7 @@
|
|
3198
3214
|
</fn>
|
3199
3215
|
-->
|
3200
3216
|
<!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
|
3201
|
-
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
3217
|
+
<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">
|
3202
3218
|
|
3203
3219
|
<!-- list of footnotes to calculate actual footnotes number -->
|
3204
3220
|
<xsl:variable name="p_fn_">
|
@@ -3255,8 +3271,7 @@
|
|
3255
3271
|
</fo:basic-link>
|
3256
3272
|
</fo:inline>
|
3257
3273
|
</xsl:variable>
|
3258
|
-
|
3259
|
-
gen_id=<xsl:value-of select="$gen_id"/> -->
|
3274
|
+
|
3260
3275
|
<xsl:choose>
|
3261
3276
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
3262
3277
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -3311,7 +3326,7 @@
|
|
3311
3326
|
<!-- commented:
|
3312
3327
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
3313
3328
|
because 'fn' there is in biblio-tag -->
|
3314
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
3329
|
+
<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])]">
|
3315
3330
|
<!-- copy unique fn -->
|
3316
3331
|
<fn gen_id="{generate-id(.)}">
|
3317
3332
|
<xsl:copy-of select="@*"/>
|
@@ -5858,7 +5873,9 @@
|
|
5858
5873
|
|
5859
5874
|
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
5860
5875
|
<xsl:if test="number($scale) < 100">
|
5861
|
-
|
5876
|
+
|
5877
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
5878
|
+
|
5862
5879
|
</xsl:if>
|
5863
5880
|
|
5864
5881
|
</xsl:if>
|
@@ -6784,7 +6801,7 @@
|
|
6784
6801
|
<!-- sourcecode -->
|
6785
6802
|
<!-- =============== -->
|
6786
6803
|
|
6787
|
-
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
6804
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
6788
6805
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
6789
6806
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
6790
6807
|
|
@@ -6871,6 +6888,12 @@
|
|
6871
6888
|
</xsl:attribute>
|
6872
6889
|
</xsl:for-each>
|
6873
6890
|
|
6891
|
+
<!-- remove margin between rows in the table with sourcecode line numbers -->
|
6892
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
|
6893
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
6894
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
6895
|
+
</xsl:if>
|
6896
|
+
|
6874
6897
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
6875
6898
|
</fo:block>
|
6876
6899
|
|
@@ -6919,7 +6942,7 @@
|
|
6919
6942
|
</xsl:template>
|
6920
6943
|
|
6921
6944
|
<!-- outer table with line numbers for sourcecode -->
|
6922
|
-
<xsl:template match="*[local-name()='
|
6945
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
|
6923
6946
|
<fo:block>
|
6924
6947
|
<fo:table width="100%" table-layout="fixed">
|
6925
6948
|
<xsl:copy-of select="@id"/>
|
@@ -6931,16 +6954,16 @@
|
|
6931
6954
|
</fo:table>
|
6932
6955
|
</fo:block>
|
6933
6956
|
</xsl:template>
|
6934
|
-
<xsl:template match="*[local-name()='
|
6957
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
|
6935
6958
|
<xsl:apply-templates/>
|
6936
6959
|
</xsl:template>
|
6937
|
-
<xsl:template match="*[local-name()='
|
6960
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
|
6938
6961
|
<fo:table-row>
|
6939
6962
|
<xsl:apply-templates/>
|
6940
6963
|
</fo:table-row>
|
6941
6964
|
</xsl:template>
|
6942
6965
|
<!-- first td with line numbers -->
|
6943
|
-
<xsl:template match="*[local-name()='
|
6966
|
+
<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'] -->
|
6944
6967
|
<fo:table-cell>
|
6945
6968
|
<fo:block>
|
6946
6969
|
|
@@ -6960,8 +6983,9 @@
|
|
6960
6983
|
</fo:block>
|
6961
6984
|
</fo:table-cell>
|
6962
6985
|
</xsl:template>
|
6986
|
+
|
6963
6987
|
<!-- second td with sourcecode -->
|
6964
|
-
<xsl:template match="*[local-name()='
|
6988
|
+
<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'] -->
|
6965
6989
|
<fo:table-cell>
|
6966
6990
|
<fo:block>
|
6967
6991
|
<xsl:apply-templates/>
|
@@ -7199,7 +7223,25 @@
|
|
7199
7223
|
<xsl:template match="*[local-name()='pre']" name="pre">
|
7200
7224
|
<fo:block xsl:use-attribute-sets="pre-style">
|
7201
7225
|
<xsl:copy-of select="@id"/>
|
7202
|
-
<xsl:
|
7226
|
+
<xsl:choose>
|
7227
|
+
|
7228
|
+
<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' -->
|
7229
|
+
<xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
|
7230
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
7231
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
7232
|
+
</xsl:if>
|
7233
|
+
<fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
|
7234
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
7235
|
+
<mtext><xsl:value-of select="."/></mtext>
|
7236
|
+
</math>
|
7237
|
+
</fo:instream-foreign-object>
|
7238
|
+
</xsl:when>
|
7239
|
+
|
7240
|
+
<xsl:otherwise>
|
7241
|
+
<xsl:apply-templates/>
|
7242
|
+
</xsl:otherwise>
|
7243
|
+
|
7244
|
+
</xsl:choose>
|
7203
7245
|
</fo:block>
|
7204
7246
|
</xsl:template>
|
7205
7247
|
<!-- =============== -->
|
@@ -8827,8 +8869,8 @@
|
|
8827
8869
|
|
8828
8870
|
<xsl:variable name="toc_level">
|
8829
8871
|
<!-- https://www.metanorma.org/author/ref/document-attributes/ -->
|
8830
|
-
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = '
|
8831
|
-
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = '
|
8872
|
+
<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:-->
|
8873
|
+
<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 -->
|
8832
8874
|
<xsl:choose>
|
8833
8875
|
<xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
|
8834
8876
|
<xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
|
@@ -9817,6 +9859,7 @@
|
|
9817
9859
|
<xsl:choose>
|
9818
9860
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
9819
9861
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
9862
|
+
<xsl:when test="$align = 'justified'">justify</xsl:when>
|
9820
9863
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
9821
9864
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
9822
9865
|
<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
|
|
@@ -705,14 +705,14 @@
|
|
705
705
|
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 -->
|
706
706
|
|
707
707
|
<!--
|
708
|
-
<
|
708
|
+
<metanorma-extension>
|
709
709
|
<presentation-metadata>
|
710
710
|
<papersize>letter</papersize>
|
711
711
|
</presentation-metadata>
|
712
|
-
</
|
712
|
+
</metanorma-extension>
|
713
713
|
-->
|
714
714
|
|
715
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
715
|
+
<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'])))"/>
|
716
716
|
<xsl:variable name="papersize_width_">
|
717
717
|
<xsl:choose>
|
718
718
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -829,7 +829,7 @@
|
|
829
829
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
830
830
|
|
831
831
|
<xsl:variable name="title-list-tables">
|
832
|
-
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
832
|
+
<xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
833
833
|
<xsl:value-of select="$toc_table_title"/>
|
834
834
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
835
835
|
<xsl:call-template name="getTitle">
|
@@ -839,7 +839,7 @@
|
|
839
839
|
</xsl:variable>
|
840
840
|
|
841
841
|
<xsl:variable name="title-list-figures">
|
842
|
-
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
842
|
+
<xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
843
843
|
<xsl:value-of select="$toc_figure_title"/>
|
844
844
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
845
845
|
<xsl:call-template name="getTitle">
|
@@ -849,7 +849,7 @@
|
|
849
849
|
</xsl:variable>
|
850
850
|
|
851
851
|
<xsl:variable name="title-list-recommendations">
|
852
|
-
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
852
|
+
<xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
853
853
|
<xsl:value-of select="$toc_requirement_title"/>
|
854
854
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
855
855
|
<xsl:call-template name="getTitle">
|
@@ -921,7 +921,7 @@
|
|
921
921
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
922
922
|
|
923
923
|
<xsl:variable name="additional_fonts_">
|
924
|
-
<xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = '
|
924
|
+
<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']">
|
925
925
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
926
926
|
</xsl:for-each>
|
927
927
|
</xsl:variable>
|
@@ -1965,10 +1965,10 @@
|
|
1965
1965
|
|
1966
1966
|
<xsl:template name="processTablesFigures_Contents">
|
1967
1967
|
<xsl:param name="always"/>
|
1968
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1968
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
1969
1969
|
<xsl:call-template name="processTables_Contents"/>
|
1970
1970
|
</xsl:if>
|
1971
|
-
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = '
|
1971
|
+
<xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
1972
1972
|
<xsl:call-template name="processFigures_Contents"/>
|
1973
1973
|
</xsl:if>
|
1974
1974
|
</xsl:template>
|
@@ -2311,6 +2311,8 @@
|
|
2311
2311
|
<xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
|
2312
2312
|
</xsl:if>
|
2313
2313
|
|
2314
|
+
<xsl:call-template name="setBordersTableArray"/>
|
2315
|
+
|
2314
2316
|
</xsl:element>
|
2315
2317
|
</xsl:variable>
|
2316
2318
|
|
@@ -2455,6 +2457,10 @@
|
|
2455
2457
|
|
2456
2458
|
</xsl:template>
|
2457
2459
|
|
2460
|
+
<xsl:template name="setBordersTableArray">
|
2461
|
+
|
2462
|
+
</xsl:template>
|
2463
|
+
|
2458
2464
|
<xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
|
2459
2465
|
<xsl:param name="continued"/>
|
2460
2466
|
<xsl:if test="normalize-space() != ''">
|
@@ -2929,6 +2935,8 @@
|
|
2929
2935
|
<fo:table-row>
|
2930
2936
|
<fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
|
2931
2937
|
|
2938
|
+
<xsl:call-template name="setBordersTableArray"/>
|
2939
|
+
|
2932
2940
|
<!-- fn will be processed inside 'note' processing -->
|
2933
2941
|
|
2934
2942
|
<!-- for BSI (not PAS) display Notes before footnotes -->
|
@@ -3050,6 +3058,8 @@
|
|
3050
3058
|
<xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
|
3051
3059
|
<fo:table-row xsl:use-attribute-sets="table-header-row-style">
|
3052
3060
|
|
3061
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3062
|
+
|
3053
3063
|
<xsl:call-template name="setTableRowAttributes"/>
|
3054
3064
|
|
3055
3065
|
<xsl:apply-templates/>
|
@@ -3073,6 +3083,8 @@
|
|
3073
3083
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
3074
3084
|
</xsl:if>
|
3075
3085
|
|
3086
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3087
|
+
|
3076
3088
|
<xsl:call-template name="setTableRowAttributes"/>
|
3077
3089
|
<xsl:apply-templates/>
|
3078
3090
|
</fo:table-row>
|
@@ -3092,6 +3104,8 @@
|
|
3092
3104
|
<xsl:with-param name="default">center</xsl:with-param>
|
3093
3105
|
</xsl:call-template>
|
3094
3106
|
|
3107
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3108
|
+
|
3095
3109
|
<xsl:if test="$lang = 'ar'">
|
3096
3110
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3097
3111
|
</xsl:if>
|
@@ -3144,6 +3158,8 @@
|
|
3144
3158
|
|
3145
3159
|
<!-- bsi -->
|
3146
3160
|
|
3161
|
+
<xsl:call-template name="setBordersTableArray"/>
|
3162
|
+
|
3147
3163
|
<xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
|
3148
3164
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3149
3165
|
</xsl:if>
|
@@ -3198,7 +3214,7 @@
|
|
3198
3214
|
</fn>
|
3199
3215
|
-->
|
3200
3216
|
<!-- footnotes in text (title, bibliography, main body, table's, figure's names), not for tables, figures -->
|
3201
|
-
<xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
3217
|
+
<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">
|
3202
3218
|
|
3203
3219
|
<!-- list of footnotes to calculate actual footnotes number -->
|
3204
3220
|
<xsl:variable name="p_fn_">
|
@@ -3255,8 +3271,7 @@
|
|
3255
3271
|
</fo:basic-link>
|
3256
3272
|
</fo:inline>
|
3257
3273
|
</xsl:variable>
|
3258
|
-
|
3259
|
-
gen_id=<xsl:value-of select="$gen_id"/> -->
|
3274
|
+
|
3260
3275
|
<xsl:choose>
|
3261
3276
|
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
3262
3277
|
<xsl:copy-of select="$footnote_inline"/>
|
@@ -3311,7 +3326,7 @@
|
|
3311
3326
|
<!-- commented:
|
3312
3327
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
3313
3328
|
because 'fn' there is in biblio-tag -->
|
3314
|
-
<xsl:for-each select=".//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])
|
3329
|
+
<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])]">
|
3315
3330
|
<!-- copy unique fn -->
|
3316
3331
|
<fn gen_id="{generate-id(.)}">
|
3317
3332
|
<xsl:copy-of select="@*"/>
|
@@ -5858,7 +5873,9 @@
|
|
5858
5873
|
|
5859
5874
|
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
5860
5875
|
<xsl:if test="number($scale) < 100">
|
5861
|
-
|
5876
|
+
|
5877
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
5878
|
+
|
5862
5879
|
</xsl:if>
|
5863
5880
|
|
5864
5881
|
</xsl:if>
|
@@ -6784,7 +6801,7 @@
|
|
6784
6801
|
<!-- sourcecode -->
|
6785
6802
|
<!-- =============== -->
|
6786
6803
|
|
6787
|
-
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = '
|
6804
|
+
<xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
6788
6805
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
6789
6806
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
6790
6807
|
|
@@ -6871,6 +6888,12 @@
|
|
6871
6888
|
</xsl:attribute>
|
6872
6889
|
</xsl:for-each>
|
6873
6890
|
|
6891
|
+
<!-- remove margin between rows in the table with sourcecode line numbers -->
|
6892
|
+
<xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
|
6893
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
6894
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
6895
|
+
</xsl:if>
|
6896
|
+
|
6874
6897
|
<xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
|
6875
6898
|
</fo:block>
|
6876
6899
|
|
@@ -6919,7 +6942,7 @@
|
|
6919
6942
|
</xsl:template>
|
6920
6943
|
|
6921
6944
|
<!-- outer table with line numbers for sourcecode -->
|
6922
|
-
<xsl:template match="*[local-name()='
|
6945
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] | -->
|
6923
6946
|
<fo:block>
|
6924
6947
|
<fo:table width="100%" table-layout="fixed">
|
6925
6948
|
<xsl:copy-of select="@id"/>
|
@@ -6931,16 +6954,16 @@
|
|
6931
6954
|
</fo:table>
|
6932
6955
|
</fo:block>
|
6933
6956
|
</xsl:template>
|
6934
|
-
<xsl:template match="*[local-name()='
|
6957
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']/*[local-name() = 'tbody']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']/*[local-name() = 'tbody'] | -->
|
6935
6958
|
<xsl:apply-templates/>
|
6936
6959
|
</xsl:template>
|
6937
|
-
<xsl:template match="*[local-name()='
|
6960
|
+
<xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode']//*[local-name()='tr'] | -->
|
6938
6961
|
<fo:table-row>
|
6939
6962
|
<xsl:apply-templates/>
|
6940
6963
|
</fo:table-row>
|
6941
6964
|
</xsl:template>
|
6942
6965
|
<!-- first td with line numbers -->
|
6943
|
-
<xsl:template match="*[local-name()='
|
6966
|
+
<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'] -->
|
6944
6967
|
<fo:table-cell>
|
6945
6968
|
<fo:block>
|
6946
6969
|
|
@@ -6960,8 +6983,9 @@
|
|
6960
6983
|
</fo:block>
|
6961
6984
|
</fo:table-cell>
|
6962
6985
|
</xsl:template>
|
6986
|
+
|
6963
6987
|
<!-- second td with sourcecode -->
|
6964
|
-
<xsl:template match="*[local-name()='
|
6988
|
+
<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'] -->
|
6965
6989
|
<fo:table-cell>
|
6966
6990
|
<fo:block>
|
6967
6991
|
<xsl:apply-templates/>
|
@@ -7199,7 +7223,25 @@
|
|
7199
7223
|
<xsl:template match="*[local-name()='pre']" name="pre">
|
7200
7224
|
<fo:block xsl:use-attribute-sets="pre-style">
|
7201
7225
|
<xsl:copy-of select="@id"/>
|
7202
|
-
<xsl:
|
7226
|
+
<xsl:choose>
|
7227
|
+
|
7228
|
+
<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' -->
|
7229
|
+
<xsl:if test="ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']"> <!-- is current tr isn't last -->
|
7230
|
+
<xsl:attribute name="margin-top">0pt</xsl:attribute>
|
7231
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
7232
|
+
</xsl:if>
|
7233
|
+
<fo:instream-foreign-object fox:alt-text="{.}" content-width="95%">
|
7234
|
+
<math xmlns="http://www.w3.org/1998/Math/MathML">
|
7235
|
+
<mtext><xsl:value-of select="."/></mtext>
|
7236
|
+
</math>
|
7237
|
+
</fo:instream-foreign-object>
|
7238
|
+
</xsl:when>
|
7239
|
+
|
7240
|
+
<xsl:otherwise>
|
7241
|
+
<xsl:apply-templates/>
|
7242
|
+
</xsl:otherwise>
|
7243
|
+
|
7244
|
+
</xsl:choose>
|
7203
7245
|
</fo:block>
|
7204
7246
|
</xsl:template>
|
7205
7247
|
<!-- =============== -->
|
@@ -8827,8 +8869,8 @@
|
|
8827
8869
|
|
8828
8870
|
<xsl:variable name="toc_level">
|
8829
8871
|
<!-- https://www.metanorma.org/author/ref/document-attributes/ -->
|
8830
|
-
<xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = '
|
8831
|
-
<xsl:variable name="toclevels" select="normalize-space(//*[local-name() = '
|
8872
|
+
<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:-->
|
8873
|
+
<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 -->
|
8832
8874
|
<xsl:choose>
|
8833
8875
|
<xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
|
8834
8876
|
<xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
|
@@ -9817,6 +9859,7 @@
|
|
9817
9859
|
<xsl:choose>
|
9818
9860
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
9819
9861
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
9862
|
+
<xsl:when test="$align = 'justified'">justify</xsl:when>
|
9820
9863
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
9821
9864
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
9822
9865
|
<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-m3aawg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.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: htmlentities
|