metanorma-iso 1.5.13 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +17 -0
  3. data/lib/asciidoctor/iso/base.rb +1 -6
  4. data/lib/asciidoctor/iso/basicdoc.rng +52 -3
  5. data/lib/asciidoctor/iso/cleanup.rb +0 -6
  6. data/lib/asciidoctor/iso/front.rb +5 -5
  7. data/lib/asciidoctor/iso/isodoc.rng +114 -3
  8. data/lib/asciidoctor/iso/isostandard-amd.rng +8 -4
  9. data/lib/asciidoctor/iso/isostandard.rng +19 -10
  10. data/lib/asciidoctor/iso/validate.rb +78 -0
  11. data/lib/asciidoctor/iso/validate_section.rb +12 -9
  12. data/lib/isodoc/iso/html/header.html +12 -12
  13. data/lib/isodoc/iso/html/html_iso_intro.html +1 -1
  14. data/lib/isodoc/iso/html/html_iso_titlepage.html +1 -1
  15. data/lib/isodoc/iso/html/word_iso_intro.html +1 -1
  16. data/lib/isodoc/iso/html/word_iso_titlepage.html +1 -1
  17. data/lib/isodoc/iso/html_convert.rb +2 -2
  18. data/lib/isodoc/iso/i18n-en.yaml +2 -0
  19. data/lib/isodoc/iso/i18n-fr.yaml +1 -1
  20. data/lib/isodoc/iso/i18n-zh-Hans.yaml +1 -1
  21. data/lib/isodoc/iso/iso.amendment.xsl +486 -206
  22. data/lib/isodoc/iso/iso.international-standard.xsl +486 -206
  23. data/lib/isodoc/iso/sections.rb +1 -1
  24. data/lib/isodoc/iso/word_convert.rb +2 -2
  25. data/lib/isodoc/iso/xref.rb +28 -12
  26. data/lib/metanorma/iso/processor.rb +11 -0
  27. data/lib/metanorma/iso/version.rb +1 -1
  28. data/metanorma-iso.gemspec +2 -2
  29. data/spec/asciidoctor-iso/amd_spec.rb +14 -14
  30. data/spec/asciidoctor-iso/base_spec.rb +20 -20
  31. data/spec/asciidoctor-iso/blocks_spec.rb +21 -21
  32. data/spec/asciidoctor-iso/cleanup_spec.rb +32 -26
  33. data/spec/asciidoctor-iso/inline_spec.rb +7 -7
  34. data/spec/asciidoctor-iso/lists_spec.rb +3 -3
  35. data/spec/asciidoctor-iso/refs_spec.rb +4 -4
  36. data/spec/asciidoctor-iso/section_spec.rb +7 -7
  37. data/spec/asciidoctor-iso/table_spec.rb +4 -4
  38. data/spec/asciidoctor-iso/validate_spec.rb +457 -87
  39. data/spec/isodoc/amd_spec.rb +13 -13
  40. data/spec/isodoc/iso_spec.rb +2 -2
  41. data/spec/isodoc/postproc_spec.rb +1 -0
  42. data/spec/spec_helper.rb +12 -0
  43. metadata +7 -11
  44. data/lib/asciidoctor/iso/macros.rb +0 -21
  45. data/lib/asciidoctor/iso/term_lookup_cleanup.rb +0 -86
  46. data/lib/metanorma/iso/fonts_manifest.yaml +0 -6
  47. data/spec/asciidoctor-iso/macros_spec.rb +0 -310
@@ -1024,20 +1024,20 @@
1024
1024
  <fo:block-container font-weight="bold">
1025
1025
 
1026
1026
  <fo:block text-align-last="justify" font-size="16pt" margin-top="10pt" margin-bottom="18pt">
1027
- <xsl:variable name="title-toc">
1028
- <xsl:call-template name="getTitle">
1029
- <xsl:with-param name="name" select="'title-toc'"/>
1027
+ <fo:inline font-size="16pt" font-weight="bold">
1028
+ <!-- Contents -->
1029
+ <xsl:call-template name="getLocalizedString">
1030
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
1030
1031
  </xsl:call-template>
1031
- </xsl:variable>
1032
- <fo:inline font-size="16pt" font-weight="bold"><xsl:value-of select="$title-toc"/></fo:inline>
1032
+ </fo:inline>
1033
1033
  <fo:inline keep-together.within-line="always">
1034
1034
  <fo:leader leader-pattern="space"/>
1035
- <xsl:variable name="title-page">
1036
- <xsl:call-template name="getTitle">
1037
- <xsl:with-param name="name" select="'title-page'"/>
1038
- </xsl:call-template>
1039
- </xsl:variable>
1040
- <fo:inline font-weight="normal" font-size="10pt"><xsl:value-of select="$title-page"/></fo:inline>
1035
+ <fo:inline font-weight="normal" font-size="10pt">
1036
+ <!-- Page -->
1037
+ <xsl:call-template name="getLocalizedString">
1038
+ <xsl:with-param name="key">locality.page</xsl:with-param>
1039
+ </xsl:call-template>
1040
+ </fo:inline>
1041
1041
  </fo:inline>
