metanorma-iso 2.7.5 → 2.7.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -296,10 +296,12 @@
296
296
  -->
297
297
  <xsl:variable name="contents_">
298
298
  <contents>
299
- <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
300
- <xsl:call-template name="processMainSectionsDefault_Contents"/>
301
- <xsl:apply-templates select="//iso:indexsect" mode="contents"/>
302
- <xsl:call-template name="processTablesFigures_Contents"/>
299
+ <xsl:if test="$isGenerateTableIF = 'false'">
300
+ <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
301
+ <xsl:call-template name="processMainSectionsDefault_Contents"/>
302
+ <xsl:apply-templates select="//iso:indexsect" mode="contents"/>
303
+ <xsl:call-template name="processTablesFigures_Contents"/>
304
+ </xsl:if>
303
305
  </contents>
304
306
  </xsl:variable>
305
307
  <xsl:variable name="contents" select="xalan:nodeset($contents_)"/>
@@ -426,9 +428,10 @@
426
428
  <xsl:attribute name="font-size">8.5pt</xsl:attribute>
427
429
  </xsl:if>
428
430
 
429
- <!-- <xsl:if test="$lang = 'zh'">
430
- <xsl:attribute name="font-family">Source Han Sans, Times New Roman, Cambria Math</xsl:attribute>
431
- </xsl:if> -->
431
+ <xsl:if test="$lang = 'zh'">
432
+ <!-- <xsl:attribute name="font-family">Source Han Sans, Times New Roman, Cambria Math</xsl:attribute> -->
433
+ <xsl:attribute name="font-selection-strategy">character-by-character</xsl:attribute>
434
+ </xsl:if>
432
435
  </root-style>
433
436
  </xsl:variable>
434
437
  <xsl:call-template name="insertRootStyle">
@@ -445,8 +448,8 @@
445
448
 
446
449
  <fo:layout-master-set>
447
450
 
448
- <xsl:variable name="marginLeftRight_cover_page_1951">12.5</xsl:variable>
449
- <xsl:variable name="marginTop_cover_page_1951">18</xsl:variable>
451
+ <xsl:variable name="marginLeftRight_cover_page_1951">16.5</xsl:variable> <!-- 12.5 -->
452
+ <xsl:variable name="marginTop_cover_page_1951">19.5</xsl:variable>
450
453
  <xsl:variable name="marginBottom_cover_page_1951">94.5</xsl:variable>
451
454
 
452
455
  <xsl:variable name="marginLeft_cover_page_1972">21</xsl:variable>
@@ -801,18 +804,20 @@
801
804
  <xsl:with-param name="contents" select="$contents"/>
802
805
  </xsl:call-template>
803
806
 
807
+ <xsl:if test="$isGenerateTableIF = 'false'"> <!-- no need cover page for auto-layout algorithm -->
808
+
804
809
  <!-- cover page -->
805
810
  <xsl:choose>
806
811
  <xsl:when test="$layoutVersion = '1951'">
807
812
  <fo:page-sequence master-reference="cover-page_1951" force-page-count="no-force">
808
- <fo:static-content flow-name="cover-page-header" font-weight="bold" font-size="9pt">
813
+ <fo:static-content flow-name="cover-page-header" font-family="Times New Roman" font-size="8.5pt" font-weight="bold">
809
814
  <fo:block-container height="99%" display-align="after">
810
815
  <fo:block text-align-last="justify" role="SKIP">
811
816
  <!-- Example: UDC 669.7 : 620.178.1 -->
812
817
  <xsl:value-of select="$udc"/>
813
818
  <fo:inline keep-together.within-line="always" role="SKIP">
814
819
  <fo:leader leader-pattern="space"/>
815
- <fo:inline font-weight="normal"><xsl:value-of select="concat($i18n_reference_number_abbrev, ': ')"/></fo:inline><xsl:value-of select="$ISOnumber"/>
820
+ <fo:inline font-weight="normal"><xsl:value-of select="concat($i18n_reference_number_abbrev, ' : ')"/></fo:inline><xsl:value-of select="$ISOnumber"/> <!-- font-family="Arial" -->
816
821
  </fo:inline>
817
822
  </fo:block>
818
823
  </fo:block-container>
@@ -824,40 +829,43 @@
824
829
  </fo:block>
825
830
  </fo:static-content>
826
831
  <fo:flow flow-name="xsl-region-body">
827
- <fo:block text-align="center" font-family="Arial" margin-top="18mm">
832
+ <fo:block text-align="center" font-family="Arial" margin-top="14mm">
828
833
  <fo:block>
829
834
  <fo:instream-foreign-object content-width="23mm" fox:alt-text="Image ISO Logo">
830
835
  <xsl:copy-of select="$Image-ISO-Logo-1951-SVG"/>
831
836
  </fo:instream-foreign-object>
832
837
  </fo:block>
