metanorma-mpfa 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/mpfa/converter.rb +17 -13
- data/lib/asciidoctor/mpfa/isodoc.rng +14 -0
- data/lib/isodoc/mpfa/html/scripts.html +0 -1
- data/lib/isodoc/mpfa/mpfa.circular.xsl +251 -107
- data/lib/isodoc/mpfa/mpfa.compliance-standards-for-mpf-trustees.xsl +251 -107
- data/lib/isodoc/mpfa/mpfa.guidelines.xsl +251 -107
- data/lib/isodoc/mpfa/mpfa.standards.xsl +251 -107
- data/lib/isodoc/mpfa/mpfa.supervision-of-mpf-intermediaries.xsl +251 -107
- data/lib/metanorma/mpfa/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f1856ecde5c7f52e4b8287bb3540ab3aebf463c08b80d90cf39b65f8fa3628d6
|
4
|
+
data.tar.gz: a185cb883f506cf8a609a836e3192643dcaf5e7ccaabe96b458709fc68e59fc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c79d6153c881b5e9c7328c2ab44b4405492b48388b756fafe8ae359001873f2fed8d4059f25cd5b06b630465e80f50f447ecdec1742474067a804dfcadbe1975
|
7
|
+
data.tar.gz: 7edd6a6ce865b9bb0e993953e9606a16ae666d2c3eb656267183c75a14348a943cf7b6cffee5f9b98f7ffc46ad1c0db36cfc6c8c78cbcf0f47d5ca08a962a73f
|
@@ -9,7 +9,6 @@ require_relative "./validate"
|
|
9
9
|
|
10
10
|
module Asciidoctor
|
11
11
|
module MPFA
|
12
|
-
|
13
12
|
# A {Converter} implementation that generates MPFD output, and a document
|
14
13
|
# schema encapsulation of the document for validation
|
15
14
|
#
|
@@ -25,13 +24,14 @@ module Asciidoctor
|
|
25
24
|
|
26
25
|
def metadata_committee(node, xml)
|
27
26
|
return unless node.attr("committee")
|
27
|
+
|
28
28
|
xml.editorialgroup do |a|
|
29
29
|
a.committee node.attr("committee"),
|
30
|
-
|
30
|
+
**attr_code(type: node.attr("committee-type"))
|
31
31
|
i = 2
|
32
|
-
while node.attr("committee_#{i}")
|
32
|
+
while node.attr("committee_#{i}")
|
33
33
|
a.committee node.attr("committee_#{i}"),
|
34
|
-
|
34
|
+
**attr_code(type: node.attr("committee-type_#{i}"))
|
35
35
|
i += 1
|
36
36
|
end
|
37
37
|
end
|
@@ -42,7 +42,7 @@ module Asciidoctor
|
|
42
42
|
xml.docnumber { |i| i << node.attr("docnumber") }
|
43
43
|
end
|
44
44
|
|
45
|
-
def title_validate(
|
45
|
+
def title_validate(_root)
|
46
46
|
nil
|
47
47
|
end
|
48
48
|
|
@@ -52,11 +52,14 @@ module Asciidoctor
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def outputs(node, ret)
|
55
|
-
File.open(@filename
|
56
|
-
presentation_xml_converter(node).convert(@filename
|
57
|
-
html_converter(node).convert(@filename
|
58
|
-
|
59
|
-
|
55
|
+
File.open("#{@filename}.xml", "w:UTF-8") { |f| f.write(ret) }
|
56
|
+
presentation_xml_converter(node).convert("#{@filename}.xml")
|
57
|
+
html_converter(node).convert("#{@filename}.presentation.xml", nil,
|
58
|
+
false, "#{@filename}.html")
|
59
|
+
doc_converter(node).convert("#{@filename}.presentation.xml", nil,
|
60
|
+
false, "#{@filename}.doc")
|
61
|
+
pdf_converter(node)&.convert("#{@filename}.presentation.xml", nil,
|
62
|
+
false, "#{@filename}.pdf")
|
60
63
|
end
|
61
64
|
|
62
65
|
def validate(doc)
|
@@ -65,8 +68,8 @@ module Asciidoctor
|
|
65
68
|
File.join(File.dirname(__FILE__), "mpfd.rng"))
|
66
69
|
end
|
67
70
|
|
68
|
-
def style(
|
69
|
-
|
71
|
+
def style(_n, _t)
|
72
|
+
nil
|
70
73
|
end
|
71
74
|
|
72
75
|
def presentation_xml_converter(node)
|
@@ -83,7 +86,8 @@ module Asciidoctor
|
|
83
86
|
|
84
87
|
def pdf_converter(node)
|
85
88
|
return if node.attr("no-pdf")
|
86
|
-
|
89
|
+
|
90
|
+
IsoDoc::MPFA::PdfConvert.new(pdf_extract_attributes(node))
|
87
91
|
end
|
88
92
|
end
|
89
93
|
end
|
@@ -1796,6 +1796,20 @@
|
|
1796
1796
|
<data type="ID"/>
|
1797
1797
|
</attribute>
|
1798
1798
|
</optional>
|
1799
|
+
<optional>
|
1800
|
+
<attribute name="language"/>
|
1801
|
+
</optional>
|
1802
|
+
<optional>
|
1803
|
+
<attribute name="script"/>
|
1804
|
+
</optional>
|
1805
|
+
<optional>
|
1806
|
+
<attribute name="tag"/>
|
1807
|
+
</optional>
|
1808
|
+
<optional>
|
1809
|
+
<attribute name="multilingual-rendering">
|
1810
|
+
<ref name="MultilingualRenderingType"/>
|
1811
|
+
</attribute>
|
1812
|
+
</optional>
|
1799
1813
|
<oneOrMore>
|
1800
1814
|
<ref name="preferred"/>
|
1801
1815
|
</oneOrMore>
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
8
|
<xsl:param name="basepath"/>
|
9
9
|
|
10
|
-
<xsl:key name="kfn" match="
|
10
|
+
<xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
|
11
11
|
|
12
12
|
|
13
13
|
|
@@ -287,7 +287,7 @@
|
|
287
287
|
|
288
288
|
<xsl:variable name="display">
|
289
289
|
<xsl:choose>
|
290
|
-
<xsl:when test="$level >
|
290
|
+
<xsl:when test="$level > $toc_level">false</xsl:when>
|
291
291
|
<xsl:otherwise>true</xsl:otherwise>
|
292
292
|
</xsl:choose>
|
293
293
|
</xsl:variable>
|
@@ -458,62 +458,7 @@
|
|
458
458
|
|
459
459
|
</xsl:template>
|
460
460
|
|
461
|
-
<!--
|
462
|
-
<fn reference="1">
|
463
|
-
<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
|
464
|
-
</fn>
|
465
|
-
-->
|
466
461
|
|
467
|
-
<xsl:variable name="p_fn">
|
468
|
-
<xsl:for-each select="//mpfd:p/mpfd:fn[generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
469
|
-
<!-- copy unique fn -->
|
470
|
-
<fn gen_id="{generate-id(.)}">
|
471
|
-
<xsl:copy-of select="@*"/>
|
472
|
-
<xsl:copy-of select="node()"/>
|
473
|
-
</fn>
|
474
|
-
</xsl:for-each>
|
475
|
-
</xsl:variable>
|
476
|
-
|
477
|
-
<xsl:template match="mpfd:p/mpfd:fn" priority="2">
|
478
|
-
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
479
|
-
<xsl:variable name="reference" select="@reference"/>
|
480
|
-
<xsl:variable name="number">
|
481
|
-
<xsl:value-of select="count(xalan:nodeset($p_fn)//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
482
|
-
</xsl:variable>
|
483
|
-
<xsl:choose>
|
484
|
-
<xsl:when test="xalan:nodeset($p_fn)//fn[@gen_id = $gen_id]">
|
485
|
-
<fo:footnote>
|
486
|
-
<fo:inline font-size="7pt" keep-with-previous.within-line="always" vertical-align="super">
|
487
|
-
<fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
|
488
|
-
<!-- <xsl:value-of select="@reference"/> -->
|
489
|
-
<xsl:value-of select="$number + count(//mpfd:bibitem[ancestor::mpfd:references[@id='_normative_references' or not(preceding-sibling::mpfd:references)]]/mpfd:note)"/>
|
490
|
-
</fo:basic-link>
|
491
|
-
</fo:inline>
|
492
|
-
<fo:footnote-body>
|
493
|
-
<fo:block font-size="9pt" margin-bottom="12pt">
|
494
|
-
<fo:inline font-size="6pt" id="footnote_{@reference}_{$number}" keep-with-next.within-line="always" vertical-align="super" padding-right="1mm">
|
495
|
-
<xsl:value-of select="$number + count(//mpfd:bibitem[ancestor::mpfd:references[@id='_normative_references' or not(preceding-sibling::mpfd:references)]]/mpfd:note)"/>
|
496
|
-
</fo:inline>
|
497
|
-
<xsl:for-each select="mpfd:p">
|
498
|
-
<xsl:apply-templates/>
|
499
|
-
</xsl:for-each>
|
500
|
-
</fo:block>
|
501
|
-
</fo:footnote-body>
|
502
|
-
</fo:footnote>
|
503
|
-
</xsl:when>
|
504
|
-
<xsl:otherwise>
|
505
|
-
<fo:inline font-size="7pt" keep-with-previous.within-line="always" vertical-align="super">
|
506
|
-
<fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
|
507
|
-
<xsl:value-of select="$number + count(//mpfd:bibitem/mpfd:note)"/>
|
508
|
-
</fo:basic-link>
|
509
|
-
</fo:inline>
|
510
|
-
</xsl:otherwise>
|
511
|
-
</xsl:choose>
|
512
|
-
</xsl:template>
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
462
|
|
518
463
|
<xsl:template match="mpfd:bibitem">
|
519
464
|
<fo:block id="{@id}" margin-bottom="12pt" text-indent="-11.7mm" margin-left="11.7mm"> <!-- 12 pt -->
|
@@ -1317,6 +1262,78 @@
|
|
1317
1262
|
|
1318
1263
|
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
1319
1264
|
<xsl:attribute name="line-height">135%</xsl:attribute>
|
1265
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-style">
|
1266
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1267
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-num-style">
|
1268
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1269
|
+
|
1270
|
+
|
1271
|
+
|
1272
|
+
|
1273
|
+
|
1274
|
+
|
1275
|
+
|
1276
|
+
|
1277
|
+
|
1278
|
+
|
1279
|
+
|
1280
|
+
<xsl:attribute name="font-size">7pt</xsl:attribute>
|
1281
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1282
|
+
|
1283
|
+
|
1284
|
+
|
1285
|
+
|
1286
|
+
|
1287
|
+
|
1288
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-style">
|
1289
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1290
|
+
<xsl:attribute name="font-style">normal</xsl:attribute>
|
1291
|
+
<xsl:attribute name="text-indent">0</xsl:attribute>
|
1292
|
+
<xsl:attribute name="start-indent">0</xsl:attribute>
|
1293
|
+
|
1294
|
+
|
1295
|
+
|
1296
|
+
|
1297
|
+
|
1298
|
+
|
1299
|
+
|
1300
|
+
|
1301
|
+
|
1302
|
+
|
1303
|
+
|
1304
|
+
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
1305
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1306
|
+
|
1307
|
+
|
1308
|
+
|
1309
|
+
|
1310
|
+
|
1311
|
+
|
1312
|
+
|
1313
|
+
|
1314
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
|
1315
|
+
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
1316
|
+
|
1317
|
+
|
1318
|
+
|
1319
|
+
|
1320
|
+
|
1321
|
+
|
1322
|
+
|
1323
|
+
|
1324
|
+
|
1325
|
+
|
1326
|
+
|
1327
|
+
<xsl:attribute name="font-size">6pt</xsl:attribute>
|
1328
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1329
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
1330
|
+
|
1331
|
+
|
1332
|
+
|
1333
|
+
|
1334
|
+
|
1335
|
+
|
1336
|
+
|
1320
1337
|
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
|
1321
1338
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1322
1339
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -2257,6 +2274,102 @@
|
|
2257
2274
|
|
2258
2275
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
|
2259
2276
|
<xsl:apply-templates/>
|
2277
|
+
</xsl:template><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">
|
2278
|
+
|
2279
|
+
<!-- list of footnotes to calculate actual footnotes number -->
|
2280
|
+
<xsl:variable name="p_fn_">
|
2281
|
+
<xsl:choose>
|
2282
|
+
<xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
|
2283
|
+
<fn gen_id="{generate-id(.)}">
|
2284
|
+
<xsl:copy-of select="@*"/>
|
2285
|
+
<xsl:copy-of select="node()"/>
|
2286
|
+
</fn>
|
2287
|
+
</xsl:when>
|
2288
|
+
<xsl:otherwise>
|
2289
|
+
<!-- itetation for:
|
2290
|
+
footnotes in bibdata/title
|
2291
|
+
footnotes in bibliography
|
2292
|
+
footnotes in document's body (except table's head/body/foot and figure text)
|
2293
|
+
-->
|
2294
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
2295
|
+
<fn gen_id="{generate-id(.)}">
|
2296
|
+
<xsl:copy-of select="@*"/>
|
2297
|
+
<xsl:copy-of select="node()"/>
|
2298
|
+
</fn>
|
2299
|
+
</xsl:for-each>
|
2300
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
|
2301
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2302
|
+
<xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[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])]">
|
2303
|
+
<!-- copy unique fn -->
|
2304
|
+
<fn gen_id="{generate-id(.)}">
|
2305
|
+
<xsl:copy-of select="@*"/>
|
2306
|
+
<xsl:copy-of select="node()"/>
|
2307
|
+
</fn>
|
2308
|
+
</xsl:for-each>
|
2309
|
+
</xsl:for-each>
|
2310
|
+
</xsl:otherwise>
|
2311
|
+
</xsl:choose>
|
2312
|
+
</xsl:variable>
|
2313
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
2314
|
+
|
2315
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
2316
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
2317
|
+
<xsl:variable name="reference" select="@reference"/>
|
2318
|
+
<!-- fn sequence number in document -->
|
2319
|
+
<xsl:variable name="current_fn_number">
|
2320
|
+
<xsl:choose>
|
2321
|
+
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
2322
|
+
<xsl:otherwise>
|
2323
|
+
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
2324
|
+
</xsl:otherwise>
|
2325
|
+
</xsl:choose>
|
2326
|
+
</xsl:variable>
|
2327
|
+
<xsl:variable name="current_fn_number_text">
|
2328
|
+
<xsl:value-of select="$current_fn_number"/>
|
2329
|
+
|
2330
|
+
|
2331
|
+
</xsl:variable>
|
2332
|
+
|
2333
|
+
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
2334
|
+
<xsl:variable name="footnote_inline">
|
2335
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
2336
|
+
|
2337
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
2338
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2339
|
+
</fo:basic-link>
|
2340
|
+
</fo:inline>
|
2341
|
+
</xsl:variable>
|
2342
|
+
<!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
|
2343
|
+
gen_id=<xsl:value-of select="$gen_id"/> -->
|
2344
|
+
<xsl:choose>
|
2345
|
+
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
2346
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2347
|
+
</xsl:when>
|
2348
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
2349
|
+
<fo:footnote xsl:use-attribute-sets="fn-style">
|
2350
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2351
|
+
<fo:footnote-body>
|
2352
|
+
|
2353
|
+
<fo:block-container text-indent="0" start-indent="0">
|
2354
|
+
|
2355
|
+
|
2356
|
+
<fo:block xsl:use-attribute-sets="fn-body-style">
|
2357
|
+
|
2358
|
+
|
2359
|
+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
|
2360
|
+
|
2361
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2362
|
+
</fo:inline>
|
2363
|
+
<xsl:apply-templates/>
|
2364
|
+
</fo:block>
|
2365
|
+
</fo:block-container>
|
2366
|
+
</fo:footnote-body>
|
2367
|
+
</fo:footnote>
|
2368
|
+
</xsl:when>
|
2369
|
+
<xsl:otherwise>
|
2370
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2371
|
+
</xsl:otherwise>
|
2372
|
+
</xsl:choose>
|
2260
2373
|
</xsl:template><xsl:template name="fn_display">
|
2261
2374
|
<xsl:variable name="references">
|
2262
2375
|
|
@@ -2447,6 +2560,8 @@
|
|
2447
2560
|
|
2448
2561
|
</fo:basic-link>
|
2449
2562
|
</fo:inline>
|
2563
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
2564
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
2450
2565
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
2451
2566
|
<fo:inline>
|
2452
2567
|
<xsl:apply-templates/>
|
@@ -3437,22 +3552,6 @@
|
|
3437
3552
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
3438
3553
|
<xsl:apply-templates/>
|
3439
3554
|
</fo:inline>
|
3440
|
-
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3441
|
-
<xsl:variable name="title-modified">
|
3442
|
-
|
3443
|
-
|
3444
|
-
<xsl:call-template name="getTitle">
|
3445
|
-
<xsl:with-param name="name" select="'title-modified'"/>
|
3446
|
-
</xsl:call-template>
|
3447
|
-
|
3448
|
-
</xsl:variable>
|
3449
|
-
|
3450
|
-
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3451
|
-
<xsl:choose>
|
3452
|
-
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
|
3453
|
-
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
|
3454
|
-
</xsl:choose>
|
3455
|
-
<xsl:apply-templates/>
|
3456
3555
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
3457
3556
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
3458
3557
|
|
@@ -4684,58 +4783,69 @@
|
|
4684
4783
|
<xsl:variable name="termsource_text">
|
4685
4784
|
<xsl:apply-templates/>
|
4686
4785
|
</xsl:variable>
|
4687
|
-
|
4688
|
-
<xsl:choose>
|
4786
|
+
<xsl:copy-of select="$termsource_text"/>
|
4787
|
+
<!-- <xsl:choose>
|
4689
4788
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
4690
|
-
<!-- <xsl:apply-templates /> -->
|
4691
4789
|
<xsl:copy-of select="$termsource_text"/>
|
4692
4790
|
</xsl:when>
|
4693
4791
|
<xsl:otherwise>
|
4694
|
-
|
4695
|
-
|
4696
|
-
|
4792
|
+
<xsl:if test="$namespace = 'bsi'">
|
4793
|
+
<xsl:choose>
|
4794
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
|
4795
|
+
<xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
|
4796
|
+
</xsl:choose>
|
4797
|
+
</xsl:if>
|
4798
|
+
<xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
|
4799
|
+
<xsl:text>[</xsl:text>
|
4800
|
+
</xsl:if>
|
4697
4801
|
<xsl:copy-of select="$termsource_text"/>
|
4698
|
-
|
4699
|
-
|
4802
|
+
<xsl:if test="$namespace = 'bsi'">
|
4803
|
+
<xsl:choose>
|
4804
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
|
4805
|
+
<xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
|
4806
|
+
</xsl:choose>
|
4807
|
+
</xsl:if>
|
4808
|
+
<xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
|
4809
|
+
<xsl:text>]</xsl:text>
|
4810
|
+
</xsl:if>
|
4700
4811
|
</xsl:otherwise>
|
4701
|
-
</xsl:choose>
|
4812
|
+
</xsl:choose> -->
|
4702
4813
|
</fo:block>
|
4703
4814
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
4704
4815
|
<xsl:if test="normalize-space() != ''">
|
4705
4816
|
<xsl:value-of select="."/>
|
4706
4817
|
</xsl:if>
|
4707
|
-
</xsl:template><xsl:
|
4708
|
-
<
|
4709
|
-
|
4710
|
-
|
4711
|
-
|
4818
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
|
4819
|
+
<fo:inline>
|
4820
|
+
|
4821
|
+
|
4822
|
+
<xsl:value-of select="."/>
|
4823
|
+
</fo:inline>
|
4824
|
+
</xsl:template><xsl:template match="*[local-name() = 'origin']">
|
4712
4825
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4713
4826
|
<xsl:if test="normalize-space(@citeas) = ''">
|
4714
4827
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4715
4828
|
</xsl:if>
|
4716
|
-
|
4717
|
-
|
4718
|
-
<fo:inline>
|
4719
|
-
|
4720
|
-
|
4721
|
-
|
4722
|
-
|
4723
|
-
|
4724
|
-
|
4725
|
-
|
4726
|
-
<xsl:call-template name="getTitle">
|
4727
|
-
<xsl:with-param name="name" select="'title-source'"/>
|
4728
|
-
</xsl:call-template>
|
4729
|
-
<xsl:text>: </xsl:text>
|
4730
|
-
|
4731
|
-
|
4732
|
-
</fo:inline>
|
4733
|
-
|
4734
4829
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
4735
4830
|
<xsl:apply-templates/>
|
4736
4831
|
</fo:inline>
|
4832
|
+
</fo:basic-link>
|
4833
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
4834
|
+
<xsl:variable name="title-modified">
|
4737
4835
|
|
4738
|
-
|
4836
|
+
|
4837
|
+
<xsl:call-template name="getTitle">
|
4838
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
4839
|
+
</xsl:call-template>
|
4840
|
+
|
4841
|
+
</xsl:variable>
|
4842
|
+
|
4843
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
4844
|
+
<xsl:choose>
|
4845
|
+
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
|
4846
|
+
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
|
4847
|
+
</xsl:choose>
|
4848
|
+
<xsl:apply-templates/>
|
4739
4849
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
4740
4850
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
4741
4851
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
|
@@ -5331,7 +5441,31 @@
|
|
5331
5441
|
<fo:block-container border="1pt solid black" width="50%">
|
5332
5442
|
<fo:block> </fo:block>
|
5333
5443
|
</fo:block-container>
|
5334
|
-
</xsl:template><xsl:
|
5444
|
+
</xsl:template><xsl:variable name="toc_level">
|
5445
|
+
<xsl:choose>
|
5446
|
+
<xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
|
5447
|
+
<xsl:otherwise><!-- default value -->
|
5448
|
+
|
5449
|
+
|
5450
|
+
|
5451
|
+
|
5452
|
+
|
5453
|
+
|
5454
|
+
|
5455
|
+
|
5456
|
+
|
5457
|
+
|
5458
|
+
2
|
5459
|
+
|
5460
|
+
|
5461
|
+
|
5462
|
+
|
5463
|
+
|
5464
|
+
|
5465
|
+
|
5466
|
+
</xsl:otherwise>
|
5467
|
+
</xsl:choose>
|
5468
|
+
</xsl:variable><xsl:template match="*[local-name() = 'toc']">
|
5335
5469
|
<xsl:param name="colwidths"/>
|
5336
5470
|
<xsl:variable name="colwidths_">
|
5337
5471
|
<xsl:choose>
|
@@ -5964,4 +6098,14 @@
|
|
5964
6098
|
</xsl:otherwise>
|
5965
6099
|
</xsl:choose>
|
5966
6100
|
</xsl:if>
|
6101
|
+
</xsl:template><xsl:template name="setAltText">
|
6102
|
+
<xsl:param name="value"/>
|
6103
|
+
<xsl:attribute name="fox:alt-text">
|
6104
|
+
<xsl:choose>
|
6105
|
+
<xsl:when test="normalize-space($value) != ''">
|
6106
|
+
<xsl:value-of select="$value"/>
|
6107
|
+
</xsl:when>
|
6108
|
+
<xsl:otherwise>_</xsl:otherwise>
|
6109
|
+
</xsl:choose>
|
6110
|
+
</xsl:attribute>
|
5967
6111
|
</xsl:template></xsl:stylesheet>
|