metanorma-iho 0.6.0 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -560,6 +560,7 @@
560
560
 
561
561
  <xsl:template match="iho:p" name="paragraph">
562
562
  <xsl:param name="inline" select="'false'"/>
563
+ <xsl:param name="split_keep-within-line"/>
563
564
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
564
565
  <xsl:variable name="element-name">
565
566
  <xsl:choose>
@@ -594,7 +595,9 @@
594
595
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
595
596
  </xsl:if>
596
597
 
597
- <xsl:apply-templates/>
598
+ <xsl:apply-templates>
599
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
600
+ </xsl:apply-templates>
598
601
  </xsl:element>
599
602
  <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
600
603
  <fo:block margin-bottom="12pt">
@@ -777,12 +780,41 @@
777
780
  <xsl:text>iVBORw0KGgoAAAANSUhEUgAAAN8AAADfCAIAAAD5m5F7AAAAAXNSR0IArs4c6QAAAAlwSFlzAAAh1QAAIdUBBJy0nQAAPjlJREFUeAHtXQdAFEcX5qhH772IgIAgxYLYFRV7773EEjWWaKImplmS2BKT2BVjr9hFxN4bghRBpYn03nvn//aWW5cDkagcd//NxXB7uzNv3rz3zZs37S2noryoqqJQSoojRT5EAiImAdmqiqKyklSCThHTC2GHkoAsTwwwnMR2EkCInASkRY4jwhCRAF8CBJ18SZBv0ZMAQafo6YRwxJcAQSdfEuRb9CRA0Cl6OiEc8SVA0MmXBPkWPQkQdIqeTghHfAkQdPIlQb5FTwIEnaKnE8IRXwIEnXxJkG/RkwBBp+jphHDElwBBJ18S5Fv0JEDQKXo6IRzxJUDQyZcE+RY9CRB0ip5OCEd8CRB08iVBvkVPAgSdoqcTwhFfAgSdfEmQb9GTAEGn6OmEcMSXAEEnXxLkW/QkQNApejohHPElQNDJlwT5Fj0JEHSKnk4IR3wJEHTyJUG+RU8C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bEsUrQKXEqF6MKE3SKkbIkjlWCTolTuRhVmKBTjJQlcawSdEqcysWowgSdYqQsiWOVoFPiVC5GFSboFCNlSRyrBJ0Sp3IxqjBBpxgpS+JYJeiUOJWLUYUJOsVIWRLHKkGnxKlcjCpM0ClGypI4Vgk6JU7lYlRhgk4xUpbEsUrQKXEqF6MKE3SKkbIkjlWCTolTuRhVmKBTjJQlcawSdEqcysWowgSdYqQsiWP1f5V8zYCHJlYcAAAAAElFTkSuQmCC</xsl:text>
778
781
  </xsl:variable>
779
782
 
780
- <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">
783
+ <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_">
784
+ <xsl:for-each select="$table_widths_from_if//table">
785
+ <xsl:copy>
786
+ <xsl:copy-of select="@*"/>
787
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm"/>
788
+ </xsl:copy>
789
+ </xsl:for-each>
790
+ </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_">
791
+ false
792
+ </xsl:variable><xsl:variable name="isGenerateTableIF" select="normalize-space($isGenerateTableIF_)"/><xsl:variable name="lang">
781
793
  <xsl:call-template name="getLang"/>
782
- </xsl:variable><xsl:variable name="pageWidth_">
783
- 210
794
+ </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_">
795
+ <xsl:choose>
796
+ <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
797
+ <xsl:when test="$papersize = 'a4'">210</xsl:when>
798
+ </xsl:choose>
799
+ </xsl:variable><xsl:variable name="papersize_width" select="normalize-space($papersize_width_)"/><xsl:variable name="papersize_height_">
800
+ <xsl:choose>
801
+ <xsl:when test="$papersize = 'letter'">279.4</xsl:when>
802
+ <xsl:when test="$papersize = 'a4'">297</xsl:when>
803
+ </xsl:choose>
804
+ </xsl:variable><xsl:variable name="papersize_height" select="normalize-space($papersize_height_)"/><xsl:variable name="pageWidth_">
805
+ <xsl:choose>
806
+ <xsl:when test="$papersize_width != ''"><xsl:value-of select="$papersize_width"/></xsl:when>
807
+ <xsl:otherwise>
808
+ 210
809
+ </xsl:otherwise>
810
+ </xsl:choose>
784
811
  </xsl:variable><xsl:variable name="pageWidth" select="normalize-space($pageWidth_)"/><xsl:variable name="pageHeight_">
785
- 297
812
+ <xsl:choose>
813
+ <xsl:when test="$papersize_height != ''"><xsl:value-of select="$papersize_height"/></xsl:when>
814
+ <xsl:otherwise>
815
+ 297
816
+ </xsl:otherwise>
817
+ </xsl:choose>
786
818
  </xsl:variable><xsl:variable name="pageHeight" select="normalize-space($pageHeight_)"/><xsl:variable name="marginLeftRight1_">
787
819
  25.4
788
820
  </xsl:variable><xsl:variable name="marginLeftRight1" select="normalize-space($marginLeftRight1_)"/><xsl:variable name="marginLeftRight2_">
@@ -896,7 +928,8 @@
896
928
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
897
929
  </xsl:otherwise>
898
930
  </xsl:choose>
899
- </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">
931
+ </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">
932
+
900
933
 
901
934
 
902
935
 
@@ -904,7 +937,8 @@
904
937
 
905
938
 
906
939
 
907
- <xsl:attribute name="font-family">Arial, Cambria Math</xsl:attribute>
940
+ <xsl:attribute name="font-family">Arial, Cambria Math, <xsl:value-of select="$font_noto_sans"/></xsl:attribute>
941
+ <xsl:attribute name="font-family-generic">Sans</xsl:attribute>
908
942
  <xsl:attribute name="font-size">12pt</xsl:attribute>
909
943
 
910
944
 
@@ -927,17 +961,60 @@
927
961
  </xsl:variable>
928
962
  <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
929
963
 
964
+ <xsl:variable name="font_family_generic" select="$root-style_/root-style/@font-family-generic"/>
965
+
930
966
  <xsl:for-each select="$root-style_/root-style/@*">
967
+
931
968
  <xsl:choose>
932
- <xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
969
+ <xsl:when test="local-name() = 'font-family-generic'"><!-- skip, it's using for determine 'sans' or 'serif' --></xsl:when>
970
+ <xsl:when test="local-name() = 'font-family'">
971
+
972
+ <xsl:variable name="font_regional_prefix">
973
+ <xsl:choose>
974
+ <xsl:when test="$font_family_generic = 'Sans'">Noto Sans</xsl:when>
975
+ <xsl:otherwise>Noto Serif</xsl:otherwise>
976
+ </xsl:choose>
977
+ </xsl:variable>
978
+
933
979
  <xsl:attribute name="{local-name()}">
934
- <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
980
+
981
+ <xsl:variable name="font_extended">
982
+ <xsl:choose>
983
+ <xsl:when test="$lang = 'zh'"><xsl:value-of select="$font_regional_prefix"/> SC</xsl:when>
984
+ <xsl:when test="$lang = 'hk'"><xsl:value-of select="$font_regional_prefix"/> HK</xsl:when>
985
+ <xsl:when test="$lang = 'jp'"><xsl:value-of select="$font_regional_prefix"/> JP</xsl:when>
986
+ <xsl:when test="$lang = 'kr'"><xsl:value-of select="$font_regional_prefix"/> KR</xsl:when>
987
+ <xsl:when test="$lang = 'sc'"><xsl:value-of select="$font_regional_prefix"/> SC</xsl:when>
988
+ <xsl:when test="$lang = 'tc'"><xsl:value-of select="$font_regional_prefix"/> TC</xsl:when>
989
+ </xsl:choose>
990
+ </xsl:variable>
991
+ <xsl:if test="normalize-space($font_extended) != ''">
992
+ <xsl:value-of select="$font_regional_prefix"/><xsl:text>, </xsl:text>
993
+ <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
994
+ </xsl:if>
995
+
996
+ <xsl:value-of select="."/>
997
+
998
+ <xsl:if test="$additional_fonts != ''">
999
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1000
+ </xsl:if>
935
1001
  </xsl:attribute>
936
1002
  </xsl:when>
937
1003
  <xsl:otherwise>
938
1004
  <xsl:copy-of select="."/>
939
1005
  </xsl:otherwise>
940
1006
  </xsl:choose>
1007
+
1008
+ <!-- <xsl:choose>
1009
+ <xsl:when test="local-name() = 'font-family'">
1010
+ <xsl:attribute name="{local-name()}">
1011
+ <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
1012
+ </xsl:attribute>
1013
+ </xsl:when>
1014
+ <xsl:otherwise>
1015
+ <xsl:copy-of select="."/>
1016
+ </xsl:otherwise>
1017
+ </xsl:choose> -->
941
1018
  </xsl:for-each>
942
1019
  </xsl:template><xsl:attribute-set name="copyright-statement-style">
943
1020
 
@@ -1008,7 +1085,8 @@
1008
1085
 
1009
1086
 
1010
1087
 
1011
- <xsl:attribute name="font-family">Fira Code</xsl:attribute>
1088
+
1089
+ <xsl:attribute name="font-family">Fira Code, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1012
1090
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1013
1091
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1014
1092
  <xsl:attribute name="line-height">113%</xsl:attribute>
@@ -1054,6 +1132,7 @@
1054
1132
 
1055
1133
 
1056
1134
 
1135
+
1057
1136
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1058
1137
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
1059
1138
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
@@ -1068,6 +1147,7 @@
1068
1147
 
1069
1148
 
1070
1149
 
1150
+
1071
1151
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1072
1152
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
1073
1153
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1093,6 +1173,7 @@
1093
1173
 
1094
1174
 
1095
1175
 
1176
+
1096
1177
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1097
1178
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1098
1179
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -1138,6 +1219,7 @@
1138
1219
 
1139
1220
  </xsl:attribute-set><xsl:variable name="table-border_">
1140
1221
 
1222
+
1141
1223
  </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-container-style">
1142
1224
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
1143
1225
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -1149,6 +1231,7 @@
1149
1231
 
1150
1232
 
1151
1233
 
1234
+
1152
1235
  <xsl:attribute name="space-after">18pt</xsl:attribute>
1153
1236
 
1154
1237
 
@@ -1177,6 +1260,7 @@
1177
1260
 
1178
1261
 
1179
1262
 
1263
+
1180
1264
 
1181
1265
 
1182
1266
 
@@ -1197,6 +1281,7 @@
1197
1281
 
1198
1282
 
1199
1283
 
1284
+
1200
1285
 
1201
1286
  <xsl:attribute name="text-align">center</xsl:attribute>
1202
1287
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1239,6 +1324,7 @@
1239
1324
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1240
1325
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1241
1326
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
1327
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1242
1328
  <xsl:attribute name="display-align">center</xsl:attribute>
1243
1329
 
1244
1330
 
@@ -1257,6 +1343,8 @@
1257
1343
  <xsl:attribute name="display-align">center</xsl:attribute>
1258
1344
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1259
1345
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
1346
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1347
+
1260
1348
 
1261
1349
 
1262
1350
 
@@ -1284,7 +1372,7 @@
1284
1372
 
1285
1373
 
1286
1374
 
1287
-
1375
+
1288
1376
 
1289
1377
 
1290
1378
 
@@ -1297,6 +1385,7 @@
1297
1385
 
1298
1386
 
1299
1387
 
1388
+
1300
1389
  <xsl:attribute name="font-size">12pt</xsl:attribute>
1301
1390
 
1302
1391
 
@@ -1309,6 +1398,8 @@
1309
1398
 
1310
1399
 
1311
1400
 
1401
+
1402
+
1312
1403
  </xsl:attribute-set><xsl:attribute-set name="table-fn-number-style">
1313
1404
  <xsl:attribute name="font-size">80%</xsl:attribute>
1314
1405
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
@@ -1319,6 +1410,7 @@
1319
1410
 
1320
1411
 
1321
1412
 
1413
+
1322
1414
  <xsl:attribute name="vertical-align">super</xsl:attribute>
1323
1415
 
1324
1416
 
@@ -1345,13 +1437,15 @@
1345
1437
  </xsl:attribute-set><xsl:attribute-set name="dt-row-style">
1346
1438
 
1347
1439
 
1348
- </xsl:attribute-set><xsl:attribute-set name="dt-style">
1440
+ </xsl:attribute-set><xsl:attribute-set name="dt-cell-style">
1441
+ </xsl:attribute-set><xsl:attribute-set name="dt-block-style">
1349
1442
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1350
1443
 
1351
1444
 
1352
1445
 
1353
1446
 
1354
1447
 
1448
+
1355
1449
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
1356
1450
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1357
1451
 
@@ -1360,6 +1454,28 @@
1360
1454
 
1361
1455
 
1362
1456
 
1457
+ </xsl:attribute-set><xsl:attribute-set name="dl-name-style">
1458
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1459
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1460
+
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1467
+
1468
+
1469
+
1470
+
1471
+
1472
+
1473
+
1474
+
1475
+
1476
+
1477
+ </xsl:attribute-set><xsl:attribute-set name="dd-cell-style">
1478
+ <xsl:attribute name="padding-left">2mm</xsl:attribute>
1363
1479
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1364
1480
 
1365
1481
 
@@ -1390,6 +1506,7 @@
1390
1506
 
1391
1507
 
1392
1508
 
1509
+
1393
1510
 
1394
1511
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1395
1512
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
@@ -1466,6 +1583,8 @@
1466
1583
 
1467
1584
 
1468
1585
 