1042
1042
  </fo:block>
1043
1043
 
@@ -1363,13 +1363,22 @@
1363
1363
  <xsl:otherwise> <!-- for ordered lists -->
1364
1364
  <xsl:choose>
1365
1365
  <xsl:when test="../@type = 'arabic'">
1366
- <xsl:number format="a)"/>
1366
+ <xsl:number format="1." lang="en"/>
1367
1367
  </xsl:when>
1368
1368
  <xsl:when test="../@type = 'alphabet'">
1369
- <xsl:number format="a)"/>
1369
+ <xsl:number format="a)" lang="en"/>
1370
+ </xsl:when>
1371
+ <xsl:when test="../@type = 'alphabet_upper'">
1372
+ <xsl:number format="A." lang="en"/>
1373
+ </xsl:when>
1374
+ <xsl:when test="../@type = 'roman'">
1375
+ <xsl:number format="i)"/>
1376
+ </xsl:when>
1377
+ <xsl:when test="../@type = 'roman_upper'">
1378
+ <xsl:number format="I."/>
1370
1379
  </xsl:when>
1371
1380
  <xsl:otherwise>
1372
- <xsl:number format="1."/>
1381
+ <xsl:number format="a)"/>
1373
1382
  </xsl:otherwise>
1374
1383
  </xsl:choose>
1375
1384
  </xsl:otherwise>
@@ -2513,6 +2522,7 @@
2513
2522
 
2514
2523
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2515
2524
 
2525
+
2516
2526
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2517
2527
 
2518
2528
 
@@ -2524,6 +2534,7 @@
2524
2534
 
2525
2535
 
2526
2536
 
2537
+
2527
2538
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
2528
2539
 
2529
2540
 
@@ -2660,188 +2671,240 @@
2660
2671
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2661
2672
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
2662
2673
  <xsl:call-template name="add-zero-spaces-java"/>
2663
- </xsl:template><xsl:template match="*[local-name()='table']">
2674
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2664
2675
 
2665
- <xsl:variable name="simple-table">
2666
- <xsl:call-template name="getSimpleTable"/>
2667
- </xsl:variable>
2676
+ <xsl:variable name="table">
2668
2677
 
2669
-
2670
-
2671
-
2672
-
2673
- <!-- <xsl:if test="$namespace = 'bipm'">
2674
- <fo:block>&#xA0;</fo:block>
2675
- </xsl:if> -->
2676
-
2677
- <!-- $namespace = 'iso' or -->
2678
-
2679
-
2678
+ <xsl:variable name="simple-table">
2679
+ <xsl:call-template name="getSimpleTable"/>
2680
+ </xsl:variable>
2680
2681
 
2681
2682
 
2682
-
2683
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2684
-
2685
- <!-- <xsl:variable name="cols-count">
2686
- <xsl:choose>
2687
- <xsl:when test="*[local-name()='thead']">
2688
- <xsl:call-template name="calculate-columns-numbers">
2689
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2690
- </xsl:call-template>
2691
- </xsl:when>
2692
- <xsl:otherwise>
2693
- <xsl:call-template name="calculate-columns-numbers">
2694
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2695
- </xsl:call-template>
2696
- </xsl:otherwise>
2697
- </xsl:choose>
2698
- </xsl:variable> -->
2699
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2700
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2701
-
2702
-
2703
-
2704
- <xsl:variable name="colwidths">
2705
- <xsl:call-template name="calculate-column-widths">
2706
- <xsl:with-param name="cols-count" select="$cols-count"/>
2707
- <xsl:with-param name="table" select="$simple-table"/>
2708
- </xsl:call-template>
2709
- </xsl:variable>
2710
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2711
-
2712
- <!-- <xsl:variable name="colwidths2">
2713
- <xsl:call-template name="calculate-column-widths">
2714
- <xsl:with-param name="cols-count" select="$cols-count"/>
2715
- </xsl:call-template>
2716
- </xsl:variable> -->
2717
-
2718
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2719
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
2720
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2721
-
2722
- <xsl:variable name="margin-left">
2723
- <xsl:choose>
2724
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2725
- <xsl:otherwise>0</xsl:otherwise>
2726
- </xsl:choose>
2727
- </xsl:variable>
2728
-
2729
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2730
2683
 
2731
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2732
2684
 
2733
2685
 
2734
-
2735
-
2736
-
2686
+ <!-- <xsl:if test="$namespace = 'bipm'">
2687
+ <fo:block>&#xA0;</fo:block>
2688
+ </xsl:if> -->
2737
2689
 
2690
+ <!-- $namespace = 'iso' or -->
2738
2691
 
2739
-
2692
+
2740
2693
 
2694
+
2741
2695
 
2742
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
2743
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2744
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2745
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2696
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2746
2697
 
