metanorma-ieee 1.5.4 → 1.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -562,9 +562,7 @@
562
562
 
563
563
  <xsl:call-template name="insertHeaderFooter">
564
564
  <xsl:with-param name="document_id" select="$document_id"/>
565
- <xsl:with-param name="title_prefix" select="$title_prefix"/>
566
565
  <xsl:with-param name="title" select="$title"/>
567
- <xsl:with-param name="doctype" select="$doctype"/>
568
566
  <xsl:with-param name="copyright_year" select="$copyright_year"/>
569
567
  <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
570
568
  <xsl:with-param name="hideFooter"><xsl:if test="not(contains('amendment corrigendum erratum', $subdoctype) and $subdoctype != '')">false</xsl:if></xsl:with-param>
@@ -592,7 +590,6 @@
592
590
  <xsl:call-template name="insertFootnoteSeparator"/>
593
591
 
594
592
  <xsl:call-template name="insertHeaderFooter">
595
- <xsl:with-param name="doctype" select="$doctype"/>
596
593
  <xsl:with-param name="copyright_year" select="$copyright_year"/>
597
594
  <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
598
595
  <!-- <xsl:with-param name="hideHeader">true</xsl:with-param> -->
@@ -686,9 +683,7 @@
686
683
  <xsl:call-template name="insertFootnoteSeparator"/>
687
684
  <xsl:call-template name="insertHeaderFooter">
688
685
  <xsl:with-param name="document_id" select="$document_id"/>
689
- <xsl:with-param name="title_prefix" select="$title_prefix"/>
690
686
  <xsl:with-param name="title" select="$title"/>
691
- <xsl:with-param name="doctype" select="$doctype"/>
692
687
  <xsl:with-param name="copyright_year" select="$copyright_year"/>
693
688
  <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
694
689
  </xsl:call-template>
@@ -708,7 +703,6 @@
708
703
  <fo:page-sequence master-reference="document-nonstandard" force-page-count="no-force" font-family="Calibri Light">
709
704
 
710
705
  <xsl:call-template name="insertHeaderFooter">
711
- <xsl:with-param name="doctype" select="$doctype"/>
712
706
  <xsl:with-param name="copyright_year" select="$copyright_year"/>
713
707
  <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
714
708
  <xsl:with-param name="hideHeader">true</xsl:with-param>
@@ -748,22 +742,14 @@
748
742
  <!-- End Second page(s) -->
749
743
  <!-- =================== -->
750
744
 
745
+ <xsl:variable name="updated_xml_with_pages">
746
+ <xsl:call-template name="processPrefaceAndMainSectionsIEEE_items"/>
747
+ </xsl:variable>
748
+
751
749
  <!-- ================================ -->
752
750
  <!-- PREFACE pages (Introduction, Contents -->
753
751
  <!-- ================================ -->
754
752
 
755
- <xsl:variable name="structured_xml_preface">
756
- <xsl:apply-templates select="/*/mn:preface/mn:introduction" mode="flatxml"/>
757
- </xsl:variable>
758
-
759
- <!-- structured_xml_preface=<xsl:copy-of select="$structured_xml_preface"/> -->
760
-
761
- <xsl:variable name="paged_xml_preface">
762
- <xsl:call-template name="makePagedXML">
763
- <xsl:with-param name="structured_xml" select="$structured_xml_preface"/>
764
- </xsl:call-template>
765
- </xsl:variable>
766
-
767
753
  <xsl:if test="$debug = 'true'">
768
754
  <redirect:write file="contents_.xml">
769
755
  <xsl:copy-of select="$contents"/>
@@ -773,34 +759,53 @@
773
759
  <xsl:choose>
774
760
 
775
761
  <xsl:when test="$current_template = 'standard' or $current_template = 'draft'">
776
- <fo:page-sequence master-reference="document-draft" id="prefaceSequence"> <!-- format="i" initial-page-number="1" -->
777
762
 
778
- <xsl:call-template name="insertFootnoteSeparator"/>
763
+ <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
779
764
 
780
- <xsl:call-template name="insertHeaderFooter">
781
- <xsl:with-param name="document_id" select="$document_id"/>
782
- <xsl:with-param name="title_prefix" select="$title_prefix"/>
783
- <xsl:with-param name="title" select="$title"/>
784
- <xsl:with-param name="doctype" select="$doctype"/>
785
- <xsl:with-param name="copyright_year" select="$copyright_year"/>
786
- <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
787
- </xsl:call-template>
765
+ <!-- <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]"> -->
766
+ <xsl:for-each select=".//mn:page_sequence[mn:introduction]">
788
767
 
789
- <fo:flow flow-name="xsl-region-body">
768
+ <fo:page-sequence master-reference="document-draft"> <!-- format="i" initial-page-number="1" -->
790
769
 
791
- <fo:block>
792
- <xsl:for-each select="xalan:nodeset($paged_xml_preface)/mn:page">
793
- <xsl:apply-templates select="*" mode="page"/>
794
- <fo:block break-after="page"/>
795
- </xsl:for-each>
796
- </fo:block>
770
+ <xsl:call-template name="insertFootnoteSeparator"/>
797
771
 
798
- <xsl:apply-templates select="/*/mn:preface/mn:clause[@type = 'toc']">
799
- <xsl:with-param name="num" select="$num"/>
800
- </xsl:apply-templates>
772
+ <xsl:call-template name="insertHeaderFooter">
773
+ <xsl:with-param name="document_id" select="$document_id"/>
774
+ <xsl:with-param name="title" select="$title"/>
775
+ <xsl:with-param name="copyright_year" select="$copyright_year"/>
776
+ <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
777
+ </xsl:call-template>
778
+
779
+ <fo:flow flow-name="xsl-region-body">
780
+
781
+ <fo:block>
782
+ <xsl:apply-templates/>
783
+ </fo:block>
784
+
785
+ </fo:flow>
786
+ </fo:page-sequence>
787
+ </xsl:for-each>
788
+ </xsl:for-each>
789
+
790
+ <xsl:for-each select="/*/mn:preface/mn:clause[@type = 'toc']">
791
+ <fo:page-sequence master-reference="document-draft">
792
+ <xsl:call-template name="insertFootnoteSeparator"/>
793
+
794
+ <xsl:call-template name="insertHeaderFooter">
795
+ <xsl:with-param name="document_id" select="$document_id"/>
796
+ <xsl:with-param name="title" select="$title"/>
797
+ <xsl:with-param name="copyright_year" select="$copyright_year"/>
798
+ <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
799
+ </xsl:call-template>
800
+
801
+ <fo:flow flow-name="xsl-region-body">
802
+ <xsl:apply-templates select=".">
803
+ <xsl:with-param name="num" select="$num"/>
804
+ </xsl:apply-templates>
805
+ </fo:flow>
806
+ </fo:page-sequence>
807
+ </xsl:for-each>
801
808
 
802
- </fo:flow>
803
- </fo:page-sequence>
804
809
  </xsl:when> <!-- 'standard' or 'draft' -->
805
810
 
806
811
  <xsl:when test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
@@ -812,7 +817,6 @@
812
817
  <fo:page-sequence master-reference="page-toc" force-page-count="no-force">
813
818
 
814
819
  <xsl:call-template name="insertHeaderFooter">
815
- <xsl:with-param name="doctype" select="$doctype"/>
816
820
  <xsl:with-param name="copyright_year" select="$copyright_year"/>
817
821
  <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
818
822
  <xsl:with-param name="hideHeader">true</xsl:with-param>
@@ -858,239 +862,268 @@
858
862
  </xsl:choose>
859
863
 
860
864
  <!-- ================================ -->
