metanorma-cc 2.5.12 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/isodoc/cc/cc.standard.xsl +341 -73
- data/lib/isodoc/cc/html/_coverpage.css +224 -124
- data/lib/isodoc/cc/html/_coverpage.scss +2 -1
- data/lib/isodoc/cc/html/cc.css +251 -190
- data/lib/isodoc/cc/html/htmlstyle.css +555 -712
- data/lib/isodoc/cc/html/htmlstyle.scss +2 -2
- data/lib/isodoc/cc/html/wordstyle.css +459 -389
- data/lib/metanorma/cc/basicdoc.rng +37 -32
- data/lib/metanorma/cc/cc.rng +27 -30
- data/lib/metanorma/cc/isodoc.rng +35 -23
- data/lib/metanorma/cc/version.rb +1 -1
- data/metanorma-cc.gemspec +4 -3
- data/metanorma.yml +1 -0
- metadata +26 -12
@@ -1,4 +1,4 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:csd="https://www.metanorma.org/ns/
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:csd="https://www.metanorma.org/ns/standoc" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:java="http://xml.apache.org/xalan/java" xmlns:redirect="http://xml.apache.org/xalan/redirect" exclude-result-prefixes="java xalan" extension-element-prefixes="redirect" version="1.0">
|
2
2
|
|
3
3
|
<xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
|
4
4
|
|
@@ -8,14 +8,14 @@
|
|
8
8
|
|
9
9
|
<xsl:variable name="copyright">
|
10
10
|
<xsl:text>© The Calendaring and Scheduling Consortium, Inc. </xsl:text>
|
11
|
-
<xsl:value-of select="/csd:
|
11
|
+
<xsl:value-of select="/csd:metanorma/csd:bibdata/csd:copyright/csd:from"/>
|
12
12
|
<xsl:text> – All rights reserved</xsl:text>
|
13
13
|
</xsl:variable>
|
14
14
|
|
15
15
|
<xsl:variable name="header">
|
16
|
-
<xsl:value-of select="/csd:
|
16
|
+
<xsl:value-of select="/csd:metanorma/csd:bibdata/csd:docidentifier[@type = 'csd']"/>
|
17
17
|
<xsl:text>:</xsl:text>
|
18
|
-
<xsl:value-of select="/csd:
|
18
|
+
<xsl:value-of select="/csd:metanorma/csd:bibdata/csd:copyright/csd:from"/>
|
19
19
|
</xsl:variable>
|
20
20
|
|
21
21
|
<xsl:variable name="contents_">
|
@@ -184,17 +184,17 @@
|
|
184
184
|
<fo:block text-align="right">
|
185
185
|
<!-- CC/FDS 18011:2018 -->
|
186
186
|
<fo:block font-size="14pt" font-weight="bold" margin-bottom="10pt">
|
187
|
-
<xsl:value-of select="/csd:
|
187
|
+
<xsl:value-of select="/csd:metanorma/csd:bibdata/csd:docidentifier[@type = 'csd']"/><xsl:text> </xsl:text>
|
188
188
|
</fo:block>
|
189
189
|
<fo:block margin-bottom="12pt">
|
190
|
-
<xsl:value-of select="/csd:
|
190
|
+
<xsl:value-of select="/csd:metanorma/csd:bibdata/csd:copyright/csd:owner/csd:organization/csd:name"/>
|
191
191
|
<xsl:text> TC </xsl:text>
|
192
|
-
<xsl:value-of select="/csd:
|
192
|
+
<xsl:value-of select="/csd:metanorma/csd:bibdata/csd:ext/csd:editorialgroup/csd:technical-committee"/>
|
193
193
|
<xsl:text> </xsl:text>
|
194
194
|
</fo:block>
|
195
195
|
</fo:block>
|
196
196
|
<fo:block font-size="24pt" font-weight="bold" text-align="center" role="H1">
|
197
|
-
<xsl:value-of select="/csd:
|
197
|
+
<xsl:value-of select="/csd:metanorma/csd:bibdata/csd:title[@language = 'en']"/>
|
198
198
|
<xsl:value-of select="$linebreak"/>
|
199
199
|
</fo:block>
|
200
200
|
<fo:block> </fo:block>
|
@@ -204,12 +204,12 @@
|
|
204
204
|
<fo:block padding-top="1mm">
|
205
205
|
<xsl:call-template name="capitalizeWords">
|
206
206
|
<!-- ex: final-draft -->
|
207
|
-
<xsl:with-param name="str" select="/csd:
|
207
|
+
<xsl:with-param name="str" select="/csd:metanorma/csd:bibdata/csd:status/csd:stage"/>
|
208
208
|
</xsl:call-template>
|
209
209
|
<xsl:text> </xsl:text>
|
210
210
|
<xsl:call-template name="capitalizeWords">
|
211
211
|
<!-- ex: standard -->
|
212
|
-
<xsl:with-param name="str" select="/csd:
|
212
|
+
<xsl:with-param name="str" select="/csd:metanorma/csd:bibdata/csd:ext/csd:doctype"/>
|
213
213
|
</xsl:call-template>
|
214
214
|
</fo:block>
|
215
215
|
</fo:block-container>
|
@@ -226,7 +226,7 @@
|
|
226
226
|
</fo:block-container>
|
227
227
|
<fo:block text-align="center">
|
228
228
|
<xsl:text>The Calendaring and Scheduling Consortium, Inc. </xsl:text>
|
229
|
-
<xsl:value-of select="/csd:
|
229
|
+
<xsl:value-of select="/csd:metanorma/csd:bibdata/csd:copyright/csd:from"/>
|
230
230
|
</fo:block>
|
231
231
|
</fo:flow>
|
232
232
|
</fo:page-sequence>
|
@@ -278,20 +278,20 @@
|
|
278
278
|
<fo:block margin-bottom="15pt"> </fo:block>
|
279
279
|
<fo:block margin-bottom="14pt">
|
280
280
|
<xsl:text>© </xsl:text>
|
281
|
-
<xsl:value-of select="/csd:
|
281
|
+
<xsl:value-of select="/csd:metanorma/csd:bibdata/csd:copyright/csd:from"/>
|
282
282
|
<xsl:text> </xsl:text>
|
283
283
|
<fo:inline>
|
284
|
-
<xsl:apply-templates select="/csd:
|
284
|
+
<xsl:apply-templates select="/csd:metanorma/csd:boilerplate/csd:feedback-statement/csd:clause/csd:p[@id = 'boilerplate-name']"/>
|
285
285
|
</fo:inline>
|
286
286
|
</fo:block>
|
287
287
|
<fo:block margin-bottom="12pt">
|
288
|
-
<xsl:apply-templates select="/csd:
|
288
|
+
<xsl:apply-templates select="/csd:metanorma/csd:boilerplate/csd:legal-statement"/>
|
289
289
|
</fo:block>
|
290
290
|
<fo:block margin-bottom="12pt">
|
291
|
-
<xsl:apply-templates select="/csd:
|
291
|
+
<xsl:apply-templates select="/csd:metanorma/csd:boilerplate/csd:feedback-statement/csd:clause/csd:p[@id = 'boilerplate-name']"/>
|
292
292
|
</fo:block>
|
293
293
|
<fo:block>
|
294
|
-
<xsl:apply-templates select="/csd:
|
294
|
+
<xsl:apply-templates select="/csd:metanorma/csd:boilerplate/csd:feedback-statement/csd:clause/csd:p[@id = 'boilerplate-address']"/>
|
295
295
|
</fo:block>
|
296
296
|
|
297
297
|
<fo:block break-after="page"/>
|
@@ -328,7 +328,7 @@
|
|
328
328
|
<xsl:call-template name="insertHeaderFooter"/>
|
329
329
|
<fo:flow flow-name="xsl-region-body">
|
330
330
|
<!-- <fo:block font-size="16pt" font-weight="bold" margin-bottom="17pt" role="H1">
|
331
|
-
<xsl:value-of select="/csd:
|
331
|
+
<xsl:value-of select="/csd:metanorma/csd:bibdata/csd:title[@language = 'en']"/>
|
332
332
|
</fo:block> -->
|
333
333
|
<fo:block>
|
334
334
|
<!-- <xsl:call-template name="processMainSectionsDefault"/> -->
|
@@ -681,21 +681,21 @@
|
|
681
681
|
|
682
682
|
<xsl:variable name="namespace_full_">
|
683
683
|
<xsl:choose>
|
684
|
-
<xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[
|
685
|
-
<xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/
|
684
|
+
<xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="namespace-uri(//*[local-name() = 'metanorma'][1])"/></xsl:when>
|
685
|
+
<xsl:otherwise><xsl:value-of select="namespace-uri(/*)"/></xsl:otherwise><!-- example: https://www.metanorma.org/ns/standoc -->
|
686
686
|
</xsl:choose>
|
687
687
|
</xsl:variable>
|
688
688
|
<xsl:variable name="namespace_full" select="normalize-space($namespace_full_)"/>
|
689
689
|
|
690
690
|
<xsl:variable name="root_element_">
|
691
691
|
<xsl:choose>
|
692
|
-
<xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[
|
693
|
-
<xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: iso-standard -->
|
692
|
+
<xsl:when test="local-name(/*) = 'metanorma-collection'"><xsl:value-of select="local-name(//*[local-name() = 'metanorma'][1])"/></xsl:when>
|
693
|
+
<xsl:otherwise><xsl:value-of select="local-name(/*)"/></xsl:otherwise><!-- example: metanorma (former iso-standard) -->
|
694
694
|
</xsl:choose>
|
695
695
|
</xsl:variable>
|
696
696
|
<xsl:variable name="root_element" select="normalize-space($root_element_)"/>
|
697
697
|
|
698
|
-
<xsl:variable name="document_scheme" select="normalize-space(//*[
|
698
|
+
<xsl:variable name="document_scheme" select="normalize-space(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
|
699
699
|
|
700
700
|
<!-- external parameters -->
|
701
701
|
|
@@ -796,7 +796,7 @@
|
|
796
796
|
</metanorma-extension>
|
797
797
|
-->
|
798
798
|
|
799
|
-
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[
|
799
|
+
<xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
|
800
800
|
<xsl:variable name="papersize_width_">
|
801
801
|
<xsl:choose>
|
802
802
|
<xsl:when test="$papersize = 'letter'">215.9</xsl:when>
|
@@ -858,7 +858,7 @@
|
|
858
858
|
<xsl:variable name="marginBottom" select="normalize-space($marginBottom_)"/>
|
859
859
|
|
860
860
|
<xsl:variable name="layout_columns_default">1</xsl:variable>
|
861
|
-
<xsl:variable name="layout_columns_" select="normalize-space((//*[
|
861
|
+
<xsl:variable name="layout_columns_" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'layout-columns'])"/>
|
862
862
|
<xsl:variable name="layout_columns">
|
863
863
|
<xsl:choose>
|
864
864
|
<xsl:when test="$layout_columns_ != ''"><xsl:value-of select="$layout_columns_"/></xsl:when>
|
@@ -919,7 +919,7 @@
|
|
919
919
|
<xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
|
920
920
|
|
921
921
|
<xsl:variable name="title-list-tables">
|
922
|
-
<xsl:variable name="toc_table_title" select="//*[
|
922
|
+
<xsl:variable name="toc_table_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
|
923
923
|
<xsl:value-of select="$toc_table_title"/>
|
924
924
|
<xsl:if test="normalize-space($toc_table_title) = ''">
|
925
925
|
<xsl:call-template name="getLocalizedString">
|
@@ -929,7 +929,7 @@
|
|
929
929
|
</xsl:variable>
|
930
930
|
|
931
931
|
<xsl:variable name="title-list-figures">
|
932
|
-
<xsl:variable name="toc_figure_title" select="//*[
|
932
|
+
<xsl:variable name="toc_figure_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
|
933
933
|
<xsl:value-of select="$toc_figure_title"/>
|
934
934
|
<xsl:if test="normalize-space($toc_figure_title) = ''">
|
935
935
|
<xsl:call-template name="getLocalizedString">
|
@@ -939,7 +939,7 @@
|
|
939
939
|
</xsl:variable>
|
940
940
|
|
941
941
|
<xsl:variable name="title-list-recommendations">
|
942
|
-
<xsl:variable name="toc_requirement_title" select="//*[
|
942
|
+
<xsl:variable name="toc_requirement_title" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
|
943
943
|
<xsl:value-of select="$toc_requirement_title"/>
|
944
944
|
<xsl:if test="normalize-space($toc_requirement_title) = ''">
|
945
945
|
<xsl:call-template name="getLocalizedString">
|
@@ -949,8 +949,8 @@
|
|
949
949
|
</xsl:variable>
|
950
950
|
|
951
951
|
<xsl:variable name="bibdata">
|
952
|
-
<xsl:copy-of select="//*[
|
953
|
-
<xsl:copy-of select="//*[
|
952
|
+
<xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']"/>
|
953
|
+
<xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'localized-strings']"/>
|
954
954
|
</xsl:variable>
|
955
955
|
|
956
956
|
<!-- Characters -->
|
@@ -1015,7 +1015,7 @@
|
|
1015
1015
|
<xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
|
1016
1016
|
|
1017
1017
|
<xsl:variable name="additional_fonts_">
|
1018
|
-
<xsl:for-each select="//*[
|
1018
|
+
<xsl:for-each select="//*[local-name() = 'metanorma'][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[local-name() = 'metanorma'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
|
1019
1019
|
<xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
|
1020
1020
|
</xsl:for-each>
|
1021
1021
|
</xsl:variable>
|
@@ -2306,10 +2306,10 @@
|
|
2306
2306
|
|
2307
2307
|
<xsl:template name="processTablesFigures_Contents">
|
2308
2308
|
<xsl:param name="always"/>
|
2309
|
-
<xsl:if test="(//*[
|
2309
|
+
<xsl:if test="(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
2310
2310
|
<xsl:call-template name="processTables_Contents"/>
|
2311
2311
|
</xsl:if>
|
2312
|
-
<xsl:if test="(//*[
|
2312
|
+
<xsl:if test="(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
|
2313
2313
|
<xsl:call-template name="processFigures_Contents"/>
|
2314
2314
|
</xsl:if>
|
2315
2315
|
</xsl:template>
|
@@ -2389,7 +2389,7 @@
|
|
2389
2389
|
</xsl:template><!-- END: processMainSectionsDefault -->
|
2390
2390
|
|
2391
2391
|
<!-- Example:
|
2392
|
-
<
|
2392
|
+
<metanorma>
|
2393
2393
|
<preface>
|
2394
2394
|
<page_sequence>
|
2395
2395
|
<clause...
|
@@ -2412,7 +2412,7 @@
|
|
2412
2412
|
<page_sequence>
|
2413
2413
|
<annex ..
|
2414
2414
|
</page_sequence>
|
2415
|
-
</
|
2415
|
+
</metanorma>
|
2416
2416
|
-->
|
2417
2417
|
<xsl:template name="processPrefaceAndMainSectionsDefault_items">
|
2418
2418
|
|
@@ -2455,15 +2455,8 @@
|
|
2455
2455
|
</xsl:template> <!-- END: insertPrefaceSectionsPageSequences -->
|
2456
2456
|
|
2457
2457
|
<xsl:template name="insertMainSectionsPageSequences">
|
2458
|
-
<xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
|
2459
|
-
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
2460
|
-
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
2461
|
-
<xsl:sort select="@displayorder" data-type="number"/>
|
2462
|
-
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
2463
2458
|
|
2464
|
-
|
2465
|
-
</xsl:element>
|
2466
|
-
</xsl:element>
|
2459
|
+
<xsl:call-template name="insertSectionsInPageSequence"/>
|
2467
2460
|
|
2468
2461
|
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
2469
2462
|
<xsl:for-each select="/*/*[local-name()='annex']">
|
@@ -2482,6 +2475,18 @@
|
|
2482
2475
|
</xsl:element>
|
2483
2476
|
</xsl:template> <!-- END: insertMainSectionsPageSequences -->
|
2484
2477
|
|
2478
|
+
<xsl:template name="insertSectionsInPageSequence">
|
2479
|
+
<xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
|
2480
|
+
<xsl:element name="page_sequence" namespace="{$namespace_full}">
|
2481
|
+
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
2482
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2483
|
+
<xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
|
2484
|
+
|
2485
|
+
</xsl:for-each>
|
2486
|
+
</xsl:element>
|
2487
|
+
</xsl:element>
|
2488
|
+
</xsl:template>
|
2489
|
+
|
2485
2490
|
<xsl:template name="insertMainSectionsInSeparatePageSequences">
|
2486
2491
|
<xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
|
2487
2492
|
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
|
@@ -3995,7 +4000,7 @@
|
|
3995
4000
|
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
3996
4001
|
|
3997
4002
|
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
3998
|
-
<xsl:variable name="lang" select="ancestor::*[
|
4003
|
+
<xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
3999
4004
|
<xsl:variable name="reference_">
|
4000
4005
|
<xsl:value-of select="@reference"/>
|
4001
4006
|
<xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
|
@@ -4116,13 +4121,13 @@
|
|
4116
4121
|
footnotes in bibliography
|
4117
4122
|
footnotes in document's body (except table's head/body/foot and figure text)
|
4118
4123
|
-->
|
4119
|
-
<xsl:for-each select="ancestor::*[
|
4124
|
+
<xsl:for-each select="ancestor::*[local-name() = 'metanorma']/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
4120
4125
|
<fn gen_id="{generate-id(.)}">
|
4121
4126
|
<xsl:copy-of select="@*"/>
|
4122
4127
|
<xsl:copy-of select="node()"/>
|
4123
4128
|
</fn>
|
4124
4129
|
</xsl:for-each>
|
4125
|
-
<xsl:for-each select="ancestor::*[
|
4130
|
+
<xsl:for-each select="ancestor::*[local-name() = 'metanorma']/*[local-name()='boilerplate']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='preface']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='sections']/* | ancestor::*[local-name() = 'metanorma']//*[local-name()='annex'] | ancestor::*[local-name() = 'metanorma']//*[local-name()='bibliography']/*">
|
4126
4131
|
<xsl:sort select="@displayorder" data-type="number"/>
|
4127
4132
|
<!-- commented:
|
4128
4133
|
.//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] |
|
@@ -6484,6 +6489,8 @@
|
|
6484
6489
|
<!-- ======================================= -->
|
6485
6490
|
<!-- math -->
|
6486
6491
|
<!-- ======================================= -->
|
6492
|
+
<xsl:template match="*[local-name() = 'stem'][following-sibling::*[1][local-name() = 'fmt-stem']]"/> <!-- for tablesonly.xml generated by mn2pdf -->
|
6493
|
+
|
6487
6494
|
<xsl:template match="mathml:math">
|
6488
6495
|
<xsl:variable name="isAdded" select="@added"/>
|
6489
6496
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
@@ -6843,10 +6850,10 @@
|
|
6843
6850
|
<xsl:template match="*[local-name()='localityStack']"/>
|
6844
6851
|
|
6845
6852
|
<xsl:variable name="pdfAttachmentsList_">
|
6846
|
-
<xsl:for-each select="//*[
|
6853
|
+
<xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
6847
6854
|
<attachment filename="{@name}"/>
|
6848
6855
|
</xsl:for-each>
|
6849
|
-
<xsl:if test="not(//*[
|
6856
|
+
<xsl:if test="not(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
6850
6857
|
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
6851
6858
|
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
6852
6859
|
<attachment filename="{$attachment_path}"/>
|
@@ -8312,7 +8319,9 @@
|
|
8312
8319
|
<xsl:apply-templates mode="bookmarks"/>
|
8313
8320
|
</xsl:template>
|
8314
8321
|
|
8315
|
-
<xsl:template match="*[local-name() = '
|
8322
|
+
<xsl:template match="*[local-name() = 'stem']" mode="contents"/>
|
8323
|
+
|
8324
|
+
<xsl:template match="*[local-name() = 'title' or local-name() = 'name' or local-name() = 'fmt-title' or local-name() = 'fmt-name']//*[local-name() = 'fmt-stem']" mode="contents">
|
8316
8325
|
<xsl:apply-templates select="."/>
|
8317
8326
|
</xsl:template>
|
8318
8327
|
|
@@ -8329,7 +8338,15 @@
|
|
8329
8338
|
<xsl:apply-templates mode="contents"/>
|
8330
8339
|
</xsl:template>
|
8331
8340
|
|
8332
|
-
<xsl:template match="*[local-name() = '
|
8341
|
+
<xsl:template match="*[local-name() = 'concept']" mode="contents"/>
|
8342
|
+
<xsl:template match="*[local-name() = 'eref']" mode="contents"/>
|
8343
|
+
<xsl:template match="*[local-name() = 'xref']" mode="contents"/>
|
8344
|
+
<xsl:template match="*[local-name() = 'link']" mode="contents"/>
|
8345
|
+
<xsl:template match="*[local-name() = 'origin']" mode="contents"/>
|
8346
|
+
<xsl:template match="*[local-name() = 'erefstack ']" mode="contents"/>
|
8347
|
+
|
8348
|
+
<xsl:template match="*[local-name() = 'stem']" mode="bookmarks"/>
|
8349
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="bookmarks">
|
8333
8350
|
<xsl:apply-templates mode="bookmarks"/>
|
8334
8351
|
</xsl:template>
|
8335
8352
|
|
@@ -8342,6 +8359,13 @@
|
|
8342
8359
|
<xsl:apply-templates mode="bookmarks"/>
|
8343
8360
|
</xsl:template>
|
8344
8361
|
|
8362
|
+
<xsl:template match="*[local-name() = 'concept']" mode="bookmarks"/>
|
8363
|
+
<xsl:template match="*[local-name() = 'eref']" mode="bookmarks"/>
|
8364
|
+
<xsl:template match="*[local-name() = 'xref']" mode="bookmarks"/>
|
8365
|
+
<xsl:template match="*[local-name() = 'link']" mode="bookmarks"/>
|
8366
|
+
<xsl:template match="*[local-name() = 'origin']" mode="bookmarks"/>
|
8367
|
+
<xsl:template match="*[local-name() = 'erefstack ']" mode="bookmarks"/>
|
8368
|
+
|
8345
8369
|
<!-- Bookmarks -->
|
8346
8370
|
<xsl:template name="addBookmarks">
|
8347
8371
|
<xsl:param name="contents"/>
|
@@ -8626,6 +8650,13 @@
|
|
8626
8650
|
|
8627
8651
|
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="contents_item"/>
|
8628
8652
|
|
8653
|
+
<xsl:template match="*[local-name() = 'concept']" mode="contents_item"/>
|
8654
|
+
<xsl:template match="*[local-name() = 'eref']" mode="contents_item"/>
|
8655
|
+
<xsl:template match="*[local-name() = 'xref']" mode="contents_item"/>
|
8656
|
+
<xsl:template match="*[local-name() = 'link']" mode="contents_item"/>
|
8657
|
+
<xsl:template match="*[local-name() = 'origin']" mode="contents_item"/>
|
8658
|
+
<xsl:template match="*[local-name() = 'erefstack ']" mode="contents_item"/>
|
8659
|
+
|
8629
8660
|
<xsl:template name="getSection">
|
8630
8661
|
<xsl:choose>
|
8631
8662
|
<xsl:when test="*[local-name() = 'fmt-title']">
|
@@ -8745,7 +8776,8 @@
|
|
8745
8776
|
</xsl:copy>
|
8746
8777
|
</xsl:template>
|
8747
8778
|
|
8748
|
-
<xsl:template match="*[local-name() = 'stem']" mode="contents_item"
|
8779
|
+
<xsl:template match="*[local-name() = 'stem']" mode="contents_item"/>
|
8780
|
+
<xsl:template match="*[local-name() = 'fmt-stem']" mode="contents_item">
|
8749
8781
|
<xsl:copy-of select="."/>
|
8750
8782
|
</xsl:template>
|
8751
8783
|
|
@@ -8809,7 +8841,7 @@
|
|
8809
8841
|
<!-- sourcecode -->
|
8810
8842
|
<!-- =============== -->
|
8811
8843
|
|
8812
|
-
<xsl:variable name="source-highlighter-css_" select="//*[
|
8844
|
+
<xsl:variable name="source-highlighter-css_" select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
|
8813
8845
|
<xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
|
8814
8846
|
<xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
|
8815
8847
|
|
@@ -10276,7 +10308,7 @@
|
|
10276
10308
|
|
10277
10309
|
</xsl:template> <!-- sections_element_style -->
|
10278
10310
|
|
10279
|
-
<xsl:template match="//*[
|
10311
|
+
<xsl:template match="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*" priority="2" name="preface_node"> <!-- /*/*[local-name() = 'preface']/* -->
|
10280
10312
|
|
10281
10313
|
<fo:block break-after="page"/>
|
10282
10314
|
|
@@ -10380,7 +10412,7 @@
|
|
10380
10412
|
<fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
10381
10413
|
</xsl:when>
|
10382
10414
|
<!-- if there isn't element with id 'from', then create 'bookmark' here -->
|
10383
|
-
<xsl:when test="ancestor::*[
|
10415
|
+
<xsl:when test="ancestor::*[local-name() = 'metanorma'] and not(ancestor::*[local-name() = 'metanorma']//*[@id = $id_from])">
|
10384
10416
|
<fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
|
10385
10417
|
</xsl:when>
|
10386
10418
|
<xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
|
@@ -11720,7 +11752,7 @@
|
|
11720
11752
|
<xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
|
11721
11753
|
|
11722
11754
|
<!-- move section 'Normative references' inside 'sections' -->
|
11723
|
-
<xsl:for-each select="* | ancestor::*[
|
11755
|
+
<xsl:for-each select="* | ancestor::*[local-name() = 'metanorma']/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | ancestor::*[local-name() = 'metanorma']/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
|
11724
11756
|
<xsl:sort select="@displayorder" data-type="number"/>
|
11725
11757
|
|
11726
11758
|
<!-- process Section's title -->
|
@@ -11781,10 +11813,126 @@
|
|
11781
11813
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
|
11782
11814
|
<xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_pres"/>
|
11783
11815
|
|
11784
|
-
<xsl:template match="*[local-name() = 'stem']
|
11816
|
+
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
|
11817
|
+
<xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
|
11818
|
+
|
11819
|
+
<xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
|
11820
|
+
<xsl:element name="stem" namespace="{$namespace_full}">
|
11821
|
+
<xsl:copy-of select="@*"/>
|
11822
|
+
<xsl:choose>
|
11823
|
+
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
11824
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
11825
|
+
</xsl:when>
|
11826
|
+
<xsl:otherwise>
|
11827
|
+
<xsl:copy-of select="node()"/>
|
11828
|
+
</xsl:otherwise>
|
11829
|
+
</xsl:choose>
|
11830
|
+
</xsl:element>
|
11831
|
+
</xsl:template>
|
11832
|
+
<xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
|
11833
|
+
<xsl:element name="stem" namespace="{$namespace_full}">
|
11834
|
+
<xsl:copy-of select="@*"/>
|
11835
|
+
<xsl:choose>
|
11836
|
+
<xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
|
11837
|
+
<xsl:copy-of select="*[local-name() = 'semx']/node()"/>
|
11838
|
+
</xsl:when>
|
11839
|
+
<xsl:otherwise>
|
11840
|
+
<xsl:copy-of select="node()"/>
|
11841
|
+
</xsl:otherwise>
|
11842
|
+
</xsl:choose>
|
11843
|
+
</xsl:element>
|
11844
|
+
</xsl:template>
|
11845
|
+
|
11846
|
+
<xsl:template match="*[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
|
11785
11847
|
<xsl:copy-of select="."/>
|
11786
11848
|
</xsl:template>
|
11787
11849
|
|
11850
|
+
<!-- https://github.com/metanorma/isodoc/issues/651 -->
|
11851
|
+
<!-- *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])] -->
|
11852
|
+
<xsl:template match="*[local-name() = 'sourcecode']" mode="update_xml_step1">
|
11853
|
+
<xsl:copy>
|
11854
|
+
<xsl:copy-of select="@*"/>
|
11855
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
|
11856
|
+
<xsl:choose>
|
11857
|
+
<xsl:when test="*[local-name() = 'fmt-sourcecode']">
|
11858
|
+
<xsl:choose>
|
11859
|
+
<xsl:when test="*[local-name() = 'fmt-sourcecode'][not(.//*[local-name() = 'passthrough'])] and not(.//*[local-name() = 'fmt-name'])">
|
11860
|
+
<xsl:copy-of select="*[local-name() = 'fmt-sourcecode']/node()"/>
|
11861
|
+
</xsl:when>
|
11862
|
+
<xsl:otherwise>
|
11863
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="update_xml_step1"/>
|
11864
|
+
</xsl:otherwise>
|
11865
|
+
</xsl:choose>
|
11866
|
+
</xsl:when>
|
11867
|
+
<xsl:otherwise> <!-- If fmt-sourcecode is not present -->
|
11868
|
+
<xsl:choose>
|
11869
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])">
|
11870
|
+
<xsl:copy-of select="node()"/>
|
11871
|
+
</xsl:when>
|
11872
|
+
<xsl:otherwise>
|
11873
|
+
<xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="update_xml_step1"/>
|
11874
|
+
</xsl:otherwise>
|
11875
|
+
</xsl:choose>
|
11876
|
+
</xsl:otherwise>
|
11877
|
+
</xsl:choose>
|
11878
|
+
</xsl:copy>
|
11879
|
+
</xsl:template>
|
11880
|
+
<xsl:template match="*[local-name() = 'sourcecode']" mode="update_xml_pres">
|
11881
|
+
<xsl:copy>
|
11882
|
+
<xsl:copy-of select="@*"/>
|
11883
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_pres"/>
|
11884
|
+
<xsl:choose>
|
11885
|
+
<xsl:when test="*[local-name() = 'fmt-sourcecode']">
|
11886
|
+
<xsl:choose>
|
11887
|
+
<xsl:when test="*[local-name() = 'fmt-sourcecode'][not(.//*[local-name() = 'passthrough'])] and not(.//*[local-name() = 'fmt-name'])">
|
11888
|
+
<xsl:copy-of select="*[local-name() = 'fmt-sourcecode']/node()"/>
|
11889
|
+
</xsl:when>
|
11890
|
+
<xsl:otherwise>
|
11891
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-sourcecode']/node()" mode="update_xml_pres"/>
|
11892
|
+
</xsl:otherwise>
|
11893
|
+
</xsl:choose>
|
11894
|
+
</xsl:when>
|
11895
|
+
<xsl:otherwise> <!-- If fmt-sourcecode is not present -->
|
11896
|
+
<xsl:choose>
|
11897
|
+
<xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[local-name() = 'fmt-name'])">
|
11898
|
+
<xsl:copy-of select="node()"/>
|
11899
|
+
</xsl:when>
|
11900
|
+
<xsl:otherwise>
|
11901
|
+
<xsl:apply-templates select="node()[not(local-name() = 'fmt-name')]" mode="update_xml_pres"/>
|
11902
|
+
</xsl:otherwise>
|
11903
|
+
</xsl:choose>
|
11904
|
+
</xsl:otherwise>
|
11905
|
+
</xsl:choose>
|
11906
|
+
</xsl:copy>
|
11907
|
+
</xsl:template>
|
11908
|
+
|
11909
|
+
<!-- https://github.com/metanorma/isodoc/issues/651 -->
|
11910
|
+
<xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="update_xml_step1" priority="2">
|
11911
|
+
<xsl:copy>
|
11912
|
+
<xsl:copy-of select="@*"/>
|
11913
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_step1"/>
|
11914
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="update_xml_step1"/>
|
11915
|
+
</xsl:copy>
|
11916
|
+
</xsl:template>
|
11917
|
+
<xsl:template match="*[local-name() = 'figure'][*[local-name() = 'fmt-figure']]" mode="update_xml_pres" priority="2">
|
11918
|
+
<xsl:copy>
|
11919
|
+
<xsl:copy-of select="@*"/>
|
11920
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-name']" mode="update_xml_pres"/>
|
11921
|
+
<xsl:apply-templates select="*[local-name() = 'fmt-figure']/node()" mode="update_xml_pres"/>
|
11922
|
+
</xsl:copy>
|
11923
|
+
</xsl:template>
|
11924
|
+
|
11925
|
+
<!-- https://github.com/metanorma/isodoc/issues/652 -->
|
11926
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']"/>
|
11927
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']"/>
|
11928
|
+
<xsl:template match="*[local-name() = 'amend']"/>
|
11929
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="update_xml_step1"/>
|
11930
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_step1"/>
|
11931
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'source']" mode="update_xml_pres"/>
|
11932
|
+
<xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
|
11933
|
+
<xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
|
11934
|
+
<xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
|
11935
|
+
|
11788
11936
|
<xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
|
11789
11937
|
<xsl:copy>
|
11790
11938
|
<xsl:copy-of select="@*"/>
|
@@ -11815,7 +11963,7 @@
|
|
11815
11963
|
<!-- add @id - first element with @id plus '_element_name' -->
|
11816
11964
|
<xsl:variable name="prefix_id_" select="(.//*[@id])[1]/@id"/>
|
11817
11965
|
<xsl:variable name="prefix_id"><xsl:value-of select="$prefix_id_"/><xsl:if test="normalize-space($prefix_id_) = ''"><xsl:value-of select="generate-id()"/></xsl:if></xsl:variable>
|
11818
|
-
<xsl:variable name="document_suffix" select="ancestor::*[
|
11966
|
+
<xsl:variable name="document_suffix" select="ancestor::*[local-name() = 'metanorma']/@document_suffix"/>
|
11819
11967
|
<xsl:attribute name="id"><xsl:value-of select="concat($prefix_id, '_', local-name(), '_', $document_suffix)"/></xsl:attribute>
|
11820
11968
|
</xsl:if>
|
11821
11969
|
</xsl:template>
|
@@ -12065,6 +12213,126 @@
|
|
12065
12213
|
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_step1"/>
|
12066
12214
|
<xsl:template match="*[local-name() = 'fmt-xref-label']" mode="update_xml_pres"/>
|
12067
12215
|
|
12216
|
+
<xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="update_xml_step1">
|
12217
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12218
|
+
</xsl:template>
|
12219
|
+
|
12220
|
+
<xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" mode="update_xml_pres">
|
12221
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12222
|
+
</xsl:template>
|
12223
|
+
|
12224
|
+
<xsl:template match="*[local-name() = 'requirement']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'recommendation']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'permission']/*[not(starts-with(local-name(), 'fmt-'))]" mode="update_xml_step1"/>
|
12225
|
+
|
12226
|
+
<xsl:template match="*[local-name() = 'requirement']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'recommendation']/*[not(starts-with(local-name(), 'fmt-'))] | *[local-name() = 'permission']/*[not(starts-with(local-name(), 'fmt-'))]" mode="update_xml_pres"/>
|
12227
|
+
|
12228
|
+
<xsl:template match="*[local-name() = 'fmt-provision']" mode="update_xml_step1">
|
12229
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12230
|
+
</xsl:template>
|
12231
|
+
<xsl:template match="*[local-name() = 'fmt-provision']" mode="update_xml_pres">
|
12232
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12233
|
+
</xsl:template>
|
12234
|
+
|
12235
|
+
<xsl:template match="*[local-name() = 'identifier']" mode="update_xml_step1"/>
|
12236
|
+
<xsl:template match="*[local-name() = 'identifier']" mode="update_xml_pres"/>
|
12237
|
+
<xsl:template match="*[local-name() = 'fmt-identifier']" mode="update_xml_step1">
|
12238
|
+
<xsl:element name="identifier" namespace="{$namespace_full}">
|
12239
|
+
<xsl:copy-of select="@*"/>
|
12240
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12241
|
+
</xsl:element>
|
12242
|
+
</xsl:template>
|
12243
|
+
<xsl:template match="*[local-name() = 'fmt-identifier']" mode="update_xml_pres">
|
12244
|
+
<xsl:element name="identifier" namespace="{$namespace_full}">
|
12245
|
+
<xsl:copy-of select="@*"/>
|
12246
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12247
|
+
</xsl:element>
|
12248
|
+
</xsl:template>
|
12249
|
+
|
12250
|
+
<xsl:template match="*[local-name() = 'concept']"/>
|
12251
|
+
<xsl:template match="*[local-name() = 'concept']" mode="update_xml_step1"/>
|
12252
|
+
<xsl:template match="*[local-name() = 'concept']" mode="update_xml_pres"/>
|
12253
|
+
|
12254
|
+
<xsl:template match="*[local-name() = 'fmt-concept']">
|
12255
|
+
<xsl:apply-templates/>
|
12256
|
+
</xsl:template>
|
12257
|
+
<xsl:template match="*[local-name() = 'fmt-concept']" mode="update_xml_step1">
|
12258
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12259
|
+
</xsl:template>
|
12260
|
+
<xsl:template match="*[local-name() = 'fmt-concept']" mode="update_xml_pres">
|
12261
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12262
|
+
</xsl:template>
|
12263
|
+
|
12264
|
+
<xsl:template match="*[local-name() = 'eref']" mode="update_xml_step1"/>
|
12265
|
+
<xsl:template match="*[local-name() = 'eref']" mode="update_xml_pres"/>
|
12266
|
+
|
12267
|
+
<xsl:template match="*[local-name() = 'fmt-eref']" mode="update_xml_step1">
|
12268
|
+
<xsl:element name="eref" namespace="{$namespace_full}">
|
12269
|
+
<xsl:copy-of select="@*"/>
|
12270
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12271
|
+
</xsl:element>
|
12272
|
+
</xsl:template>
|
12273
|
+
<xsl:template match="*[local-name() = 'fmt-eref']" mode="update_xml_pres">
|
12274
|
+
<xsl:element name="eref" namespace="{$namespace_full}">
|
12275
|
+
<xsl:copy-of select="@*"/>
|
12276
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12277
|
+
</xsl:element>
|
12278
|
+
</xsl:template>
|
12279
|
+
|
12280
|
+
<xsl:template match="*[local-name() = 'xref']" mode="update_xml_step1"/>
|
12281
|
+
<xsl:template match="*[local-name() = 'xref']" mode="update_xml_pres"/>
|
12282
|
+
|
12283
|
+
<xsl:template match="*[local-name() = 'fmt-xref']" mode="update_xml_step1">
|
12284
|
+
<xsl:element name="xref" namespace="{$namespace_full}">
|
12285
|
+
<xsl:copy-of select="@*"/>
|
12286
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12287
|
+
</xsl:element>
|
12288
|
+
</xsl:template>
|
12289
|
+
<xsl:template match="*[local-name() = 'fmt-xref']" mode="update_xml_pres">
|
12290
|
+
<xsl:element name="xref" namespace="{$namespace_full}">
|
12291
|
+
<xsl:copy-of select="@*"/>
|
12292
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12293
|
+
</xsl:element>
|
12294
|
+
</xsl:template>
|
12295
|
+
|
12296
|
+
<xsl:template match="*[local-name() = 'link']" mode="update_xml_step1"/>
|
12297
|
+
<xsl:template match="*[local-name() = 'link']" mode="update_xml_pres"/>
|
12298
|
+
|
12299
|
+
<xsl:template match="*[local-name() = 'fmt-link']" mode="update_xml_step1">
|
12300
|
+
<xsl:element name="link" namespace="{$namespace_full}">
|
12301
|
+
<xsl:copy-of select="@*"/>
|
12302
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12303
|
+
</xsl:element>
|
12304
|
+
</xsl:template>
|
12305
|
+
<xsl:template match="*[local-name() = 'fmt-link']" mode="update_xml_pres">
|
12306
|
+
<xsl:element name="link" namespace="{$namespace_full}">
|
12307
|
+
<xsl:copy-of select="@*"/>
|
12308
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12309
|
+
</xsl:element>
|
12310
|
+
</xsl:template>
|
12311
|
+
|
12312
|
+
<xsl:template match="*[local-name() = 'origin']" mode="update_xml_step1"/>
|
12313
|
+
<xsl:template match="*[local-name() = 'origin']" mode="update_xml_pres"/>
|
12314
|
+
|
12315
|
+
<xsl:template match="*[local-name() = 'fmt-origin']" mode="update_xml_step1">
|
12316
|
+
<xsl:element name="origin" namespace="{$namespace_full}">
|
12317
|
+
<xsl:copy-of select="@*"/>
|
12318
|
+
<xsl:apply-templates mode="update_xml_step1"/>
|
12319
|
+
</xsl:element>
|
12320
|
+
</xsl:template>
|
12321
|
+
<xsl:template match="*[local-name() = 'fmt-origin']" mode="update_xml_pres">
|
12322
|
+
<xsl:element name="origin" namespace="{$namespace_full}">
|
12323
|
+
<xsl:copy-of select="@*"/>
|
12324
|
+
<xsl:apply-templates mode="update_xml_pres"/>
|
12325
|
+
</xsl:element>
|
12326
|
+
</xsl:template>
|
12327
|
+
|
12328
|
+
<xsl:template match="*[local-name() = 'erefstack']"/>
|
12329
|
+
<xsl:template match="*[local-name() = 'erefstack']" mode="update_xml_step1"/>
|
12330
|
+
<xsl:template match="*[local-name() = 'erefstack']" mode="update_xml_pres"/>
|
12331
|
+
|
12332
|
+
<xsl:template match="*[local-name() = 'svgmap']"/>
|
12333
|
+
<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_step1"/>
|
12334
|
+
<xsl:template match="*[local-name() = 'svgmap']" mode="update_xml_pres"/>
|
12335
|
+
|
12068
12336
|
<!-- END: update new Presentation XML -->
|
12069
12337
|
|
12070
12338
|
<!-- =========================================================================== -->
|
@@ -12137,7 +12405,7 @@
|
|
12137
12405
|
|
12138
12406
|
<xsl:choose>
|
12139
12407
|
<xsl:when test="$page_sequence_at_top = 'true'">
|
12140
|
-
<xsl:for-each select="ancestor::*[ancestor::*[
|
12408
|
+
<xsl:for-each select="ancestor::*[ancestor::*[local-name() = 'metanorma']]">
|
12141
12409
|
<element pos="{position()}">
|
12142
12410
|
<xsl:copy-of select="@*[local-name() != 'id']"/>
|
12143
12411
|
<xsl:value-of select="name()"/>
|
@@ -12565,7 +12833,7 @@
|
|
12565
12833
|
</xsl:when>
|
12566
12834
|
<xsl:when test="contains($text, $replace)">
|
12567
12835
|
<xsl:value-of select="substring-before($text,$replace)"/>
|
12568
|
-
<xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/
|
12836
|
+
<xsl:element name="inlineChar" namespace="https://www.metanorma.org/ns/standoc"><xsl:value-of select="$by"/></xsl:element>
|
12569
12837
|
<xsl:call-template name="replaceChar">
|
12570
12838
|
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
|
12571
12839
|
<xsl:with-param name="replace" select="$replace"/>
|
@@ -12602,7 +12870,7 @@
|
|
12602
12870
|
</xsl:variable>
|
12603
12871
|
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
12604
12872
|
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
12605
|
-
<xsl:variable name="lang" select="ancestor::*[
|
12873
|
+
<xsl:variable name="lang" select="ancestor::*[local-name() = 'metanorma']/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
12606
12874
|
<xsl:variable name="reference" select="@reference"/>
|
12607
12875
|
<!-- fn sequence number in document -->
|
12608
12876
|
<xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
@@ -12647,7 +12915,7 @@
|
|
12647
12915
|
</xsl:template>
|
12648
12916
|
|
12649
12917
|
<xsl:template name="printEdition">
|
12650
|
-
<xsl:variable name="edition_i18n" select="normalize-space((//*[
|
12918
|
+
<xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
|
12651
12919
|
|
12652
12920
|
<xsl:choose>
|
12653
12921
|
<xsl:when test="$edition_i18n != ''">
|
@@ -12657,7 +12925,7 @@
|
|
12657
12925
|
</xsl:call-template>
|
12658
12926
|
</xsl:when>
|
12659
12927
|
<xsl:otherwise>
|
12660
|
-
<xsl:variable name="edition" select="normalize-space((//*[
|
12928
|
+
<xsl:variable name="edition" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'])"/>
|
12661
12929
|
<xsl:if test="$edition != ''"> <!-- Example: 1.3 -->
|
12662
12930
|
<xsl:call-template name="capitalize">
|
12663
12931
|
<xsl:with-param name="str">
|
@@ -12791,7 +13059,7 @@
|
|
12791
13059
|
<xsl:param name="charDelim" select="', '"/>
|
12792
13060
|
<xsl:choose>
|
12793
13061
|
<xsl:when test="$sorting = 'true' or $sorting = 'yes'">
|
12794
|
-
<xsl:for-each select="//*[
|
13062
|
+
<xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
12795
13063
|
<xsl:sort data-type="text" order="ascending"/>
|
12796
13064
|
<xsl:call-template name="insertKeyword">
|
12797
13065
|
<xsl:with-param name="meta" select="$meta"/>
|
@@ -12801,7 +13069,7 @@
|
|
12801
13069
|
</xsl:for-each>
|
12802
13070
|
</xsl:when>
|
12803
13071
|
<xsl:otherwise>
|
12804
|
-
<xsl:for-each select="//*[
|
13072
|
+
<xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
12805
13073
|
<xsl:call-template name="insertKeyword">
|
12806
13074
|
<xsl:with-param name="meta" select="$meta"/>
|
12807
13075
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
@@ -12876,7 +13144,7 @@
|
|
12876
13144
|
<!-- Dublin Core properties go here -->
|
12877
13145
|
<dc:title>
|
12878
13146
|
<xsl:variable name="title">
|
12879
|
-
<xsl:for-each select="(//*[
|
13147
|
+
<xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
|
12880
13148
|
|
12881
13149
|
<xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
|
12882
13150
|
|
@@ -12896,7 +13164,7 @@
|
|
12896
13164
|
</rdf:Alt>
|
12897
13165
|
</dc:title>
|
12898
13166
|
<xsl:variable name="dc_creator">
|
12899
|
-
<xsl:for-each select="(//*[
|
13167
|
+
<xsl:for-each select="(//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']">
|
12900
13168
|
|
12901
13169
|
<rdf:Seq>
|
12902
13170
|
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
@@ -12918,7 +13186,7 @@
|
|
12918
13186
|
<xsl:variable name="dc_description">
|
12919
13187
|
<xsl:variable name="abstract">
|
12920
13188
|
|
12921
|
-
<xsl:copy-of select="//*[
|
13189
|
+
<xsl:copy-of select="//*[local-name() = 'metanorma']/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'fmt-title']) and not(ancestor::*[local-name() = 'title']) and not(ancestor::*[local-name() = 'fmt-xref-label'])]"/>
|
12922
13190
|
|
12923
13191
|
</xsl:variable>
|
12924
13192
|
<rdf:Alt>
|
@@ -12946,7 +13214,7 @@
|
|
12946
13214
|
</rdf:RDF>
|
12947
13215
|
</x:xmpmeta>
|
12948
13216
|
<!-- add attachments -->
|
12949
|
-
<xsl:for-each select="//*[
|
13217
|
+
<xsl:for-each select="//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
12950
13218
|
<xsl:variable name="bibitem_attachment_" select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]"/>
|
12951
13219
|
<xsl:variable name="bibitem_attachment" select="xalan:nodeset($bibitem_attachment_)"/>
|
12952
13220
|
<xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
|
@@ -12980,7 +13248,7 @@
|
|
12980
13248
|
</pdf:embedded-file>
|
12981
13249
|
</xsl:for-each>
|
12982
13250
|
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
|
12983
|
-
<xsl:if test="not(//*[
|
13251
|
+
<xsl:if test="not(//*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
12984
13252
|
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
12985
13253
|
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
12986
13254
|
<xsl:variable name="attachment_name" select="java:org.metanorma.fop.Util.getFilenameFromPath($attachment_path)"/>
|
@@ -13184,9 +13452,9 @@
|
|
13184
13452
|
<xsl:value-of select="document('')//*/namespace::csd"/>
|
13185
13453
|
|
13186
13454
|
</xsl:variable>
|
13187
|
-
<xsl:if test="$documentNS != $XSLNS">
|
13455
|
+
<!-- <xsl:if test="$documentNS != $XSLNS">
|
13188
13456
|
<xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
|
13189
|
-
</xsl:if>
|
13457
|
+
</xsl:if> -->
|
13190
13458
|
</xsl:template> <!-- namespaceCheck -->
|
13191
13459
|
|
13192
13460
|
<xsl:template name="getLanguage">
|
@@ -13265,10 +13533,10 @@
|
|
13265
13533
|
|
13266
13534
|
<xsl:variable name="data_value">
|
13267
13535
|
<xsl:choose>
|
13268
|
-
<xsl:when test="$formatted = 'true' and string-length($bibdata_updated) !=
|
13536
|
+
<xsl:when test="$formatted = 'true' and string-length($bibdata_updated) != 0">
|
13269
13537
|
<xsl:apply-templates select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
13270
13538
|
</xsl:when>
|
13271
|
-
<xsl:when test="string-length($bibdata_updated) !=
|
13539
|
+
<xsl:when test="string-length($bibdata_updated) != 0">
|
13272
13540
|
<xsl:value-of select="xalan:nodeset($bibdata_updated)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
13273
13541
|
</xsl:when>
|
13274
13542
|
<xsl:when test="$formatted = 'true'">
|
@@ -13406,7 +13674,7 @@
|
|
13406
13674
|
<!-- background image -->
|
13407
13675
|
<fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
|
13408
13676
|
<fo:block>
|
13409
|
-
<xsl:for-each select="/*[
|
13677
|
+
<xsl:for-each select="/*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
|
13410
13678
|
<xsl:choose>
|
13411
13679
|
<xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
|
13412
13680
|
<fo:instream-foreign-object fox:alt-text="Image Front">
|