metanorma-iso 2.1.6 → 2.1.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rake.yml +3 -1
  3. data/.github/workflows/release.yml +24 -0
  4. data/lib/isodoc/iso/html/html_iso_titlepage.html +2 -2
  5. data/lib/isodoc/iso/html/style-human.css +34 -2
  6. data/lib/isodoc/iso/html/style-human.scss +35 -1
  7. data/lib/isodoc/iso/html/style-iso.css +34 -2
  8. data/lib/isodoc/iso/html/style-iso.scss +36 -1
  9. data/lib/isodoc/iso/i18n-en.yaml +4 -0
  10. data/lib/isodoc/iso/i18n-fr.yaml +5 -0
  11. data/lib/isodoc/iso/i18n-ru.yaml +4 -0
  12. data/lib/isodoc/iso/i18n-zh-Hans.yaml +5 -0
  13. data/lib/isodoc/iso/init.rb +4 -0
  14. data/lib/isodoc/iso/iso.amendment.xsl +195 -197
  15. data/lib/isodoc/iso/iso.international-standard.xsl +195 -197
  16. data/lib/isodoc/iso/presentation_xml_convert.rb +22 -6
  17. data/lib/isodoc/iso/xref.rb +35 -4
  18. data/lib/metanorma/iso/base.rb +4 -0
  19. data/lib/metanorma/iso/biblio.rng +8 -5
  20. data/lib/metanorma/iso/cleanup.rb +5 -1
  21. data/lib/metanorma/iso/front_id.rb +63 -38
  22. data/lib/metanorma/iso/section.rb +5 -0
  23. data/lib/metanorma/iso/validate.rb +3 -2
  24. data/lib/metanorma/iso/version.rb +1 -1
  25. data/lib/metanorma/requirements/modspec.rb +60 -0
  26. data/lib/metanorma/requirements/requirements.rb +16 -0
  27. data/lib/metanorma-iso.rb +2 -1
  28. data/metanorma-iso.gemspec +1 -1
  29. data/spec/assets/iso.adoc +10 -0
  30. data/spec/examples/rice_img/1000-1_ed2amd3fig1a.png +0 -0
  31. data/spec/examples/rice_img/1000-1_ed2amd3fig1b.png +0 -0
  32. data/spec/examples/rice_img/1000-1_ed2amd3fig2.png +0 -0
  33. data/spec/examples/rice_img/1000-1_ed2amd3fig3.png +0 -0
  34. data/spec/examples/rice_img/1000-1_ed2amd3fig4.png +0 -0
  35. data/spec/examples/rice_img/1000-1_ed2amd3fig5_f.png +0 -0
  36. data/spec/examples/rice_img/1000-1_ed2amd3figA.png +0 -0
  37. data/spec/examples/rice_img/1000-1_ed2amd3figA1.png +0 -0
  38. data/spec/examples/rice_img/1000-1_ed2amd3figA2.png +0 -0
  39. data/spec/examples/rice_img/1000-1_ed2amd3figTab1.png +0 -0
  40. data/spec/examples/rice_img/1000-1_ed2amd3figTab2.png +0 -0
  41. data/spec/examples/rice_img/1001_ed2amd3fig1.png +0 -0
  42. data/spec/examples/rice_img/ISO_1213_1.png +0 -0
  43. data/spec/examples/rice_img/SL1000-1_ed2amd3fig1.png +0 -0
  44. data/spec/isodoc/ref_spec.rb +129 -82
  45. data/spec/metanorma/amd_spec.rb +0 -10
  46. data/spec/metanorma/base_spec.rb +15 -12
  47. data/spec/metanorma/cleanup_spec.rb +136 -0
  48. data/spec/metanorma/macros_spec.rb +99 -0
  49. data/spec/metanorma/processor_spec.rb +86 -86
  50. data/spec/metanorma/section_spec.rb +2 -2
  51. data/spec/metanorma/validate_spec.rb +41 -40
  52. data/spec/requirements/requirements_spec.rb +1299 -0
  53. data/spec/requirements/xref_spec.rb +1205 -0
  54. data/spec/vcr_cassettes/docrels.yml +385 -0
  55. data/spec/vcr_cassettes/withdrawn_iso.yml +21 -21
  56. metadata +40 -18
@@ -10,7 +10,7 @@
10
10
 
11
11
  <xsl:variable name="debug">false</xsl:variable>
12
12
 
13
- <xsl:variable name="docidentifierISO_undated" select="normalize-space(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-undated'])"/>
13
+ <xsl:variable name="docidentifierISO_undated"><xsl:if test="not($stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM' or $stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM')"><xsl:value-of select="normalize-space(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-undated'])"/></xsl:if></xsl:variable>
14
14
  <xsl:variable name="docidentifierISO_">
15
15
  <xsl:value-of select="$docidentifierISO_undated"/>
16
16
  <xsl:if test="$docidentifierISO_undated = ''">
@@ -120,8 +120,8 @@
120
120
 
121
121
  <xsl:variable name="stagename-header-coverpage">
122
122
  <xsl:choose>
123
- <xsl:when test="$stage-abbreviation = 'DIS'">DRAFT</xsl:when>
124
- <xsl:when test="$stage-abbreviation = 'FDIS'">FINAL DRAFT</xsl:when>
123
+ <xsl:when test="$stage-abbreviation = 'DIS' or $stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM'">DRAFT</xsl:when>
124
+ <xsl:when test="$stage-abbreviation = 'FDIS' or $stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM'">FINAL DRAFT</xsl:when>
125
125
  <xsl:when test="$stage-abbreviation = 'PRF'"/>