1586
+ </xsl:attribute-set><xsl:attribute-set name="termnote-p-style">
1587
+
1469
1588
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1470
1589
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
1471
1590
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
@@ -1516,6 +1635,7 @@
1516
1635
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1517
1636
 
1518
1637
 
1638
+
1519
1639
 
1520
1640
 
1521
1641
 
@@ -1563,6 +1683,7 @@
1563
1683
 
1564
1684
 
1565
1685
 
1686
+
1566
1687
  </xsl:attribute-set><xsl:attribute-set name="formula-stem-number-style">
1567
1688
  <xsl:attribute name="text-align">right</xsl:attribute>
1568
1689
 
@@ -1581,20 +1702,20 @@
1581
1702
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
1582
1703
 
1583
1704
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
1705
+ <xsl:attribute name="width">100%</xsl:attribute>
1706
+ <xsl:attribute name="content-height">100%</xsl:attribute>
1707
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1584
1708
 
1585
1709
 
1586
- <xsl:attribute name="width">100%</xsl:attribute>
1587
1710
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
1588
- <xsl:attribute name="scaling">uniform</xsl:attribute>
1589
1711
 
1590
1712
 
1591
1713
 
1592
-
1593
-
1714
+
1594
1715
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1595
1716
 
1596
1717
 
1597
- <xsl:attribute name="font-family">Courier New</xsl:attribute>
1718
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1598
1719
 
1599
1720
 
1600
1721
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
@@ -1664,6 +1785,7 @@
1664
1785
 
1665
1786
 
1666
1787
 
1788
+
1667
1789
  <xsl:attribute name="provisional-distance-between-starts">6mm</xsl:attribute>
1668
1790
 
1669
1791
 
@@ -1677,6 +1799,24 @@
1677
1799
 
1678
1800
 
1679
1801
 
1802
+ </xsl:attribute-set><xsl:attribute-set name="list-name-style">
1803
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1804
+
1805
+
1806
+
1807
+
1808
+
1809
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1810
+
1811
+
1812
+
1813
+
1814
+
1815
+
1816
+
1817
+
1818
+
1819
+
1680
1820
  </xsl:attribute-set><xsl:attribute-set name="list-item-style">
1681
1821
 
1682
1822
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1716,6 +1856,7 @@
1716
1856
 
1717
1857
 
1718
1858
 
1859
+
1719
1860
  <xsl:attribute name="font-size">70%</xsl:attribute>
1720
1861
  <xsl:attribute name="vertical-align">super</xsl:attribute>
1721
1862
 
@@ -1740,6 +1881,7 @@
1740
1881
 
1741
1882
 
1742
1883
 
1884
+
1743
1885
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1744
1886
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1745
1887
 
@@ -1763,6 +1905,7 @@
1763
1905
 
1764
1906
 
1765
1907
 
1908
+
1766
1909
  <xsl:attribute name="font-size">60%</xsl:attribute>
1767
1910
  <xsl:attribute name="vertical-align">super</xsl:attribute>
1768
1911
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -1784,6 +1927,7 @@
1784
1927
 
1785
1928
 
1786
1929
 
1930
+
1787
1931
  <xsl:attribute name="border">0.5pt solid rgb(79, 129, 189)</xsl:attribute>
1788
1932
  <xsl:attribute name="color">rgb(79, 129, 189)</xsl:attribute>
1789
1933
  <xsl:attribute name="margin-left">16mm</xsl:attribute>
@@ -1799,12 +1943,13 @@
1799
1943
 
1800
1944
 
1801
1945
  </xsl:attribute-set><xsl:attribute-set name="admonition-container-style">
1946
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1947
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1948
+
1802
1949
 
1803
1950
 
1804
1951
 
1805
1952
 
1806
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1807
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1808
1953
  <xsl:attribute name="padding">2mm</xsl:attribute>
1809
1954
  <xsl:attribute name="padding-top">3mm</xsl:attribute>
1810
1955
 
@@ -1840,6 +1985,7 @@
1840
1985
 
1841
1986
 
1842
1987
 
1988
+
1843
1989
  <xsl:attribute name="font-style">italic</xsl:attribute>
1844
1990
 
1845
1991
 
@@ -1876,6 +2022,7 @@
1876
2022
 
1877
2023
 
1878
2024
 
2025
+
1879
2026
  <xsl:attribute name="line-height">115%</xsl:attribute>
1880
2027
 
1881
2028
 
@@ -1897,6 +2044,7 @@
1897
2044
 
1898
2045
 
1899
2046
 
2047
+
1900
2048
  <xsl:attribute name="line-height">115%</xsl:attribute>
1901
2049
 
1902
2050
 
@@ -1922,6 +2070,7 @@
1922
2070
 
1923
2071
 
1924
2072
 
2073
+
1925
2074
  <xsl:attribute name="font-size">8pt</xsl:attribute>
1926
2075
  <xsl:attribute name="baseline-shift">30%</xsl:attribute>
1927
2076
 
@@ -1943,6 +2092,7 @@
1943
2092
 
1944
2093
 
1945
2094
 
2095
+
1946
2096
  <xsl:attribute name="alignment-baseline">hanging</xsl:attribute>
1947
2097
  <xsl:attribute name="padding-right">3mm</xsl:attribute>
1948
2098
 
@@ -1964,6 +2114,7 @@
1964
2114
 
1965
2115
 
1966
2116
 
2117
+
1967
2118
  <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
1968
2119
 
1969
2120
 
@@ -2083,13 +2234,13 @@
2083
2234
 
2084
2235
  </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">
2085
2236
  <xsl:variable name="nodes_preface_">
2086
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2237
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2087
2238
  <node id="{@id}"/>
2088
2239
  </xsl:for-each>
2089
2240
  </xsl:variable>
2090
2241
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2091
2242
 
2092
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2243
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2093
2244
  <xsl:sort select="@displayorder" data-type="number"/>
2094
2245
 
2095
2246
  <!-- process Section's title -->
@@ -2155,7 +2306,7 @@
2155
2306
  </xsl:for-each>
2156
2307
  </figures>
2157
2308
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2158
- <xsl:for-each select="/*/*[local-name()='preface']/*">
2309
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2159
2310
  <xsl:sort select="@displayorder" data-type="number"/>
2160
2311
  <xsl:apply-templates select="."/>
2161
2312
  </xsl:for-each>
@@ -2209,7 +2360,38 @@
2209
2360
  </xsl:template><xsl:template match="*[local-name()='br']">
2210
2361
  <xsl:value-of select="$linebreak"/>
2211
2362
  </xsl:template><xsl:template match="*[local-name() = 'keep-together_within-line']">
2212
- <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2363
+ <xsl:param name="split_keep-within-line"/>
2364
+
2365
+ <!-- <fo:inline>split_keep-within-line='<xsl:value-of select="$split_keep-within-line"/>'</fo:inline> -->
2366
+ <xsl:choose>
2367
+
2368
+ <xsl:when test="normalize-space($split_keep-within-line) = 'true'">
2369
+ <xsl:variable name="sep">_</xsl:variable>
2370
+ <xsl:variable name="items">
2371
+ <xsl:call-template name="split">
2372
+ <xsl:with-param name="pText" select="."/>
2373
+ <xsl:with-param name="sep" select="$sep"/>
2374
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
2375
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
2376
+ </xsl:call-template>
2377
+ </xsl:variable>
2378
+ <xsl:for-each select="xalan:nodeset($items)/item">
2379
+ <xsl:choose>
2380
+ <xsl:when test=". = $sep">
2381
+ <xsl:value-of select="$sep"/><xsl:value-of select="$zero_width_space"/>
2382
+ </xsl:when>
2383
+ <xsl:otherwise>
2384
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2385
+ </xsl:otherwise>
2386
+ </xsl:choose>
2387
+ </xsl:for-each>
2388
+ </xsl:when>
2389
+
2390
+ <xsl:otherwise>
2391
+ <fo:inline keep-together.within-line="always"><xsl:apply-templates/></fo:inline>
2392
+ </xsl:otherwise>
2393
+
2394
+ </xsl:choose>
2213
2395
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
2214
2396
  <fo:block xsl:use-attribute-sets="copyright-statement-style">
2215
2397
  <xsl:apply-templates/>
@@ -2301,9 +2483,14 @@
2301
2483
 
2302
2484
  <xsl:variable name="table">
2303
2485
 
2304
- <xsl:variable name="simple-table">
2305
- <xsl:call-template name="getSimpleTable"/>
2486
+ <xsl:variable name="simple-table">
2487
+ <xsl:call-template name="getSimpleTable">
2488
+ <xsl:with-param name="id" select="@id"/>
2489
+ </xsl:call-template>
2306
2490
  </xsl:variable>
2491
+ <!-- <xsl:variable name="simple-table" select="xalan:nodeset($simple-table_)"/> -->
2492
+
2493
+ <!-- simple-table=<xsl:copy-of select="$simple-table"/> -->
2307
2494
 
2308
2495
 
2309
2496
  <!-- Display table's name before table as standalone block -->
@@ -2326,7 +2513,23 @@
2326
2513
  </xsl:call-template>
2327
2514
  </xsl:if>
2328
2515
  </xsl:variable>
2329
- <!-- DEBUG colwidths=<xsl:copy-of select="$colwidths"/> -->
2516
+ <!-- <xsl:variable name="colwidths" select="xalan:nodeset($colwidths_)"/> -->
2517
+
2518
+ <!-- DEBUG -->
2519
+ <xsl:if test="$table_if_debug = 'true'">
2520
+ <fo:block font-size="60%">
2521
+ <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/>
2522
+ </fo:block>
2523
+ </xsl:if>
2524
+
2525
+
2526
+ <!-- <xsl:copy-of select="$colwidths"/> -->
2527
+
2528
+ <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
2529
+ DEBUG
2530
+ colwidths=<xsl:copy-of select="$colwidths"/>
2531
+ <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> -->
2532
+
2330
2533
 
2331
2534
 
2332
2535
  <xsl:variable name="margin-side">
@@ -2348,6 +2551,8 @@
2348
2551
 
2349
2552
 
2350
2553
 
2554
+
2555
+
2351
2556
 
2352
2557
 
2353
2558
 
@@ -2384,12 +2589,22 @@
2384
2589
 
2385
2590
 
2386
2591
 
2592
+
2593
+
2387
2594
  </xsl:element>
2388
2595
  </xsl:variable>
2389
2596
 
2597
+ <xsl:if test="$isGenerateTableIF = 'true'">
2598
+ <!-- to determine start of table -->
2599
+ <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
2600
+ </xsl:if>
2390
2601
 
2391
2602
  <fo:table id="{@id}">
2392
2603
 
2604
+ <xsl:if test="$isGenerateTableIF = 'true'">
2605
+ <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
2606
+ </xsl:if>
2607
+
2393
2608
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
2394
2609
  <xsl:attribute name="{local-name()}">
2395
2610
  <xsl:value-of select="."/>
@@ -2403,24 +2618,47 @@
2403
2618
 
2404
2619
 
2405
2620
  <xsl:choose>
2406
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2407
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2408
- <fo:table-column column-width="{@width}"/>
2409
- </xsl:for-each>
2621
+ <xsl:when test="$isGenerateTableIF = 'true'">
2622
+ <!-- generate IF for table widths -->
2623
+ <!-- example:
2624
+ <tr>
2625
+ <td valign="top" align="left" id="tab-symdu_1_1">
2626
+ <p>Symbol</p>
2627
+ <word id="tab-symdu_1_1_word_1">Symbol</word>
2628
+ </td>
2629
+ <td valign="top" align="left" id="tab-symdu_1_2">
2630
+ <p>Description</p>
2631
+ <word id="tab-symdu_1_2_word_1">Description</word>
2632
+ </td>
2633
+ </tr>
2634
+ -->
2635
+ <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if"/>
2636
+
2410
2637
  </xsl:when>
2411
2638
  <xsl:otherwise>
2412
- <xsl:call-template name="insertTableColumnWidth">
2413
- <xsl:with-param name="colwidths" select="$colwidths"/>
2414
- </xsl:call-template>
2415
- </xsl:otherwise>
2416
- </xsl:choose>
2417
2639
 
2418
- <xsl:choose>
2419
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2420
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2421
- </xsl:when>
2422
- <xsl:otherwise>
2423
- <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 -->
2640
+ <xsl:choose>
2641
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2642
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2643
+ <fo:table-column column-width="{@width}"/>
2644
+ </xsl:for-each>
2645
+ </xsl:when>
2646
+ <xsl:otherwise>
2647
+ <xsl:call-template name="insertTableColumnWidth">
2648
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2649
+ </xsl:call-template>
2650
+ </xsl:otherwise>
2651
+ </xsl:choose>
2652
+
2653
+ <xsl:choose>
2654
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2655
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2656
+ </xsl:when>
2657
+ <xsl:otherwise>
2658
+ <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 -->
2659
+ </xsl:otherwise>
2660
+ </xsl:choose>
2661
+
2424
2662
  </xsl:otherwise>
2425
2663
  </xsl:choose>
2426
2664
 
@@ -2498,23 +2736,29 @@
2498
2736
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
2499
2737
  <xsl:param name="continued"/>
2500
2738
  <xsl:if test="normalize-space() != ''">
2501
- <fo:block xsl:use-attribute-sets="table-name-style">
2502
-
2503
-
2504
-
2505
-
2739
+
2740
+
2506
2741
 
2507
- <xsl:choose>
2508
- <xsl:when test="$continued = 'true'">
2742
+ <fo:block xsl:use-attribute-sets="table-name-style">
2743
+
2509
2744
 