833
- <fo:block margin-top="3mm" font-size="8pt" font-weight="bold">
838
+ <fo:block margin-top="2mm" font-size="8pt" font-weight="bold">
834
839
  <xsl:call-template name="add-letter-spacing">
835
840
  <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new(/iso:iso-standard/iso:bibdata/iso:copyright/iso:owner/iso:organization/iso:name))"/>
836
- <xsl:with-param name="letter-spacing" select="0.65"/>
841
+ <xsl:with-param name="letter-spacing" select="0.55"/>
837
842
  </xsl:call-template>
838
843
  </fo:block>
839
- <fo:block-container margin-top="12mm" height="78mm" display-align="center">
840
- <fo:block font-size="20pt">
841
- <!-- ISO RECOMMENDATION -->
842
- <xsl:call-template name="add-letter-spacing">
843
- <xsl:with-param name="text" select="$doctype_uppercased"/>
844
- <xsl:with-param name="letter-spacing" select="0.65"/>
845
- </xsl:call-template>
846
- </fo:block>
847
- <fo:block font-size="24pt" margin-top="5mm">
848
- <xsl:value-of select="$docnumber_with_prefix"/>
849
- </fo:block>
850
844
 
851
- <fo:block font-size="11pt" margin-top="12mm">
845
+ <fo:block font-size="20pt" margin-top="31mm">
846
+ <!-- ISO RECOMMENDATION -->
847
+ <xsl:call-template name="add-letter-spacing">
848
+ <xsl:with-param name="text" select="$doctype_uppercased"/>
849
+ <xsl:with-param name="letter-spacing" select="0.35"/>
850
+ </xsl:call-template>
851
+ </fo:block>
852
+ <fo:block font-size="24pt" margin-top="5mm">
853
+ <xsl:value-of select="$docnumber_with_prefix"/>
854
+ </fo:block>
855
+
856
+ <fo:block-container height="39mm" display-align="center">
857
+ <fo:block font-size="11pt">
852
858
  <xsl:call-template name="insertTitlesLangMain"/>
853
859
  </fo:block>
854
-
855
860
  </fo:block-container>
856
- <fo:block-container height="40mm" display-align="center" font-size="9pt">
857
- <fo:block><xsl:apply-templates select="/iso:iso-standard/iso:bibdata/iso:edition[@language != '']"/></fo:block>
858
- <fo:block> </fo:block>
861
+
862
+ <fo:block-container margin-top="8.5mm" font-size="10pt"> <!-- height="40mm" display-align="center" -->
863
+ <!-- Example: 1st EDITION -->
864
+ <!-- <fo:block><xsl:apply-templates select="/iso:iso-standard/iso:bibdata/iso:edition[@language != '']" /></fo:block> -->
865
+ <fo:block font-weight="bold"><xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:edition[@language != '']"/></fo:block>
866
+ <!-- <fo:block>&#xa0;</fo:block> -->
859
867
  <!-- Example: October 1971 -->
860
- <fo:block>
868
+ <fo:block margin-top="2mm" font-size="9pt">
861
869
  <xsl:call-template name="convertDate">
862
870
  <xsl:with-param name="date" select="/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date"/>
863
871
  </xsl:call-template>
@@ -2045,12 +2053,16 @@
2045
2053
  </xsl:otherwise>
2046
2054
  </xsl:choose>
2047
2055
 
2056
+ </xsl:if> <!-- $isGenerateTableIF = ' false' -->
2057
+
2048
2058
  <xsl:if test="$debug = 'true'"><xsl:message>START updated_xml_step1</xsl:message></xsl:if>
2049
2059
  <xsl:variable name="startTime1" select="java:getTime(java:java.util.Date.new())"/>
2050
2060
 
2051
2061
  <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
2052
2062
  <xsl:variable name="updated_xml_step1">
2053
- <xsl:apply-templates mode="update_xml_step1"/>
2063
+ <xsl:if test="$table_if = 'false'">
2064
+ <xsl:apply-templates mode="update_xml_step1"/>
2065
+ </xsl:if>
2054
2066
  </xsl:variable>
2055
2067
 
2056
2068
  <!-- DEBUG -->
@@ -2069,7 +2081,9 @@
2069
2081
 
2070
2082
  <!-- STEP2: add 'fn' after 'eref' and 'origin', if referenced to bibitem with 'note' = Withdrawn.' or 'Cancelled and replaced...' -->
2071
2083
  <xsl:variable name="updated_xml_step2">
2072
- <xsl:apply-templates select="xalan:nodeset($updated_xml_step1)" mode="update_xml_step2"/>
2084
+ <xsl:if test="$table_if = 'false'">
2085
+ <xsl:apply-templates select="xalan:nodeset($updated_xml_step1)" mode="update_xml_step2"/>
2086
+ </xsl:if>
2073
2087
  </xsl:variable>