126
126
  <xsl:when test="$stage-abbreviation = 'IS'"/>
127
127
  <xsl:otherwise>
@@ -453,14 +453,17 @@
453
453
  <fo:table-body>
454
454
  <fo:table-row>
455
455
  <fo:table-cell font-size="6.5pt" text-align="justify" display-align="after" padding-bottom="8mm">
456
+ <xsl:if test="$stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM'">
457
+ <xsl:attribute name="font-size">7pt</xsl:attribute>
458
+ </xsl:if>
456
459
  <!-- margin-top="-30mm" -->
457
460
  <fo:block> <!-- margin-top="-100mm" -->
458
- <xsl:if test="$stage-abbreviation = 'DIS' or $stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD'">
461
+ <xsl:if test="$stage-abbreviation = 'DIS' or $stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM' or $stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD'">
459
462
  <fo:block margin-bottom="1.5mm">
460
463
  <xsl:text>THIS DOCUMENT IS A DRAFT CIRCULATED FOR COMMENT AND APPROVAL. IT IS THEREFORE SUBJECT TO CHANGE AND MAY NOT BE REFERRED TO AS AN INTERNATIONAL STANDARD UNTIL PUBLISHED AS SUCH.</xsl:text>
461
464
  </fo:block>
462
465
  </xsl:if>
463
- <xsl:if test="$stage-abbreviation = 'FDIS' or $stage-abbreviation = 'DIS' or $stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD'">
466
+ <xsl:if test="$stage-abbreviation = 'FDIS' or $stage-abbreviation = 'DIS' or $stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM' or $stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM' or $stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD'">
464
467
  <fo:block margin-bottom="1.5mm">
465
468
  <xsl:text>RECIPIENTS OF THIS DRAFT ARE INVITED TO
466
469
  SUBMIT, WITH THEIR COMMENTS, NOTIFICATION
@@ -494,7 +497,7 @@
494
497
  </xsl:if>
495
498
 
496
499
  <fo:block>
497
- <xsl:if test="$stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD' or $stage-abbreviation = 'DIS' or $stage-abbreviation = 'FDIS'">
500
+ <xsl:if test="$stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD' or $stage-abbreviation = 'DIS' or $stage-abbreviation = 'FDIS' or $stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM'">
498
501
  <xsl:variable name="text">
499
502
  <xsl:for-each select="/iso:iso-standard/iso:preface/iso:note[@coverpage='true']/iso:p">
500
503
  <fo:block>
@@ -610,7 +613,7 @@
610
613
 
611
614
  <xsl:choose>
612
615
  <!-- COVER PAGE for DIS document only -->
613
- <xsl:when test="$stage-abbreviation = 'DIS'">
616
+ <xsl:when test="$stage-abbreviation = 'DIS' or $stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM'">
614
617
  <fo:flow flow-name="xsl-region-body">
615
618
  <fo:block-container>
616
619
  <fo:block margin-top="-1mm" font-size="20pt" text-align="right">
@@ -635,7 +638,7 @@
635
638
  </fo:block>
636
639
  </fo:table-cell>
637
640
  <fo:table-cell>
638
- <fo:block>
641
+ <fo:block margin-bottom="3mm">
639
642
  <xsl:copy-of select="$secretariat"/>
640
643
  </fo:block>
641
644
  </fo:table-cell>
@@ -730,10 +733,10 @@
730
733
  </fo:block-container>
731
734
  </fo:flow>
732
735
 
733
- </xsl:when> <!-- END: $stage-abbreviation = 'DIS' -->
736
+ </xsl:when> <!-- END: $stage-abbreviation = 'DIS' 'DAmd' 'DAM'-->
734
737
  <xsl:otherwise>
735
738
 
736
- <!-- COVER PAGE for all documents except DIS -->
739
+ <!-- COVER PAGE for all documents except DIS, DAmd and DAM -->
737
740
  <fo:flow flow-name="xsl-region-body">
738
741
  <fo:block-container>
739
742
  <fo:table table-layout="fixed" width="100%" font-size="24pt" line-height="1"> <!-- margin-bottom="35mm" -->
@@ -769,6 +772,7 @@
769
772
  <fo:table-cell>
770
773
  <fo:block text-align="left">
771
774
  <xsl:choose>
775
+ <xsl:when test="$stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM'"><xsl:value-of select="$doctype_uppercased"/></xsl:when>
772
776
  <xsl:when test="$doctype = 'amendment'">
773
777
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(translate(/iso:iso-standard/iso:bibdata/iso:ext/iso:updates-document-type,'-',' ')))"/>
774
778
  </xsl:when>
@@ -817,7 +821,7 @@
817
821
  </fo:block>
818
822
  <!-- <xsl:value-of select="$linebreak"/>
819
823
  <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date"/> -->
820
- <xsl:if test="$doctype = 'amendment'">
824
+ <xsl:if test="$doctype = 'amendment' and not($stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM')">
821
825
  <fo:block text-align="right" margin-right="0.5mm">
822
826
  <fo:block font-weight="bold" margin-top="4pt" role="H1">
823
827
  <xsl:value-of select="$doctype_uppercased"/>
@@ -875,11 +879,11 @@
875
879
  <fo:table-row> <!-- border="1pt solid black" height="150mm" -->
876
880
  <fo:table-cell font-size="11pt">
877
881
  <fo:block>
878
- <xsl:if test="$stage-abbreviation = 'FDIS'">
882
+ <xsl:if test="$stage-abbreviation = 'FDIS' or $stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM'">
879
883
  <fo:block-container border="0.5mm solid black" width="51mm">
880
884
  <fo:block margin="2mm">
