metanorma-nist 1.2.10 → 1.2.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -2347,6 +2347,7 @@
2347
2347
 
2348
2348
 
2349
2349
 
2350
+
2350
2351
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
2351
2352
 
2352
2353
 
@@ -2457,6 +2458,7 @@
2457
2458
 
2458
2459
 
2459
2460
 
2461
+
2460
2462
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
2461
2463
 
2462
2464
 
@@ -2584,200 +2586,239 @@
2584
2586
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2585
2587
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
2586
2588
  <xsl:call-template name="add-zero-spaces-java"/>
2587
- </xsl:template><xsl:template match="*[local-name()='table']">
2589
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2588
2590
 
2589
- <xsl:variable name="simple-table">
2590
- <xsl:call-template name="getSimpleTable"/>
2591
- </xsl:variable>
2591
+ <xsl:variable name="table">
2592
2592
 
2593
-
2594
-
2595
-
2596
-
2597
- <!-- <xsl:if test="$namespace = 'bipm'">
2598
- <fo:block>&#xA0;</fo:block>
2599
- </xsl:if> -->
2600
-
2601
- <!-- $namespace = 'iso' or -->
2602
-
2603
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2604
-
2605
-
2593
+ <xsl:variable name="simple-table">
2594
+ <xsl:call-template name="getSimpleTable"/>
2595
+ </xsl:variable>
2606
2596
 
2607
2597
 
2608
-
2609
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2610
-
2611
- <!-- <xsl:variable name="cols-count">
2612
- <xsl:choose>
2613
- <xsl:when test="*[local-name()='thead']">
2614
- <xsl:call-template name="calculate-columns-numbers">
2615
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2616
- </xsl:call-template>
2617
- </xsl:when>
2618
- <xsl:otherwise>
2619
- <xsl:call-template name="calculate-columns-numbers">
2620
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2621
- </xsl:call-template>
2622
- </xsl:otherwise>
2623
- </xsl:choose>
2624
- </xsl:variable> -->
2625
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2626
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2627
-
2628
-
2629
-
2630
- <xsl:variable name="colwidths">
2631
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2632
- <xsl:call-template name="calculate-column-widths">
2633
- <xsl:with-param name="cols-count" select="$cols-count"/>
2634
- <xsl:with-param name="table" select="$simple-table"/>
2635
- </xsl:call-template>
2636
- </xsl:if>
2637
- </xsl:variable>
2638
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2639
-
2640
- <!-- <xsl:variable name="colwidths2">
2641
- <xsl:call-template name="calculate-column-widths">
2642
- <xsl:with-param name="cols-count" select="$cols-count"/>
2643
- </xsl:call-template>
2644
- </xsl:variable> -->
2645
-
2646
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2647
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
2648
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2649
-
2650
- <xsl:variable name="margin-left">
2651
- <xsl:choose>
2652
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2653
- <xsl:otherwise>0</xsl:otherwise>
2654
- </xsl:choose>
2655
- </xsl:variable>
2656
-
2657
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2658
2598
 
2659
2599
 
2660
- <xsl:attribute name="space-after">6pt</xsl:attribute>
2661
2600
 
2662
-
2663
-
2664
-
2601
+ <!-- <xsl:if test="$namespace = 'bipm'">
2602
+ <fo:block>&#xA0;</fo:block>
2603
+ </xsl:if> -->
2665
2604
 
2605
+ <!-- $namespace = 'iso' or -->
2666
2606
 
2667
- <xsl:if test="ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface']">
2668
- <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
2669
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2670
- </xsl:if>
2671
- <xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
2672
- <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
2673
- <xsl:attribute name="font-size">12pt</xsl:attribute>
2674
- </xsl:if>
2675
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2607
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2676
2608
 
2677
-
2609
+
2678
2610
 
2611
+
2679
2612
 
2613
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2680
2614
 
2615
+ <!-- <xsl:variable name="cols-count">
2616
+ <xsl:choose>
2617
+ <xsl:when test="*[local-name()='thead']">
2618
+ <xsl:call-template name="calculate-columns-numbers">
2619
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2620
+ </xsl:call-template>
2621
+ </xsl:when>
2622
+ <xsl:otherwise>
2623
+ <xsl:call-template name="calculate-columns-numbers">
2624
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2625
+ </xsl:call-template>
2626
+ </xsl:otherwise>
2627
+ </xsl:choose>
2628
+ </xsl:variable> -->
2629
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2630
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2681
2631
 
2682
2632
 
2683
2633
 