2698
+ <!-- <xsl:variable name="cols-count">
2699
+ <xsl:choose>
2700
+ <xsl:when test="*[local-name()='thead']">
2701
+ <xsl:call-template name="calculate-columns-numbers">
2702
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2703
+ </xsl:call-template>
2704
+ </xsl:when>
2705
+ <xsl:otherwise>
2706
+ <xsl:call-template name="calculate-columns-numbers">
2707
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2708
+ </xsl:call-template>
2709
+ </xsl:otherwise>
2710
+ </xsl:choose>
2711
+ </xsl:variable> -->
2712
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2713
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2747
2714
 
2748
2715
 
2749
2716
 
2717
+ <xsl:variable name="colwidths">
2718
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2719
+ <xsl:call-template name="calculate-column-widths">
2720
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2721
+ <xsl:with-param name="table" select="$simple-table"/>
2722
+ </xsl:call-template>
2723
+ </xsl:if>
2724
+ </xsl:variable>
2725
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2750
2726
 
2727
+ <!-- <xsl:variable name="colwidths2">
2728
+ <xsl:call-template name="calculate-column-widths">
2729
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2730
+ </xsl:call-template>
2731
+ </xsl:variable> -->
2751
2732
 
2752
- <xsl:variable name="table_attributes">
2753
- <attribute name="table-layout">fixed</attribute>
2754
- <attribute name="width">100%</attribute>
2755
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2756
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2733
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2734
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
2735
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2736
+
2737
+ <xsl:variable name="margin-left">
2738
+ <xsl:choose>
2739
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2740
+ <xsl:otherwise>0</xsl:otherwise>
2741
+ </xsl:choose>
2742
+ </xsl:variable>
2743
+
2744
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2757
2745
 
2758
- <attribute name="border">1.5pt solid black</attribute>
2759
- <xsl:if test="*[local-name()='thead']">
2760
- <attribute name="border-top">1pt solid black</attribute>
2761
- </xsl:if>
2746
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2762
2747
 
2763
2748
 
2749
+
2750
+
2751
+
2764
2752
 
2765
2753
 
2766
- <attribute name="margin-left">0mm</attribute>
2767
- <attribute name="margin-right">0mm</attribute>
2754
+
2768
2755
 
2769
-
2770
-
2771
-
2772
2756
 
2773
-
2757
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
2758
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2759
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2760
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2774
2761
 
2775
- </xsl:variable>
2776
-
2777
-
2778
- <fo:table id="{@id}" table-omit-footer-at-break="true">
2779
2762
 
2780
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2781
- <xsl:attribute name="{@name}">
2782
- <xsl:value-of select="."/>
2783
- </xsl:attribute>
2784
- </xsl:for-each>
2785
2763
 
2786
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2787
- <xsl:if test="$isNoteOrFnExist = 'true'">
2788
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2789
- </xsl:if>
2790
2764
 
2791
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2765
+
2766
+ <xsl:variable name="table_width">
2767
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2768
+ 100%
2769
+
2770
+
2771
+ </xsl:variable>
2772
+
2773
+ <xsl:variable name="table_attributes">
2774
+ <attribute name="table-layout">fixed</attribute>
2775
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
2776
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2777
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2778
+
2779
+ <attribute name="border">1.5pt solid black</attribute>
2780
+ <xsl:if test="*[local-name()='thead']">
2781
+ <attribute name="border-top">1pt solid black</attribute>
2782
+ </xsl:if>
2783
+
2784
+
2785
+
2786
+
2787
+ <attribute name="margin-left">0mm</attribute>
2788
+ <attribute name="margin-right">0mm</attribute>
2789
+
2790
+
2791
+
2792
+
2793
+
2794
+
2795
+
2796
+ </xsl:variable>
2797
+
2798
+
2799
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
2800
+
2801
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2802
+ <xsl:attribute name="{@name}">
2803
+ <xsl:value-of select="."/>
2804
+ </xsl:attribute>
2805
+ </xsl:for-each>
2806
+
2807
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2808
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2809
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2810
+ </xsl:if>
2811
+
2792
2812
  <xsl:choose>
2793
- <xsl:when test=". = 1 or . = 0">
2794
- <fo:table-column column-width="proportional-column-width(2)"/>
2813
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2814
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2815
+ <fo:table-column column-width="{@width}"/>
2816
+ </xsl:for-each>
2795
2817
  </xsl:when>
2796
2818
  <xsl:otherwise>
2797
- <fo:table-column column-width="proportional-column-width({.})"/>
2819
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2820
+ <xsl:choose>
2821
+ <xsl:when test=". = 1 or . = 0">
2822
+ <fo:table-column column-width="proportional-column-width(2)"/>
2823
+ </xsl:when>
2824
+ <xsl:otherwise>
2825
+ <fo:table-column column-width="proportional-column-width({.})"/>
2826
+ </xsl:otherwise>
2827
+ </xsl:choose>
2828
+ </xsl:for-each>
2798
2829
  </xsl:otherwise>
2799
2830
  </xsl:choose>