2074
2088
 
2075
2089
  <xsl:variable name="endTime2" select="java:getTime(java:java.util.Date.new())"/>
@@ -2083,7 +2097,14 @@
2083
2097
  <xsl:variable name="startTime3" select="java:getTime(java:java.util.Date.new())"/>
2084
2098
 
2085
2099
  <xsl:variable name="updated_xml_step3">
2086
- <xsl:apply-templates select="xalan:nodeset($updated_xml_step2)" mode="update_xml_enclose_keep-together_within-line"/>
2100
+ <xsl:choose>
2101
+ <xsl:when test="$table_if = 'false'">
2102
+ <xsl:apply-templates select="xalan:nodeset($updated_xml_step2)" mode="update_xml_enclose_keep-together_within-line"/>
2103
+ </xsl:when>
2104
+ <xsl:otherwise>
2105
+ <xsl:copy-of select="."/>
2106
+ </xsl:otherwise>
2107
+ </xsl:choose>
2087
2108
  </xsl:variable>
2088
2109
 
2089
2110
  <xsl:variable name="endTime3" select="java:getTime(java:java.util.Date.new())"/>
@@ -2409,9 +2430,17 @@
2409
2430
  <xsl:if test="$layoutVersion = '1951'">
2410
2431
  <!-- first page header -->
2411
2432
  <!-- Example: ISO Recommendation R 453 November 1965 -->
2412
- <fo:block-container margin-top="-13mm" margin-left="-12mm" margin-right="-12mm">
2433
+ <fo:block-container margin-top="-8mm" margin-left="-12mm" margin-right="-12mm">
2434
+ <xsl:if test="$revision_date_num &gt;= 19690101">
2435
+ <xsl:attribute name="margin-top">-9mm</xsl:attribute>
2436
+ <xsl:attribute name="margin-left">-12.5mm</xsl:attribute>
2437
+ <xsl:attribute name="margin-right">-12.5mm</xsl:attribute>
2438
+ </xsl:if>
2413
2439
  <fo:block-container margin-left="0" margin-right="0" border-bottom="1.25pt solid black">
2414
2440
  <fo:table table-layout="fixed" width="100%" font-family="Arial" font-size="13pt">
2441
+ <xsl:if test="$revision_date_num &gt;= 19690101">
2442
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2443
+ </xsl:if>
2415
2444
  <fo:table-column column-width="proportional-column-width(9.5)"/>
2416
2445
  <fo:table-column column-width="proportional-column-width(65)"/>
2417
2446
  <fo:table-column column-width="proportional-column-width(34)"/>
@@ -2419,6 +2448,9 @@
2419
2448
  <fo:table-column column-width="proportional-column-width(9.5)"/>
2420
2449
  <fo:table-body>
2421
2450
  <fo:table-row height="10mm">
2451
+ <xsl:if test="$revision_date_num &gt;= 19690101">
2452
+ <xsl:attribute name="height">7mm</xsl:attribute>
2453
+ </xsl:if>
2422
2454
  <fo:table-cell><fo:block> </fo:block></fo:table-cell>
2423
2455
  <fo:table-cell><fo:block><xsl:value-of select="$doctype_localized"/></fo:block></fo:table-cell>
2424
2456
  <fo:table-cell text-align="center"><fo:block><xsl:value-of select="$docnumber_with_prefix"/></fo:block></fo:table-cell>
@@ -2513,6 +2545,7 @@
2513
2545
  <xsl:message>END xalan:nodeset</xsl:message> -->
2514
2546
 
2515
2547
  <xsl:choose>
2548
+ <xsl:when test="$isGenerateTableIF = 'true'"><!-- skip last page --></xsl:when>
2516
2549
  <xsl:when test="$layoutVersion = '1951'"/>
2517
2550
  <xsl:when test="$layoutVersion = '1972'"/>
2518
2551
  <xsl:when test="$layoutVersion = '1987' and $doctype = 'technical-report'"><!-- UDC, Keywords and Price renders on the first page for technical-report --></xsl:when>
@@ -2762,6 +2795,8 @@
2762
2795
 
2763
2796
  <xsl:template match="iso:preface/iso:clause[@type = 'toc']" priority="3">
2764
2797
  <xsl:choose>
2798
+ <xsl:when test="$isGenerateTableIF = 'true'"/>
2799
+ <xsl:when test="$toc_level = 0"/>
2765
2800
  <xsl:when test="$doctype = 'amendment'"/><!-- ToC shouldn't be generated in amendments. -->
2766
2801
  <xsl:when test="$layoutVersion = '1987' and $doctype = 'technical-report'"/>
2767
2802
  <xsl:otherwise>
@@ -3083,6 +3118,10 @@
3083
3118
  <xsl:attribute name="text-align">center</xsl:attribute>