2634
+ <xsl:variable name="colwidths">
2635
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2636
+ <xsl:call-template name="calculate-column-widths">
2637
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2638
+ <xsl:with-param name="table" select="$simple-table"/>
2639
+ </xsl:call-template>
2640
+ </xsl:if>
2641
+ </xsl:variable>
2642
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2643
+
2644
+ <!-- <xsl:variable name="colwidths2">
2645
+ <xsl:call-template name="calculate-column-widths">
2646
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2647
+ </xsl:call-template>
2648
+ </xsl:variable> -->
2649
+
2650
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2651
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
2652
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2684
2653
 
2685
- <xsl:variable name="table_attributes">
2686
- <attribute name="table-layout">fixed</attribute>
2687
- <attribute name="width">100%</attribute>
2688
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2689
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2654
+ <xsl:variable name="margin-left">
2655
+ <xsl:choose>
2656
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2657
+ <xsl:otherwise>0</xsl:otherwise>
2658
+ </xsl:choose>
2659
+ </xsl:variable>
2660
+
2661
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2690
2662
 
2691
2663
 
2664
+ <xsl:attribute name="space-after">6pt</xsl:attribute>
2692
2665
 
2666
+
2667
+
2668
+
2693
2669
 
2694
-
2695
-
2696
-
2697
2670
 
2698
-
2671
+ <xsl:if test="ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface']">
2672
+ <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
2673
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2674
+ </xsl:if>
2675
+ <xsl:if test="not(ancestor::*[local-name()='annex'] or ancestor::*[local-name()='preface'])">
2676
+ <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
2677
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
2678
+ </xsl:if>
2679
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2699
2680
 
2700
- </xsl:variable>
2701
-
2702
-
2703
- <fo:table id="{@id}" table-omit-footer-at-break="true">
2681
+
2704
2682
 
2705
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2706
- <xsl:attribute name="{@name}">
2707
- <xsl:value-of select="."/>
2708
- </xsl:attribute>
2709
- </xsl:for-each>
2710
2683
 
2711
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2712
- <xsl:if test="$isNoteOrFnExist = 'true'">
2713
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2714
- </xsl:if>
2715
2684
 
2716
- <xsl:choose>
2717
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2718
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2719
- <fo:table-column column-width="{@width}"/>
2720
- </xsl:for-each>
2721
- </xsl:when>
2722
- <xsl:otherwise>
2723
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2724
- <xsl:choose>
2725
- <xsl:when test=". = 1 or . = 0">
2726
- <fo:table-column column-width="proportional-column-width(2)"/>
2727
- </xsl:when>
2728
- <xsl:otherwise>
2729
- <fo:table-column column-width="proportional-column-width({.})"/>
2730
- </xsl:otherwise>
2731
- </xsl:choose>
2732
- </xsl:for-each>
2733
- </xsl:otherwise>
2734
- </xsl:choose>
2735
2685
 
2736
- <xsl:choose>
2737
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2738
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2739
- </xsl:when>
2740
- <xsl:otherwise>
2741
- <xsl:apply-templates/>
2742
- </xsl:otherwise>
2743
- </xsl:choose>
2744
2686
 
2745
- </fo:table>
2746
-
2747
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2748
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2749
- <xsl:call-template name="insertTableFooterInSeparateTable">
2750
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
2751
- <xsl:with-param name="colwidths" select="$colwidths"/>
2752
- <xsl:with-param name="colgroup" select="$colgroup"/>
2753
- </xsl:call-template>
2754
- </xsl:for-each>
2755
-
2756
- <!-- insert footer as table -->
2757
- <!-- <fo:table>
2758
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2759
- <xsl:attribute name="{@name}">
2760
- <xsl:value-of select="."/>
2761
- </xsl:attribute>
2762
- </xsl:for-each>
2763
2687
 
2764
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2688
+ <xsl:variable name="table_width">
2689
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2690
+ 100%
2691
+
2692
+
2693
+ </xsl:variable>
2694
+
2695
+ <xsl:variable name="table_attributes">
2696
+ <attribute name="table-layout">fixed</attribute>
2697
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
2698
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2699
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2700
+
2701
+
2702
+
2703
+
2704
+
2705
+
2706
+
2707
+
2708
+
2709
+
2710
+ </xsl:variable>
2711
+
2712
+
2713
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
2714
+
2715
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2716
+ <xsl:attribute name="{@name}">
2717
+ <xsl:value-of select="."/>
2718
+ </xsl:attribute>
2719
+ </xsl:for-each>
2720
+
2721
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2722
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2723
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2724
+ </xsl:if>
2725
+
2726
+ <xsl:choose>
2727
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2728
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2729
+ <fo:table-column column-width="{@width}"/>
2730
+ </xsl:for-each>
2731
+ </xsl:when>
2732
+ <xsl:otherwise>
2733
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2734
+ <xsl:choose>
2735
+ <xsl:when test=". = 1 or . = 0">
2736
+ <fo:table-column column-width="proportional-column-width(2)"/>
2737
+ </xsl:when>
2738
+ <xsl:otherwise>
2739
+ <fo:table-column column-width="proportional-column-width({.})"/>
2740
+ </xsl:otherwise>
2741
+ </xsl:choose>
2742
+ </xsl:for-each>
2743
+ </xsl:otherwise>
2744
+ </xsl:choose>
2745
+
2765
2746
  <xsl:choose>