2800
- </xsl:for-each>
2801
-
2802
- <xsl:choose>
2803
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2804
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2805
- </xsl:when>
2806
- <xsl:otherwise>
2807
- <xsl:apply-templates/>
2808
- </xsl:otherwise>
2809
- </xsl:choose>
2810
-
2811
- </fo:table>
2812
-
2813
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2814
- <xsl:call-template name="insertTableFooterInSeparateTable">
2815
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
2816
- <xsl:with-param name="colwidths" select="$colwidths"/>
2817
- </xsl:call-template>
2818
- </xsl:for-each>
2819
-
2820
- <!-- insert footer as table -->
2821
- <!-- <fo:table>
2822
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2823
- <xsl:attribute name="{@name}">
2824
- <xsl:value-of select="."/>
2825
- </xsl:attribute>
2826
- </xsl:for-each>
2827
-
2828
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2831
+
2829
2832
  <xsl:choose>
2830
- <xsl:when test=". = 1 or . = 0">
2831
- <fo:table-column column-width="proportional-column-width(2)"/>
2833
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2834
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2832
2835
  </xsl:when>
2833
2836
  <xsl:otherwise>
2834
- <fo:table-column column-width="proportional-column-width({.})"/>
2837
+ <xsl:apply-templates/>
2835
2838
  </xsl:otherwise>
2836
2839
  </xsl:choose>
2840
+
2841
+ </fo:table>
2842
+
2843
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2844
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2845
+ <xsl:call-template name="insertTableFooterInSeparateTable">
2846
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
2847
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2848
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2849
+ </xsl:call-template>
2837
2850
  </xsl:for-each>
2838
- </fo:table>-->
2839
-
2840
-
2841
-
2842
-
2843
-
2844
- </fo:block-container>
2851
+
2852
+ <!-- insert footer as table -->
2853
+ <!-- <fo:table>
2854
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2855
+ <xsl:attribute name="{@name}">
2856
+ <xsl:value-of select="."/>
2857
+ </xsl:attribute>
2858
+ </xsl:for-each>
2859
+
2860
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2861
+ <xsl:choose>
2862
+ <xsl:when test=". = 1 or . = 0">
2863
+ <fo:table-column column-width="proportional-column-width(2)"/>
2864
+ </xsl:when>
2865
+ <xsl:otherwise>
2866
+ <fo:table-column column-width="proportional-column-width({.})"/>
2867
+ </xsl:otherwise>
2868
+ </xsl:choose>
2869
+ </xsl:for-each>
2870
+ </fo:table>-->
2871
+
2872
+
2873
+
2874
+
2875
+
2876
+ </fo:block-container>
2877
+ </xsl:variable>
2878
+
2879
+
2880
+
2881
+ <xsl:choose>
2882
+ <xsl:when test="@width">
2883
+
2884
+ <!-- centered table when table name is centered (see table-name-style) -->
2885
+
2886
+ <fo:table table-layout="fixed" width="100%">
2887
+ <fo:table-column column-width="proportional-column-width(1)"/>
2888
+ <fo:table-column column-width="{@width}"/>
2889
+ <fo:table-column column-width="proportional-column-width(1)"/>
2890
+ <fo:table-body>
2891
+ <fo:table-row>
2892
+ <fo:table-cell column-number="2">
2893
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
2894
+ </fo:table-cell>
2895
+ </fo:table-row>
2896
+ </fo:table-body>
2897
+ </fo:table>
2898
+
2899
+
2900
+
2901
+
2902
+ </xsl:when>
2903
+ <xsl:otherwise>
2904
+ <xsl:copy-of select="$table"/>
2905
+ </xsl:otherwise>
2906
+ </xsl:choose>
2907
+
2845
2908
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2846
2909
  <xsl:if test="normalize-space() != ''">
2847
2910
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -3075,12 +3138,22 @@
3075
3138
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
3076
3139
  <xsl:param name="table_attributes"/>
3077
3140
  <xsl:param name="colwidths"/>
3141
+ <xsl:param name="colgroup"/>
3078
3142
 
3079
3143
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3080
3144
 
3081
3145
  <xsl:if test="$isNoteOrFnExist = 'true'">
3082
3146
 
3083
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
3147
+ <xsl:variable name="cols-count">
3148
+ <xsl:choose>
3149
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3150
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
3151
+ </xsl:when>
3152
+ <xsl:otherwise>
3153
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
3154
+ </xsl:otherwise>
3155
+ </xsl:choose>
3156
+ </xsl:variable>
3084
3157
 
3085
3158
  <fo:table keep-with-previous="always">
3086
3159
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -3098,16 +3171,25 @@
3098
3171
  </xsl:choose>
3099
3172
  </xsl:for-each>
3100
3173
 