881
885
  <fo:block margin-bottom="8pt"><xsl:copy-of select="$editorialgroup"/></fo:block>
882
- <fo:block margin-bottom="6pt"><xsl:value-of select="$secretariat"/></fo:block>
886
+ <fo:block margin-bottom="6pt"><xsl:copy-of select="$secretariat"/></fo:block>
883
887
  <fo:block margin-bottom="6pt">Voting begins on:<xsl:value-of select="$linebreak"/>
884
888
  <fo:inline font-weight="bold">
885
889
  <xsl:choose>
@@ -911,7 +915,7 @@
911
915
  <fo:table-cell>
912
916
  <xsl:call-template name="insertTripleLine"/>
913
917
  <fo:block-container line-height="1.1">
914
- <fo:block margin-right="5mm">
918
+ <fo:block margin-right="3.5mm">
915
919
  <fo:block font-size="18pt" font-weight="bold" margin-top="12pt" role="H1">
916
920
 
917
921
  <xsl:apply-templates select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-intro']"/>
@@ -928,27 +932,29 @@
928
932
 
929
933
  </fo:block>
930
934
 
931
- <xsl:for-each select="xalan:nodeset($lang_other)/lang">
932
- <xsl:variable name="lang_other" select="."/>
935
+ <xsl:if test="not($stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM')">
936
+ <xsl:for-each select="xalan:nodeset($lang_other)/lang">
937
+ <xsl:variable name="lang_other" select="."/>
933
938
 
934
- <fo:block font-size="12pt"><xsl:value-of select="$linebreak"/></fo:block>
935
- <fo:block font-size="11pt" font-style="italic" line-height="1.1" role="H1">
939
+ <fo:block font-size="12pt"><xsl:value-of select="$linebreak"/></fo:block>
940
+ <fo:block font-size="11pt" font-style="italic" line-height="1.1" role="H1">
936
941
 
937
- <!-- Example: title-intro fr -->
938
- <xsl:apply-templates select="$XML/iso:iso-standard/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-intro']"/>
942
+ <!-- Example: title-intro fr -->
943
+ <xsl:apply-templates select="$XML/iso:iso-standard/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-intro']"/>
939
944
 
940
- <xsl:apply-templates select="$XML/iso:iso-standard/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-main']"/>
945
+ <xsl:apply-templates select="$XML/iso:iso-standard/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-main']"/>
941
946
 
942
- <xsl:apply-templates select="$XML/iso:iso-standard/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-part']">
943
- <xsl:with-param name="curr_lang" select="$lang_other"/>
944
- </xsl:apply-templates>
947
+ <xsl:apply-templates select="$XML/iso:iso-standard/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-part']">
948
+ <xsl:with-param name="curr_lang" select="$lang_other"/>
949
+ </xsl:apply-templates>
945
950
 
946
- <xsl:apply-templates select="$XML/iso:iso-standard/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-amd']">
947
- <xsl:with-param name="curr_lang" select="$lang_other"/>
948
- </xsl:apply-templates>
951
+ <xsl:apply-templates select="$XML/iso:iso-standard/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-amd']">
952
+ <xsl:with-param name="curr_lang" select="$lang_other"/>
953
+ </xsl:apply-templates>
949
954
 
950
- </fo:block>
951
- </xsl:for-each>
955
+ </fo:block>
956
+ </xsl:for-each>
957
+ </xsl:if>
952
958
 
953
959
  <xsl:if test="$stage-abbreviation = 'NWIP' or $stage-abbreviation = 'NP' or $stage-abbreviation = 'PWI' or $stage-abbreviation = 'AWI' or $stage-abbreviation = 'WD' or $stage-abbreviation = 'CD' or $stage-abbreviation = 'FDIS'">
954
960
  <fo:block margin-top="10mm">
@@ -1591,13 +1597,19 @@
1591
1597
  </xsl:if>
1592
1598
 
1593
1599
  <fo:block font-weight="normal" line-height="1.1">
1594
- <xsl:value-of select="$doctype_uppercased"/>
1600
+ <xsl:choose>
1601
+ <xsl:when test="$isMainLang = 'false' and $curr_lang = 'fr'">AMENDEMENT</xsl:when>
1602
+ <xsl:otherwise><xsl:value-of select="$doctype_uppercased"/></xsl:otherwise>
1603
+ </xsl:choose>
1595
1604
  <xsl:variable name="amendment-number" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@amendment"/>
1596
1605
  <xsl:if test="normalize-space($amendment-number) != ''">
1597
1606
  <xsl:text> </xsl:text><xsl:value-of select="$amendment-number"/>
1598
1607
  </xsl:if>
1599
- <xsl:text>: </xsl:text>
1600
- <xsl:apply-templates/>
1608
+
1609
+ <xsl:if test="not($stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM')">
1610
+ <xsl:text>: </xsl:text>
1611
+ <xsl:apply-templates/>
1612
+ </xsl:if>
1601
1613
  </fo:block>
1602
1614
 
1603
1615
  </fo:block>
@@ -2012,18 +2024,27 @@
2012
2024
  </fo:table>
2013
2025
  </fo:block-container>
2014
2026
  </fo:static-content>