2766
- <xsl:when test=". = 1 or . = 0">
2767
- <fo:table-column column-width="proportional-column-width(2)"/>
2747
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2748
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2768
2749
  </xsl:when>
2769
2750
  <xsl:otherwise>
2770
- <fo:table-column column-width="proportional-column-width({.})"/>
2751
+ <xsl:apply-templates/>
2771
2752
  </xsl:otherwise>
2772
2753
  </xsl:choose>
2754
+
2755
+ </fo:table>
2756
+
2757
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2758
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2759
+ <xsl:call-template name="insertTableFooterInSeparateTable">
2760
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
2761
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2762
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2763
+ </xsl:call-template>
2773
2764
  </xsl:for-each>
2774
- </fo:table>-->
2775
-
2776
-
2777
-
2778
-
2779
-
2780
- </fo:block-container>
2765
+
2766
+ <!-- insert footer as table -->
2767
+ <!-- <fo:table>
2768
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2769
+ <xsl:attribute name="{@name}">
2770
+ <xsl:value-of select="."/>
2771
+ </xsl:attribute>
2772
+ </xsl:for-each>
2773
+
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>
2784
+ </fo:table>-->
2785
+
2786
+
2787
+
2788
+
2789
+
2790
+ </fo:block-container>
2791
+ </xsl:variable>
2792
+
2793
+
2794
+
2795
+ <xsl:choose>
2796
+ <xsl:when test="@width">
2797
+
2798
+ <!-- centered table when table name is centered (see table-name-style) -->
2799
+
2800
+ <fo:table table-layout="fixed" width="100%">
2801
+ <fo:table-column column-width="proportional-column-width(1)"/>
2802
+ <fo:table-column column-width="{@width}"/>
2803
+ <fo:table-column column-width="proportional-column-width(1)"/>
2804
+ <fo:table-body>
2805
+ <fo:table-row>
2806
+ <fo:table-cell column-number="2">
2807
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
2808
+ </fo:table-cell>
2809
+ </fo:table-row>
2810
+ </fo:table-body>
2811
+ </fo:table>
2812
+
2813
+
2814
+
2815
+
2816
+ </xsl:when>
2817
+ <xsl:otherwise>
2818
+ <xsl:copy-of select="$table"/>
2819
+ </xsl:otherwise>
2820
+ </xsl:choose>
2821
+
2781
2822
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2782
2823
  <xsl:if test="normalize-space() != ''">
2783
2824
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -2905,7 +2946,15 @@
2905
2946
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2906
2947
  <xsl:value-of select="@target"/>
2907
2948
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2908
- <xsl:variable name="math_text" select="normalize-space(.)"/>
2949
+ <xsl:variable name="mathml">
2950
+ <xsl:for-each select="*">
2951
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2952
+ <xsl:copy-of select="."/>
2953
+ </xsl:if>
2954
+ </xsl:for-each>
2955
+ </xsl:variable>
2956
+
2957
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2909
2958
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2910
2959
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2911
2960
  <xsl:param name="cols-count"/>
@@ -3618,7 +3667,7 @@
3618
3667
  <xsl:with-param name="table" select="$html-table"/>
3619
3668
  </xsl:call-template>
3620
3669
  </xsl:variable>
3621
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3670
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3622
3671
  <xsl:variable name="maxlength_dt">
3623
3672
  <xsl:call-template name="getMaxLength_dt"/>
3624
3673
  </xsl:variable>
@@ -3647,13 +3696,22 @@
3647
3696
  </xsl:when>
3648
3697
  <xsl:otherwise>
3649
3698
  <xsl:choose>