2510
- </xsl:when>
2511
- <xsl:otherwise>
2512
- <xsl:apply-templates/>
2513
- </xsl:otherwise>
2514
- </xsl:choose>
2515
-
2745
+
2746
+
2747
+
2748
+ <xsl:choose>
2749
+ <xsl:when test="$continued = 'true'">
2750
+
2751
+ </xsl:when>
2752
+ <xsl:otherwise>
2753
+ <xsl:apply-templates/>
2754
+ </xsl:otherwise>
2755
+ </xsl:choose>
2756
+
2757
+
2758
+ </fo:block>
2759
+
2516
2760
 
2517
- </fo:block>
2761
+
2518
2762
  </xsl:if>
2519
2763
  </xsl:template><xsl:template name="calculate-columns-numbers">
2520
2764
  <xsl:param name="table-row"/>
@@ -2523,11 +2767,22 @@
2523
2767
  <xsl:variable name="columns-with-colspan" select="count($table-row/*[@colspan])"/>
2524
2768
  <xsl:value-of select="$columns-count + $sum-colspans - $columns-with-colspan"/>
2525
2769
  </xsl:template><xsl:template name="calculate-column-widths">
2770
+ <xsl:param name="table"/>
2771
+ <xsl:param name="cols-count"/>
2772
+
2773
+ <xsl:call-template name="calculate-column-widths-proportional">
2774
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2775
+ <xsl:with-param name="table" select="$table"/>
2776
+ </xsl:call-template>
2777
+
2778
+ </xsl:template><xsl:template name="calculate-column-widths-proportional">
2526
2779
  <xsl:param name="table"/>
2527
2780
  <xsl:param name="cols-count"/>
2528
2781
  <xsl:param name="curr-col" select="1"/>
2529
2782
  <xsl:param name="width" select="0"/>
2530
2783
 
2784
+ <!-- table=<xsl:copy-of select="$table"/> -->
2785
+
2531
2786
  <xsl:if test="$curr-col &lt;= $cols-count">
2532
2787
  <xsl:variable name="widths">
2533
2788
  <xsl:choose>
@@ -2565,10 +2820,15 @@
2565
2820
  </xsl:for-each>
2566
2821
  </xsl:when>
2567
2822
  <xsl:otherwise>
2568
- <xsl:for-each select="xalan:nodeset($table)/*/tr">
2823
+ <!-- <curr_col><xsl:value-of select="$curr-col"/></curr_col> -->
2824
+
2825
+ <!-- <table><xsl:copy-of select="$table"/></table>
2826
+ -->
2827
+ <xsl:for-each select="xalan:nodeset($table)/*/*[local-name()='tr']">
2569
2828
  <xsl:variable name="td_text">
2570
2829
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2571
2830
  </xsl:variable>
2831
+ <!-- <td_text><xsl:value-of select="$td_text"/></td_text> -->
2572
2832
  <xsl:variable name="words">
2573
2833
  <xsl:variable name="string_with_added_zerospaces">
2574
2834
  <xsl:call-template name="add-zero-spaces-java">
@@ -2583,6 +2843,7 @@
2583
2843
  <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
2584
2844
  </xsl:call-template>
2585
2845
  </xsl:variable>
2846
+ <!-- words=<xsl:copy-of select="$words"/> -->
2586
2847
  <xsl:variable name="max_length">
2587
2848
  <xsl:call-template name="max_length">
2588
2849
  <xsl:with-param name="words" select="xalan:nodeset($words)"/>
@@ -2607,6 +2868,8 @@
2607
2868
  </xsl:choose>
2608
2869
  </xsl:variable>
2609
2870
 
2871
+ <!-- widths=<xsl:copy-of select="$widths"/> -->
2872
+
2610
2873
  <column>
2611
2874
  <xsl:for-each select="xalan:nodeset($widths)//width">
2612
2875
  <xsl:sort select="." data-type="number" order="descending"/>
@@ -2615,33 +2878,271 @@
2615
2878
  </xsl:if>
2616
2879
  </xsl:for-each>
2617
2880
  </column>
2618
- <xsl:call-template name="calculate-column-widths">
2881
+ <xsl:call-template name="calculate-column-widths-proportional">
2619
2882
  <xsl:with-param name="cols-count" select="$cols-count"/>
2620
2883
  <xsl:with-param name="curr-col" select="$curr-col +1"/>
2621
2884
  <xsl:with-param name="table" select="$table"/>
2622
2885
  </xsl:call-template>
2623
2886
  </xsl:if>
2624
- </xsl:template><xsl:template match="*[@keep-together.within-line]/text()" priority="2" mode="td_text">
2887
+ </xsl:template><xsl:template match="*[@keep-together.within-line or local-name() = 'keep-together_within-line']/text()" priority="2" mode="td_text">
2625
2888
  <!-- <xsl:message>DEBUG t1=<xsl:value-of select="."/></xsl:message>
2626
2889
  <xsl:message>DEBUG t2=<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/></xsl:message> -->
2627
2890
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'.','X')"/>
2891
+
2892
+ <!-- if all capitals english letters or digits -->
2893
+ <xsl:if test="normalize-space(translate(., concat($upper,'0123456789'), '')) = ''">
2894
+ <xsl:call-template name="repeat">
2895
+ <xsl:with-param name="char" select="'X'"/>
2896
+ <xsl:with-param name="count" select="string-length(normalize-space(.)) * 0.5"/>
2897
+ </xsl:call-template>
2898
+ </xsl:if>
2628
2899
  </xsl:template><xsl:template match="text()" mode="td_text">
2629
2900
  <xsl:value-of select="translate(., $zero_width_space, ' ')"/><xsl:text> </xsl:text>
2630
2901
  </xsl:template><xsl:template match="*[local-name()='termsource']" mode="td_text">
2631
2902
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2632
2903
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2633
2904
  <xsl:value-of select="@target"/>
2634
- </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2635
- <xsl:variable name="mathml">
2636
- <xsl:for-each select="*">
2637
- <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2638
- <xsl:copy-of select="."/>
2639
- </xsl:if>
2905
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text" name="math_length">
2906
+ <xsl:if test="$isGenerateTableIF = 'false'">
2907
+ <xsl:variable name="mathml_">
2908
+ <xsl:for-each select="*">
2909
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
2910
+ <xsl:copy-of select="."/>
2911
+ </xsl:if>
2912
+ </xsl:for-each>
2913
+ </xsl:variable>
2914
+ <xsl:variable name="mathml" select="xalan:nodeset($mathml_)"/>
2915
+
2916
+ <xsl:variable name="math_text">
2917
+ <xsl:value-of select="normalize-space($mathml)"/>
2918
+ <xsl:for-each select="$mathml//@open"><xsl:value-of select="."/></xsl:for-each>
2919
+ <xsl:for-each select="$mathml//@close"><xsl:value-of select="."/></xsl:for-each>
2920
+ </xsl:variable>
2921
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2922
+ </xsl:if>
2923
+ </xsl:template><xsl:template name="calculate-column-widths-autolayout-algorithm">
2924
+ <xsl:param name="parent_table_page-width"/> <!-- for nested tables, in re-calculate step -->
2925
+
2926
+ <!-- via intermediate format -->
2927
+
2928
+ <!-- The algorithm uses two passes through the table data and scales linearly with the size of the table -->
2929
+
2930
+ <!-- In the first pass, line wrapping is disabled, and the user agent keeps track of the minimum and maximum width of each cell. -->
2931
+
2932
+ <!-- Since line wrap has been disabled, paragraphs are treated as long lines unless broken by BR elements. -->
2933
+
2934
+ <!-- get current table id -->
2935
+ <xsl:variable name="table_id" select="@id"/>
2936
+ <!-- find table by id in the file 'table_widths' -->
2937
+ <!-- <xsl:variable name="table-if_" select="$table_widths_from_if//table[@id = $table_id]"/>
2938
+ <xsl:variable name="table-if" select="xalan:nodeset($table-if_)"/> -->
2939
+
2940
+ <!-- table='<xsl:copy-of select="$table"/>' -->
2941
+ <!-- table_id='<xsl:value-of select="$table_id"/>\ -->
2942
+ <!-- table-if='<xsl:copy-of select="$table-if"/>' -->
2943
+ <!-- table_widths_from_if='<xsl:copy-of select="$table_widths_from_if"/>' -->
2944
+
2945
+ <xsl:variable name="table_with_cell_widths_">
2946
+ <xsl:apply-templates select="." mode="determine_cell_widths-if"/> <!-- read column's width from IF -->
2947
+ </xsl:variable>
2948
+ <xsl:variable name="table_with_cell_widths" select="xalan:nodeset($table_with_cell_widths_)"/>
2949
+
2950
+ <!-- <xsl:if test="$table_if_debug = 'true'">
2951
+ <xsl:copy-of select="$table_with_cell_widths"/>
2952
+ </xsl:if> -->
2953
+
2954
+
2955
+ <!-- The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. -->
2956
+
2957
+ <xsl:variable name="column_widths_">
2958
+ <!-- iteration of columns -->
2959
+ <xsl:for-each select="$table_with_cell_widths//tr[1]/td">
2960
+ <xsl:variable name="pos" select="position()"/>
2961
+ <column>
2962
+ <xsl:attribute name="width_max">
2963
+ <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_max">
2964
+ <xsl:sort select="." data-type="number" order="descending"/>
2965
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2966
+ </xsl:for-each>
2967
+ </xsl:attribute>
2968
+ <xsl:attribute name="width_min">
2969
+ <xsl:for-each select="ancestor::tbody//tr/td[$pos]/@width_min">
2970
+ <xsl:sort select="." data-type="number" order="descending"/>
2971
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
2972
+ </xsl:for-each>
2973
+ </xsl:attribute>
2974
+ </column>
2640
2975
  </xsl:for-each>
2641
2976
  </xsl:variable>
2977
+ <xsl:variable name="column_widths" select="xalan:nodeset($column_widths_)"/>
2978
+
2979
+ <!-- <column_widths>
2980
+ <xsl:copy-of select="$column_widths"/>
2981
+ </column_widths> -->
2982
+
2983
+ <!-- These in turn, are used to find the minimum and maximum width for the table. -->
2984
+ <xsl:variable name="table_widths_">
2985
+ <table>
2986
+ <xsl:attribute name="width_max">
2987
+ <xsl:value-of select="sum($column_widths/column/@width_max)"/>
2988
+ </xsl:attribute>
2989
+ <xsl:attribute name="width_min">
2990
+ <xsl:value-of select="sum($column_widths/column/@width_min)"/>
2991
+ </xsl:attribute>
2992
+ </table>
2993
+ </xsl:variable>
2994
+ <xsl:variable name="table_widths" select="xalan:nodeset($table_widths_)"/>
2642
2995
 