3101
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3102
- <xsl:choose>
3103
- <xsl:when test=". = 1 or . = 0">
3104
- <fo:table-column column-width="proportional-column-width(2)"/>
3105
- </xsl:when>
3106
- <xsl:otherwise>
3107
- <fo:table-column column-width="proportional-column-width({.})"/>
3108
- </xsl:otherwise>
3109
- </xsl:choose>
3110
- </xsl:for-each>
3174
+ <xsl:choose>
3175
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3176
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
3177
+ <fo:table-column column-width="{@width}"/>
3178
+ </xsl:for-each>
3179
+ </xsl:when>
3180
+ <xsl:otherwise>
3181
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3182
+ <xsl:choose>
3183
+ <xsl:when test=". = 1 or . = 0">
3184
+ <fo:table-column column-width="proportional-column-width(2)"/>
3185
+ </xsl:when>
3186
+ <xsl:otherwise>
3187
+ <fo:table-column column-width="proportional-column-width({.})"/>
3188
+ </xsl:otherwise>
3189
+ </xsl:choose>
3190
+ </xsl:for-each>
3191
+ </xsl:otherwise>
3192
+ </xsl:choose>
3111
3193
 
3112
3194
  <fo:table-body>
3113
3195
  <fo:table-row>
@@ -3581,7 +3663,9 @@
3581
3663
  </xsl:template><xsl:template match="*[local-name()='dl']">
3582
3664
  <fo:block-container>
3583
3665
 
3584
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
3666
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
3667
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3668
+ </xsl:if>
3585
3669
 
3586
3670
 
3587
3671
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -3596,6 +3680,7 @@
3596
3680
  <fo:block-container>
3597
3681
 
3598
3682
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
3683
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
3599
3684
 
3600
3685
 
3601
3686
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -3726,7 +3811,7 @@
3726
3811
  <xsl:with-param name="table" select="$html-table"/>
3727
3812
  </xsl:call-template>
3728
3813
  </xsl:variable>
3729
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3814
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3730
3815
  <xsl:variable name="maxlength_dt">
3731
3816
  <xsl:call-template name="getMaxLength_dt"/>
3732
3817
  </xsl:variable>
@@ -3755,13 +3840,22 @@
3755
3840
  </xsl:when>
3756
3841
  <xsl:otherwise>
3757
3842
  <xsl:choose>
3843
+ <!-- to set width check most wide chars like `W` -->
3758
3844
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
3759
- <fo:table-column column-width="5%"/>
3760
- <fo:table-column column-width="95%"/>
3845
+ <fo:table-column column-width="7%"/>
3846
+ <fo:table-column column-width="93%"/>
3847
+ </xsl:when>
3848
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
3849
+ <fo:table-column column-width="15%"/>
3850
+ <fo:table-column column-width="85%"/>
3761
3851
  </xsl:when>
3762
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
3763
- <fo:table-column column-width="10%"/>
3764
- <fo:table-column column-width="90%"/>
3852
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
3853
+ <fo:table-column column-width="20%"/>
3854
+ <fo:table-column column-width="80%"/>
3855
+ </xsl:when>
3856
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
3857
+ <fo:table-column column-width="25%"/>
3858
+ <fo:table-column column-width="75%"/>
3765
3859
  </xsl:when>
3766
3860
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
3767
3861
  <fo:table-column column-width="60%"/>
@@ -3793,12 +3887,32 @@
3793
3887
  </xsl:otherwise>
3794
3888
  </xsl:choose>
3795
3889
  </xsl:template><xsl:template name="getMaxLength_dt">
3796
- <xsl:for-each select="*[local-name()='dt']">
3797
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3798
- <xsl:if test="position() = 1">
3799
- <xsl:value-of select="string-length(normalize-space(.))"/>
3800
- </xsl:if>
3801
- </xsl:for-each>
3890
+ <xsl:variable name="lengths">
3891
+ <xsl:for-each select="*[local-name()='dt']">
3892
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
3893
+ <xsl:variable name="attributes">
3894
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
3895
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
3896
+ </xsl:variable>
3897
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
3898
+ </xsl:for-each>
3899
+ </xsl:variable>
3900
+ <xsl:variable name="maxLength">
3901
+ <!-- <xsl:for-each select="*[local-name()='dt']">
3902
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3903
+ <xsl:if test="position() = 1">
3904
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3905
+ </xsl:if>
3906
+ </xsl:for-each> -->
3907
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
3908
+ <xsl:sort select="." data-type="number" order="descending"/>
3909
+ <xsl:if test="position() = 1">
3910
+ <xsl:value-of select="."/>
3911
+ </xsl:if>
3912
+ </xsl:for-each>
3913
+ </xsl:variable>
3914
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
3915
+ <xsl:value-of select="$maxLength"/>
3802
3916
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
3803
3917
  <xsl:param name="key_iso"/>
3804
3918
 
@@ -3939,6 +4053,7 @@
3939
4053
 
3940
4054
 
3941
4055
 
4056
+
3942
4057
 
3943
4058
  </xsl:variable>
3944
4059
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -3952,6 +4067,10 @@
3952
4067
  </xsl:if>
3953
4068
  <xsl:apply-templates/>
3954
4069
  </fo:inline>