861
- <!-- END: PREFACE pages (Table of Contents, Foreword -->
865
+ <!-- END: PREFACE pages (Introduction, Table of Contents -->
862
866
  <!-- ================================ -->
863
867
 
864
- <!-- item - page sequence -->
865
- <xsl:variable name="structured_xml_">
868
+ <xsl:for-each select="xalan:nodeset($updated_xml_with_pages)"> <!-- set context to preface/sections -->
866
869
 
867
- <xsl:choose>
870
+ <!-- Introduction, Acknowledgements, Abstract for whitepaper and report -->
871
+ <xsl:if test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
872
+ <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
873
+ <xsl:call-template name="insert_page-sequence">
874
+ <xsl:with-param name="document_id" select="$document_id"/>
875
+ <xsl:with-param name="title" select="$title"/>
876
+ <xsl:with-param name="doctype" select="$doctype"/>
877
+ <xsl:with-param name="copyright_year" select="$copyright_year"/>
878
+ <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
879
+ <xsl:with-param name="is_first_sequence" select="normalize-space(position() = 1)"/>
880
+ </xsl:call-template>
881
+ </xsl:for-each>
882
+ </xsl:if>
868
883
 
869
- <xsl:when test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
884
+ <xsl:for-each select=".//mn:page_sequence[parent::mn:sections][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
885
+ <xsl:call-template name="insert_page-sequence">
886
+ <xsl:with-param name="document_id" select="$document_id"/>
887
+ <xsl:with-param name="title" select="$title"/>
888
+ <xsl:with-param name="doctype" select="$doctype"/>
889
+ <xsl:with-param name="copyright_year" select="$copyright_year"/>
890
+ <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
891
+ <xsl:with-param name="is_first_sequence" select="normalize-space(position() = 1)"/>
892
+ </xsl:call-template>
893
+ </xsl:for-each>
870
894
 
871
- <item>
872
- <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:introduction" mode="flatxml"/>
873
- </item>
895
+ <!-- Annexes, Bibliography and Index -->
896
+ <xsl:for-each select=".//mn:page_sequence[not(parent::mn:preface) and not(parent::mn:sections)][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
897
+ <xsl:call-template name="insert_page-sequence">
898
+ <xsl:with-param name="document_id" select="$document_id"/>
899
+ <xsl:with-param name="title" select="$title"/>
900
+ <xsl:with-param name="doctype" select="$doctype"/>
901
+ <xsl:with-param name="copyright_year" select="$copyright_year"/>
902
+ <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
903
+ </xsl:call-template>
904
+ </xsl:for-each>
874
905
 
875
- <item>
876
- <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:acknowledgements" mode="flatxml"/>
877
- </item>
906
+ </xsl:for-each>
878
907
 
879
- <item>
880
- <xsl:apply-templates select="/mn:metanorma/mn:preface/mn:abstract" mode="flatxml"/>
881
- </item>
908
+ <!-- ===================== -->
909
+ <!-- End IEEE pages -->
910
+ <!-- ===================== -->
882
911
 
883
- <xsl:for-each select="/*/mn:sections/*[not(contains(@class, 'zzSTDTitle'))]"> <!-- each section starts with a new page -->
884
- <item>
885
- <xsl:if test="position() = 1">
886
- <xsl:copy-of select="ancestor::mn:sections/*[contains(@class, 'zzSTDTitle')]"/> <!-- put title on the 1st page -->
887
- </xsl:if>
888
- <xsl:apply-templates select="." mode="flatxml"/>
889
- </item>
890
- </xsl:for-each>
891
- </xsl:when> <!-- $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->
912
+ <xsl:call-template name="back-page"/>
892
913
 
893
- <xsl:when test="$current_template = 'standard'">
894
- <xsl:choose>
895
- <xsl:when test="$page_break_between_sections = 'true'">
896
- <xsl:for-each select="/*/mn:sections/*[not(contains(@class, 'zzSTDTitle'))]"> <!-- each section starts with a new page -->
897
- <item>
898
- <xsl:if test="position() = 1">
899
- <xsl:copy-of select="ancestor::mn:sections/*[contains(@class, 'zzSTDTitle')]"/> <!-- put title on the 1st page -->
900
- </xsl:if>
901
- <xsl:apply-templates select="." mode="flatxml"/>
902
- </item>
903
- </xsl:for-each>
904
- </xsl:when>
905
- <xsl:otherwise>
906
- <item>
907
- <xsl:apply-templates select="/*/mn:sections/*" mode="flatxml"/>
908
- </item>
909
- </xsl:otherwise>
910
- </xsl:choose>
911
- </xsl:when> <!-- $current_template = 'standard' -->
914
+ <xsl:if test="not(xalan:nodeset($updated_xml_with_pages)//mn:page_sequence[*])">
915
+ <fo:page-sequence master-reference="document-nonstandard" force-page-count="no-force">
916
+ <fo:flow flow-name="xsl-region-body">
917
+ <fo:block><!-- prevent fop error for empty document --></fo:block>
918
+ </fo:flow>
919
+ </fo:page-sequence>
920
+ </xsl:if>
912
921
 
913
- <xsl:otherwise>
914
- <item>
915
- <xsl:apply-templates select="/*/mn:sections/*" mode="flatxml"/>
916
- </item>
917
- </xsl:otherwise>
918
- </xsl:choose>
922
+ </xsl:for-each>
923
+ </xsl:for-each> <!-- END of //metanorma (former ieee-standard) iteration -->
919
924
 
920
- <!-- Annexes -->
921
- <xsl:for-each select="/*/mn:annex">
922
- <item>
923
- <xsl:apply-templates select="." mode="flatxml"/>
924
- </item>
925
- </xsl:for-each>
925
+ <xsl:if test="not(//mn:metanorma)">
926
+ <fo:page-sequence master-reference="document-nonstandard" force-page-count="no-force">
927
+ <fo:flow flow-name="xsl-region-body">
928
+ <fo:block><!-- prevent fop error for empty document --></fo:block>
929
+ </fo:flow>
930
+ </fo:page-sequence>
931
+ </xsl:if>
926
932
 
927
- <!-- Bibliography -->
928
- <xsl:for-each select="/*/mn:bibliography/*">
929
- <item><xsl:apply-templates select="." mode="flatxml"/></item>
930
- </xsl:for-each>
933
+ </fo:root>
934
+ </xsl:template>
931
935
 
932
- <item>
933
- <xsl:copy-of select="//mn:indexsect"/>
934
- </item>
936
+ <xsl:template name="processPrefaceAndMainSectionsIEEE_items">
937
+ <xsl:variable name="updated_xml_step_move_pagebreak">
938
+ <xsl:element name="{$root_element}" namespace="{$namespace_full}">
939
+ <xsl:call-template name="copyCommonElements"/>
935
940
 
936
- </xsl:variable>
941
+ <xsl:element name="preface" namespace="{$namespace_full}"> <!-- save context element -->
942
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
943
+ <xsl:for-each select="/*/mn:preface/mn:introduction">
944
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
945
+ </xsl:for-each>
946
+ </xsl:element>
937
947
 
938
- <xsl:if test="$debug = 'true'">
939
- <redirect:write file="page_items.xml">
940
- <xsl:copy-of select="$structured_xml_"/>
941
- </redirect:write>
942
- </xsl:if>
948
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
949
+ <xsl:for-each select="/*/mn:preface/mn:acknowledgements">
950
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
951
+ </xsl:for-each>
952
+ </xsl:element>
943
953
 
944
- <!-- page break before each section -->
945
- <xsl:variable name="structured_xml">
946
- <xsl:for-each select="xalan:nodeset($structured_xml_)/item[*]">
947
- <xsl:element name="pagebreak" namespace="{$namespace_full}"/>
948
- <xsl:copy-of select="./*"/>
954
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
955
+ <xsl:for-each select="/*/mn:preface/mn:abstract">
956
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
949
957
  </xsl:for-each>
950
- </xsl:variable>
958
+ </xsl:element>
951
959
 
952
- <!-- structured_xml=<xsl:copy-of select="$structured_xml" />=end structured_xml -->
960
+ </xsl:element>
953
961
 
954
- <xsl:variable name="paged_xml">
955
- <xsl:call-template name="makePagedXML">
956
- <xsl:with-param name="structured_xml" select="$structured_xml"/>
957
- </xsl:call-template>
958
- </xsl:variable>
962
+ <xsl:element name="sections" namespace="{$namespace_full}"> <!-- save context element -->
963
+ <xsl:choose>
964
+ <xsl:when test="$page_break_between_sections = 'true'">
965
+ <xsl:for-each select="/*/mn:sections/*[not(contains(@class, 'zzSTDTitle'))]"> <!-- each section starts with a new page -->
966
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
967
+ <xsl:if test="position() = 1">
968
+ <xsl:copy-of select="ancestor::mn:sections/*[contains(@class, 'zzSTDTitle')]"/> <!-- put title on the 1st page -->
969
+ </xsl:if>
970
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
971
+ </xsl:element>
972
+ </xsl:for-each>
973
+ </xsl:when>
974
+ <xsl:otherwise>
975
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
976
+ <xsl:apply-templates select="/*/mn:sections/*" mode="update_xml_step_move_pagebreak"/>
977
+ </xsl:element>
978
+ </xsl:otherwise>
979
+ </xsl:choose>
980
+ </xsl:element>
959
981
 
960
- <xsl:if test="$debug = 'true'">
961
- <redirect:write file="paged_xml.xml">
962
- <xsl:copy-of select="$paged_xml"/>
963
- </redirect:write>
964
- </xsl:if>
982
+ <!-- Annexes -->
983
+ <xsl:for-each select="/*/mn:annex">
984
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
985
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
986
+ </xsl:element>
987
+ </xsl:for-each>
965
988
 
966
- <!-- paged_xml=<xsl:copy-of select="$paged_xml"/> -->
989
+ <!-- Bibliography -->
990
+ <xsl:for-each select="/*/mn:bibliography/*">
991
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
992
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
993
+ </xsl:element>
994
+ </xsl:for-each>
967
995
 
968
- <xsl:for-each select="xalan:nodeset($paged_xml)/mn:page[*]">
969
- <fo:page-sequence master-reference="document-draft" force-page-count="no-force">
996
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
997
+ <xsl:copy-of select="//mn:indexsect"/>
998
+ </xsl:element>
970
999
 
971
- <xsl:if test="@orientation = 'landscape'">
972
- <xsl:attribute name="master-reference">document-draft-<xsl:value-of select="@orientation"/></xsl:attribute>
973
- </xsl:if>
1000
+ </xsl:element>
1001
+ </xsl:variable>
974
1002
 
975
- <xsl:if test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
976
- <xsl:attribute name="master-reference">document-nonstandard</xsl:attribute>
977
- <xsl:if test="@orientation = 'landscape'">
978
- <xsl:attribute name="master-reference">document-nonstandard<xsl:value-of select="@orientation"/></xsl:attribute>
979
- </xsl:if>
980
- </xsl:if>
1003
+ <xsl:variable name="updated_xml_step_move_pagebreak_filename" select="concat($output_path,'_main_', java:getTime(java:java.util.Date.new()), '.xml')"/>
981
1004
 
982
- <xsl:if test="$current_template = 'standard'">
983
- <xsl:attribute name="master-reference">document-standard<xsl:if test="position() = 1">-first</xsl:if></xsl:attribute>
984
- <xsl:if test="@orientation = 'landscape'">
985
- <xsl:attribute name="master-reference">document-standard<xsl:value-of select="@orientation"/></xsl:attribute>
986
- </xsl:if>
987
- </xsl:if>
1005
+ <redirect:write file="{$updated_xml_step_move_pagebreak_filename}">
1006
+ <xsl:copy-of select="$updated_xml_step_move_pagebreak"/>
1007
+ </redirect:write>
988
1008
 
989
- <!-- <xsl:if test="position() = 1">
990
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
991
- </xsl:if> -->
992
- <xsl:if test=".//mn:indexsect">
993
- <xsl:attribute name="master-reference">index</xsl:attribute>
994
- </xsl:if>
1009
+ <xsl:copy-of select="document($updated_xml_step_move_pagebreak_filename)"/>
995
1010
 
996
- <xsl:call-template name="insertFootnoteSeparator"/>
1011
+ <xsl:if test="$debug = 'true'">
1012
+ <redirect:write file="page_sequence_preface_and_main.xml">
1013
+ <xsl:copy-of select="$updated_xml_step_move_pagebreak"/>
1014
+ </redirect:write>
1015
+ </xsl:if>
997
1016
 
998
- <xsl:choose>
999
- <xsl:when test="$current_template = 'standard' or $current_template = 'draft'">
1000
- <xsl:call-template name="insertHeaderFooter">
1001
- <xsl:with-param name="document_id" select="$document_id"/>
1002
- <xsl:with-param name="title_prefix" select="$title_prefix"/>
1003
- <xsl:with-param name="title" select="$title"/>
1004
- <xsl:with-param name="doctype" select="$doctype"/>
1005
- <xsl:with-param name="copyright_year" select="$copyright_year"/>
1006
- <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
1007
- <xsl:with-param name="orientation">@orientation</xsl:with-param>
1008
- </xsl:call-template>
1009
- </xsl:when>
1010
- <xsl:otherwise> <!-- ($current_template = 'international-standard' and $isDraft = 'false') or $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->
1011
- <xsl:call-template name="insertHeaderFooter">
1012
- <xsl:with-param name="doctype" select="$doctype"/>
1013
- <xsl:with-param name="copyright_year" select="$copyright_year"/>
1014
- <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
1015
- <xsl:with-param name="hideHeader">true</xsl:with-param>
1016
- </xsl:call-template>
1017
- </xsl:otherwise>
1018
- </xsl:choose>
1017
+ <xsl:call-template name="deleteFile">
1018
+ <xsl:with-param name="filepath" select="$updated_xml_step_move_pagebreak_filename"/>
1019
+ </xsl:call-template>
1019
1020
 
1020
- <fo:flow flow-name="xsl-region-body">
1021
- <!-- debugpage=<xsl:copy-of select="."/> -->
1021
+ </xsl:template> <!-- processPrefaceAndMainSectionsIEEE_items -->
1022
1022
 
1023
- <!-- <xsl:if test="position() = 1">
1024
-
1025
- <xsl:choose>
1026
- <xsl:when test="$current_template = 'draft'">
1027
- <fo:block font-family="Arial" font-size="23pt" font-weight="bold" margin-top="70pt" margin-bottom="48pt">
1028
-
1029
- <xsl:if test="contains('amendment corrigendum erratum', $subdoctype) and $subdoctype != ''">
1030
- <xsl:attribute name="font-size">24pt</xsl:attribute>
1031
- </xsl:if>
1032
-
1033
- <xsl:copy-of select="$title_prefix"/>
1034
- <xsl:copy-of select="$title"/>
1035
-
1036
- </fo:block>
1037
- </xsl:when>
1038
-
1039
- <xsl:when test="$current_template = 'standard'">
1040
- <fo:block font-family="Arial" font-weight="bold" margin-top="13mm" space-after="12pt">
1041
- <fo:block font-weight="bold" space-before="13mm">
1042
- <xsl:copy-of select="$title_standard_coverpage"/>
1043
- </fo:block>
1044
- </fo:block>
1045
- </xsl:when>
1046
-
1047
- <xsl:otherwise> --><!-- $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->
1048
-
1049
- <!-- <xsl:attribute name="font-family">Calibri Light</xsl:attribute>
1050
- <xsl:attribute name="font-size">12pt</xsl:attribute>
1051
-
1052
- <fo:block font-family="Arial Black" font-size="20pt" margin-top="18pt">
1053
- <xsl:copy-of select="$title"/>
1054
- </fo:block>
1055
- <xsl:call-template name="addBlueBox"/>
1056
- <fo:block margin-bottom="12pt">&#xa0;</fo:block>
1057
- </xsl:otherwise>
1058
- </xsl:choose>
1059
-
1060
- </xsl:if> -->
1023
+ <xsl:template name="insert_page-sequence">
1024
+ <xsl:param name="document_id"/>
1025
+ <xsl:param name="title"/>
1026
+ <xsl:param name="doctype"/>
1027
+ <xsl:param name="copyright_year"/>
1028
+ <xsl:param name="copyright_holder"/>
1029
+ <xsl:param name="is_first_sequence"/>
1061
1030
 
1062
- <xsl:apply-templates select="*" mode="page"/>
1063
- <xsl:if test="position() = last()"><fo:block id="lastBlockMain"/></xsl:if>
1064
- </fo:flow>
1065
- </fo:page-sequence>
1066
- </xsl:for-each>
1067
- <!-- ===================== -->
1068
- <!-- End IEEE pages -->
1069
- <!-- ===================== -->
1031
+ <fo:page-sequence master-reference="document-draft" force-page-count="no-force">
1070
1032
 
1071
- <xsl:call-template name="back-page"/>
1033
+ <xsl:if test="@orientation = 'landscape'">
1034
+ <xsl:attribute name="master-reference">document-draft-<xsl:value-of select="@orientation"/></xsl:attribute>
1035
+ </xsl:if>
1072
1036
 
1073
- <xsl:if test="not(xalan:nodeset($paged_xml)/mn:page[*])">
1074
- <fo:page-sequence master-reference="document-nonstandard" force-page-count="no-force">
1075
- <fo:flow flow-name="xsl-region-body">
1076
- <fo:block><!-- prevent fop error for empty document --></fo:block>
1077
- </fo:flow>
1078
- </fo:page-sequence>
1079
- </xsl:if>
1037
+ <xsl:if test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
1038
+ <xsl:attribute name="master-reference">document-nonstandard</xsl:attribute>
1039
+ <xsl:if test="@orientation = 'landscape'">
1040
+ <xsl:attribute name="master-reference">document-nonstandard<xsl:value-of select="@orientation"/></xsl:attribute>
1041
+ </xsl:if>
1042
+ </xsl:if>
1080
1043
 
1081
- </xsl:for-each>
1082
- </xsl:for-each> <!-- END of //metanorma (former ieee-standard) iteration -->
1044
+ <xsl:if test="$current_template = 'standard'">
1045
+ <xsl:attribute name="master-reference">document-standard<xsl:if test="position() = 1 and $is_first_sequence = 'true'">-first</xsl:if></xsl:attribute>
1046
+ <xsl:if test="@orientation = 'landscape'">
1047
+ <xsl:attribute name="master-reference">document-standard<xsl:value-of select="@orientation"/></xsl:attribute>
1048
+ </xsl:if>
1049
+ </xsl:if>
1083
1050
 
1084
- <xsl:if test="not(//mn:metanorma)">
1085
- <fo:page-sequence master-reference="document-nonstandard" force-page-count="no-force">
1086
- <fo:flow flow-name="xsl-region-body">
1087
- <fo:block><!-- prevent fop error for empty document --></fo:block>
1088
- </fo:flow>
1089
- </fo:page-sequence>
1051
+ <!-- <xsl:if test="position() = 1">
1052
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
1053
+ </xsl:if> -->
1054
+ <xsl:if test=".//mn:indexsect">
1055
+ <xsl:attribute name="master-reference">index</xsl:attribute>
1090
1056
  </xsl:if>
1091
1057
 
1092
- </fo:root>
1093
- </xsl:template>
1058
+ <xsl:call-template name="insertFootnoteSeparator"/>
1059
+
1060
+ <xsl:choose>
1061
+ <xsl:when test="$current_template = 'standard' or $current_template = 'draft'">
1062
+ <xsl:call-template name="insertHeaderFooter">
1063
+ <xsl:with-param name="document_id" select="$document_id"/>
1064
+ <xsl:with-param name="title" select="$title"/>
1065
+ <xsl:with-param name="copyright_year" select="$copyright_year"/>
1066
+ <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
1067
+ <xsl:with-param name="orientation">@orientation</xsl:with-param>
1068
+ </xsl:call-template>
1069
+ </xsl:when>
1070
+ <xsl:otherwise> <!-- ($current_template = 'international-standard' and $isDraft = 'false') or $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->
1071
+ <xsl:call-template name="insertHeaderFooter">
1072
+ <xsl:with-param name="copyright_year" select="$copyright_year"/>
1073
+ <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
1074
+ <xsl:with-param name="hideHeader">true</xsl:with-param>
1075
+ </xsl:call-template>
1076
+ </xsl:otherwise>
1077
+ </xsl:choose>
1078
+
1079
+ <fo:flow flow-name="xsl-region-body">
1080
+ <!-- debugpage=<xsl:copy-of select="."/> -->
1081
+
1082
+ <!-- <xsl:if test="position() = 1">
1083
+
1084
+ <xsl:choose>
1085
+ <xsl:when test="$current_template = 'draft'">
1086
+ <fo:block font-family="Arial" font-size="23pt" font-weight="bold" margin-top="70pt" margin-bottom="48pt">
1087
+
1088
+ <xsl:if test="contains('amendment corrigendum erratum', $subdoctype) and $subdoctype != ''">
1089
+ <xsl:attribute name="font-size">24pt</xsl:attribute>
1090
+ </xsl:if>
1091
+
1092
+ <xsl:copy-of select="$title_prefix"/>
1093
+ <xsl:copy-of select="$title"/>
1094
+
1095
+ </fo:block>
1096
+ </xsl:when>
1097
+
1098
+ <xsl:when test="$current_template = 'standard'">
1099
+ <fo:block font-family="Arial" font-weight="bold" margin-top="13mm" space-after="12pt">
1100
+ <fo:block font-weight="bold" space-before="13mm">
1101
+ <xsl:copy-of select="$title_standard_coverpage"/>
1102
+ </fo:block>
1103
+ </fo:block>
1104
+ </xsl:when>
1105
+
1106
+ <xsl:otherwise> --><!-- $current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report' -->
1107
+
1108
+ <!-- <xsl:attribute name="font-family">Calibri Light</xsl:attribute>
1109
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
1110
+
1111
+ <fo:block font-family="Arial Black" font-size="20pt" margin-top="18pt">
1112
+ <xsl:copy-of select="$title"/>
1113
+ </fo:block>
1114
+ <xsl:call-template name="addBlueBox"/>
1115
+ <fo:block margin-bottom="12pt">&#xa0;</fo:block>
1116
+ </xsl:otherwise>
1117
+ </xsl:choose>
1118
+
1119
+ </xsl:if> -->
1120
+
1121
+ <!-- <xsl:apply-templates select="*" /> --> <!-- mode="page" -->
1122
+ <xsl:apply-templates/> <!-- mode="page" -->
1123
+ <!-- <xsl:if test="position() = last()"><fo:block id="lastBlockMain"/></xsl:if> -->
1124
+ </fo:flow>
1125
+ </fo:page-sequence>
1126
+ </xsl:template> <!-- insert_page-sequence -->
1094
1127
 
1095
1128
  <xsl:template name="cover-page">
1096
1129
  <xsl:param name="num"/>
@@ -1139,10 +1172,7 @@
1139
1172
 
1140
1173
  <xsl:call-template name="insertHeaderFooter">
1141
1174
  <xsl:with-param name="document_id" select="$document_id"/>
1142
- <xsl:with-param name="title_prefix" select="$title_prefix"/>
1143
1175
  <xsl:with-param name="title" select="$title"/>
1144
- <xsl:with-param name="doctype" select="$doctype"/>
1145
-
1146
1176
  <xsl:with-param name="copyright_year" select="$copyright_year"/>
1147
1177
  <xsl:with-param name="copyright_holder" select="$copyright_holder"/>
1148
1178
  <xsl:with-param name="hideFooter">true</xsl:with-param>
@@ -1285,7 +1315,6 @@
1285
1315
  <xsl:with-param name="enabler" select="$enabler"/>
1286
1316
  <xsl:with-param name="standard_number" select="$standard_number"/>
1287
1317
  <xsl:with-param name="history" select="$history_text"/>
1288
- <!-- <xsl:with-param name="standard_title_prefix" select="$title_prefix"/> -->
1289
1318
  <xsl:with-param name="cutoff_date" select="$cutoff_date"/>
1290
1319
  <xsl:with-param name="expiration_date" select="$expiration_date"/>
1291
1320
  </xsl:call-template>
@@ -1325,7 +1354,7 @@
1325
1354
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
1326
1355
  </xsl:if>
1327
1356
 
1328
- <fo:block text-align-last="justify">
1357
+ <fo:block text-align-last="justify" role="SKIP">
1329
1358
  <xsl:attribute name="margin-left"><xsl:value-of select="$margin-left * (@level - 1)"/>mm</xsl:attribute>
1330
1359
  <xsl:if test="@type = 'annex'">
1331
1360
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -1388,14 +1417,14 @@
1388
1417
 
1389
1418
  <xsl:attribute name="margin-left"><xsl:value-of select="$provisional-distance-between-starts * (@level - 1)"/>mm</xsl:attribute>
1390
1419
 
1391
- <fo:list-item>
1392
- <fo:list-item-label end-indent="label-end()">
1393
- <fo:block>
1420
+ <fo:list-item role="SKIP">
1421
+ <fo:list-item-label end-indent="label-end()" role="SKIP">
1422
+ <fo:block role="SKIP">
1394
1423
  <xsl:value-of select="@section"/>
1395
1424
  </fo:block>
1396
1425
  </fo:list-item-label>
1397
- <fo:list-item-body start-indent="body-start()">
1398
- <fo:block text-align-last="justify">
1426
+ <fo:list-item-body start-indent="body-start()" role="SKIP">
1427
+ <fo:block text-align-last="justify" role="SKIP">
1399
1428
 
1400
1429
  <xsl:if test="@type = 'annex'">
1401
1430
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -1940,46 +1969,6 @@
1940
1969
  </xsl:copy>
1941
1970
  </xsl:template>
1942
1971
 
1943
- <xsl:template name="makePagedXML">
1944
- <xsl:param name="structured_xml"/>
1945
- <xsl:choose>
1946
- <xsl:when test="not(xalan:nodeset($structured_xml)/mn:pagebreak)">
1947
- <xsl:element name="page" namespace="{$namespace_full}">
1948
- <xsl:copy-of select="xalan:nodeset($structured_xml)"/>
1949
- </xsl:element>
1950
- </xsl:when>
1951
- <xsl:otherwise>
1952
- <xsl:for-each select="xalan:nodeset($structured_xml)/mn:pagebreak">
1953
-
1954
- <xsl:variable name="pagebreak_id" select="generate-id()"/>
1955
- <!-- <xsl:variable name="pagebreak_previous_orientation" select="normalize-space(preceding-sibling::mn:pagebreak[1]/@orientation)"/> -->
1956
-
1957
- <!-- copy elements before pagebreak -->
1958
- <xsl:element name="page" namespace="{$namespace_full}">
1959
- <xsl:if test="not(preceding-sibling::mn:pagebreak)">
1960
- <xsl:copy-of select="../@*"/>
1961
- </xsl:if>
1962
- <!-- copy previous pagebreak orientation -->
1963
- <xsl:copy-of select="preceding-sibling::mn:pagebreak[1]/@orientation"/>
1964
- <!-- <xsl:if test="$pagebreak_previous_orientation != ''">
1965
- <xsl:attribute name="orientation"><xsl:value-of select="$pagebreak_previous_orientation"/></xsl:attribute>
1966
- </xsl:if> -->
1967
- <xsl:copy-of select="preceding-sibling::node()[following-sibling::mn:pagebreak[1][generate-id(.) = $pagebreak_id]][not(self::mn:pagebreak)]"/>
1968
- </xsl:element>
1969
-
1970
- <!-- copy elements after last page break -->
1971
- <xsl:if test="position() = last() and following-sibling::node()">
1972
- <xsl:element name="page" namespace="{$namespace_full}">
1973
- <xsl:copy-of select="@orientation"/>
1974
- <xsl:copy-of select="following-sibling::node()"/>
1975
- </xsl:element>
1976
- </xsl:if>
1977
-
1978
- </xsl:for-each>
1979
- </xsl:otherwise>
1980
- </xsl:choose>
1981
- </xsl:template>
1982
-
1983
1972
  <xsl:template match="mn:p[@class = 'zzSTDTitle1']" priority="4">
1984
1973
  <xsl:choose>
1985
1974
  <xsl:when test="$current_template = 'draft' or $current_template = 'standard'">
@@ -2151,10 +2140,10 @@
2151
2140
 
2152
2141
  <xsl:choose>
2153
2142
  <xsl:when test="$current_template = 'standard'">
2154
- <fo:list-block xsl:use-attribute-sets="toc-listof-item-style">
2155
- <fo:list-item>
2156
- <fo:list-item-label end-indent="label-end()">
2157
- <fo:block>
2143
+ <fo:list-block xsl:use-attribute-sets="toc-listof-item-style" role="TOCI">
2144
+ <fo:list-item role="SKIP">
2145
+ <fo:list-item-label end-indent="label-end()" role="SKIP">
2146
+ <fo:block role="SKIP">
2158
2147
  <fo:basic-link internal-destination="{@id}">
2159
2148
  <xsl:call-template name="setAltText">
2160
2149
  <xsl:with-param name="value" select="@alt-text"/>
@@ -2163,8 +2152,8 @@
2163
2152
  </fo:basic-link>
2164
2153
  </fo:block>
2165
2154
  </fo:list-item-label>
2166
- <fo:list-item-body start-indent="body-start()">
2167
- <fo:block text-align-last="justify">
2155
+ <fo:list-item-body start-indent="body-start()" role="SKIP">
2156
+ <fo:block text-align-last="justify" role="SKIP">
2168
2157
  <fo:basic-link internal-destination="{@id}">
2169
2158
  <xsl:call-template name="setAltText">
2170
2159
  <xsl:with-param name="value" select="@alt-text"/>
@@ -2235,214 +2224,9 @@
2235
2224
  <!-- display titles -->
2236
2225
  <!-- ==================== -->
2237
2226
 
2238
- <!-- ================================= -->
2239
- <!-- XML Flattening -->
2240
- <!-- ================================= -->
2241
- <xsl:template match="@*|node()" mode="flatxml">
2242
- <xsl:copy>
2243
- <xsl:apply-templates select="@*|node()" mode="flatxml"/>
2244
- </xsl:copy>
2245
- </xsl:template>
2246
-
2247
- <xsl:template match="processing-instruction()" mode="flatxml">
2248
- <xsl:copy-of select="."/>
2249
- </xsl:template>
2250
-
2251
- <xsl:template match="mn:preface//mn:clause[@type = 'front_notes']" mode="flatxml" priority="2">
2252
- <!-- ignore processing (source STS is front/notes) -->
2253
- </xsl:template>
2254
-
2255
- <xsl:template match="mn:foreword | mn:foreword//mn:clause | mn:preface//mn:clause[not(@type = 'corrigenda') and not(@type = 'related-refs') and not(@type = 'toc') ] | mn:introduction | mn:introduction//mn:clause | mn:sections//mn:clause | mn:annex | mn:annex//mn:clause | mn:references | mn:bibliography/mn:clause | mn:sections//mn:terms | mn:sections//mn:definitions | mn:annex//mn:definitions" mode="flatxml" name="clause">
2256
- <!-- From:
2257
- <clause>
2258
- <title>...</title>
2259
- <p>...</p>
2260
- </clause>
2261
- To:
2262
- <clause/>
2263
- <title>...</title>
2264
- <p>...</p>
2265
- -->
2266
- <xsl:copy>
2267
- <xsl:apply-templates select="@*" mode="flatxml"/>
2268
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2269
- <xsl:if test="self::mn:foreword or self::mn:introduction or parent::mn:preface or parent::mn:sections or (self::mn:references and parent::mn:bibliography) or (self::mn:clause and parent::mn:bibliography) or self::mn:annex or parent::mn:annex">
2270
- <xsl:attribute name="mainsection">true</xsl:attribute>
2271
- </xsl:if>
2272
-
2273
- </xsl:copy>
2274
- <xsl:apply-templates mode="flatxml"/>
2275
-
2276
- </xsl:template>
2277
-
2278
- <xsl:template match="mn:term" mode="flatxml" priority="2">
2279
- <xsl:copy>
2280
- <xsl:apply-templates select="@*" mode="flatxml"/>
2281
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2282
- <xsl:variable name="level">
2283
- <xsl:call-template name="getLevel"/>
2284
- </xsl:variable>
2285
- <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
2286
- <xsl:attribute name="ancestor">sections</xsl:attribute>
2287
- <xsl:apply-templates select="node()[not(self::mn:term)]" mode="flatxml"/>
2288
- </xsl:copy>
2289
- <xsl:apply-templates select="mn:term" mode="flatxml"/>
2290
- </xsl:template>
2291
-
2292
- <xsl:template match="mn:introduction//mn:fmt-title | mn:foreword//mn:fmt-title | mn:sections//mn:fmt-title | mn:annex//mn:fmt-title | mn:bibliography/mn:clause/mn:fmt-title | mn:references/mn:fmt-title" mode="flatxml" priority="2"> <!-- | mn:term -->
2293
- <xsl:copy>
2294
- <xsl:apply-templates select="@*" mode="flatxml"/>
2295
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2296
- <xsl:variable name="level">
2297
- <xsl:call-template name="getLevel"/>
2298
- </xsl:variable>
2299
- <xsl:attribute name="depth"><xsl:value-of select="$level"/></xsl:attribute>
2300
- <xsl:if test="parent::mn:annex">
2301
- <xsl:attribute name="depth">1</xsl:attribute>
2302
- </xsl:if>
2303
- <xsl:if test="../@inline-header = 'true'">
2304
- <xsl:copy-of select="../@inline-header"/>
2305
- </xsl:if>
2306
- <xsl:attribute name="ancestor">
2307
- <xsl:choose>
2308
- <xsl:when test="ancestor::mn:foreword">foreword</xsl:when>
2309
- <xsl:when test="ancestor::mn:introduction">introduction</xsl:when>
2310
- <xsl:when test="ancestor::mn:sections">sections</xsl:when>
2311
- <xsl:when test="ancestor::mn:annex">annex</xsl:when>
2312
- <xsl:when test="ancestor::mn:bibliography">bibliography</xsl:when>
2313
- </xsl:choose>
2314
- </xsl:attribute>
2315
-
2316
- <xsl:apply-templates mode="flatxml"/>
2317
- </xsl:copy>
2318
- </xsl:template>
2319
-
2320
- <!-- recalculate table width -->
2321
- <!-- 210 - (15+22+20) = 153 -->
2322
- <xsl:variable name="max_table_width_mm" select="$pageWidth - ($marginLeftRight1 + $marginLeftRight2)"/>
2323
- <!-- 153 / 25.4 * 96 dpi = 578px-->
2324
- <xsl:variable name="max_table_width_px" select="round($max_table_width_mm div 25.4 * 96)"/>
2325
- <!-- landscape table -->
2326
- <xsl:variable name="max_table_landscape_width_mm" select="$pageHeight - ($marginTop + $marginBottom)"/>
2327
- <xsl:variable name="max_table_landscape_width_px" select="round($max_table_landscape_width_mm div 25.4 * 96)"/>
2328
-
2329
- <xsl:template match="mn:table/@width[contains(., 'px')]" mode="flatxml">
2330
- <xsl:variable name="width" select="number(substring-before(., 'px'))"/>
2331
- <xsl:variable name="isLandscapeTable" select="../preceding-sibling::*[not(self::mn:table)][1]/@orientation = 'landscape'"/>
2332
- <xsl:attribute name="width">
2333
- <xsl:choose>
2334
- <xsl:when test="normalize-space($isLandscapeTable) = 'true' and $width &gt; $max_table_landscape_width_px"><xsl:value-of select="$max_table_landscape_width_px"/>px</xsl:when>
2335
- <xsl:when test="normalize-space($isLandscapeTable) = 'false' and $width &gt; $max_table_width_px"><xsl:value-of select="$max_table_width_px"/>px</xsl:when>
2336
- <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
2337
- </xsl:choose>
2338
- </xsl:attribute>
2339
- </xsl:template>
2340
-
2341
- <!-- add @to = figure, table, clause -->
2342
- <!-- add @depth = from -->
2343
- <xsl:template match="mn:fmt-xref" mode="flatxml">
2344
- <xsl:copy>
2345
- <xsl:apply-templates select="@*" mode="flatxml"/>
2346
- <xsl:variable name="target" select="@target"/>
2347
- <xsl:attribute name="to">
2348
- <xsl:value-of select="local-name(//*[@id = current()/@target][1])"/>
2349
- </xsl:attribute>
2350
- <xsl:attribute name="depth">
2351
- <xsl:value-of select="//*[@id = current()/@target][1]/mn:fmt-title/@depth"/>
2352
- </xsl:attribute>
2353
- <xsl:apply-templates select="node()" mode="flatxml"/>
2354
- </xsl:copy>
2355
- </xsl:template>
2356
-
2357
- <xsl:template match="text()" mode="flatxml">
2358
- <xsl:choose>
2359
- <xsl:when test="contains(., $non_breaking_hyphen)">
2360
- <xsl:call-template name="replaceChar">
2361
- <xsl:with-param name="text" select="."/>
2362
- <xsl:with-param name="replace" select="$non_breaking_hyphen"/>
2363
- <xsl:with-param name="by" select="'-'"/>
2364
- </xsl:call-template>
2365
- </xsl:when>
2366
- <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
2367
- </xsl:choose>
2368
-
2369
- </xsl:template>
2370
-
2371
- <!-- remove newlines chars (0xd 0xa, 0xa, 0xd) in p, em, strong (except in sourcecode). -->
2372
- <xsl:template match="*[not(ancestor::mn:sourcecode)]/*[self::mn:p or self::mn:strong or self::mn:em]/text()" mode="flatxml">
2373
- <xsl:choose>
2374
- <xsl:when test=". = '&#13;' or . = '&#10;' or . = '&#13;&#10;'"/>
2375
- <xsl:when test="contains(., $non_breaking_hyphen)">
2376
- <xsl:call-template name="replaceChar">
2377
- <xsl:with-param name="text" select="."/>
2378
- <xsl:with-param name="replace" select="$non_breaking_hyphen"/>
2379
- <xsl:with-param name="by" select="'-'"/>
2380
- </xsl:call-template>
2381
- </xsl:when>
2382
- <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
2383
- </xsl:choose>
2384
- </xsl:template>
2385
-
2386
- <!-- change @reference to actual value, and add skip_footnote_body="true" for repeatable (2nd, 3rd, ...) -->
2387
- <!--
2388
- <fn reference="1">
2389
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
2390
- </fn>
2391
- -->
2392
-
2393
- <xsl:template match="mn:fn[not(ancestor::*[(self::mn:table or self::mn:figure)] and not(ancestor::mn:fmt-name))]" mode="flatxml">
2394
- <xsl:variable name="p_fn_">
2395
- <xsl:call-template name="get_fn_list"/>
2396
- </xsl:variable>
2397
- <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
2398
- <xsl:variable name="gen_id" select="generate-id(.)"/>
2399
-
2400
- <xsl:copy>
2401
- <xsl:apply-templates select="@*" mode="flatxml"/>
2402
- <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
2403
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
2404
- </xsl:attribute>
2405
- <xsl:apply-templates select="node()" mode="flatxml"/>
2406
- </xsl:copy>
2407
- </xsl:template>
2408
-
2409
- <!-- <xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" mode="flatxml">
2410
- <xsl:variable name="p_fn_">
2411
- <xsl:call-template name="get_fn_list"/>
2412
- </xsl:variable>
2413
- <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
2414
- <xsl:variable name="gen_id" select="generate-id(.)"/>
2415
- <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
2416
- <xsl:variable name="reference" select="@reference"/> --><!-- @reference added to bibitem/note in step 'update_xml_step2' -->
2417
- <!-- fn sequence number in document -->
2418
- <!-- <xsl:variable name="current_fn_number" select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" />
2419
- <xsl:copy>
2420
- <xsl:apply-templates select="@*" mode="flatxml"/> -->
2421
- <!-- put actual reference number -->
2422
- <!-- <xsl:attribute name="current_fn_number">
2423
- <xsl:value-of select="$current_fn_number"/>
2424
- </xsl:attribute>
2425
- <xsl:apply-templates select="node()" mode="flatxml"/>
2426
- </xsl:copy>
2427
- </xsl:template> -->
2428
-
2429
- <xsl:template match="mn:p[@type = 'section-title']" priority="3" mode="flatxml">
2430
- <xsl:copy>
2431
- <xsl:apply-templates select="@*" mode="flatxml"/>
2432
- <xsl:if test="@depth = '1'">
2433
- <xsl:attribute name="mainsection">true</xsl:attribute>
2434
- </xsl:if>
2435
- <xsl:apply-templates select="node()" mode="flatxml"/>
2436
- </xsl:copy>
2437
- </xsl:template>
2438
-
2439
- <!-- ================================= -->
2440
- <!-- END of XML Flattening -->
2441
- <!-- ================================= -->
2442
-
2443
- <xsl:template match="*" priority="3" mode="page">
2227
+ <!-- <xsl:template match="*" priority="3" mode="page">
2444
2228
  <xsl:call-template name="elementProcessing"/>
2445
- </xsl:template>
2229
+ </xsl:template> -->
2446
2230
 
2447
2231
  <xsl:template match="mn:clauses_union/*" priority="3" mode="clauses_union">
2448
2232
  <xsl:call-template name="elementProcessing"/>
@@ -2520,7 +2304,8 @@
2520
2304
  </fo:block>
2521
2305
  </xsl:template>
2522
2306
 
2523
- <xsl:template match="mn:fmt-title[@inline-header = 'true'][following-sibling::*[1][self::mn:p] or following-sibling::*[1][self::mn:clause] or not(following-sibling::*)]" priority="3">
2307
+ <!-- <xsl:template match="mn:fmt-title[@inline-header = 'true'][following-sibling::*[1][self::mn:p] or following-sibling::*[1][self::mn:clause] or not(following-sibling::*)]" priority="3"> -->
2308
+ <xsl:template match="mn:fmt-title[../@inline-header = 'true'][following-sibling::*[1][self::mn:p] or following-sibling::*[1][self::mn:clause] or not(following-sibling::*)]" priority="3">
2524
2309
  <fo:block>
2525
2310
  <xsl:attribute name="space-before">
2526
2311
  <xsl:call-template name="getTitleMarginTop"/>
@@ -2550,24 +2335,25 @@
2550
2335
  <xsl:choose>
2551
2336
  <xsl:when test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
2552
2337
  <xsl:choose>
2553
- <xsl:when test="$level = 2">22.4pt</xsl:when>
2554
- <xsl:when test="$level = 3">4.6pt</xsl:when>
2338
+ <xsl:when test="$level = 2">28.4pt</xsl:when> <!-- 22.4pt -->
2339
+ <xsl:when test="$level = 3">12.6pt</xsl:when> <!-- 4.6pt -->
2555
2340
  <xsl:otherwise>0mm</xsl:otherwise>
2556
2341
  </xsl:choose>
2557
2342
  </xsl:when>
2558
2343
  <xsl:when test="$current_template = 'standard'">
2559
2344
  <xsl:choose>
2560
- <xsl:when test="$level = 1">12pt</xsl:when>
2561
- <xsl:when test="$level = 2">12pt</xsl:when>
2562
- <xsl:when test="$level &gt;= 3">12pt</xsl:when>
2345
+ <xsl:when test="$level = 1 and (ancestor::mn:preface or ancestor::mn:introduction or ancestor::mn:annex)">12pt</xsl:when> <!-- 12pt -->
2346
+ <xsl:when test="$level = 1">20pt</xsl:when> <!-- 12pt -->
2347
+ <xsl:when test="$level = 2">20pt</xsl:when>
2348
+ <xsl:when test="$level &gt;= 3">18pt</xsl:when>
2563
2349
  <xsl:otherwise>0mm</xsl:otherwise>
2564
2350
  </xsl:choose>
2565
2351
  </xsl:when>
2566
2352
  <xsl:otherwise>
2567
2353
  <xsl:choose>
2568
- <xsl:when test="$level = 1">18pt</xsl:when>
2569
- <xsl:when test="$level = 2">18pt</xsl:when>
2570
- <xsl:when test="$level &gt;= 3">12pt</xsl:when>
2354
+ <xsl:when test="$level = 1">26pt</xsl:when> <!-- 18pt -->
2355
+ <xsl:when test="$level = 2">28pt</xsl:when> <!-- 20pt -->
2356
+ <xsl:when test="$level &gt;= 3">18pt</xsl:when> <!-- 12pt -->
2571
2357
  <xsl:otherwise>0mm</xsl:otherwise>
2572
2358
  </xsl:choose>
2573
2359
  </xsl:otherwise>
@@ -2575,6 +2361,9 @@
2575
2361
  </xsl:template>
2576
2362
 
2577
2363
  <xsl:template name="getTitleMarginBottom">
2364
+ <xsl:variable name="level">
2365
+ <xsl:call-template name="getLevel"/>
2366
+ </xsl:variable>
2578
2367
  <xsl:choose>
2579
2368
  <xsl:when test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">
2580
2369
  <xsl:choose>
@@ -2582,7 +2371,14 @@
2582
2371
  <xsl:otherwise>12pt</xsl:otherwise>
2583
2372
  </xsl:choose>
2584
2373
  </xsl:when>
2585
- <xsl:otherwise>12pt</xsl:otherwise>
2374
+ <xsl:otherwise>
2375
+ <xsl:choose>
2376
+ <xsl:when test="$level = 1 and (ancestor::mn:preface or ancestor::mn:introduction)">12pt</xsl:when>
2377
+ <xsl:when test="$level = 1 and not(following-sibling::*[1][self::mn:clause])">12pt</xsl:when>
2378
+ <xsl:when test="$level = 1">24pt</xsl:when>
2379
+ <xsl:otherwise>12pt</xsl:otherwise>
2380
+ </xsl:choose>
2381
+ </xsl:otherwise>
2586
2382
  </xsl:choose>
2587
2383
  </xsl:template>
2588
2384
 
@@ -2627,7 +2423,8 @@
2627
2423
  <xsl:when test="$current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report'">normal</xsl:when>
2628
2424
  <xsl:otherwise>
2629
2425
  <xsl:choose>
2630
- <xsl:when test="@ancestor = 'annex' and $level = 1">normal</xsl:when>
2426
+ <!-- <xsl:when test="@ancestor = 'annex' and $level = 1">normal</xsl:when> -->
2427
+ <xsl:when test="ancestor::mn:annex and $level = 1">normal</xsl:when>
2631
2428
  <xsl:otherwise>bold</xsl:otherwise>
2632
2429
  </xsl:choose>
2633
2430
  </xsl:otherwise>
@@ -2649,7 +2446,7 @@
2649
2446
 
2650
2447
  <xsl:variable name="element-name">
2651
2448
  <xsl:choose>
2652
- <xsl:when test="@inline-header = 'true'">fo:inline</xsl:when>
2449
+ <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
2653
2450
  <xsl:otherwise>fo:block</xsl:otherwise>
2654
2451
  </xsl:choose>
2655
2452
  </xsl:variable>
@@ -2660,6 +2457,8 @@
2660
2457
  <xsl:attribute name="font-size"><xsl:value-of select="$font-size"/></xsl:attribute>
2661
2458
  <xsl:attribute name="font-weight"><xsl:value-of select="$font-weight"/></xsl:attribute>
2662
2459
  <xsl:attribute name="space-before"><xsl:value-of select="$margin-top"/></xsl:attribute>
2460
+ <!-- <xsl:attribute name="margin-top"><xsl:value-of select="$margin-top"/></xsl:attribute> -->
2461
+ <xsl:if test="ancestor::mn:introduction"><xsl:attribute name="margin-top"><xsl:value-of select="$margin-top"/></xsl:attribute></xsl:if>
2663
2462
  <xsl:attribute name="margin-bottom"><xsl:value-of select="$margin-bottom"/></xsl:attribute>
2664
2463
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2665
2464
  <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
@@ -2742,7 +2541,8 @@
2742
2541
  </xsl:otherwise>
2743
2542
  </xsl:choose>
2744
2543
 
2745
- <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and preceding-sibling::*[1][self::mn:references[@normative = 'false']]">
2544
+ <!-- <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and preceding-sibling::*[1][self::mn:references[@normative = 'false']]"> -->
2545
+ <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and ancestor::*[1][self::mn:references[@normative = 'false']]">
2746
2546
  <xsl:call-template name="addBlueBox"/>
2747
2547
  </xsl:if>
2748
2548
 
@@ -2761,7 +2561,7 @@
2761
2561
  </xsl:template>
2762
2562
 
2763
2563
  <!-- add blue box after first break in Annex title -->
2764
- <xsl:template match="mn:br[ancestor::mn:fmt-title[preceding-sibling::*[1][self::mn:annex]]]" priority="2">
2564
+ <xsl:template match="mn:br[ancestor::mn:fmt-title[parent::mn:annex]]" priority="2">
2765
2565
  <xsl:choose>
2766
2566
  <xsl:when test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') ">
2767
2567
  <xsl:if test="not(preceding-sibling::mn:br)">
@@ -2785,8 +2585,10 @@
2785
2585
  <fo:block>@ancestor=<xsl:value-of select="@ancestor"/></fo:block> -->
2786
2586
  <xsl:variable name="font-size">
2787
2587
  <xsl:choose>
2788
- <xsl:when test="@ancestor = 'sections' and $level = '2'">11pt</xsl:when>
2789
- <xsl:when test="@ancestor = 'sections' and $level &gt; 2">11pt</xsl:when>
2588
+ <!-- <xsl:when test="@ancestor = 'sections' and $level = '2'">11pt</xsl:when>
2589
+ <xsl:when test="@ancestor = 'sections' and $level &gt; 2">11pt</xsl:when> -->
2590
+ <xsl:when test="$level = '2'">11pt</xsl:when>
2591
+ <xsl:when test="$level &gt; 2">11pt</xsl:when>
2790
2592
  <xsl:otherwise>11.5pt</xsl:otherwise>
2791
2593
  </xsl:choose>
2792
2594
  </xsl:variable>
@@ -2799,12 +2601,14 @@
2799
2601
  </xsl:variable>
2800
2602
 
2801
2603
  <fo:block margin-bottom="16pt">
2802
- <xsl:if test="@ancestor = 'sections' and $level &gt; 2">
2604
+ <!-- <xsl:if test="@ancestor = 'sections' and $level &gt; 2"> -->
2605
+ <xsl:if test="$level &gt; 2">
2803
2606
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2804
2607
  </xsl:if>
2805
2608
  <xsl:copy-of select="@id"/>
2806
2609
  <fo:block font-size="{$font-size}" font-weight="bold" margin-bottom="6pt" keep-with-next="always" role="H{$level}">
2807
- <xsl:if test="@ancestor = 'sections' and $level &gt; 2">
2610
+ <!-- <xsl:if test="@ancestor = 'sections' and $level &gt; 2"> -->
2611
+ <xsl:if test="$level &gt; 2">
2808
2612
  <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
2809
2613
  </xsl:if>
2810
2614
  <!-- term/name -->
@@ -2855,11 +2659,11 @@
2855
2659
 
2856
2660
  <xsl:choose>
2857
2661
 
2858
- <xsl:when test="preceding-sibling::*[1][self::mn:fmt-title]/@inline-header = 'true' and $inline-header = 'false'"/> <!-- paragraph displayed in title template -->
2662
+ <xsl:when test="preceding-sibling::*[1][self::mn:fmt-title]/../@inline-header = 'true' and $inline-header = 'false'"/> <!-- paragraph displayed in title template -->
2859
2663
 
2860
2664
  <xsl:otherwise>
2861
2665
 
2862
- <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
2666
+ <!-- <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/> -->
2863
2667
  <xsl:variable name="element-name">fo:block</xsl:variable>
2864
2668
  <!-- <xsl:choose>
2865
2669
  <xsl:when test="$inline = 'true'">fo:inline</xsl:when> -->
@@ -3070,7 +2874,7 @@
3070
2874
  <xsl:value-of select="normalize-space()"/>
3071
2875
  </xsl:template>
3072
2876
 
3073
- <xsl:template match="mn:bibitem[preceding-sibling::mn:references[1][not(@normative='true')]]" priority="3">
2877
+ <xsl:template match="mn:bibitem[ancestor::mn:references[1][not(@normative='true')]]" priority="3">
3074
2878
  <xsl:call-template name="bibitem_non_normative"/>
3075
2879
  </xsl:template>
3076
2880
 
@@ -3078,7 +2882,9 @@
3078
2882
  <!-- Index processing -->
3079
2883
  <!-- =================== -->
3080
2884
 
3081
- <xsl:template match="mn:indexsect"/>
2885
+ <xsl:template match="mn:indexsect">
2886
+ <xsl:apply-templates select="." mode="index"/>
2887
+ </xsl:template>
3082
2888
  <xsl:template match="mn:indexsect" mode="index">
3083
2889
  <fo:block id="{@id}" span="all">
3084
2890
  <xsl:apply-templates select="mn:title"/>
@@ -3190,9 +2996,7 @@
3190
2996
  </xsl:template>
3191
2997
 
3192
2998
  <xsl:template name="insertHeaderFooter">
3193
- <xsl:param name="doctype"/>
3194
2999
  <xsl:param name="document_id"/>
3195
- <xsl:param name="title_prefix"/>
3196
3000
  <xsl:param name="title"/>
3197
3001
 
3198
3002
  <xsl:param name="copyright_year"/>
@@ -3304,38 +3108,59 @@
3304
3108
  </xsl:choose>
3305
3109
  </xsl:variable>
3306
3110
 
3111
+ <xsl:if test="$hideHeader = 'false'">
3112
+ <xsl:call-template name="insertHeader">
3113
+ <xsl:with-param name="orientation" select="$orientation"/>
3114
+ <xsl:with-param name="header" select="$header"/>
3115
+ </xsl:call-template>
3116
+ </xsl:if>
3117
+
3118
+ <xsl:if test="$hideFooter = 'false'">
3119
+ <xsl:call-template name="insertFooter">
3120
+ <xsl:with-param name="orientation" select="$orientation"/>
3121
+ <xsl:with-param name="footer" select="$footer"/>
3122
+ </xsl:call-template>
3123
+ </xsl:if>
3124
+ </xsl:template>
3125
+
3126
+ <xsl:template name="insertHeader">
3127
+ <xsl:param name="orientation"/>
3128
+ <xsl:param name="header"/>
3307
3129
  <xsl:choose>
3308
3130
  <xsl:when test="$orientation = 'landscape'">
3309
- <xsl:if test="$hideHeader = 'false'">
3310
- <fo:static-content flow-name="right-region-landscape" role="artifact">
3311
- <fo:block-container reference-orientation="270" margin-left="13mm">
3312
- <xsl:copy-of select="$header"/>
3313
- </fo:block-container>
3314
- </fo:static-content>
3315
- </xsl:if>
3316
- <xsl:if test="$hideFooter = 'false'">
3317
- <fo:static-content flow-name="left-region-landspace" role="artifact">
3318
- <fo:block-container reference-orientation="270" margin-left="13mm">
3319
- <xsl:copy-of select="$footer"/>
3320
- </fo:block-container>
3321
- </fo:static-content>
3322
- </xsl:if>
3131
+ <fo:static-content flow-name="right-region-landscape" role="artifact">
3132
+ <fo:block-container reference-orientation="270" margin-left="13mm">
3133
+ <xsl:copy-of select="$header"/>
3134
+ </fo:block-container>
3135
+ </fo:static-content>
3323
3136
  </xsl:when>
3324
3137
  <xsl:otherwise>
3325
- <xsl:if test="$hideHeader = 'false'">
3326
- <fo:static-content flow-name="header" role="artifact">
3327
- <fo:block-container margin-top="12.7mm">
3328
- <xsl:copy-of select="$header"/>
3329
- </fo:block-container>
3330
- </fo:static-content>
3331
- </xsl:if>
3332
- <xsl:if test="$hideFooter = 'false'">
3333
- <fo:static-content flow-name="footer" role="artifact">
3334
- <fo:block-container display-align="after" height="100%">
3335
- <xsl:copy-of select="$footer"/>
3336
- </fo:block-container>
3337
- </fo:static-content>
3338
- </xsl:if>
3138
+ <fo:static-content flow-name="header" role="artifact">
3139
+ <fo:block-container margin-top="12.7mm">
3140
+ <xsl:copy-of select="$header"/>
3141
+ </fo:block-container>
3142
+ </fo:static-content>
3143
+ </xsl:otherwise>
3144
+ </xsl:choose>
3145
+ </xsl:template>
3146
+
3147
+ <xsl:template name="insertFooter">
3148
+ <xsl:param name="orientation"/>
3149
+ <xsl:param name="footer"/>
3150
+ <xsl:choose>
3151
+ <xsl:when test="$orientation = 'landscape'">
3152
+ <fo:static-content flow-name="left-region-landspace" role="artifact">
3153
+ <fo:block-container reference-orientation="270" margin-left="13mm">
3154
+ <xsl:copy-of select="$footer"/>
3155
+ </fo:block-container>
3156
+ </fo:static-content>
3157
+ </xsl:when>
3158
+ <xsl:otherwise>
3159
+ <fo:static-content flow-name="footer" role="artifact">
3160
+ <fo:block-container display-align="after" height="100%">
3161
+ <xsl:copy-of select="$footer"/>
3162
+ </fo:block-container>
3163
+ </fo:static-content>
3339
3164
  </xsl:otherwise>
3340
3165
  </xsl:choose>
3341
3166
  </xsl:template>
@@ -3499,7 +3324,6 @@
3499
3324
  <xsl:param name="enabler"/>
3500
3325
  <xsl:param name="standard_number"/>
3501
3326
  <xsl:param name="history"/>
3502
- <!-- <xsl:param name="standard_title_prefix" /> -->
3503
3327
  <xsl:param name="cutoff_date"/>
3504
3328
  <xsl:param name="expiration_date"/>
3505
3329
 
@@ -4285,6 +4109,7 @@
4285
4109
  <xsl:variable name="en_dash">–</xsl:variable>
4286
4110
  <xsl:variable name="em_dash">—</xsl:variable>
4287
4111
  <xsl:variable name="nonbreak_space_em_dash_space"> — </xsl:variable>
4112
+ <xsl:variable name="nonbreak_space_em_dash"> —</xsl:variable>
4288
4113
  <xsl:variable name="cr">&#13;</xsl:variable>
4289
4114
  <xsl:variable name="lf">
4290
4115
  </xsl:variable>
@@ -4828,6 +4653,7 @@
4828
4653
  <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]" mode="update_xml_step1"/>
4829
4654
  <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]" mode="update_xml_step1"/>
