metanorma-mpfa 0.7.1 → 0.7.5
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/asciidoctor/mpfa/converter.rb +17 -13
- data/lib/asciidoctor/mpfa/isodoc.rng +61 -18
- data/lib/isodoc/mpfa/html/htmlstyle.css +30 -19
- data/lib/isodoc/mpfa/html/htmlstyle.scss +21 -18
- data/lib/isodoc/mpfa/html/rsd.css +0 -1
- data/lib/isodoc/mpfa/html/rsd.scss +0 -1
- data/lib/isodoc/mpfa/html/scripts.html +0 -1
- data/lib/isodoc/mpfa/html/wordstyle.css +30 -18
- data/lib/isodoc/mpfa/html/wordstyle.scss +30 -18
- data/lib/isodoc/mpfa/mpfa.circular.xsl +329 -122
- data/lib/isodoc/mpfa/mpfa.compliance-standards-for-mpf-trustees.xsl +329 -122
- data/lib/isodoc/mpfa/mpfa.guidelines.xsl +329 -122
- data/lib/isodoc/mpfa/mpfa.standards.xsl +329 -122
- data/lib/isodoc/mpfa/mpfa.supervision-of-mpf-intermediaries.xsl +329 -122
- data/lib/metanorma/mpfa/version.rb +1 -1
- data/metanorma-mpfd.gemspec +1 -1
- metadata +8 -8
@@ -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>
|
@@ -332,7 +332,9 @@
|
|
332
332
|
|
333
333
|
<xsl:template name="getListItemFormat">
|
334
334
|
<xsl:choose>
|
335
|
-
<xsl:when test="local-name(..) = 'ul'"
|
335
|
+
<xsl:when test="local-name(..) = 'ul'">
|
336
|
+
<xsl:call-template name="setULLabel"/>
|
337
|
+
</xsl:when>
|
336
338
|
<xsl:otherwise> <!-- for ordered lists -->
|
337
339
|
<xsl:choose>
|
338
340
|
<xsl:when test="../@type = 'arabic'">
|
@@ -357,7 +359,7 @@
|
|
357
359
|
|
358
360
|
|
359
361
|
|
360
|
-
<xsl:template match="mpfd:title">
|
362
|
+
<xsl:template match="mpfd:title" name="title">
|
361
363
|
|
362
364
|
<xsl:variable name="level">
|
363
365
|
<xsl:call-template name="getLevel"/>
|
@@ -458,62 +460,7 @@
|
|
458
460
|
|
459
461
|
</xsl:template>
|
460
462
|
|
461
|
-
<!--
|
462
|
-
<fn reference="1">
|
463
|
-
<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
|
464
|
-
</fn>
|
465
|
-
-->
|
466
463
|
|
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
464
|
|
518
465
|
<xsl:template match="mpfd:bibitem">
|
519
466
|
<fo:block id="{@id}" margin-bottom="12pt" text-indent="-11.7mm" margin-left="11.7mm"> <!-- 12 pt -->
|
@@ -593,11 +540,6 @@
|
|
593
540
|
<fo:list-item id="{@id}">
|
594
541
|
<fo:list-item-label end-indent="label-end()">
|
595
542
|
<fo:block>
|
596
|
-
<!-- to vertical align big dot -->
|
597
|
-
<!-- <xsl:if test="local-name(..) = 'ul'">
|
598
|
-
<xsl:attribute name="font-size">18pt</xsl:attribute>
|
599
|
-
<xsl:attribute name="margin-top">-0.5mm</xsl:attribute>
|
600
|
-
</xsl:if> -->
|
601
543
|
<xsl:call-template name="getListItemFormat"/>
|
602
544
|
</fo:block>
|
603
545
|
</fo:list-item-label>
|
@@ -615,6 +557,7 @@
|
|
615
557
|
|
616
558
|
<xsl:template match="mpfd:preferred">
|
617
559
|
<fo:inline font-weight="bold">
|
560
|
+
<xsl:call-template name="setStyle_preferred"/>
|
618
561
|
<xsl:apply-templates/>
|
619
562
|
</fo:inline>
|
620
563
|
<xsl:if test="not(following-sibling::*[1][local-name() = 'preferred'])">
|
@@ -1316,6 +1259,78 @@
|
|
1316
1259
|
|
1317
1260
|
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
1318
1261
|
<xsl:attribute name="line-height">135%</xsl:attribute>
|
1262
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-style">
|
1263
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1264
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-num-style">
|
1265
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1266
|
+
|
1267
|
+
|
1268
|
+
|
1269
|
+
|
1270
|
+
|
1271
|
+
|
1272
|
+
|
1273
|
+
|
1274
|
+
|
1275
|
+
|
1276
|
+
|
1277
|
+
<xsl:attribute name="font-size">7pt</xsl:attribute>
|
1278
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1279
|
+
|
1280
|
+
|
1281
|
+
|
1282
|
+
|
1283
|
+
|
1284
|
+
|
1285
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-style">
|
1286
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1287
|
+
<xsl:attribute name="font-style">normal</xsl:attribute>
|
1288
|
+
<xsl:attribute name="text-indent">0</xsl:attribute>
|
1289
|
+
<xsl:attribute name="start-indent">0</xsl:attribute>
|
1290
|
+
|
1291
|
+
|
1292
|
+
|
1293
|
+
|
1294
|
+
|
1295
|
+
|
1296
|
+
|
1297
|
+
|
1298
|
+
|
1299
|
+
|
1300
|
+
|
1301
|
+
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
1302
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1303
|
+
|
1304
|
+
|
1305
|
+
|
1306
|
+
|
1307
|
+
|
1308
|
+
|
1309
|
+
|
1310
|
+
|
1311
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
|
1312
|
+
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
1313
|
+
|
1314
|
+
|
1315
|
+
|
1316
|
+
|
1317
|
+
|
1318
|
+
|
1319
|
+
|
1320
|
+
|
1321
|
+
|
1322
|
+
|
1323
|
+
|
1324
|
+
<xsl:attribute name="font-size">6pt</xsl:attribute>
|
1325
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1326
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
1327
|
+
|
1328
|
+
|
1329
|
+
|
1330
|
+
|
1331
|
+
|
1332
|
+
|
1333
|
+
|
1319
1334
|
</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">
|
1320
1335
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1321
1336
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1341,7 +1356,8 @@
|
|
1341
1356
|
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
1342
1357
|
|
1343
1358
|
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
1344
|
-
|
1359
|
+
|
1360
|
+
<xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
|
1345
1361
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1346
1362
|
<xsl:apply-templates select="." mode="contents"/>
|
1347
1363
|
</xsl:for-each>
|
@@ -1351,7 +1367,7 @@
|
|
1351
1367
|
<xsl:apply-templates select="." mode="contents"/>
|
1352
1368
|
</xsl:for-each>
|
1353
1369
|
|
1354
|
-
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1370
|
+
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1355
1371
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1356
1372
|
<xsl:apply-templates select="." mode="contents"/>
|
1357
1373
|
</xsl:for-each>
|
@@ -2255,6 +2271,102 @@
|
|
2255
2271
|
|
2256
2272
|
</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">
|
2257
2273
|
<xsl:apply-templates/>
|
2274
|
+
</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">
|
2275
|
+
|
2276
|
+
<!-- list of footnotes to calculate actual footnotes number -->
|
2277
|
+
<xsl:variable name="p_fn_">
|
2278
|
+
<xsl:choose>
|
2279
|
+
<xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
|
2280
|
+
<fn gen_id="{generate-id(.)}">
|
2281
|
+
<xsl:copy-of select="@*"/>
|
2282
|
+
<xsl:copy-of select="node()"/>
|
2283
|
+
</fn>
|
2284
|
+
</xsl:when>
|
2285
|
+
<xsl:otherwise>
|
2286
|
+
<!-- itetation for:
|
2287
|
+
footnotes in bibdata/title
|
2288
|
+
footnotes in bibliography
|
2289
|
+
footnotes in document's body (except table's head/body/foot and figure text)
|
2290
|
+
-->
|
2291
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
2292
|
+
<fn gen_id="{generate-id(.)}">
|
2293
|
+
<xsl:copy-of select="@*"/>
|
2294
|
+
<xsl:copy-of select="node()"/>
|
2295
|
+
</fn>
|
2296
|
+
</xsl:for-each>
|
2297
|
+
<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']/*">
|
2298
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2299
|
+
<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])]">
|
2300
|
+
<!-- copy unique fn -->
|
2301
|
+
<fn gen_id="{generate-id(.)}">
|
2302
|
+
<xsl:copy-of select="@*"/>
|
2303
|
+
<xsl:copy-of select="node()"/>
|
2304
|
+
</fn>
|
2305
|
+
</xsl:for-each>
|
2306
|
+
</xsl:for-each>
|
2307
|
+
</xsl:otherwise>
|
2308
|
+
</xsl:choose>
|
2309
|
+
</xsl:variable>
|
2310
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
2311
|
+
|
2312
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
2313
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
2314
|
+
<xsl:variable name="reference" select="@reference"/>
|
2315
|
+
<!-- fn sequence number in document -->
|
2316
|
+
<xsl:variable name="current_fn_number">
|
2317
|
+
<xsl:choose>
|
2318
|
+
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
2319
|
+
<xsl:otherwise>
|
2320
|
+
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
2321
|
+
</xsl:otherwise>
|
2322
|
+
</xsl:choose>
|
2323
|
+
</xsl:variable>
|
2324
|
+
<xsl:variable name="current_fn_number_text">
|
2325
|
+
<xsl:value-of select="$current_fn_number"/>
|
2326
|
+
|
2327
|
+
|
2328
|
+
</xsl:variable>
|
2329
|
+
|
2330
|
+
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
2331
|
+
<xsl:variable name="footnote_inline">
|
2332
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
2333
|
+
|
2334
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
2335
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2336
|
+
</fo:basic-link>
|
2337
|
+
</fo:inline>
|
2338
|
+
</xsl:variable>
|
2339
|
+
<!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
|
2340
|
+
gen_id=<xsl:value-of select="$gen_id"/> -->
|
2341
|
+
<xsl:choose>
|
2342
|
+
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
2343
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2344
|
+
</xsl:when>
|
2345
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
2346
|
+
<fo:footnote xsl:use-attribute-sets="fn-style">
|
2347
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2348
|
+
<fo:footnote-body>
|
2349
|
+
|
2350
|
+
<fo:block-container text-indent="0" start-indent="0">
|
2351
|
+
|
2352
|
+
|
2353
|
+
<fo:block xsl:use-attribute-sets="fn-body-style">
|
2354
|
+
|
2355
|
+
|
2356
|
+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
|
2357
|
+
|
2358
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2359
|
+
</fo:inline>
|
2360
|
+
<xsl:apply-templates/>
|
2361
|
+
</fo:block>
|
2362
|
+
</fo:block-container>
|
2363
|
+
</fo:footnote-body>
|
2364
|
+
</fo:footnote>
|
2365
|
+
</xsl:when>
|
2366
|
+
<xsl:otherwise>
|
2367
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2368
|
+
</xsl:otherwise>
|
2369
|
+
</xsl:choose>
|
2258
2370
|
</xsl:template><xsl:template name="fn_display">
|
2259
2371
|
<xsl:variable name="references">
|
2260
2372
|
|
@@ -2445,6 +2557,8 @@
|
|
2445
2557
|
|
2446
2558
|
</fo:basic-link>
|
2447
2559
|
</fo:inline>
|
2560
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
2561
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
2448
2562
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
2449
2563
|
<fo:inline>
|
2450
2564
|
<xsl:apply-templates/>
|
@@ -2802,6 +2916,7 @@
|
|
2802
2916
|
</xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
|
2803
2917
|
<xsl:apply-templates/>
|
2804
2918
|
</xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
|
2919
|
+
<xsl:apply-templates select="@language"/>
|
2805
2920
|
<xsl:apply-templates/>
|
2806
2921
|
</xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
|
2807
2922
|
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
@@ -3435,22 +3550,6 @@
|
|
3435
3550
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
3436
3551
|
<xsl:apply-templates/>
|
3437
3552
|
</fo:inline>
|
3438
|
-
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3439
|
-
<xsl:variable name="title-modified">
|
3440
|
-
|
3441
|
-
|
3442
|
-
<xsl:call-template name="getTitle">
|
3443
|
-
<xsl:with-param name="name" select="'title-modified'"/>
|
3444
|
-
</xsl:call-template>
|
3445
|
-
|
3446
|
-
</xsl:variable>
|
3447
|
-
|
3448
|
-
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3449
|
-
<xsl:choose>
|
3450
|
-
<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>
|
3451
|
-
<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>
|
3452
|
-
</xsl:choose>
|
3453
|
-
<xsl:apply-templates/>
|
3454
3553
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
3455
3554
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
3456
3555
|
|
@@ -4015,12 +4114,12 @@
|
|
4015
4114
|
</xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
4016
4115
|
<xsl:apply-templates mode="contents"/>
|
4017
4116
|
<xsl:text> </xsl:text>
|
4018
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
|
4117
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
|
4019
4118
|
<xsl:apply-templates mode="bookmarks"/>
|
4020
4119
|
<xsl:text> </xsl:text>
|
4021
4120
|
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
|
4022
4121
|
<xsl:value-of select="."/>
|
4023
|
-
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
4122
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
|
4024
4123
|
<xsl:value-of select="."/>
|
4025
4124
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4026
4125
|
<xsl:apply-templates mode="contents"/>
|
@@ -4290,6 +4389,8 @@
|
|
4290
4389
|
|
4291
4390
|
|
4292
4391
|
|
4392
|
+
|
4393
|
+
|
4293
4394
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4294
4395
|
<xsl:variable name="_font-size">
|
4295
4396
|
|
@@ -4323,13 +4424,17 @@
|
|
4323
4424
|
|
4324
4425
|
|
4325
4426
|
|
4427
|
+
|
4428
|
+
|
4326
4429
|
<xsl:apply-templates/>
|
4327
4430
|
</fo:block>
|
4328
|
-
|
4431
|
+
|
4329
4432
|
|
4330
4433
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4331
4434
|
|
4332
4435
|
|
4436
|
+
|
4437
|
+
|
4333
4438
|
</fo:block-container>
|
4334
4439
|
</fo:block-container>
|
4335
4440
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -4676,58 +4781,69 @@
|
|
4676
4781
|
<xsl:variable name="termsource_text">
|
4677
4782
|
<xsl:apply-templates/>
|
4678
4783
|
</xsl:variable>
|
4679
|
-
|
4680
|
-
<xsl:choose>
|
4784
|
+
<xsl:copy-of select="$termsource_text"/>
|
4785
|
+
<!-- <xsl:choose>
|
4681
4786
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
4682
|
-
<!-- <xsl:apply-templates /> -->
|
4683
4787
|
<xsl:copy-of select="$termsource_text"/>
|
4684
4788
|
</xsl:when>
|
4685
4789
|
<xsl:otherwise>
|
4686
|
-
|
4687
|
-
|
4688
|
-
|
4790
|
+
<xsl:if test="$namespace = 'bsi'">
|
4791
|
+
<xsl:choose>
|
4792
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
|
4793
|
+
<xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
|
4794
|
+
</xsl:choose>
|
4795
|
+
</xsl:if>
|
4796
|
+
<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'">
|
4797
|
+
<xsl:text>[</xsl:text>
|
4798
|
+
</xsl:if>
|
4689
4799
|
<xsl:copy-of select="$termsource_text"/>
|
4690
|
-
|
4691
|
-
|
4800
|
+
<xsl:if test="$namespace = 'bsi'">
|
4801
|
+
<xsl:choose>
|
4802
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
|
4803
|
+
<xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
|
4804
|
+
</xsl:choose>
|
4805
|
+
</xsl:if>
|
4806
|
+
<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'">
|
4807
|
+
<xsl:text>]</xsl:text>
|
4808
|
+
</xsl:if>
|
4692
4809
|
</xsl:otherwise>
|
4693
|
-
</xsl:choose>
|
4810
|
+
</xsl:choose> -->
|
4694
4811
|
</fo:block>
|
4695
4812
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
4696
4813
|
<xsl:if test="normalize-space() != ''">
|
4697
4814
|
<xsl:value-of select="."/>
|
4698
4815
|
</xsl:if>
|
4699
|
-
</xsl:template><xsl:
|
4700
|
-
<
|
4701
|
-
|
4702
|
-
|
4703
|
-
|
4816
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
|
4817
|
+
<fo:inline>
|
4818
|
+
|
4819
|
+
|
4820
|
+
<xsl:value-of select="."/>
|
4821
|
+
</fo:inline>
|
4822
|
+
</xsl:template><xsl:template match="*[local-name() = 'origin']">
|
4704
4823
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4705
4824
|
<xsl:if test="normalize-space(@citeas) = ''">
|
4706
4825
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4707
4826
|
</xsl:if>
|
4708
|
-
|
4709
|
-
|
4710
|
-
<fo:inline>
|
4711
|
-
|
4712
|
-
|
4713
|
-
|
4714
|
-
|
4715
|
-
|
4716
|
-
|
4717
|
-
|
4718
|
-
<xsl:call-template name="getTitle">
|
4719
|
-
<xsl:with-param name="name" select="'title-source'"/>
|
4720
|
-
</xsl:call-template>
|
4721
|
-
<xsl:text>: </xsl:text>
|
4722
|
-
|
4723
|
-
|
4724
|
-
</fo:inline>
|
4725
|
-
|
4726
4827
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
4727
4828
|
<xsl:apply-templates/>
|
4728
4829
|
</fo:inline>
|
4830
|
+
</fo:basic-link>
|
4831
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
4832
|
+
<xsl:variable name="title-modified">
|
4729
4833
|
|
4730
|
-
|
4834
|
+
|
4835
|
+
<xsl:call-template name="getTitle">
|
4836
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
4837
|
+
</xsl:call-template>
|
4838
|
+
|
4839
|
+
</xsl:variable>
|
4840
|
+
|
4841
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
4842
|
+
<xsl:choose>
|
4843
|
+
<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>
|
4844
|
+
<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>
|
4845
|
+
</xsl:choose>
|
4846
|
+
<xsl:apply-templates/>
|
4731
4847
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
4732
4848
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
4733
4849
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
|
@@ -4916,15 +5032,20 @@
|
|
4916
5032
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
4917
5033
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
4918
5034
|
</fo:block>
|
5035
|
+
</xsl:template><xsl:template name="setStyle_preferred">
|
5036
|
+
<xsl:if test="*[local-name() = 'strong']">
|
5037
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
5038
|
+
</xsl:if>
|
4919
5039
|
</xsl:template><xsl:template match="*[local-name() = 'definition']">
|
4920
5040
|
<fo:block xsl:use-attribute-sets="definition-style">
|
4921
5041
|
<xsl:apply-templates/>
|
4922
5042
|
</fo:block>
|
4923
5043
|
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
|
4924
5044
|
<xsl:apply-templates/>
|
4925
|
-
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
|
5045
|
+
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
|
4926
5046
|
<fo:inline> <xsl:apply-templates/></fo:inline>
|
4927
|
-
<fo:block
|
5047
|
+
<!-- <fo:block> </fo:block> -->
|
5048
|
+
<fo:block/>
|
4928
5049
|
</xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
|
4929
5050
|
|
4930
5051
|
<fo:block>
|
@@ -4980,6 +5101,51 @@
|
|
4980
5101
|
</xsl:template><xsl:template match="*[local-name() = 'name']/text()">
|
4981
5102
|
<!-- 0xA0 to space replacement -->
|
4982
5103
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
5104
|
+
</xsl:template><xsl:variable name="ul_labels_">
|
5105
|
+
|
5106
|
+
|
5107
|
+
|
5108
|
+
|
5109
|
+
|
5110
|
+
|
5111
|
+
|
5112
|
+
|
5113
|
+
|
5114
|
+
|
5115
|
+
<label>—</label> <!-- em dash -->
|
5116
|
+
|
5117
|
+
|
5118
|
+
|
5119
|
+
|
5120
|
+
|
5121
|
+
|
5122
|
+
|
5123
|
+
|
5124
|
+
</xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
|
5125
|
+
<xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
|
5126
|
+
<xsl:variable name="list_level">
|
5127
|
+
<xsl:choose>
|
5128
|
+
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
5129
|
+
<xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
|
5130
|
+
</xsl:choose>
|
5131
|
+
</xsl:variable>
|
5132
|
+
<xsl:choose>
|
5133
|
+
<xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
|
5134
|
+
<xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
|
5135
|
+
</xsl:when>
|
5136
|
+
<xsl:when test="$list_level mod 3 = 0">
|
5137
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
|
5138
|
+
</xsl:when>
|
5139
|
+
<xsl:when test="$list_level mod 2 = 0">
|
5140
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
|
5141
|
+
</xsl:when>
|
5142
|
+
<xsl:otherwise>
|
5143
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
|
5144
|
+
</xsl:otherwise>
|
5145
|
+
</xsl:choose>
|
5146
|
+
</xsl:template><xsl:template match="label" mode="ul_labels">
|
5147
|
+
<xsl:copy-of select="@*[not(local-name() = 'level')]"/>
|
5148
|
+
<xsl:value-of select="."/>
|
4983
5149
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
4984
5150
|
<xsl:choose>
|
4985
5151
|
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
@@ -5318,7 +5484,31 @@
|
|
5318
5484
|
<fo:block-container border="1pt solid black" width="50%">
|
5319
5485
|
<fo:block> </fo:block>
|
5320
5486
|
</fo:block-container>
|
5321
|
-
</xsl:template><xsl:
|
5487
|
+
</xsl:template><xsl:variable name="toc_level">
|
5488
|
+
<xsl:choose>
|
5489
|
+
<xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
|
5490
|
+
<xsl:otherwise><!-- default value -->
|
5491
|
+
|
5492
|
+
|
5493
|
+
|
5494
|
+
|
5495
|
+
|
5496
|
+
|
5497
|
+
|
5498
|
+
|
5499
|
+
|
5500
|
+
|
5501
|
+
2
|
5502
|
+
|
5503
|
+
|
5504
|
+
|
5505
|
+
|
5506
|
+
|
5507
|
+
|
5508
|
+
|
5509
|
+
</xsl:otherwise>
|
5510
|
+
</xsl:choose>
|
5511
|
+
</xsl:variable><xsl:template match="*[local-name() = 'toc']">
|
5322
5512
|
<xsl:param name="colwidths"/>
|
5323
5513
|
<xsl:variable name="colwidths_">
|
5324
5514
|
<xsl:choose>
|
@@ -5409,6 +5599,10 @@
|
|
5409
5599
|
</svg>
|
5410
5600
|
</fo:instream-foreign-object>
|
5411
5601
|
</fo:inline>
|
5602
|
+
</xsl:template><xsl:template match="@language">
|
5603
|
+
<xsl:copy-of select="."/>
|
5604
|
+
</xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
|
5605
|
+
<xsl:call-template name="title"/>
|
5412
5606
|
</xsl:template><xsl:template name="convertDate">
|
5413
5607
|
<xsl:param name="date"/>
|
5414
5608
|
<xsl:param name="format" select="'short'"/>
|
@@ -5846,12 +6040,15 @@
|
|
5846
6040
|
<xsl:param name="default">left</xsl:param>
|
5847
6041
|
<xsl:attribute name="text-align">
|
5848
6042
|
<xsl:choose>
|
5849
|
-
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6043
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
5850
6044
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
5851
6045
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
5852
6046
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
5853
6047
|
</xsl:choose>
|
5854
6048
|
</xsl:attribute>
|
6049
|
+
<xsl:if test="@align = 'indent'">
|
6050
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
6051
|
+
</xsl:if>
|
5855
6052
|
</xsl:template><xsl:template name="number-to-words">
|
5856
6053
|
<xsl:param name="number"/>
|
5857
6054
|
<xsl:param name="first"/>
|
@@ -5948,4 +6145,14 @@
|
|
5948
6145
|
</xsl:otherwise>
|
5949
6146
|
</xsl:choose>
|
5950
6147
|
</xsl:if>
|
6148
|
+
</xsl:template><xsl:template name="setAltText">
|
6149
|
+
<xsl:param name="value"/>
|
6150
|
+
<xsl:attribute name="fox:alt-text">
|
6151
|
+
<xsl:choose>
|
6152
|
+
<xsl:when test="normalize-space($value) != ''">
|
6153
|
+
<xsl:value-of select="$value"/>
|
6154
|
+
</xsl:when>
|
6155
|
+
<xsl:otherwise>_</xsl:otherwise>
|
6156
|
+
</xsl:choose>
|
6157
|
+
</xsl:attribute>
|
5951
6158
|
</xsl:template></xsl:stylesheet>
|