2643
- <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2644
- <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2996
+ <xsl:variable name="page_width">
2997
+ <xsl:choose>
2998
+ <xsl:when test="$parent_table_page-width != ''">
2999
+ <xsl:value-of select="$parent_table_page-width"/>
3000
+ </xsl:when>
3001
+ <xsl:otherwise>
3002
+ <xsl:value-of select="@page-width"/>
3003
+ </xsl:otherwise>
3004
+ </xsl:choose>
3005
+ </xsl:variable>
3006
+
3007
+ <xsl:if test="$table_if_debug = 'true'">
3008
+ <table_width>
3009
+ <xsl:copy-of select="$table_widths"/>
3010
+ </table_width>
3011
+ <debug>$page_width=<xsl:value-of select="$page_width"/></debug>
3012
+ </xsl:if>
3013
+
3014
+
3015
+ <!-- There are three cases: -->
3016
+ <xsl:choose>
3017
+ <!-- 1. The minimum table width is equal to or wider than the available space -->
3018
+ <xsl:when test="$table_widths/table/@width_min &gt;= $page_width and 1 = 2"> <!-- this condition isn't working see case 3 below -->
3019
+ <!-- call old algorithm -->
3020
+ <case1/>
3021
+ <!-- <xsl:variable name="cols-count" select="count(xalan:nodeset($table)/*/tr[1]/td)"/>
3022
+ <xsl:call-template name="calculate-column-widths-proportional">
3023
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3024
+ <xsl:with-param name="table" select="$table"/>
3025
+ </xsl:call-template> -->
3026
+ </xsl:when>
3027
+ <!-- 2. The maximum table width fits within the available space. In this case, set the columns to their maximum widths. -->
3028
+ <xsl:when test="$table_widths/table/@width_max &lt;= $page_width">
3029
+ <case2/>
3030
+ <autolayout/>
3031
+ <xsl:for-each select="$column_widths/column/@width_max">
3032
+ <column divider="100"><xsl:value-of select="."/></column>
3033
+ </xsl:for-each>
3034
+ </xsl:when>
3035
+ <!-- 3. The maximum width of the table is greater than the available space, but the minimum table width is smaller.
3036
+ In this case, find the difference between the available space and the minimum table width, lets call it W.
3037
+ Lets also call D the difference between maximum and minimum width of the table.
3038
+ For each column, let d be the difference between maximum and minimum width of that column.
3039
+ Now set the column's width to the minimum width plus d times W over D.
3040
+ This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
3041
+ <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)">
3042
+ <!-- difference between the available space and the minimum table width -->
3043
+ <xsl:variable name="W" select="$page_width - $table_widths/table/@width_min"/>
3044
+ <W><xsl:value-of select="$W"/></W>
3045
+ <!-- difference between maximum and minimum width of the table -->
3046
+ <xsl:variable name="D" select="$table_widths/table/@width_max - $table_widths/table/@width_min"/>
3047
+ <D><xsl:value-of select="$D"/></D>
3048
+ <case3/>
3049
+ <autolayout/>
3050
+ <xsl:if test="$table_widths/table/@width_min &gt;= $page_width">
3051
+ <split_keep-within-line>true</split_keep-within-line>
3052
+ </xsl:if>
3053
+ <xsl:for-each select="$column_widths/column">
3054
+ <!-- difference between maximum and minimum width of that column. -->
3055
+ <xsl:variable name="d" select="@width_max - @width_min"/>
3056
+ <d><xsl:value-of select="$d"/></d>
3057
+ <width_min><xsl:value-of select="@width_min"/></width_min>
3058
+ <e><xsl:value-of select="$d * $W div $D"/></e>
3059
+ <!-- set the column's width to the minimum width plus d times W over D. -->
3060
+ <column divider="100">
3061
+ <xsl:value-of select="round(@width_min + $d * $W div $D)"/> <!-- * 10 -->
3062
+ </column>
3063
+ </xsl:for-each>
3064
+
3065
+ </xsl:when>
3066
+ <xsl:otherwise><unknown_case/></xsl:otherwise>
3067
+ </xsl:choose>
3068
+
3069
+ </xsl:template><xsl:template name="get-calculated-column-widths-autolayout-algorithm">
3070
+
3071
+ <!-- if nested 'dl' or 'table' -->
3072
+ <xsl:variable name="parent_table_id" select="normalize-space(ancestor::*[local-name() = 'table' or local-name() = 'dl'][1]/@id)"/>
3073
+ <parent_table_id><xsl:value-of select="$parent_table_id"/></parent_table_id>
3074
+
3075
+ <parent_element><xsl:value-of select="local-name(..)"/></parent_element>
3076
+
3077
+ <xsl:variable name="parent_table_page-width_">
3078
+ <xsl:if test="$parent_table_id != ''">
3079
+ <!-- determine column number in the parent table -->
3080
+ <xsl:variable name="parent_table_column_number">
3081
+ <xsl:choose>
3082
+ <xsl:when test="parent::*[local-name() = 'dd']">2</xsl:when>
3083
+ <xsl:otherwise> <!-- parent is table -->
3084
+ <xsl:value-of select="count(ancestor::*[local-name() = 'td'][1]/preceding-sibling::*[local-name() = 'td']) + 1"/>
3085
+ </xsl:otherwise>
3086
+ </xsl:choose>
3087
+ </xsl:variable>
3088
+ <!-- find table by id in the file 'table_widths' and get all Nth `<column>...</column> -->
3089
+ <xsl:value-of select="$table_widths_from_if_calculated//table[@id = $parent_table_id]/column[number($parent_table_column_number)]"/>
3090
+ </xsl:if>
3091
+ </xsl:variable>
3092
+ <xsl:variable name="parent_table_page-width" select="normalize-space($parent_table_page-width_)"/>
3093
+
3094
+ <!-- get current table id -->
3095
+ <xsl:variable name="table_id" select="@id"/>
3096
+
3097
+ <xsl:choose>
3098
+ <xsl:when test="$parent_table_id = '' or $parent_table_page-width = ''">
3099
+ <!-- find table by id in the file 'table_widths' and get all `<column>...</column> -->
3100
+ <xsl:copy-of select="$table_widths_from_if_calculated//table[@id = $table_id]/node()"/>
3101
+ </xsl:when>
3102
+ <xsl:otherwise>
3103
+ <!-- recalculate columns width based on parent table width -->
3104
+ <xsl:for-each select="$table_widths_from_if//table[@id = $table_id]">
3105
+ <xsl:call-template name="calculate-column-widths-autolayout-algorithm">
3106
+ <xsl:with-param name="parent_table_page-width" select="$parent_table_page-width"/> <!-- padding-left = 2mm = 50000-->
3107
+ </xsl:call-template>
3108
+ </xsl:for-each>
3109
+ </xsl:otherwise>
3110
+ </xsl:choose>
3111
+
3112
+ </xsl:template><xsl:template match="@*|node()" mode="determine_cell_widths-if">
3113
+ <xsl:copy>
3114
+ <xsl:apply-templates select="@*|node()" mode="determine_cell_widths-if"/>
3115
+ </xsl:copy>
3116
+ </xsl:template><xsl:template match="td | th" mode="determine_cell_widths-if">
3117
+ <xsl:copy>
3118
+ <xsl:copy-of select="@*"/>
3119
+
3120
+ <!-- The maximum width is given by the widest line. -->
3121
+ <xsl:attribute name="width_max">
3122
+ <xsl:for-each select="p_len">
3123
+ <xsl:sort select="." data-type="number" order="descending"/>
3124
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3125
+ </xsl:for-each>
3126
+ </xsl:attribute>
3127
+
3128
+ <!-- The minimum width is given by the widest text element (word, image, etc.) -->
3129
+ <xsl:variable name="width_min">
3130
+ <xsl:for-each select="word_len">
3131
+ <xsl:sort select="." data-type="number" order="descending"/>
3132
+ <xsl:if test="position() = 1"><xsl:value-of select="."/></xsl:if>
3133
+ </xsl:for-each>
3134
+ </xsl:variable>
3135
+ <xsl:attribute name="width_min">
3136
+ <xsl:value-of select="$width_min"/>
3137
+ </xsl:attribute>
3138
+
3139
+ <xsl:if test="$width_min = 0">
3140
+ <xsl:attribute name="width_min">1</xsl:attribute>
3141
+ </xsl:if>
3142
+
3143
+ <xsl:apply-templates select="node()" mode="determine_cell_widths-if"/>
3144
+
3145
+ </xsl:copy>
2645
3146
  </xsl:template><xsl:template match="*[local-name()='thead']">
2646
3147
  <xsl:param name="cols-count"/>
2647
3148
  <fo:table-header>
@@ -2655,12 +3156,18 @@
2655
3156
  <fo:table-row>
2656
3157
  <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">
2657
3158
 
2658
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
2659
- <xsl:with-param name="continued">true</xsl:with-param>
2660
- </xsl:apply-templates>
2661
3159
 
2662
3160
 
2663
3161
 
3162
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
3163
+ <xsl:with-param name="continued">true</xsl:with-param>
3164
+ </xsl:apply-templates>
3165
+
3166
+
3167
+
3168
+
3169
+
3170
+
2664
3171
  </fo:table-cell>
2665
3172
  </fo:table-row>
2666
3173
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -2726,6 +3233,7 @@
2726
3233
  </xsl:for-each>
2727
3234
  </xsl:when>
2728
3235
  <xsl:otherwise>
3236
+ <!-- $colwidths=<xsl:copy-of select="$colwidths"/> -->
2729
3237
  <xsl:call-template name="insertTableColumnWidth">
2730
3238
  <xsl:with-param name="colwidths" select="$colwidths"/>
2731
3239
  </xsl:call-template>
@@ -2760,7 +3268,10 @@
2760
3268
 
2761
3269
 
2762
3270
  <!-- fn processing -->
2763
- <xsl:call-template name="table_fn_display"/>
3271
+
3272
+ <xsl:call-template name="table_fn_display"/>
3273
+
3274
+
2764
3275
 
2765
3276
  <!-- for PAS display Notes after footnotes -->
2766
3277
 
@@ -2770,6 +3281,9 @@
2770
3281
  </fo:table-body>
2771
3282
 
2772
3283
  </fo:table>
3284
+
3285
+
3286
+
2773
3287
  </xsl:if>
2774
3288
  </xsl:template><xsl:template match="*[local-name()='tbody']">
2775
3289
 
@@ -2805,6 +3319,52 @@
2805
3319
 
2806
3320
  </fo:table-body>
2807
3321
 
3322
+ </xsl:template><xsl:template match="/" mode="process_table-if">
3323
+ <xsl:param name="table_or_dl">table</xsl:param>
3324
+ <xsl:apply-templates mode="process_table-if">
3325
+ <xsl:with-param name="table_or_dl" select="$table_or_dl"/>
3326
+ </xsl:apply-templates>
3327
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="process_table-if">
3328
+ <xsl:param name="table_or_dl">table</xsl:param>
3329
+
3330
+ <fo:table-body>
3331
+ <xsl:for-each select="*[local-name() = 'tr']">
3332
+ <xsl:variable name="col_count" select="count(*)"/>
3333
+
3334
+ <!-- iteration for each tr/td -->
3335
+
3336
+ <xsl:choose>
3337
+ <xsl:when test="$table_or_dl = 'table'">
3338
+ <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']/*">
3339
+ <fo:table-row number-columns-spanned="{$col_count}">
3340
+ <!-- <test_table><xsl:copy-of select="."/></test_table> -->
3341
+ <xsl:call-template name="td"/>
3342
+ </fo:table-row>
3343
+ </xsl:for-each>
3344
+ </xsl:when>
3345
+ <xsl:otherwise> <!-- $table_or_dl = 'dl' -->
3346
+ <xsl:for-each select="*[local-name() = 'td' or local-name() = 'th']">
3347
+ <xsl:variable name="is_dt" select="position() = 1"/>
3348
+
3349
+ <xsl:for-each select="*">
3350
+ <!-- <test><xsl:copy-of select="."/></test> -->
3351
+ <fo:table-row number-columns-spanned="{$col_count}">
3352
+ <xsl:choose>
3353
+ <xsl:when test="$is_dt">
3354
+ <xsl:call-template name="insert_dt_cell"/>
3355
+ </xsl:when>
3356
+ <xsl:otherwise>
3357
+ <xsl:call-template name="insert_dd_cell"/>
3358
+ </xsl:otherwise>
3359
+ </xsl:choose>
3360
+ </fo:table-row>
3361
+ </xsl:for-each>
3362
+ </xsl:for-each>
3363
+ </xsl:otherwise>
3364
+ </xsl:choose>
3365
+
3366
+ </xsl:for-each>
3367
+ </fo:table-body>
2808
3368
  </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
2809
3369
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
2810
3370
 
@@ -2812,6 +3372,9 @@
2812
3372
 
2813
3373
 
2814
3374
 
3375
+
3376
+
3377
+
2815
3378
 
2816
3379
 
2817
3380
  <xsl:call-template name="setTableRowAttributes"/>
@@ -2831,6 +3394,8 @@
2831
3394
 
2832
3395
 
2833
3396
 
3397
+
3398
+
2834
3399
  <xsl:call-template name="setTableRowAttributes"/>
2835
3400
  <xsl:apply-templates/>
2836
3401
  </fo:table-row>
@@ -2891,7 +3456,7 @@
2891
3456
  </xsl:choose>
2892
3457
  </xsl:attribute>
2893
3458
  </xsl:if>
2894
- </xsl:template><xsl:template match="*[local-name()='td']">
3459
+ </xsl:template><xsl:template match="*[local-name()='td']" name="td">
2895
3460
  <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
2896
3461
  <xsl:call-template name="setTextAlignment">
2897
3462
  <xsl:with-param name="default">left</xsl:with-param>
@@ -2912,6 +3477,8 @@
2912
3477
 
2913
3478
 
2914
3479
 
3480
+
3481
+
2915
3482
 
2916
3483
 
2917
3484
 
@@ -2925,11 +3492,24 @@
2925
3492
 
2926
3493
  <xsl:call-template name="setTableCellAttributes"/>
2927
3494
 
3495
+ <xsl:if test="$isGenerateTableIF = 'true'">
3496
+ <xsl:attribute name="border">1pt solid black</xsl:attribute> <!-- border is mandatory, to determine page width -->
3497
+ <xsl:attribute name="text-align">left</xsl:attribute>
3498
+ </xsl:if>
3499
+
2928
3500
  <fo:block>
2929
3501
 
3502
+ <xsl:if test="$isGenerateTableIF = 'true'">
3503
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
3504
+ </xsl:if>
3505
+
3506
+
2930
3507
 
2931
3508
 
2932
3509
  <xsl:apply-templates/>
3510
+
3511
+ <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"/> -->
3512
+
2933
3513
  </fo:block>
2934
3514
  </fo:table-cell>
2935
3515
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2">
@@ -2970,7 +3550,11 @@
2970
3550
 
2971
3551
  <xsl:variable name="gen_id" select="generate-id(.)"/>
2972
3552
  <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
2973
- <xsl:variable name="reference" select="@reference"/>
3553
+ <xsl:variable name="reference_">
3554
+ <xsl:value-of select="@reference"/>
3555
+ <xsl:if test="normalize-space(@reference) = ''"><xsl:value-of select="$gen_id"/></xsl:if>
3556
+ </xsl:variable>
3557
+ <xsl:variable name="reference" select="normalize-space($reference_)"/>
2974
3558
  <!-- fn sequence number in document -->
2975
3559
  <xsl:variable name="current_fn_number">
2976
3560
  <xsl:choose>
@@ -3045,7 +3629,7 @@
3045
3629
  <xsl:copy-of select="node()"/>
3046
3630
  </fn>
3047
3631
  </xsl:for-each>
3048
- <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']/*">
3632
+ <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']/*">
3049
3633
  <xsl:sort select="@displayorder" data-type="number"/>
3050
3634
  <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])]">
3051
3635
  <!-- copy unique fn -->
@@ -3126,9 +3710,9 @@
3126
3710
  <!-- current hierarchy is 'figure' element -->
3127
3711
  <xsl:variable name="following_dl_colwidths">
3128
3712
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
3129
- <xsl:variable name="html-table">
3130
- <xsl:variable name="doc_ns">
3131
-
3713
+ <xsl:variable name="simple-table">
3714
+ <!-- <xsl:variable name="doc_ns">
3715
+ <xsl:if test="$namespace = 'bipm'">bipm</xsl:if>
3132
3716
  </xsl:variable>
3133
3717
  <xsl:variable name="ns">
3134
3718
  <xsl:choose>
@@ -3139,7 +3723,7 @@
3139
3723
  <xsl:value-of select="substring-before(name(/*), '-')"/>
3140
3724
  </xsl:otherwise>
3141
3725
  </xsl:choose>
