metanorma-m3aawg 1.8.1 → 1.8.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciidoctor/m3aawg/converter.rb +15 -11
- data/lib/asciidoctor/m3aawg/isodoc.rng +61 -18
- data/lib/isodoc/m3aawg/html/htmlstyle.css +20 -9
- data/lib/isodoc/m3aawg/html/htmlstyle.scss +11 -8
- data/lib/isodoc/m3aawg/html/m3d.css +0 -1
- data/lib/isodoc/m3aawg/html/m3d.scss +0 -1
- data/lib/isodoc/m3aawg/html/scripts.html +0 -1
- data/lib/isodoc/m3aawg/html/wordstyle.css +30 -18
- data/lib/isodoc/m3aawg/html/wordstyle.scss +30 -18
- data/lib/isodoc/m3aawg/m3aawg.policy.xsl +330 -108
- data/lib/isodoc/m3aawg/m3aawg.report.xsl +330 -108
- data/lib/metanorma/m3aawg/version.rb +1 -1
- data/metanorma-m3d.gemspec +1 -1
- metadata +8 -8
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
|
12
|
-
<xsl:key name="kfn" match="
|
12
|
+
<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"/>
|
13
13
|
|
14
14
|
|
15
15
|
|
@@ -363,7 +363,7 @@
|
|
363
363
|
<xsl:choose>
|
364
364
|
<xsl:when test="ancestor-or-self::m3d:preface and $level >= 2">false</xsl:when>
|
365
365
|
<xsl:when test="ancestor::m3d:annex and $level >= 3">false</xsl:when>
|
366
|
-
<xsl:when test="$level <=
|
366
|
+
<xsl:when test="$level <= $toc_level">true</xsl:when>
|
367
367
|
<xsl:otherwise>false</xsl:otherwise>
|
368
368
|
</xsl:choose>
|
369
369
|
</xsl:variable>
|
@@ -403,7 +403,9 @@
|
|
403
403
|
|
404
404
|
<xsl:template name="getListItemFormat">
|
405
405
|
<xsl:choose>
|
406
|
-
<xsl:when test="local-name(..) = 'ul'"
|
406
|
+
<xsl:when test="local-name(..) = 'ul'">
|
407
|
+
<xsl:call-template name="setULLabel"/>
|
408
|
+
</xsl:when>
|
407
409
|
<xsl:otherwise> <!-- for ordered lists -->
|
408
410
|
<xsl:choose>
|
409
411
|
<xsl:when test="../@type = 'arabic'">
|
@@ -473,7 +475,7 @@
|
|
473
475
|
</xsl:template>
|
474
476
|
|
475
477
|
|
476
|
-
<xsl:template match="m3d:title">
|
478
|
+
<xsl:template match="m3d:title" name="title">
|
477
479
|
|
478
480
|
<xsl:variable name="level">
|
479
481
|
<xsl:call-template name="getLevel"/>
|
@@ -586,65 +588,11 @@
|
|
586
588
|
|
587
589
|
</xsl:template>
|
588
590
|
|
589
|
-
<!--
|
590
|
-
<fn reference="1">
|
591
|
-
<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
|
592
|
-
</fn>
|
593
|
-
-->
|
594
|
-
|
595
|
-
<xsl:variable name="p_fn">
|
596
|
-
<xsl:for-each select="//m3d:p/m3d:fn[generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
597
|
-
<!-- copy unique fn -->
|
598
|
-
<fn gen_id="{generate-id(.)}">
|
599
|
-
<xsl:copy-of select="@*"/>
|
600
|
-
<xsl:copy-of select="node()"/>
|
601
|
-
</fn>
|
602
|
-
</xsl:for-each>
|
603
|
-
</xsl:variable>
|
604
|
-
|
605
|
-
<xsl:template match="m3d:p/m3d:fn" priority="2">
|
606
|
-
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
607
|
-
<xsl:variable name="reference" select="@reference"/>
|
608
|
-
<xsl:variable name="number">
|
609
|
-
<xsl:value-of select="count(xalan:nodeset($p_fn)//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
610
|
-
</xsl:variable>
|
611
|
-
<xsl:choose>
|
612
|
-
<xsl:when test="xalan:nodeset($p_fn)//fn[@gen_id = $gen_id]">
|
613
|
-
<fo:footnote>
|
614
|
-
<fo:inline font-size="7pt" keep-with-previous.within-line="always" vertical-align="super">
|
615
|
-
<fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
|
616
|
-
<!-- <xsl:value-of select="@reference"/> -->
|
617
|
-
<xsl:value-of select="$number + count(//m3d:bibitem[ancestor::m3d:references[@normative='true' or not(preceding-sibling::m3d:references)]]/m3d:note)"/>
|
618
|
-
</fo:basic-link>
|
619
|
-
</fo:inline>
|
620
|
-
<fo:footnote-body>
|
621
|
-
<fo:block font-size="9pt" margin-bottom="12pt">
|
622
|
-
<fo:inline font-size="6pt" id="footnote_{@reference}_{$number}" keep-with-next.within-line="always" vertical-align="super" padding-right="1mm">
|
623
|
-
<xsl:value-of select="$number + count(//m3d:bibitem[ancestor::m3d:references[@normative='true' or not(preceding-sibling::m3d:references)]]/m3d:note)"/>
|
624
|
-
</fo:inline>
|
625
|
-
<xsl:for-each select="m3d:p">
|
626
|
-
<xsl:apply-templates/>
|
627
|
-
</xsl:for-each>
|
628
|
-
</fo:block>
|
629
|
-
</fo:footnote-body>
|
630
|
-
</fo:footnote>
|
631
|
-
</xsl:when>
|
632
|
-
<xsl:otherwise>
|
633
|
-
<fo:inline font-size="7pt" keep-with-previous.within-line="always" vertical-align="super">
|
634
|
-
<fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
|
635
|
-
<xsl:value-of select="$number + count(//m3d:bibitem/m3d:note)"/>
|
636
|
-
</fo:basic-link>
|
637
|
-
</fo:inline>
|
638
|
-
</xsl:otherwise>
|
639
|
-
</xsl:choose>
|
640
|
-
</xsl:template>
|
641
|
-
|
642
591
|
<xsl:template match="m3d:p/m3d:fn/m3d:p">
|
643
592
|
<xsl:apply-templates/>
|
644
593
|
</xsl:template>
|
645
594
|
|
646
595
|
|
647
|
-
|
648
596
|
<xsl:template match="m3d:bibitem">
|
649
597
|
<fo:block id="{@id}" margin-bottom="12pt" text-indent="-11.7mm" margin-left="11.7mm"> <!-- 12 pt -->
|
650
598
|
<!-- m3d:docidentifier -->
|
@@ -715,10 +663,6 @@
|
|
715
663
|
<fo:list-item id="{@id}">
|
716
664
|
<fo:list-item-label end-indent="label-end()">
|
717
665
|
<fo:block>
|
718
|
-
<xsl:if test="local-name(..) = 'ul'">
|
719
|
-
<xsl:attribute name="font-size">18pt</xsl:attribute>
|
720
|
-
<xsl:attribute name="margin-top">-0.5mm</xsl:attribute><!-- to vertical align big dot -->
|
721
|
-
</xsl:if>
|
722
666
|
<xsl:call-template name="getListItemFormat"/>
|
723
667
|
</fo:block>
|
724
668
|
</fo:list-item-label>
|
@@ -738,6 +682,7 @@
|
|
738
682
|
<xsl:template match="m3d:preferred">
|
739
683
|
|
740
684
|
<fo:inline>
|
685
|
+
<xsl:call-template name="setStyle_preferred"/>
|
741
686
|
<xsl:apply-templates/>
|
742
687
|
</fo:inline>
|
743
688
|
|
@@ -1454,6 +1399,78 @@
|
|
1454
1399
|
|
1455
1400
|
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
1456
1401
|
<xsl:attribute name="line-height">135%</xsl:attribute>
|
1402
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-style">
|
1403
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1404
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-num-style">
|
1405
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1406
|
+
|
1407
|
+
|
1408
|
+
|
1409
|
+
|
1410
|
+
|
1411
|
+
|
1412
|
+
|
1413
|
+
|
1414
|
+
|
1415
|
+
|
1416
|
+
<xsl:attribute name="font-size">7pt</xsl:attribute>
|
1417
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1418
|
+
|
1419
|
+
|
1420
|
+
|
1421
|
+
|
1422
|
+
|
1423
|
+
|
1424
|
+
|
1425
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-style">
|
1426
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1427
|
+
<xsl:attribute name="font-style">normal</xsl:attribute>
|
1428
|
+
<xsl:attribute name="text-indent">0</xsl:attribute>
|
1429
|
+
<xsl:attribute name="start-indent">0</xsl:attribute>
|
1430
|
+
|
1431
|
+
|
1432
|
+
|
1433
|
+
|
1434
|
+
|
1435
|
+
|
1436
|
+
|
1437
|
+
|
1438
|
+
|
1439
|
+
|
1440
|
+
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
1441
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1442
|
+
|
1443
|
+
|
1444
|
+
|
1445
|
+
|
1446
|
+
|
1447
|
+
|
1448
|
+
|
1449
|
+
|
1450
|
+
|
1451
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
|
1452
|
+
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
1453
|
+
|
1454
|
+
|
1455
|
+
|
1456
|
+
|
1457
|
+
|
1458
|
+
|
1459
|
+
|
1460
|
+
|
1461
|
+
|
1462
|
+
|
1463
|
+
<xsl:attribute name="font-size">6pt</xsl:attribute>
|
1464
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1465
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
1466
|
+
|
1467
|
+
|
1468
|
+
|
1469
|
+
|
1470
|
+
|
1471
|
+
|
1472
|
+
|
1473
|
+
|
1457
1474
|
</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">
|
1458
1475
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1459
1476
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1479,7 +1496,8 @@
|
|
1479
1496
|
<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"/>
|
1480
1497
|
|
1481
1498
|
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
1482
|
-
|
1499
|
+
|
1500
|
+
<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']]">
|
1483
1501
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1484
1502
|
<xsl:apply-templates select="." mode="contents"/>
|
1485
1503
|
</xsl:for-each>
|
@@ -1489,7 +1507,7 @@
|
|
1489
1507
|
<xsl:apply-templates select="." mode="contents"/>
|
1490
1508
|
</xsl:for-each>
|
1491
1509
|
|
1492
|
-
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1510
|
+
<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')]]">
|
1493
1511
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1494
1512
|
<xsl:apply-templates select="." mode="contents"/>
|
1495
1513
|
</xsl:for-each>
|
@@ -2393,6 +2411,102 @@
|
|
2393
2411
|
|
2394
2412
|
</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">
|
2395
2413
|
<xsl:apply-templates/>
|
2414
|
+
</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">
|
2415
|
+
|
2416
|
+
<!-- list of footnotes to calculate actual footnotes number -->
|
2417
|
+
<xsl:variable name="p_fn_">
|
2418
|
+
<xsl:choose>
|
2419
|
+
<xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
|
2420
|
+
<fn gen_id="{generate-id(.)}">
|
2421
|
+
<xsl:copy-of select="@*"/>
|
2422
|
+
<xsl:copy-of select="node()"/>
|
2423
|
+
</fn>
|
2424
|
+
</xsl:when>
|
2425
|
+
<xsl:otherwise>
|
2426
|
+
<!-- itetation for:
|
2427
|
+
footnotes in bibdata/title
|
2428
|
+
footnotes in bibliography
|
2429
|
+
footnotes in document's body (except table's head/body/foot and figure text)
|
2430
|
+
-->
|
2431
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
2432
|
+
<fn gen_id="{generate-id(.)}">
|
2433
|
+
<xsl:copy-of select="@*"/>
|
2434
|
+
<xsl:copy-of select="node()"/>
|
2435
|
+
</fn>
|
2436
|
+
</xsl:for-each>
|
2437
|
+
<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']/*">
|
2438
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2439
|
+
<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])]">
|
2440
|
+
<!-- copy unique fn -->
|
2441
|
+
<fn gen_id="{generate-id(.)}">
|
2442
|
+
<xsl:copy-of select="@*"/>
|
2443
|
+
<xsl:copy-of select="node()"/>
|
2444
|
+
</fn>
|
2445
|
+
</xsl:for-each>
|
2446
|
+
</xsl:for-each>
|
2447
|
+
</xsl:otherwise>
|
2448
|
+
</xsl:choose>
|
2449
|
+
</xsl:variable>
|
2450
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
2451
|
+
|
2452
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
2453
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
2454
|
+
<xsl:variable name="reference" select="@reference"/>
|
2455
|
+
<!-- fn sequence number in document -->
|
2456
|
+
<xsl:variable name="current_fn_number">
|
2457
|
+
<xsl:choose>
|
2458
|
+
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
2459
|
+
<xsl:otherwise>
|
2460
|
+
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
2461
|
+
</xsl:otherwise>
|
2462
|
+
</xsl:choose>
|
2463
|
+
</xsl:variable>
|
2464
|
+
<xsl:variable name="current_fn_number_text">
|
2465
|
+
<xsl:value-of select="$current_fn_number"/>
|
2466
|
+
|
2467
|
+
|
2468
|
+
</xsl:variable>
|
2469
|
+
|
2470
|
+
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
2471
|
+
<xsl:variable name="footnote_inline">
|
2472
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
2473
|
+
|
2474
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
2475
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2476
|
+
</fo:basic-link>
|
2477
|
+
</fo:inline>
|
2478
|
+
</xsl:variable>
|
2479
|
+
<!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
|
2480
|
+
gen_id=<xsl:value-of select="$gen_id"/> -->
|
2481
|
+
<xsl:choose>
|
2482
|
+
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
2483
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2484
|
+
</xsl:when>
|
2485
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
2486
|
+
<fo:footnote xsl:use-attribute-sets="fn-style">
|
2487
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2488
|
+
<fo:footnote-body>
|
2489
|
+
|
2490
|
+
<fo:block-container text-indent="0" start-indent="0">
|
2491
|
+
|
2492
|
+
|
2493
|
+
<fo:block xsl:use-attribute-sets="fn-body-style">
|
2494
|
+
|
2495
|
+
|
2496
|
+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
|
2497
|
+
|
2498
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2499
|
+
</fo:inline>
|
2500
|
+
<xsl:apply-templates/>
|
2501
|
+
</fo:block>
|
2502
|
+
</fo:block-container>
|
2503
|
+
</fo:footnote-body>
|
2504
|
+
</fo:footnote>
|
2505
|
+
</xsl:when>
|
2506
|
+
<xsl:otherwise>
|
2507
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2508
|
+
</xsl:otherwise>
|
2509
|
+
</xsl:choose>
|
2396
2510
|
</xsl:template><xsl:template name="fn_display">
|
2397
2511
|
<xsl:variable name="references">
|
2398
2512
|
|
@@ -2585,6 +2699,8 @@
|
|
2585
2699
|
|
2586
2700
|
</fo:basic-link>
|
2587
2701
|
</fo:inline>
|
2702
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
2703
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
2588
2704
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
2589
2705
|
<fo:inline>
|
2590
2706
|
<xsl:apply-templates/>
|
@@ -2942,6 +3058,7 @@
|
|
2942
3058
|
</xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
|
2943
3059
|
<xsl:apply-templates/>
|
2944
3060
|
</xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
|
3061
|
+
<xsl:apply-templates select="@language"/>
|
2945
3062
|
<xsl:apply-templates/>
|
2946
3063
|
</xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
|
2947
3064
|
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
@@ -3580,22 +3697,6 @@
|
|
3580
3697
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
3581
3698
|
<xsl:apply-templates/>
|
3582
3699
|
</fo:inline>
|
3583
|
-
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3584
|
-
<xsl:variable name="title-modified">
|
3585
|
-
|
3586
|
-
|
3587
|
-
<xsl:call-template name="getTitle">
|
3588
|
-
<xsl:with-param name="name" select="'title-modified'"/>
|
3589
|
-
</xsl:call-template>
|
3590
|
-
|
3591
|
-
</xsl:variable>
|
3592
|
-
|
3593
|
-
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3594
|
-
<xsl:choose>
|
3595
|
-
<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>
|
3596
|
-
<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>
|
3597
|
-
</xsl:choose>
|
3598
|
-
<xsl:apply-templates/>
|
3599
3700
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
3600
3701
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
3601
3702
|
|
@@ -4166,12 +4267,12 @@
|
|
4166
4267
|
</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">
|
4167
4268
|
<xsl:apply-templates mode="contents"/>
|
4168
4269
|
<xsl:text> </xsl:text>
|
4169
|
-
</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">
|
4270
|
+
</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">
|
4170
4271
|
<xsl:apply-templates mode="bookmarks"/>
|
4171
4272
|
<xsl:text> </xsl:text>
|
4172
4273
|
</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">
|
4173
4274
|
<xsl:value-of select="."/>
|
4174
|
-
</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">
|
4275
|
+
</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">
|
4175
4276
|
<xsl:value-of select="."/>
|
4176
4277
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4177
4278
|
<xsl:apply-templates mode="contents"/>
|
@@ -4441,6 +4542,8 @@
|
|
4441
4542
|
|
4442
4543
|
|
4443
4544
|
|
4545
|
+
|
4546
|
+
|
4444
4547
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4445
4548
|
<xsl:variable name="_font-size">
|
4446
4549
|
|
@@ -4474,13 +4577,17 @@
|
|
4474
4577
|
|
4475
4578
|
|
4476
4579
|
|
4580
|
+
|
4581
|
+
|
4477
4582
|
<xsl:apply-templates/>
|
4478
4583
|
</fo:block>
|
4479
|
-
|
4584
|
+
|
4480
4585
|
|
4481
4586
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4482
4587
|
|
4483
4588
|
|
4589
|
+
|
4590
|
+
|
4484
4591
|
</fo:block-container>
|
4485
4592
|
</fo:block-container>
|
4486
4593
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -4827,45 +4934,69 @@
|
|
4827
4934
|
<xsl:variable name="termsource_text">
|
4828
4935
|
<xsl:apply-templates/>
|
4829
4936
|
</xsl:variable>
|
4830
|
-
|
4831
|
-
<xsl:choose>
|
4937
|
+
<xsl:copy-of select="$termsource_text"/>
|
4938
|
+
<!-- <xsl:choose>
|
4832
4939
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
4833
|
-
<!-- <xsl:apply-templates /> -->
|
4834
4940
|
<xsl:copy-of select="$termsource_text"/>
|
4835
4941
|
</xsl:when>
|
4836
4942
|
<xsl:otherwise>
|
4837
|
-
|
4838
|
-
|
4943
|
+
<xsl:if test="$namespace = 'bsi'">
|
4944
|
+
<xsl:choose>
|
4945
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
|
4946
|
+
<xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
|
4947
|
+
</xsl:choose>
|
4948
|
+
</xsl:if>
|
4949
|
+
<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'">
|
4839
4950
|
<xsl:text>[</xsl:text>
|
4840
|
-
|
4841
|
-
<!-- <xsl:apply-templates /> -->
|
4951
|
+
</xsl:if>
|
4842
4952
|
<xsl:copy-of select="$termsource_text"/>
|
4843
|
-
|
4844
|
-
|
4953
|
+
<xsl:if test="$namespace = 'bsi'">
|
4954
|
+
<xsl:choose>
|
4955
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
|
4956
|
+
<xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
|
4957
|
+
</xsl:choose>
|
4958
|
+
</xsl:if>
|
4959
|
+
<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'">
|
4845
4960
|
<xsl:text>]</xsl:text>
|
4846
|
-
|
4961
|
+
</xsl:if>
|
4847
4962
|
</xsl:otherwise>
|
4848
|
-
</xsl:choose>
|
4963
|
+
</xsl:choose> -->
|
4849
4964
|
</fo:block>
|
4850
4965
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
4851
4966
|
<xsl:if test="normalize-space() != ''">
|
4852
4967
|
<xsl:value-of select="."/>
|
4853
4968
|
</xsl:if>
|
4854
|
-
</xsl:template><xsl:
|
4855
|
-
<
|
4856
|
-
|
4857
|
-
|
4858
|
-
|
4969
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
|
4970
|
+
<fo:inline>
|
4971
|
+
|
4972
|
+
|
4973
|
+
<xsl:value-of select="."/>
|
4974
|
+
</fo:inline>
|
4975
|
+
</xsl:template><xsl:template match="*[local-name() = 'origin']">
|
4859
4976
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4860
4977
|
<xsl:if test="normalize-space(@citeas) = ''">
|
4861
4978
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4862
4979
|
</xsl:if>
|
4863
|
-
|
4864
4980
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
4865
4981
|
<xsl:apply-templates/>
|
4866
4982
|
</fo:inline>
|
4983
|
+
</fo:basic-link>
|
4984
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
4985
|
+
<xsl:variable name="title-modified">
|
4867
4986
|
|
4868
|
-
|
4987
|
+
|
4988
|
+
<xsl:call-template name="getTitle">
|
4989
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
4990
|
+
</xsl:call-template>
|
4991
|
+
|
4992
|
+
</xsl:variable>
|
4993
|
+
|
4994
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
4995
|
+
<xsl:choose>
|
4996
|
+
<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>
|
4997
|
+
<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>
|
4998
|
+
</xsl:choose>
|
4999
|
+
<xsl:apply-templates/>
|
4869
5000
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
4870
5001
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
4871
5002
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
|
@@ -5050,24 +5181,29 @@
|
|
5050
5181
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
5051
5182
|
<xsl:variable name="title-deprecated">
|
5052
5183
|
|
5053
|
-
|
5054
|
-
|
5055
|
-
<xsl:with-param name="name" select="'title-deprecated'"/>
|
5184
|
+
<xsl:call-template name="getLocalizedString">
|
5185
|
+
<xsl:with-param name="key">deprecated</xsl:with-param>
|
5056
5186
|
</xsl:call-template>
|
5057
5187
|
|
5188
|
+
|
5058
5189
|
</xsl:variable>
|
5059
5190
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
5060
5191
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
5061
5192
|
</fo:block>
|
5193
|
+
</xsl:template><xsl:template name="setStyle_preferred">
|
5194
|
+
<xsl:if test="*[local-name() = 'strong']">
|
5195
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
5196
|
+
</xsl:if>
|
5062
5197
|
</xsl:template><xsl:template match="*[local-name() = 'definition']">
|
5063
5198
|
<fo:block xsl:use-attribute-sets="definition-style">
|
5064
5199
|
<xsl:apply-templates/>
|
5065
5200
|
</fo:block>
|
5066
5201
|
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
|
5067
5202
|
<xsl:apply-templates/>
|
5068
|
-
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
|
5203
|
+
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
|
5069
5204
|
<fo:inline> <xsl:apply-templates/></fo:inline>
|
5070
|
-
<fo:block
|
5205
|
+
<!-- <fo:block> </fo:block> -->
|
5206
|
+
<fo:block/>
|
5071
5207
|
</xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
|
5072
5208
|
|
5073
5209
|
<fo:block break-after="page"/>
|
@@ -5130,6 +5266,51 @@
|
|
5130
5266
|
</xsl:template><xsl:template match="*[local-name() = 'name']/text()">
|
5131
5267
|
<!-- 0xA0 to space replacement -->
|
5132
5268
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
5269
|
+
</xsl:template><xsl:variable name="ul_labels_">
|
5270
|
+
|
5271
|
+
|
5272
|
+
|
5273
|
+
|
5274
|
+
|
5275
|
+
|
5276
|
+
|
5277
|
+
|
5278
|
+
|
5279
|
+
<label font-size="18pt" margin-top="-0.5mm">•</label> <!-- margin-top to vertical align big dot -->
|
5280
|
+
|
5281
|
+
|
5282
|
+
|
5283
|
+
|
5284
|
+
|
5285
|
+
|
5286
|
+
|
5287
|
+
|
5288
|
+
|
5289
|
+
</xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
|
5290
|
+
<xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
|
5291
|
+
<xsl:variable name="list_level">
|
5292
|
+
<xsl:choose>
|
5293
|
+
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
5294
|
+
<xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
|
5295
|
+
</xsl:choose>
|
5296
|
+
</xsl:variable>
|
5297
|
+
<xsl:choose>
|
5298
|
+
<xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
|
5299
|
+
<xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
|
5300
|
+
</xsl:when>
|
5301
|
+
<xsl:when test="$list_level mod 3 = 0">
|
5302
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
|
5303
|
+
</xsl:when>
|
5304
|
+
<xsl:when test="$list_level mod 2 = 0">
|
5305
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
|
5306
|
+
</xsl:when>
|
5307
|
+
<xsl:otherwise>
|
5308
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
|
5309
|
+
</xsl:otherwise>
|
5310
|
+
</xsl:choose>
|
5311
|
+
</xsl:template><xsl:template match="label" mode="ul_labels">
|
5312
|
+
<xsl:copy-of select="@*[not(local-name() = 'level')]"/>
|
5313
|
+
<xsl:value-of select="."/>
|
5133
5314
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
5134
5315
|
<xsl:choose>
|
5135
5316
|
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
@@ -5468,7 +5649,31 @@
|
|
5468
5649
|
<fo:block-container border="1pt solid black" width="50%">
|
5469
5650
|
<fo:block> </fo:block>
|
5470
5651
|
</fo:block-container>
|
5471
|
-
</xsl:template><xsl:
|
5652
|
+
</xsl:template><xsl:variable name="toc_level">
|
5653
|
+
<xsl:choose>
|
5654
|
+
<xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
|
5655
|
+
<xsl:otherwise><!-- default value -->
|
5656
|
+
|
5657
|
+
|
5658
|
+
|
5659
|
+
|
5660
|
+
|
5661
|
+
|
5662
|
+
|
5663
|
+
|
5664
|
+
|
5665
|
+
3
|
5666
|
+
|
5667
|
+
|
5668
|
+
|
5669
|
+
|
5670
|
+
|
5671
|
+
|
5672
|
+
|
5673
|
+
|
5674
|
+
</xsl:otherwise>
|
5675
|
+
</xsl:choose>
|
5676
|
+
</xsl:variable><xsl:template match="*[local-name() = 'toc']">
|
5472
5677
|
<xsl:param name="colwidths"/>
|
5473
5678
|
<xsl:variable name="colwidths_">
|
5474
5679
|
<xsl:choose>
|
@@ -5559,6 +5764,10 @@
|
|
5559
5764
|
</svg>
|
5560
5765
|
</fo:instream-foreign-object>
|
5561
5766
|
</fo:inline>
|
5767
|
+
</xsl:template><xsl:template match="@language">
|
5768
|
+
<xsl:copy-of select="."/>
|
5769
|
+
</xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
|
5770
|
+
<xsl:call-template name="title"/>
|
5562
5771
|
</xsl:template><xsl:template name="convertDate">
|
5563
5772
|
<xsl:param name="date"/>
|
5564
5773
|
<xsl:param name="format" select="'short'"/>
|
@@ -6003,12 +6212,15 @@
|
|
6003
6212
|
<xsl:param name="default">left</xsl:param>
|
6004
6213
|
<xsl:attribute name="text-align">
|
6005
6214
|
<xsl:choose>
|
6006
|
-
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6215
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
6007
6216
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
6008
6217
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
6009
6218
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
6010
6219
|
</xsl:choose>
|
6011
6220
|
</xsl:attribute>
|
6221
|
+
<xsl:if test="@align = 'indent'">
|
6222
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
6223
|
+
</xsl:if>
|
6012
6224
|
</xsl:template><xsl:template name="number-to-words">
|
6013
6225
|
<xsl:param name="number"/>
|
6014
6226
|
<xsl:param name="first"/>
|
@@ -6105,4 +6317,14 @@
|
|
6105
6317
|
</xsl:otherwise>
|
6106
6318
|
</xsl:choose>
|
6107
6319
|
</xsl:if>
|
6320
|
+
</xsl:template><xsl:template name="setAltText">
|
6321
|
+
<xsl:param name="value"/>
|
6322
|
+
<xsl:attribute name="fox:alt-text">
|
6323
|
+
<xsl:choose>
|
6324
|
+
<xsl:when test="normalize-space($value) != ''">
|
6325
|
+
<xsl:value-of select="$value"/>
|
6326
|
+
</xsl:when>
|
6327
|
+
<xsl:otherwise>_</xsl:otherwise>
|
6328
|
+
</xsl:choose>
|
6329
|
+
</xsl:attribute>
|
6108
6330
|
</xsl:template></xsl:stylesheet>
|