metanorma-m3aawg 2.1.0 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -547,6 +547,7 @@
547
547
 
548
548
  <xsl:template match="m3d:p" name="paragraph">
549
549
  <xsl:param name="inline" select="'false'"/>
550
+ <xsl:param name="split_keep-within-line"/>
550
551
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
551
552
  <xsl:variable name="element-name">
552
553
  <xsl:choose>
@@ -567,7 +568,9 @@
567
568
  </xsl:attribute>
568
569
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
569
570
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
570
- <xsl:apply-templates/>
571
+ <xsl:apply-templates>
572
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
573
+ </xsl:apply-templates>
571
574
  </xsl:element>
572
575
  <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
573
576
  <xsl:choose>
@@ -649,12 +652,41 @@
649
652
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAjUAAAA8CAYAAACehUt5AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA99pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLz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XEzqrCButblm2a1xcovbcdtD7QrPwUehc0OOM5l7cmeJtjA6k80mJnbrttzUXiDIMn1WHWVZsUgsYulYcr+7KXlhVZVjVTVElxpxphn6Vltqi9u0m9pgVWf5ey0/sTQYZBDfbXTdb1UI9tFbXdUyCwhX43GS4fKHV6wfDcXkTDOsI4byfPzq2B9pQqc9C9gVKnGxOWF24nYu5cUs1twmr59sCl/WjzU1MAHYIQWw2XqsLZRoRpOjVnMND+1qKFmae8wFgtsG2gHDly5KgAVF5e/pvffrJtf4yoCUBDsrlDD0jZnqdqAtAEtE9GzVJS12NpxxuqwnCspk7vvSewQplRk4CGffKrpLu4WsU2xFMqfgTkuIS+hrErAGQ7eV+RpBtsgMaRI0eOqpNswmSFMlscf1yDdZ5rqVfsk3NFkMJL4HkmbZYabCMMUYsM4wNDz3VFkKzUrNShVr7FUOZ9NShw35f64SwWk60P1I2fJiwW9gDQlGR1cGTSNv0gbYKhLrYvh9WWD5peZ3C5fFLqB3dI7HfDm2YPzqkkhzFChQ+bC2gOAdpwAOpSxzYdOXJUW8m8/VQPKGr7yVHdJbgdKy+GwcowwKvGOsCgFnZZy2jfUtv7DMAXtgDYy4dHFM5Yakzw/AsXBTBqhR3AXAaFzOI7nKfc9pMjR44KTNh+cmc/OaqTRBCxpIbrgO2dVXWoz6DF+ZLJkSNHjuodOZduR44cOXLkyJEDNY4cOXLkyJEjR7WF/O2nDbnvXd9oIzfEjhw5cuTI0W8L1CAA0DauOxw5clQA6khe84PrCkeOHBWS/l+AAQACYD7v73Ou8wAAAABJRU5ErkJggg==</xsl:text>
650
653
  </xsl:variable>
651
654
 
652
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:variable name="lang">
655
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:param name="add_math_as_text">true</xsl:param><xsl:param name="table_if">false</xsl:param><xsl:param name="table_widths"/><xsl:variable name="table_widths_from_if" select="xalan:nodeset($table_widths)"/><xsl:variable name="table_widths_from_if_calculated_">
656
+ <xsl:for-each select="$table_widths_from_if//table">
657
+ <xsl:copy>
658
+ <xsl:copy-of select="@*"/>
659
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm"/>
660
+ </xsl:copy>
661
+ </xsl:for-each>
662
+ </xsl:variable><xsl:variable name="table_widths_from_if_calculated" select="xalan:nodeset($table_widths_from_if_calculated_)"/><xsl:param name="table_if_debug">false</xsl:param><xsl:variable name="isGenerateTableIF_">
663
+ false
664
+ </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang">
653
665
  <xsl:call-template name="getLang"/>
654
- </xsl:variable><xsl:variable name="pageWidth_">
655
- 215.9
666
+ </xsl:variable><xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/><xsl:variable name="papersize_width_">
667
+ <xsl:choose>
668
+ <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
669
+ <xsl:when test="$papersize = 'a4'">210</xsl:when>
670
+ </xsl:choose>
671
+ </xsl:variable><xsl:variable name="papersize_width" select="normalize-space($papersize_width_)"/><xsl:variable name="papersize_height_">
672
+ <xsl:choose>
673
+ <xsl:when test="$papersize = 'letter'">279.4</xsl:when>
674
+ <xsl:when test="$papersize = 'a4'">297</xsl:when>
675
+ </xsl:choose>
676
+ </xsl:variable><xsl:variable name="papersize_height" select="normalize-space($papersize_height_)"/><xsl:variable name="pageWidth_">
677
+ <xsl:choose>
678
+ <xsl:when test="$papersize_width != ''"><xsl:value-of select="$papersize_width"/></xsl:when>
679
+ <xsl:otherwise>
680
+ 215.9
681
+ </xsl:otherwise>
682
+ </xsl:choose>
656
683
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
657
- 279.4
684
+ <xsl:choose>
685
+ <xsl:when test="$papersize_height != ''"><xsl:value-of select="$papersize_height"/></xsl:when>
686
+ <xsl:otherwise>
687
+ 279.4
688
+ </xsl:otherwise>
689
+ </xsl:choose>
658
690
  </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
659
691
  17.3
660
692
  </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
@@ -768,7 +800,7 @@
768
800
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
769
801
  </xsl:otherwise>
770
802
  </xsl:choose>
771
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:attribute-set name="root-style">
803
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable><xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable><xsl:variable name="font_noto_serif">Noto Serif, Noto Serif HK, Noto Serif JP, Noto Serif KR, Noto Serif SC, Noto Serif TC</xsl:variable><xsl:attribute-set name="root-style">
772
804
 
773
805
 
774
806
 
@@ -779,7 +811,9 @@
779
811
 
780
812
 
781
813
 
782
- <xsl:attribute name="font-family">EB Garamond 12</xsl:attribute>
814
+
815
+ <xsl:attribute name="font-family">EB Garamond 12, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
816
+ <xsl:attribute name="font-family-generic">Sans</xsl:attribute>
783
817
  <xsl:attribute name="font-size">12pt</xsl:attribute>
784
818
 
785
819
 
@@ -799,17 +833,60 @@
799
833
  </xsl:variable>
800
834
  <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
801
835
 
836
+ <xsl:variable name="font_family_generic" select="$root-style_/root-style/@font-family-generic"/>
837
+
802
838
  <xsl:for-each select="$root-style_/root-style/@*">
839
+
803
840
  <xsl:choose>
804
- <xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
841
+ <xsl:when test="local-name() = 'font-family-generic'"><!-- skip, it's using for determine 'sans' or 'serif' --></xsl:when>
842
+ <xsl:when test="local-name() = 'font-family'">
843
+
844
+ <xsl:variable name="font_regional_prefix">
845
+ <xsl:choose>
846
+ <xsl:when test="$font_family_generic = 'Sans'">Noto Sans</xsl:when>
847
+ <xsl:otherwise>Noto Serif</xsl:otherwise>
848
+ </xsl:choose>
849
+ </xsl:variable>
850
+
805
851
  <xsl:attribute name="{local-name()}">
806
- <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
852
+
853
+ <xsl:variable name="font_extended">
854
+ <xsl:choose>
855
+ <xsl:when test="$lang = 'zh'"><xsl:value-of select="$font_regional_prefix"/> SC</xsl:when>
856
+ <xsl:when test="$lang = 'hk'"><xsl:value-of select="$font_regional_prefix"/> HK</xsl:when>
857
+ <xsl:when test="$lang = 'jp'"><xsl:value-of select="$font_regional_prefix"/> JP</xsl:when>
858
+ <xsl:when test="$lang = 'kr'"><xsl:value-of select="$font_regional_prefix"/> KR</xsl:when>
859
+ <xsl:when test="$lang = 'sc'"><xsl:value-of select="$font_regional_prefix"/> SC</xsl:when>
860
+ <xsl:when test="$lang = 'tc'"><xsl:value-of select="$font_regional_prefix"/> TC</xsl:when>
861
+ </xsl:choose>
862
+ </xsl:variable>
863
+ <xsl:if test="normalize-space($font_extended) != ''">
864
+ <xsl:value-of select="$font_regional_prefix"/><xsl:text>, </xsl:text>
865
+ <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
866
+ </xsl:if>
867
+
868
+ <xsl:value-of select="."/>
869
+
870
+ <xsl:if test="$additional_fonts != ''">
871
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
872
+ </xsl:if>
807
873
  </xsl:attribute>
808
874
  </xsl:when>
809
875
  <xsl:otherwise>
810
876
  <xsl:copy-of select="."/>
811
877
  </xsl:otherwise>
812
878
  </xsl:choose>
879
+
880
+ <!-- <xsl:choose>
881
+ <xsl:when test="local-name() = 'font-family'">
882
+ <xsl:attribute name="{local-name()}">
883
+ <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
884
+ </xsl:attribute>
885
+ </xsl:when>
886
+ <xsl:otherwise>
887
+ <xsl:copy-of select="."/>
888
+ </xsl:otherwise>
889
+ </xsl:choose> -->
813
890
  </xsl:for-each>
814
891
  </xsl:template><xsl:attribute-set name="copyright-statement-style">
815
892
 
@@ -884,7 +961,8 @@
884
961
 
885
962
 
886
963
 
887
- <xsl:attribute name="font-family">Courier New</xsl:attribute>
964
+
965
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
888
966
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
889
967
 
890
968
 
@@ -924,6 +1002,7 @@
924
1002
 
925
1003
 
926
1004
 
1005
+
927
1006
 
928
1007
  <xsl:attribute name="margin-top">14pt</xsl:attribute>
929
1008
  <xsl:attribute name="margin-bottom">14pt</xsl:attribute>
@@ -939,6 +1018,7 @@
939
1018
 
940
1019
 
941
1020
 
1021
+
942
1022
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
943
1023
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
944
1024
 
@@ -963,6 +1043,7 @@
963
1043
 
964
1044
 
965
1045
 
1046
+
966
1047
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
967
1048
  <xsl:attribute name="font-weight">bold</xsl:attribute>
968
1049
 
@@ -1006,6 +1087,7 @@
1006
1087
 
1007
1088
  </xsl:attribute-set><xsl:variable name="table-border_">
1008
1089
 
1090
+
1009
1091
  </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-container-style">
1010
1092
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
1011
1093
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -1021,6 +1103,7 @@
1021
1103
 
1022
1104
 
1023
1105
 
1106
+
1024
1107
 
1025
1108
 
1026
1109
 
@@ -1049,6 +1132,7 @@
1049
1132
 
1050
1133
 
1051
1134
 
1135
+
1052
1136
 
1053
1137
 
1054
1138
 
@@ -1069,6 +1153,7 @@
1069
1153
 
1070
1154
 
1071
1155
 
1156
+
1072
1157
 
1073
1158
 
1074
1159
 
@@ -1106,6 +1191,7 @@
1106
1191
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1107
1192
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1108
1193
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
1194
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1109
1195
  <xsl:attribute name="display-align">center</xsl:attribute>
1110
1196
 
1111
1197
 
@@ -1124,6 +1210,8 @@
1124
1210
  <xsl:attribute name="display-align">center</xsl:attribute>
1125
1211
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1126
1212
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
1213
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1214
+
1127
1215
 
1128
1216
 
1129
1217
 
@@ -1149,7 +1237,7 @@
1149
1237
 
1150
1238
 
1151
1239
 
1152
-
1240
+
1153
1241
 
1154
1242
 
1155
1243
 
@@ -1164,6 +1252,7 @@
1164
1252
 
1165
1253
 
1166
1254
 
1255
+
1167
1256
  </xsl:attribute-set><xsl:attribute-set name="table-fn-style">
1168
1257
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1169
1258
 
@@ -1172,6 +1261,8 @@
1172
1261
 
1173
1262
 
1174
1263
 
1264
+
1265
+
1175
1266
  </xsl:attribute-set><xsl:attribute-set name="table-fn-number-style">
1176
1267
  <xsl:attribute name="font-size">80%</xsl:attribute>
1177
1268
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -1184,6 +1275,7 @@
1184
1275
 
1185
1276
 
1186
1277
 