3142
- </xsl:variable>
3726
+ </xsl:variable> -->
3143
3727
 
3144
3728
  <xsl:for-each select="*[local-name() = 'dl'][1]">
3145
3729
  <tbody>
@@ -3150,7 +3734,7 @@
3150
3734
 
3151
3735
  <xsl:call-template name="calculate-column-widths">
3152
3736
  <xsl:with-param name="cols-count" select="2"/>
3153
- <xsl:with-param name="table" select="$html-table"/>
3737
+ <xsl:with-param name="table" select="$simple-table"/>
3154
3738
  </xsl:call-template>
3155
3739
 
3156
3740
  </xsl:if>
@@ -3327,6 +3911,11 @@
3327
3911
 
3328
3912
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
3329
3913
 
3914
+
3915
+ <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
3916
+ <xsl:attribute name="margin-top">0</xsl:attribute>
3917
+ </xsl:if>
3918
+
3330
3919
  <fo:block>
3331
3920
 
3332
3921
 
@@ -3334,7 +3923,21 @@
3334
3923
  <xsl:attribute name="margin-left">-3.5mm</xsl:attribute>
3335
3924
 
3336
3925
 
3926
+ <xsl:apply-templates select="*[local-name() = 'name']">
3927
+ <xsl:with-param name="process">true</xsl:with-param>
3928
+ </xsl:apply-templates>
3929
+
3930
+ <xsl:if test="$isGenerateTableIF = 'true'">
3931
+ <!-- to determine start of table -->
3932
+ <fo:block id="{concat('table_if_start_',@id)}" keep-with-next="always" font-size="1pt">Start table '<xsl:value-of select="@id"/>'.</fo:block>
3933
+ </xsl:if>
3934
+
3337
3935
  <fo:table width="95%" table-layout="fixed">
3936
+
3937
+ <xsl:if test="$isGenerateTableIF = 'true'">
3938
+ <xsl:attribute name="wrap-option">no-wrap</xsl:attribute>
3939
+ </xsl:if>
3940
+
3338
3941
 
3339
3942
  <xsl:choose>
3340
3943
  <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
@@ -3343,69 +3946,173 @@
3343
3946
 
3344
3947
  </xsl:when>
3345
3948
  </xsl:choose>
3346
- <!-- create virtual html table for dl/[dt and dd] -->
3347
- <xsl:variable name="html-table">
3348
- <xsl:variable name="doc_ns">
3949
+
3950
+
3951
+
3952
+ <xsl:choose>
3953
+ <xsl:when test="$isGenerateTableIF = 'true'">
3954
+ <!-- generate IF for table widths -->
3955
+ <!-- example:
3956
+ <tr>
3957
+ <td valign="top" align="left" id="tab-symdu_1_1">
3958
+ <p>Symbol</p>
3959
+ <word id="tab-symdu_1_1_word_1">Symbol</word>
3960
+ </td>
3961
+ <td valign="top" align="left" id="tab-symdu_1_2">
3962
+ <p>Description</p>
3963
+ <word id="tab-symdu_1_2_word_1">Description</word>
3964
+ </td>
3965
+ </tr>
3966
+ -->
3349
3967
 
3350
- </xsl:variable>
3351
- <xsl:variable name="ns">
3352
- <xsl:choose>
3353
- <xsl:when test="normalize-space($doc_ns) != ''">
3354
- <xsl:value-of select="normalize-space($doc_ns)"/>
3355
- </xsl:when>
3356
- <xsl:otherwise>
3357
- <xsl:value-of select="substring-before(name(/*), '-')"/>
3358
- </xsl:otherwise>
3359
- </xsl:choose>
3360
- </xsl:variable>
3361
- <tbody>
3362
- <xsl:apply-templates mode="dl"/>
3363
- </tbody>
3364
- </xsl:variable>
3365
- <!-- DEBUG: html-table<xsl:copy-of select="$html-table"/> -->
3366
- <xsl:variable name="colwidths">
3367
- <xsl:call-template name="calculate-column-widths">
3368
- <xsl:with-param name="cols-count" select="2"/>
3369
- <xsl:with-param name="table" select="$html-table"/>
3370
- </xsl:call-template>
3371
- </xsl:variable>
3372
- <!-- DEBUG: colwidths=<xsl:copy-of select="$colwidths"/> -->
3373
- <xsl:variable name="maxlength_dt">
3374
- <xsl:call-template name="getMaxLength_dt"/>
3375
- </xsl:variable>
3376
- <xsl:variable name="isContainsKeepTogetherTag_">
3377
- false
3378
- </xsl:variable>
3379
- <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
3380
- <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
3381
- <xsl:call-template name="setColumnWidth_dl">
3382
- <xsl:with-param name="colwidths" select="$colwidths"/>
3383
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
3384
- <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
3385
- </xsl:call-template>
3968
+ <!-- create virtual html table for dl/[dt and dd] -->
3969
+ <xsl:variable name="simple-table">
3970
+
3971
+ <xsl:variable name="dl_table">
3972
+ <tbody>
3973
+ <xsl:apply-templates mode="dl_if">
3974
+ <xsl:with-param name="id" select="@id"/>
3975
+ </xsl:apply-templates>
3976
+ </tbody>
3977
+ </xsl:variable>
3978
+
3979
+ <!-- dl_table='<xsl:copy-of select="$dl_table"/>' -->
3980
+
3981
+ <!-- Step: replace <br/> to <p>...</p> -->
3982
+ <xsl:variable name="table_without_br">
3983
+ <xsl:apply-templates select="xalan:nodeset($dl_table)" mode="table-without-br"/>
3984
+ </xsl:variable>
3985
+
3986
+ <!-- table_without_br='<xsl:copy-of select="$table_without_br"/>' -->
3987
+
3988
+ <!-- Step: add id to each cell -->
3989
+ <!-- add <word>...</word> for each word, image, math -->
3990
+ <xsl:variable name="simple-table-id">
3991
+ <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-id">
3992
+ <xsl:with-param name="id" select="@id"/>
3993
+ </xsl:apply-templates>
3994
+ </xsl:variable>
3995
+
3996
+ <!-- simple-table-id='<xsl:copy-of select="$simple-table-id"/>' -->
3997
+
3998
+ <xsl:copy-of select="xalan:nodeset($simple-table-id)"/>
3999
+
4000
+ </xsl:variable>
4001
+
4002
+ <!-- DEBUG: simple-table<xsl:copy-of select="$simple-table"/> -->
4003
+
4004
+ <xsl:apply-templates select="xalan:nodeset($simple-table)" mode="process_table-if">
4005
+ <xsl:with-param name="table_or_dl">dl</xsl:with-param>
4006
+ </xsl:apply-templates>
4007
+
4008
+ </xsl:when>
4009
+ <xsl:otherwise>
3386
4010
 
3387
- <fo:table-body>
3388
- <xsl:apply-templates>
3389
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
3390
- </xsl:apply-templates>
3391
- </fo:table-body>
4011
+ <xsl:variable name="simple-table">
4012
+
4013
+ <xsl:variable name="dl_table">
4014
+ <tbody>
4015
+ <xsl:apply-templates mode="dl">
4016
+ <xsl:with-param name="id" select="@id"/>
4017
+ </xsl:apply-templates>
4018
+ </tbody>
4019
+ </xsl:variable>
4020
+
4021
+ <xsl:copy-of select="$dl_table"/>
4022
+ </xsl:variable>
4023
+
4024
+ <xsl:variable name="colwidths">
4025
+ <xsl:call-template name="calculate-column-widths">
4026
+ <xsl:with-param name="cols-count" select="2"/>
4027
+ <xsl:with-param name="table" select="$simple-table"/>
4028
+ </xsl:call-template>
4029
+ </xsl:variable>
4030
+
4031
+ <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
4032
+ DEBUG
4033
+ colwidths=<xsl:copy-of select="$colwidths"/>
4034
+ <xsl:text disable-output-escaping="yes">- -&gt;</xsl:text> -->
4035
+
4036
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
4037
+
4038
+ <xsl:variable name="maxlength_dt">
4039
+ <xsl:call-template name="getMaxLength_dt"/>
4040
+ </xsl:variable>
4041
+
4042
+ <xsl:variable name="isContainsKeepTogetherTag_">
4043
+ false
4044
+ </xsl:variable>
4045
+ <xsl:variable name="isContainsKeepTogetherTag" select="normalize-space($isContainsKeepTogetherTag_)"/>
4046
+ <!-- isContainsExpressReference=<xsl:value-of select="$isContainsExpressReference"/> -->
4047
+
4048
+
4049
+ <xsl:call-template name="setColumnWidth_dl">
4050
+ <xsl:with-param name="colwidths" select="$colwidths"/>
4051
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
4052
+ <xsl:with-param name="isContainsKeepTogetherTag" select="$isContainsKeepTogetherTag"/>
4053
+ </xsl:call-template>
4054
+
4055
+ <fo:table-body>
4056
+
4057
+ <!-- DEBUG -->
4058
+ <xsl:if test="$table_if_debug = 'true'">
4059
+ <fo:table-row>
4060
+ <fo:table-cell number-columns-spanned="2" font-size="60%">
4061
+ <xsl:apply-templates select="xalan:nodeset($colwidths)" mode="print_as_xml"/>
4062
+ </fo:table-cell>
4063
+ </fo:table-row>
4064
+ </xsl:if>
4065
+
4066
+ <xsl:apply-templates>
4067
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
4068
+ <xsl:with-param name="split_keep-within-line" select="xalan:nodeset($colwidths)/split_keep-within-line"/>
4069
+ </xsl:apply-templates>
4070
+
4071
+ </fo:table-body>
4072
+ </xsl:otherwise>
4073
+ </xsl:choose>
3392
4074
  </fo:table>
3393
4075
  </fo:block>
3394
4076
  </fo:block>
3395
4077
  </xsl:if> <!-- END: a few components -->
3396
4078
  </fo:block-container>
3397
4079
  </fo:block-container>
4080
+
4081
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- process nested 'dl' -->
4082
+ <xsl:apply-templates select="*[local-name() = 'dd']/*[local-name() = 'dl']"/>
4083
+ </xsl:if>
4084
+
4085
+ </xsl:template><xsl:template match="*[local-name() = 'dl']/*[local-name() = 'name']">
4086
+ <xsl:param name="process">false</xsl:param>
4087
+ <xsl:if test="$process = 'true'">
4088
+ <fo:block xsl:use-attribute-sets="dl-name-style">
4089
+ <xsl:apply-templates/>
4090
+ </fo:block>
4091
+ </xsl:if>
3398
4092
  </xsl:template><xsl:template name="setColumnWidth_dl">
3399
4093
  <xsl:param name="colwidths"/>
3400
4094
  <xsl:param name="maxlength_dt"/>
3401
4095
  <xsl:param name="isContainsKeepTogetherTag"/>
4096
+
4097
+ <!-- <colwidths><xsl:copy-of select="$colwidths"/></colwidths> -->
4098
+
3402
4099
  <xsl:choose>
4100
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
4101
+ <xsl:call-template name="insertTableColumnWidth">
4102
+ <xsl:with-param name="colwidths" select="$colwidths"/>
4103
+ </xsl:call-template>
4104
+ </xsl:when>
3403
4105
  <xsl:when test="ancestor::*[local-name()='dl']"><!-- second level, i.e. inlined table -->
3404
4106
  <fo:table-column column-width="50%"/>
3405
4107
  <fo:table-column column-width="50%"/>
3406
4108
  </xsl:when>
3407
4109
  <xsl:otherwise>
3408
4110
  <xsl:choose>
4111
+ <xsl:when test="xalan:nodeset($colwidths)/autolayout">
4112
+ <xsl:call-template name="insertTableColumnWidth">
4113
+ <xsl:with-param name="colwidths" select="$colwidths"/>
4114
+ </xsl:call-template>
4115
+ </xsl:when>
3409
4116
  <xsl:when test="$isContainsKeepTogetherTag">
3410
4117
  <xsl:call-template name="insertTableColumnWidth">
3411
4118
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -3450,13 +4157,19 @@
3450
4157
  </xsl:choose>
3451
4158
  </xsl:template><xsl:template name="insertTableColumnWidth">
3452
4159
  <xsl:param name="colwidths"/>
4160
+
3453
4161
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
3454
4162
  <xsl:choose>
3455
4163
  <xsl:when test=". = 1 or . = 0">
3456
4164
  <fo:table-column column-width="proportional-column-width(2)"/>
3457
4165
  </xsl:when>
3458
4166
  <xsl:otherwise>
3459
- <fo:table-column column-width="proportional-column-width({.})"/>
4167
+ <!-- <fo:table-column column-width="proportional-column-width({.})"/> -->
4168
+ <xsl:variable name="divider">
4169
+ <xsl:value-of select="@divider"/>
4170
+ <xsl:if test="not(@divider)">1</xsl:if>
4171
+ </xsl:variable>
4172
+ <fo:table-column column-width="proportional-column-width({round(. div $divider)})"/>
3460
4173
  </xsl:otherwise>
3461
4174
  </xsl:choose>
3462
4175
  </xsl:for-each>
@@ -3518,11 +4231,19 @@
3518
4231
  </fo:table-cell>
3519
4232
  </fo:table-row>
3520
4233
  </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl">
4234
+ <xsl:param name="id"/>
4235
+ <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
3521
4236
  <tr>
3522
4237
  <td>
4238
+ <xsl:attribute name="id">
4239
+ <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4240
+ </xsl:attribute>
3523
4241
  <xsl:apply-templates/>
3524
4242
  </td>
3525
4243
  <td>
4244
+ <xsl:attribute name="id">
4245
+ <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4246
+ </xsl:attribute>
3526
4247
 
3527
4248
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3528
4249
  <xsl:with-param name="process">true</xsl:with-param>