4070
+ </xsl:template><xsl:template match="*[local-name()='underline']">
4071
+ <fo:inline text-decoration="underline">
4072
+ <xsl:apply-templates/>
4073
+ </fo:inline>
3955
4074
  </xsl:template><xsl:template match="*[local-name()='del']">
3956
4075
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3957
4076
  <xsl:apply-templates/>
@@ -4045,6 +4164,10 @@
4045
4164
  <xsl:param name="text" select="."/>
4046
4165
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4047
4166
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
4167
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
4168
+ <xsl:param name="text" select="."/>
4169
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4170
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
4048
4171
  </xsl:template><xsl:template name="add-zero-spaces">
4049
4172
  <xsl:param name="text" select="."/>
4050
4173
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -4305,6 +4428,11 @@
4305
4428
  <!-- replace start and end spaces to non-break space -->
4306
4429
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4307
4430
  </xsl:copy>
4431
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4432
+ <xsl:copy>
4433
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
4434
+ </xsl:copy>
4435
+ <mathml:mspace width="0.5ex"/>
4308
4436
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
4309
4437
  <xsl:variable name="target">
4310
4438
  <xsl:choose>
@@ -4326,7 +4454,10 @@
4326
4454
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
4327
4455
  <xsl:choose>
4328
4456
  <xsl:when test="normalize-space(.) = ''">
4329
- <xsl:value-of select="$target"/>
4457
+ <!-- <xsl:value-of select="$target"/> -->
4458
+ <xsl:call-template name="add-zero-spaces-link-java">
4459
+ <xsl:with-param name="text" select="$target"/>
4460
+ </xsl:call-template>
4330
4461
  </xsl:when>
4331
4462
  <xsl:otherwise>
4332
4463
  <xsl:apply-templates/>
@@ -4530,7 +4661,7 @@
4530
4661
  </xsl:if> -->
4531
4662
  </fo:inline>
4532
4663
  </xsl:if>
4533
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
4664
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
4534
4665
  <fo:block-container id="{@id}">
4535
4666
 
4536
4667
  <fo:block>
@@ -4599,6 +4730,8 @@
4599
4730
  <xsl:variable name="bookmark-title_">
4600
4731
  <xsl:call-template name="getLangVersion">
4601
4732
  <xsl:with-param name="lang" select="@lang"/>
4733
+ <xsl:with-param name="doctype" select="@doctype"/>
4734
+ <xsl:with-param name="title" select="@title-part"/>
4602
4735
  </xsl:call-template>
4603
4736
  </xsl:variable>
4604
4737
  <xsl:choose>
@@ -4616,13 +4749,34 @@
4616
4749
  </xsl:choose>
4617
4750
  </fo:bookmark-title>
4618
4751
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4752
+
4753
+ <xsl:call-template name="insertFigureBookmarks">
4754
+ <xsl:with-param name="contents" select="contents"/>
4755
+ </xsl:call-template>
4756
+
4757
+ <xsl:call-template name="insertTableBookmarks">
4758
+ <xsl:with-param name="contents" select="contents"/>
4759
+ <xsl:with-param name="lang" select="@lang"/>
4760
+ </xsl:call-template>
4761
+
4619
4762
  </fo:bookmark>
4620
4763
 
4621
4764
  </xsl:for-each>
4622
4765
  </xsl:when>
4623
4766
  <xsl:otherwise>
4624
4767
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4768
+
4625
4769
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4770
+
4771
+ <xsl:call-template name="insertFigureBookmarks">
4772
+ <xsl:with-param name="contents" select="contents"/>
4773
+ </xsl:call-template>
4774
+
4775
+ <xsl:call-template name="insertTableBookmarks">
4776
+ <xsl:with-param name="contents" select="contents"/>
4777
+ <xsl:with-param name="lang" select="@lang"/>
4778
+ </xsl:call-template>
4779
+
4626
4780
  </xsl:for-each>
4627
4781
  </xsl:otherwise>
4628
4782
  </xsl:choose>
@@ -4641,8 +4795,44 @@
4641
4795
 
4642
4796
  </fo:bookmark-tree>
4643
4797
  </xsl:if>
4798
+ </xsl:template><xsl:template name="insertFigureBookmarks">
4799
+ <xsl:param name="contents"/>
4800
+ <xsl:if test="xalan:nodeset($contents)/figure">
4801
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
4802
+ <fo:bookmark-title>Figures</fo:bookmark-title>
4803
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
4804
+ <fo:bookmark internal-destination="{@id}">
4805
+ <fo:bookmark-title>
4806
+ <xsl:value-of select="normalize-space(title)"/>
4807
+ </fo:bookmark-title>
4808
+ </fo:bookmark>
4809
+ </xsl:for-each>
4810
+ </fo:bookmark>
4811
+ </xsl:if>
4812
+ </xsl:template><xsl:template name="insertTableBookmarks">
4813
+ <xsl:param name="contents"/>
4814
+ <xsl:param name="lang"/>
4815
+ <xsl:if test="xalan:nodeset($contents)/table">
4816
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
4817
+ <fo:bookmark-title>
4818
+ <xsl:choose>
4819
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
4820
+ <xsl:otherwise>Tables</xsl:otherwise>
4821
+ </xsl:choose>
4822
+ </fo:bookmark-title>
4823
+ <xsl:for-each select="xalan:nodeset($contents)/table">
4824
+ <fo:bookmark internal-destination="{@id}">
4825
+ <fo:bookmark-title>
4826
+ <xsl:value-of select="normalize-space(title)"/>
4827
+ </fo:bookmark-title>
4828
+ </fo:bookmark>
4829
+ </xsl:for-each>
4830
+ </fo:bookmark>
4831
+ </xsl:if>
4644
4832
  </xsl:template><xsl:template name="getLangVersion">