1278
+
1187
1279
  <xsl:attribute name="vertical-align">super</xsl:attribute>
1188
1280
 
1189
1281
 
@@ -1208,7 +1300,8 @@
1208
1300
  </xsl:attribute-set><xsl:attribute-set name="dt-row-style">
1209
1301
 
1210
1302
 
1211
- </xsl:attribute-set><xsl:attribute-set name="dt-style">
1303
+ </xsl:attribute-set><xsl:attribute-set name="dt-cell-style">
1304
+ </xsl:attribute-set><xsl:attribute-set name="dt-block-style">
1212
1305
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1213
1306
 
1214
1307
 
@@ -1220,6 +1313,29 @@
1220
1313
 
1221
1314
 
1222
1315
 
1316
+
1317
+ </xsl:attribute-set><xsl:attribute-set name="dl-name-style">
1318
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1319
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1320
+
1321
+
1322
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1323
+
1324
+
1325
+
1326
+
1327
+
1328
+
1329
+
1330
+
1331
+
1332
+
1333
+
1334
+
1335
+
1336
+
1337
+ </xsl:attribute-set><xsl:attribute-set name="dd-cell-style">
1338
+ <xsl:attribute name="padding-left">2mm</xsl:attribute>
1223
1339
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1224
1340
 
1225
1341
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1256,6 +1372,7 @@
1256
1372
 
1257
1373
 
1258
1374
 
1375
+
1259
1376
 
1260
1377
 
1261
1378
 
@@ -1325,6 +1442,8 @@
1325
1442
 
1326
1443
 
1327
1444
 
1445
+ </xsl:attribute-set><xsl:attribute-set name="termnote-p-style">
1446
+
1328
1447
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1329
1448
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
1330
1449
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
@@ -1367,6 +1486,7 @@
1367
1486
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1368
1487
 
1369
1488
 
1489
+
1370
1490
 
1371
1491
 
1372
1492
 
@@ -1415,6 +1535,7 @@
1415
1535
 
1416
1536
 
1417
1537
 
1538
+
1418
1539
  </xsl:attribute-set><xsl:attribute-set name="formula-stem-number-style">
1419
1540
  <xsl:attribute name="text-align">right</xsl:attribute>
1420
1541
 
@@ -1435,21 +1556,20 @@
1435
1556
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1436
1557
 
1437
1558
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1559
+ <xsl:attribute name="width">100%</xsl:attribute>
1560
+ <xsl:attribute name="content-height">100%</xsl:attribute>
1561
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1438
1562
 
1439
1563
 
1440
1564
 
1441
- <xsl:attribute name="width">100%</xsl:attribute>
1442
- <xsl:attribute name="content-height">100%</xsl:attribute>
1443
1565
  <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
1444
- <xsl:attribute name="scaling">uniform</xsl:attribute>
1445
1566
 
1446
1567
 
1447
-
1448
-
1568
+
1449
1569
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1450
1570
 
1451
1571
 
1452
- <xsl:attribute name="font-family">Courier New</xsl:attribute>
1572
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1453
1573
 
1454
1574
 
1455
1575
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
@@ -1520,6 +1640,7 @@
1520
1640
 
1521
1641
 
1522
1642
 
1643
+
1523
1644
  <xsl:attribute name="provisional-distance-between-starts">6mm</xsl:attribute>
1524
1645
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1525
1646
 
@@ -1531,6 +1652,24 @@
1531
1652
 
1532
1653
 
1533
1654
 
1655
+ </xsl:attribute-set><xsl:attribute-set name="list-name-style">
1656
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1657
+
1658
+
1659
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1660
+
1661
+
1662
+
1663
+
1664
+
1665
+
1666
+
1667
+
1668
+
1669
+
1670
+
1671
+
1672
+
1534
1673
  </xsl:attribute-set><xsl:attribute-set name="list-item-style">
1535
1674
 
1536
1675
 
@@ -1569,6 +1708,7 @@
1569
1708
 
1570
1709
 
1571
1710
 
1711
+
1572
1712
  <xsl:attribute name="font-size">7pt</xsl:attribute>
1573
1713
  <xsl:attribute name="vertical-align">super</xsl:attribute>
1574
1714
 
@@ -1593,6 +1733,7 @@
1593
1733
 
1594
1734
 
1595
1735
 
1736
+
1596
1737
  <xsl:attribute name="font-size">9pt</xsl:attribute>
1597
1738
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1598
1739
 
@@ -1616,6 +1757,7 @@
1616
1757
 
1617
1758
 
1618
1759
 
1760
+
1619
1761
  <xsl:attribute name="font-size">6pt</xsl:attribute>
1620
1762
  <xsl:attribute name="vertical-align">super</xsl:attribute>
1621
1763
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -1642,7 +1784,11 @@
1642
1784
 
1643
1785
 
1644
1786
 
1787
+
1645
1788
  </xsl:attribute-set><xsl:attribute-set name="admonition-container-style">
1789
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1790
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1791
+
1646
1792
 
1647
1793
 
1648
1794
 
@@ -1678,6 +1824,7 @@
1678
1824
 
1679
1825
 
1680
1826
 
1827
+
1681
1828
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1682
1829
 
1683
1830
 
@@ -1723,6 +1870,7 @@
1723
1870
 
1724
1871
 
1725
1872
 
1873
+
1726
1874
  </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-style">
1727
1875
 
1728
1876
 
@@ -1742,6 +1890,7 @@
1742
1890
 
1743
1891
 
1744
1892
 
1893
+
1745
1894
  </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-body-style">
1746
1895
 
1747
1896
 
@@ -1765,6 +1914,7 @@
1765
1914
 
1766
1915
 
1767
1916
 
1917
+
1768
1918
  <xsl:attribute name="font-size">7pt</xsl:attribute>
1769
1919
  <xsl:attribute name="baseline-shift">30%</xsl:attribute>
1770
1920
 
@@ -1786,6 +1936,7 @@
1786
1936
 
1787
1937
 
1788
1938
 
1939
+
1789
1940
  <xsl:attribute name="font-size">6pt</xsl:attribute>
1790
1941
  <xsl:attribute name="baseline-shift">30%</xsl:attribute>
1791
1942
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -1808,6 +1959,7 @@
1808
1959
 
1809
1960
 
1810
1961
 
1962
+
1811
1963
  <xsl:attribute name="font-size">9pt</xsl:attribute>
1812
1964
  <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
1813
1965
 
@@ -1924,13 +2076,13 @@
1924
2076
 
1925
2077
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
1926
2078
  <xsl:variable name="nodes_preface_">
1927
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2079
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
1928
2080
  <node id="{@id}"/>
1929
2081
  </xsl:for-each>
1930
2082
  </xsl:variable>
1931
2083
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
1932
2084
 
1933
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2085
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
1934
2086
  <xsl:sort select="@displayorder" data-type="number"/>
1935
2087
 
1936
2088
  <!-- process Section's title -->
@@ -1996,7 +2148,7 @@
1996
2148
  </xsl:for-each>
1997
2149
  </figures>
1998
2150
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1999
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2151
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2000
2152
  <xsl:sort select="@displayorder" data-type="number"/>
2001
2153
  <xsl:apply-templates select="."/>
2002
2154
  </xsl:for-each>
@@ -2056,7 +2208,38 @@
2056
2208
  </xsl:template><xsl:template match="*[local-name()='br']">
2057
2209
  <xsl:value-of select="$linebreak"/>
2058
2210
  </xsl:template><xsl:template match="*[local-name() = 'keep-together_within-line']">
2059
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2211
+ <xsl:param name="split_keep-within-line"/>
2212
+
2213
+ <!-- <fo:inline>split_keep-within-line='<xsl:value-of select="$split_keep-within-line"/>'</fo:inline> -->
2214
+ <xsl:choose>
2215
+
2216
+ <xsl:when test="normalize-space($split_keep-within-line) = 'true'">
2217
+ <xsl:variable name="sep">_</xsl:variable>
2218
+ <xsl:variable name="items">
2219
+ <xsl:call-template name="split">
2220
+ <xsl:with-param name="pText" select="."/>
2221
+ <xsl:with-param name="sep" select="$sep"/>
2222
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
2223
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
2224
+ </xsl:call-template>
2225
+ </xsl:variable>
2226
+ <xsl:for-each select="xalan:nodeset($items)/item">
2227
+ <xsl:choose>
2228
+ <xsl:when test=". = $sep">
2229
+ <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2230
+ </xsl:when>
2231
+ <xsl:otherwise>
2232
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2233
+ </xsl:otherwise>
2234
+ </xsl:choose>
2235
+ </xsl:for-each>
2236
+ </xsl:when>
2237
+
2238
+ <xsl:otherwise>
2239
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2240
+ </xsl:otherwise>
2241
+
2242
+ </xsl:choose>
2060
2243
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
2061
2244
  <fo:block xsl:use-attribute-sets="copyright-statement-style">
2062
2245
  <xsl:apply-templates/>
@@ -2148,9 +2331,14 @@
2148
2331
 
2149
2332
  <xsl:variable name="table">
2150
2333
 
2151
- <xsl:variable name="simple-table">
2152
- <xsl:call-template name="getSimpleTable"/>
2334
+ <xsl:variable name="simple-table">
2335
+ <xsl:call-template name="getSimpleTable">
2336
+ <xsl:with-param name="id" select="@id"/>
2337
+ </xsl:call-template>
2153
2338
  </xsl:variable>
2339
+ <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
2340
+
2341
+ <!-- simple-table=<xsl:copy-of select="$simple-table"/> -->
2154
2342
 
2155
2343
 
2156
2344
  <!-- Display table's name before table as standalone block -->
@@ -2173,7 +2361,23 @@
2173
2361
  </xsl:call-template>
2174
2362
  </xsl:if>
2175
2363
  </xsl:variable>
2176
- <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
2364
+ <!-- <xsl:variable name="colwidths" select="xalan:nodeset($colwidths_)"/> -->
2365
+
2366
+ <!-- DEBUG -->
2367
+ <xsl:if test="$table_if_debug = 'true'">
2368
+ <fo:block font-size="60%">
2369
+ <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/>
2370
+ </fo:block>
2371
+ </xsl:if>
2372
+
2373
+
2374
+ <!-- <xsl:copy-of select="$colwidths"/> -->
2375
+
2376
+ <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
2377
+ DEBUG
2378
+ colwidths=<xsl:copy-of select="$colwidths"/>
2379
+ <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> -->
2380
+
2177
2381
 
2178
2382
 
2179
2383
  <xsl:variable name="margin-side">
@@ -2198,6 +2402,8 @@
2198
2402
 
2199
2403
 
2200
2404
 
2405
+
2406
+
2201
2407
 
2202
2408
 
2203
2409
 
@@ -2237,12 +2443,22 @@
2237
2443
 
2238
2444
 
2239
2445
 
2446
+
2447
+
2240
2448
  </xsl:element>
2241
2449
  </xsl:variable>
2242
2450
 
2451
+ <xsl:if test="$isGenerateTableIF = 'true'">
2452
+ <!-- to determine start of table -->
2453
+ <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
2454
+ </xsl:if>
2243
2455
 
2244
2456
  <fo:table id="{@id}">
2245
2457
 
2458
+ <xsl:if test="$isGenerateTableIF = 'true'">
2459
+ <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
2460
+ </xsl:if>
2461
+
2246
2462
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
2247
2463
  <xsl:attribute name="{local-name()}">
2248
2464
  <xsl:value-of select="."/>
@@ -2256,24 +2472,47 @@
2256
2472
 
2257
2473
 
2258
2474
  <xsl:choose>
2259
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2260
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2261
- <fo:table-column column-width="{@width}"/>
2262
- </xsl:for-each>
2475
+ <xsl:when test="$isGenerateTableIF = 'true'">
2476
+ <!-- generate IF for table widths -->
2477
+ <!-- example:
2478
+ <tr>
2479
+ <td valign="top" align="left" id="tab-symdu_1_1">
2480
+ <p>Symbol</p>
2481
+ <word id="tab-symdu_1_1_word_1">Symbol</word>
2482
+ </td>
2483
+ <td valign="top" align="left" id="tab-symdu_1_2">
2484
+ <p>Description</p>
2485
+ <word id="tab-symdu_1_2_word_1">Description</word>
2486
+ </td>
2487
+ </tr>
2488
+ -->
2489
+ <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2490
+
2263
2491
  </xsl:when>