3084
3119
  <xsl:attribute name="margin-top">49mm</xsl:attribute>
3085
3120
  <xsl:attribute name="text-transform">uppercase</xsl:attribute>
3121
+ <xsl:if test="$revision_date_num &gt;= 19690101">
3122
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
3123
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
3124
+ </xsl:if>
3086
3125
  </xsl:if>
3087
3126
  <xsl:if test="$layoutVersion = '1972' or $layoutVersion = '1987' or $layoutVersion = '1989'">
3088
3127
  <xsl:attribute name="font-size">16pt</xsl:attribute>
@@ -3259,7 +3298,7 @@
3259
3298
  <xsl:when test="$layoutVersion = '1951'">
3260
3299
  <xsl:choose>
3261
3300
  <xsl:when test="@id = 'boilerplate-message'">
3262
- <fo:block-container width="85.5mm" margin-left="50mm" margin-right="50mm">
3301
+ <fo:block-container width="87mm" margin-left="45mm" margin-right="45mm">
3263
3302
  <fo:block-container margin-left="0" margin-right="0">
3264
3303
  <fo:block text-align="justify" text-align-last="center">
3265
3304
  <!-- The copyright of ISO Recommendations and 1SO Standards
@@ -4004,7 +4043,7 @@
4004
4043
  <fo:static-content flow-name="header-even" role="artifact">
4005
4044
  <xsl:if test="$layoutVersion = '1951' and $border_around_page = 'true'">
4006
4045
  <!-- box around page -->
4007
- <fo:block-container position="absolute" left="16.5mm" top="10mm" height="271.5mm" width="170mm" border="1.25pt solid black" role="SKIP">
4046
+ <fo:block-container position="absolute" left="16.5mm" top="15mm" height="270mm" width="170mm" border="1.25pt solid black" role="SKIP">
4008
4047
  <fo:block> </fo:block>
4009
4048
  </fo:block-container>
4010
4049
  </xsl:if>
@@ -4012,14 +4051,24 @@
4012
4051
  <xsl:if test="$layoutVersion = '2024'">
4013
4052
  <xsl:attribute name="height">23mm</xsl:attribute>
4014
4053
  </xsl:if>
4015
- <fo:block font-size="{$font-size_header}" font-weight="bold" padding-top="12.5mm" line-height="1.1">
4016
- <xsl:call-template name="insertLayoutVersionAttributesTop">
4017
- <xsl:with-param name="odd_or_even">even</xsl:with-param>
4018
- </xsl:call-template>
4019
- <xsl:if test="$is_header = 'true'">
4020
- <xsl:value-of select="$ISOnumber"/>
4021
- </xsl:if>
4022
- </fo:block>
4054
+ <xsl:choose>
4055
+ <xsl:when test="$layoutVersion = '1951'">
4056
+ <xsl:call-template name="insertHeader1951">
4057
+ <xsl:with-param name="is_header" select="$is_header"/>
4058
+ <xsl:with-param name="odd_or_even">even</xsl:with-param>
4059
+ </xsl:call-template>
4060
+ </xsl:when>
4061
+ <xsl:otherwise>
4062
+ <fo:block font-size="{$font-size_header}" font-weight="bold" padding-top="12.5mm" line-height="1.1">
4063
+ <xsl:call-template name="insertLayoutVersionAttributesTop">
4064
+ <xsl:with-param name="odd_or_even">even</xsl:with-param>
4065
+ </xsl:call-template>
4066
+ <xsl:if test="$is_header = 'true'">
4067
+ <xsl:value-of select="$ISOnumber"/>
4068
+ </xsl:if>
4069
+ </fo:block>
4070
+ </xsl:otherwise>
4071
+ </xsl:choose>
4023
4072
  </fo:block-container>
4024
4073
  </fo:static-content>
4025
4074
  </xsl:template>
@@ -4106,7 +4155,7 @@
4106
4155
  <fo:static-content flow-name="header-odd" role="artifact">
4107
4156
  <xsl:if test="$layoutVersion = '1951' and $border_around_page = 'true'">
4108
4157
  <!-- box around page -->
4109
- <fo:block-container position="absolute" left="23.5mm" top="10mm" height="271.5mm" width="170mm" border="1.25pt solid black" role="SKIP">
4158
+ <fo:block-container position="absolute" left="23.5mm" top="15mm" height="270mm" width="170mm" border="1.25pt solid black" role="SKIP">
4110
4159
  <fo:block> </fo:block>
4111
4160
  </fo:block-container>
4112
4161
  </xsl:if>
@@ -4114,18 +4163,66 @@
4114
4163
  <xsl:if test="$layoutVersion = '2024'">
4115
4164
  <xsl:attribute name="height">23mm</xsl:attribute>
4116
4165
  </xsl:if>