3699
+ <!-- to set width check most wide chars like `W` -->
3650
3700
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
3651
- <fo:table-column column-width="5%"/>
3652
- <fo:table-column column-width="95%"/>
3701
+ <fo:table-column column-width="7%"/>
3702
+ <fo:table-column column-width="93%"/>
3703
+ </xsl:when>
3704
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
3705
+ <fo:table-column column-width="15%"/>
3706
+ <fo:table-column column-width="85%"/>
3653
3707
  </xsl:when>
3654
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
3655
- <fo:table-column column-width="10%"/>
3656
- <fo:table-column column-width="90%"/>
3708
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
3709
+ <fo:table-column column-width="20%"/>
3710
+ <fo:table-column column-width="80%"/>
3711
+ </xsl:when>
3712
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
3713
+ <fo:table-column column-width="25%"/>
3714
+ <fo:table-column column-width="75%"/>
3657
3715
  </xsl:when>
3658
3716
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
3659
3717
  <fo:table-column column-width="60%"/>
@@ -3865,6 +3923,7 @@
3865
3923
 
3866
3924
 
3867
3925
 
3926
+
3868
3927
 
3869
3928
  </xsl:variable>
3870
3929
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -3878,10 +3937,18 @@
3878
3937
  </xsl:if>
3879
3938
  <xsl:apply-templates/>
3880
3939
  </fo:inline>
3940
+ </xsl:template><xsl:template match="*[local-name()='underline']">
3941
+ <fo:inline text-decoration="underline">
3942
+ <xsl:apply-templates/>
3943
+ </fo:inline>
3881
3944
  </xsl:template><xsl:template match="*[local-name()='del']">
3882
3945
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3883
3946
  <xsl:apply-templates/>
3884
3947
  </fo:inline>
3948
+ </xsl:template><xsl:template match="*[local-name()='hi']">
3949
+ <fo:inline background-color="yellow">
3950
+ <xsl:apply-templates/>
3951
+ </fo:inline>
3885
3952
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
3886
3953
  <xsl:variable name="text" select="normalize-space(.)"/>
3887
3954
  <fo:inline font-size="75%">
@@ -3971,6 +4038,10 @@
3971
4038
  <xsl:param name="text" select="."/>
3972
4039
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
3973
4040
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
4041
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
4042
+ <xsl:param name="text" select="."/>
4043
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4044
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
3974
4045
  </xsl:template><xsl:template name="add-zero-spaces">
3975
4046
  <xsl:param name="text" select="."/>
3976
4047
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -4218,6 +4289,7 @@
4218
4289
  <xsl:apply-templates select="." mode="mathml"/>
4219
4290
  </xsl:variable>
4220
4291
  <fo:instream-foreign-object fox:alt-text="Math">
4292
+
4221
4293
  <!-- <xsl:copy-of select="."/> -->
4222
4294
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4223
4295
  </fo:instream-foreign-object>
@@ -4231,7 +4303,12 @@
4231
4303
  <!-- replace start and end spaces to non-break space -->
4232
4304
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4233
4305
  </xsl:copy>
4234
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
4306
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4307
+ <xsl:copy>
4308
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
4309
+ </xsl:copy>
4310
+ <mathml:mspace width="0.5ex"/>
4311
+ </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">
4235
4312
  <xsl:variable name="target">
4236
4313
  <xsl:choose>
4237
4314
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -4252,7 +4329,10 @@
4252
4329
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
4253
4330
  <xsl:choose>
4254
4331
  <xsl:when test="normalize-space(.) = ''">
4255
- <xsl:value-of select="$target"/>
4332
+ <!-- <xsl:value-of select="$target"/> -->
4333
+ <xsl:call-template name="add-zero-spaces-link-java">
4334
+ <xsl:with-param name="text" select="$target"/>
4335
+ </xsl:call-template>
4256
4336
  </xsl:when>
4257
4337
  <xsl:otherwise>
4258
4338
  <xsl:apply-templates/>
@@ -4262,8 +4342,6 @@
4262
4342
  </xsl:otherwise>
4263
4343
  </xsl:choose>
4264
4344
  </fo:inline>
4265
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
4266
- <fo:inline id="{@id}"/>
4267
4345
  </xsl:template><xsl:template match="*[local-name()='appendix']">
4268
4346
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
4269
4347
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -4458,7 +4536,7 @@
4458
4536
  </xsl:if> -->
4459
4537
  </fo:inline>
4460
4538
  </xsl:if>
4461
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
4539
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
4462
4540
  <fo:block-container id="{@id}">
4463
4541
 
4464
4542
  <fo:block>
@@ -4474,6 +4552,7 @@
4474
4552
  <fo:block id="{@id}">
4475
4553
  <xsl:apply-templates/>
4476
4554
  </fo:block>