2264
2492
  <xsl:otherwise>
2265
- <xsl:call-template name="insertTableColumnWidth">
2266
- <xsl:with-param name="colwidths" select="$colwidths"/>
2267
- </xsl:call-template>
2268
- </xsl:otherwise>
2269
- </xsl:choose>
2270
2493
 
2271
- <xsl:choose>
2272
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2273
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2274
- </xsl:when>
2275
- <xsl:otherwise>
2276
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer and note that renders separaterely -->
2494
+ <xsl:choose>
2495
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2496
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2497
+ <fo:table-column column-width="{@width}"/>
2498
+ </xsl:for-each>
2499
+ </xsl:when>
2500
+ <xsl:otherwise>
2501
+ <xsl:call-template name="insertTableColumnWidth">
2502
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2503
+ </xsl:call-template>
2504
+ </xsl:otherwise>
2505
+ </xsl:choose>
2506
+
2507
+ <xsl:choose>
2508
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2509
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2510
+ </xsl:when>
2511
+ <xsl:otherwise>
2512
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer and note that renders separaterely -->
2513
+ </xsl:otherwise>
2514
+ </xsl:choose>
2515
+
2277
2516
  </xsl:otherwise>
2278
2517
  </xsl:choose>
2279
2518
 
@@ -2351,23 +2590,29 @@
2351
2590
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
2352
2591
  <xsl:param name="continued"/>
2353
2592
  <xsl:if test="normalize-space() != ''">
2354
- <fo:block xsl:use-attribute-sets="table-name-style">
2355
-
2356
-
2357
-
2358
-
2593
+
2594
+
2359
2595
 
2360
- <xsl:choose>
2361
- <xsl:when test="$continued = 'true'">
2596
+ <fo:block xsl:use-attribute-sets="table-name-style">
2597
+
2362
2598
 
2363
- </xsl:when>
2364
- <xsl:otherwise>
2365
- <xsl:apply-templates/>
2366
- </xsl:otherwise>
2367
- </xsl:choose>
2368
-
2599
+
2600
+
2601
+
2602
+ <xsl:choose>
2603
+ <xsl:when test="$continued = 'true'">
2604
+
2605
+ </xsl:when>
2606
+ <xsl:otherwise>
2607
+ <xsl:apply-templates/>
2608
+ </xsl:otherwise>
2609
+ </xsl:choose>
2610
+
2611
+
2612
+ </fo:block>
2613
+
2369
2614
 
2370
- </fo:block>
2615
+
2371
2616
  </xsl:if>
2372
2617
  </xsl:template><xsl:template name="calculate-columns-numbers">
2373
2618
  <xsl:param name="table-row"/>
@@ -2376,11 +2621,22 @@
2376
2621
  <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
2377
2622
  <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
2378
2623
  </xsl:template><xsl:template name="calculate-column-widths">
2624
+ <xsl:param name="table"/>
2625
+ <xsl:param name="cols-count"/>
2626
+
2627
+ <xsl:call-template name="calculate-column-widths-proportional">
2628
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2629
+ <xsl:with-param name="table" select="$table"/>
2630
+ </xsl:call-template>
2631
+
2632
+ </xsl:template><xsl:template name="calculate-column-widths-proportional">
2379
2633
  <xsl:param name="table"/>
2380
2634
  <xsl:param name="cols-count"/>
2381
2635
  <xsl:param name="curr-col" select="1"/>
2382
2636
  <xsl:param name="width" select="0"/>
2383
2637
 
2638
+ <!-- table=<xsl:copy-of select="$table"/> -->
2639
+
2384
2640
  <xsl:if test="$curr-col &lt;= $cols-count">
2385
2641
  <xsl:variable name="widths">
2386
2642
  <xsl:choose>
@@ -2418,10 +2674,15 @@
2418
2674
  </xsl:for-each>
2419
2675
  </xsl:when>
2420
2676
  <xsl:otherwise>
2421
- <xsl:for-each select="xalan:nodeset($table)/*/tr">
2677
+ <!-- <curr_col><xsl:value-of select="$curr-col"/></curr_col> -->
2678
+
2679
+ <!-- <table><xsl:copy-of select="$table"/></table>
2680
+ -->
2681
+ <xsl:for-each select="xalan:nodeset($table)/*/*[local-name()='tr']">
2422
2682
  <xsl:variable name="td_text">
2423
2683
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2424
2684
  </xsl:variable>
2685
+ <!-- <td_text><xsl:value-of select="$td_text"/></td_text> -->
2425
2686
  <xsl:variable name="words">
2426
2687
  <xsl:variable name="string_with_added_zerospaces">
2427
2688
  <xsl:call-template name="add-zero-spaces-java">
@@ -2436,6 +2697,7 @@
2436
2697
  <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2437
2698
  </xsl:call-template>
2438
2699
  </xsl:variable>
2700
+ <!-- words=<xsl:copy-of select="$words"/> -->
2439
2701
  <xsl:variable name="max_length">
2440
2702
  <xsl:call-template name="max_length">
2441
2703
  <xsl:with-param name="words" select="xalan:nodeset($words)"/>
@@ -2460,6 +2722,8 @@
2460
2722
  </xsl:choose>
2461
2723
  </xsl:variable>
2462
2724
 
2725
+ <!-- widths=<xsl:copy-of select="$widths"/> -->
2726
+
2463
2727
  <column>
2464
2728
  <xsl:for-each select="xalan:nodeset($widths)//width">
2465
2729
  <xsl:sort select="." data-type="number" order="descending"/>
@@ -2468,33 +2732,271 @@
2468
2732
  </xsl:if>
2469
2733
  </xsl:for-each>
2470
2734
  </column>
2471
- <xsl:call-template name="calculate-column-widths">
2735
+ <xsl:call-template name="calculate-column-widths-proportional">
2472
2736
  <xsl:with-param name="cols-count" select="$cols-count"/>
2473
2737
  <xsl:with-param name="curr-col" select="$curr-col +1"/>
2474
2738
  <xsl:with-param name="table" select="$table"/>
2475
2739
  </xsl:call-template>
2476
2740
  </xsl:if>
2477
- </xsl:template><xsl:template match="*[@keep-together.within-line]/text()" priority="2" mode="td_text">
2741
+ </xsl:template><xsl:template match="*[@keep-together.within-line or local-name() = 'keep-together_within-line']/text()" priority="2" mode="td_text">
2478
2742
  <!-- <xsl:message>DEBUG t1=<xsl:value-of select="."/></xsl:message>
2479
2743
  <xsl:message>DEBUG t2=<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/></xsl:message> -->
2480
2744
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/>
2745
+
2746
+ <!-- if all capitals english letters or digits -->
2747
+ <xsl:if test="normalize-space(translate(., concat($upper,'0123456789'), '')) = ''">
2748
+ <xsl:call-template name="repeat">
2749
+ <xsl:with-param name="char" select="'X'"/>
2750
+ <xsl:with-param name="count" select="string-length(normalize-space(.)) * 0.5"/>
2751
+ </xsl:call-template>
2752
+ </xsl:if>
2481
2753
  </xsl:template><xsl:template match="text()" mode="td_text">
2482
2754
  <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
2483
2755
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2484
2756
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2485
2757
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2486
2758
  <xsl:value-of select="@target"/>
2487
- </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2488
- <xsl:variable name="mathml">
2489
- <xsl:for-each select="*">
2490
- <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2491
- <xsl:copy-of select="."/>
2492
- </xsl:if>
2759
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text" name="math_length">
2760
+ <xsl:if test="$isGenerateTableIF = 'false'">
2761
+ <xsl:variable name="mathml_">
2762
+ <xsl:for-each select="*">
2763
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2764
+ <xsl:copy-of select="."/>
2765
+ </xsl:if>
2766
+ </xsl:for-each>
2767
+ </xsl:variable>
2768
+ <xsl:variable name="mathml" select="xalan:nodeset($mathml_)"/>
2769
+
2770
+ <xsl:variable name="math_text">
2771
+ <xsl:value-of select="normalize-space($mathml)"/>
2772
+ <xsl:for-each select="$mathml//@open"><xsl:value-of select="."/></xsl:for-each>
2773
+ <xsl:for-each select="$mathml//@close"><xsl:value-of select="."/></xsl:for-each>
2774
+ </xsl:variable>
2775
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2776
+ </xsl:if>
2777
+ </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm">
2778
+ <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
2779
+
2780
+ <!-- via intermediate format -->
2781
+
2782
+ <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table -->
2783
+
2784
+ <!-- In the first pass, line wrapping is disabled, and the user agent keeps track of the minimum and maximum width of each cell. -->
2785
+
2786
+ <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
2787
+
2788
+ <!-- get current table id -->
2789
+ <xsl:variable name="table_id" select="@id"/>
2790
+ <!-- find table by id in the file 'table_widths' -->
2791
+ <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2792
+ <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
2793
+
2794
+ <!-- table='<xsl:copy-of select="$table"/>' -->
2795
+ <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
2796
+ <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
2797
+ <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2798
+
2799
+ <xsl:variable name="table_with_cell_widths_">
2800
+ <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
2801
+ </xsl:variable>
2802
+ <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2803
+
2804
+ <!-- <xsl:if test="$table_if_debug = 'true'">
2805
+ <xsl:copy-of select="$table_with_cell_widths"/>
2806
+ </xsl:if> -->
2807
+
2808
+
2809
+ <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
2810
+
2811
+ <xsl:variable name="column_widths_">
2812
+ <!-- iteration of columns -->
2813
+ <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
2814
+ <xsl:variable name="pos" select="position()"/>
2815
+ <column>
2816
+ <xsl:attribute name="width_max">
2817
+ <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
2818
+ <xsl:sort select="." data-type="number" order="descending"/>
2819
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2820
+ </xsl:for-each>
2821
+ </xsl:attribute>
2822
+ <xsl:attribute name="width_min">
2823
+ <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
2824
+ <xsl:sort select="." data-type="number" order="descending"/>
2825
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2826
+ </xsl:for-each>
2827
+ </xsl:attribute>
2828
+ </column>
2493
2829
  </xsl:for-each>
2494
2830
  </xsl:variable>