4117
- <fo:block font-size="{$font-size_header}" font-weight="bold" text-align="right" padding-top="12.5mm" line-height="1.1">
4118
- <xsl:call-template name="insertLayoutVersionAttributesTop">
4119
- <xsl:with-param name="odd_or_even">odd</xsl:with-param>
4120
- </xsl:call-template>
4121
- <xsl:if test="$is_header = 'true'">
4122
- <xsl:value-of select="$ISOnumber"/>
4123
- </xsl:if>
4124
- </fo:block>
4166
+ <xsl:choose>
4167
+ <xsl:when test="$layoutVersion = '1951'">
4168
+ <xsl:call-template name="insertHeader1951">
4169
+ <xsl:with-param name="is_header" select="$is_header"/>
4170
+ <xsl:with-param name="odd_or_even">odd</xsl:with-param>
4171
+ </xsl:call-template>
4172
+ </xsl:when>
4173
+ <xsl:otherwise>
4174
+ <fo:block font-size="{$font-size_header}" font-weight="bold" text-align="right" padding-top="12.5mm" line-height="1.1">
4175
+ <xsl:call-template name="insertLayoutVersionAttributesTop">
4176
+ <xsl:with-param name="odd_or_even">odd</xsl:with-param>
4177
+ </xsl:call-template>
4178
+ <xsl:if test="$is_header = 'true'">
4179
+ <xsl:value-of select="$ISOnumber"/>
4180
+ </xsl:if>
4181
+ </fo:block>
4182
+ </xsl:otherwise>
4183
+ </xsl:choose>
4125
4184
  </fo:block-container>
4126
4185
  </fo:static-content>
4127
4186
  </xsl:template>
4128
4187
 
4188
+ <xsl:template name="insertHeader1951">
4189
+ <xsl:param name="is_header"/>
4190
+ <xsl:param name="odd_or_even"/>
4191
+ <fo:block-container font-size="{$font-size_header}" font-weight="bold" text-align="right" padding-top="12.5mm" line-height="1.1">
4192
+ <xsl:call-template name="insertLayoutVersionAttributesTop">
4193
+ <xsl:with-param name="odd_or_even" select="$odd_or_even"/>
4194
+ </xsl:call-template>
4195
+ <fo:block-container margin-left="0mm" margin-right="0mm">
4196
+ <fo:table table-layout="fixed" width="100%">
4197
+ <fo:table-column column-width="proportional-column-width(1)"/>
4198
+ <fo:table-column column-width="proportional-column-width(1)"/>
4199
+ <fo:table-column column-width="proportional-column-width(1)"/>
4200
+ <fo:table-body>
4201
+ <fo:table-row>
4202
+ <fo:table-cell>
4203
+ <fo:block> </fo:block>
4204
+ </fo:table-cell>
4205
+ <fo:table-cell padding-top="-0.5mm">
4206
+ <fo:block font-size="9.5pt" text-align="center">
4207
+ <xsl:if test="$revision_date_num &gt;= 19690101">
4208
+ <xsl:value-of select="$em_dash"/>  <fo:page-number/>  <xsl:value-of select="$em_dash"/>
4209
+ </xsl:if>
4210
+ </fo:block>
4211
+ </fo:table-cell>
4212
+ <fo:table-cell>
4213
+ <fo:block>
4214
+ <xsl:if test="$is_header = 'true'">
4215
+ <xsl:value-of select="$ISOnumber"/>
4216
+ </xsl:if>
4217
+ </fo:block>
4218
+ </fo:table-cell>
4219
+ </fo:table-row>
4220
+ </fo:table-body>
4221
+ </fo:table>
4222
+ </fo:block-container>
4223
+ </fo:block-container>
4224
+ </xsl:template>
4225
+
4129
4226
  <xsl:variable name="font-size_footer_copyright">
4130
4227
  <xsl:choose>
4131
4228
  <xsl:when test="$layoutVersion = '1972' or $layoutVersion = '1987' or $layoutVersion = '1989'">8pt</xsl:when>
@@ -4289,8 +4386,8 @@
4289
4386
  <xsl:attribute name="display-align">after</xsl:attribute>
4290
4387
  <xsl:attribute name="text-align">center</xsl:attribute>
4291
4388
  <fo:block-container margin-left="-13mm" margin-right="-13mm">
4292
- <fo:block-container margin-left="0mm" margin-right="0mm">
4293
- <fo:table table-layout="fixed" width="100%" margin-bottom="8mm">
4389
+ <fo:block-container margin-left="0mm" margin-right="0mm">
4390
+ <fo:table table-layout="fixed" width="100%" margin-bottom="5mm">
4294
4391
  <fo:table-column column-width="proportional-column-width(35)"/>
4295
4392
  <fo:table-column column-width="proportional-column-width(100)"/>
4296
4393
  <fo:table-column column-width="proportional-column-width(35)"/>
@@ -4311,7 +4408,11 @@
4311
4408
  </fo:block>