4830
4655
  <xsl:template match="mn:section-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
4656
+ <xsl:template match="mn:floating-title[following-sibling::*[1][self::mn:p][@type = 'section-title' or @type = 'floating-title']]" mode="update_xml_step1"/>
4831
4657
  <!-- <xsl:template match="mn:preferred[following-sibling::*[not(local-name() = 'preferred')][1][local-name() = 'fmt-preferred']]" mode="update_xml_step1"/> -->
4832
4658
  <xsl:template match="mn:preferred" mode="update_xml_step1"/>
4833
4659
  <!-- <xsl:template match="mn:admitted[following-sibling::*[not(local-name() = 'admitted')][1][local-name() = 'fmt-admitted']]" mode="update_xml_step1"/> -->
@@ -4842,10 +4668,10 @@
4842
4668
 
4843
4669
  <xsl:template match="mn:term[@unnumbered = 'true'][not(.//*[starts-with(local-name(), 'fmt-')])]" mode="update_xml_step1"/>
4844
4670
 
4845
- <xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title]]" mode="update_xml_step1">
4671
+ <xsl:template match="mn:p[@type = 'section-title' or @type = 'floating-title'][preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]]" mode="update_xml_step1">
4846
4672
  <xsl:copy>
4847
4673
  <xsl:apply-templates select="@*" mode="update_xml_step1"/>