2015
- <fo:static-content flow-name="header-first">
2016
- <fo:block-container margin-top="13mm" height="9mm" width="172mm" border-top="0.5mm solid black" border-bottom="0.5mm solid black" display-align="center" background-color="white">
2017
- <fo:block text-align-last="justify" font-size="12pt" font-weight="bold">
2027
+ <fo:static-content flow-name="header-first" role="artifact">
2028
+ <xsl:choose>
2029
+ <xsl:when test="$stage-abbreviation = 'FDAmd' or $stage-abbreviation = 'FDAM' or $stage-abbreviation = 'DAmd' or $stage-abbreviation = 'DAM'">
2030
+ <fo:block-container height="24mm" display-align="before">
2031
+ <fo:block font-size="12pt" font-weight="bold" text-align="right" padding-top="12.5mm"><xsl:value-of select="$ISOname"/></fo:block>
2032
+ </fo:block-container>
2033
+ </xsl:when>
2034
+ <xsl:otherwise>
2035
+ <fo:block-container margin-top="13mm" height="9mm" width="172mm" border-top="0.5mm solid black" border-bottom="0.5mm solid black" display-align="center" background-color="white">
2036
+ <fo:block text-align-last="justify" font-size="12pt" font-weight="bold">
2018
2037
 
2019
- <xsl:value-of select="$stagename-header-firstpage"/>
2038
+ <xsl:value-of select="$stagename-header-firstpage"/>
2020
2039
 
2021
- <fo:inline keep-together.within-line="always">
2022
- <fo:leader leader-pattern="space"/>
2023
- <fo:inline><xsl:value-of select="$ISOname"/></fo:inline>
2024
- </fo:inline>
2025
- </fo:block>
2026
- </fo:block-container>
2040
+ <fo:inline keep-together.within-line="always">
2041
+ <fo:leader leader-pattern="space"/>
2042
+ <fo:inline><xsl:value-of select="$ISOname"/></fo:inline>
2043
+ </fo:inline>
2044
+ </fo:block>
2045
+ </fo:block-container>
2046
+ </xsl:otherwise>
2047
+ </xsl:choose>
2027
2048
  </fo:static-content>
2028
2049
  <fo:static-content flow-name="header-odd" role="artifact">
2029
2050
  <fo:block-container height="24mm" display-align="before">
@@ -2130,10 +2151,18 @@
2130
2151
 
2131
2152
  <xsl:param name="table_if_debug">false</xsl:param> <!-- set 'true' to put debug width data before table or dl -->
2132
2153
 
2133
- <xsl:variable name="isGenerateTableIF_">
2154
+ <xsl:variable name="isApplyAutolayoutAlgorithm_">
2155
+ true
2156
+ </xsl:variable>
2157
+ <xsl:variable name="isApplyAutolayoutAlgorithm" select="normalize-space($isApplyAutolayoutAlgorithm_)"/>
2134
2158
 
2159
+ <xsl:variable name="isGenerateTableIF_">
2160
+ <xsl:choose>
2161
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
2135
2162
  <xsl:value-of select="normalize-space($table_if) = 'true'"/>
2136
-
2163
+ </xsl:when>
2164
+ <xsl:otherwise>false</xsl:otherwise>
2165
+ </xsl:choose>
2137
2166
  </xsl:variable>
2138
2167
  <xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/>
2139
2168
 
@@ -2562,6 +2591,9 @@
2562
2591
  <xsl:attribute-set name="import-style">
2563
2592
  </xsl:attribute-set>
2564
2593
 
2594
+ <xsl:attribute-set name="component-style">
2595
+ </xsl:attribute-set>
2596
+
2565
2597
  <xsl:attribute-set name="recommendation-style">
2566
2598
 
2567
2599
  </xsl:attribute-set>
@@ -2778,9 +2810,7 @@
2778
2810
  </xsl:attribute-set>
2779
2811
 
2780
2812
  <xsl:attribute-set name="dt-block-style">
2781
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
2782
-
2783
- <xsl:attribute name="margin-top">0pt</xsl:attribute>
2813
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
2784
2814
 
2785
2815
  </xsl:attribute-set>
2786
2816
 
@@ -3749,6 +3779,7 @@
3749
3779
 
3750
3780
  <xsl:variable name="margin-side">
3751
3781
  <xsl:choose>
3782
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">0</xsl:when>
3752
3783
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
3753
3784
  <xsl:otherwise>0</xsl:otherwise>
3754
3785
  </xsl:choose>
@@ -3819,6 +3850,7 @@
3819
3850
  </td>
3820
3851
  </tr>
3821
3852
  -->
3853
+ <!-- Simple_table=<xsl:copy-of select="$simple-table"/> -->
3822
3854
  <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
3823
3855
 
3824
3856
  </xsl:when>
@@ -3955,9 +3987,17 @@
3955
3987
  <xsl:template name="calculate-column-widths">
3956
3988
  <xsl:param name="table"/>
3957
3989
  <xsl:param name="cols-count"/>
3958
-
3990
+ <xsl:choose>
3991
+ <xsl:when test="$isApplyAutolayoutAlgorithm = 'true'">
3959
3992
  <xsl:call-template name="get-calculated-column-widths-autolayout-algorithm"/>
3960
-
3993
+ </xsl:when>
3994
+ <xsl:otherwise>
3995
+ <xsl:call-template name="calculate-column-widths-proportional">
3996
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3997
+ <xsl:with-param name="table" select="$table"/>
3998
+ </xsl:call-template>
3999
+ </xsl:otherwise>
4000
+ </xsl:choose>
3961
4001
  </xsl:template>
3962
4002
 
3963
4003
  <!-- ================================================== -->