4312
4409
  </fo:table-cell>
4313
4410
  <fo:table-cell>
4314
- <fo:block font-size="9.5pt" font-weight="bold"><xsl:value-of select="$em_dash"/>  <fo:page-number/>  <xsl:value-of select="$em_dash"/></fo:block>
4411
+ <fo:block font-size="9.5pt" font-weight="bold">
4412
+ <xsl:if test="$revision_date_num &lt; 19690101">
4413
+ <xsl:value-of select="$em_dash"/>  <fo:page-number/>  <xsl:value-of select="$em_dash"/>
4414
+ </xsl:if>
4415
+ </fo:block>
4315
4416
  </fo:table-cell>
4316
4417
  <fo:table-cell>
4317
4418
  <fo:block font-size="8.5pt" text-align="right" font-weight="bold">
@@ -4346,12 +4447,22 @@
4346
4447
  <xsl:attribute name="font-family">Arial</xsl:attribute>
4347
4448
  <xsl:attribute name="font-size">8pt</xsl:attribute>
4348
4449
  <xsl:attribute name="text-align">right</xsl:attribute>
4349
- <xsl:attribute name="padding-top">5mm</xsl:attribute>
4450
+ <xsl:attribute name="padding-top">8mm</xsl:attribute>
4451
+ <xsl:if test="$revision_date_num &gt;= 19690101">
4452
+ <xsl:attribute name="padding-top">11mm</xsl:attribute>
4453
+ <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
4454
+ </xsl:if>
4350
4455
  <xsl:if test="$odd_or_even = 'odd'">
4351
4456
  <xsl:attribute name="margin-right">16.5mm</xsl:attribute>
4457
+ <xsl:if test="$revision_date_num &gt;= 19690101">
4458
+ <xsl:attribute name="margin-left">23.5mm</xsl:attribute>
4459
+ </xsl:if>
4352
4460
  </xsl:if>
4353
4461
  <xsl:if test="$odd_or_even = 'even'">
4354
4462
  <xsl:attribute name="margin-right">23.5mm</xsl:attribute>
4463
+ <xsl:if test="$revision_date_num &gt;= 19690101">
4464
+ <xsl:attribute name="margin-left">16.5mm</xsl:attribute>
4465
+ </xsl:if>
4355
4466
  </xsl:if>
4356
4467
  </xsl:if>
4357
4468
  <xsl:if test="$layoutVersion = '2024'">
@@ -4726,17 +4837,30 @@
4726
4837
  <xsl:param name="add_math_as_text">true</xsl:param> <!-- add math in text behind svg formula, to copy-paste formula from PDF as text -->
4727
4838
 
4728
4839
  <xsl:param name="table_if">false</xsl:param> <!-- generate extended table in IF for autolayout-algorithm -->
4729
- <xsl:param name="table_widths"/> <!-- path to xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
4840
+ <xsl:param name="table_widths"/> <!-- (debug: path to) xml with table's widths, generated on 1st pass, based on FOP Intermediate Format -->
4730
4841
  <!-- Example: <tables>
4731
- <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
4732
- <tbody>
4733
- <tr>
4734
- <td id="tab-symdu_1_1">
4735
- <p_len>6</p_len>
4736
- <p_len>100</p_len> for 2nd paragraph
4737
- <word_len>6</word_len>
4738
- <word_len>20</word_len>
4739
- ...
4842
+ <table page-width="509103" id="table1" width_max="223561" width_min="223560">
4843
+ <column width_max="39354" width_min="39354"/>
4844
+ <column width_max="75394" width_min="75394"/>
4845
+ <column width_max="108813" width_min="108813"/>
4846
+ <tbody>
4847
+ <tr>
4848
+ <td width_max="39354" width_min="39354">
4849
+ <p_len>39354</p_len>
4850
+ <word_len>39354</word_len>
4851
+ </td>
4852
+
4853
+ OLD:
4854
+ <tables>
4855
+ <table id="table_if_tab-symdu" page-width="75"> - table id prefixed by 'table_if_' to simple search in IF
4856
+ <tbody>
4857
+ <tr>
4858
+ <td id="tab-symdu_1_1">
4859
+ <p_len>6</p_len>
4860
+ <p_len>100</p_len> for 2nd paragraph
4861
+ <word_len>6</word_len>
4862
+ <word_len>20</word_len>
4863
+ ...
4740
4864
  -->
4741
4865
 
4742
4866
  <!-- for command line debug: <xsl:variable name="table_widths_from_if" select="document($table_widths)"/> -->
@@ -4985,6 +5109,9 @@
4985
5109
  <xsl:variable name="hair_space"> </xsl:variable>
4986
5110
  <xsl:variable name="en_dash">–</xsl:variable>
4987
5111
  <xsl:variable name="em_dash">—</xsl:variable>