4848
- <xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title]/@depth"/>
4674
+ <xsl:copy-of select="preceding-sibling::*[1][self::mn:section-title or self::mn:floating-title]/@depth"/>
4849
4675
  <xsl:apply-templates select="node()" mode="update_xml_step1"/>
4850
4676
  </xsl:copy>
4851
4677
  </xsl:template>
@@ -6090,6 +5916,12 @@
6090
5916
  <xsl:template name="refine_sourcecode-style">
6091
5917
  </xsl:template> <!-- refine_sourcecode-style -->
6092
5918
 
5919
+ <xsl:attribute-set name="sourcecode-number-style">
5920
+ </xsl:attribute-set>
5921
+
5922
+ <xsl:template name="refine_sourcecode-number-style">
5923
+ </xsl:template>
5924
+
6093
5925
  <xsl:attribute-set name="sourcecode-name-style">
6094
5926
  <xsl:attribute name="font-size">11pt</xsl:attribute>
6095
5927
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -7477,6 +7309,12 @@
7477
7309
  <xsl:template name="refine_term-name-style">
7478
7310
  </xsl:template>
7479
7311
 
7312
+ <xsl:attribute-set name="preferred-style">
7313
+ </xsl:attribute-set> <!-- preferred-style -->
7314
+
7315
+ <xsl:template name="refine_preferred-style">
7316
+ </xsl:template>
7317
+
7480
7318
  <xsl:attribute-set name="preferred-block-style">
