metanorma-nist 1.2.12 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +9 -32
- data/.gitignore +1 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/nist/biblio.rng +4 -6
- data/lib/asciidoctor/nist/isodoc.rng +235 -3
- data/lib/asciidoctor/nist/nist.rng +6 -0
- data/lib/isodoc/nist/html/htmlstyle.css +7 -0
- data/lib/isodoc/nist/html_convert.rb +0 -1
- data/lib/isodoc/nist/nist.csts.xsl +529 -296
- data/lib/isodoc/nist/nist.cswp.xsl +529 -296
- data/lib/isodoc/nist/nist.sp.xsl +540 -255
- data/lib/isodoc/nist/presentation_xml_convert.rb +1 -1
- data/lib/metanorma/nist/version.rb +1 -1
- data/metanorma-nist.gemspec +8 -8
- metadata +31 -30
data/lib/isodoc/nist/nist.sp.xsl
CHANGED
@@ -5,7 +5,9 @@
|
|
5
5
|
|
6
6
|
|
7
7
|
<xsl:param name="svg_images"/>
|
8
|
+
<xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
|
8
9
|
<xsl:variable name="images" select="document($svg_images)"/>
|
10
|
+
<xsl:param name="basepath"/>
|
9
11
|
|
10
12
|
|
11
13
|
|
@@ -86,7 +88,9 @@
|
|
86
88
|
</fo:simple-page-master>
|
87
89
|
</fo:layout-master-set>
|
88
90
|
|
89
|
-
<
|
91
|
+
<fo:declarations>
|
92
|
+
<xsl:call-template name="addPDFUAmeta"/>
|
93
|
+
</fo:declarations>
|
90
94
|
|
91
95
|
<xsl:call-template name="addBookmarks">
|
92
96
|
<xsl:with-param name="contents" select="$contents"/>
|
@@ -1470,7 +1474,7 @@
|
|
1470
1474
|
</fo:block>
|
1471
1475
|
</xsl:when>
|
1472
1476
|
<xsl:when test="ancestor-or-self::nist:annex and $level >= 2">
|
1473
|
-
<fo:block font-family="Arial" font-size="12pt" font-weight="bold"
|
1477
|
+
<fo:block font-family="Arial" font-size="12pt" font-weight="bold" margin-top="3pt" margin-bottom="12pt" keep-with-next="always"> <!-- text-align="center" -->
|
1474
1478
|
<xsl:apply-templates/>
|
1475
1479
|
</fo:block>
|
1476
1480
|
</xsl:when>
|
@@ -1545,6 +1549,7 @@
|
|
1545
1549
|
<fo:list-block>
|
1546
1550
|
<xsl:attribute name="space-after">
|
1547
1551
|
<xsl:choose>
|
1552
|
+
<xsl:when test="ancestor::nist:figure and not(following-sibling::*)">0pt</xsl:when>
|
1548
1553
|
<xsl:when test="$margin != ''"><xsl:value-of select="$margin"/></xsl:when>
|
1549
1554
|
<xsl:otherwise>12pt</xsl:otherwise>
|
1550
1555
|
</xsl:choose>
|
@@ -1681,7 +1686,8 @@
|
|
1681
1686
|
<fo:table-body>
|
1682
1687
|
<fo:table-row>
|
1683
1688
|
<fo:table-cell>
|
1684
|
-
<fo:block text-align="left" margin-left="7mm">
|
1689
|
+
<!-- <fo:block text-align="left" margin-left="7mm"> -->
|
1690
|
+
<fo:block text-align="center" margin-left="7mm">
|
1685
1691
|
<xsl:apply-templates/>
|
1686
1692
|
</fo:block>
|
1687
1693
|
</fo:table-cell>
|
@@ -1794,6 +1800,10 @@
|
|
1794
1800
|
</fo:block>
|
1795
1801
|
</xsl:template>
|
1796
1802
|
|
1803
|
+
<xsl:template match="nist:figure[@class='pseudocode']//nist:dd//nist:stem[count(ancestor::nist:dd/nist:p) = 1 and normalize-space(ancestor::nist:dd/nist:p/text()) = '']" priority="2">
|
1804
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
1805
|
+
</xsl:template>
|
1806
|
+
|
1797
1807
|
<xsl:template match="nist:dd//nist:stem[count(ancestor::nist:dd/nist:p) = 1 and normalize-space(ancestor::nist:dd/nist:p/text()) = '']">
|
1798
1808
|
<fo:block text-align="center">
|
1799
1809
|
<xsl:apply-templates/>
|
@@ -1806,6 +1816,37 @@
|
|
1806
1816
|
</fo:block>
|
1807
1817
|
</xsl:template>
|
1808
1818
|
|
1819
|
+
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']" priority="2">
|
1820
|
+
<fo:block-container id="{@id}" border="1pt solid black" background-color="rgb(230, 230, 230)" padding="1.5mm" space-before="6pt" space-after="6pt">
|
1821
|
+
<xsl:apply-templates/>
|
1822
|
+
</fo:block-container>
|
1823
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
1824
|
+
</xsl:template>
|
1825
|
+
|
1826
|
+
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name()='dl']" priority="2">
|
1827
|
+
<fo:block-container id="{@id}">
|
1828
|
+
<xsl:apply-templates/>
|
1829
|
+
</fo:block-container>
|
1830
|
+
</xsl:template>
|
1831
|
+
|
1832
|
+
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name()='dt']" priority="2">
|
1833
|
+
<fo:block>
|
1834
|
+
<xsl:if test="following-sibling::*[local-name()='dt'] or ancestor::*[local-name()='dd']/following-sibling::*[local-name()='dt']">
|
1835
|
+
<xsl:attribute name="margin-bottom">2pt</xsl:attribute>
|
1836
|
+
</xsl:if>
|
1837
|
+
<xsl:if test="preceding-sibling::*[local-name()='dt'] or ancestor::*[local-name()='dd']/preceding-sibling::*[local-name()='dt']">
|
1838
|
+
<xsl:attribute name="margin-top">2pt</xsl:attribute>
|
1839
|
+
</xsl:if>
|
1840
|
+
<xsl:apply-templates/>
|
1841
|
+
<fo:inline>: </fo:inline>
|
1842
|
+
<xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
|
1843
|
+
</fo:block>
|
1844
|
+
</xsl:template>
|
1845
|
+
|
1846
|
+
<xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name()='dd']/*[local-name()='p']" priority="2">
|
1847
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
1848
|
+
</xsl:template>
|
1849
|
+
|
1809
1850
|
<!-- <xsl:template match="nist:dl[@type = 'glossary']" priority="2">
|
1810
1851
|
<xsl:apply-templates />
|
1811
1852
|
</xsl:template>
|
@@ -2347,6 +2388,7 @@
|
|
2347
2388
|
|
2348
2389
|
|
2349
2390
|
|
2391
|
+
|
2350
2392
|
</xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
|
2351
2393
|
|
2352
2394
|
|
@@ -2587,203 +2629,237 @@
|
|
2587
2629
|
<xsl:call-template name="add-zero-spaces-java"/>
|
2588
2630
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
2589
2631
|
|
2590
|
-
<xsl:variable name="
|
2591
|
-
<xsl:call-template name="getSimpleTable"/>
|
2592
|
-
</xsl:variable>
|
2632
|
+
<xsl:variable name="table">
|
2593
2633
|
|
2594
|
-
|
2595
|
-
|
2596
|
-
|
2597
|
-
|
2598
|
-
<!-- <xsl:if test="$namespace = 'bipm'">
|
2599
|
-
<fo:block> </fo:block>
|
2600
|
-
</xsl:if> -->
|
2601
|
-
|
2602
|
-
<!-- $namespace = 'iso' or -->
|
2603
|
-
|
2604
|
-
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
2605
|
-
|
2606
|
-
|
2634
|
+
<xsl:variable name="simple-table">
|
2635
|
+
<xsl:call-template name="getSimpleTable"/>
|
2636
|
+
</xsl:variable>
|
2607
2637
|
|
2608
2638
|
|
2609
|
-
|
2610
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
2611
|
-
|
2612
|
-
<!-- <xsl:variable name="cols-count">
|
2613
|
-
<xsl:choose>
|
2614
|
-
<xsl:when test="*[local-name()='thead']">
|
2615
|
-
<xsl:call-template name="calculate-columns-numbers">
|
2616
|
-
<xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
2617
|
-
</xsl:call-template>
|
2618
|
-
</xsl:when>
|
2619
|
-
<xsl:otherwise>
|
2620
|
-
<xsl:call-template name="calculate-columns-numbers">
|
2621
|
-
<xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
|
2622
|
-
</xsl:call-template>
|
2623
|
-
</xsl:otherwise>
|
2624
|
-
</xsl:choose>
|
2625
|
-
</xsl:variable> -->
|
2626
|
-
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
2627
|
-
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
2628
|
-
|
2629
|
-
|
2630
|
-
|
2631
|
-
<xsl:variable name="colwidths">
|
2632
|
-
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
2633
|
-
<xsl:call-template name="calculate-column-widths">
|
2634
|
-
<xsl:with-param name="cols-count" select="$cols-count"/>
|
2635
|
-
<xsl:with-param name="table" select="$simple-table"/>
|
2636
|
-
</xsl:call-template>
|
2637
|
-
</xsl:if>
|
2638
|
-
</xsl:variable>
|
2639
|
-
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
2640
|
-
|
2641
|
-
<!-- <xsl:variable name="colwidths2">
|
2642
|
-
<xsl:call-template name="calculate-column-widths">
|
2643
|
-
<xsl:with-param name="cols-count" select="$cols-count"/>
|
2644
|
-
</xsl:call-template>
|
2645
|
-
</xsl:variable> -->
|
2646
|
-
|
2647
|
-
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
2648
|
-
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
2649
|
-
colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
|
2650
|
-
|
2651
|
-
<xsl:variable name="margin-left">
|
2652
|
-
<xsl:choose>
|
2653
|
-
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
2654
|
-
<xsl:otherwise>0</xsl:otherwise>
|
2655
|
-
</xsl:choose>
|
2656
|
-
</xsl:variable>
|
2657
|
-
|
2658
|
-
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
2659
2639
|
|
2660
2640
|
|
2661
|
-
<xsl:attribute name="space-after">6pt</xsl:attribute>
|
2662
2641
|
|
2663
|
-
|
2664
|
-
|
2665
|
-
|
2642
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
2643
|
+
<fo:block> </fo:block>
|
2644
|
+
</xsl:if> -->
|
2666
2645
|
|
2646
|
+
<!-- $namespace = 'iso' or -->
|
2667
2647
|
|
2668
|
-
<xsl:
|
2669
|
-
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
2670
|
-
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2671
|
-
</xsl:if>
|
2672
|
-
<xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
|
2673
|
-
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
2674
|
-
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
2675
|
-
</xsl:if>
|
2676
|
-
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
2648
|
+
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
2677
2649
|
|
2678
|
-
|
2650
|
+
|
2679
2651
|
|
2652
|
+
|
2680
2653
|
|
2654
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
2681
2655
|
|
2656
|
+
<!-- <xsl:variable name="cols-count">
|
2657
|
+
<xsl:choose>
|
2658
|
+
<xsl:when test="*[local-name()='thead']">
|
2659
|
+
<xsl:call-template name="calculate-columns-numbers">
|
2660
|
+
<xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
2661
|
+
</xsl:call-template>
|
2662
|
+
</xsl:when>
|
2663
|
+
<xsl:otherwise>
|
2664
|
+
<xsl:call-template name="calculate-columns-numbers">
|
2665
|
+
<xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
|
2666
|
+
</xsl:call-template>
|
2667
|
+
</xsl:otherwise>
|
2668
|
+
</xsl:choose>
|
2669
|
+
</xsl:variable> -->
|
2670
|
+
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
2671
|
+
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
2682
2672
|
|
2683
2673
|
|
2684
2674
|
|
2675
|
+
<xsl:variable name="colwidths">
|
2676
|
+
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
2677
|
+
<xsl:call-template name="calculate-column-widths">
|
2678
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
2679
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
2680
|
+
</xsl:call-template>
|
2681
|
+
</xsl:if>
|
2682
|
+
</xsl:variable>
|
2683
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
2685
2684
|
|
2686
|
-
<xsl:variable name="
|
2687
|
-
<
|
2688
|
-
|
2689
|
-
|
2690
|
-
|
2691
|
-
|
2692
|
-
|
2693
|
-
|
2694
|
-
|
2695
|
-
|
2685
|
+
<!-- <xsl:variable name="colwidths2">
|
2686
|
+
<xsl:call-template name="calculate-column-widths">
|
2687
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
2688
|
+
</xsl:call-template>
|
2689
|
+
</xsl:variable> -->
|
2690
|
+
|
2691
|
+
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
2692
|
+
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
2693
|
+
colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
|
2694
|
+
|
2695
|
+
<xsl:variable name="margin-left">
|
2696
|
+
<xsl:choose>
|
2697
|
+
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
2698
|
+
<xsl:otherwise>0</xsl:otherwise>
|
2699
|
+
</xsl:choose>
|
2700
|
+
</xsl:variable>
|
2701
|
+
|
2702
|
+
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
2696
2703
|
|
2697
2704
|
|
2705
|
+
<xsl:attribute name="space-after">6pt</xsl:attribute>
|
2698
2706
|
|
2707
|
+
|
2708
|
+
|
2709
|
+
|
2699
2710
|
|
2700
|
-
|
2701
|
-
|
2702
|
-
|
2703
2711
|
|
2704
|
-
|
2712
|
+
<xsl:if test="ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface']">
|
2713
|
+
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
2714
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
2715
|
+
</xsl:if>
|
2716
|
+
<xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
|
2717
|
+
<xsl:attribute name="font-family">Times New Roman</xsl:attribute>
|
2718
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
2719
|
+
</xsl:if>
|
2720
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
2705
2721
|
|
2706
|
-
|
2707
|
-
|
2708
|
-
|
2709
|
-
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
2722
|
+
|
2710
2723
|
|
2711
|
-
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
2712
|
-
<xsl:attribute name="{@name}">
|
2713
|
-
<xsl:value-of select="."/>
|
2714
|
-
</xsl:attribute>
|
2715
|
-
</xsl:for-each>
|
2716
2724
|
|
2717
|
-
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
2718
|
-
<xsl:if test="$isNoteOrFnExist = 'true'">
|
2719
|
-
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
2720
|
-
</xsl:if>
|
2721
2725
|
|
2722
|
-
<xsl:choose>
|
2723
|
-
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
2724
|
-
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
2725
|
-
<fo:table-column column-width="{@width}"/>
|
2726
|
-
</xsl:for-each>
|
2727
|
-
</xsl:when>
|
2728
|
-
<xsl:otherwise>
|
2729
|
-
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2730
|
-
<xsl:choose>
|
2731
|
-
<xsl:when test=". = 1 or . = 0">
|
2732
|
-
<fo:table-column column-width="proportional-column-width(2)"/>
|
2733
|
-
</xsl:when>
|
2734
|
-
<xsl:otherwise>
|
2735
|
-
<fo:table-column column-width="proportional-column-width({.})"/>
|
2736
|
-
</xsl:otherwise>
|
2737
|
-
</xsl:choose>
|
2738
|
-
</xsl:for-each>
|
2739
|
-
</xsl:otherwise>
|
2740
|
-
</xsl:choose>
|
2741
2726
|
|
2742
|
-
<xsl:choose>
|
2743
|
-
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
2744
|
-
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
2745
|
-
</xsl:when>
|
2746
|
-
<xsl:otherwise>
|
2747
|
-
<xsl:apply-templates/>
|
2748
|
-
</xsl:otherwise>
|
2749
|
-
</xsl:choose>
|
2750
2727
|
|
2751
|
-
</fo:table>
|
2752
|
-
|
2753
|
-
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
2754
|
-
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
2755
|
-
<xsl:call-template name="insertTableFooterInSeparateTable">
|
2756
|
-
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
2757
|
-
<xsl:with-param name="colwidths" select="$colwidths"/>
|
2758
|
-
<xsl:with-param name="colgroup" select="$colgroup"/>
|
2759
|
-
</xsl:call-template>
|
2760
|
-
</xsl:for-each>
|
2761
|
-
|
2762
|
-
<!-- insert footer as table -->
|
2763
|
-
<!-- <fo:table>
|
2764
|
-
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
2765
|
-
<xsl:attribute name="{@name}">
|
2766
|
-
<xsl:value-of select="."/>
|
2767
|
-
</xsl:attribute>
|
2768
|
-
</xsl:for-each>
|
2769
2728
|
|
2770
|
-
<xsl:
|
2729
|
+
<xsl:variable name="table_width">
|
2730
|
+
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
2731
|
+
100%
|
2732
|
+
|
2733
|
+
|
2734
|
+
</xsl:variable>
|
2735
|
+
|
2736
|
+
<xsl:variable name="table_attributes">
|
2737
|
+
<attribute name="table-layout">fixed</attribute>
|
2738
|
+
<attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
|
2739
|
+
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
2740
|
+
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
2741
|
+
|
2742
|
+
|
2743
|
+
|
2744
|
+
|
2745
|
+
|
2746
|
+
|
2747
|
+
|
2748
|
+
|
2749
|
+
|
2750
|
+
|
2751
|
+
</xsl:variable>
|
2752
|
+
|
2753
|
+
|
2754
|
+
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
2755
|
+
|
2756
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
2757
|
+
<xsl:attribute name="{@name}">
|
2758
|
+
<xsl:value-of select="."/>
|
2759
|
+
</xsl:attribute>
|
2760
|
+
</xsl:for-each>
|
2761
|
+
|
2762
|
+
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
2763
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
2764
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
2765
|
+
</xsl:if>
|
2766
|
+
|
2771
2767
|
<xsl:choose>
|
2772
|
-
<xsl:when test="
|
2773
|
-
<
|
2768
|
+
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
2769
|
+
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
2770
|
+
<fo:table-column column-width="{@width}"/>
|
2771
|
+
</xsl:for-each>
|
2774
2772
|
</xsl:when>
|
2775
2773
|
<xsl:otherwise>
|
2776
|
-
<
|
2774
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2775
|
+
<xsl:choose>
|
2776
|
+
<xsl:when test=". = 1 or . = 0">
|
2777
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
2778
|
+
</xsl:when>
|
2779
|
+
<xsl:otherwise>
|
2780
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
2781
|
+
</xsl:otherwise>
|
2782
|
+
</xsl:choose>
|
2783
|
+
</xsl:for-each>
|
2777
2784
|
</xsl:otherwise>
|
2778
2785
|
</xsl:choose>
|
2786
|
+
|
2787
|
+
<xsl:choose>
|
2788
|
+
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
2789
|
+
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
2790
|
+
</xsl:when>
|
2791
|
+
<xsl:otherwise>
|
2792
|
+
<xsl:apply-templates/>
|
2793
|
+
</xsl:otherwise>
|
2794
|
+
</xsl:choose>
|
2795
|
+
|
2796
|
+
</fo:table>
|
2797
|
+
|
2798
|
+
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
2799
|
+
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
2800
|
+
<xsl:call-template name="insertTableFooterInSeparateTable">
|
2801
|
+
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
2802
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
2803
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
2804
|
+
</xsl:call-template>
|
2779
2805
|
</xsl:for-each>
|
2780
|
-
|
2781
|
-
|
2782
|
-
|
2783
|
-
|
2784
|
-
|
2785
|
-
|
2786
|
-
|
2806
|
+
|
2807
|
+
<!-- insert footer as table -->
|
2808
|
+
<!-- <fo:table>
|
2809
|
+
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
2810
|
+
<xsl:attribute name="{@name}">
|
2811
|
+
<xsl:value-of select="."/>
|
2812
|
+
</xsl:attribute>
|
2813
|
+
</xsl:for-each>
|
2814
|
+
|
2815
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
2816
|
+
<xsl:choose>
|
2817
|
+
<xsl:when test=". = 1 or . = 0">
|
2818
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
2819
|
+
</xsl:when>
|
2820
|
+
<xsl:otherwise>
|
2821
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
2822
|
+
</xsl:otherwise>
|
2823
|
+
</xsl:choose>
|
2824
|
+
</xsl:for-each>
|
2825
|
+
</fo:table>-->
|
2826
|
+
|
2827
|
+
|
2828
|
+
|
2829
|
+
|
2830
|
+
|
2831
|
+
</fo:block-container>
|
2832
|
+
</xsl:variable>
|
2833
|
+
|
2834
|
+
|
2835
|
+
|
2836
|
+
<xsl:choose>
|
2837
|
+
<xsl:when test="@width">
|
2838
|
+
|
2839
|
+
<!-- centered table when table name is centered (see table-name-style) -->
|
2840
|
+
|
2841
|
+
<fo:table table-layout="fixed" width="100%">
|
2842
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
2843
|
+
<fo:table-column column-width="{@width}"/>
|
2844
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
2845
|
+
<fo:table-body>
|
2846
|
+
<fo:table-row>
|
2847
|
+
<fo:table-cell column-number="2">
|
2848
|
+
<fo:block><xsl:copy-of select="$table"/></fo:block>
|
2849
|
+
</fo:table-cell>
|
2850
|
+
</fo:table-row>
|
2851
|
+
</fo:table-body>
|
2852
|
+
</fo:table>
|
2853
|
+
|
2854
|
+
|
2855
|
+
|
2856
|
+
|
2857
|
+
</xsl:when>
|
2858
|
+
<xsl:otherwise>
|
2859
|
+
<xsl:copy-of select="$table"/>
|
2860
|
+
</xsl:otherwise>
|
2861
|
+
</xsl:choose>
|
2862
|
+
|
2787
2863
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
2788
2864
|
<xsl:if test="normalize-space() != ''">
|
2789
2865
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
@@ -2911,7 +2987,15 @@
|
|
2911
2987
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
2912
2988
|
<xsl:value-of select="@target"/>
|
2913
2989
|
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
2914
|
-
<xsl:variable name="
|
2990
|
+
<xsl:variable name="mathml">
|
2991
|
+
<xsl:for-each select="*">
|
2992
|
+
<xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
|
2993
|
+
<xsl:copy-of select="."/>
|
2994
|
+
</xsl:if>
|
2995
|
+
</xsl:for-each>
|
2996
|
+
</xsl:variable>
|
2997
|
+
|
2998
|
+
<xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
|
2915
2999
|
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
2916
3000
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
2917
3001
|
<xsl:param name="cols-count"/>
|
@@ -3624,7 +3708,7 @@
|
|
3624
3708
|
<xsl:with-param name="table" select="$html-table"/>
|
3625
3709
|
</xsl:call-template>
|
3626
3710
|
</xsl:variable>
|
3627
|
-
<!-- colwidths=<xsl:
|
3711
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
3628
3712
|
<xsl:variable name="maxlength_dt">
|
3629
3713
|
<xsl:call-template name="getMaxLength_dt"/>
|
3630
3714
|
</xsl:variable>
|
@@ -3653,13 +3737,22 @@
|
|
3653
3737
|
</xsl:when>
|
3654
3738
|
<xsl:otherwise>
|
3655
3739
|
<xsl:choose>
|
3740
|
+
<!-- to set width check most wide chars like `W` -->
|
3656
3741
|
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 2"> <!-- if dt contains short text like t90, a, etc -->
|
3657
|
-
<fo:table-column column-width="
|
3658
|
-
<fo:table-column column-width="
|
3742
|
+
<fo:table-column column-width="7%"/>
|
3743
|
+
<fo:table-column column-width="93%"/>
|
3744
|
+
</xsl:when>
|
3745
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 5"> <!-- if dt contains short text like ABC, etc -->
|
3746
|
+
<fo:table-column column-width="15%"/>
|
3747
|
+
<fo:table-column column-width="85%"/>
|
3659
3748
|
</xsl:when>
|
3660
|
-
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <=
|
3661
|
-
<fo:table-column column-width="
|
3662
|
-
<fo:table-column column-width="
|
3749
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 7"> <!-- if dt contains short text like ABCDEF, etc -->
|
3750
|
+
<fo:table-column column-width="20%"/>
|
3751
|
+
<fo:table-column column-width="80%"/>
|
3752
|
+
</xsl:when>
|
3753
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
|
3754
|
+
<fo:table-column column-width="25%"/>
|
3755
|
+
<fo:table-column column-width="75%"/>
|
3663
3756
|
</xsl:when>
|
3664
3757
|
<!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 1.7">
|
3665
3758
|
<fo:table-column column-width="60%"/>
|
@@ -3893,6 +3986,10 @@
|
|
3893
3986
|
<fo:inline font-size="10pt" color="red" text-decoration="line-through">
|
3894
3987
|
<xsl:apply-templates/>
|
3895
3988
|
</fo:inline>
|
3989
|
+
</xsl:template><xsl:template match="*[local-name()='hi']">
|
3990
|
+
<fo:inline background-color="yellow">
|
3991
|
+
<xsl:apply-templates/>
|
3992
|
+
</fo:inline>
|
3896
3993
|
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
3897
3994
|
<xsl:variable name="text" select="normalize-space(.)"/>
|
3898
3995
|
<fo:inline font-size="75%">
|
@@ -3982,6 +4079,10 @@
|
|
3982
4079
|
<xsl:param name="text" select="."/>
|
3983
4080
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
3984
4081
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1')"/>
|
4082
|
+
</xsl:template><xsl:template name="add-zero-spaces-link-java">
|
4083
|
+
<xsl:param name="text" select="."/>
|
4084
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
4085
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1')"/>
|
3985
4086
|
</xsl:template><xsl:template name="add-zero-spaces">
|
3986
4087
|
<xsl:param name="text" select="."/>
|
3987
4088
|
<xsl:variable name="zero-space-after-chars">-</xsl:variable>
|
@@ -4229,6 +4330,7 @@
|
|
4229
4330
|
<xsl:apply-templates select="." mode="mathml"/>
|
4230
4331
|
</xsl:variable>
|
4231
4332
|
<fo:instream-foreign-object fox:alt-text="Math">
|
4333
|
+
|
4232
4334
|
<!-- <xsl:copy-of select="."/> -->
|
4233
4335
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
4234
4336
|
</fo:instream-foreign-object>
|
@@ -4242,7 +4344,12 @@
|
|
4242
4344
|
<!-- replace start and end spaces to non-break space -->
|
4243
4345
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
|
4244
4346
|
</xsl:copy>
|
4245
|
-
</xsl:template><xsl:template match="
|
4347
|
+
</xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
|
4348
|
+
<xsl:copy>
|
4349
|
+
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
4350
|
+
</xsl:copy>
|
4351
|
+
<mathml:mspace width="0.5ex"/>
|
4352
|
+
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
4246
4353
|
<xsl:variable name="target">
|
4247
4354
|
<xsl:choose>
|
4248
4355
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
@@ -4263,7 +4370,10 @@
|
|
4263
4370
|
<fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
|
4264
4371
|
<xsl:choose>
|
4265
4372
|
<xsl:when test="normalize-space(.) = ''">
|
4266
|
-
<xsl:value-of select="$target"/>
|
4373
|
+
<!-- <xsl:value-of select="$target"/> -->
|
4374
|
+
<xsl:call-template name="add-zero-spaces-link-java">
|
4375
|
+
<xsl:with-param name="text" select="$target"/>
|
4376
|
+
</xsl:call-template>
|
4267
4377
|
</xsl:when>
|
4268
4378
|
<xsl:otherwise>
|
4269
4379
|
<xsl:apply-templates/>
|
@@ -4273,8 +4383,6 @@
|
|
4273
4383
|
</xsl:otherwise>
|
4274
4384
|
</xsl:choose>
|
4275
4385
|
</fo:inline>
|
4276
|
-
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
4277
|
-
<fo:inline id="{@id}"/>
|
4278
4386
|
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
4279
4387
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
4280
4388
|
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
@@ -4485,6 +4593,7 @@
|
|
4485
4593
|
<fo:block id="{@id}">
|
4486
4594
|
<xsl:apply-templates/>
|
4487
4595
|
</fo:block>
|
4596
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
4488
4597
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
|
4489
4598
|
<fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
|
4490
4599
|
<xsl:apply-templates/>
|
@@ -4498,6 +4607,9 @@
|
|
4498
4607
|
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
4499
4608
|
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
4500
4609
|
</xsl:when>
|
4610
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
4611
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
4612
|
+
</xsl:when>
|
4501
4613
|
<xsl:otherwise>
|
4502
4614
|
<xsl:value-of select="@src"/>
|
4503
4615
|
</xsl:otherwise>
|
@@ -4769,6 +4881,8 @@
|
|
4769
4881
|
<xsl:copy>
|
4770
4882
|
<xsl:apply-templates mode="contents_item"/>
|
4771
4883
|
</xsl:copy>
|
4884
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
|
4885
|
+
<xsl:copy-of select="."/>
|
4772
4886
|
</xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
|
4773
4887
|
<xsl:text> </xsl:text>
|
4774
4888
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
@@ -5099,10 +5213,11 @@
|
|
5099
5213
|
</xsl:choose>
|
5100
5214
|
|
5101
5215
|
</xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
|
5102
|
-
|
5216
|
+
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
5103
5217
|
<xsl:variable name="element">
|
5104
5218
|
block
|
5105
5219
|
|
5220
|
+
|
5106
5221
|
</xsl:variable>
|
5107
5222
|
<xsl:choose>
|
5108
5223
|
<xsl:when test="normalize-space($element) = 'block'">
|
@@ -5164,11 +5279,13 @@
|
|
5164
5279
|
</xsl:if>
|
5165
5280
|
</xsl:if>
|
5166
5281
|
|
5282
|
+
|
5167
5283
|
<fo:block-container margin-left="0mm">
|
5168
5284
|
|
5169
5285
|
<fo:block xsl:use-attribute-sets="quote-style">
|
5170
5286
|
<!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
|
5171
|
-
|
5287
|
+
|
5288
|
+
<xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
|
5172
5289
|
</fo:block>
|
5173
5290
|
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
5174
5291
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
@@ -5191,31 +5308,49 @@
|
|
5191
5308
|
<xsl:text>— </xsl:text>
|
5192
5309
|
<xsl:apply-templates/>
|
5193
5310
|
</xsl:template><xsl:template match="*[local-name() = 'eref']">
|
5194
|
-
|
5195
|
-
|
5196
|
-
|
5197
|
-
|
5198
|
-
|
5199
|
-
|
5200
|
-
|
5201
|
-
|
5202
|
-
|
5203
|
-
|
5204
|
-
|
5205
|
-
|
5206
|
-
|
5207
|
-
|
5208
|
-
|
5209
|
-
|
5210
|
-
|
5211
|
-
|
5212
|
-
|
5213
|
-
|
5214
|
-
|
5215
|
-
|
5216
|
-
|
5217
|
-
|
5218
|
-
|
5311
|
+
|
5312
|
+
<xsl:variable name="bibitemid">
|
5313
|
+
<xsl:choose>
|
5314
|
+
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
|
5315
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
5316
|
+
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
5317
|
+
</xsl:choose>
|
5318
|
+
</xsl:variable>
|
5319
|
+
|
5320
|
+
<xsl:choose>
|
5321
|
+
<xsl:when test="normalize-space($bibitemid) != ''">
|
5322
|
+
<fo:inline xsl:use-attribute-sets="eref-style">
|
5323
|
+
<xsl:if test="@type = 'footnote'">
|
5324
|
+
|
5325
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
5326
|
+
<xsl:attribute name="font-size">80%</xsl:attribute>
|
5327
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
5328
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
5329
|
+
|
5330
|
+
|
5331
|
+
</xsl:if>
|
5332
|
+
|
5333
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
5334
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
5335
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
5336
|
+
</xsl:if>
|
5337
|
+
<xsl:if test="@type = 'inline'">
|
5338
|
+
|
5339
|
+
|
5340
|
+
|
5341
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
5342
|
+
|
5343
|
+
</xsl:if>
|
5344
|
+
|
5345
|
+
<xsl:apply-templates/>
|
5346
|
+
</fo:basic-link>
|
5347
|
+
|
5348
|
+
</fo:inline>
|
5349
|
+
</xsl:when>
|
5350
|
+
<xsl:otherwise>
|
5351
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
5352
|
+
</xsl:otherwise>
|
5353
|
+
</xsl:choose>
|
5219
5354
|
</xsl:template><xsl:template match="*[local-name() = 'tab']">
|
5220
5355
|
<!-- zero-space char -->
|
5221
5356
|
<xsl:variable name="depth">
|
@@ -5400,6 +5535,153 @@
|
|
5400
5535
|
</fo:block>
|
5401
5536
|
</xsl:otherwise>
|
5402
5537
|
</xsl:choose>
|
5538
|
+
</xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
|
5539
|
+
<xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
|
5540
|
+
<bookmark><xsl:value-of select="@id"/></bookmark>
|
5541
|
+
</xsl:for-each>
|
5542
|
+
</xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
|
5543
|
+
<xsl:copy>
|
5544
|
+
<xsl:apply-templates select="@*|node()" mode="index_add_id"/>
|
5545
|
+
</xsl:copy>
|
5546
|
+
</xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
|
5547
|
+
<xsl:variable name="id">
|
5548
|
+
<xsl:call-template name="generateIndexXrefId"/>
|
5549
|
+
</xsl:variable>
|
5550
|
+
<xsl:copy> <!-- add id to xref -->
|
5551
|
+
<xsl:apply-templates select="@*" mode="index_add_id"/>
|
5552
|
+
<xsl:attribute name="id">
|
5553
|
+
<xsl:value-of select="$id"/>
|
5554
|
+
</xsl:attribute>
|
5555
|
+
<xsl:apply-templates mode="index_add_id"/>
|
5556
|
+
</xsl:copy>
|
5557
|
+
<!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
|
5558
|
+
<xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
|
5559
|
+
<xsl:if test="@to">
|
5560
|
+
<xsl:value-of select="$dash"/>
|
5561
|
+
<xsl:copy>
|
5562
|
+
<xsl:copy-of select="@*"/>
|
5563
|
+
<xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
|
5564
|
+
<xsl:attribute name="id">
|
5565
|
+
<xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
|
5566
|
+
</xsl:attribute>
|
5567
|
+
<xsl:apply-templates mode="index_add_id"/>
|
5568
|
+
</xsl:copy>
|
5569
|
+
</xsl:if>
|
5570
|
+
</xsl:template><xsl:template match="@*|node()" mode="index_update">
|
5571
|
+
<xsl:copy>
|
5572
|
+
<xsl:apply-templates select="@*|node()" mode="index_update"/>
|
5573
|
+
</xsl:copy>
|
5574
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
|
5575
|
+
<xsl:copy>
|
5576
|
+
<xsl:apply-templates select="@*" mode="index_update"/>
|
5577
|
+
<xsl:apply-templates select="node()[1]" mode="process_li_element"/>
|
5578
|
+
</xsl:copy>
|
5579
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
|
5580
|
+
<xsl:param name="element"/>
|
5581
|
+
<xsl:param name="remove" select="'false'"/>
|
5582
|
+
<xsl:param name="target"/>
|
5583
|
+
<!-- <node></node> -->
|
5584
|
+
<xsl:choose>
|
5585
|
+
<xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
|
5586
|
+
<!-- skip text (i.e. remove it) and process next element -->
|
5587
|
+
<!-- [removed_<xsl:value-of select="."/>] -->
|
5588
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
5589
|
+
<xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
|
5590
|
+
</xsl:apply-templates>
|
5591
|
+
</xsl:when>
|
5592
|
+
<xsl:when test="self::text()">
|
5593
|
+
<xsl:value-of select="."/>
|
5594
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
5595
|
+
</xsl:when>
|
5596
|
+
<xsl:when test="self::* and local-name(.) = 'xref'">
|
5597
|
+
<xsl:variable name="id" select="@id"/>
|
5598
|
+
<xsl:variable name="page" select="$index//item[@id = $id]"/>
|
5599
|
+
<xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
|
5600
|
+
<xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
|
5601
|
+
|
5602
|
+
<xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
|
5603
|
+
<xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
|
5604
|
+
|
5605
|
+
<xsl:choose>
|
5606
|
+
<!-- 2nd pass -->
|
5607
|
+
<!-- if page is equal to page for next and page is not the end of range -->
|
5608
|
+
<xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
|
5609
|
+
<!-- skip element (i.e. remove it) and remove next text ',' -->
|
5610
|
+
<!-- [removed_xref] -->
|
5611
|
+
|
5612
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
5613
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
5614
|
+
<xsl:with-param name="target">
|
5615
|
+
<xsl:choose>
|
5616
|
+
<xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
|
5617
|
+
<xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
|
5618
|
+
</xsl:choose>
|
5619
|
+
</xsl:with-param>
|
5620
|
+
</xsl:apply-templates>
|
5621
|
+
</xsl:when>
|
5622
|
+
|
5623
|
+
<xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
|
5624
|
+
<!-- remove xref -->
|
5625
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
5626
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
5627
|
+
</xsl:apply-templates>
|
5628
|
+
</xsl:when>
|
5629
|
+
|
5630
|
+
<xsl:otherwise>
|
5631
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
5632
|
+
<xsl:with-param name="target" select="$target"/>
|
5633
|
+
</xsl:apply-templates>
|
5634
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
5635
|
+
</xsl:otherwise>
|
5636
|
+
</xsl:choose>
|
5637
|
+
</xsl:when>
|
5638
|
+
<xsl:when test="self::* and local-name(.) = 'ul'">
|
5639
|
+
<!-- ul -->
|
5640
|
+
<xsl:apply-templates select="." mode="index_update"/>
|
5641
|
+
</xsl:when>
|
5642
|
+
<xsl:otherwise>
|
5643
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
5644
|
+
<xsl:with-param name="target" select="$target"/>
|
5645
|
+
</xsl:apply-templates>
|
5646
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
5647
|
+
</xsl:otherwise>
|
5648
|
+
</xsl:choose>
|
5649
|
+
</xsl:template><xsl:template match="@*|node()" mode="xref_copy">
|
5650
|
+
<xsl:param name="target"/>
|
5651
|
+
<xsl:copy>
|
5652
|
+
<xsl:apply-templates select="@*" mode="xref_copy"/>
|
5653
|
+
<xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
|
5654
|
+
<xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
|
5655
|
+
</xsl:if>
|
5656
|
+
<xsl:apply-templates select="node()" mode="xref_copy"/>
|
5657
|
+
</xsl:copy>
|
5658
|
+
</xsl:template><xsl:template name="generateIndexXrefId">
|
5659
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
5660
|
+
|
5661
|
+
<xsl:variable name="docid">
|
5662
|
+
<xsl:call-template name="getDocumentId"/>
|
5663
|
+
</xsl:variable>
|
5664
|
+
<xsl:variable name="item_number">
|
5665
|
+
<xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
|
5666
|
+
</xsl:variable>
|
5667
|
+
<xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
|
5668
|
+
<xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
|
5669
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
|
5670
|
+
<xsl:apply-templates/>
|
5671
|
+
<fo:block>
|
5672
|
+
<xsl:if test="following-sibling::*[local-name() = 'clause']">
|
5673
|
+
<fo:block> </fo:block>
|
5674
|
+
</xsl:if>
|
5675
|
+
</fo:block>
|
5676
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
|
5677
|
+
<xsl:apply-templates/>
|
5678
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
5679
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
5680
|
+
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
5681
|
+
<xsl:apply-templates/>
|
5682
|
+
</fo:block>
|
5683
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
5684
|
+
<fo:inline id="{@id}" font-size="1pt"/>
|
5403
5685
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
5404
5686
|
<!-- <row>
|
5405
5687
|
<date>05-07-2013</date>
|
@@ -5589,7 +5871,7 @@
|
|
5589
5871
|
<xsl:param name="charDelim" select="', '"/>
|
5590
5872
|
<xsl:choose>
|
5591
5873
|
<xsl:when test="$sorting = 'true' or $sorting = 'yes'">
|
5592
|
-
<xsl:for-each select="
|
5874
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
5593
5875
|
<xsl:sort data-type="text" order="ascending"/>
|
5594
5876
|
<xsl:call-template name="insertKeyword">
|
5595
5877
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
@@ -5598,7 +5880,7 @@
|
|
5598
5880
|
</xsl:for-each>
|
5599
5881
|
</xsl:when>
|
5600
5882
|
<xsl:otherwise>
|
5601
|
-
<xsl:for-each select="
|
5883
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
5602
5884
|
<xsl:call-template name="insertKeyword">
|
5603
5885
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
5604
5886
|
<xsl:with-param name="charDelim" select="$charDelim"/>
|
@@ -5615,68 +5897,71 @@
|
|
5615
5897
|
<xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
|
5616
5898
|
</xsl:choose>
|
5617
5899
|
</xsl:template><xsl:template name="addPDFUAmeta">
|
5618
|
-
<
|
5619
|
-
<
|
5620
|
-
|
5621
|
-
|
5622
|
-
|
5623
|
-
|
5624
|
-
|
5625
|
-
|
5626
|
-
|
5627
|
-
|
5628
|
-
|
5629
|
-
|
5900
|
+
<xsl:variable name="lang">
|
5901
|
+
<xsl:call-template name="getLang"/>
|
5902
|
+
</xsl:variable>
|
5903
|
+
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
5904
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
5905
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
5906
|
+
</pdf:dictionary>
|
5907
|
+
</pdf:catalog>
|
5908
|
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
5909
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
5910
|
+
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
5911
|
+
<!-- Dublin Core properties go here -->
|
5912
|
+
<dc:title>
|
5913
|
+
<xsl:variable name="title">
|
5914
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
5915
|
+
|
5916
|
+
<xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
|
5630
5917
|
|
5631
|
-
<xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
|
5632
5918
|
|
5633
5919
|
|
5634
5920
|
|
5635
5921
|
|
5636
5922
|
|
5637
|
-
</xsl:
|
5638
|
-
|
5639
|
-
|
5640
|
-
|
5641
|
-
|
5642
|
-
|
5643
|
-
|
5644
|
-
</xsl:
|
5645
|
-
</xsl:
|
5646
|
-
</
|
5647
|
-
|
5923
|
+
</xsl:for-each>
|
5924
|
+
</xsl:variable>
|
5925
|
+
<xsl:choose>
|
5926
|
+
<xsl:when test="normalize-space($title) != ''">
|
5927
|
+
<xsl:value-of select="$title"/>
|
5928
|
+
</xsl:when>
|
5929
|
+
<xsl:otherwise>
|
5930
|
+
<xsl:text> </xsl:text>
|
5931
|
+
</xsl:otherwise>
|
5932
|
+
</xsl:choose>
|
5933
|
+
</dc:title>
|
5934
|
+
<dc:creator>
|
5935
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
5648
5936
|
|
5649
5937
|
|
5650
5938
|
|
5651
|
-
<xsl:for-each select="
|
5939
|
+
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
5652
5940
|
<xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
|
5653
5941
|
<xsl:if test="position() != last()">; </xsl:if>
|
5654
5942
|
</xsl:for-each>
|
5655
5943
|
|
5656
|
-
</
|
5657
|
-
|
5658
|
-
|
5659
|
-
|
5660
|
-
|
5661
|
-
|
5662
|
-
|
5663
|
-
|
5664
|
-
|
5665
|
-
|
5666
|
-
|
5667
|
-
|
5668
|
-
|
5669
|
-
|
5670
|
-
|
5671
|
-
|
5672
|
-
|
5673
|
-
<
|
5674
|
-
|
5675
|
-
|
5676
|
-
|
5677
|
-
</rdf:RDF>
|
5678
|
-
</x:xmpmeta>
|
5679
|
-
</fo:declarations>
|
5944
|
+
</xsl:for-each>
|
5945
|
+
</dc:creator>
|
5946
|
+
<dc:description>
|
5947
|
+
<xsl:variable name="abstract">
|
5948
|
+
|
5949
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
5950
|
+
|
5951
|
+
|
5952
|
+
</xsl:variable>
|
5953
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
5954
|
+
</dc:description>
|
5955
|
+
<pdf:Keywords>
|
5956
|
+
<xsl:call-template name="insertKeywords"/>
|
5957
|
+
</pdf:Keywords>
|
5958
|
+
</rdf:Description>
|
5959
|
+
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
5960
|
+
<!-- XMP properties go here -->
|
5961
|
+
<xmp:CreatorTool/>
|
5962
|
+
</rdf:Description>
|
5963
|
+
</rdf:RDF>
|
5964
|
+
</x:xmpmeta>
|
5680
5965
|
</xsl:template><xsl:template name="getId">
|
5681
5966
|
<xsl:choose>
|
5682
5967
|
<xsl:when test="../@id">
|