@@ -3533,50 +4254,134 @@
3533
4254
 
3534
4255
  </xsl:template><xsl:template match="*[local-name()='dt']">
3535
4256
  <xsl:param name="key_iso"/>
4257
+ <xsl:param name="split_keep-within-line"/>
3536
4258
 
3537
4259
  <fo:table-row xsl:use-attribute-sets="dt-row-style">
3538
- <fo:table-cell>
4260
+ <xsl:call-template name="insert_dt_cell">
4261
+ <xsl:with-param name="key_iso" select="$key_iso"/>
4262
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4263
+ </xsl:call-template>
4264
+ <xsl:for-each select="following-sibling::*[local-name()='dd'][1]">
4265
+ <xsl:call-template name="insert_dd_cell">
4266
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4267
+ </xsl:call-template>
4268
+ </xsl:for-each>
4269
+ </fo:table-row>
4270
+ </xsl:template><xsl:template name="insert_dt_cell">
4271
+ <xsl:param name="key_iso"/>
4272
+ <xsl:param name="split_keep-within-line"/>
4273
+ <fo:table-cell xsl:use-attribute-sets="dt-cell-style">
4274
+
4275
+ <xsl:if test="$isGenerateTableIF = 'true'">
4276
+ <!-- border is mandatory, to calculate real width -->
4277
+ <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4278
+ <xsl:attribute name="text-align">left</xsl:attribute>
4279
+ </xsl:if>
4280
+
4281
+
4282
+ <fo:block xsl:use-attribute-sets="dt-block-style">
4283
+ <xsl:copy-of select="@id"/>
4284
+
4285
+ <xsl:if test="normalize-space($key_iso) = 'true'">
4286
+ <xsl:attribute name="margin-top">0</xsl:attribute>
4287
+ </xsl:if>
4288
+
4289
+
4290
+
4291
+ <xsl:apply-templates>
4292
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4293
+ </xsl:apply-templates>
4294
+
4295
+ <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"/> -->
4296
+
4297
+ </fo:block>
4298
+ </fo:table-cell>
4299
+ </xsl:template><xsl:template name="insert_dd_cell">
4300
+ <xsl:param name="split_keep-within-line"/>
4301
+ <fo:table-cell xsl:use-attribute-sets="dd-cell-style">
4302
+
4303
+ <xsl:if test="$isGenerateTableIF = 'true'">
4304
+ <!-- border is mandatory, to calculate real width -->
4305
+ <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4306
+ </xsl:if>
4307
+
4308
+ <fo:block>
4309
+
4310
+ <xsl:if test="$isGenerateTableIF = 'true'">
4311
+ <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
4312
+ </xsl:if>
4313
+
3539
4314
 
3540
- <fo:block xsl:use-attribute-sets="dt-style">
3541
- <xsl:copy-of select="@id"/>
3542
-
3543
- <xsl:if test="normalize-space($key_iso) = 'true'">
3544
- <xsl:attribute name="margin-top">0</xsl:attribute>
3545
- </xsl:if>
3546
-
3547
-
3548
-
3549
- <xsl:apply-templates/>
3550
- </fo:block>
3551
- </fo:table-cell>
3552
- <fo:table-cell>
3553
- <fo:block>
3554
-
3555
4315
 
3556
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
3557
- <xsl:with-param name="process">true</xsl:with-param>
3558
- </xsl:apply-templates>
3559
- </fo:block>
3560
- </fo:table-cell>
3561
- </fo:table-row>
4316
+ <xsl:choose>
4317
+ <xsl:when test="$isGenerateTableIF = 'true'">
4318
+ <xsl:apply-templates> <!-- following-sibling::*[local-name()='dd'][1] -->
4319
+ <xsl:with-param name="process">true</xsl:with-param>
4320
+ </xsl:apply-templates>
4321
+ </xsl:when>
4322
+ <xsl:otherwise>
4323
+ <xsl:apply-templates select="."> <!-- following-sibling::*[local-name()='dd'][1] -->
4324
+ <xsl:with-param name="process">true</xsl:with-param>
4325
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4326
+ </xsl:apply-templates>
4327
+ </xsl:otherwise>
4328
+
4329
+ </xsl:choose>
4330
+
4331
+ <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"/> -->
4332
+
4333
+ </fo:block>
4334
+ </fo:table-cell>
3562
4335
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
3563
4336
  <xsl:apply-templates/>
3564
4337
  </xsl:template><xsl:template match="*[local-name()='dd']">
3565
4338
  <xsl:param name="process">false</xsl:param>
4339
+ <xsl:param name="split_keep-within-line"/>
3566
4340
  <xsl:if test="$process = 'true'">
3567
4341
  <xsl:apply-templates select="@language"/>
3568
- <xsl:apply-templates/>
4342
+ <xsl:apply-templates>
4343
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4344
+ </xsl:apply-templates>
3569
4345
  </xsl:if>
3570
4346
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
3571
4347
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
3572
- </xsl:template><xsl:template match="*[local-name()='em']">
4348
+ </xsl:template><xsl:template match="*[local-name()='dt']" mode="dl_if">
4349
+ <xsl:param name="id"/>
4350
+ <xsl:variable name="row_number" select="count(preceding-sibling::*[local-name()='dt']) + 1"/>
4351
+ <tr>
4352
+ <td>
4353
+ <xsl:copy-of select="node()"/>
4354
+ </td>
4355
+ <td>
4356
+
4357
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/node()[not(local-name() = 'dl')]"/>
4358
+
4359
+ <!-- get paragraphs from nested 'dl' -->
4360
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'dl']" mode="dl_if_nested"/>
4361
+
4362
+
4363
+ </td>
4364
+ </tr>
4365
+
4366
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if"/><xsl:template match="*[local-name()='dl']" mode="dl_if_nested">
4367
+ <xsl:for-each select="*[local-name() = 'dt']">
4368
+ <p>
4369
+ <xsl:copy-of select="node()"/>
4370
+ <xsl:text> </xsl:text>
4371
+ <xsl:copy-of select="following-sibling::*[local-name()='dd'][1]/*[local-name() = 'p']/node()"/>
4372
+ </p>
4373
+ </xsl:for-each>
4374
+ </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/><xsl:template match="*[local-name()='em']">
3573
4375
  <fo:inline font-style="italic">
3574
4376
  <xsl:apply-templates/>
3575
4377
  </fo:inline>
3576
4378
  </xsl:template><xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
4379
+ <xsl:param name="split_keep-within-line"/>
3577
4380
  <fo:inline font-weight="bold">
3578
4381
 
3579
- <xsl:apply-templates/>
4382
+ <xsl:apply-templates>
4383
+ <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4384
+ </xsl:apply-templates>
3580
4385
  </fo:inline>
3581
4386
  </xsl:template><xsl:template match="*[local-name()='padding']">
3582
4387
  <fo:inline padding-right="{@value}"> </fo:inline>
@@ -3597,7 +4402,7 @@
3597
4402
 
3598
4403
 
3599
4404
  10
3600
-
4405
+ <!-- 10 -->
3601
4406
 
3602
4407
 
3603
4408
 
@@ -3777,6 +4582,10 @@
3777
4582
  <xsl:param name="text"/>
3778
4583
  <xsl:param name="separator" select="' '"/>
3779
4584
  <xsl:choose>
4585
+
4586
+ <xsl:when test="$isGenerateTableIF = 'true' and not(contains($text, $separator))">
4587
+ <word><xsl:value-of select="normalize-space($text)"/></word>
4588
+ </xsl:when>
3780
4589
  <xsl:when test="not(contains($text, $separator))">
3781
4590
  <word>
3782
4591
  <xsl:variable name="len_str_tmp" select="string-length(normalize-space($text))"/>
@@ -3821,13 +4630,66 @@
3821
4630
  </xsl:when>
3822
4631
  <xsl:otherwise>
3823
4632
  <word>
3824
- <xsl:value-of select="string-length(normalize-space(substring-before($text, $separator)))"/>
4633
+ <xsl:variable name="word" select="normalize-space(substring-before($text, $separator))"/>
4634
+ <xsl:choose>
4635
+ <xsl:when test="$isGenerateTableIF = 'true'">
4636
+ <xsl:value-of select="$word"/>
4637
+ </xsl:when>
4638
+ <xsl:otherwise>
4639
+ <xsl:value-of select="string-length($word)"/>
4640
+ </xsl:otherwise>
4641
+ </xsl:choose>
3825
4642
  </word>
3826
4643
  <xsl:call-template name="tokenize">
3827
4644
  <xsl:with-param name="text" select="substring-after($text, $separator)"/>
3828
4645
  </xsl:call-template>
3829
4646
  </xsl:otherwise>
3830
4647
  </xsl:choose>
4648
+ </xsl:template><xsl:template name="tokenize_with_tags">
4649
+ <xsl:param name="tags"/>
4650
+ <xsl:param name="text"/>
4651
+ <xsl:param name="separator" select="' '"/>
4652
+ <xsl:choose>
4653
+
4654
+ <xsl:when test="not(contains($text, $separator))">
4655
+ <word>
4656
+ <xsl:call-template name="enclose_text_in_tags">
4657
+ <xsl:with-param name="text" select="normalize-space($text)"/>
4658
+ <xsl:with-param name="tags" select="$tags"/>
4659
+ </xsl:call-template>
4660
+ </word>
4661
+ </xsl:when>
4662
+ <xsl:otherwise>
4663
+ <word>
4664
+ <xsl:call-template name="enclose_text_in_tags">
4665
+ <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
4666
+ <xsl:with-param name="tags" select="$tags"/>
4667
+ </xsl:call-template>
4668
+ </word>
4669
+ <xsl:call-template name="tokenize_with_tags">
4670
+ <xsl:with-param name="text" select="substring-after($text, $separator)"/>
4671
+ </xsl:call-template>
4672
+ </xsl:otherwise>
4673
+ </xsl:choose>
4674
+ </xsl:template><xsl:template name="enclose_text_in_tags">
4675
+ <xsl:param name="text"/>
4676
+ <xsl:param name="tags"/>
4677
+ <xsl:param name="num">1</xsl:param> <!-- default (start) value -->
4678
+
4679
+ <xsl:variable name="tag_name" select="normalize-space(xalan:nodeset($tags)//tag[$num])"/>
4680
+
4681
+ <xsl:choose>
4682
+ <xsl:when test="$tag_name = ''"><xsl:value-of select="$text"/></xsl:when>
4683
+ <xsl:otherwise>
4684
+ <xsl:element name="{$tag_name}">
4685
+ <xsl:call-template name="enclose_text_in_tags">
4686
+ <xsl:with-param name="text" select="$text"/>
4687
+ <xsl:with-param name="tags" select="$tags"/>
4688
+ <xsl:with-param name="num" select="$num + 1"/>
4689
+ </xsl:call-template>
4690
+ </xsl:element>
4691
+ </xsl:otherwise>
4692
+ </xsl:choose>
3831
4693
  </xsl:template><xsl:template name="max_length">
3832
4694
  <xsl:param name="words"/>
3833
4695
  <xsl:for-each select="$words//word">
@@ -3928,12 +4790,19 @@
3928
4790
  </xsl:otherwise>
3929
4791
  </xsl:choose>
3930
4792
  </xsl:template><xsl:template name="getSimpleTable">
4793
+ <xsl:param name="id"/>
4794
+
3931
4795
  <xsl:variable name="simple-table">
3932
4796
 
4797
+ <!-- Step 0. replace <br/> to <p>...</p> -->
4798
+ <xsl:variable name="table_without_br">
4799
+ <xsl:apply-templates mode="table-without-br"/>
4800
+ </xsl:variable>
4801
+
3933
4802
  <!-- Step 1. colspan processing -->
3934
4803
  <xsl:variable name="simple-table-colspan">
3935
4804
  <tbody>
3936
- <xsl:apply-templates mode="simple-table-colspan"/>
4805
+ <xsl:apply-templates select="xalan:nodeset($table_without_br)" mode="simple-table-colspan"/>
3937
4806
  </tbody>
3938
4807
  </xsl:variable>
3939
4808
 
@@ -3942,10 +4811,67 @@
3942
4811
  <xsl:apply-templates select="xalan:nodeset($simple-table-colspan)" mode="simple-table-rowspan"/>
3943
4812
  </xsl:variable>
3944
4813
 
3945
- <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
3946
-
4814
+ <!-- Step 3: add id to each cell -->
4815
+ <!-- add <word>...</word> for each word, image, math -->
4816
+ <xsl:variable name="simple-table-id">
4817
+ <xsl:apply-templates select="xalan:nodeset($simple-table-rowspan)" mode="simple-table-id">
4818
+ <xsl:with-param name="id" select="$id"/>
4819
+ </xsl:apply-templates>
4820
+ </xsl:variable>
4821
+
4822
+ <xsl:copy-of select="xalan:nodeset($simple-table-id)"/>
4823
+
3947
4824
  </xsl:variable>
3948
4825
  <xsl:copy-of select="$simple-table"/>