@@ -4135,6 +4175,7 @@
4135
4175
  <!-- (https://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.5.2) -->
4136
4176
  <!-- ================================================== -->
4137
4177
 
4178
+ <!-- INPUT: table with columns widths, generated by table_if.xsl -->
4138
4179
  <xsl:template name="calculate-column-widths-autolayout-algorithm">
4139
4180
  <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
4140
4181
 
@@ -4146,67 +4187,6 @@
4146
4187
 
4147
4188
  <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
4148
4189
 
4149
- <!-- get current table id -->
4150
- <xsl:variable name="table_id" select="@id"/>
4151
- <!-- find table by id in the file 'table_widths' -->
4152
- <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
4153
- <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
4154
-
4155
- <!-- table='<xsl:copy-of select="$table"/>' -->
4156
- <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
4157
- <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
4158
- <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
4159
-
4160
- <xsl:variable name="table_with_cell_widths_">
4161
- <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
4162
- </xsl:variable>
4163
- <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
4164
-
4165
- <!-- <xsl:if test="$table_if_debug = 'true'">
4166
- <xsl:copy-of select="$table_with_cell_widths"/>
4167
- </xsl:if> -->
4168
-
4169
- <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
4170
-
4171
- <xsl:variable name="column_widths_">
4172
- <!-- iteration of columns -->
4173
- <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
4174
- <xsl:variable name="pos" select="position()"/>
4175
- <column>
4176
- <xsl:attribute name="width_max">
4177
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
4178
- <xsl:sort select="." data-type="number" order="descending"/>
4179
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4180
- </xsl:for-each>
4181
- </xsl:attribute>
4182
- <xsl:attribute name="width_min">
4183
- <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
4184
- <xsl:sort select="." data-type="number" order="descending"/>
4185
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4186
- </xsl:for-each>
4187
- </xsl:attribute>
4188
- </column>
4189
- </xsl:for-each>
4190
- </xsl:variable>
4191
- <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
4192
-
4193
- <!-- <column_widths>
4194
- <xsl:copy-of select="$column_widths"/>
4195
- </column_widths> -->
4196
-
4197
- <!-- These in turn, are used to find the minimum and maximum width for the table. -->
4198
- <xsl:variable name="table_widths_">
4199
- <table>
4200
- <xsl:attribute name="width_max">
4201
- <xsl:value-of select="sum($column_widths/column/@width_max)"/>
4202
- </xsl:attribute>
4203
- <xsl:attribute name="width_min">
4204
- <xsl:value-of select="sum($column_widths/column/@width_min)"/>
4205
- </xsl:attribute>
4206
- </table>
4207
- </xsl:variable>
4208
- <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
4209
-
4210
4190
  <xsl:variable name="page_width">
4211
4191
  <xsl:choose>
4212
4192
  <xsl:when test="$parent_table_page-width != ''">
@@ -4219,16 +4199,13 @@
4219
4199
  </xsl:variable>
4220
4200
 
4221
4201
  <xsl:if test="$table_if_debug = 'true'">
4222
- <table_width>
4223
- <xsl:copy-of select="$table_widths"/>
4224
- </table_width>
4225
- <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
4202
+ <page_width><xsl:value-of select="$page_width"/></page_width>
4226
4203
  </xsl:if>
4227
4204
 
4228
4205
  <!-- There are three cases: -->
4229
4206
  <xsl:choose>
4230
4207
  <!-- 1. The minimum table width is equal to or wider than the available space -->
4231
- <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
4208
+ <xsl:when test="@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
4232
4209
  <!-- call old algorithm -->
4233
4210
  <case1/>
4234
4211
  <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
@@ -4238,10 +4215,10 @@
4238
4215
  </xsl:call-template> -->
4239
4216
  </xsl:when>
4240
4217
  <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
4241
- <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
4218
+ <xsl:when test="@width_max &lt;= $page_width">
4242
4219
  <case2/>
4243
4220
  <autolayout/>
4244
- <xsl:for-each select="$column_widths/column/@width_max">
4221
+ <xsl:for-each select="column/@width_max">
4245
4222
  <column divider="100"><xsl:value-of select="."/></column>
4246
4223
  </xsl:for-each>
4247
4224
  </xsl:when>
@@ -4251,19 +4228,19 @@
4251
4228
  For each column, let d be the difference between maximum and minimum width of that column.
4252
4229
  Now set the column's width to the minimum width plus d times W over D.
4253
4230
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
4254
- <xsl:when test="($table_widths/table/@width_max &gt; $page_width and $table_widths/table/@width_min &lt; $page_width) or ($table_widths/table/@width_min &gt;= $page_width)">
4231
+ <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
4255
4232
  <!-- difference between the available space and the minimum table width -->
4256
- <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
4233
+ <xsl:variable name="W" select="$page_width - @width_min"/>
4257
4234
  <W><xsl:value-of select="$W"/></W>
4258
4235
  <!-- difference between maximum and minimum width of the table -->
4259
- <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
4236
+ <xsl:variable name="D" select="@width_max - @width_min"/>
4260
4237
  <D><xsl:value-of select="$D"/></D>
4261
4238
  <case3/>
4262
4239
  <autolayout/>
4263
- <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
4240
+ <xsl:if test="@width_min &gt;= $page_width">
4264
4241
  <split_keep-within-line>true</split_keep-within-line>
4265
4242
  </xsl:if>
4266
- <xsl:for-each select="$column_widths/column">
4243
+ <xsl:for-each select="column">
4267
4244
  <!-- difference between maximum and minimum width of that column. -->
4268
4245
  <xsl:variable name="d" select="@width_max - @width_min"/>
4269
4246
  <d><xsl:value-of select="$d"/></d>
@@ -4289,23 +4266,39 @@
4289
4266
 
4290
4267
  <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
4291
4268
 
4269
+ <ancestor_tree>
4270
+ <xsl:for-each select="ancestor::*">
4271
+ <ancestor><xsl:value-of select="local-name()"/></ancestor>
4272
+ </xsl:for-each>
4273
+ </ancestor_tree>
4274
+
4292
4275
  <xsl:variable name="parent_table_page-width_">
4293
4276
  <xsl:if test="$parent_table_id != ''">
4294
4277
  <!-- determine column number in the parent table -->
4295
4278
  <xsl:variable name="parent_table_column_number">
4296
4279
  <xsl:choose>
4297
- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
4280
+ <!-- <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when> -->
4281
+ <xsl:when test="(ancestor::*[local-name() = 'dd' or local-name() = 'table' or local-name() = 'dl'])[last()][local-name() = 'dd' or local-name() = 'dl']">2</xsl:when>
4298
4282
  <xsl:otherwise> <!-- parent is table -->
4299
4283
  <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
4300
4284
  </xsl:otherwise>
4301
4285
  </xsl:choose>
4302
4286
  </xsl:variable>
4303
4287
  <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
4304
- <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
4288
+
4289
+ <xsl:variable name="parent_table_column_" select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
4290
+ <xsl:variable name="parent_table_column" select="xalan:nodeset($parent_table_column_)"/>
4291
+ <!-- <xsl:variable name="divider">
4292
+ <xsl:value-of select="$parent_table_column/@divider"/>
4293
+ <xsl:if test="not($parent_table_column/@divider)">1</xsl:if>
4294
+ </xsl:variable> -->
4295
+ <xsl:value-of select="$parent_table_column/text()"/> <!-- * 10 -->
4305
4296
  </xsl:if>
4306
4297
  </xsl:variable>
4307
4298
  <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
4308
4299
 
4300
+ <parent_table_page-width><xsl:value-of select="$parent_table_page-width"/></parent_table_page-width>
4301
+
4309
4302
  <!-- get current table id -->
4310
4303
  <xsl:variable name="table_id" select="@id"/>
4311
4304
 
@@ -4326,50 +4319,6 @@
4326
4319
 
4327
4320
  </xsl:template> <!-- get-calculated-column-widths-autolayout-algorithm -->
4328
4321
 
4329
- <!-- ============================= -->
4330
- <!-- mode: determine_cell_widths-if -->
4331
- <!-- ============================= -->
4332
- <xsl:template match="@*|node()" mode="determine_cell_widths-if">
4333
- <xsl:copy>
4334
- <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
4335
- </xsl:copy>
4336
- </xsl:template>
4337
-
4338
- <xsl:template match="td | th" mode="determine_cell_widths-if">
4339
- <xsl:copy>
4340
- <xsl:copy-of select="@*"/>
4341
-
4342
- <!-- The maximum width is given by the widest line. -->
4343
- <xsl:attribute name="width_max">
4344
- <xsl:for-each select="p_len">
4345
- <xsl:sort select="." data-type="number" order="descending"/>
4346
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4347
- </xsl:for-each>
4348
- </xsl:attribute>
4349
-
4350
- <!-- The minimum width is given by the widest text element (word, image, etc.) -->
4351
- <xsl:variable name="width_min">
4352
- <xsl:for-each select="word_len">
4353
- <xsl:sort select="." data-type="number" order="descending"/>
4354
- <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
4355
- </xsl:for-each>
4356
- </xsl:variable>
4357
- <xsl:attribute name="width_min">
4358
- <xsl:value-of select="$width_min"/>
4359
- </xsl:attribute>
4360
-
4361
- <xsl:if test="$width_min = 0">
4362
- <xsl:attribute name="width_min">1</xsl:attribute>
4363
- </xsl:if>
4364
-
4365
- <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
4366
-
4367
- </xsl:copy>
4368
- </xsl:template>
4369
- <!-- ============================= -->
4370
- <!-- END mode: determine_cell_widths-if -->
4371
- <!-- ============================= -->
4372
-
4373
4322
  <!-- ================================================== -->
4374
4323
  <!-- Calculate column's width based on HTML4 algorithm -->
4375
4324
  <!-- ================================================== -->
@@ -4614,6 +4563,7 @@
4614
4563
  <xsl:when test="$table_or_dl = 'table'">
4615
4564
  <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
4616
4565
  <fo:table-row number-columns-spanned="{$col_count}">
4566
+ <xsl:copy-of select="../@font-weight"/>
4617
4567
  <!-- <test_table><xsl:copy-of select="."/></test_table> -->
4618
4568
  <xsl:call-template name="td"/>
4619
4569
  </fo:table-row>
@@ -4775,7 +4725,7 @@
4775
4725
 
4776
4726
  <xsl:apply-templates/>
4777
4727
 
4778
- <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
4728
+ <xsl:if test="$isGenerateTableIF = 'true'"> <fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
4779
4729
 
4780
4730
  </fo:block>
4781
4731
  </fo:table-cell>
@@ -5108,6 +5058,7 @@
5108
5058
  <xsl:template match="*[local-name()='dl']">
5109
5059
  <xsl:variable name="isAdded" select="@added"/>
5110
5060
  <xsl:variable name="isDeleted" select="@deleted"/>
5061
+ <!-- <dl><xsl:copy-of select="."/></dl> -->
5111
5062
  <fo:block-container>
5112
5063
 
5113
5064
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -5659,21 +5610,16 @@
5659
5610
  <!-- virtual html table for dl/[dt and dd] for IF (Intermediate Format) -->
5660
5611
  <xsl:template match="*[local-name()='dt']" mode="dl_if">
5661
5612
  <xsl:param name="id"/>
5662
- <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
5663
5613
  <tr>
5664
5614
  <td>
5665
5615
  <xsl:copy-of select="node()"/>
5666
5616
  </td>
5667
5617
  <td>
5668
-
5669
- <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
5670
-
5671
- <!-- get paragraphs from nested 'dl' -->
5672
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
5673
-
5618
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
5619
+ <!-- get paragraphs from nested 'dl' -->
5620
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
5674
5621
  </td>
5675
5622
  </tr>
5676
-
5677
5623
  </xsl:template>
5678
5624
  <xsl:template match="*[local-name()='dd']" mode="dl_if"/>
5679
5625
 
@@ -6324,6 +6270,9 @@
6324
6270
  <xsl:variable name="td">
6325
6271
  <xsl:element name="td">
6326
6272
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
6273
+ <xsl:if test="local-name()='th'">
6274
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
6275
+ </xsl:if>
6327
6276
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
6328
6277
  <xsl:apply-templates mode="simple-table-colspan"/>
6329
6278
  </xsl:element>
@@ -6336,6 +6285,9 @@
6336
6285
  <xsl:otherwise>
6337
6286
  <xsl:element name="td">
6338
6287
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
6288
+ <xsl:if test="local-name()='th'">
6289
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
6290
+ </xsl:if>
6339
6291
  <xsl:apply-templates mode="simple-table-colspan"/>
6340
6292
  </xsl:element>
6341
6293
  </xsl:otherwise>
@@ -6465,8 +6417,14 @@
6465
6417
  <xsl:copy-of select="@*"/>
6466
6418
  <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
6467
6419
  <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
6420
+ <xsl:variable name="divide">
6421
+ <xsl:choose>
6422
+ <xsl:when test="@divide"><xsl:value-of select="@divide"/></xsl:when>
6423
+ <xsl:otherwise>1</xsl:otherwise>
6424
+ </xsl:choose>
6425
+ </xsl:variable>
6468
6426
  <xsl:attribute name="id">
6469
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
6427
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
6470
6428
  </xsl:attribute>
6471
6429
 
6472
6430
  <xsl:for-each select="*[local-name() = 'p']">
@@ -6474,10 +6432,12 @@
6474
6432
  <xsl:copy-of select="@*"/>
6475
6433
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
6476
6434
  <xsl:attribute name="id">
6477
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
6435
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
6478
6436
  </xsl:attribute>
6479
6437
 
6480
- <xsl:copy-of select="node()"/>
6438
+ <!-- <xsl:copy-of select="node()" /> -->
6439
+ <xsl:apply-templates mode="simple-table-noid"/>
6440
+
6481
6441
  </xsl:copy>
6482
6442
  </xsl:for-each>
6483
6443
 
@@ -6506,7 +6466,7 @@
6506
6466
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
6507
6467
  <xsl:copy>
6508
6468
  <xsl:attribute name="id">
6509
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
6469
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
6510
6470
  </xsl:attribute>
6511
6471
  <xsl:copy-of select="node()"/>
6512
6472
  </xsl:copy>
@@ -6515,6 +6475,24 @@
6515
6475
  </xsl:copy>
6516
6476
 
6517
6477
  </xsl:template>
6478
+
6479
+ <xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p']//*" mode="simple-table-noid">
6480
+ <xsl:copy>
6481
+ <xsl:choose>
6482
+ <xsl:when test="$isGenerateTableIF = 'true'">
6483
+ <xsl:copy-of select="@*[local-name() != 'id']"/> <!-- to prevent repeat id in colspan/rowspan cells -->
6484
+ <!-- <xsl:if test="local-name() = 'dl' or local-name() = 'table'">
6485
+ <xsl:copy-of select="@id"/>
6486
+ </xsl:if> -->
6487
+ </xsl:when>
6488
+ <xsl:otherwise>
6489
+ <xsl:copy-of select="@*"/>
6490
+ </xsl:otherwise>
6491
+ </xsl:choose>
6492
+ <xsl:apply-templates select="node()" mode="simple-table-noid"/>
6493
+ </xsl:copy>
6494
+ </xsl:template>
6495
+
6518
6496
  <!-- End mode: simple-table-id -->
6519
6497
  <!-- ===================== -->
6520
6498
  <!-- ===================== -->
@@ -6524,7 +6502,7 @@
6524
6502
  <!-- =============================== -->
6525
6503
  <xsl:template match="@*|node()" mode="td_text_with_formatting">
6526
6504
  <xsl:copy>
6527
- <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
6505
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
6528
6506
  </xsl:copy>
6529
6507
  </xsl:template>
6530
6508
 
@@ -6638,6 +6616,10 @@
6638
6616
 
6639
6617
  <fo:inline xsl:use-attribute-sets="mathml-style">
6640
6618
 
6619
+ <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
6620
+ <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
6621
+ </xsl:if>
6622
+
6641
6623
  <xsl:call-template name="setTrackChangesStyles">
6642
6624
  <xsl:with-param name="isAdded" select="$isAdded"/>
6643
6625
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
@@ -6985,6 +6967,10 @@
6985
6967
 
6986
6968
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
6987
6969
 
6970
+ <xsl:if test="$doctype = 'amendment' and parent::*[local-name() = 'quote']">
6971
+ <xsl:attribute name="font-size">inherit</xsl:attribute>
6972
+ </xsl:if>
6973
+
6988
6974
  <fo:block-container margin-left="0mm">
6989
6975
 
6990
6976
  <fo:block>
@@ -7035,6 +7021,10 @@
7035
7021
  <xsl:template match="*[local-name() = 'termnote']">
7036
7022
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
7037
7023
 
7024
+ <xsl:if test="$doctype = 'amendment' and parent::*[local-name() = 'quote']">
7025
+ <xsl:attribute name="font-size">inherit</xsl:attribute>
7026
+ </xsl:if>
7027
+
7038
7028
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
7039
7029
 
7040
7030
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
@@ -8525,41 +8515,47 @@
8525
8515
  </fo:block>
8526
8516
  </xsl:template>
8527
8517
 
8528
- <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
8518
+ <xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit'] | *[local-name() = 'div'][@type = 'requirement-inherit'] | *[local-name() = 'div'][@type = 'recommendation-inherit'] | *[local-name() = 'div'][@type = 'permission-inherit']">
8529
8519
  <fo:block xsl:use-attribute-sets="inherit-style">
8530
8520
  <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
8531
8521
  </fo:block>
8532
8522
  </xsl:template>
8533
8523
 
8534
- <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
8524
+ <xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description'] | *[local-name() = 'div'][@type = 'requirement-description'] | *[local-name() = 'div'][@type = 'recommendation-description'] | *[local-name() = 'div'][@type = 'permission-description']">
8535
8525
  <fo:block xsl:use-attribute-sets="description-style">
8536
8526
  <xsl:apply-templates/>
8537
8527
  </fo:block>
8538
8528
  </xsl:template>
8539
8529
 
8540
- <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
8530
+ <xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification'] | *[local-name() = 'div'][@type = 'requirement-specification'] | *[local-name() = 'div'][@type = 'recommendation-specification'] | *[local-name() = 'div'][@type = 'permission-specification']">
8541
8531
  <fo:block xsl:use-attribute-sets="specification-style">
8542
8532
  <xsl:apply-templates/>
8543
8533
  </fo:block>
8544
8534
  </xsl:template>
8545
8535
 
8546
- <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
8536
+ <xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target'] | *[local-name() = 'div'][@type = 'requirement-measurement-target'] | *[local-name() = 'div'][@type = 'recommendation-measurement-target'] | *[local-name() = 'div'][@type = 'permission-measurement-target']">
8547
8537
  <fo:block xsl:use-attribute-sets="measurement-target-style">
8548
8538
  <xsl:apply-templates/>
8549
8539
  </fo:block>
8550
8540
  </xsl:template>
8551
8541
 
8552
- <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
8542
+ <xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification'] | *[local-name() = 'div'][@type = 'requirement-verification'] | *[local-name() = 'div'][@type = 'recommendation-verification'] | *[local-name() = 'div'][@type = 'permission-verification']">
8553
8543
  <fo:block xsl:use-attribute-sets="verification-style">
8554
8544
  <xsl:apply-templates/>
8555
8545
  </fo:block>
8556
8546
  </xsl:template>
8557
8547
 
8558
- <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
8548
+ <xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import'] | *[local-name() = 'div'][@type = 'requirement-import'] | *[local-name() = 'div'][@type = 'recommendation-import'] | *[local-name() = 'div'][@type = 'permission-import']">
8559
8549
  <fo:block xsl:use-attribute-sets="import-style">
8560
8550
  <xsl:apply-templates/>
8561
8551
  </fo:block>
8562
8552
  </xsl:template>
8553
+
8554
+ <xsl:template match="*[local-name() = 'div'][starts-with(@type, 'requirement-component')] | *[local-name() = 'div'][starts-with(@type, 'recommendation-component')] | *[local-name() = 'div'][starts-with(@type, 'permission-component')]">
8555
+ <fo:block xsl:use-attribute-sets="component-style">
8556
+ <xsl:apply-templates/>
8557
+ </fo:block>
8558
+ </xsl:template>
8563
8559
  <!-- ========== -->
8564
8560
  <!-- END -->
8565
8561
  <!-- ========== -->
@@ -8615,15 +8611,12 @@
8615
8611
 
8616
8612
  <xsl:template match="*[local-name()='tr']" mode="requirement">
8617
8613
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
8618
- <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
8619
- <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
8620
- </xsl:if>
8621
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
8622
- <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
8623
- </xsl:if>
8624
- <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
8625
- <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
8614
+
8615
+ <xsl:if test="parent::*[local-name()='thead'] or starts-with(*[local-name()='td' or local-name()='th'][1], 'Requirement ') or starts-with(*[local-name()='td' or local-name()='th'][1], 'Recommendation ')">
8616
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
8617
+
8626
8618
  </xsl:if>
8619
+
8627
8620
  <xsl:apply-templates mode="requirement"/>
8628
8621
  </fo:table-row>
8629
8622
  </xsl:template>
@@ -8969,6 +8962,11 @@
8969
8962
  <fo:block-container margin-left="0mm">
8970
8963
  <fo:block-container xsl:use-attribute-sets="quote-style">
8971
8964
 
8965
+ <xsl:if test="$doctype = 'amendment' and (*[local-name() = 'note'] or *[local-name() = 'termnote'])">
8966
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
8967
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
8968
+ </xsl:if>
8969
+
8972
8970
  <fo:block-container margin-left="0mm" margin-right="0mm">
8973
8971
  <fo:block role="BlockQuote">
8974
8972
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -10136,7 +10134,7 @@
10136
10134
  </tbody>
10137
10135
  </xsl:variable>
10138
10136
  <xsl:variable name="cols-count" select="count(xalan:nodeset($toc_table_simple)/*/tr[1]/td)"/>
10139
- <xsl:call-template name="calculate-column-widths">
10137
+ <xsl:call-template name="calculate-column-widths-proportional">
10140
10138
  <xsl:with-param name="cols-count" select="$cols-count"/>
10141
10139
  <xsl:with-param name="table" select="$toc_table_simple"/>
10142
10140
  </xsl:call-template>