7481
7319
  </xsl:attribute-set> <!-- preferred-block-style -->
7482
7320
 
@@ -8135,6 +7973,12 @@
8135
7973
  <xsl:call-template name="setBordersTableArray"/>
8136
7974
  </xsl:template> <!-- refine_table-style -->
8137
7975
 
7976
+ <xsl:attribute-set name="table-number-style">
7977
+ </xsl:attribute-set>
7978
+
7979
+ <xsl:template name="refine_table-number-style">
7980
+ </xsl:template>
7981
+
8138
7982
  <xsl:attribute-set name="table-name-style">
8139
7983
  <xsl:attribute name="role">Caption</xsl:attribute>
8140
7984
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
@@ -11743,6 +11587,12 @@
11743
11587
  <xsl:template name="refine_figure-style">
11744
11588
  </xsl:template>
11745
11589
 
11590
+ <xsl:attribute-set name="figure-number-style">
11591
+ </xsl:attribute-set>
11592
+
11593
+ <xsl:template name="refine_figure-number-style">
11594
+ </xsl:template>
11595
+
11746
11596
  <xsl:attribute-set name="figure-name-style">
11747
11597
  <xsl:attribute name="role">Caption</xsl:attribute>
11748
11598
  <xsl:attribute name="font-family">Arial</xsl:attribute>