4645
4833
  <xsl:param name="lang"/>
4834
+ <xsl:param name="doctype" select="''"/>
4835
+ <xsl:param name="title" select="''"/>
4646
4836
  <xsl:choose>
4647
4837
  <xsl:when test="$lang = 'en'">
4648
4838
 
@@ -4678,6 +4868,12 @@
4678
4868
  <!-- <xsl:text> </xsl:text> -->
4679
4869
  </xsl:template><xsl:template name="getSection">
4680
4870
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4871
+ <!--
4872
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
4873
+ <xsl:value-of select="."/>
4874
+ </xsl:for-each>
4875
+ -->
4876
+
4681
4877
  </xsl:template><xsl:template name="getName">
4682
4878
  <xsl:choose>
4683
4879
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -4730,6 +4926,12 @@
4730
4926
  <xsl:copy>
4731
4927
  <xsl:apply-templates mode="contents_item"/>
4732
4928
  </xsl:copy>
4929
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
4930
+ <xsl:copy>
4931
+ <xsl:apply-templates mode="contents_item"/>
4932
+ </xsl:copy>
4933
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
4934
+ <xsl:copy-of select="."/>
4733
4935
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4734
4936
  <xsl:text> </xsl:text>
4735
4937
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -4755,6 +4957,7 @@
4755
4957
 
4756
4958
  9
4757
4959
 
4960
+
4758
4961
 
4759
4962
 
4760
4963
 
@@ -5135,10 +5338,13 @@
5135
5338
  </xsl:if>
5136
5339
  </xsl:if>
5137
5340
 
5341
+
5138
5342
  <fo:block-container margin-left="0mm">
5139
5343
 
5140
5344
  <fo:block xsl:use-attribute-sets="quote-style">
5141
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
5345
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5346
+
5347
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5142
5348
  </fo:block>
5143
5349
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5144
5350
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5294,6 +5500,7 @@
5294
5500
  <xsl:attribute name="space-before">18pt</xsl:attribute>
5295
5501
  </xsl:if>
5296
5502
 
5503
+
5297
5504
 
5298
5505
 
5299
5506
 
@@ -5305,7 +5512,7 @@
5305
5512
 
5306
5513
 
5307
5514
 
5308
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
5515
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
5309
5516
  <fo:block break-after="page"/>
5310
5517
  <fo:block>
5311
5518
  <xsl:call-template name="setId"/>
@@ -5313,7 +5520,8 @@
5313
5520
  </fo:block>
5314
5521
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
5315
5522
  <fo:block>
5316
- <xsl:call-template name="setId"/>
5523
+ <xsl:call-template name="setId"/>
5524
+
5317
5525
 
5318
5526
  <xsl:apply-templates/>
5319
5527
  </fo:block>
@@ -5378,7 +5586,8 @@
5378
5586
  <fo:table-column column-width="107mm"/>
5379
5587
  <fo:table-column column-width="15mm"/>
5380
5588
  <fo:table-body>
5381
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
5589
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
5590
+
5382
5591
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
5383
5592
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
5384
5593
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -5396,6 +5605,10 @@
5396
5605
  <fo:block><xsl:apply-templates/></fo:block>
5397
5606
  </fo:table-cell>
5398
5607
  </xsl:template><xsl:template name="processBibitem">
5608
+
5609
+
5610
+ <!-- end BIPM bibitem processing-->
5611
+
5399
5612
 
5400
5613
 
5401
5614
 
@@ -5454,6 +5667,8 @@
5454
5667
  <xsl:value-of select="translate(.,'. ','')"/>
5455
5668
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
5456
5669
  <xsl:value-of select="substring(.,1,1)"/>
5670
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5671
+ <fo:inline><xsl:apply-templates/></fo:inline>
5457
5672
  </xsl:template><xsl:template name="convertDate">
5458
5673
  <xsl:param name="date"/>
5459
5674
  <xsl:param name="format" select="'short'"/>
@@ -5478,6 +5693,57 @@
5478
5693
  </xsl:variable>
5479
5694
  <xsl:variable name="result">
5480
5695
  <xsl:choose>