4555
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4477
4556
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
4478
4557
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
4479
4558
  <xsl:apply-templates/>
@@ -4696,6 +4775,12 @@
4696
4775
  <!-- <xsl:text> </xsl:text> -->
4697
4776
  </xsl:template><xsl:template name="getSection">
4698
4777
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4778
+ <!--
4779
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
4780
+ <xsl:value-of select="."/>
4781
+ </xsl:for-each>
4782
+ -->
4783
+
4699
4784
  </xsl:template><xsl:template name="getName">
4700
4785
  <xsl:choose>
4701
4786
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -4748,6 +4833,12 @@
4748
4833
  <xsl:copy>
4749
4834
  <xsl:apply-templates mode="contents_item"/>
4750
4835
  </xsl:copy>
4836
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
4837
+ <xsl:copy>
4838
+ <xsl:apply-templates mode="contents_item"/>
4839
+ </xsl:copy>
4840
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
4841
+ <xsl:copy-of select="."/>
4751
4842
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4752
4843
  <xsl:text> </xsl:text>
4753
4844
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -4773,6 +4864,7 @@
4773
4864
 
4774
4865
 
4775
4866
 
4867
+
4776
4868
 
4777
4869
 
4778
4870
  10
@@ -5077,10 +5169,11 @@
5077
5169
  </xsl:choose>
5078
5170
 
5079
5171
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
5080
-
5172
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
5081
5173
  <xsl:variable name="element">
5082
5174
  block
5083
5175
 
5176
+
5084
5177
  </xsl:variable>
5085
5178
  <xsl:choose>
5086
5179
  <xsl:when test="normalize-space($element) = 'block'">
@@ -5142,11 +5235,13 @@
5142
5235
  </xsl:if>
5143
5236
  </xsl:if>
5144
5237
 
5238
+
5145
5239
  <fo:block-container margin-left="0mm">
5146
5240
 
5147
5241
  <fo:block xsl:use-attribute-sets="quote-style">
5148
5242
  <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5149
- <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5243
+
5244
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5150
5245
  </fo:block>
5151
5246
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5152
5247
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5169,31 +5264,49 @@
5169
5264
  <xsl:text>— </xsl:text>
5170
5265
  <xsl:apply-templates/>
5171
5266
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
5172
- <fo:inline xsl:use-attribute-sets="eref-style">
5173
- <xsl:if test="@type = 'footnote'">
5174
-
5175
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5176
- <xsl:attribute name="font-size">80%</xsl:attribute>
5177
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5178
- <xsl:attribute name="vertical-align">super</xsl:attribute>
5179
-
5180
-
5181
- </xsl:if>
5182
-
5183
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5184
-
5185
- <xsl:if test="@type = 'inline'">
5186
-
5187
-
5188
-
5189
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
5190
-
5191
- </xsl:if>
5192
-
5193
-
5194
- <xsl:apply-templates/>
5195
- </fo:basic-link>
5196
- </fo:inline>
5267
+
5268
+ <xsl:variable name="bibitemid">
5269
+ <xsl:choose>
5270
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
5271
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
5272
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
5273
+ </xsl:choose>
5274
+ </xsl:variable>
5275
+
5276
+ <xsl:choose>
5277
+ <xsl:when test="normalize-space($bibitemid) != ''">
5278
+ <fo:inline xsl:use-attribute-sets="eref-style">
5279
+ <xsl:if test="@type = 'footnote'">
5280
+
5281
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5282
+ <xsl:attribute name="font-size">80%</xsl:attribute>
5283
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5284
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
5285
+
5286
+
5287
+ </xsl:if>
5288
+
5289
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5290
+ <xsl:if test="normalize-space(@citeas) = ''">
5291
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
5292
+ </xsl:if>
5293
+ <xsl:if test="@type = 'inline'">
5294
+
5295
+
5296
+
5297
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
5298
+
5299
+ </xsl:if>
5300
+
5301
+ <xsl:apply-templates/>
5302
+ </fo:basic-link>
5303
+
5304
+ </fo:inline>
5305
+ </xsl:when>
5306
+ <xsl:otherwise>
5307
+ <fo:inline><xsl:apply-templates/></fo:inline>
5308
+ </xsl:otherwise>
5309
+ </xsl:choose>
5197
5310
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
5198
5311
  <!-- zero-space char -->
5199
5312
  <xsl:variable name="depth">
@@ -5300,6 +5413,7 @@
5300
5413
 
5301
5414
 
5302
5415
 
5416
+
5303
5417
 
5304
5418
 
5305
5419
 
