metanorma-iho 0.4.1 → 0.4.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/iho/converter.rb +1 -1
- data/lib/asciidoctor/iho/isodoc.rng +61 -18
- data/lib/isodoc/iho/html/htmlstyle.css +25 -12
- data/lib/isodoc/iho/html/htmlstyle.scss +16 -11
- data/lib/isodoc/iho/html/scripts.html +0 -1
- data/lib/isodoc/iho/html/wordstyle.css +30 -18
- data/lib/isodoc/iho/html/wordstyle.scss +30 -18
- data/lib/isodoc/iho/iho.specification.xsl +330 -123
- data/lib/isodoc/iho/iho.standard.xsl +330 -123
- 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>
|
@@ -467,7 +466,7 @@
|
|
467
466
|
</fo:block>
|
468
467
|
</xsl:template>
|
469
468
|
|
470
|
-
<xsl:template match="iho:title">
|
469
|
+
<xsl:template match="iho:title" name="title">
|
471
470
|
|
472
471
|
<xsl:variable name="level">
|
473
472
|
<xsl:call-template name="getLevel"/>
|
@@ -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/>
|
@@ -820,6 +764,7 @@
|
|
820
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>
|
@@ -875,7 +820,9 @@
|
|
875
820
|
|
876
821
|
<xsl:template name="getListItemFormat">
|
877
822
|
<xsl:choose>
|
878
|
-
<xsl:when test="local-name(..) = 'ul'"
|
823
|
+
<xsl:when test="local-name(..) = 'ul'">
|
824
|
+
<xsl:call-template name="setULLabel"/>
|
825
|
+
</xsl:when>
|
879
826
|
<xsl:otherwise> <!-- for ordered lists -->
|
880
827
|
<xsl:choose>
|
881
828
|
<xsl:when test="../@type = 'arabic'">
|
@@ -1536,6 +1483,78 @@
|
|
1536
1483
|
|
1537
1484
|
</xsl:attribute-set><xsl:attribute-set name="toc-style">
|
1538
1485
|
<xsl:attribute name="line-height">135%</xsl:attribute>
|
1486
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-style">
|
1487
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1488
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-num-style">
|
1489
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
1490
|
+
|
1491
|
+
|
1492
|
+
|
1493
|
+
|
1494
|
+
|
1495
|
+
|
1496
|
+
|
1497
|
+
<xsl:attribute name="font-size">70%</xsl:attribute>
|
1498
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1499
|
+
|
1500
|
+
|
1501
|
+
|
1502
|
+
|
1503
|
+
|
1504
|
+
|
1505
|
+
|
1506
|
+
|
1507
|
+
|
1508
|
+
|
1509
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-style">
|
1510
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
1511
|
+
<xsl:attribute name="font-style">normal</xsl:attribute>
|
1512
|
+
<xsl:attribute name="text-indent">0</xsl:attribute>
|
1513
|
+
<xsl:attribute name="start-indent">0</xsl:attribute>
|
1514
|
+
|
1515
|
+
|
1516
|
+
|
1517
|
+
|
1518
|
+
|
1519
|
+
|
1520
|
+
|
1521
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
1522
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
1523
|
+
|
1524
|
+
|
1525
|
+
|
1526
|
+
|
1527
|
+
|
1528
|
+
|
1529
|
+
|
1530
|
+
|
1531
|
+
|
1532
|
+
|
1533
|
+
|
1534
|
+
|
1535
|
+
</xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
|
1536
|
+
<xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
|
1537
|
+
|
1538
|
+
|
1539
|
+
|
1540
|
+
|
1541
|
+
|
1542
|
+
|
1543
|
+
|
1544
|
+
<xsl:attribute name="font-size">60%</xsl:attribute>
|
1545
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
1546
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
1547
|
+
|
1548
|
+
|
1549
|
+
|
1550
|
+
|
1551
|
+
|
1552
|
+
|
1553
|
+
|
1554
|
+
|
1555
|
+
|
1556
|
+
|
1557
|
+
|
1539
1558
|
</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
1559
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1541
1560
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1561,7 +1580,8 @@
|
|
1561
1580
|
<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
1581
|
|
1563
1582
|
</xsl:template><xsl:template name="processMainSectionsDefault_Contents">
|
1564
|
-
|
1583
|
+
|
1584
|
+
<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
1585
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1566
1586
|
<xsl:apply-templates select="." mode="contents"/>
|
1567
1587
|
</xsl:for-each>
|
@@ -1571,7 +1591,7 @@
|
|
1571
1591
|
<xsl:apply-templates select="." mode="contents"/>
|
1572
1592
|
</xsl:for-each>
|
1573
1593
|
|
1574
|
-
<xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
|
1594
|
+
<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
1595
|
<xsl:sort select="@displayorder" data-type="number"/>
|
1576
1596
|
<xsl:apply-templates select="." mode="contents"/>
|
1577
1597
|
</xsl:for-each>
|
@@ -2476,6 +2496,102 @@
|
|
2476
2496
|
|
2477
2497
|
</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
2498
|
<xsl:apply-templates/>
|
2499
|
+
</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">
|
2500
|
+
|
2501
|
+
<!-- list of footnotes to calculate actual footnotes number -->
|
2502
|
+
<xsl:variable name="p_fn_">
|
2503
|
+
<xsl:choose>
|
2504
|
+
<xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
|
2505
|
+
<fn gen_id="{generate-id(.)}">
|
2506
|
+
<xsl:copy-of select="@*"/>
|
2507
|
+
<xsl:copy-of select="node()"/>
|
2508
|
+
</fn>
|
2509
|
+
</xsl:when>
|
2510
|
+
<xsl:otherwise>
|
2511
|
+
<!-- itetation for:
|
2512
|
+
footnotes in bibdata/title
|
2513
|
+
footnotes in bibliography
|
2514
|
+
footnotes in document's body (except table's head/body/foot and figure text)
|
2515
|
+
-->
|
2516
|
+
<xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
|
2517
|
+
<fn gen_id="{generate-id(.)}">
|
2518
|
+
<xsl:copy-of select="@*"/>
|
2519
|
+
<xsl:copy-of select="node()"/>
|
2520
|
+
</fn>
|
2521
|
+
</xsl:for-each>
|
2522
|
+
<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']/*">
|
2523
|
+
<xsl:sort select="@displayorder" data-type="number"/>
|
2524
|
+
<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])]">
|
2525
|
+
<!-- copy unique fn -->
|
2526
|
+
<fn gen_id="{generate-id(.)}">
|
2527
|
+
<xsl:copy-of select="@*"/>
|
2528
|
+
<xsl:copy-of select="node()"/>
|
2529
|
+
</fn>
|
2530
|
+
</xsl:for-each>
|
2531
|
+
</xsl:for-each>
|
2532
|
+
</xsl:otherwise>
|
2533
|
+
</xsl:choose>
|
2534
|
+
</xsl:variable>
|
2535
|
+
<xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
|
2536
|
+
|
2537
|
+
<xsl:variable name="gen_id" select="generate-id(.)"/>
|
2538
|
+
<xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
|
2539
|
+
<xsl:variable name="reference" select="@reference"/>
|
2540
|
+
<!-- fn sequence number in document -->
|
2541
|
+
<xsl:variable name="current_fn_number">
|
2542
|
+
<xsl:choose>
|
2543
|
+
<xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
|
2544
|
+
<xsl:otherwise>
|
2545
|
+
<xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
|
2546
|
+
</xsl:otherwise>
|
2547
|
+
</xsl:choose>
|
2548
|
+
</xsl:variable>
|
2549
|
+
<xsl:variable name="current_fn_number_text">
|
2550
|
+
<xsl:value-of select="$current_fn_number"/>
|
2551
|
+
|
2552
|
+
|
2553
|
+
</xsl:variable>
|
2554
|
+
|
2555
|
+
<xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
|
2556
|
+
<xsl:variable name="footnote_inline">
|
2557
|
+
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
2558
|
+
|
2559
|
+
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
2560
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2561
|
+
</fo:basic-link>
|
2562
|
+
</fo:inline>
|
2563
|
+
</xsl:variable>
|
2564
|
+
<!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
|
2565
|
+
gen_id=<xsl:value-of select="$gen_id"/> -->
|
2566
|
+
<xsl:choose>
|
2567
|
+
<xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
|
2568
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2569
|
+
</xsl:when>
|
2570
|
+
<xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
|
2571
|
+
<fo:footnote xsl:use-attribute-sets="fn-style">
|
2572
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2573
|
+
<fo:footnote-body>
|
2574
|
+
|
2575
|
+
<fo:block-container text-indent="0" start-indent="0">
|
2576
|
+
|
2577
|
+
|
2578
|
+
<fo:block xsl:use-attribute-sets="fn-body-style">
|
2579
|
+
|
2580
|
+
|
2581
|
+
<fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
|
2582
|
+
|
2583
|
+
<xsl:value-of select="$current_fn_number_text"/>
|
2584
|
+
</fo:inline>
|
2585
|
+
<xsl:apply-templates/>
|
2586
|
+
</fo:block>
|
2587
|
+
</fo:block-container>
|
2588
|
+
</fo:footnote-body>
|
2589
|
+
</fo:footnote>
|
2590
|
+
</xsl:when>
|
2591
|
+
<xsl:otherwise>
|
2592
|
+
<xsl:copy-of select="$footnote_inline"/>
|
2593
|
+
</xsl:otherwise>
|
2594
|
+
</xsl:choose>
|
2479
2595
|
</xsl:template><xsl:template name="fn_display">
|
2480
2596
|
<xsl:variable name="references">
|
2481
2597
|
|
@@ -2668,6 +2784,8 @@
|
|
2668
2784
|
|
2669
2785
|
</fo:basic-link>
|
2670
2786
|
</fo:inline>
|
2787
|
+
</xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
|
2788
|
+
<fo:inline><xsl:value-of select="."/></fo:inline>
|
2671
2789
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
2672
2790
|
<fo:inline>
|
2673
2791
|
<xsl:apply-templates/>
|
@@ -3032,6 +3150,7 @@
|
|
3032
3150
|
</xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
|
3033
3151
|
<xsl:apply-templates/>
|
3034
3152
|
</xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
|
3153
|
+
<xsl:apply-templates select="@language"/>
|
3035
3154
|
<xsl:apply-templates/>
|
3036
3155
|
</xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
|
3037
3156
|
<fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
|
@@ -3665,22 +3784,6 @@
|
|
3665
3784
|
<xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
|
3666
3785
|
<xsl:apply-templates/>
|
3667
3786
|
</fo:inline>
|
3668
|
-
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
3669
|
-
<xsl:variable name="title-modified">
|
3670
|
-
|
3671
|
-
|
3672
|
-
<xsl:call-template name="getTitle">
|
3673
|
-
<xsl:with-param name="name" select="'title-modified'"/>
|
3674
|
-
</xsl:call-template>
|
3675
|
-
|
3676
|
-
</xsl:variable>
|
3677
|
-
|
3678
|
-
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
3679
|
-
<xsl:choose>
|
3680
|
-
<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>
|
3681
|
-
<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>
|
3682
|
-
</xsl:choose>
|
3683
|
-
<xsl:apply-templates/>
|
3684
3787
|
</xsl:template><xsl:template match="*[local-name() = 'xref']">
|
3685
3788
|
<fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
|
3686
3789
|
|
@@ -4249,12 +4352,12 @@
|
|
4249
4352
|
</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">
|
4250
4353
|
<xsl:apply-templates mode="contents"/>
|
4251
4354
|
<xsl:text> </xsl:text>
|
4252
|
-
</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">
|
4355
|
+
</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">
|
4253
4356
|
<xsl:apply-templates mode="bookmarks"/>
|
4254
4357
|
<xsl:text> </xsl:text>
|
4255
4358
|
</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">
|
4256
4359
|
<xsl:value-of select="."/>
|
4257
|
-
</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">
|
4360
|
+
</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">
|
4258
4361
|
<xsl:value-of select="."/>
|
4259
4362
|
</xsl:template><xsl:template match="node()" mode="contents">
|
4260
4363
|
<xsl:apply-templates mode="contents"/>
|
@@ -4524,6 +4627,8 @@
|
|
4524
4627
|
|
4525
4628
|
|
4526
4629
|
|
4630
|
+
|
4631
|
+
|
4527
4632
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4528
4633
|
<xsl:variable name="_font-size">
|
4529
4634
|
|
@@ -4557,13 +4662,17 @@
|
|
4557
4662
|
|
4558
4663
|
|
4559
4664
|
|
4665
|
+
|
4666
|
+
|
4560
4667
|
<xsl:apply-templates/>
|
4561
4668
|
</fo:block>
|
4562
|
-
|
4669
|
+
|
4563
4670
|
|
4564
4671
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4565
4672
|
|
4566
4673
|
|
4674
|
+
|
4675
|
+
|
4567
4676
|
</fo:block-container>
|
4568
4677
|
</fo:block-container>
|
4569
4678
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -4910,62 +5019,69 @@
|
|
4910
5019
|
<xsl:variable name="termsource_text">
|
4911
5020
|
<xsl:apply-templates/>
|
4912
5021
|
</xsl:variable>
|
4913
|
-
|
4914
|
-
<xsl:choose>
|
5022
|
+
<xsl:copy-of select="$termsource_text"/>
|
5023
|
+
<!-- <xsl:choose>
|
4915
5024
|
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
|
4916
|
-
<!-- <xsl:apply-templates /> -->
|
4917
5025
|
<xsl:copy-of select="$termsource_text"/>
|
4918
5026
|
</xsl:when>
|
4919
5027
|
<xsl:otherwise>
|
4920
|
-
|
4921
|
-
|
5028
|
+
<xsl:if test="$namespace = 'bsi'">
|
5029
|
+
<xsl:choose>
|
5030
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
|
5031
|
+
<xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
|
5032
|
+
</xsl:choose>
|
5033
|
+
</xsl:if>
|
5034
|
+
<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'">
|
4922
5035
|
<xsl:text>[</xsl:text>
|
4923
|
-
|
4924
|
-
<!-- <xsl:apply-templates /> -->
|
5036
|
+
</xsl:if>
|
4925
5037
|
<xsl:copy-of select="$termsource_text"/>
|
4926
|
-
|
4927
|
-
|
5038
|
+
<xsl:if test="$namespace = 'bsi'">
|
5039
|
+
<xsl:choose>
|
5040
|
+
<xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
|
5041
|
+
<xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
|
5042
|
+
</xsl:choose>
|
5043
|
+
</xsl:if>
|
5044
|
+
<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'">
|
4928
5045
|
<xsl:text>]</xsl:text>
|
4929
|
-
|
5046
|
+
</xsl:if>
|
4930
5047
|
</xsl:otherwise>
|
4931
|
-
</xsl:choose>
|
5048
|
+
</xsl:choose> -->
|
4932
5049
|
</fo:block>
|
4933
5050
|
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
|
4934
5051
|
<xsl:if test="normalize-space() != ''">
|
4935
5052
|
<xsl:value-of select="."/>
|
4936
5053
|
</xsl:if>
|
4937
|
-
</xsl:template><xsl:
|
4938
|
-
<
|
4939
|
-
|
4940
|
-
|
4941
|
-
|
5054
|
+
</xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
|
5055
|
+
<fo:inline>
|
5056
|
+
|
5057
|
+
|
5058
|
+
<xsl:value-of select="."/>
|
5059
|
+
</fo:inline>
|
5060
|
+
</xsl:template><xsl:template match="*[local-name() = 'origin']">
|
4942
5061
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4943
5062
|
<xsl:if test="normalize-space(@citeas) = ''">
|
4944
5063
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
|
4945
5064
|
</xsl:if>
|
4946
|
-
|
4947
|
-
|
4948
|
-
<fo:inline>
|
4949
|
-
|
4950
|
-
|
4951
|
-
|
4952
|
-
|
4953
|
-
|
4954
|
-
|
4955
|
-
|
4956
|
-
<xsl:call-template name="getTitle">
|
4957
|
-
<xsl:with-param name="name" select="'title-source'"/>
|
4958
|
-
</xsl:call-template>
|
4959
|
-
<xsl:text>: </xsl:text>
|
4960
|
-
|
4961
|
-
|
4962
|
-
</fo:inline>
|
4963
|
-
|
4964
5065
|
<fo:inline xsl:use-attribute-sets="origin-style">
|
4965
5066
|
<xsl:apply-templates/>
|
4966
5067
|
</fo:inline>
|
5068
|
+
</fo:basic-link>
|
5069
|
+
</xsl:template><xsl:template match="*[local-name() = 'modification']">
|
5070
|
+
<xsl:variable name="title-modified">
|
4967
5071
|
|
4968
|
-
|
5072
|
+
|
5073
|
+
<xsl:call-template name="getTitle">
|
5074
|
+
<xsl:with-param name="name" select="'title-modified'"/>
|
5075
|
+
</xsl:call-template>
|
5076
|
+
|
5077
|
+
</xsl:variable>
|
5078
|
+
|
5079
|
+
<xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
|
5080
|
+
<xsl:choose>
|
5081
|
+
<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>
|
5082
|
+
<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>
|
5083
|
+
</xsl:choose>
|
5084
|
+
<xsl:apply-templates/>
|
4969
5085
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
|
4970
5086
|
<fo:inline><xsl:apply-templates/></fo:inline>
|
4971
5087
|
</xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
|
@@ -5151,24 +5267,29 @@
|
|
5151
5267
|
</xsl:template><xsl:template match="*[local-name() = 'deprecates']">
|
5152
5268
|
<xsl:variable name="title-deprecated">
|
5153
5269
|
|
5154
|
-
|
5155
|
-
|
5156
|
-
<xsl:with-param name="name" select="'title-deprecated'"/>
|
5270
|
+
<xsl:call-template name="getLocalizedString">
|
5271
|
+
<xsl:with-param name="key">deprecated</xsl:with-param>
|
5157
5272
|
</xsl:call-template>
|
5158
5273
|
|
5274
|
+
|
5159
5275
|
</xsl:variable>
|
5160
5276
|
<fo:block xsl:use-attribute-sets="deprecates-style">
|
5161
5277
|
<xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
|
5162
5278
|
</fo:block>
|
5279
|
+
</xsl:template><xsl:template name="setStyle_preferred">
|
5280
|
+
<xsl:if test="*[local-name() = 'strong']">
|
5281
|
+
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
5282
|
+
</xsl:if>
|
5163
5283
|
</xsl:template><xsl:template match="*[local-name() = 'definition']">
|
5164
5284
|
<fo:block xsl:use-attribute-sets="definition-style">
|
5165
5285
|
<xsl:apply-templates/>
|
5166
5286
|
</fo:block>
|
5167
5287
|
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
|
5168
5288
|
<xsl:apply-templates/>
|
5169
|
-
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
|
5289
|
+
</xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
|
5170
5290
|
<fo:inline> <xsl:apply-templates/></fo:inline>
|
5171
|
-
<fo:block
|
5291
|
+
<!-- <fo:block> </fo:block> -->
|
5292
|
+
<fo:block/>
|
5172
5293
|
</xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
|
5173
5294
|
|
5174
5295
|
<fo:block>
|
@@ -5224,6 +5345,51 @@
|
|
5224
5345
|
</xsl:template><xsl:template match="*[local-name() = 'name']/text()">
|
5225
5346
|
<!-- 0xA0 to space replacement -->
|
5226
5347
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
|
5348
|
+
</xsl:template><xsl:variable name="ul_labels_">
|
5349
|
+
|
5350
|
+
|
5351
|
+
|
5352
|
+
|
5353
|
+
|
5354
|
+
|
5355
|
+
<label>—</label> <!-- em dash -->
|
5356
|
+
|
5357
|
+
|
5358
|
+
|
5359
|
+
|
5360
|
+
|
5361
|
+
|
5362
|
+
|
5363
|
+
|
5364
|
+
|
5365
|
+
|
5366
|
+
|
5367
|
+
|
5368
|
+
</xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
|
5369
|
+
<xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
|
5370
|
+
<xsl:variable name="list_level">
|
5371
|
+
<xsl:choose>
|
5372
|
+
<xsl:when test="$list_level_ <= 3"><xsl:value-of select="$list_level_"/></xsl:when>
|
5373
|
+
<xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
|
5374
|
+
</xsl:choose>
|
5375
|
+
</xsl:variable>
|
5376
|
+
<xsl:choose>
|
5377
|
+
<xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
|
5378
|
+
<xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
|
5379
|
+
</xsl:when>
|
5380
|
+
<xsl:when test="$list_level mod 3 = 0">
|
5381
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
|
5382
|
+
</xsl:when>
|
5383
|
+
<xsl:when test="$list_level mod 2 = 0">
|
5384
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
|
5385
|
+
</xsl:when>
|
5386
|
+
<xsl:otherwise>
|
5387
|
+
<xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
|
5388
|
+
</xsl:otherwise>
|
5389
|
+
</xsl:choose>
|
5390
|
+
</xsl:template><xsl:template match="label" mode="ul_labels">
|
5391
|
+
<xsl:copy-of select="@*[not(local-name() = 'level')]"/>
|
5392
|
+
<xsl:value-of select="."/>
|
5227
5393
|
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
|
5228
5394
|
<xsl:choose>
|
5229
5395
|
<xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
|
@@ -5661,7 +5827,31 @@
|
|
5661
5827
|
<fo:block-container border="1pt solid black" width="50%">
|
5662
5828
|
<fo:block> </fo:block>
|
5663
5829
|
</fo:block-container>
|
5664
|
-
</xsl:template><xsl:
|
5830
|
+
</xsl:template><xsl:variable name="toc_level">
|
5831
|
+
<xsl:choose>
|
5832
|
+
<xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
|
5833
|
+
<xsl:otherwise><!-- default value -->
|
5834
|
+
|
5835
|
+
|
5836
|
+
|
5837
|
+
|
5838
|
+
|
5839
|
+
|
5840
|
+
2
|
5841
|
+
|
5842
|
+
|
5843
|
+
|
5844
|
+
|
5845
|
+
|
5846
|
+
|
5847
|
+
|
5848
|
+
|
5849
|
+
|
5850
|
+
|
5851
|
+
|
5852
|
+
</xsl:otherwise>
|
5853
|
+
</xsl:choose>
|
5854
|
+
</xsl:variable><xsl:template match="*[local-name() = 'toc']">
|
5665
5855
|
<xsl:param name="colwidths"/>
|
5666
5856
|
<xsl:variable name="colwidths_">
|
5667
5857
|
<xsl:choose>
|
@@ -5752,6 +5942,10 @@
|
|
5752
5942
|
</svg>
|
5753
5943
|
</fo:instream-foreign-object>
|
5754
5944
|
</fo:inline>
|
5945
|
+
</xsl:template><xsl:template match="@language">
|
5946
|
+
<xsl:copy-of select="."/>
|
5947
|
+
</xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
|
5948
|
+
<xsl:call-template name="title"/>
|
5755
5949
|
</xsl:template><xsl:template name="convertDate">
|
5756
5950
|
<xsl:param name="date"/>
|
5757
5951
|
<xsl:param name="format" select="'short'"/>
|
@@ -6196,12 +6390,15 @@
|
|
6196
6390
|
<xsl:param name="default">left</xsl:param>
|
6197
6391
|
<xsl:attribute name="text-align">
|
6198
6392
|
<xsl:choose>
|
6199
|
-
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
6393
|
+
<xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
|
6200
6394
|
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
6201
6395
|
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
6202
6396
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
6203
6397
|
</xsl:choose>
|
6204
6398
|
</xsl:attribute>
|
6399
|
+
<xsl:if test="@align = 'indent'">
|
6400
|
+
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
6401
|
+
</xsl:if>
|
6205
6402
|
</xsl:template><xsl:template name="number-to-words">
|
6206
6403
|
<xsl:param name="number"/>
|
6207
6404
|
<xsl:param name="first"/>
|
@@ -6298,4 +6495,14 @@
|
|
6298
6495
|
</xsl:otherwise>
|
6299
6496
|
</xsl:choose>
|
6300
6497
|
</xsl:if>
|
6498
|
+
</xsl:template><xsl:template name="setAltText">
|
6499
|
+
<xsl:param name="value"/>
|
6500
|
+
<xsl:attribute name="fox:alt-text">
|
6501
|
+
<xsl:choose>
|
6502
|
+
<xsl:when test="normalize-space($value) != ''">
|
6503
|
+
<xsl:value-of select="$value"/>
|
6504
|
+
</xsl:when>
|
6505
|
+
<xsl:otherwise>_</xsl:otherwise>
|
6506
|
+
</xsl:choose>
|
6507
|
+
</xsl:attribute>
|
6301
6508
|
</xsl:template></xsl:stylesheet>
|