metanorma-m3aawg 1.8.0 → 1.8.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/m3aawg/converter.rb +15 -11
- data/lib/asciidoctor/m3aawg/isodoc.rng +68 -18
- data/lib/isodoc/m3aawg/html/htmlstyle.css +4 -2
- data/lib/isodoc/m3aawg/html/htmlstyle.scss +4 -1
- 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/m3aawg.policy.xsl +298 -108
- data/lib/isodoc/m3aawg/m3aawg.report.xsl +298 -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>
|
@@ -586,65 +586,11 @@
|
|
586
586
|
|
587
587
|
</xsl:template>
|
588
588
|
|
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
589
|
<xsl:template match="m3d:p/m3d:fn/m3d:p">
|
643
590
|
<xsl:apply-templates/>
|
644
591
|
</xsl:template>
|
645
592
|
|
646
593
|
|
647
|
-
|
648
594
|
<xsl:template match="m3d:bibitem">
|
649
595
|
<fo:block id="{@id}" margin-bottom="12pt" text-indent="-11.7mm" margin-left="11.7mm"> <!-- 12 pt -->
|
650
596
|
<!-- m3d:docidentifier -->
|
@@ -738,6 +684,7 @@
|
|
738
684
|
<xsl:template match="m3d:preferred">
|
739
685
|
|
740
686
|
<fo:inline>
|
687
|
+
<xsl:call-template name="setStyle_preferred"/>
|
741
688
|
<xsl:apply-templates/>
|
742
689
|
</fo:inline>
|
743
690
|
|
@@ -1454,6 +1401,78 @@
|
|
1454
1401
|
|
1455
1402
|
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
1456
1403
|
<xsl:attribute name="line-height">135%</xsl:attribute>
|
1404
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-style">
|
1405
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1406
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-num-style">
|
1407
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1408
|
+
|
1409
|
+
|
1410
|
+
|
1411
|
+
|
1412
|
+
|
1413
|
+
|
1414
|
+
|
1415
|
+
|
1416
|
+
|
1417
|
+
|
1418
|
+
<xsl:attribute name="font-size">7pt</xsl:attribute>
|
1419
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1420
|
+
|
1421
|
+
|
1422
|
+
|
1423
|
+
|
1424
|
+
|
1425
|
+
|
1426
|
+
|
1427
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-style">
|
1428
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1429
|
+
<xsl:attribute name="font-style">normal</xsl:attribute>
|
1430
|
+
<xsl:attribute name="text-indent">0</xsl:attribute>
|
1431
|
+
<xsl:attribute name="start-indent">0</xsl:attribute>
|
1432
|
+
|
1433
|
+
|
1434
|
+
|
1435
|
+
|
1436
|
+
|
1437
|
+
|
1438
|
+
|
1439
|
+
|
1440
|
+
|
1441
|
+
|
1442
|
+
<xsl:attribute name="font-size">9pt</xsl:attribute>
|
1443
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1444
|
+
|
1445
|
+
|
1446
|
+
|
1447
|
+
|
1448
|
+
|
1449
|
+
|
1450
|
+
|
1451
|
+
|
1452
|
+
|
1453
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
|
1454
|
+
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
1455
|
+
|
1456
|
+
|
1457
|
+
|
1458
|
+
|
1459
|
+
|
1460
|
+
|
1461
|
+
|
1462
|
+
|
1463
|
+
|
1464
|
+
|
1465
|
+
<xsl:attribute name="font-size">6pt</xsl:attribute>
|
1466
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1467
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
1468
|
+
|
1469
|
+
|
1470
|
+
|
1471
|
+
|
1472
|
+
|
1473
|
+
|
1474
|
+
|
1475
|
+
|
1457
1476
|
</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
1477
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1459
1478
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1479,7 +1498,8 @@
|
|
1479
1498
|
<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
1499
|
|
1481
1500
|
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
1482
|
-
|
1501
|
+
|
1502
|
+
<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
1503
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1484
1504
|
<xsl:apply-templates select="." mode="contents"/>
|
1485
1505
|
</xsl:for-each>
|
@@ -1489,7 +1509,7 @@
|
|
1489
1509
|
<xsl:apply-templates select="." mode="contents"/>
|
1490
1510
|
</xsl:for-each>
|
1491
1511
|
|
1492
|
-
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1512
|
+
<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
1513
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1494
1514
|
<xsl:apply-templates select="." mode="contents"/>
|
1495
1515
|
</xsl:for-each>
|
@@ -2393,6 +2413,102 @@
|
|
2393
2413
|
|
2394
2414
|
</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
2415
|
<xsl:apply-templates/>
|
2416
|
+
</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">
|
2417
|
+
|
2418
|
+
<!-- list of footnotes to calculate actual footnotes number -->
|
2419
|
+
<xsl:variable name="p_fn_">
|
2420
|
+
<xsl:choose>
|
2421
|
+
<xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
|
2422
|
+
<fn gen_id="{generate-id(.)}">
|
2423
|
+
<xsl:copy-of select="@*"/>
|
2424
|
+
<xsl:copy-of select="node()"/>
|
2425
|
+
</fn>
|
2426
|
+
</xsl:when>
|
2427
|
+
<xsl:otherwise>
|
2428
|
+
<!-- itetation for:
|
2429
|
+
footnotes in bibdata/title
|
2430
|
+
footnotes in bibliography
|
2431
|
+
footnotes in document's body (except table's head/body/foot and figure text)
|
2432
|
+
-->
|
2433
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
2434
|
+
<fn gen_id="{generate-id(.)}">
|
2435
|
+
<xsl:copy-of select="@*"/>
|
2436
|
+
<xsl:copy-of select="node()"/>
|
2437
|
+
</fn>
|
2438
|
+
</xsl:for-each>
|
2439
|
+
<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']/*">
|
2440
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2441
|
+
<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])]">
|
2442
|
+
<!-- copy unique fn -->
|
2443
|
+
<fn gen_id="{generate-id(.)}">
|
2444
|
+
<xsl:copy-of select="@*"/>
|
2445
|
+
<xsl:copy-of select="node()"/>
|
2446
|
+
</fn>
|
2447
|
+
</xsl:for-each>
|
2448
|
+
</xsl:for-each>
|
2449
|
+
</xsl:otherwise>
|
2450
|
+
</xsl:choose>
|
2451
|
+
</xsl:variable>
|
2452
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
2453
|
+
|
2454
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
2455
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
2456
|
+
<xsl:variable name="reference" select="@reference"/>
|
2457
|
+
<!-- fn sequence number in document -->
|
2458
|
+
<xsl:variable name="current_fn_number">
|
2459
|
+
<xsl:choose>
|
2460
|
+
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
2461
|
+
<xsl:otherwise>
|
2462
|
+
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
2463
|
+
</xsl:otherwise>
|
2464
|
+
</xsl:choose>
|
2465
|
+
</xsl:variable>
|
2466
|
+
<xsl:variable name="current_fn_number_text">
|
2467
|
+
<xsl:value-of select="$current_fn_number"/>
|
2468
|
+
|
2469
|
+
|
2470
|
+
</xsl:variable>
|
2471
|
+
|
2472
|
+
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
2473
|
+
<xsl:variable name="footnote_inline">
|
2474
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
2475
|
+
|
2476
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
2477
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2478
|
+
</fo:basic-link>
|
2479
|
+
</fo:inline>
|
2480
|
+
</xsl:variable>
|
2481
|
+
<!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
|
2482
|
+
gen_id=<xsl:value-of select="$gen_id"/> -->
|
2483
|
+
<xsl:choose>
|
2484
|
+
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
2485
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2486
|
+
</xsl:when>
|
2487
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
2488
|
+
<fo:footnote xsl:use-attribute-sets="fn-style">
|
2489
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2490
|
+
<fo:footnote-body>
|
2491
|
+
|
2492
|
+
<fo:block-container text-indent="0" start-indent="0">
|
2493
|
+
|
2494
|
+
|
2495
|
+
<fo:block xsl:use-attribute-sets="fn-body-style">
|
2496
|
+
|
2497
|
+
|
2498
|
+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
|
2499
|
+
|
2500
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2501
|
+
</fo:inline>
|
2502
|
+
<xsl:apply-templates/>
|
2503
|
+
</fo:block>
|
2504
|
+
</fo:block-container>
|
2505
|
+
</fo:footnote-body>
|
2506
|
+
</fo:footnote>
|
2507
|
+
</xsl:when>
|
2508
|
+
<xsl:otherwise>
|
2509
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2510
|
+
</xsl:otherwise>
|
2511
|
+
</xsl:choose>
|
2396
2512
|
</xsl:template><xsl:template name="fn_display">
|
2397
2513
|
<xsl:variable name="references">
|
2398
2514
|
|
@@ -2585,6 +2701,8 @@
|
|
2585
2701
|
|
2586
2702
|
</fo:basic-link>
|
2587
2703
|
</fo:inline>
|
2704
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
2705
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
2588
2706
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
2589
2707
|
<fo:inline>
|
2590
2708
|
<xsl:apply-templates/>
|
@@ -2884,6 +3002,7 @@
|
|
2884
3002
|
<fo:table-cell>
|
2885
3003
|
|
2886
3004
|
<fo:block margin-top="6pt">
|
3005
|
+
<xsl:copy-of select="@id"/>
|
2887
3006
|
|
2888
3007
|
|
2889
3008
|
<xsl:if test="normalize-space($key_iso) = 'true'">
|
@@ -3579,22 +3698,6 @@
|
|
3579
3698
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
3580
3699
|
<xsl:apply-templates/>
|
3581
3700
|
</fo:inline>
|
3582
|
-
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3583
|
-
<xsl:variable name="title-modified">
|
3584
|
-
|
3585
|
-
|
3586
|
-
<xsl:call-template name="getTitle">
|
3587
|
-
<xsl:with-param name="name" select="'title-modified'"/>
|
3588
|
-
</xsl:call-template>
|
3589
|
-
|
3590
|
-
</xsl:variable>
|
3591
|
-
|
3592
|
-
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3593
|
-
<xsl:choose>
|
3594
|
-
<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>
|
3595
|
-
<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>
|
3596
|
-
</xsl:choose>
|
3597
|
-
<xsl:apply-templates/>
|
3598
3701
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
3599
3702
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
3600
3703
|
|
@@ -3726,10 +3829,12 @@
|
|
3726
3829
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
|
3727
3830
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
3728
3831
|
</xsl:template><xsl:template match="*[local-name() = 'terms']">
|
3832
|
+
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
3729
3833
|
<fo:block id="{@id}">
|
3730
3834
|
<xsl:apply-templates/>
|
3731
3835
|
</fo:block>
|
3732
3836
|
</xsl:template><xsl:template match="*[local-name() = 'term']">
|
3837
|
+
<!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
|
3733
3838
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
3734
3839
|
|
3735
3840
|
|
@@ -3737,7 +3842,9 @@
|
|
3737
3842
|
<xsl:apply-templates select="m3d:name" mode="presentation"/>
|
3738
3843
|
</fo:block>
|
3739
3844
|
|
3740
|
-
|
3845
|
+
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
3846
|
+
|
3847
|
+
</xsl:if>
|
3741
3848
|
<xsl:apply-templates/>
|
3742
3849
|
</fo:block>
|
3743
3850
|
</xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
|
@@ -4161,12 +4268,12 @@
|
|
4161
4268
|
</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">
|
4162
4269
|
<xsl:apply-templates mode="contents"/>
|
4163
4270
|
<xsl:text> </xsl:text>
|
4164
|
-
</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">
|
4271
|
+
</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">
|
4165
4272
|
<xsl:apply-templates mode="bookmarks"/>
|
4166
4273
|
<xsl:text> </xsl:text>
|
4167
4274
|
</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">
|
4168
4275
|
<xsl:value-of select="."/>
|
4169
|
-
</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">
|
4276
|
+
</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">
|
4170
4277
|
<xsl:value-of select="."/>
|
4171
4278
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4172
4279
|
<xsl:apply-templates mode="contents"/>
|
@@ -4436,6 +4543,8 @@
|
|
4436
4543
|
|
4437
4544
|
|
4438
4545
|
|
4546
|
+
|
4547
|
+
|
4439
4548
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4440
4549
|
<xsl:variable name="_font-size">
|
4441
4550
|
|
@@ -4469,13 +4578,17 @@
|
|
4469
4578
|
|
4470
4579
|
|
4471
4580
|
|
4581
|
+
|
4582
|
+
|
4472
4583
|
<xsl:apply-templates/>
|
4473
4584
|
</fo:block>
|
4474
|
-
|
4585
|
+
|
4475
4586
|
|
4476
4587
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4477
4588
|
|
4478
4589
|
|
4590
|
+
|
4591
|
+
|
4479
4592
|
</fo:block-container>
|
4480
4593
|
</fo:block-container>
|
4481
4594
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -4711,7 +4824,8 @@
|
|
4711
4824
|
</fo:block>
|
4712
4825
|
</fo:table-cell>
|
4713
4826
|
</xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
|
4714
|
-
<fo:block font-size="11pt"
|
4827
|
+
<fo:block font-size="11pt">
|
4828
|
+
|
4715
4829
|
<xsl:apply-templates/>
|
4716
4830
|
</fo:block>
|
4717
4831
|
</xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
|
@@ -4821,43 +4935,69 @@
|
|
4821
4935
|
<xsl:variable name="termsource_text">
|
4822
4936
|
<xsl:apply-templates/>
|
4823
4937
|
</xsl:variable>
|
4824
|
-
|
4825
|
-
<xsl:choose>
|
4938
|
+
<xsl:copy-of select="$termsource_text"/>
|
4939
|
+
<!-- <xsl:choose>
|
4826
4940
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
4827
|
-
<!-- <xsl:apply-templates /> -->
|
4828
4941
|
<xsl:copy-of select="$termsource_text"/>
|
4829
4942
|
</xsl:when>
|
4830
|
-
<xsl:otherwise>
|
4831
|
-
|
4943
|
+
<xsl:otherwise>
|
4944
|
+
<xsl:if test="$namespace = 'bsi'">
|
4945
|
+
<xsl:choose>
|
4946
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
|
4947
|
+
<xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
|
4948
|
+
</xsl:choose>
|
4949
|
+
</xsl:if>
|
4950
|
+
<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'">
|
4832
4951
|
<xsl:text>[</xsl:text>
|
4833
|
-
|
4834
|
-
<!-- <xsl:apply-templates /> -->
|
4952
|
+
</xsl:if>
|
4835
4953
|
<xsl:copy-of select="$termsource_text"/>
|
4836
|
-
|
4954
|
+
<xsl:if test="$namespace = 'bsi'">
|
4955
|
+
<xsl:choose>
|
4956
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
|
4957
|
+
<xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
|
4958
|
+
</xsl:choose>
|
4959
|
+
</xsl:if>
|
4960
|
+
<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'">
|
4837
4961
|
<xsl:text>]</xsl:text>
|
4838
|
-
|
4962
|
+
</xsl:if>
|
4839
4963
|
</xsl:otherwise>
|
4840
|
-
</xsl:choose>
|
4964
|
+
</xsl:choose> -->
|
4841
4965
|
</fo:block>
|
4842
4966
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
4843
4967
|
<xsl:if test="normalize-space() != ''">
|
4844
4968
|
<xsl:value-of select="."/>
|
4845
4969
|
</xsl:if>
|
4846
|
-
</xsl:template><xsl:
|
4847
|
-
<
|
4848
|
-
|
4849
|
-
|
4850
|
-
|
4970
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
|
4971
|
+
<fo:inline>
|
4972
|
+
|
4973
|
+
|
4974
|
+
<xsl:value-of select="."/>
|
4975
|
+
</fo:inline>
|
4976
|
+
</xsl:template><xsl:template match="*[local-name() = 'origin']">
|
4851
4977
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4852
4978
|
<xsl:if test="normalize-space(@citeas) = ''">
|
4853
4979
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4854
4980
|
</xsl:if>
|
4855
|
-
|
4856
4981
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
4857
4982
|
<xsl:apply-templates/>
|
4858
4983
|
</fo:inline>
|
4984
|
+
</fo:basic-link>
|
4985
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
4986
|
+
<xsl:variable name="title-modified">
|
4859
4987
|
|
4860
|
-
|
4988
|
+
|
4989
|
+
<xsl:call-template name="getTitle">
|
4990
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
4991
|
+
</xsl:call-template>
|
4992
|
+
|
4993
|
+
</xsl:variable>
|
4994
|
+
|
4995
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
4996
|
+
<xsl:choose>
|
4997
|
+
<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>
|
4998
|
+
<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>
|
4999
|
+
</xsl:choose>
|
5000
|
+
<xsl:apply-templates/>
|
4861
5001
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
4862
5002
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
4863
5003
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
|
@@ -4900,12 +5040,20 @@
|
|
4900
5040
|
</xsl:template><xsl:template match="*[local-name() = 'author']">
|
4901
5041
|
<xsl:text>— </xsl:text>
|
4902
5042
|
<xsl:apply-templates/>
|
4903
|
-
</xsl:template><xsl:
|
5043
|
+
</xsl:template><xsl:variable name="bibitem_hidden_">
|
5044
|
+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
|
5045
|
+
<xsl:copy-of select="."/>
|
5046
|
+
</xsl:for-each>
|
5047
|
+
<xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
|
5048
|
+
<xsl:copy-of select="."/>
|
5049
|
+
</xsl:for-each>
|
5050
|
+
</xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
|
4904
5051
|
|
4905
5052
|
<xsl:variable name="bibitemid">
|
4906
5053
|
<xsl:choose>
|
4907
|
-
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"
|
4908
|
-
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"
|
5054
|
+
<!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
|
5055
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
|
5056
|
+
<xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
4909
5057
|
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
4910
5058
|
</xsl:choose>
|
4911
5059
|
</xsl:variable>
|
@@ -4997,10 +5145,10 @@
|
|
4997
5145
|
</xsl:choose>
|
4998
5146
|
</xsl:variable>
|
4999
5147
|
|
5000
|
-
<xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
5148
|
+
<!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
|
5001
5149
|
|
5002
5150
|
<xsl:choose>
|
5003
|
-
<xsl:when test="$
|
5151
|
+
<xsl:when test="$lang = 'zh'">
|
5004
5152
|
<fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
|
5005
5153
|
</xsl:when>
|
5006
5154
|
<xsl:when test="../../@inline-header = 'true'">
|
@@ -5034,24 +5182,29 @@
|
|
5034
5182
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
5035
5183
|
<xsl:variable name="title-deprecated">
|
5036
5184
|
|
5037
|
-
|
5038
|
-
|
5039
|
-
<xsl:with-param name="name" select="'title-deprecated'"/>
|
5185
|
+
<xsl:call-template name="getLocalizedString">
|
5186
|
+
<xsl:with-param name="key">deprecated</xsl:with-param>
|
5040
5187
|
</xsl:call-template>
|
5041
5188
|
|
5189
|
+
|
5042
5190
|
</xsl:variable>
|
5043
5191
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
5044
5192
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
5045
5193
|
</fo:block>
|
5194
|
+
</xsl:template><xsl:template name="setStyle_preferred">
|
5195
|
+
<xsl:if test="*[local-name() = 'strong']">
|
5196
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
5197
|
+
</xsl:if>
|
5046
5198
|
</xsl:template><xsl:template match="*[local-name() = 'definition']">
|
5047
5199
|
<fo:block xsl:use-attribute-sets="definition-style">
|
5048
5200
|
<xsl:apply-templates/>
|
5049
5201
|
</fo:block>
|
5050
5202
|
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
|
5051
5203
|
<xsl:apply-templates/>
|
5052
|
-
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
|
5204
|
+
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
|
5053
5205
|
<fo:inline> <xsl:apply-templates/></fo:inline>
|
5054
|
-
<fo:block
|
5206
|
+
<!-- <fo:block> </fo:block> -->
|
5207
|
+
<fo:block/>
|
5055
5208
|
</xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
|
5056
5209
|
|
5057
5210
|
<fo:block break-after="page"/>
|
@@ -5452,7 +5605,31 @@
|
|
5452
5605
|
<fo:block-container border="1pt solid black" width="50%">
|
5453
5606
|
<fo:block> </fo:block>
|
5454
5607
|
</fo:block-container>
|
5455
|
-
</xsl:template><xsl:
|
5608
|
+
</xsl:template><xsl:variable name="toc_level">
|
5609
|
+
<xsl:choose>
|
5610
|
+
<xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
|
5611
|
+
<xsl:otherwise><!-- default value -->
|
5612
|
+
|
5613
|
+
|
5614
|
+
|
5615
|
+
|
5616
|
+
|
5617
|
+
|
5618
|
+
|
5619
|
+
|
5620
|
+
|
5621
|
+
3
|
5622
|
+
|
5623
|
+
|
5624
|
+
|
5625
|
+
|
5626
|
+
|
5627
|
+
|
5628
|
+
|
5629
|
+
|
5630
|
+
</xsl:otherwise>
|
5631
|
+
</xsl:choose>
|
5632
|
+
</xsl:variable><xsl:template match="*[local-name() = 'toc']">
|
5456
5633
|
<xsl:param name="colwidths"/>
|
5457
5634
|
<xsl:variable name="colwidths_">
|
5458
5635
|
<xsl:choose>
|
@@ -5987,12 +6164,15 @@
|
|
5987
6164
|
<xsl:param name="default">left</xsl:param>
|
5988
6165
|
<xsl:attribute name="text-align">
|
5989
6166
|
<xsl:choose>
|
5990
|
-
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6167
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
5991
6168
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
5992
6169
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
5993
6170
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
5994
6171
|
</xsl:choose>
|
5995
6172
|
</xsl:attribute>
|
6173
|
+
<xsl:if test="@align = 'indent'">
|
6174
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
6175
|
+
</xsl:if>
|
5996
6176
|
</xsl:template><xsl:template name="number-to-words">
|
5997
6177
|
<xsl:param name="number"/>
|
5998
6178
|
<xsl:param name="first"/>
|
@@ -6089,4 +6269,14 @@
|
|
6089
6269
|
</xsl:otherwise>
|
6090
6270
|
</xsl:choose>
|
6091
6271
|
</xsl:if>
|
6272
|
+
</xsl:template><xsl:template name="setAltText">
|
6273
|
+
<xsl:param name="value"/>
|
6274
|
+
<xsl:attribute name="fox:alt-text">
|
6275
|
+
<xsl:choose>
|
6276
|
+
<xsl:when test="normalize-space($value) != ''">
|
6277
|
+
<xsl:value-of select="$value"/>
|
6278
|
+
</xsl:when>
|
6279
|
+
<xsl:otherwise>_</xsl:otherwise>
|
6280
|
+
</xsl:choose>
|
6281
|
+
</xsl:attribute>
|
6092
6282
|
</xsl:template></xsl:stylesheet>
|