@@ -5315,7 +5429,7 @@
5315
5429
  </xsl:if>
5316
5430
 
5317
5431
 
5318
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
5432
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
5319
5433
  <fo:block break-after="page"/>
5320
5434
  <fo:block>
5321
5435
  <xsl:call-template name="setId"/>
@@ -5323,7 +5437,8 @@
5323
5437
  </fo:block>
5324
5438
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
5325
5439
  <fo:block>
5326
- <xsl:call-template name="setId"/>
5440
+ <xsl:call-template name="setId"/>
5441
+
5327
5442
 
5328
5443
  <xsl:apply-templates/>
5329
5444
  </fo:block>
@@ -5376,6 +5491,153 @@
5376
5491
  </fo:block>
5377
5492
  </xsl:otherwise>
5378
5493
  </xsl:choose>
5494
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
5495
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
5496
+ <bookmark><xsl:value-of select="@id"/></bookmark>
5497
+ </xsl:for-each>
5498
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
5499
+ <xsl:copy>
5500
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
5501
+ </xsl:copy>
5502
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
5503
+ <xsl:variable name="id">
5504
+ <xsl:call-template name="generateIndexXrefId"/>
5505
+ </xsl:variable>
5506
+ <xsl:copy> <!-- add id to xref -->
5507
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
5508
+ <xsl:attribute name="id">
5509
+ <xsl:value-of select="$id"/>
5510
+ </xsl:attribute>
5511
+ <xsl:apply-templates mode="index_add_id"/>
5512
+ </xsl:copy>
5513
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
5514
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
5515
+ <xsl:if test="@to">
5516
+ <xsl:value-of select="$dash"/>
5517
+ <xsl:copy>
5518
+ <xsl:copy-of select="@*"/>
5519
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
5520
+ <xsl:attribute name="id">
5521
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
5522
+ </xsl:attribute>
5523
+ <xsl:apply-templates mode="index_add_id"/>
5524
+ </xsl:copy>
5525
+ </xsl:if>
5526
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
5527
+ <xsl:copy>
5528
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
5529
+ </xsl:copy>
5530
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
5531
+ <xsl:copy>
5532
+ <xsl:apply-templates select="@*" mode="index_update"/>
5533
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
5534
+ </xsl:copy>
5535
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
5536
+ <xsl:param name="element"/>
5537
+ <xsl:param name="remove" select="'false'"/>
5538
+ <xsl:param name="target"/>
5539
+ <!-- <node></node> -->
5540
+ <xsl:choose>
5541
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
5542
+ <!-- skip text (i.e. remove it) and process next element -->
5543
+ <!-- [removed_<xsl:value-of select="."/>] -->
5544
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5545
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
5546
+ </xsl:apply-templates>
5547
+ </xsl:when>
5548
+ <xsl:when test="self::text()">
5549
+ <xsl:value-of select="."/>
5550
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5551
+ </xsl:when>
5552
+ <xsl:when test="self::* and local-name(.) = 'xref'">
5553
+ <xsl:variable name="id" select="@id"/>
5554
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
5555
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
5556
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
5557
+
5558
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
5559
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
5560
+
5561
+ <xsl:choose>
5562
+ <!-- 2nd pass -->
5563
+ <!-- if page is equal to page for next and page is not the end of range -->
5564
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
5565
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
5566
+ <!-- [removed_xref] -->
5567
+
5568
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5569
+ <xsl:with-param name="remove">true</xsl:with-param>
5570
+ <xsl:with-param name="target">
5571
+ <xsl:choose>
5572
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
5573
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
5574
+ </xsl:choose>
5575
+ </xsl:with-param>
5576
+ </xsl:apply-templates>
5577
+ </xsl:when>
5578
+
5579
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
5580
+ <!-- remove xref -->
5581
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5582
+ <xsl:with-param name="remove">true</xsl:with-param>
5583
+ </xsl:apply-templates>
5584
+ </xsl:when>
5585
+
5586
+ <xsl:otherwise>
5587
+ <xsl:apply-templates select="." mode="xref_copy">
5588
+ <xsl:with-param name="target" select="$target"/>
5589
+ </xsl:apply-templates>
5590
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5591
+ </xsl:otherwise>
5592
+ </xsl:choose>
5593
+ </xsl:when>
5594
+ <xsl:when test="self::* and local-name(.) = 'ul'">
5595
+ <!-- ul -->
5596
+ <xsl:apply-templates select="." mode="index_update"/>
5597
+ </xsl:when>
5598
+ <xsl:otherwise>
5599
+ <xsl:apply-templates select="." mode="xref_copy">
5600
+ <xsl:with-param name="target" select="$target"/>
5601
+ </xsl:apply-templates>
5602
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5603
+ </xsl:otherwise>
5604
+ </xsl:choose>
5605
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
5606
+ <xsl:param name="target"/>
5607
+ <xsl:copy>
5608
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
5609
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
5610
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
5611
+ </xsl:if>
5612
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
5613
+ </xsl:copy>
5614
+ </xsl:template><xsl:template name="generateIndexXrefId">
5615
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5616
+
5617
+ <xsl:variable name="docid">
5618
+ <xsl:call-template name="getDocumentId"/>
5619
+ </xsl:variable>
5620
+ <xsl:variable name="item_number">
5621
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
5622
+ </xsl:variable>
5623
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
5624
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
5625
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
5626
+ <xsl:apply-templates/>
5627
+ <fo:block>
5628
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
5629
+ <fo:block> </fo:block>
5630
+ </xsl:if>
5631
+ </fo:block>
5632
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
5633
+ <xsl:apply-templates/>
5634
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
5635
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5636
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5637
+ <xsl:apply-templates/>
5638
+ </fo:block>
5639
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']">
5640
+ <fo:inline id="{@id}"/>
5379
5641
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
5380
5642
  <!-- <row>