@@ -14414,7 +14264,7 @@
14414
14264
 
14415
14265
  <fo:list-item>
14416
14266
  <fo:list-item-label end-indent="label-end()">
14417
- <fo:block role="SKIP">
14267
+ <fo:block role="SKIP" id="__internal_layout__bibitem_{@id}_{generate-id()}">
14418
14268
  <fo:inline role="SKIP">
14419
14269
  <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report')">
14420
14270
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
@@ -16358,7 +16208,7 @@
16358
16208
  <xsl:attribute name="font-size">23pt</xsl:attribute>
16359
16209
  <xsl:attribute name="font-weight">bold</xsl:attribute>
16360
16210
  <xsl:attribute name="margin-top">84pt</xsl:attribute>
16361
- <xsl:attribute name="margin-bottom">40pt</xsl:attribute>
16211
+ <xsl:attribute name="margin-bottom">52pt</xsl:attribute>
16362
16212
  <xsl:attribute name="line-height">1.1</xsl:attribute>
16363
16213
  </xsl:attribute-set>
16364
16214
 
@@ -16706,10 +16556,17 @@
16706
16556
  </xsl:choose>
16707
16557
  </xsl:template>
16708
16558
 
16559
+ <xsl:attribute-set name="clause-style">
16560
+
16561
+ </xsl:attribute-set>
16562
+
16563
+ <xsl:template name="refine_clause-style">
16564
+ </xsl:template>
16565
+
16709
16566
  <!-- main sections -->