2831
+ <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
2832
+
2833
+ <!-- <column_widths>
2834
+ <xsl:copy-of select="$column_widths"/>
2835
+ </column_widths> -->
2836
+
2837
+ <!-- These in turn, are used to find the minimum and maximum width for the table. -->
2838
+ <xsl:variable name="table_widths_">
2839
+ <table>
2840
+ <xsl:attribute name="width_max">
2841
+ <xsl:value-of select="sum($column_widths/column/@width_max)"/>
2842
+ </xsl:attribute>
2843
+ <xsl:attribute name="width_min">
2844
+ <xsl:value-of select="sum($column_widths/column/@width_min)"/>
2845
+ </xsl:attribute>
2846
+ </table>
2847
+ </xsl:variable>
2848
+ <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
2849
+
2850
+ <xsl:variable name="page_width">
2851
+ <xsl:choose>
2852
+ <xsl:when test="$parent_table_page-width != ''">
2853
+ <xsl:value-of select="$parent_table_page-width"/>
2854
+ </xsl:when>
2855
+ <xsl:otherwise>
2856
+ <xsl:value-of select="@page-width"/>
2857
+ </xsl:otherwise>
2858
+ </xsl:choose>
2859
+ </xsl:variable>
2860
+
2861
+ <xsl:if test="$table_if_debug = 'true'">
2862
+ <table_width>
2863
+ <xsl:copy-of select="$table_widths"/>
2864
+ </table_width>
2865
+ <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
2866
+ </xsl:if>
2867
+
2868
+
2869
+ <!-- There are three cases: -->
2870
+ <xsl:choose>
2871
+ <!-- 1. The minimum table width is equal to or wider than the available space -->
2872
+ <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
2873
+ <!-- call old algorithm -->
2874
+ <case1/>
2875
+ <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
2876
+ <xsl:call-template name="calculate-column-widths-proportional">
2877
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2878
+ <xsl:with-param name="table" select="$table"/>
2879
+ </xsl:call-template> -->
2880
+ </xsl:when>
2881
+ <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
2882
+ <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
2883
+ <case2/>
2884
+ <autolayout/>
2885
+ <xsl:for-each select="$column_widths/column/@width_max">
2886
+ <column divider="100"><xsl:value-of select="."/></column>
2887
+ </xsl:for-each>
2888
+ </xsl:when>
2889
+ <!-- 3. The maximum width of the table is greater than the available space, but the minimum table width is smaller.
2890
+ In this case, find the difference between the available space and the minimum table width, lets call it W.
2891
+ Lets also call D the difference between maximum and minimum width of the table.
2892
+ For each column, let d be the difference between maximum and minimum width of that column.
2893
+ Now set the column's width to the minimum width plus d times W over D.
2894
+ This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2895
+ <xsl:when test="($table_widths/table/@width_max &gt; $page_width and $table_widths/table/@width_min &lt; $page_width) or ($table_widths/table/@width_min &gt;= $page_width)">
2896
+ <!-- difference between the available space and the minimum table width -->
2897
+ <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
2898
+ <W><xsl:value-of select="$W"/></W>
2899
+ <!-- difference between maximum and minimum width of the table -->
2900
+ <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
2901
+ <D><xsl:value-of select="$D"/></D>
2902
+ <case3/>
2903
+ <autolayout/>
2904
+ <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
2905
+ <split_keep-within-line>true</split_keep-within-line>
2906
+ </xsl:if>
2907
+ <xsl:for-each select="$column_widths/column">
2908
+ <!-- difference between maximum and minimum width of that column. -->
2909
+ <xsl:variable name="d" select="@width_max - @width_min"/>
2910
+ <d><xsl:value-of select="$d"/></d>
2911
+ <width_min><xsl:value-of select="@width_min"/></width_min>
2912
+ <e><xsl:value-of select="$d * $W div $D"/></e>
2913
+ <!-- set the column's width to the minimum width plus d times W over D. -->
2914
+ <column divider="100">
2915
+ <xsl:value-of select="round(@width_min + $d * $W div $D)"/> <!-- * 10 -->
2916
+ </column>
2917
+ </xsl:for-each>
2918
+
2919
+ </xsl:when>
2920
+ <xsl:otherwise><unknown_case/></xsl:otherwise>
2921
+ </xsl:choose>
2922
+
2923
+ </xsl:template><xsl:template name="get-calculated-column-widths-autolayout-algorithm">
2924
+
2925
+ <!-- if nested 'dl' or 'table' -->
2926
+ <xsl:variable name="parent_table_id" select="normalize-space(ancestor::*[local-name() = 'table' or local-name() = 'dl'][1]/@id)"/>
2927
+ <parent_table_id><xsl:value-of select="$parent_table_id"/></parent_table_id>
2928
+
2929
+ <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
2930
+
2931
+ <xsl:variable name="parent_table_page-width_">
2932
+ <xsl:if test="$parent_table_id != ''">
2933
+ <!-- determine column number in the parent table -->
2934
+ <xsl:variable name="parent_table_column_number">
2935
+ <xsl:choose>
2936
+ <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
2937
+ <xsl:otherwise> <!-- parent is table -->
2938
+ <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
2939
+ </xsl:otherwise>
2940
+ </xsl:choose>
2941
+ </xsl:variable>
2942
+ <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
2943
+ <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
2944
+ </xsl:if>
2945
+ </xsl:variable>
2946
+ <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
2947
+
2948
+ <!-- get current table id -->
2949
+ <xsl:variable name="table_id" select="@id"/>
2950
+
2951
+ <xsl:choose>
2952
+ <xsl:when test="$parent_table_id = '' or $parent_table_page-width = ''">
2953
+ <!-- find table by id in the file 'table_widths' and get all `<column>...</column> -->
2954
+ <xsl:copy-of select="$table_widths_from_if_calculated//table[@id = $table_id]/node()"/>
2955
+ </xsl:when>
2956
+ <xsl:otherwise>
2957
+ <!-- recalculate columns width based on parent table width -->
2958
+ <xsl:for-each select="$table_widths_from_if//table[@id = $table_id]">
2959
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm">
2960
+ <xsl:with-param name="parent_table_page-width" select="$parent_table_page-width"/> <!-- padding-left = 2mm = 50000-->
2961
+ </xsl:call-template>
2962
+ </xsl:for-each>
2963
+ </xsl:otherwise>
2964
+ </xsl:choose>
2495
2965
 
2496
- <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2497
- <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2966
+ </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if">
2967
+ <xsl:copy>
2968
+ <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
2969
+ </xsl:copy>
2970
+ </xsl:template><xsl:template match="td | th" mode="determine_cell_widths-if">
2971
+ <xsl:copy>
2972
+ <xsl:copy-of select="@*"/>
2973
+
2974
+ <!-- The maximum width is given by the widest line. -->
2975
+ <xsl:attribute name="width_max">
2976
+ <xsl:for-each select="p_len">
2977
+ <xsl:sort select="." data-type="number" order="descending"/>
2978
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2979
+ </xsl:for-each>
2980
+ </xsl:attribute>
2981
+
2982
+ <!-- The minimum width is given by the widest text element (word, image, etc.) -->
2983
+ <xsl:variable name="width_min">
2984
+ <xsl:for-each select="word_len">
2985
+ <xsl:sort select="." data-type="number" order="descending"/>
2986
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2987
+ </xsl:for-each>
2988
+ </xsl:variable>
2989
+ <xsl:attribute name="width_min">
2990
+ <xsl:value-of select="$width_min"/>
2991
+ </xsl:attribute>
2992
+
2993
+ <xsl:if test="$width_min = 0">
2994
+ <xsl:attribute name="width_min">1</xsl:attribute>
2995
+ </xsl:if>
2996
+
2997
+ <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
2998
+
2999
+ </xsl:copy>
2498
3000
  </xsl:template><xsl:template match="*[local-name()='thead']">
2499
3001
  <xsl:param name="cols-count"/>
2500
3002
  <fo:table-header>
@@ -2508,12 +3010,18 @@
2508
3010
  <fo:table-row>
2509
3011
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
2510
3012
 
2511
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
2512
- <xsl:with-param name="continued">true</xsl:with-param>
2513
- </xsl:apply-templates>
2514
3013
 
2515
3014
 
2516
3015
 
3016
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
3017
+ <xsl:with-param name="continued">true</xsl:with-param>
3018
+ </xsl:apply-templates>
3019
+
3020
+
3021
+
3022
+
3023
+
3024
+
2517
3025
  </fo:table-cell>
2518
3026
  </fo:table-row>
2519
3027
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -2579,6 +3087,7 @@
2579
3087
  </xsl:for-each>
2580
3088
  </xsl:when>
2581
3089
  <xsl:otherwise>
3090
+ <!-- $colwidths=<xsl:copy-of select="$colwidths"/> -->
2582
3091
  <xsl:call-template name="insertTableColumnWidth">
2583
3092
  <xsl:with-param name="colwidths" select="$colwidths"/>
2584
3093
  </xsl:call-template>
@@ -2613,7 +3122,10 @@
2613
3122
 
2614
3123
 
2615
3124
  <!-- fn processing -->
2616
- <xsl:call-template name="table_fn_display"/>
3125
+
3126
+ <xsl:call-template name="table_fn_display"/>
3127
+
3128
+
2617
3129
 
2618
3130
  <!-- for PAS display Notes after footnotes -->
2619
3131
 
@@ -2623,6 +3135,9 @@
2623
3135
  </fo:table-body>
2624
3136
 
2625
3137
  </fo:table>
3138
+
3139
+
3140
+
2626
3141
  </xsl:if>
2627
3142
  </xsl:template><xsl:template match="*[local-name()='tbody']">
2628
3143
 
@@ -2658,6 +3173,52 @@
2658
3173
 
2659
3174
  </fo:table-body>
2660
3175
 
3176
+ </xsl:template><xsl:template match="/" mode="process_table-if">
3177
+ <xsl:param name="table_or_dl">table</xsl:param>
3178
+ <xsl:apply-templates mode="process_table-if">
3179
+ <xsl:with-param name="table_or_dl" select="$table_or_dl"/>
3180
+ </xsl:apply-templates>
3181
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="process_table-if">
3182
+ <xsl:param name="table_or_dl">table</xsl:param>
3183
+
3184
+ <fo:table-body>
3185
+ <xsl:for-each select="*[local-name() = 'tr']">
3186
+ <xsl:variable name="col_count" select="count(*)"/>
3187
+
3188
+ <!-- iteration for each tr/td -->
3189
+
3190
+ <xsl:choose>
3191
+ <xsl:when test="$table_or_dl = 'table'">
3192
+ <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
3193
+ <fo:table-row number-columns-spanned="{$col_count}">
3194
+ <!-- <test_table><xsl:copy-of select="."/></test_table> -->
3195
+ <xsl:call-template name="td"/>
3196
+ </fo:table-row>
3197
+ </xsl:for-each>
3198
+ </xsl:when>
3199
+ <xsl:otherwise> <!-- $table_or_dl = 'dl' -->
3200
+ <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']">
3201
+ <xsl:variable name="is_dt" select="position() = 1"/>
3202
+
3203
+ <xsl:for-each select="*">
3204
+ <!-- <test><xsl:copy-of select="."/></test> -->
3205
+ <fo:table-row number-columns-spanned="{$col_count}">
3206
+ <xsl:choose>
3207
+ <xsl:when test="$is_dt">
3208
+ <xsl:call-template name="insert_dt_cell"/>
3209
+ </xsl:when>
3210
+ <xsl:otherwise>
3211
+ <xsl:call-template name="insert_dd_cell"/>
3212
+ </xsl:otherwise>
3213
+ </xsl:choose>
3214
+ </fo:table-row>
3215
+ </xsl:for-each>
3216
+ </xsl:for-each>
3217
+ </xsl:otherwise>
3218
+ </xsl:choose>
3219
+
3220
+ </xsl:for-each>
3221
+ </fo:table-body>
2661
3222
  </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
2662
3223
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
2663
3224
 
@@ -2665,6 +3226,9 @@
2665
3226
 
2666
3227
 
2667
3228
 
3229
+
3230
+
3231
+
2668
3232
 
2669
3233
 
2670
3234
  <xsl:call-template name="setTableRowAttributes"/>
@@ -2684,6 +3248,8 @@
2684
3248
 
2685
3249
 
2686
3250
 
3251
+
3252
+
2687
3253
  <xsl:call-template name="setTableRowAttributes"/>
2688
3254
  <xsl:apply-templates/>
2689
3255
  </fo:table-row>
@@ -2744,7 +3310,7 @@
2744
3310
  </xsl:choose>
2745
3311
  </xsl:attribute>
2746
3312
  </xsl:if>
2747
- </xsl:template><xsl:template match="*[local-name()='td']">
3313
+ </xsl:template><xsl:template match="*[local-name()='td']" name="td">
2748
3314
  <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
2749
3315
  <xsl:call-template name="setTextAlignment">
2750
3316
  <xsl:with-param name="default">left</xsl:with-param>
@@ -2765,6 +3331,8 @@
2765
3331
 
2766
3332
 
2767
3333
 
3334
+
3335
+
2768
3336
 
2769
3337
 
2770
3338
 
@@ -2778,11 +3346,24 @@
2778
3346
 
2779
3347
  <xsl:call-template name="setTableCellAttributes"/>
2780
3348
 
3349
+ <xsl:if test="$isGenerateTableIF = 'true'">
3350
+ <xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width -->
3351
+ <xsl:attribute name="text-align">left</xsl:attribute>
3352
+ </xsl:if>
3353
+
2781
3354
  <fo:block>
2782
3355
 
3356
+ <xsl:if test="$isGenerateTableIF = 'true'">
3357
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
3358
+ </xsl:if>
3359
+
3360
+
2783
3361
 
2784
3362
 
2785
3363
  <xsl:apply-templates/>
3364
+
3365
+ <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
3366
+
2786
3367
  </fo:block>
2787
3368
  </fo:table-cell>
2788
3369
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
@@ -2823,7 +3404,11 @@
2823
3404
 
2824
3405
  <xsl:variable name="gen_id" select="generate-id(.)"/>
2825
3406
  <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
2826
- <xsl:variable name="reference" select="@reference"/>
3407
+ <xsl:variable name="reference_">
3408
+ <xsl:value-of select="@reference"/>
3409
+ <xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
3410
+ </xsl:variable>
3411
+ <xsl:variable name="reference" select="normalize-space($reference_)"/>
2827
3412
  <!-- fn sequence number in document -->
2828
3413
  <xsl:variable name="current_fn_number">
2829
3414
  <xsl:choose>
@@ -2898,7 +3483,7 @@
2898
3483
  <xsl:copy-of select="node()"/>
2899
3484
  </fn>
2900
3485
  </xsl:for-each>
2901
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
3486
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='boilerplate']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
2902
3487
  <xsl:sort select="@displayorder" data-type="number"/>
2903
3488
  <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
2904
3489
  <!-- copy unique fn -->
@@ -2979,9 +3564,9 @@
2979
3564
  <!-- current hierarchy is 'figure' element -->
2980
3565
  <xsl:variable name="following_dl_colwidths">
2981
3566
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2982
- <xsl:variable name="html-table">
2983
- <xsl:variable name="doc_ns">
2984
-
3567
+ <xsl:variable name="simple-table">
3568
+ <!-- <xsl:variable name="doc_ns">
3569
+ <xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
2985
3570
  </xsl:variable>
2986
3571
  <xsl:variable name="ns">
2987
3572
  <xsl:choose>
@@ -2992,7 +3577,7 @@
2992
3577
  <xsl:value-of select="substring-before(name(/*), '-')"/>
2993
3578
  </xsl:otherwise>
2994
3579
  </xsl:choose>
2995
- </xsl:variable>
3580
+ </xsl:variable> -->
2996
3581
 
2997
3582
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2998
3583
  <tbody>
@@ -3003,7 +3588,7 @@
3003
3588
 
3004
3589
  <xsl:call-template name="calculate-column-widths">
3005
3590
  <xsl:with-param name="cols-count" select="2"/>
3006
- <xsl:with-param name="table" select="$html-table"/>
3591
+ <xsl:with-param name="table" select="$simple-table"/>
3007
3592
  </xsl:call-template>
3008
3593
 
3009
3594
  </xsl:if>
@@ -3178,12 +3763,31 @@
3178
3763
 
3179
3764
 
3180
3765
 
3766
+
3767
+ <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
3768
+ <xsl:attribute name="margin-top">0</xsl:attribute>
3769
+ </xsl:if>
3770
+
3181
3771
  <fo:block>
3182
3772
 
3183
3773
 
3184
3774
 
3185
3775
 
3776
+ <xsl:apply-templates select="*[local-name() = 'name']">
3777
+ <xsl:with-param name="process">true</xsl:with-param>
3778
+ </xsl:apply-templates>
3779
+
3780
+ <xsl:if test="$isGenerateTableIF = 'true'">
3781
+ <!-- to determine start of table -->
3782
+ <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
3783
+ </xsl:if>
3784
+
3186
3785
  <fo:table width="95%" table-layout="fixed">
3786
+
3787
+ <xsl:if test="$isGenerateTableIF = 'true'">
3788
+ <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
3789
+ </xsl:if>
3790
+
3187
3791
 
3188
3792
  <xsl:choose>
3189
3793
  <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
@@ -3192,69 +3796,173 @@
3192
3796
 
3193
3797
  </xsl:when>
3194
3798
  </xsl:choose>
3195
- <!-- create virtual html table for dl/[dt and dd] -->
3196
- <xsl:variable name="html-table">
3197
- <xsl:variable name="doc_ns">
3799
+
3800
+
3801
+
3802
+ <xsl:choose>
3803
+ <xsl:when test="$isGenerateTableIF = 'true'">
3804
+ <!-- generate IF for table widths -->
3805
+ <!-- example:
3806
+ <tr>
3807
+ <td valign="top" align="left" id="tab-symdu_1_1">
3808
+ <p>Symbol</p>
3809
+ <word id="tab-symdu_1_1_word_1">Symbol</word>
3810
+ </td>
3811
+ <td valign="top" align="left" id="tab-symdu_1_2">
3812
+ <p>Description</p>
3813
+ <word id="tab-symdu_1_2_word_1">Description</word>
3814
+ </td>
3815
+ </tr>
3816
+ -->
3198
3817
 
3199
- </xsl:variable>
3200
- <xsl:variable name="ns">
3201
- <xsl:choose>
3202
- <xsl:when test="normalize-space($doc_ns) != ''">
3203
- <xsl:value-of select="normalize-space($doc_ns)"/>
3204
- </xsl:when>
3205
- <xsl:otherwise>
3206
- <xsl:value-of select="substring-before(name(/*), '-')"/>
3207
- </xsl:otherwise>
3208
- </xsl:choose>
3209
- </xsl:variable>
3210
- <tbody>
3211
- <xsl:apply-templates mode="dl"/>
3212
- </tbody>
3213
- </xsl:variable>
3214
- <!-- DEBUG: html-table<xsl:copy-of select="$html-table"/> -->
3215
- <xsl:variable name="colwidths">
3216
- <xsl:call-template name="calculate-column-widths">
3217
- <xsl:with-param name="cols-count" select="2"/>
3218
- <xsl:with-param name="table" select="$html-table"/>
3219
- </xsl:call-template>
3220
- </xsl:variable>
3221
- <!-- DEBUG: colwidths=<xsl:copy-of select="$colwidths"/> -->
3222
- <xsl:variable name="maxlength_dt">
3223
- <xsl:call-template name="getMaxLength_dt"/>
3224
- </xsl:variable>
3225
- <xsl:variable name="isContainsKeepTogetherTag_">
3226
- false
3227
- </xsl:variable>
3228
- <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
3229
- <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
3230
- <xsl:call-template name="setColumnWidth_dl">
3231
- <xsl:with-param name="colwidths" select="$colwidths"/>
3232
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3233
- <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
3234
- </xsl:call-template>
3818
+ <!-- create virtual html table for dl/[dt and dd] -->
3819
+ <xsl:variable name="simple-table">
3820
+
3821
+ <xsl:variable name="dl_table">
3822
+ <tbody>
3823
+ <xsl:apply-templates mode="dl_if">
3824
+ <xsl:with-param name="id" select="@id"/>
3825
+ </xsl:apply-templates>
3826
+ </tbody>
3827
+ </xsl:variable>
3828
+
3829
+ <!-- dl_table='<xsl:copy-of select="$dl_table"/>' -->
3830
+
3831
+ <!-- Step: replace <br/> to <p>...</p> -->
3832
+ <xsl:variable name="table_without_br">
3833
+ <xsl:apply-templates select="xalan:nodeset($dl_table)" mode="table-without-br"/>
3834
+ </xsl:variable>
3835
+
3836
+ <!-- table_without_br='<xsl:copy-of select="$table_without_br"/>' -->
3837
+
3838
+ <!-- Step: add id to each cell -->
3839
+ <!-- add <word>...</word> for each word, image, math -->
3840
+ <xsl:variable name="simple-table-id">
3841
+ <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-id">
3842
+ <xsl:with-param name="id" select="@id"/>
3843
+ </xsl:apply-templates>
3844
+ </xsl:variable>
3845
+
3846
+ <!-- simple-table-id='<xsl:copy-of select="$simple-table-id"/>' -->
3847
+
3848
+ <xsl:copy-of select="xalan:nodeset($simple-table-id)"/>
3849
+
3850
+ </xsl:variable>
3851
+
3852
+ <!-- DEBUG: simple-table<xsl:copy-of select="$simple-table"/> -->
3853
+
3854
+ <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if">
3855
+ <xsl:with-param name="table_or_dl">dl</xsl:with-param>
3856
+ </xsl:apply-templates>
3857
+
3858
+ </xsl:when>
3859
+ <xsl:otherwise>
3235
3860
 
3236
- <fo:table-body>
3237
- <xsl:apply-templates>
3238
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3239
- </xsl:apply-templates>
3240
- </fo:table-body>
3861
+ <xsl:variable name="simple-table">
3862
+
3863
+ <xsl:variable name="dl_table">
3864
+ <tbody>
3865
+ <xsl:apply-templates mode="dl">
3866
+ <xsl:with-param name="id" select="@id"/>
3867
+ </xsl:apply-templates>
3868
+ </tbody>
3869
+ </xsl:variable>
3870
+
3871
+ <xsl:copy-of select="$dl_table"/>
3872
+ </xsl:variable>
3873
+
3874
+ <xsl:variable name="colwidths">
3875
+ <xsl:call-template name="calculate-column-widths">
3876
+ <xsl:with-param name="cols-count" select="2"/>
3877
+ <xsl:with-param name="table" select="$simple-table"/>
3878
+ </xsl:call-template>
3879
+ </xsl:variable>
3880
+
3881
+ <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
3882
+ DEBUG
3883
+ colwidths=<xsl:copy-of select="$colwidths"/>
3884
+ <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> -->
3885
+
3886
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3887
+
3888
+ <xsl:variable name="maxlength_dt">
3889
+ <xsl:call-template name="getMaxLength_dt"/>
3890
+ </xsl:variable>
3891
+
3892
+ <xsl:variable name="isContainsKeepTogetherTag_">
3893
+ false
3894
+ </xsl:variable>
3895
+ <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
3896
+ <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
3897
+
3898
+
3899
+ <xsl:call-template name="setColumnWidth_dl">
3900
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3901
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3902
+ <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
3903
+ </xsl:call-template>
3904
+
3905
+ <fo:table-body>
3906
+
3907
+ <!-- DEBUG -->
3908
+ <xsl:if test="$table_if_debug = 'true'">
3909
+ <fo:table-row>
3910
+ <fo:table-cell number-columns-spanned="2" font-size="60%">
3911
+ <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/>
3912
+ </fo:table-cell>
3913
+ </fo:table-row>
3914
+ </xsl:if>
3915
+
3916
+ <xsl:apply-templates>
3917
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3918
+ <xsl:with-param name="split_keep-within-line" select="xalan:nodeset($colwidths)/split_keep-within-line"/>
3919
+ </xsl:apply-templates>
3920
+
3921
+ </fo:table-body>
3922
+ </xsl:otherwise>
3923
+ </xsl:choose>
3241
3924
  </fo:table>
3242
3925
  </fo:block>
3243
3926
  </fo:block>
3244
3927
  </xsl:if> <!-- END: a few components -->
3245
3928
  </fo:block-container>
3246
3929
  </fo:block-container>
3930
+
3931
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- process nested 'dl' -->
3932
+ <xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/>
3933
+ </xsl:if>
3934
+
3935
+ </xsl:template><xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
3936
+ <xsl:param name="process">false</xsl:param>
3937
+ <xsl:if test="$process = 'true'">
3938
+ <fo:block xsl:use-attribute-sets="dl-name-style">
3939
+ <xsl:apply-templates/>
3940
+ </fo:block>
3941
+ </xsl:if>
3247
3942
  </xsl:template><xsl:template name="setColumnWidth_dl">
3248
3943
  <xsl:param name="colwidths"/>
3249
3944
  <xsl:param name="maxlength_dt"/>
3250
3945
  <xsl:param name="isContainsKeepTogetherTag"/>
3946
+
3947
+ <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
3948
+
3251
3949
  <xsl:choose>
3950
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
3951
+ <xsl:call-template name="insertTableColumnWidth">
3952
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3953
+ </xsl:call-template>
3954
+ </xsl:when>
3252
3955
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3253
3956
  <fo:table-column column-width="50%"/>
3254
3957
  <fo:table-column column-width="50%"/>
3255
3958
  </xsl:when>
3256
3959
  <xsl:otherwise>
3257
3960
  <xsl:choose>
3961
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
3962
+ <xsl:call-template name="insertTableColumnWidth">
3963
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3964
+ </xsl:call-template>
3965
+ </xsl:when>
3258
3966
  <xsl:when test="$isContainsKeepTogetherTag">
3259
3967
  <xsl:call-template name="insertTableColumnWidth">
3260
3968
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -3299,13 +4007,19 @@
3299
4007
  </xsl:choose>
3300
4008
  </xsl:template><xsl:template name="insertTableColumnWidth">
3301
4009
  <xsl:param name="colwidths"/>
4010
+
3302
4011
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
3303
4012
  <xsl:choose>
3304
4013
  <xsl:when test=". = 1 or . = 0">
3305
4014
  <fo:table-column column-width="proportional-column-width(2)"/>
3306
4015
  </xsl:when>
3307
4016
  <xsl:otherwise>
3308
- <fo:table-column column-width="proportional-column-width({.})"/>
4017
+ <!-- <fo:table-column column-width="proportional-column-width({.})"/> -->
4018
+ <xsl:variable name="divider">
4019
+ <xsl:value-of select="@divider"/>
4020
+ <xsl:if test="not(@divider)">1</xsl:if>
4021
+ </xsl:variable>
4022
+ <fo:table-column column-width="proportional-column-width({round(. div $divider)})"/>
3309
4023
  </xsl:otherwise>
3310
4024
  </xsl:choose>
3311
4025
  </xsl:for-each>
@@ -3367,11 +4081,19 @@
3367
4081
  </fo:table-cell>
3368
4082
  </fo:table-row>
3369
4083
  </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
4084
+ <xsl:param name="id"/>
4085
+ <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
3370
4086
  <tr>
3371
4087
  <td>
4088
+ <xsl:attribute name="id">
4089
+ <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4090
+ </xsl:attribute>
3372
4091
  <xsl:apply-templates/>
3373
4092
  </td>
3374
4093
  <td>
4094
+ <xsl:attribute name="id">
4095
+ <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4096
+ </xsl:attribute>
3375
4097
 
3376
4098
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3377
4099
  <xsl:with-param name="process">true</xsl:with-param>
@@ -3380,52 +4102,136 @@
3380
4102
  </td>
3381
4103
  </tr>
3382
4104
 
3383
- </xsl:template><xsl:template match="*[local-name()='dt']">
3384
- <xsl:param name="key_iso"/>
4105
+ </xsl:template><xsl:template match="*[local-name()='dt']">
4106
+ <xsl:param name="key_iso"/>
4107
+ <xsl:param name="split_keep-within-line"/>
4108
+
4109
+ <fo:table-row xsl:use-attribute-sets="dt-row-style">
4110
+ <xsl:call-template name="insert_dt_cell">
4111
+ <xsl:with-param name="key_iso" select="$key_iso"/>
4112
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4113
+ </xsl:call-template>
4114
+ <xsl:for-each select="following-sibling::*[local-name()='dd'][1]">
4115
+ <xsl:call-template name="insert_dd_cell">
4116
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4117
+ </xsl:call-template>
4118
+ </xsl:for-each>
4119
+ </fo:table-row>
4120
+ </xsl:template><xsl:template name="insert_dt_cell">
4121
+ <xsl:param name="key_iso"/>
4122
+ <xsl:param name="split_keep-within-line"/>
4123
+ <fo:table-cell xsl:use-attribute-sets="dt-cell-style">
4124
+
4125
+ <xsl:if test="$isGenerateTableIF = 'true'">
4126
+ <!-- border is mandatory, to calculate real width -->
4127
+ <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4128
+ <xsl:attribute name="text-align">left</xsl:attribute>
4129
+ </xsl:if>
4130
+
4131
+
4132
+ <fo:block xsl:use-attribute-sets="dt-block-style">
4133
+ <xsl:copy-of select="@id"/>
4134
+
4135
+ <xsl:if test="normalize-space($key_iso) = 'true'">
4136
+ <xsl:attribute name="margin-top">0</xsl:attribute>
4137
+ </xsl:if>
4138
+
4139
+
4140
+
4141
+ <xsl:apply-templates>
4142
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4143
+ </xsl:apply-templates>
4144
+
4145
+ <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
4146
+
4147
+ </fo:block>
4148
+ </fo:table-cell>
4149
+ </xsl:template><xsl:template name="insert_dd_cell">
4150
+ <xsl:param name="split_keep-within-line"/>
4151
+ <fo:table-cell xsl:use-attribute-sets="dd-cell-style">
4152
+
4153
+ <xsl:if test="$isGenerateTableIF = 'true'">
4154
+ <!-- border is mandatory, to calculate real width -->
4155
+ <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4156
+ </xsl:if>
3385
4157
 
3386
- <fo:table-row xsl:use-attribute-sets="dt-row-style">
3387
- <fo:table-cell>
4158
+ <fo:block>
4159
+
4160
+ <xsl:if test="$isGenerateTableIF = 'true'">
4161
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
4162
+ </xsl:if>
4163
+
3388
4164
 
3389
- <fo:block xsl:use-attribute-sets="dt-style">
3390
- <xsl:copy-of select="@id"/>
3391
-
3392
- <xsl:if test="normalize-space($key_iso) = 'true'">
3393
- <xsl:attribute name="margin-top">0</xsl:attribute>
3394
- </xsl:if>
3395
-
3396
-
3397
-
3398
- <xsl:apply-templates/>
3399
- </fo:block>
3400
- </fo:table-cell>
3401
- <fo:table-cell>
3402
- <fo:block>
3403
-
3404
4165
 
3405
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3406
- <xsl:with-param name="process">true</xsl:with-param>
3407
- </xsl:apply-templates>
3408
- </fo:block>
3409
- </fo:table-cell>
3410
- </fo:table-row>
4166
+ <xsl:choose>
4167
+ <xsl:when test="$isGenerateTableIF = 'true'">
4168
+ <xsl:apply-templates> <!-- following-sibling::*[local-name()='dd'][1] -->
4169
+ <xsl:with-param name="process">true</xsl:with-param>
4170
+ </xsl:apply-templates>
4171
+ </xsl:when>
4172
+ <xsl:otherwise>
4173
+ <xsl:apply-templates select="."> <!-- following-sibling::*[local-name()='dd'][1] -->
4174
+ <xsl:with-param name="process">true</xsl:with-param>
4175
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4176
+ </xsl:apply-templates>
4177
+ </xsl:otherwise>
4178
+
4179
+ </xsl:choose>
4180
+
4181
+ <xsl:if test="$isGenerateTableIF = 'true'"><fo:inline id="{@id}_end">end</fo:inline></xsl:if> <!-- to determine width of text --> <!-- <xsl:value-of select="$hair_space"/> -->
4182
+
4183
+ </fo:block>
4184
+ </fo:table-cell>
3411
4185
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3412
4186
  <xsl:apply-templates/>
3413
4187
  </xsl:template><xsl:template match="*[local-name()='dd']">
3414
4188
  <xsl:param name="process">false</xsl:param>
4189
+ <xsl:param name="split_keep-within-line"/>
3415
4190
  <xsl:if test="$process = 'true'">
3416
4191
  <xsl:apply-templates select="@language"/>
3417
- <xsl:apply-templates/>
4192
+ <xsl:apply-templates>
4193
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4194
+ </xsl:apply-templates>
3418
4195
  </xsl:if>
3419
4196
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3420
4197
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
3421
- </xsl:template><xsl:template match="*[local-name()='em']">
4198
+ </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl_if">
4199
+ <xsl:param name="id"/>
4200
+ <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
4201
+ <tr>
4202
+ <td>
4203
+ <xsl:copy-of select="node()"/>
4204
+ </td>
4205
+ <td>
4206
+
4207
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4208
+
4209
+ <!-- get paragraphs from nested 'dl' -->
4210
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4211
+
4212
+
4213
+ </td>
4214
+ </tr>
4215
+
4216
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
4217
+ <xsl:for-each select="*[local-name() = 'dt']">
4218
+ <p>
4219
+ <xsl:copy-of select="node()"/>
4220
+ <xsl:text> </xsl:text>
4221
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'p']/node()"/>
4222
+ </p>
4223
+ </xsl:for-each>
4224
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/><xsl:template match="*[local-name()='em']">
3422
4225
  <fo:inline font-style="italic">
3423
4226
  <xsl:apply-templates/>
3424
4227
  </fo:inline>
3425
4228
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
4229
+ <xsl:param name="split_keep-within-line"/>
3426
4230
  <fo:inline font-weight="bold">
3427
4231
 
3428
- <xsl:apply-templates/>
4232
+ <xsl:apply-templates>
4233
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4234
+ </xsl:apply-templates>
3429
4235
  </fo:inline>
3430
4236
  </xsl:template><xsl:template match="*[local-name()='padding']">
3431
4237
  <fo:inline padding-right="{@value}"> </fo:inline>
@@ -3446,7 +4252,7 @@
3446
4252
 
3447
4253
 
3448
4254
 
3449
-
4255
+ <!-- 10 -->
3450
4256
 
3451
4257
 
3452
4258
 
@@ -3631,6 +4437,10 @@
3631
4437
  <xsl:param name="text"/>
3632
4438
  <xsl:param name="separator" select="' '"/>
3633
4439
  <xsl:choose>
4440
+
4441
+ <xsl:when test="$isGenerateTableIF = 'true' and not(contains($text, $separator))">
4442
+ <word><xsl:value-of select="normalize-space($text)"/></word>
4443
+ </xsl:when>
3634
4444
  <xsl:when test="not(contains($text, $separator))">
3635
4445
  <word>
3636
4446
  <xsl:variable name="len_str_tmp" select="string-length(normalize-space($text))"/>
@@ -3675,13 +4485,66 @@
3675
4485
  </xsl:when>
3676
4486
  <xsl:otherwise>
3677
4487
  <word>
3678
- <xsl:value-of select="string-length(normalize-space(substring-before($text, $separator)))"/>
4488
+ <xsl:variable name="word" select="normalize-space(substring-before($text, $separator))"/>
4489
+ <xsl:choose>
4490
+ <xsl:when test="$isGenerateTableIF = 'true'">
4491
+ <xsl:value-of select="$word"/>
4492
+ </xsl:when>
4493
+ <xsl:otherwise>
4494
+ <xsl:value-of select="string-length($word)"/>
4495
+ </xsl:otherwise>
4496
+ </xsl:choose>
3679
4497
  </word>
3680
4498
  <xsl:call-template name="tokenize">
3681
4499
  <xsl:with-param name="text" select="substring-after($text, $separator)"/>
3682
4500
  </xsl:call-template>
3683
4501
  </xsl:otherwise>
3684
4502
  </xsl:choose>
4503
+ </xsl:template><xsl:template name="tokenize_with_tags">
4504
+ <xsl:param name="tags"/>
4505
+ <xsl:param name="text"/>
4506
+ <xsl:param name="separator" select="' '"/>
4507
+ <xsl:choose>
4508
+
4509
+ <xsl:when test="not(contains($text, $separator))">
4510
+ <word>
4511
+ <xsl:call-template name="enclose_text_in_tags">
4512
+ <xsl:with-param name="text" select="normalize-space($text)"/>
4513
+ <xsl:with-param name="tags" select="$tags"/>
4514
+ </xsl:call-template>
4515
+ </word>
4516
+ </xsl:when>
4517
+ <xsl:otherwise>
4518
+ <word>
4519
+ <xsl:call-template name="enclose_text_in_tags">
4520
+ <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
4521
+ <xsl:with-param name="tags" select="$tags"/>
4522
+ </xsl:call-template>
4523
+ </word>
4524
+ <xsl:call-template name="tokenize_with_tags">
4525
+ <xsl:with-param name="text" select="substring-after($text, $separator)"/>
4526
+ </xsl:call-template>
4527
+ </xsl:otherwise>
4528
+ </xsl:choose>
4529
+ </xsl:template><xsl:template name="enclose_text_in_tags">
4530
+ <xsl:param name="text"/>
4531
+ <xsl:param name="tags"/>
4532
+ <xsl:param name="num">1</xsl:param> <!-- default (start) value -->
4533
+
4534
+ <xsl:variable name="tag_name" select="normalize-space(xalan:nodeset($tags)//tag[$num])"/>
4535
+
4536
+ <xsl:choose>
4537
+ <xsl:when test="$tag_name = ''"><xsl:value-of select="$text"/></xsl:when>
4538
+ <xsl:otherwise>
4539
+ <xsl:element name="{$tag_name}">
4540
+ <xsl:call-template name="enclose_text_in_tags">
4541
+ <xsl:with-param name="text" select="$text"/>
4542
+ <xsl:with-param name="tags" select="$tags"/>
4543
+ <xsl:with-param name="num" select="$num + 1"/>
4544
+ </xsl:call-template>
4545
+ </xsl:element>
4546
+ </xsl:otherwise>
4547
+ </xsl:choose>
3685
4548
  </xsl:template><xsl:template name="max_length">
3686
4549
  <xsl:param name="words"/>
3687
4550
  <xsl:for-each select="$words//word">
@@ -3782,12 +4645,19 @@
3782
4645
  </xsl:otherwise>
3783
4646
  </xsl:choose>
3784
4647
  </xsl:template><xsl:template name="getSimpleTable">
4648
+ <xsl:param name="id"/>
4649
+
3785
4650
  <xsl:variable name="simple-table">
3786
4651
 
4652
+ <!-- Step 0. replace <br/> to <p>...</p> -->
4653
+ <xsl:variable name="table_without_br">
4654
+ <xsl:apply-templates mode="table-without-br"/>
4655
+ </xsl:variable>
4656
+
3787
4657
  <!-- Step 1. colspan processing -->
3788
4658
  <xsl:variable name="simple-table-colspan">
3789
4659
  <tbody>
3790
- <xsl:apply-templates mode="simple-table-colspan"/>
4660
+ <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-colspan"/>
3791
4661
  </tbody>
3792
4662
  </xsl:variable>
3793
4663
 
@@ -3796,10 +4666,67 @@
3796
4666
  <xsl:apply-templates select="xalan:nodeset($simple-table-colspan)" mode="simple-table-rowspan"/>
3797
4667
  </xsl:variable>
3798
4668
 
3799
- <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
3800
-
4669
+ <!-- Step 3: add id to each cell -->
4670
+ <!-- add <word>...</word> for each word, image, math -->
4671
+ <xsl:variable name="simple-table-id">
4672
+ <xsl:apply-templates select="xalan:nodeset($simple-table-rowspan)" mode="simple-table-id">
4673
+ <xsl:with-param name="id" select="$id"/>
4674
+ </xsl:apply-templates>
4675
+ </xsl:variable>
4676
+
4677
+ <xsl:copy-of select="xalan:nodeset($simple-table-id)"/>
4678
+
3801
4679
  </xsl:variable>
3802
4680
  <xsl:copy-of select="$simple-table"/>
4681
+ </xsl:template><xsl:template match="@*|node()" mode="table-without-br">
4682
+ <xsl:copy>
4683
+ <xsl:apply-templates select="@*|node()" mode="table-without-br"/>
4684
+ </xsl:copy>
4685
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p'])]" mode="table-without-br">
4686
+ <xsl:copy>
4687
+ <xsl:copy-of select="@*"/>
4688
+ <p>
4689
+ <xsl:copy-of select="node()"/>
4690
+ </p>
4691
+ </xsl:copy>
4692
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td'][*[local-name()='br']]" mode="table-without-br">
4693
+ <xsl:copy>
4694
+ <xsl:copy-of select="@*"/>
4695
+ <xsl:for-each select="*[local-name()='br']">
4696
+ <xsl:variable name="current_id" select="generate-id()"/>
4697
+ <p>
4698
+ <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]">
4699
+ <xsl:copy-of select="."/>
4700
+ </xsl:for-each>
4701
+ </p>
4702
+ <xsl:if test="not(following-sibling::*[local-name() = 'br'])">
4703
+ <p>
4704
+ <xsl:for-each select="following-sibling::node()">
4705
+ <xsl:copy-of select="."/>
4706
+ </xsl:for-each>
4707
+ </p>
4708
+ </xsl:if>
4709
+ </xsl:for-each>
4710
+ </xsl:copy>
4711
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p'][*[local-name()='br']]" mode="table-without-br">
4712
+ <xsl:for-each select="*[local-name()='br']">
4713
+ <xsl:variable name="current_id" select="generate-id()"/>
4714
+ <p>
4715
+ <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]">
4716
+ <xsl:copy-of select="."/>
4717
+ </xsl:for-each>
4718
+ </p>
4719
+ <xsl:if test="not(following-sibling::*[local-name() = 'br'])">
4720
+ <p>
4721
+ <xsl:for-each select="following-sibling::node()">
4722
+ <xsl:copy-of select="."/>
4723
+ </xsl:for-each>
4724
+ </p>
4725
+ </xsl:if>
4726
+ </xsl:for-each>
4727
+ </xsl:template><xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
4728
+ <xsl:variable name="text" select="translate(.,'&#9;&#10;&#13;','')"/>
4729
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
3803
4730
  </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3804
4731
  <xsl:apply-templates mode="simple-table-colspan"/>
3805
4732
  </xsl:template><xsl:template match="*[local-name()='fn']" mode="simple-table-colspan"/><xsl:template match="*[local-name()='th'] | *[local-name()='td']" mode="simple-table-colspan">
@@ -3889,6 +4816,126 @@
3889
4816
  <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
3890
4817
  <xsl:with-param name="previousRow" select="$newRow"/>
3891
4818
  </xsl:apply-templates>
4819
+ </xsl:template><xsl:template match="/" mode="simple-table-id">
4820
+ <xsl:param name="id"/>
4821
+ <xsl:variable name="id_prefixed" select="concat('table_if_',$id)"/> <!-- table id prefixed by 'table_if_' to simple search in IF -->
4822
+ <xsl:apply-templates select="@*|node()" mode="simple-table-id">
4823
+ <xsl:with-param name="id" select="$id_prefixed"/>
4824
+ </xsl:apply-templates>
4825
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-id">
4826
+ <xsl:param name="id"/>
4827
+ <xsl:copy>
4828
+ <xsl:apply-templates select="@*|node()" mode="simple-table-id">
4829
+ <xsl:with-param name="id" select="$id"/>
4830
+ </xsl:apply-templates>
4831
+ </xsl:copy>
4832
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="simple-table-id">
4833
+ <xsl:param name="id"/>
4834
+ <xsl:copy>
4835
+ <xsl:copy-of select="@*"/>
4836
+ <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
4837
+ <xsl:apply-templates select="node()" mode="simple-table-id">
4838
+ <xsl:with-param name="id" select="$id"/>
4839
+ </xsl:apply-templates>
4840
+ </xsl:copy>
4841
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
4842
+ <xsl:param name="id"/>
4843
+ <xsl:copy>
4844
+ <xsl:copy-of select="@*"/>
4845
+ <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
4846
+ <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
4847
+ <xsl:attribute name="id">
4848
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
4849
+ </xsl:attribute>
4850
+
4851
+ <xsl:for-each select="*[local-name() = 'p']">
4852
+ <xsl:copy>
4853
+ <xsl:copy-of select="@*"/>
4854
+ <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
4855
+ <xsl:attribute name="id">
4856
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
4857
+ </xsl:attribute>
4858
+
4859
+ <xsl:copy-of select="node()"/>
4860
+ </xsl:copy>
4861
+ </xsl:for-each>
4862
+
4863
+
4864
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- split each paragraph to words, image, math -->
4865
+
4866
+ <xsl:variable name="td_text">
4867
+ <xsl:apply-templates select="." mode="td_text_with_formatting"/>
4868
+ </xsl:variable>
4869
+
4870
+ <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
4871
+
4872
+ <xsl:variable name="words">
4873
+ <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
4874
+ <word>
4875
+ <xsl:copy-of select="."/>
4876
+ </word>
4877
+ </xsl:for-each>
4878
+
4879
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
4880
+ <xsl:copy-of select="."/>
4881
+ </xsl:for-each>
4882
+
4883
+ </xsl:variable>
4884
+
4885
+ <xsl:for-each select="xalan:nodeset($words)/word">
4886
+ <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
4887
+ <xsl:copy>
4888
+ <xsl:attribute name="id">
4889
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
4890
+ </xsl:attribute>
4891
+ <xsl:copy-of select="node()"/>
4892
+ </xsl:copy>
4893
+ </xsl:for-each>
4894
+ </xsl:if>
4895
+ </xsl:copy>
4896
+
4897
+ </xsl:template><xsl:template match="@*|node()" mode="td_text_with_formatting">
4898
+ <xsl:copy>
4899
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
4900
+ </xsl:copy>
4901
+ </xsl:template><xsl:template match="*[local-name() = 'stem' or local-name() = 'image']" mode="td_text_with_formatting"/><xsl:template match="*[local-name() = 'keep-together_within-line']/text()" mode="td_text_with_formatting">
4902
+ <xsl:variable name="formatting_tags">
4903
+ <xsl:call-template name="getFormattingTags"/>
4904
+ </xsl:variable>
4905
+ <word>
4906
+ <xsl:call-template name="enclose_text_in_tags">
4907
+ <xsl:with-param name="text" select="normalize-space(.)"/>
4908
+ <xsl:with-param name="tags" select="$formatting_tags"/>
4909
+ </xsl:call-template>
4910
+ </word>
4911
+ </xsl:template><xsl:template match="*[local-name() != 'keep-together_within-line']/text()" mode="td_text_with_formatting">
4912
+
4913
+ <xsl:variable name="td_text" select="."/>
4914
+
4915
+ <xsl:variable name="string_with_added_zerospaces">
4916
+ <xsl:call-template name="add-zero-spaces-java">
4917
+ <xsl:with-param name="text" select="$td_text"/>
4918
+ </xsl:call-template>
4919
+ </xsl:variable>
4920
+
4921
+ <xsl:variable name="formatting_tags">
4922
+ <xsl:call-template name="getFormattingTags"/>
4923
+ </xsl:variable>
4924
+
4925
+ <!-- <word>text</word> -->
4926
+ <xsl:call-template name="tokenize_with_tags">
4927
+ <xsl:with-param name="tags" select="$formatting_tags"/>
4928
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
4929
+ </xsl:call-template>
4930
+ </xsl:template><xsl:template name="getFormattingTags">
4931
+ <tags>
4932
+ <xsl:if test="ancestor::*[local-name() = 'strong']"><tag>strong</tag></xsl:if>
4933
+ <xsl:if test="ancestor::*[local-name() = 'em']"><tag>em</tag></xsl:if>
4934
+ <xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
4935
+ <xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
4936
+ <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
4937
+ <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
4938
+ </tags>
3892
4939
  </xsl:template><xsl:template name="getLang">
3893
4940
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3894
4941
  <xsl:variable name="language">
@@ -4082,6 +5129,11 @@
4082
5129
  </xsl:variable>
4083
5130
  <fo:inline xsl:use-attribute-sets="link-style">
4084
5131
 
5132
+ <xsl:if test="starts-with(normalize-space(@target), 'mailto:')">
5133
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5134
+ </xsl:if>
5135
+
5136
+
4085
5137
 
4086
5138
 
4087
5139
 
@@ -4344,7 +5396,19 @@
4344
5396
  <xsl:value-of select="$suffix"/>
4345
5397
  </xsl:if>
4346
5398
  </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
4347
- <fo:inline><xsl:apply-templates/></fo:inline>
5399
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
5400
+ <xsl:choose>
5401
+ <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
5402
+ <fo:inline xsl:use-attribute-sets="termnote-p-style">
5403
+ <xsl:apply-templates/>
5404
+ </fo:inline>
5405
+ </xsl:when>
5406
+ <xsl:otherwise>
5407
+ <fo:block xsl:use-attribute-sets="termnote-p-style">
5408
+ <xsl:apply-templates/>
5409
+ </fo:block>
5410
+ </xsl:otherwise>
5411
+ </xsl:choose>
4348
5412
  </xsl:template><xsl:template match="*[local-name() = 'terms']">
4349
5413
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
4350
5414
  <fo:block id="{@id}">
@@ -5165,7 +6229,7 @@
5165
6229
  </xsl:choose>
5166
6230
  </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'xref']" mode="contents">
5167
6231
  <xsl:value-of select="."/>
5168
- </xsl:template><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
6232
+ </xsl:template><xsl:template match="*[local-name() = 'review']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
5169
6233
  <xsl:text> </xsl:text>
5170
6234
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
5171
6235
  <xsl:copy>
@@ -5236,7 +6300,7 @@
5236
6300
 
5237
6301
 
5238
6302
 
5239
-
6303
+ <!-- 9 -->
5240
6304
 
5241
6305
 
5242
6306
 
@@ -5320,7 +6384,7 @@
5320
6384
  <xsl:for-each select="xalan:nodeset($text_step4)/node()">
5321
6385
  <xsl:choose>
5322
6386
  <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5323
- <xsl:call-template name="interspers">
6387
+ <xsl:call-template name="interspers-java">
5324
6388
  <xsl:with-param name="str" select="."/>
5325
6389
  </xsl:call-template>
5326
6390
  </xsl:when>
@@ -5370,6 +6434,10 @@
5370
6434
  <xsl:with-param name="char" select="$char"/>
5371
6435
  </xsl:call-template>
5372
6436
  </xsl:if>
6437
+ </xsl:template><xsl:template name="interspers-java">
6438
+ <xsl:param name="str"/>
6439
+ <xsl:param name="char" select="$zero_width_space"/>
6440
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($str),'([^ -.:=_—])',concat('$1', $char))"/> <!-- insert $char after each char excep space, - . : = _ etc. -->
5373
6441
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
5374
6442
  <xsl:apply-templates mode="syntax_highlight"/>
5375
6443
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -5582,7 +6650,9 @@
5582
6650
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
5583
6651
  </xsl:if>
5584
6652
  <xsl:variable name="simple-table">
5585
- <xsl:call-template name="getSimpleTable"/>
6653
+ <xsl:call-template name="getSimpleTable">
6654
+ <xsl:with-param name="id" select="@id"/>
6655
+ </xsl:call-template>
5586
6656
  </xsl:variable>
5587
6657
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
5588
6658
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
@@ -6000,6 +7070,7 @@
6000
7070
 
6001
7071
 
6002
7072
 
7073
+
6003
7074
 
6004
7075
  <xsl:variable name="references_num_current">
6005
7076
  <xsl:number level="any" count="m3d:references"/>
@@ -6323,6 +7394,11 @@
6323
7394
  </xsl:otherwise>
6324
7395
  </xsl:choose>
6325
7396
  </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
7397
+
7398
+ <xsl:apply-templates select="*[local-name() = 'name']">
7399
+ <xsl:with-param name="process">true</xsl:with-param>
7400
+ </xsl:apply-templates>
7401
+
6326
7402
  <fo:list-block xsl:use-attribute-sets="list-style">
6327
7403
 
6328
7404
 
@@ -6337,12 +7413,23 @@
6337
7413
 
6338
7414
 
6339
7415
 
7416
+ <xsl:if test="*[local-name() = 'name']">
7417
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7418
+ </xsl:if>
7419
+
6340
7420
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
6341
7421
  </fo:list-block>
6342
7422
  <!-- <xsl:for-each select="./iho:note">
6343
7423
  <xsl:call-template name="note"/>
6344
7424
  </xsl:for-each> -->
6345
7425
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
7426
+ </xsl:template><xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
7427
+ <xsl:param name="process">false</xsl:param>
7428
+ <xsl:if test="$process = 'true'">
7429
+ <fo:block xsl:use-attribute-sets="list-name-style">
7430
+ <xsl:apply-templates/>
7431
+ </fo:block>
7432
+ </xsl:if>
6346
7433
  </xsl:template><xsl:template match="*[local-name()='li']">
6347
7434
  <fo:list-item xsl:use-attribute-sets="list-item-style">
6348
7435
  <xsl:copy-of select="@id"/>
@@ -6542,7 +7629,7 @@
6542
7629
  <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
6543
7630
  <fo:inline id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:inline>
6544
7631
  <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
6545
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"> </xsl:if>
7632
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
6546
7633
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
6547
7634
  <!-- <row>
6548
7635
  <date>05-07-2013</date>
@@ -6620,7 +7707,7 @@
6620
7707
 
6621
7708
  </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" priority="2">
6622
7709
 
6623
- <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
7710
+ <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
6624
7711
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
6625
7712
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
6626
7713
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
@@ -6631,7 +7718,9 @@
6631
7718
 
6632
7719
  <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
6633
7720
  <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
6634
- <xsl:number format="[1]"/>
7721
+
7722
+ <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
7723
+
6635
7724
  </xsl:if>
6636
7725
 
6637
7726
  </fo:inline>
@@ -6653,26 +7742,23 @@
6653
7742
  <xsl:if test=".//*[local-name() = 'fn']">
6654
7743
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
6655
7744
  </xsl:if>
7745
+
7746
+ <!-- display document identifier, not number [1] -->
6656
7747
  <xsl:variable name="docidentifier">
6657
7748
  <xsl:choose>
6658
7749
  <xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
6659
7750
  <xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
6660
7751
  </xsl:choose>
6661
7752
  </xsl:variable>
6662
- <fo:inline><xsl:value-of select="$docidentifier"/></fo:inline>
7753
+ <xsl:value-of select="$docidentifier"/>
7754
+
6663
7755
  <xsl:apply-templates select="*[local-name() = 'note']"/>
6664
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
6665
- <xsl:choose>
6666
- <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = $lang]">
6667
- <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = $lang]"/>
6668
- </xsl:when>
6669
- <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
6670
- <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
6671
- </xsl:when>
6672
- <xsl:otherwise>
6673
- <xsl:apply-templates select="*[local-name() = 'title']"/>
6674
- </xsl:otherwise>
6675
- </xsl:choose>
7756
+
7757
+ <xsl:if test="normalize-space($docidentifier) != '' and *[local-name() = 'formattedref']">
7758
+ <xsl:text>,</xsl:text>
7759
+ <xsl:text> </xsl:text>
7760
+ </xsl:if>
7761
+
6676
7762
  <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
6677
7763
  <!-- end bibitem processing -->
6678
7764
 
@@ -6976,12 +8062,16 @@
6976
8062
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
6977
8063
 
6978
8064
 
8065
+
8066
+
6979
8067
 
6980
8068
 
6981
8069
 
6982
8070
  <fo:block-container xsl:use-attribute-sets="admonition-container-style">
6983
8071
 
6984
8072
 
8073
+
8074
+
6985
8075
  <fo:block xsl:use-attribute-sets="admonition-name-style">
6986
8076
  <xsl:call-template name="displayAdmonitionName"/>
6987
8077
  </fo:block>
@@ -6994,25 +8084,32 @@
6994
8084
  </fo:block-container>
6995
8085
 
6996
8086
  </xsl:template><xsl:template name="displayAdmonitionName">
6997
-
8087
+ <xsl:param name="sep"/> <!-- Example: ' - ' -->
8088
+ <!-- <xsl:choose>
8089
+ <xsl:when test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
8090
+ <xsl:choose>
8091
+ <xsl:when test="@type='important'"><xsl:apply-templates select="@type"/></xsl:when>
8092
+ <xsl:otherwise>
8093
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
8094
+ </xsl:otherwise>
8095
+ </xsl:choose>
8096
+ </xsl:when>
8097
+ <xsl:otherwise>
6998
8098
  <xsl:apply-templates select="*[local-name() = 'name']"/>
6999
8099
  <xsl:if test="not(*[local-name() = 'name'])">
7000
8100
  <xsl:apply-templates select="@type"/>
7001
8101
  </xsl:if>
7002
-
7003
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
7004
- <xsl:apply-templates/>
7005
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
7006
- <xsl:variable name="admonition_type_">
7007
- <xsl:call-template name="getLocalizedString">
7008
- <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
7009
- </xsl:call-template>
8102
+ </xsl:otherwise>
8103
+ </xsl:choose> -->
8104
+ <xsl:variable name="name">
8105
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
7010
8106
  </xsl:variable>
7011
- <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
7012
- <xsl:value-of select="$admonition_type"/>
7013
- <xsl:if test="$admonition_type = ''">
7014
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
8107
+ <xsl:copy-of select="$name"/>
8108
+ <xsl:if test="normalize-space($name) != ''">
8109
+ <xsl:value-of select="$sep"/>
7015
8110
  </xsl:if>
8111
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
8112
+ <xsl:apply-templates/>
7016
8113
  </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
7017
8114
  <!-- processing for admonition/p found in the template for 'p' -->
7018
8115
  <xsl:call-template name="paragraph"/>
@@ -7178,6 +8275,8 @@
7178
8275
  </xsl:when>
7179
8276
  <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
7180
8277
  </xsl:choose>
8278
+ </xsl:template><xsl:template match="*[local-name() = 'lang_none']">
8279
+ <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
7181
8280
  </xsl:template><xsl:template name="printEdition">
7182
8281
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
7183
8282
  <xsl:text> </xsl:text>
@@ -7284,6 +8383,27 @@
7284
8383
  </xsl:when>
7285
8384
  <xsl:otherwise><xsl:value-of select="$monthStr_"/></xsl:otherwise>
7286
8385
  </xsl:choose>
8386
+ </xsl:template><xsl:template name="getMonthLocalizedByNum">
8387
+ <xsl:param name="num"/>
8388
+ <xsl:variable name="monthStr">
8389
+ <xsl:choose>
8390
+ <xsl:when test="$num = '01'">january</xsl:when>
8391
+ <xsl:when test="$num = '02'">february</xsl:when>
8392
+ <xsl:when test="$num = '03'">march</xsl:when>
8393
+ <xsl:when test="$num = '04'">april</xsl:when>
8394
+ <xsl:when test="$num = '05'">may</xsl:when>
8395
+ <xsl:when test="$num = '06'">june</xsl:when>
8396
+ <xsl:when test="$num = '07'">july</xsl:when>
8397
+ <xsl:when test="$num = '08'">august</xsl:when>
8398
+ <xsl:when test="$num = '09'">september</xsl:when>
8399
+ <xsl:when test="$num = '10'">october</xsl:when>
8400
+ <xsl:when test="$num = '11'">november</xsl:when>
8401
+ <xsl:when test="$num = '12'">december</xsl:when>
8402
+ </xsl:choose>
8403
+ </xsl:variable>
8404
+ <xsl:call-template name="getLocalizedString">
8405
+ <xsl:with-param name="key">month_<xsl:value-of select="$monthStr"/></xsl:with-param>
8406
+ </xsl:call-template>
7287
8407
  </xsl:template><xsl:template name="insertKeywords">
7288
8408
  <xsl:param name="sorting" select="'true'"/>
7289
8409
  <xsl:param name="charAtEnd" select="'.'"/>
@@ -7483,6 +8603,7 @@
7483
8603
 
7484
8604
 
7485
8605
 
8606
+
7486
8607
  <xsl:value-of select="document('')//*/namespace::m3d"/>
7487
8608
 
7488
8609
 
@@ -7890,4 +9011,40 @@
7890
9011
  <xsl:value-of select="$value"/>
7891
9012
  </xsl:otherwise>
7892
9013
  </xsl:choose>
9014
+ </xsl:template><xsl:template match="*" mode="print_as_xml">
9015
+ <xsl:param name="level">0</xsl:param>
9016
+
9017
+ <fo:block margin-left="{2*$level}mm">
9018
+ <xsl:text>
9019
+ &lt;</xsl:text>
9020
+ <xsl:value-of select="local-name()"/>
9021
+ <xsl:for-each select="@*">
9022
+ <xsl:text> </xsl:text>
9023
+ <xsl:value-of select="local-name()"/>
9024
+ <xsl:text>="</xsl:text>
9025
+ <xsl:value-of select="."/>
9026
+ <xsl:text>"</xsl:text>
9027
+ </xsl:for-each>
9028
+ <xsl:text>&gt;</xsl:text>
9029
+
9030
+ <xsl:if test="not(*)">
9031
+ <fo:inline font-weight="bold"><xsl:value-of select="."/></fo:inline>
9032
+ <xsl:text>&lt;/</xsl:text>
9033
+ <xsl:value-of select="local-name()"/>
9034
+ <xsl:text>&gt;</xsl:text>
9035
+ </xsl:if>
9036
+ </fo:block>
9037
+
9038
+ <xsl:if test="*">
9039
+ <fo:block>
9040
+ <xsl:apply-templates mode="print_as_xml">
9041
+ <xsl:with-param name="level" select="$level + 1"/>
9042
+ </xsl:apply-templates>
9043
+ </fo:block>
9044
+ <fo:block margin-left="{2*$level}mm">
9045
+ <xsl:text>&lt;/</xsl:text>
9046
+ <xsl:value-of select="local-name()"/>
9047
+ <xsl:text>&gt;</xsl:text>
9048
+ </fo:block>
9049
+ </xsl:if>
7893
9050
  </xsl:template></xsl:stylesheet>