5381
5643
  <date>05-07-2013</date>
@@ -5473,6 +5735,8 @@
5473
5735
  <xsl:value-of select="translate(.,'. ','')"/>
5474
5736
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
5475
5737
  <xsl:value-of select="substring(.,1,1)"/>
5738
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5739
+ <fo:inline><xsl:apply-templates/></fo:inline>
5476
5740
  </xsl:template><xsl:template name="convertDate">
5477
5741
  <xsl:param name="date"/>
5478
5742
  <xsl:param name="format" select="'short'"/>
@@ -5497,6 +5761,57 @@
5497
5761
  </xsl:variable>
5498
5762
  <xsl:variable name="result">
5499
5763
  <xsl:choose>
5764
+ <xsl:when test="$format = 'ddMMyyyy'">
5765
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5766
+ <xsl:text> </xsl:text>
5767
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5768
+ </xsl:when>
5769
+ <xsl:when test="$format = 'ddMM'">
5770
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5771
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5772
+ </xsl:when>
5773
+ <xsl:when test="$format = 'short' or $day = ''">
5774
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5775
+ </xsl:when>
5776
+ <xsl:otherwise>
5777
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
5778
+ </xsl:otherwise>
5779
+ </xsl:choose>
5780
+ </xsl:variable>
5781
+ <xsl:value-of select="$result"/>
5782
+ </xsl:template><xsl:template name="convertDateLocalized">
5783
+ <xsl:param name="date"/>
5784
+ <xsl:param name="format" select="'short'"/>
5785
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
5786
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
5787
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
5788
+ <xsl:variable name="monthStr">
5789
+ <xsl:choose>
5790
+ <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
5791
+ <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
5792
+ <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
5793
+ <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
5794
+ <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
5795
+ <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
5796
+ <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
5797
+ <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
5798
+ <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
5799
+ <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
5800
+ <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
5801
+ <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
5802
+ </xsl:choose>
5803
+ </xsl:variable>
5804
+ <xsl:variable name="result">
5805
+ <xsl:choose>
5806
+ <xsl:when test="$format = 'ddMMyyyy'">
5807
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5808
+ <xsl:text> </xsl:text>
5809
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5810
+ </xsl:when>
5811
+ <xsl:when test="$format = 'ddMM'">
5812
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5813
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5814
+ </xsl:when>
5500
5815
  <xsl:when test="$format = 'short' or $day = ''">
5501
5816
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5502
5817
  </xsl:when>
@@ -5512,7 +5827,7 @@
5512
5827
  <xsl:param name="charDelim" select="', '"/>
5513
5828
  <xsl:choose>
5514
5829
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
5515
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5830
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5516
5831
  <xsl:sort data-type="text" order="ascending"/>
5517
5832
  <xsl:call-template name="insertKeyword">
5518
5833
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -5521,7 +5836,7 @@
5521
5836
  </xsl:for-each>
5522
5837
  </xsl:when>
5523
5838
  <xsl:otherwise>
5524
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5839
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5525
5840
  <xsl:call-template name="insertKeyword">
5526
5841
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
5527
5842
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -5538,68 +5853,71 @@
5538
5853
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
5539
5854
  </xsl:choose>
5540
5855
  </xsl:template><xsl:template name="addPDFUAmeta">
