metanorma-iho 0.4.0 → 0.4.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/iho/converter.rb +1 -1
- data/lib/asciidoctor/iho/isodoc.rng +68 -18
- data/lib/isodoc/iho/html/htmlstyle.css +3 -1
- data/lib/isodoc/iho/html/htmlstyle.scss +3 -0
- data/lib/isodoc/iho/html/scripts.html +0 -1
- data/lib/isodoc/iho/iho.specification.xsl +299 -128
- data/lib/isodoc/iho/iho.standard.xsl +299 -128
- data/lib/metanorma/iho/version.rb +1 -1
- data/metanorma-iho.gemspec +1 -1
- metadata +8 -8
@@ -9,8 +9,7 @@
|
|
9
9
|
|
10
10
|
|
11
11
|
|
12
|
-
|
13
|
-
<xsl:key name="kfn" match="iho:fn[local-name(..) = 'p' or ancestor::*[local-name() = 'title']]" use="@reference"/>
|
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"/>
|
14
13
|
|
15
14
|
|
16
15
|
|
@@ -377,7 +376,7 @@
|
|
377
376
|
|
378
377
|
<xsl:variable name="display">
|
379
378
|
<xsl:choose>
|
380
|
-
<xsl:when test="$level <=
|
379
|
+
<xsl:when test="$level <= $toc_level">true</xsl:when>
|
381
380
|
<xsl:otherwise>false</xsl:otherwise>
|
382
381
|
</xsl:choose>
|
383
382
|
</xsl:variable>
|
@@ -575,61 +574,6 @@
|
|
575
574
|
</xsl:if>
|
576
575
|
</xsl:template>
|
577
576
|
|
578
|
-
<!--
|
579
|
-
<fn reference="1">
|
580
|
-
<p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
|
581
|
-
</fn>
|
582
|
-
-->
|
583
|
-
|
584
|
-
<xsl:variable name="p_fn">
|
585
|
-
<!-- <xsl:for-each select="//iho:p/iho:fn[generate-id(.)=generate-id(key('kfn',@reference)[1])]"> -->
|
586
|
-
<xsl:for-each select="//iho:fn[local-name(..) = 'p' or ancestor::*[local-name() = 'title']][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
|
587
|
-
<!-- copy unique fn -->
|
588
|
-
<fn gen_id="{generate-id(.)}">
|
589
|
-
<xsl:copy-of select="@*"/>
|
590
|
-
<xsl:copy-of select="node()"/>
|
591
|
-
</fn>
|
592
|
-
</xsl:for-each>
|
593
|
-
</xsl:variable>
|
594
|
-
|
595
|
-
<!-- iho:p/iho:fn -->
|
596
|
-
<xsl:template match="iho:fn[local-name(..) = 'p' or ancestor::*[local-name() = 'title']]" priority="2">
|
597
|
-
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
598
|
-
<xsl:variable name="reference" select="@reference"/>
|
599
|
-
<xsl:variable name="number">
|
600
|
-
<!-- <xsl:number level="any" count="iho:p/iho:fn"/> -->
|
601
|
-
<xsl:value-of select="count(xalan:nodeset($p_fn)//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
602
|
-
</xsl:variable>
|
603
|
-
<xsl:choose>
|
604
|
-
<xsl:when test="xalan:nodeset($p_fn)//fn[@gen_id = $gen_id]">
|
605
|
-
<fo:footnote>
|
606
|
-
<fo:inline font-size="70%" keep-with-previous.within-line="always" vertical-align="super"> <!-- -->
|
607
|
-
<fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
|
608
|
-
<!-- <xsl:value-of select="@reference"/> -->
|
609
|
-
<xsl:value-of select="$number + count(//iho:bibitem[ancestor::iho:references[@normative='true']]/iho:note)"/>
|
610
|
-
</fo:basic-link>
|
611
|
-
</fo:inline>
|
612
|
-
<fo:footnote-body>
|
613
|
-
<fo:block font-size="10pt" margin-bottom="12pt">
|
614
|
-
<fo:inline id="footnote_{@reference}_{$number}" font-size="60%" vertical-align="super" keep-with-next.within-line="always" padding-right="1mm"> <!-- font-size="60%" alignment-baseline="hanging" -->
|
615
|
-
<xsl:value-of select="$number + count(//iho:bibitem[ancestor::iho:references[@normative='true']]/iho:note)"/>
|
616
|
-
</fo:inline>
|
617
|
-
<xsl:for-each select="iho:p">
|
618
|
-
<xsl:apply-templates/>
|
619
|
-
</xsl:for-each>
|
620
|
-
</fo:block>
|
621
|
-
</fo:footnote-body>
|
622
|
-
</fo:footnote>
|
623
|
-
</xsl:when>
|
624
|
-
<xsl:otherwise>
|
625
|
-
<fo:inline font-size="60%" keep-with-previous.within-line="always" vertical-align="super">
|
626
|
-
<fo:basic-link internal-destination="footnote_{@reference}_{$number}" fox:alt-text="footnote {@reference} {$number}">
|
627
|
-
<xsl:value-of select="$number + count(//iho:bibitem/iho:note)"/>
|
628
|
-
</fo:basic-link>
|
629
|
-
</fo:inline>
|
630
|
-
</xsl:otherwise>
|
631
|
-
</xsl:choose>
|
632
|
-
</xsl:template>
|
633
577
|
|
634
578
|
<xsl:template match="iho:p/iho:fn/iho:p">
|
635
579
|
<xsl:apply-templates/>
|
@@ -817,9 +761,10 @@
|
|
817
761
|
</xsl:variable>
|
818
762
|
<fo:block line-height="1.1" role="H{$levelTerm}">
|
819
763
|
<fo:block font-weight="bold" keep-with-next="always">
|
820
|
-
<xsl:apply-templates select="ancestor::iho:term/iho:name" mode="presentation"/>
|
764
|
+
<xsl:apply-templates select="ancestor::iho:term[1]/iho:name" mode="presentation"/>
|
821
765
|
</fo:block>
|
822
766
|
<fo:block font-weight="bold" keep-with-next="always">
|
767
|
+
<xsl:call-template name="setStyle_preferred"/>
|
823
768
|
<xsl:apply-templates/>
|
824
769
|
</fo:block>
|
825
770
|
</fo:block>
|
@@ -1536,6 +1481,78 @@
|
|
1536
1481
|
|
1537
1482
|
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
1538
1483
|
<xsl:attribute name="line-height">135%</xsl:attribute>
|
1484
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-style">
|
1485
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1486
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-num-style">
|
1487
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1488
|
+
|
1489
|
+
|
1490
|
+
|
1491
|
+
|
1492
|
+
|
1493
|
+
|
1494
|
+
|
1495
|
+
<xsl:attribute name="font-size">70%</xsl:attribute>
|
1496
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1497
|
+
|
1498
|
+
|
1499
|
+
|
1500
|
+
|
1501
|
+
|
1502
|
+
|
1503
|
+
|
1504
|
+
|
1505
|
+
|
1506
|
+
|
1507
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-style">
|
1508
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1509
|
+
<xsl:attribute name="font-style">normal</xsl:attribute>
|
1510
|
+
<xsl:attribute name="text-indent">0</xsl:attribute>
|
1511
|
+
<xsl:attribute name="start-indent">0</xsl:attribute>
|
1512
|
+
|
1513
|
+
|
1514
|
+
|
1515
|
+
|
1516
|
+
|
1517
|
+
|
1518
|
+
|
1519
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
1520
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1521
|
+
|
1522
|
+
|
1523
|
+
|
1524
|
+
|
1525
|
+
|
1526
|
+
|
1527
|
+
|
1528
|
+
|
1529
|
+
|
1530
|
+
|
1531
|
+
|
1532
|
+
|
1533
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
|
1534
|
+
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
1535
|
+
|
1536
|
+
|
1537
|
+
|
1538
|
+
|
1539
|
+
|
1540
|
+
|
1541
|
+
|
1542
|
+
<xsl:attribute name="font-size">60%</xsl:attribute>
|
1543
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1544
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
1545
|
+
|
1546
|
+
|
1547
|
+
|
1548
|
+
|
1549
|
+
|
1550
|
+
|
1551
|
+
|
1552
|
+
|
1553
|
+
|
1554
|
+
|
1555
|
+
|
1539
1556
|
</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">
|
1540
1557
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1541
1558
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1561,7 +1578,8 @@
|
|
1561
1578
|
<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"/>
|
1562
1579
|
|
1563
1580
|
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
1564
|
-
|
1581
|
+
|
1582
|
+
<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']]">
|
1565
1583
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1566
1584
|
<xsl:apply-templates select="." mode="contents"/>
|
1567
1585
|
</xsl:for-each>
|
@@ -1571,7 +1589,7 @@
|
|
1571
1589
|
<xsl:apply-templates select="." mode="contents"/>
|
1572
1590
|
</xsl:for-each>
|
1573
1591
|
|
1574
|
-
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1592
|
+
<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')]]">
|
1575
1593
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1576
1594
|
<xsl:apply-templates select="." mode="contents"/>
|
1577
1595
|
</xsl:for-each>
|
@@ -2476,6 +2494,102 @@
|
|
2476
2494
|
|
2477
2495
|
</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">
|
2478
2496
|
<xsl:apply-templates/>
|
2497
|
+
</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">
|
2498
|
+
|
2499
|
+
<!-- list of footnotes to calculate actual footnotes number -->
|
2500
|
+
<xsl:variable name="p_fn_">
|
2501
|
+
<xsl:choose>
|
2502
|
+
<xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
|
2503
|
+
<fn gen_id="{generate-id(.)}">
|
2504
|
+
<xsl:copy-of select="@*"/>
|
2505
|
+
<xsl:copy-of select="node()"/>
|
2506
|
+
</fn>
|
2507
|
+
</xsl:when>
|
2508
|
+
<xsl:otherwise>
|
2509
|
+
<!-- itetation for:
|
2510
|
+
footnotes in bibdata/title
|
2511
|
+
footnotes in bibliography
|
2512
|
+
footnotes in document's body (except table's head/body/foot and figure text)
|
2513
|
+
-->
|
2514
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
2515
|
+
<fn gen_id="{generate-id(.)}">
|
2516
|
+
<xsl:copy-of select="@*"/>
|
2517
|
+
<xsl:copy-of select="node()"/>
|
2518
|
+
</fn>
|
2519
|
+
</xsl:for-each>
|
2520
|
+
<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']/*">
|
2521
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2522
|
+
<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])]">
|
2523
|
+
<!-- copy unique fn -->
|
2524
|
+
<fn gen_id="{generate-id(.)}">
|
2525
|
+
<xsl:copy-of select="@*"/>
|
2526
|
+
<xsl:copy-of select="node()"/>
|
2527
|
+
</fn>
|
2528
|
+
</xsl:for-each>
|
2529
|
+
</xsl:for-each>
|
2530
|
+
</xsl:otherwise>
|
2531
|
+
</xsl:choose>
|
2532
|
+
</xsl:variable>
|
2533
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
2534
|
+
|
2535
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
2536
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
2537
|
+
<xsl:variable name="reference" select="@reference"/>
|
2538
|
+
<!-- fn sequence number in document -->
|
2539
|
+
<xsl:variable name="current_fn_number">
|
2540
|
+
<xsl:choose>
|
2541
|
+
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
2542
|
+
<xsl:otherwise>
|
2543
|
+
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
2544
|
+
</xsl:otherwise>
|
2545
|
+
</xsl:choose>
|
2546
|
+
</xsl:variable>
|
2547
|
+
<xsl:variable name="current_fn_number_text">
|
2548
|
+
<xsl:value-of select="$current_fn_number"/>
|
2549
|
+
|
2550
|
+
|
2551
|
+
</xsl:variable>
|
2552
|
+
|
2553
|
+
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
2554
|
+
<xsl:variable name="footnote_inline">
|
2555
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
2556
|
+
|
2557
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
2558
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2559
|
+
</fo:basic-link>
|
2560
|
+
</fo:inline>
|
2561
|
+
</xsl:variable>
|
2562
|
+
<!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
|
2563
|
+
gen_id=<xsl:value-of select="$gen_id"/> -->
|
2564
|
+
<xsl:choose>
|
2565
|
+
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
2566
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2567
|
+
</xsl:when>
|
2568
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
2569
|
+
<fo:footnote xsl:use-attribute-sets="fn-style">
|
2570
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2571
|
+
<fo:footnote-body>
|
2572
|
+
|
2573
|
+
<fo:block-container text-indent="0" start-indent="0">
|
2574
|
+
|
2575
|
+
|
2576
|
+
<fo:block xsl:use-attribute-sets="fn-body-style">
|
2577
|
+
|
2578
|
+
|
2579
|
+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
|
2580
|
+
|
2581
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2582
|
+
</fo:inline>
|
2583
|
+
<xsl:apply-templates/>
|
2584
|
+
</fo:block>
|
2585
|
+
</fo:block-container>
|
2586
|
+
</fo:footnote-body>
|
2587
|
+
</fo:footnote>
|
2588
|
+
</xsl:when>
|
2589
|
+
<xsl:otherwise>
|
2590
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2591
|
+
</xsl:otherwise>
|
2592
|
+
</xsl:choose>
|
2479
2593
|
</xsl:template><xsl:template name="fn_display">
|
2480
2594
|
<xsl:variable name="references">
|
2481
2595
|
|
@@ -2668,6 +2782,8 @@
|
|
2668
2782
|
|
2669
2783
|
</fo:basic-link>
|
2670
2784
|
</fo:inline>
|
2785
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
2786
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
2671
2787
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
2672
2788
|
<fo:inline>
|
2673
2789
|
<xsl:apply-templates/>
|
@@ -2971,6 +3087,7 @@
|
|
2971
3087
|
<fo:table-cell>
|
2972
3088
|
|
2973
3089
|
<fo:block margin-top="6pt">
|
3090
|
+
<xsl:copy-of select="@id"/>
|
2974
3091
|
|
2975
3092
|
|
2976
3093
|
<xsl:if test="normalize-space($key_iso) = 'true'">
|
@@ -3664,22 +3781,6 @@
|
|
3664
3781
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
3665
3782
|
<xsl:apply-templates/>
|
3666
3783
|
</fo:inline>
|
3667
|
-
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3668
|
-
<xsl:variable name="title-modified">
|
3669
|
-
|
3670
|
-
|
3671
|
-
<xsl:call-template name="getTitle">
|
3672
|
-
<xsl:with-param name="name" select="'title-modified'"/>
|
3673
|
-
</xsl:call-template>
|
3674
|
-
|
3675
|
-
</xsl:variable>
|
3676
|
-
|
3677
|
-
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3678
|
-
<xsl:choose>
|
3679
|
-
<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>
|
3680
|
-
<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>
|
3681
|
-
</xsl:choose>
|
3682
|
-
<xsl:apply-templates/>
|
3683
3784
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
3684
3785
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
3685
3786
|
|
@@ -3813,14 +3914,18 @@
|
|
3813
3914
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
|
3814
3915
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
3815
3916
|
</xsl:template><xsl:template match="*[local-name() = 'terms']">
|
3917
|
+
<!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
|
3816
3918
|
<fo:block id="{@id}">
|
3817
3919
|
<xsl:apply-templates/>
|
3818
3920
|
</fo:block>
|
3819
3921
|
</xsl:template><xsl:template match="*[local-name() = 'term']">
|
3922
|
+
<!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
|
3820
3923
|
<fo:block id="{@id}" xsl:use-attribute-sets="term-style">
|
3821
3924
|
|
3822
3925
|
|
3823
|
-
|
3926
|
+
<xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
|
3927
|
+
|
3928
|
+
</xsl:if>
|
3824
3929
|
<xsl:apply-templates/>
|
3825
3930
|
</fo:block>
|
3826
3931
|
</xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
|
@@ -4244,12 +4349,12 @@
|
|
4244
4349
|
</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">
|
4245
4350
|
<xsl:apply-templates mode="contents"/>
|
4246
4351
|
<xsl:text> </xsl:text>
|
4247
|
-
</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">
|
4352
|
+
</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">
|
4248
4353
|
<xsl:apply-templates mode="bookmarks"/>
|
4249
4354
|
<xsl:text> </xsl:text>
|
4250
4355
|
</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">
|
4251
4356
|
<xsl:value-of select="."/>
|
4252
|
-
</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">
|
4357
|
+
</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">
|
4253
4358
|
<xsl:value-of select="."/>
|
4254
4359
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4255
4360
|
<xsl:apply-templates mode="contents"/>
|
@@ -4519,6 +4624,8 @@
|
|
4519
4624
|
|
4520
4625
|
|
4521
4626
|
|
4627
|
+
|
4628
|
+
|
4522
4629
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4523
4630
|
<xsl:variable name="_font-size">
|
4524
4631
|
|
@@ -4552,13 +4659,17 @@
|
|
4552
4659
|
|
4553
4660
|
|
4554
4661
|
|
4662
|
+
|
4663
|
+
|
4555
4664
|
<xsl:apply-templates/>
|
4556
4665
|
</fo:block>
|
4557
|
-
|
4666
|
+
|
4558
4667
|
|
4559
4668
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4560
4669
|
|
4561
4670
|
|
4671
|
+
|
4672
|
+
|
4562
4673
|
</fo:block-container>
|
4563
4674
|
</fo:block-container>
|
4564
4675
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -4794,7 +4905,8 @@
|
|
4794
4905
|
</fo:block>
|
4795
4906
|
</fo:table-cell>
|
4796
4907
|
</xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
|
4797
|
-
<fo:block font-size="11pt"
|
4908
|
+
<fo:block font-size="11pt">
|
4909
|
+
|
4798
4910
|
<xsl:apply-templates/>
|
4799
4911
|
</fo:block>
|
4800
4912
|
</xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
|
@@ -4904,60 +5016,69 @@
|
|
4904
5016
|
<xsl:variable name="termsource_text">
|
4905
5017
|
<xsl:apply-templates/>
|
4906
5018
|
</xsl:variable>
|
4907
|
-
|
4908
|
-
<xsl:choose>
|
5019
|
+
<xsl:copy-of select="$termsource_text"/>
|
5020
|
+
<!-- <xsl:choose>
|
4909
5021
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
4910
|
-
<!-- <xsl:apply-templates /> -->
|
4911
5022
|
<xsl:copy-of select="$termsource_text"/>
|
4912
5023
|
</xsl:when>
|
4913
|
-
<xsl:otherwise>
|
4914
|
-
|
5024
|
+
<xsl:otherwise>
|
5025
|
+
<xsl:if test="$namespace = 'bsi'">
|
5026
|
+
<xsl:choose>
|
5027
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
|
5028
|
+
<xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
|
5029
|
+
</xsl:choose>
|
5030
|
+
</xsl:if>
|
5031
|
+
<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'">
|
4915
5032
|
<xsl:text>[</xsl:text>
|
4916
|
-
|
4917
|
-
<!-- <xsl:apply-templates /> -->
|
5033
|
+
</xsl:if>
|
4918
5034
|
<xsl:copy-of select="$termsource_text"/>
|
4919
|
-
|
5035
|
+
<xsl:if test="$namespace = 'bsi'">
|
5036
|
+
<xsl:choose>
|
5037
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
|
5038
|
+
<xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
|
5039
|
+
</xsl:choose>
|
5040
|
+
</xsl:if>
|
5041
|
+
<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'">
|
4920
5042
|
<xsl:text>]</xsl:text>
|
4921
|
-
|
5043
|
+
</xsl:if>
|
4922
5044
|
</xsl:otherwise>
|
4923
|
-
</xsl:choose>
|
5045
|
+
</xsl:choose> -->
|
4924
5046
|
</fo:block>
|
4925
5047
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
4926
5048
|
<xsl:if test="normalize-space() != ''">
|
4927
5049
|
<xsl:value-of select="."/>
|
4928
5050
|
</xsl:if>
|
4929
|
-
</xsl:template><xsl:
|
4930
|
-
<
|
4931
|
-
|
4932
|
-
|
4933
|
-
|
5051
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
|
5052
|
+
<fo:inline>
|
5053
|
+
|
5054
|
+
|
5055
|
+
<xsl:value-of select="."/>
|
5056
|
+
</fo:inline>
|
5057
|
+
</xsl:template><xsl:template match="*[local-name() = 'origin']">
|
4934
5058
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4935
5059
|
<xsl:if test="normalize-space(@citeas) = ''">
|
4936
5060
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4937
5061
|
</xsl:if>
|
4938
|
-
|
4939
|
-
|
4940
|
-
<fo:inline>
|
4941
|
-
|
4942
|
-
|
4943
|
-
|
4944
|
-
|
4945
|
-
|
4946
|
-
|
4947
|
-
|
4948
|
-
<xsl:call-template name="getTitle">
|
4949
|
-
<xsl:with-param name="name" select="'title-source'"/>
|
4950
|
-
</xsl:call-template>
|
4951
|
-
<xsl:text>: </xsl:text>
|
4952
|
-
|
4953
|
-
|
4954
|
-
</fo:inline>
|
4955
|
-
|
4956
5062
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
4957
5063
|
<xsl:apply-templates/>
|
4958
5064
|
</fo:inline>
|
5065
|
+
</fo:basic-link>
|
5066
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
5067
|
+
<xsl:variable name="title-modified">
|
4959
5068
|
|
4960
|
-
|
5069
|
+
|
5070
|
+
<xsl:call-template name="getTitle">
|
5071
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
5072
|
+
</xsl:call-template>
|
5073
|
+
|
5074
|
+
</xsl:variable>
|
5075
|
+
|
5076
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
5077
|
+
<xsl:choose>
|
5078
|
+
<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>
|
5079
|
+
<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>
|
5080
|
+
</xsl:choose>
|
5081
|
+
<xsl:apply-templates/>
|
4961
5082
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
4962
5083
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
4963
5084
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
|
@@ -5000,12 +5121,20 @@
|
|
5000
5121
|
</xsl:template><xsl:template match="*[local-name() = 'author']">
|
5001
5122
|
<xsl:text>— </xsl:text>
|
5002
5123
|
<xsl:apply-templates/>
|
5003
|
-
</xsl:template><xsl:
|
5124
|
+
</xsl:template><xsl:variable name="bibitem_hidden_">
|
5125
|
+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
|
5126
|
+
<xsl:copy-of select="."/>
|
5127
|
+
</xsl:for-each>
|
5128
|
+
<xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
|
5129
|
+
<xsl:copy-of select="."/>
|
5130
|
+
</xsl:for-each>
|
5131
|
+
</xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
|
5004
5132
|
|
5005
5133
|
<xsl:variable name="bibitemid">
|
5006
5134
|
<xsl:choose>
|
5007
|
-
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"
|
5008
|
-
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"
|
5135
|
+
<!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
|
5136
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
|
5137
|
+
<xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
5009
5138
|
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
5010
5139
|
</xsl:choose>
|
5011
5140
|
</xsl:variable>
|
@@ -5098,10 +5227,10 @@
|
|
5098
5227
|
</xsl:choose>
|
5099
5228
|
</xsl:variable>
|
5100
5229
|
|
5101
|
-
<xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
|
5230
|
+
<!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
|
5102
5231
|
|
5103
5232
|
<xsl:choose>
|
5104
|
-
<xsl:when test="$
|
5233
|
+
<xsl:when test="$lang = 'zh'">
|
5105
5234
|
<fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
|
5106
5235
|
</xsl:when>
|
5107
5236
|
<xsl:when test="../../@inline-header = 'true'">
|
@@ -5135,24 +5264,29 @@
|
|
5135
5264
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
5136
5265
|
<xsl:variable name="title-deprecated">
|
5137
5266
|
|
5138
|
-
|
5139
|
-
|
5140
|
-
<xsl:with-param name="name" select="'title-deprecated'"/>
|
5267
|
+
<xsl:call-template name="getLocalizedString">
|
5268
|
+
<xsl:with-param name="key">deprecated</xsl:with-param>
|
5141
5269
|
</xsl:call-template>
|
5142
5270
|
|
5271
|
+
|
5143
5272
|
</xsl:variable>
|
5144
5273
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
5145
5274
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
5146
5275
|
</fo:block>
|
5276
|
+
</xsl:template><xsl:template name="setStyle_preferred">
|
5277
|
+
<xsl:if test="*[local-name() = 'strong']">
|
5278
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
5279
|
+
</xsl:if>
|
5147
5280
|
</xsl:template><xsl:template match="*[local-name() = 'definition']">
|
5148
5281
|
<fo:block xsl:use-attribute-sets="definition-style">
|
5149
5282
|
<xsl:apply-templates/>
|
5150
5283
|
</fo:block>
|
5151
5284
|
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
|
5152
5285
|
<xsl:apply-templates/>
|
5153
|
-
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
|
5286
|
+
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
|
5154
5287
|
<fo:inline> <xsl:apply-templates/></fo:inline>
|
5155
|
-
<fo:block
|
5288
|
+
<!-- <fo:block> </fo:block> -->
|
5289
|
+
<fo:block/>
|
5156
5290
|
</xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
|
5157
5291
|
|
5158
5292
|
<fo:block>
|
@@ -5645,7 +5779,31 @@
|
|
5645
5779
|
<fo:block-container border="1pt solid black" width="50%">
|
5646
5780
|
<fo:block> </fo:block>
|
5647
5781
|
</fo:block-container>
|
5648
|
-
</xsl:template><xsl:
|
5782
|
+
</xsl:template><xsl:variable name="toc_level">
|
5783
|
+
<xsl:choose>
|
5784
|
+
<xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
|
5785
|
+
<xsl:otherwise><!-- default value -->
|
5786
|
+
|
5787
|
+
|
5788
|
+
|
5789
|
+
|
5790
|
+
|
5791
|
+
|
5792
|
+
2
|
5793
|
+
|
5794
|
+
|
5795
|
+
|
5796
|
+
|
5797
|
+
|
5798
|
+
|
5799
|
+
|
5800
|
+
|
5801
|
+
|
5802
|
+
|
5803
|
+
|
5804
|
+
</xsl:otherwise>
|
5805
|
+
</xsl:choose>
|
5806
|
+
</xsl:variable><xsl:template match="*[local-name() = 'toc']">
|
5649
5807
|
<xsl:param name="colwidths"/>
|
5650
5808
|
<xsl:variable name="colwidths_">
|
5651
5809
|
<xsl:choose>
|
@@ -6180,12 +6338,15 @@
|
|
6180
6338
|
<xsl:param name="default">left</xsl:param>
|
6181
6339
|
<xsl:attribute name="text-align">
|
6182
6340
|
<xsl:choose>
|
6183
|
-
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6341
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
6184
6342
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
6185
6343
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
6186
6344
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
6187
6345
|
</xsl:choose>
|
6188
6346
|
</xsl:attribute>
|
6347
|
+
<xsl:if test="@align = 'indent'">
|
6348
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
6349
|
+
</xsl:if>
|
6189
6350
|
</xsl:template><xsl:template name="number-to-words">
|
6190
6351
|
<xsl:param name="number"/>
|
6191
6352
|
<xsl:param name="first"/>
|
@@ -6282,4 +6443,14 @@
|
|
6282
6443
|
</xsl:otherwise>
|
6283
6444
|
</xsl:choose>
|
6284
6445
|
</xsl:if>
|
6446
|
+
</xsl:template><xsl:template name="setAltText">
|
6447
|
+
<xsl:param name="value"/>
|
6448
|
+
<xsl:attribute name="fox:alt-text">
|
6449
|
+
<xsl:choose>
|
6450
|
+
<xsl:when test="normalize-space($value) != ''">
|
6451
|
+
<xsl:value-of select="$value"/>
|
6452
|
+
</xsl:when>
|
6453
|
+
<xsl:otherwise>_</xsl:otherwise>
|
6454
|
+
</xsl:choose>
|
6455
|
+
</xsl:attribute>
|
6285
6456
|
</xsl:template></xsl:stylesheet>
|