16710
16567
  <xsl:template match="/*/mn:sections/*" name="sections_node" priority="2">
16711
16568
  <xsl:call-template name="setNamedDestination"/>
16712
- <fo:block>
16569
+ <fo:block role="Sect">
16713
16570
  <xsl:call-template name="setId"/>
16714
16571
 
16715
16572
  <xsl:call-template name="sections_element_style"/>
@@ -16742,6 +16599,14 @@
16742
16599
  </xsl:template>
16743
16600
 
16744
16601
  <xsl:template name="sections_element_style">
16602
+ <xsl:variable name="pos"><xsl:number count="*"/></xsl:variable>
16603
+ <xsl:if test="$pos &gt;= 2">
16604
+ <xsl:attribute name="space-before">
16605
+ <xsl:for-each select="mn:fmt-title[1]">
16606
+ <xsl:call-template name="getTitleMarginTop"/>
16607
+ </xsl:for-each>
16608
+ </xsl:attribute>
16609
+ </xsl:if>
16745
16610
  </xsl:template> <!-- sections_element_style -->
16746
16611
 
16747
16612
  <xsl:template match="//mn:metanorma/mn:preface/*" priority="2" name="preface_node"> <!-- /*/mn:preface/* -->
@@ -16833,6 +16698,10 @@
16833
16698
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
16834
16699
  </xsl:template>
16835
16700
 
16701
+ <!-- for case when update_xml_step1 (common.updatexml.xsl) doesn't apply when $table_if = 'true' -->
16702
+ <xsl:template match="mn:title[following-sibling::*[1][self::mn:fmt-title]]"/>
16703
+ <xsl:template match="mn:name[following-sibling::*[1][self::mn:fmt-name]]"/>
16704
+
16836
16705
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
16837
16706
  <xsl:template name="insert_basic_link">
16838
16707
  <xsl:param name="element"/>