5541
- <fo:declarations>
5542
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5543
- <pdf:dictionary type="normal" key="ViewerPreferences">
5544
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
5545
- </pdf:dictionary>
5546
- </pdf:catalog>
5547
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
5548
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
5549
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
5550
- <!-- Dublin Core properties go here -->
5551
- <dc:title>
5552
- <xsl:variable name="title">
5856
+ <xsl:variable name="lang">
5857
+ <xsl:call-template name="getLang"/>
5858
+ </xsl:variable>
5859
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5860
+ <pdf:dictionary type="normal" key="ViewerPreferences">
5861
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
5862
+ </pdf:dictionary>
5863
+ </pdf:catalog>
5864
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
5865
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
5866
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
5867
+ <!-- Dublin Core properties go here -->
5868
+ <dc:title>
5869
+ <xsl:variable name="title">
5870
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5871
+
5872
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
5553
5873
 
5554
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
5555
5874
 
5556
5875
 
5557
5876
 
5558
5877
 
5559
5878
 
5560
- </xsl:variable>
5561
- <xsl:choose>
5562
- <xsl:when test="normalize-space($title) != ''">
5563
- <xsl:value-of select="$title"/>
5564
- </xsl:when>
5565
- <xsl:otherwise>
5566
- <xsl:text> </xsl:text>
5567
- </xsl:otherwise>
5568
- </xsl:choose>
5569
- </dc:title>
5570
- <dc:creator>
5879
+ </xsl:for-each>
5880
+ </xsl:variable>
5881
+ <xsl:choose>
5882
+ <xsl:when test="normalize-space($title) != ''">
5883
+ <xsl:value-of select="$title"/>
5884
+ </xsl:when>
5885
+ <xsl:otherwise>
5886
+ <xsl:text> </xsl:text>
5887
+ </xsl:otherwise>
5888
+ </xsl:choose>
5889
+ </dc:title>
5890
+ <dc:creator>
5891
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5571
5892
 
5572
5893
 
5573
5894
 
5574
- <xsl:for-each select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
5895
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
5575
5896
  <xsl:value-of select="*[local-name() = 'person']/*[local-name() = 'name']/*[local-name() = 'completename']"/>
5576
5897
  <xsl:if test="position() != last()">; </xsl:if>
5577
5898
  </xsl:for-each>
5578
5899
 
5579
- </dc:creator>
5580
- <dc:description>
5581
- <xsl:variable name="abstract">
5582
-
5583
-
5584
-
5585
- <xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5586
-
5587
-
5588
-
5589
- </xsl:variable>
5590
- <xsl:value-of select="normalize-space($abstract)"/>
5591
- </dc:description>
5592
- <pdf:Keywords>
5593
- <xsl:call-template name="insertKeywords"/>
5594
- </pdf:Keywords>
5595
- </rdf:Description>
5596
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
5597
- <!-- XMP properties go here -->
5598
- <xmp:CreatorTool/>
5599
- </rdf:Description>
5600
- </rdf:RDF>
5601
- </x:xmpmeta>
5602
- </fo:declarations>
5900
+ </xsl:for-each>
5901
+ </dc:creator>
5902
+ <dc:description>
5903
+ <xsl:variable name="abstract">
5904
+
5905
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5906
+
5907
+
5908
+ </xsl:variable>
5909
+ <xsl:value-of select="normalize-space($abstract)"/>
5910
+ </dc:description>
5911
+ <pdf:Keywords>
5912
+ <xsl:call-template name="insertKeywords"/>
5913
+ </pdf:Keywords>
5914
+ </rdf:Description>
5915
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
5916
+ <!-- XMP properties go here -->
5917
+ <xmp:CreatorTool/>
5918
+ </rdf:Description>
5919
+ </rdf:RDF>
5920
+ </x:xmpmeta>
5603
5921
  </xsl:template><xsl:template name="getId">
5604
5922
  <xsl:choose>
5605
5923
  <xsl:when test="../@id">
@@ -5696,6 +6014,7 @@
5696
6014
 
5697
6015
 
5698
6016
 
6017
+
5699
6018
  </xsl:variable>
5700
6019
  <xsl:if test="$documentNS != $XSLNS">
5701
6020
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -5755,6 +6074,11 @@
5755
6074
  <xsl:call-template name="getLang"/>
5756
6075
  </xsl:variable>
5757
6076
 
5758
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6077
+ <xsl:choose>
6078
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6079
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6080
+ </xsl:when>
6081
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
6082
+ </xsl:choose>
5759
6083
 
5760
6084
  </xsl:template></xsl:stylesheet>