4826
+ </xsl:template><xsl:template match="@*|node()" mode="table-without-br">
4827
+ <xsl:copy>
4828
+ <xsl:apply-templates select="@*|node()" mode="table-without-br"/>
4829
+ </xsl:copy>
4830
+ </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">
4831
+ <xsl:copy>
4832
+ <xsl:copy-of select="@*"/>
4833
+ <p>
4834
+ <xsl:copy-of select="node()"/>
4835
+ </p>
4836
+ </xsl:copy>
4837
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td'][*[local-name()='br']]" mode="table-without-br">
4838
+ <xsl:copy>
4839
+ <xsl:copy-of select="@*"/>
4840
+ <xsl:for-each select="*[local-name()='br']">
4841
+ <xsl:variable name="current_id" select="generate-id()"/>
4842
+ <p>
4843
+ <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]">
4844
+ <xsl:copy-of select="."/>
4845
+ </xsl:for-each>
4846
+ </p>
4847
+ <xsl:if test="not(following-sibling::*[local-name() = 'br'])">
4848
+ <p>
4849
+ <xsl:for-each select="following-sibling::node()">
4850
+ <xsl:copy-of select="."/>
4851
+ </xsl:for-each>
4852
+ </p>
4853
+ </xsl:if>
4854
+ </xsl:for-each>
4855
+ </xsl:copy>
4856
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']/*[local-name() = 'p'][*[local-name()='br']]" mode="table-without-br">
4857
+ <xsl:for-each select="*[local-name()='br']">
4858
+ <xsl:variable name="current_id" select="generate-id()"/>
4859
+ <p>
4860
+ <xsl:for-each select="preceding-sibling::node()[following-sibling::*[local-name() = 'br'][1][generate-id() = $current_id]][not(local-name() = 'br')]">
4861
+ <xsl:copy-of select="."/>
4862
+ </xsl:for-each>
4863
+ </p>
4864
+ <xsl:if test="not(following-sibling::*[local-name() = 'br'])">
4865
+ <p>
4866
+ <xsl:for-each select="following-sibling::node()">
4867
+ <xsl:copy-of select="."/>
4868
+ </xsl:for-each>
4869
+ </p>
4870
+ </xsl:if>
4871
+ </xsl:for-each>
4872
+ </xsl:template><xsl:template match="text()[not(ancestor::*[local-name() = 'sourcecode'])]" mode="table-without-br">
4873
+ <xsl:variable name="text" select="translate(.,'&#9;&#10;&#13;','')"/>
4874
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
3949
4875
  </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
3950
4876
  <xsl:apply-templates mode="simple-table-colspan"/>
3951
4877
  </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">
@@ -4035,6 +4961,126 @@
4035
4961
  <xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
4036
4962
  <xsl:with-param name="previousRow" select="$newRow"/>
4037
4963
  </xsl:apply-templates>
4964
+ </xsl:template><xsl:template match="/" mode="simple-table-id">
4965
+ <xsl:param name="id"/>
4966
+ <xsl:variable name="id_prefixed" select="concat('table_if_',$id)"/> <!-- table id prefixed by 'table_if_' to simple search in IF -->
4967
+ <xsl:apply-templates select="@*|node()" mode="simple-table-id">
4968
+ <xsl:with-param name="id" select="$id_prefixed"/>
4969
+ </xsl:apply-templates>
4970
+ </xsl:template><xsl:template match="@*|node()" mode="simple-table-id">
4971
+ <xsl:param name="id"/>
4972
+ <xsl:copy>
4973
+ <xsl:apply-templates select="@*|node()" mode="simple-table-id">
4974
+ <xsl:with-param name="id" select="$id"/>
4975
+ </xsl:apply-templates>
4976
+ </xsl:copy>
4977
+ </xsl:template><xsl:template match="*[local-name()='tbody']" mode="simple-table-id">
4978
+ <xsl:param name="id"/>
4979
+ <xsl:copy>
4980
+ <xsl:copy-of select="@*"/>
4981
+ <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
4982
+ <xsl:apply-templates select="node()" mode="simple-table-id">
4983
+ <xsl:with-param name="id" select="$id"/>
4984
+ </xsl:apply-templates>
4985
+ </xsl:copy>
4986
+ </xsl:template><xsl:template match="*[local-name()='th' or local-name()='td']" mode="simple-table-id">
4987
+ <xsl:param name="id"/>
4988
+ <xsl:copy>
4989
+ <xsl:copy-of select="@*"/>
4990
+ <xsl:variable name="row_number" select="count(../preceding-sibling::*) + 1"/>
4991
+ <xsl:variable name="col_number" select="count(preceding-sibling::*) + 1"/>
4992
+ <xsl:attribute name="id">
4993
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number)"/>
4994
+ </xsl:attribute>
4995
+
4996
+ <xsl:for-each select="*[local-name() = 'p']">
4997
+ <xsl:copy>
4998
+ <xsl:copy-of select="@*"/>
4999
+ <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5000
+ <xsl:attribute name="id">
5001
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num)"/>
5002
+ </xsl:attribute>
5003
+
5004
+ <xsl:copy-of select="node()"/>
5005
+ </xsl:copy>
5006
+ </xsl:for-each>
5007
+
5008
+
5009
+ <xsl:if test="$isGenerateTableIF = 'true'"> <!-- split each paragraph to words, image, math -->
5010
+
5011
+ <xsl:variable name="td_text">
5012
+ <xsl:apply-templates select="." mode="td_text_with_formatting"/>
5013
+ </xsl:variable>
5014
+
5015
+ <!-- td_text='<xsl:copy-of select="$td_text"/>' -->
5016
+
5017
+ <xsl:variable name="words">
5018
+ <xsl:for-each select=".//*[local-name() = 'image' or local-name() = 'stem']">
5019
+ <word>
5020
+ <xsl:copy-of select="."/>
5021
+ </word>
5022
+ </xsl:for-each>
5023
+
5024
+ <xsl:for-each select="xalan:nodeset($td_text)//*[local-name() = 'word'][normalize-space() != '']">
5025
+ <xsl:copy-of select="."/>
5026
+ </xsl:for-each>
5027
+
5028
+ </xsl:variable>
5029
+
5030
+ <xsl:for-each select="xalan:nodeset($words)/word">
5031
+ <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5032
+ <xsl:copy>
5033
+ <xsl:attribute name="id">
5034
+ <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num)"/>
5035
+ </xsl:attribute>
5036
+ <xsl:copy-of select="node()"/>
5037
+ </xsl:copy>
5038
+ </xsl:for-each>
5039
+ </xsl:if>
5040
+ </xsl:copy>
5041
+
5042
+ </xsl:template><xsl:template match="@*|node()" mode="td_text_with_formatting">
5043
+ <xsl:copy>
5044
+ <xsl:apply-templates select="@*|node()" mode="td_text_with_formatting"/>
5045
+ </xsl:copy>
5046
+ </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">
5047
+ <xsl:variable name="formatting_tags">
5048
+ <xsl:call-template name="getFormattingTags"/>
5049
+ </xsl:variable>
5050
+ <word>
5051
+ <xsl:call-template name="enclose_text_in_tags">
5052
+ <xsl:with-param name="text" select="normalize-space(.)"/>
5053
+ <xsl:with-param name="tags" select="$formatting_tags"/>
5054
+ </xsl:call-template>
5055
+ </word>
5056
+ </xsl:template><xsl:template match="*[local-name() != 'keep-together_within-line']/text()" mode="td_text_with_formatting">
5057
+
5058
+ <xsl:variable name="td_text" select="."/>
5059
+
5060
+ <xsl:variable name="string_with_added_zerospaces">
5061
+ <xsl:call-template name="add-zero-spaces-java">
5062
+ <xsl:with-param name="text" select="$td_text"/>
5063
+ </xsl:call-template>
5064
+ </xsl:variable>
5065
+
5066
+ <xsl:variable name="formatting_tags">
5067
+ <xsl:call-template name="getFormattingTags"/>
5068
+ </xsl:variable>
5069
+
5070
+ <!-- <word>text</word> -->
5071
+ <xsl:call-template name="tokenize_with_tags">
5072
+ <xsl:with-param name="tags" select="$formatting_tags"/>
5073
+ <xsl:with-param name="text" select="normalize-space(translate($string_with_added_zerospaces, '​­', ' '))"/> <!-- replace zero-width-space and soft-hyphen to space -->
5074
+ </xsl:call-template>
5075
+ </xsl:template><xsl:template name="getFormattingTags">
5076
+ <tags>
5077
+ <xsl:if test="ancestor::*[local-name() = 'strong']"><tag>strong</tag></xsl:if>
5078
+ <xsl:if test="ancestor::*[local-name() = 'em']"><tag>em</tag></xsl:if>
5079
+ <xsl:if test="ancestor::*[local-name() = 'sub']"><tag>sub</tag></xsl:if>
5080
+ <xsl:if test="ancestor::*[local-name() = 'sup']"><tag>sup</tag></xsl:if>
5081
+ <xsl:if test="ancestor::*[local-name() = 'tt']"><tag>tt</tag></xsl:if>
5082
+ <xsl:if test="ancestor::*[local-name() = 'keep-together_within-line']"><tag>keep-together_within-line</tag></xsl:if>
5083
+ </tags>
4038
5084
  </xsl:template><xsl:template name="getLang">
4039
5085
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4040
5086
  <xsl:variable name="language">
@@ -4228,6 +5274,11 @@
4228
5274
  </xsl:variable>
4229
5275
  <fo:inline xsl:use-attribute-sets="link-style">
4230
5276
 
5277
+ <xsl:if test="starts-with(normalize-space(@target), 'mailto:')">
5278
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5279
+ </xsl:if>
5280
+
5281
+
4231
5282
 
4232
5283
 
4233
5284
 
@@ -4492,7 +5543,19 @@
4492
5543
  <xsl:value-of select="$suffix"/>
4493
5544
  </xsl:if>
4494
5545
  </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
4495
- <fo:inline><xsl:apply-templates/></fo:inline>
5546
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
5547
+ <xsl:choose>
5548
+ <xsl:when test="$num = 1"> <!-- first paragraph renders in the same line as titlenote name -->
5549
+ <fo:inline xsl:use-attribute-sets="termnote-p-style">
5550
+ <xsl:apply-templates/>
5551
+ </fo:inline>
5552
+ </xsl:when>
5553
+ <xsl:otherwise>
5554
+ <fo:block xsl:use-attribute-sets="termnote-p-style">
5555
+ <xsl:apply-templates/>
5556
+ </fo:block>
5557
+ </xsl:otherwise>
5558
+ </xsl:choose>
4496
5559
  </xsl:template><xsl:template match="*[local-name() = 'terms']">
4497
5560
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
4498
5561
  <fo:block id="{@id}">
@@ -5309,7 +6372,7 @@
5309
6372
  </xsl:choose>
5310
6373
  </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">
5311
6374
  <xsl:value-of select="."/>
5312
- </xsl:template><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
6375
+ </xsl:template><xsl:template match="*[local-name() = 'review']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
5313
6376
  <xsl:text> </xsl:text>
5314
6377
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
5315
6378
  <xsl:copy>
@@ -5380,7 +6443,7 @@
5380
6443
 
5381
6444
 
5382
6445
  10
5383
-
6446
+ <!-- 9 -->
5384
6447
 
5385
6448
 
5386
6449
 
@@ -5464,7 +6527,7 @@
5464
6527
  <xsl:for-each select="xalan:nodeset($text_step4)/node()">
5465
6528
  <xsl:choose>
5466
6529
  <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5467
- <xsl:call-template name="interspers">
6530
+ <xsl:call-template name="interspers-java">
5468
6531
  <xsl:with-param name="str" select="."/>
5469
6532
  </xsl:call-template>
5470
6533
  </xsl:when>
@@ -5514,6 +6577,10 @@
5514
6577
  <xsl:with-param name="char" select="$char"/>
5515
6578
  </xsl:call-template>
5516
6579
  </xsl:if>
6580
+ </xsl:template><xsl:template name="interspers-java">
6581
+ <xsl:param name="str"/>
6582
+ <xsl:param name="char" select="$zero_width_space"/>
6583
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($str),'([^ -.:=_—])',concat('$1', $char))"/> <!-- insert $char after each char excep space, - . : = _ etc. -->
5517
6584
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
5518
6585
  <xsl:apply-templates mode="syntax_highlight"/>
5519
6586
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -5726,7 +6793,9 @@
5726
6793
  <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
5727
6794
  </xsl:if>
5728
6795
  <xsl:variable name="simple-table">
5729
- <xsl:call-template name="getSimpleTable"/>
6796
+ <xsl:call-template name="getSimpleTable">
6797
+ <xsl:with-param name="id" select="@id"/>
6798
+ </xsl:call-template>
5730
6799
  </xsl:variable>
5731
6800
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
5732
6801
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
@@ -6162,6 +7231,7 @@
6162
7231
 
6163
7232
 
6164
7233
 
7234
+
6165
7235
  </xsl:variable>
6166
7236
 
6167
7237
  <xsl:variable name="padding-right">
@@ -6459,6 +7529,11 @@
6459
7529
  </xsl:otherwise>
6460
7530
  </xsl:choose>
6461
7531
  </xsl:template><xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
7532
+
7533
+ <xsl:apply-templates select="*[local-name() = 'name']">
7534
+ <xsl:with-param name="process">true</xsl:with-param>
7535
+ </xsl:apply-templates>
7536
+
6462
7537
  <fo:list-block xsl:use-attribute-sets="list-style">
6463
7538
 
6464
7539
 
@@ -6469,12 +7544,23 @@
6469
7544
 
6470
7545
 
6471
7546
 
7547
+ <xsl:if test="*[local-name() = 'name']">
7548
+ <xsl:attribute name="margin-top">0pt</xsl:attribute>
7549
+ </xsl:if>
7550
+
6472
7551
  <xsl:apply-templates select="node()[not(local-name() = 'note')]"/>
6473
7552
  </fo:list-block>
6474
7553
  <!-- <xsl:for-each select="./iho:note">
6475
7554
  <xsl:call-template name="note"/>
6476
7555
  </xsl:for-each> -->
6477
7556
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
7557
+ </xsl:template><xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
7558
+ <xsl:param name="process">false</xsl:param>
7559
+ <xsl:if test="$process = 'true'">
7560
+ <fo:block xsl:use-attribute-sets="list-name-style">
7561
+ <xsl:apply-templates/>
7562
+ </fo:block>
7563
+ </xsl:if>
6478
7564
  </xsl:template><xsl:template match="*[local-name()='li']">