5696
+ <xsl:when test="$format = 'ddMMyyyy'">
5697
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5698
+ <xsl:text> </xsl:text>
5699
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5700
+ </xsl:when>
5701
+ <xsl:when test="$format = 'ddMM'">
5702
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5703
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5704
+ </xsl:when>
5705
+ <xsl:when test="$format = 'short' or $day = ''">
5706
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5707
+ </xsl:when>
5708
+ <xsl:otherwise>
5709
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
5710
+ </xsl:otherwise>
5711
+ </xsl:choose>
5712
+ </xsl:variable>
5713
+ <xsl:value-of select="$result"/>
5714
+ </xsl:template><xsl:template name="convertDateLocalized">
5715
+ <xsl:param name="date"/>
5716
+ <xsl:param name="format" select="'short'"/>
5717
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
5718
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
5719
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
5720
+ <xsl:variable name="monthStr">
5721
+ <xsl:choose>
5722
+ <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>
5723
+ <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>
5724
+ <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>
5725
+ <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>
5726
+ <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>
5727
+ <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>
5728
+ <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>
5729
+ <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>
5730
+ <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>
5731
+ <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>
5732
+ <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>
5733
+ <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>
5734
+ </xsl:choose>
5735
+ </xsl:variable>
5736
+ <xsl:variable name="result">
5737
+ <xsl:choose>
5738
+ <xsl:when test="$format = 'ddMMyyyy'">
5739
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5740
+ <xsl:text> </xsl:text>
5741
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5742
+ </xsl:when>
5743
+ <xsl:when test="$format = 'ddMM'">
5744
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5745
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5746
+ </xsl:when>
5481
5747
  <xsl:when test="$format = 'short' or $day = ''">
5482
5748
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5483
5749
  </xsl:when>
@@ -5493,7 +5759,7 @@
5493
5759
  <xsl:param name="charDelim" select="', '"/>
5494
5760
  <xsl:choose>
5495
5761
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
5496
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5762
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5497
5763
  <xsl:sort data-type="text" order="ascending"/>
5498
5764
  <xsl:call-template name="insertKeyword">
5499
5765
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -5502,7 +5768,7 @@
5502
5768
  </xsl:for-each>
5503
5769
  </xsl:when>
5504
5770
  <xsl:otherwise>
5505
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5771
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5506
5772
  <xsl:call-template name="insertKeyword">
5507
5773
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
5508
5774
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -5519,6 +5785,9 @@
5519
5785
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
5520
5786
  </xsl:choose>
5521
5787
  </xsl:template><xsl:template name="addPDFUAmeta">
5788
+ <xsl:variable name="lang">
5789
+ <xsl:call-template name="getLang"/>
5790
+ </xsl:variable>
5522
5791
  <fo:declarations>
5523
5792
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5524
5793
  <pdf:dictionary type="normal" key="ViewerPreferences">
@@ -5531,13 +5800,16 @@
5531
5800
  <!-- Dublin Core properties go here -->
5532
5801
  <dc:title>
5533
5802
  <xsl:variable name="title">
5534
-
5535
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
5536
-
5537
-
5538
-
5539
-
5540
-
5803
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5804
+
5805
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
5806
+
5807
+
5808
+
5809
+
5810
+
5811
+
5812
+ </xsl:for-each>
5541
5813
  </xsl:variable>
5542
5814
  <xsl:choose>
5543
5815
  <xsl:when test="normalize-space($title) != ''">
@@ -5549,19 +5821,21 @@
5549
5821
  </xsl:choose>
5550
5822
  </dc:title>
5551
5823
  <dc:creator>
5552
-
5553
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
5554
-
5555
-
5556
-
5557
- </dc:creator>
5558
- <dc:description>
5559
- <xsl:variable name="abstract">
5824
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5825
+
5826
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
5827
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
5828
+ <xsl:if test="position() != last()">; </xsl:if>
5829
+ </xsl:for-each>
5560
5830
 
5561
- <xsl:copy-of select="/*/*[local-name() = 'bibliography']/*[local-name() = 'references']/*[local-name() = 'bibitem']/*[local-name() = 'abstract']//text()"/>
5562
5831
 
5563
5832
 
5833
+ </xsl:for-each>
5834
+ </dc:creator>
5835
+ <dc:description>
5836
+ <xsl:variable name="abstract">
5564
5837
 
5838
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5565
5839
 
5566
5840
 
5567
5841
  </xsl:variable>
@@ -5674,6 +5948,7 @@
5674
5948
 
5675
5949
 
5676
5950
 
5951
+
5677
5952
  </xsl:variable>
5678
5953
  <xsl:if test="$documentNS != $XSLNS">
5679
5954
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -5733,6 +6008,11 @@
5733
6008
  <xsl:call-template name="getLang"/>
5734
6009
  </xsl:variable>
5735
6010
 
5736
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6011
+ <xsl:choose>
6012
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6013
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6014
+ </xsl:when>
6015
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
6016
+ </xsl:choose>
5737
6017
 
5738
6018
  </xsl:template></xsl:stylesheet>