5112
+ <xsl:variable name="cr">&#13;</xsl:variable>
5113
+ <xsl:variable name="lf">
5114
+ </xsl:variable>
4988
5115
 
4989
5116
  <xsl:template name="getTitle">
4990
5117
  <xsl:param name="name"/>
@@ -5428,6 +5555,11 @@
5428
5555
  <!-- for internal table in table cell -->
5429
5556
  <xsl:attribute name="border"><xsl:value-of select="$table-cell-border"/></xsl:attribute>
5430
5557
  </xsl:if>
5558
+ <xsl:if test="$layoutVersion = '1951'">
5559
+ <xsl:if test="@unnumbered = 'true' and ancestor::*[local-name() = 'preface']">
5560
+ <xsl:attribute name="border">none</xsl:attribute>
5561
+ </xsl:if>
5562
+ </xsl:if>
5431
5563
 
5432
5564
  <xsl:call-template name="setBordersTableArray"/>
5433
5565
 
@@ -5575,6 +5707,11 @@
5575
5707
  <xsl:if test="ancestor::*[local-name() = 'tbody'] and not(../preceding-sibling::*[local-name() = 'tr']) and ancestor::*[local-name() = 'table'][1]/*[local-name() = 'thead']"> <!-- cells in 1st row in the table body, and if thead exists -->
5576
5708
  <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
5577
5709
  </xsl:if>
5710
+ <xsl:if test="$layoutVersion = '1951'">
5711
+ <xsl:if test="ancestor::*[local-name() = 'table'][1]/@unnumbered = 'true' and ancestor::*[local-name() = 'preface']">
5712
+ <xsl:attribute name="border">none</xsl:attribute>
5713
+ </xsl:if>
5714
+ </xsl:if>
5578
5715
  <!-- <xsl:attribute name="page-break-inside">avoid</xsl:attribute> -->
5579
5716
 
5580
5717
  <xsl:call-template name="setBordersTableArray"/>
@@ -6834,6 +6971,20 @@
6834
6971
  </xsl:for-each>
6835
6972
  </xsl:template>
6836
6973
 
6974
+ <xsl:param name="table_only_with_id"/><!-- Example: table1, for table auto-layout algorithm -->
6975
+
6976
+ <xsl:template match="*[local-name()='table']" priority="2">
6977
+ <xsl:choose>
6978
+ <xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
6979
+ <xsl:call-template name="table"/>
6980
+ </xsl:when>
6981
+ <xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
6982
+ <xsl:otherwise>
6983
+ <xsl:call-template name="table"/>
6984
+ </xsl:otherwise>
6985
+ </xsl:choose>
6986
+ </xsl:template>
6987
+
6837
6988
  <xsl:template match="*[local-name()='table']" name="table">
6838
6989
 
6839
6990
  <xsl:variable name="table-preamble">
@@ -6843,9 +6994,11 @@
6843
6994
  <xsl:variable name="table">
6844
6995
 
6845
6996
  <xsl:variable name="simple-table">
6846
- <xsl:call-template name="getSimpleTable">
6847
- <xsl:with-param name="id" select="@id"/>
6848
- </xsl:call-template>
6997
+ <xsl:if test="$isGenerateTableIF = 'true' and $isApplyAutolayoutAlgorithm = 'true'">
6998
+ <xsl:call-template name="getSimpleTable">
6999
+ <xsl:with-param name="id" select="@id"/>
7000
+ </xsl:call-template>
7001
+ </xsl:if>
6849
7002
  </xsl:variable>
6850
7003
  <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
6851
7004
 
@@ -6939,9 +7092,9 @@
6939
7092
  </xsl:attribute>
6940
7093
  </xsl:for-each>
6941
7094
 
6942
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
7095
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'][not(@type = 'units')] or ./*[local-name()='example'] or .//*[local-name()='fn'][local-name(..) != 'name'] or ./*[local-name()='source']"/>
6943
7096
  <xsl:if test="$isNoteOrFnExist = 'true'">
6944
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
7097
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute><!-- set 0pt border, because there is a separete table below for footer -->
6945
7098
  </xsl:if>
6946
7099
 
6947
7100
  <xsl:choose>
@@ -7114,9 +7267,28 @@
7114
7267
 
7115
7268
  </fo:block>
7116
7269
 
7270
+ <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
7271
+ <xsl:if test="$continued = 'true'">
7272
+ <fo:block text-align="right">
7273
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
7274
+ </fo:block>
7275
+ </xsl:if>
7276
+ <!-- </xsl:if> -->
7277
+
7117
7278
  </xsl:if>
7118
7279
  </xsl:template> <!-- table/name -->
7119
7280
 