6479
7565
  <fo:list-item xsl:use-attribute-sets="list-item-style">
6480
7566
  <xsl:copy-of select="@id"/>
@@ -6674,7 +7760,7 @@
6674
7760
  <!-- <fo:inline id="{@id}" font-size="1pt"/> -->
6675
7761
  <fo:inline id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:inline>
6676
7762
  <!-- we need to add zero-width space, otherwise this fo:inline is missing in IF xml -->
6677
- <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"> </xsl:if>
7763
+ <xsl:if test="not(following-sibling::node()[normalize-space() != ''])"><fo:inline font-size="1pt"> </fo:inline></xsl:if>
6678
7764
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
6679
7765
  <!-- <row>
6680
7766
  <date>05-07-2013</date>
@@ -6737,15 +7823,16 @@
6737
7823
  </xsl:template><xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
6738
7824
 
6739
7825
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-normative-list-style">
7826
+
6740
7827
  <fo:list-item>
6741
7828
  <fo:list-item-label end-indent="label-end()">
6742
7829
  <fo:block>
6743
7830
  <fo:inline>
6744
7831
 
6745
7832
  <xsl:value-of select="*[local-name() = 'docidentifier'][@type = 'metanorma-ordinal']"/>
6746
- <xsl:if test="not(*[local-name() = 'docidentifier'][@type = 'metanorma-ordinal'])">
6747
- <xsl:number format="[1]"/>
6748
- </xsl:if>
7833
+ <xsl:if test="not(*[local-name() = 'docidentifier'][@type = 'metanorma-ordinal'])">
7834
+ <xsl:number format="[1]" count="*[local-name()='bibitem'][not(@hidden = 'true')]"/>
7835
+ </xsl:if>
6749
7836
 
6750
7837
  </fo:inline>
6751
7838
  </fo:block>
@@ -6769,107 +7856,7 @@
6769
7856
 
6770
7857
 
6771
7858
  <!-- start IHO bibitem processing -->
6772
- <!-- IHO documents:
6773
- "[1] S57 edition 3.1: IHO Transfer Standard for Digital Hydrographic Data, International Hydrographic Organization (www.iho.int)”
6774
- [{number}] {docID} edition {edition}: {title}, {author/organization}
6775
- Non-IHO documents:
6776
- Provide title and publisher -->
6777
- <xsl:choose>
6778
- <xsl:when test="iho:formattedref">
6779
- <xsl:apply-templates select="iho:formattedref"/>
6780
- </xsl:when>
6781
- <xsl:otherwise>
6782
- <xsl:choose>
6783
- <!-- IHO documents -->
6784
- <!-- {docID} edition {edition}: {title}, {author/organization} -->
6785
- <xsl:when test="iho:docidentifier[1]/@type='IHO'">
6786
- <xsl:value-of select="iho:docidentifier[1]"/>
6787
- <xsl:apply-templates select="iho:edition"/>
6788
- <xsl:if test="iho:title or iho:contributor or iho:url">
6789
- <xsl:text>: </xsl:text>
6790
- </xsl:if>
6791
- </xsl:when>
6792
-
6793
- <!-- Non-IHO documents -->
6794
- <!-- title and publisher -->
6795
- <xsl:otherwise>
6796
- <xsl:variable name="docID">
6797
- <xsl:call-template name="processBibitemDocId"/>
6798
- </xsl:variable>
6799
- <xsl:value-of select="normalize-space($docID)"/>
6800
- <xsl:if test="normalize-space($docID) != ''"><xsl:text>: </xsl:text></xsl:if>
6801
- </xsl:otherwise>
6802
- </xsl:choose>
6803
-
6804
- <xsl:choose>
6805
- <xsl:when test="iho:title[@type = 'main' and @language = 'en']">
6806
- <xsl:apply-templates select="iho:title[@type = 'main' and @language = 'en']"/>
6807
- </xsl:when>
6808
- <xsl:otherwise>
6809
- <xsl:apply-templates select="iho:title"/>
6810
- </xsl:otherwise>
6811
- </xsl:choose>
6812
-
6813
- <xsl:if test="iho:title and iho:contributor">
6814
- <xsl:text>, </xsl:text>
6815
- </xsl:if>
6816
-
6817
- <xsl:variable name="authors">
6818
- <xsl:choose>
6819
- <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
6820
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
6821
- <xsl:copy-of select="."/>
6822
- </xsl:for-each>
6823
- </xsl:when>
6824
- <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']">
6825
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']">
6826
- <xsl:copy-of select="."/>
6827
- </xsl:for-each>
6828
- </xsl:when>
6829
- <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='publisher'][*[local-name() = 'organization']]">
6830
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='publisher'][*[local-name() = 'organization']]">
6831
- <xsl:copy>
6832
- <xsl:choose>
6833
- <xsl:when test="position() != 1 and position() != last()">, </xsl:when>
6834
- <xsl:when test="position() != 1 and position() = last()"> and </xsl:when>
6835
- </xsl:choose>
6836
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
6837
- </xsl:copy>
6838
- </xsl:for-each>
6839
- </xsl:when>
6840
- </xsl:choose>
6841
- </xsl:variable>
6842
-
6843
- <xsl:for-each select="xalan:nodeset($authors)/*">
6844
- <xsl:choose>
6845
- <xsl:when test="not(*[local-name() = 'role'])"><!-- publisher organisation -->
6846
- <xsl:value-of select="."/>
6847
- </xsl:when>
6848
- <xsl:otherwise> <!-- author, editor -->
6849
- <xsl:choose>
6850
- <xsl:when test="*[local-name() = 'organization']/*[local-name() = 'name']">
6851
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
6852
- </xsl:when>
6853
- <xsl:otherwise>
6854
- <xsl:for-each select="*[local-name() = 'person']">
6855
- <xsl:variable name="author">
6856
- <xsl:call-template name="processPersonalAuthor"/>
6857
- </xsl:variable>
6858
- <xsl:value-of select="xalan:nodeset($author)/author"/>
6859
- </xsl:for-each>
6860
- </xsl:otherwise>
6861
- </xsl:choose>
6862
- </xsl:otherwise>
6863
- </xsl:choose>
6864
- <xsl:if test="*[local-name() = 'organization']/*[local-name() = 'name'] and position() != last()">
6865
- <xsl:text>, </xsl:text>
6866
- </xsl:if>
6867
- </xsl:for-each>
6868
-
6869
- <xsl:apply-templates select="*[local-name() = 'uri'][1]"/>
6870
-
6871
- </xsl:otherwise>
6872
- </xsl:choose>
7859
+ <xsl:apply-templates select="iho:formattedref"/>
6873
7860
  <!-- end IHO bibitem processing -->
6874
7861
 
6875
7862
  </xsl:template><xsl:template name="processBibitemDocId">
@@ -7174,12 +8161,16 @@
7174
8161
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
7175
8162
 
7176
8163
 
8164
+
8165
+
7177
8166
 
7178
8167
 
7179
8168
 
7180
8169
  <fo:block-container xsl:use-attribute-sets="admonition-container-style">
7181
8170
 
7182
8171
 
8172
+
8173
+
7183
8174
  <fo:block xsl:use-attribute-sets="admonition-name-style">
7184
8175
  <xsl:call-template name="displayAdmonitionName"/>
7185
8176
  </fo:block>
@@ -7192,25 +8183,32 @@
7192
8183
  </fo:block-container>
7193
8184
 
7194
8185
  </xsl:template><xsl:template name="displayAdmonitionName">
7195
-
8186
+ <xsl:param name="sep"/> <!-- Example: ' - ' -->
8187
+ <!-- <xsl:choose>
8188
+ <xsl:when test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
8189
+ <xsl:choose>
8190
+ <xsl:when test="@type='important'"><xsl:apply-templates select="@type"/></xsl:when>
8191
+ <xsl:otherwise>
8192
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
8193
+ </xsl:otherwise>
8194
+ </xsl:choose>
8195
+ </xsl:when>
8196
+ <xsl:otherwise>
7196
8197
  <xsl:apply-templates select="*[local-name() = 'name']"/>
7197
8198
  <xsl:if test="not(*[local-name() = 'name'])">
7198
8199
  <xsl:apply-templates select="@type"/>
7199
8200
  </xsl:if>
7200
-
7201
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
7202
- <xsl:apply-templates/>
7203
- </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
7204
- <xsl:variable name="admonition_type_">
7205
- <xsl:call-template name="getLocalizedString">
7206
- <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
7207
- </xsl:call-template>
8201
+ </xsl:otherwise>
8202
+ </xsl:choose> -->
8203
+ <xsl:variable name="name">
8204
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
7208
8205
  </xsl:variable>
7209
- <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
7210
- <xsl:value-of select="$admonition_type"/>
7211
- <xsl:if test="$admonition_type = ''">
7212
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
8206
+ <xsl:copy-of select="$name"/>
8207
+ <xsl:if test="normalize-space($name) != ''">
8208
+ <xsl:value-of select="$sep"/>
7213
8209
  </xsl:if>
8210
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
8211
+ <xsl:apply-templates/>
7214
8212
  </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
7215
8213
  <!-- processing for admonition/p found in the template for 'p' -->
7216
8214
  <xsl:call-template name="paragraph"/>
@@ -7376,6 +8374,8 @@
7376
8374
  </xsl:when>
7377
8375
  <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
7378
8376
  </xsl:choose>
8377
+ </xsl:template><xsl:template match="*[local-name() = 'lang_none']">
8378
+ <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
7379
8379
  </xsl:template><xsl:template name="printEdition">
7380
8380
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
7381
8381
  <xsl:text> </xsl:text>
@@ -7482,6 +8482,27 @@
7482
8482
  </xsl:when>
7483
8483
  <xsl:otherwise><xsl:value-of select="$monthStr_"/></xsl:otherwise>
7484
8484
  </xsl:choose>
8485
+ </xsl:template><xsl:template name="getMonthLocalizedByNum">
8486
+ <xsl:param name="num"/>
8487
+ <xsl:variable name="monthStr">
8488
+ <xsl:choose>
8489
+ <xsl:when test="$num = '01'">january</xsl:when>
8490
+ <xsl:when test="$num = '02'">february</xsl:when>
8491
+ <xsl:when test="$num = '03'">march</xsl:when>
8492
+ <xsl:when test="$num = '04'">april</xsl:when>
8493
+ <xsl:when test="$num = '05'">may</xsl:when>
8494
+ <xsl:when test="$num = '06'">june</xsl:when>
8495
+ <xsl:when test="$num = '07'">july</xsl:when>
8496
+ <xsl:when test="$num = '08'">august</xsl:when>
8497
+ <xsl:when test="$num = '09'">september</xsl:when>
8498
+ <xsl:when test="$num = '10'">october</xsl:when>
8499
+ <xsl:when test="$num = '11'">november</xsl:when>
8500
+ <xsl:when test="$num = '12'">december</xsl:when>
8501
+ </xsl:choose>
8502
+ </xsl:variable>
8503
+ <xsl:call-template name="getLocalizedString">
8504
+ <xsl:with-param name="key">month_<xsl:value-of select="$monthStr"/></xsl:with-param>
8505
+ </xsl:call-template>
7485
8506
  </xsl:template><xsl:template name="insertKeywords">
7486
8507
  <xsl:param name="sorting" select="'true'"/>
7487
8508
  <xsl:param name="charAtEnd" select="'.'"/>
@@ -7682,6 +8703,7 @@
7682
8703
 
7683
8704
 
7684
8705
 
8706
+
7685
8707
  <xsl:value-of select="document('')//*/namespace::iho"/>
7686
8708
 
7687
8709
 
@@ -8088,4 +9110,40 @@
8088
9110
  <xsl:value-of select="$value"/>
8089
9111
  </xsl:otherwise>
8090
9112
  </xsl:choose>
9113
+ </xsl:template><xsl:template match="*" mode="print_as_xml">
9114
+ <xsl:param name="level">0</xsl:param>
9115
+
9116
+ <fo:block margin-left="{2*$level}mm">
9117
+ <xsl:text>
9118
+ &lt;</xsl:text>
9119
+ <xsl:value-of select="local-name()"/>
9120
+ <xsl:for-each select="@*">
9121
+ <xsl:text> </xsl:text>
9122
+ <xsl:value-of select="local-name()"/>
9123
+ <xsl:text>="</xsl:text>
9124
+ <xsl:value-of select="."/>
9125
+ <xsl:text>"</xsl:text>
9126
+ </xsl:for-each>
9127
+ <xsl:text>&gt;</xsl:text>
9128
+
9129
+ <xsl:if test="not(*)">
9130
+ <fo:inline font-weight="bold"><xsl:value-of select="."/></fo:inline>
9131
+ <xsl:text>&lt;/</xsl:text>
9132
+ <xsl:value-of select="local-name()"/>
9133
+ <xsl:text>&gt;</xsl:text>
9134
+ </xsl:if>
9135
+ </fo:block>
9136
+
9137
+ <xsl:if test="*">
9138
+ <fo:block>
9139
+ <xsl:apply-templates mode="print_as_xml">
9140
+ <xsl:with-param name="level" select="$level + 1"/>
9141
+ </xsl:apply-templates>
9142
+ </fo:block>
9143
+ <fo:block margin-left="{2*$level}mm">
9144
+ <xsl:text>&lt;/</xsl:text>
9145
+ <xsl:value-of select="local-name()"/>
9146
+ <xsl:text>&gt;</xsl:text>
9147
+ </fo:block>
9148
+ </xsl:if>
8091
9149
  </xsl:template></xsl:stylesheet>