7281
+ <!-- workaround solution for https://github.com/metanorma/metanorma-iso/issues/1151#issuecomment-2033087938 -->
7282
+ <xsl:template match="*[local-name()='table']/*[local-name() = 'note'][@type = 'units']/*[local-name() = 'p']/text()" priority="4">
7283
+ <xsl:choose>
7284
+ <xsl:when test="preceding-sibling::*[local-name() = 'br']">
7285
+ <!-- remove CR or LF at start -->
7286
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'^(&#13;&#10;|&#13;|&#10;)', '')"/>
7287
+ </xsl:when>
7288
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7289
+ </xsl:choose>
7290
+ </xsl:template>
7291
+
7120
7292
  <!-- SOURCE: ... -->
7121
7293
  <xsl:template match="*[local-name()='table']/*[local-name() = 'source']" priority="2">
7122
7294
  <xsl:call-template name="termsource"/>
@@ -7541,7 +7713,7 @@
7541
7713
  <xsl:param name="colwidths"/>
7542
7714
  <xsl:param name="colgroup"/>
7543
7715
 
7544
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
7716
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
7545
7717
 
7546
7718
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
7547
7719
 
@@ -7613,7 +7785,7 @@
7613
7785
 
7614
7786
  <xsl:apply-templates select="../*[local-name()='p']"/>
7615
7787
  <xsl:apply-templates select="../*[local-name()='dl']"/>
7616
- <xsl:apply-templates select="../*[local-name()='note']"/>
7788
+ <xsl:apply-templates select="../*[local-name()='note'][not(@type = 'units')]"/>
7617
7789
  <xsl:apply-templates select="../*[local-name()='example']"/>
7618
7790
  <xsl:apply-templates select="../*[local-name()='source']"/>
7619
7791
 
@@ -7623,7 +7795,7 @@
7623
7795
 
7624
7796
  <!-- horizontal row separator -->
7625
7797
  <xsl:if test="normalize-space($isDisplayRowSeparator) = 'true'">
7626
- <xsl:if test="(../*[local-name()='note'] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
7798
+ <xsl:if test="(../*[local-name()='note'][not(@type = 'units')] or ../*[local-name()='example']) and normalize-space($table_fn_block) != ''">
7627
7799
  <fo:block-container border-top="0.5pt solid black" padding-left="1mm" padding-right="1mm">
7628
7800
 
7629
7801
  <xsl:call-template name="setBordersTableArray"/>
@@ -8338,7 +8510,20 @@
8338
8510
  <!-- Definition List -->
8339
8511
  <!-- ===================== -->
8340
8512
 
8341
- <xsl:template match="*[local-name()='dl']">
8513
+ <!-- for table auto-layout algorithm -->
8514
+ <xsl:template match="*[local-name()='dl']" priority="2">
8515
+ <xsl:choose>
8516
+ <xsl:when test="$table_only_with_id != '' and @id = $table_only_with_id">
8517
+ <xsl:call-template name="dl"/>
8518
+ </xsl:when>
8519
+ <xsl:when test="$table_only_with_id != ''"><fo:block/><!-- to prevent empty fo:block-container --></xsl:when>
8520
+ <xsl:otherwise>
8521
+ <xsl:call-template name="dl"/>
8522
+ </xsl:otherwise>
8523
+ </xsl:choose>
8524
+ </xsl:template>
8525
+
8526
+ <xsl:template match="*[local-name()='dl']" name="dl">
8342
8527
  <xsl:variable name="isAdded" select="@added"/>
8343
8528
  <xsl:variable name="isDeleted" select="@deleted"/>
8344
8529
  <!-- <dl><xsl:copy-of select="."/></dl> -->
@@ -10369,7 +10554,13 @@
10369
10554
  <xsl:value-of select="$language_current_2"/>
10370
10555
  </xsl:when>
10371
10556
  <xsl:otherwise>
10372
- <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
10557
+ <xsl:variable name="language_current_3" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'])"/>
10558
+ <xsl:choose>
10559
+ <xsl:when test="$language_current_3 != ''">
10560
+ <xsl:value-of select="$language_current_3"/>
10561
+ </xsl:when>
10562
+ <xsl:otherwise>en</xsl:otherwise>
10563
+ </xsl:choose>
10373
10564
  </xsl:otherwise>
10374
10565
  </xsl:choose>
10375
10566
  </xsl:otherwise>
@@ -11283,7 +11474,7 @@
11283
11474
  </xsl:when>
11284
11475
  <xsl:otherwise>
11285
11476
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
11286
- <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
11477
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and (../*[local-name() = 'name'] or parent::*[local-name() = 'figure'][@unnumbered = 'true']) and not(ancestor::*[local-name() = 'table'])">
11287
11478
 
11288
11479
  <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
11289
11480
  <xsl:attribute name="width">
@@ -16442,6 +16633,4 @@
16442
16633
  </xsl:if>
16443
16634
  </xsl:template>
16444
16635
 
16445
- <!-- update -->
16446
-
16447
16636
  </xsl:stylesheet>