metanorma-cc 1.6.5 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +9 -32
- data/.gitignore +2 -0
- data/.rubocop.yml +6 -2
- data/lib/asciidoctor/cc/biblio.rng +4 -6
- data/lib/asciidoctor/cc/cc.rng +6 -0
- data/lib/asciidoctor/cc/isodoc.rng +235 -3
- data/lib/isodoc/cc/{csd.standard.xsl → cc.standard.xsl} +539 -264
- data/lib/isodoc/cc/html/_coverpage.css +7 -0
- data/lib/isodoc/cc/html/htmlstyle.css +14 -0
- data/lib/isodoc/cc/pdf_convert.rb +1 -1
- data/lib/metanorma/cc/version.rb +1 -1
- data/metanorma-cc.gemspec +5 -5
- metadata +24 -24
@@ -3,7 +3,9 @@
|
|
3
3
|
<xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
|
4
4
|
|
5
5
|
<xsl:param name="svg_images"/>
|
6
|
+
<xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
|
6
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
|
+
<xsl:param name="basepath"/>
|
7
9
|
|
8
10
|
<xsl:variable name="pageWidth" select="'210mm'"/>
|
9
11
|
<xsl:variable name="pageHeight" select="'297mm'"/>
|
@@ -107,7 +109,9 @@
|
|
107
109
|
|
108
110
|
</fo:layout-master-set>
|
109
111
|
|
110
|
-
<
|
112
|
+
<fo:declarations>
|
113
|
+
<xsl:call-template name="addPDFUAmeta"/>
|
114
|
+
</fo:declarations>
|
111
115
|
|
112
116
|
<xsl:call-template name="addBookmarks">
|
113
117
|
<xsl:with-param name="contents" select="$contents"/>
|
@@ -1068,6 +1072,7 @@
|
|
1068
1072
|
|
1069
1073
|
|
1070
1074
|
|
1075
|
+
|
1071
1076
|
</xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
|
1072
1077
|
|
1073
1078
|
<xsl:attribute name="padding-right">10mm</xsl:attribute>
|
@@ -1279,7 +1284,7 @@
|
|
1279
1284
|
|
1280
1285
|
</xsl:attribute-set><xsl:attribute-set name="admitted-style">
|
1281
1286
|
|
1282
|
-
|
1287
|
+
|
1283
1288
|
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
|
1284
1289
|
|
1285
1290
|
</xsl:attribute-set><xsl:attribute-set name="definition-style">
|
@@ -1287,6 +1292,12 @@
|
|
1287
1292
|
|
1288
1293
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
1289
1294
|
|
1295
|
+
</xsl:attribute-set><xsl:attribute-set name="add-style">
|
1296
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
1297
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1298
|
+
</xsl:attribute-set><xsl:attribute-set name="del-style">
|
1299
|
+
<xsl:attribute name="color">red</xsl:attribute>
|
1300
|
+
<xsl:attribute name="text-decoration">line-through</xsl:attribute>
|
1290
1301
|
</xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
|
1291
1302
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1292
1303
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1332,195 +1343,229 @@
|
|
1332
1343
|
<xsl:call-template name="add-zero-spaces-java"/>
|
1333
1344
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
1334
1345
|
|
1335
|
-
<xsl:variable name="
|
1336
|
-
<xsl:call-template name="getSimpleTable"/>
|
1337
|
-
</xsl:variable>
|
1346
|
+
<xsl:variable name="table">
|
1338
1347
|
|
1339
|
-
|
1340
|
-
|
1341
|
-
|
1342
|
-
|
1343
|
-
<!-- <xsl:if test="$namespace = 'bipm'">
|
1344
|
-
<fo:block> </fo:block>
|
1345
|
-
</xsl:if> -->
|
1346
|
-
|
1347
|
-
<!-- $namespace = 'iso' or -->
|
1348
|
-
|
1349
|
-
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
1350
|
-
|
1351
|
-
|
1352
|
-
|
1353
|
-
<xsl:call-template name="fn_name_display"/>
|
1348
|
+
<xsl:variable name="simple-table">
|
1349
|
+
<xsl:call-template name="getSimpleTable"/>
|
1350
|
+
</xsl:variable>
|
1354
1351
|
|
1355
1352
|
|
1356
|
-
|
1357
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
1358
|
-
|
1359
|
-
<!-- <xsl:variable name="cols-count">
|
1360
|
-
<xsl:choose>
|
1361
|
-
<xsl:when test="*[local-name()='thead']">
|
1362
|
-
<xsl:call-template name="calculate-columns-numbers">
|
1363
|
-
<xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
1364
|
-
</xsl:call-template>
|
1365
|
-
</xsl:when>
|
1366
|
-
<xsl:otherwise>
|
1367
|
-
<xsl:call-template name="calculate-columns-numbers">
|
1368
|
-
<xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
|
1369
|
-
</xsl:call-template>
|
1370
|
-
</xsl:otherwise>
|
1371
|
-
</xsl:choose>
|
1372
|
-
</xsl:variable> -->
|
1373
|
-
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1374
|
-
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1375
|
-
|
1376
|
-
|
1377
|
-
|
1378
|
-
<xsl:variable name="colwidths">
|
1379
|
-
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1380
|
-
<xsl:call-template name="calculate-column-widths">
|
1381
|
-
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1382
|
-
<xsl:with-param name="table" select="$simple-table"/>
|
1383
|
-
</xsl:call-template>
|
1384
|
-
</xsl:if>
|
1385
|
-
</xsl:variable>
|
1386
|
-
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1387
|
-
|
1388
|
-
<!-- <xsl:variable name="colwidths2">
|
1389
|
-
<xsl:call-template name="calculate-column-widths">
|
1390
|
-
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1391
|
-
</xsl:call-template>
|
1392
|
-
</xsl:variable> -->
|
1393
|
-
|
1394
|
-
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
1395
|
-
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
1396
|
-
colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
|
1397
|
-
|
1398
|
-
<xsl:variable name="margin-left">
|
1399
|
-
<xsl:choose>
|
1400
|
-
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
1401
|
-
<xsl:otherwise>0</xsl:otherwise>
|
1402
|
-
</xsl:choose>
|
1403
|
-
</xsl:variable>
|
1404
|
-
|
1405
|
-
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1406
1353
|
|
1407
|
-
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
1408
1354
|
|
1409
1355
|
|
1410
|
-
|
1411
|
-
|
1412
|
-
|
1356
|
+
<!-- <xsl:if test="$namespace = 'bipm'">
|
1357
|
+
<fo:block> </fo:block>
|
1358
|
+
</xsl:if> -->
|
1413
1359
|
|
1360
|
+
<!-- $namespace = 'iso' or -->
|
1414
1361
|
|
1415
|
-
|
1362
|
+
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
1416
1363
|
|
1364
|
+
|
1417
1365
|
|
1366
|
+
<xsl:call-template name="fn_name_display"/>
|
1418
1367
|
|
1368
|
+
|
1419
1369
|
|
1370
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
|
1420
1371
|
|
1372
|
+
<!-- <xsl:variable name="cols-count">
|
1373
|
+
<xsl:choose>
|
1374
|
+
<xsl:when test="*[local-name()='thead']">
|
1375
|
+
<xsl:call-template name="calculate-columns-numbers">
|
1376
|
+
<xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
|
1377
|
+
</xsl:call-template>
|
1378
|
+
</xsl:when>
|
1379
|
+
<xsl:otherwise>
|
1380
|
+
<xsl:call-template name="calculate-columns-numbers">
|
1381
|
+
<xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
|
1382
|
+
</xsl:call-template>
|
1383
|
+
</xsl:otherwise>
|
1384
|
+
</xsl:choose>
|
1385
|
+
</xsl:variable> -->
|
1386
|
+
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1387
|
+
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1421
1388
|
|
1422
1389
|
|
1423
|
-
|
1424
|
-
|
1425
|
-
<
|
1426
|
-
<xsl:
|
1427
|
-
<xsl:
|
1428
|
-
<xsl:
|
1429
|
-
</xsl:
|
1430
|
-
</
|
1431
|
-
|
1432
|
-
|
1390
|
+
|
1391
|
+
<xsl:variable name="colwidths">
|
1392
|
+
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1393
|
+
<xsl:call-template name="calculate-column-widths">
|
1394
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1395
|
+
<xsl:with-param name="table" select="$simple-table"/>
|
1396
|
+
</xsl:call-template>
|
1397
|
+
</xsl:if>
|
1398
|
+
</xsl:variable>
|
1399
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
1400
|
+
|
1401
|
+
<!-- <xsl:variable name="colwidths2">
|
1402
|
+
<xsl:call-template name="calculate-column-widths">
|
1403
|
+
<xsl:with-param name="cols-count" select="$cols-count"/>
|
1404
|
+
</xsl:call-template>
|
1405
|
+
</xsl:variable> -->
|
1406
|
+
|
1407
|
+
<!-- cols-count=<xsl:copy-of select="$cols-count"/>
|
1408
|
+
colwidthsNew=<xsl:copy-of select="$colwidths"/>
|
1409
|
+
colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
|
1410
|
+
|
1411
|
+
<xsl:variable name="margin-left">
|
1412
|
+
<xsl:choose>
|
1413
|
+
<xsl:when test="sum(xalan:nodeset($colwidths)//column) > 75">15</xsl:when>
|
1414
|
+
<xsl:otherwise>0</xsl:otherwise>
|
1415
|
+
</xsl:choose>
|
1416
|
+
</xsl:variable>
|
1417
|
+
|
1418
|
+
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1433
1419
|
|
1420
|
+
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
1434
1421
|
|
1435
1422
|
|
1423
|
+
|
1424
|
+
|
1425
|
+
|
1436
1426
|
|
1437
|
-
|
1438
|
-
|
1439
|
-
|
1440
1427
|
|
1441
|
-
|
1428
|
+
|
1442
1429
|
|
1443
|
-
</xsl:variable>
|
1444
|
-
|
1445
|
-
|
1446
|
-
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
1447
1430
|
|
1448
|
-
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1449
|
-
<xsl:attribute name="{@name}">
|
1450
|
-
<xsl:value-of select="."/>
|
1451
|
-
</xsl:attribute>
|
1452
|
-
</xsl:for-each>
|
1453
1431
|
|
1454
|
-
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1455
|
-
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1456
|
-
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1457
|
-
</xsl:if>
|
1458
1432
|
|
1459
|
-
<xsl:choose>
|
1460
|
-
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1461
|
-
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1462
|
-
<fo:table-column column-width="{@width}"/>
|
1463
|
-
</xsl:for-each>
|
1464
|
-
</xsl:when>
|
1465
|
-
<xsl:otherwise>
|
1466
|
-
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1467
|
-
<xsl:choose>
|
1468
|
-
<xsl:when test=". = 1 or . = 0">
|
1469
|
-
<fo:table-column column-width="proportional-column-width(2)"/>
|
1470
|
-
</xsl:when>
|
1471
|
-
<xsl:otherwise>
|
1472
|
-
<fo:table-column column-width="proportional-column-width({.})"/>
|
1473
|
-
</xsl:otherwise>
|
1474
|
-
</xsl:choose>
|
1475
|
-
</xsl:for-each>
|
1476
|
-
</xsl:otherwise>
|
1477
|
-
</xsl:choose>
|
1478
1433
|
|
1479
|
-
<xsl:choose>
|
1480
|
-
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
1481
|
-
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
1482
|
-
</xsl:when>
|
1483
|
-
<xsl:otherwise>
|
1484
|
-
<xsl:apply-templates/>
|
1485
|
-
</xsl:otherwise>
|
1486
|
-
</xsl:choose>
|
1487
1434
|
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1495
|
-
<xsl:with-param name="colgroup" select="$colgroup"/>
|
1496
|
-
</xsl:call-template>
|
1497
|
-
</xsl:for-each>
|
1498
|
-
|
1499
|
-
<!-- insert footer as table -->
|
1500
|
-
<!-- <fo:table>
|
1501
|
-
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
1502
|
-
<xsl:attribute name="{@name}">
|
1503
|
-
<xsl:value-of select="."/>
|
1504
|
-
</xsl:attribute>
|
1505
|
-
</xsl:for-each>
|
1435
|
+
<xsl:variable name="table_width">
|
1436
|
+
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1437
|
+
100%
|
1438
|
+
|
1439
|
+
|
1440
|
+
</xsl:variable>
|
1506
1441
|
|
1507
|
-
<xsl:
|
1442
|
+
<xsl:variable name="table_attributes">
|
1443
|
+
<attribute name="table-layout">fixed</attribute>
|
1444
|
+
<attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
|
1445
|
+
<attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1446
|
+
<attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
|
1447
|
+
|
1448
|
+
|
1449
|
+
|
1450
|
+
|
1451
|
+
|
1452
|
+
|
1453
|
+
|
1454
|
+
|
1455
|
+
|
1456
|
+
|
1457
|
+
</xsl:variable>
|
1458
|
+
|
1459
|
+
|
1460
|
+
<fo:table id="{@id}" table-omit-footer-at-break="true">
|
1461
|
+
|
1462
|
+
<xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
|
1463
|
+
<xsl:attribute name="{@name}">
|
1464
|
+
<xsl:value-of select="."/>
|
1465
|
+
</xsl:attribute>
|
1466
|
+
</xsl:for-each>
|
1467
|
+
|
1468
|
+
<xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
|
1469
|
+
<xsl:if test="$isNoteOrFnExist = 'true'">
|
1470
|
+
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1471
|
+
</xsl:if>
|
1472
|
+
|
1508
1473
|
<xsl:choose>
|
1509
|
-
<xsl:when test="
|
1510
|
-
<
|
1474
|
+
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1475
|
+
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
1476
|
+
<fo:table-column column-width="{@width}"/>
|
1477
|
+
</xsl:for-each>
|
1511
1478
|
</xsl:when>
|
1512
1479
|
<xsl:otherwise>
|
1513
|
-
<
|
1480
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1481
|
+
<xsl:choose>
|
1482
|
+
<xsl:when test=". = 1 or . = 0">
|
1483
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1484
|
+
</xsl:when>
|
1485
|
+
<xsl:otherwise>
|
1486
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1487
|
+
</xsl:otherwise>
|
1488
|
+
</xsl:choose>
|
1489
|
+
</xsl:for-each>
|
1514
1490
|
</xsl:otherwise>
|
1515
1491
|
</xsl:choose>
|
1492
|
+
|
1493
|
+
<xsl:choose>
|
1494
|
+
<xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
|
1495
|
+
<xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
|
1496
|
+
</xsl:when>
|
1497
|
+
<xsl:otherwise>
|
1498
|
+
<xsl:apply-templates/>
|
1499
|
+
</xsl:otherwise>
|
1500
|
+
</xsl:choose>
|
1501
|
+
|
1502
|
+
</fo:table>
|
1503
|
+
|
1504
|
+
<xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
|
1505
|
+
<xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
|
1506
|
+
<xsl:call-template name="insertTableFooterInSeparateTable">
|
1507
|
+
<xsl:with-param name="table_attributes" select="$table_attributes"/>
|
1508
|
+
<xsl:with-param name="colwidths" select="$colwidths"/>
|
1509
|
+
<xsl:with-param name="colgroup" select="$colgroup"/>
|
1510
|
+
</xsl:call-template>
|
1516
1511
|
</xsl:for-each>
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1512
|
+
|
1513
|
+
<!-- insert footer as table -->
|
1514
|
+
<!-- <fo:table>
|
1515
|
+
<xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
|
1516
|
+
<xsl:attribute name="{@name}">
|
1517
|
+
<xsl:value-of select="."/>
|
1518
|
+
</xsl:attribute>
|
1519
|
+
</xsl:for-each>
|
1520
|
+
|
1521
|
+
<xsl:for-each select="xalan:nodeset($colwidths)//column">
|
1522
|
+
<xsl:choose>
|
1523
|
+
<xsl:when test=". = 1 or . = 0">
|
1524
|
+
<fo:table-column column-width="proportional-column-width(2)"/>
|
1525
|
+
</xsl:when>
|
1526
|
+
<xsl:otherwise>
|
1527
|
+
<fo:table-column column-width="proportional-column-width({.})"/>
|
1528
|
+
</xsl:otherwise>
|
1529
|
+
</xsl:choose>
|
1530
|
+
</xsl:for-each>
|
1531
|
+
</fo:table>-->
|
1532
|
+
|
1533
|
+
|
1534
|
+
|
1535
|
+
|
1536
|
+
|
1537
|
+
</fo:block-container>
|
1538
|
+
</xsl:variable>
|
1539
|
+
|
1540
|
+
|
1541
|
+
|
1542
|
+
<xsl:choose>
|
1543
|
+
<xsl:when test="@width">
|
1544
|
+
|
1545
|
+
<!-- centered table when table name is centered (see table-name-style) -->
|
1546
|
+
|
1547
|
+
<fo:table table-layout="fixed" width="100%">
|
1548
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
1549
|
+
<fo:table-column column-width="{@width}"/>
|
1550
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
1551
|
+
<fo:table-body>
|
1552
|
+
<fo:table-row>
|
1553
|
+
<fo:table-cell column-number="2">
|
1554
|
+
<fo:block><xsl:copy-of select="$table"/></fo:block>
|
1555
|
+
</fo:table-cell>
|
1556
|
+
</fo:table-row>
|
1557
|
+
</fo:table-body>
|
1558
|
+
</fo:table>
|
1559
|
+
|
1560
|
+
|
1561
|
+
|
1562
|
+
|
1563
|
+
</xsl:when>
|
1564
|
+
<xsl:otherwise>
|
1565
|
+
<xsl:copy-of select="$table"/>
|
1566
|
+
</xsl:otherwise>
|
1567
|
+
</xsl:choose>
|
1568
|
+
|
1524
1569
|
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
|
1525
1570
|
<xsl:if test="normalize-space() != ''">
|
1526
1571
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
@@ -1648,7 +1693,15 @@
|
|
1648
1693
|
</xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
|
1649
1694
|
<xsl:value-of select="@target"/>
|
1650
1695
|
</xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
|
1651
|
-
<xsl:variable name="
|
1696
|
+
<xsl:variable name="mathml">
|
1697
|
+
<xsl:for-each select="*">
|
1698
|
+
<xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
|
1699
|
+
<xsl:copy-of select="."/>
|
1700
|
+
</xsl:if>
|
1701
|
+
</xsl:for-each>
|
1702
|
+
</xsl:variable>
|
1703
|
+
|
1704
|
+
<xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
|
1652
1705
|
<xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
|
1653
1706
|
</xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
|
1654
1707
|
<xsl:param name="cols-count"/>
|
@@ -2333,7 +2386,7 @@
|
|
2333
2386
|
<xsl:with-param name="table" select="$html-table"/>
|
2334
2387
|
</xsl:call-template>
|
2335
2388
|
</xsl:variable>
|
2336
|
-
<!-- colwidths=<xsl:
|
2389
|
+
<!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
|
2337
2390
|
<xsl:variable name="maxlength_dt">
|
2338
2391
|
<xsl:call-template name="getMaxLength_dt"/>
|
2339
2392
|
</xsl:variable>
|
@@ -2362,13 +2415,22 @@
|
|
2362
2415
|
</xsl:when>
|
2363
2416
|
<xsl:otherwise>
|
2364
2417
|
<xsl:choose>
|
2418
|
+
<!-- to set width check most wide chars like `W` -->
|
2365
2419
|
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 2"> <!-- if dt contains short text like t90, a, etc -->
|
2366
|
-
<fo:table-column column-width="
|
2367
|
-
<fo:table-column column-width="
|
2420
|
+
<fo:table-column column-width="7%"/>
|
2421
|
+
<fo:table-column column-width="93%"/>
|
2422
|
+
</xsl:when>
|
2423
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 5"> <!-- if dt contains short text like ABC, etc -->
|
2424
|
+
<fo:table-column column-width="15%"/>
|
2425
|
+
<fo:table-column column-width="85%"/>
|
2426
|
+
</xsl:when>
|
2427
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 7"> <!-- if dt contains short text like ABCDEF, etc -->
|
2428
|
+
<fo:table-column column-width="20%"/>
|
2429
|
+
<fo:table-column column-width="80%"/>
|
2368
2430
|
</xsl:when>
|
2369
|
-
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <=
|
2370
|
-
<fo:table-column column-width="
|
2371
|
-
<fo:table-column column-width="
|
2431
|
+
<xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) <= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
|
2432
|
+
<fo:table-column column-width="25%"/>
|
2433
|
+
<fo:table-column column-width="75%"/>
|
2372
2434
|
</xsl:when>
|
2373
2435
|
<!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] > 1.7">
|
2374
2436
|
<fo:table-column column-width="60%"/>
|
@@ -2584,8 +2646,16 @@
|
|
2584
2646
|
<fo:inline text-decoration="underline">
|
2585
2647
|
<xsl:apply-templates/>
|
2586
2648
|
</fo:inline>
|
2649
|
+
</xsl:template><xsl:template match="*[local-name()='add']">
|
2650
|
+
<fo:inline xsl:use-attribute-sets="add-style">
|
2651
|
+
<xsl:apply-templates/>
|
2652
|
+
</fo:inline>
|
2587
2653
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2588
|
-
<fo:inline
|
2654
|
+
<fo:inline xsl:use-attribute-sets="del-style">
|
2655
|
+
<xsl:apply-templates/>
|
2656
|
+
</fo:inline>
|
2657
|
+
</xsl:template><xsl:template match="*[local-name()='hi']">
|
2658
|
+
<fo:inline background-color="yellow">
|
2589
2659
|
<xsl:apply-templates/>
|
2590
2660
|
</fo:inline>
|
2591
2661
|
</xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
|
@@ -2677,6 +2747,10 @@
|
|
2677
2747
|
<xsl:param name="text" select="."/>
|
2678
2748
|
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
2679
2749
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1')"/>
|
2750
|
+
</xsl:template><xsl:template name="add-zero-spaces-link-java">
|
2751
|
+
<xsl:param name="text" select="."/>
|
2752
|
+
<!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
|
2753
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1')"/>
|
2680
2754
|
</xsl:template><xsl:template name="add-zero-spaces">
|
2681
2755
|
<xsl:param name="text" select="."/>
|
2682
2756
|
<xsl:variable name="zero-space-after-chars">-</xsl:variable>
|
@@ -2924,6 +2998,7 @@
|
|
2924
2998
|
<xsl:apply-templates select="." mode="mathml"/>
|
2925
2999
|
</xsl:variable>
|
2926
3000
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3001
|
+
|
2927
3002
|
<!-- <xsl:copy-of select="."/> -->
|
2928
3003
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
2929
3004
|
</fo:instream-foreign-object>
|
@@ -2937,7 +3012,12 @@
|
|
2937
3012
|
<!-- replace start and end spaces to non-break space -->
|
2938
3013
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
|
2939
3014
|
</xsl:copy>
|
2940
|
-
</xsl:template><xsl:template match="
|
3015
|
+
</xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
|
3016
|
+
<xsl:copy>
|
3017
|
+
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3018
|
+
</xsl:copy>
|
3019
|
+
<mathml:mspace width="0.5ex"/>
|
3020
|
+
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
2941
3021
|
<xsl:variable name="target">
|
2942
3022
|
<xsl:choose>
|
2943
3023
|
<xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
|
@@ -2958,7 +3038,10 @@
|
|
2958
3038
|
<fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
|
2959
3039
|
<xsl:choose>
|
2960
3040
|
<xsl:when test="normalize-space(.) = ''">
|
2961
|
-
<xsl:value-of select="$target"/>
|
3041
|
+
<!-- <xsl:value-of select="$target"/> -->
|
3042
|
+
<xsl:call-template name="add-zero-spaces-link-java">
|
3043
|
+
<xsl:with-param name="text" select="$target"/>
|
3044
|
+
</xsl:call-template>
|
2962
3045
|
</xsl:when>
|
2963
3046
|
<xsl:otherwise>
|
2964
3047
|
<xsl:apply-templates/>
|
@@ -2968,8 +3051,6 @@
|
|
2968
3051
|
</xsl:otherwise>
|
2969
3052
|
</xsl:choose>
|
2970
3053
|
</fo:inline>
|
2971
|
-
</xsl:template><xsl:template match="*[local-name()='bookmark']">
|
2972
|
-
<fo:inline id="{@id}"/>
|
2973
3054
|
</xsl:template><xsl:template match="*[local-name()='appendix']">
|
2974
3055
|
<fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
|
2975
3056
|
<xsl:apply-templates select="*[local-name()='title']" mode="process"/>
|
@@ -3176,27 +3257,43 @@
|
|
3176
3257
|
<fo:block id="{@id}">
|
3177
3258
|
<xsl:apply-templates/>
|
3178
3259
|
</fo:block>
|
3260
|
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
3179
3261
|
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
|
3180
3262
|
<fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
|
3181
3263
|
<xsl:apply-templates/>
|
3182
3264
|
</fo:block>
|
3183
3265
|
</xsl:template><xsl:template match="*[local-name() = 'image']">
|
3184
|
-
<
|
3185
|
-
|
3186
|
-
|
3187
|
-
|
3188
|
-
|
3189
|
-
|
3190
|
-
|
3191
|
-
|
3192
|
-
|
3193
|
-
|
3194
|
-
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
3198
|
-
|
3199
|
-
|
3266
|
+
<xsl:choose>
|
3267
|
+
<xsl:when test="ancestor::*[local-name() = 'title']">
|
3268
|
+
<fo:inline padding-left="1mm" padding-right="1mm">
|
3269
|
+
<xsl:variable name="src">
|
3270
|
+
<xsl:call-template name="image_src"/>
|
3271
|
+
</xsl:variable>
|
3272
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
|
3273
|
+
</fo:inline>
|
3274
|
+
</xsl:when>
|
3275
|
+
<xsl:otherwise>
|
3276
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
3277
|
+
|
3278
|
+
<xsl:variable name="src">
|
3279
|
+
<xsl:call-template name="image_src"/>
|
3280
|
+
</xsl:variable>
|
3281
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3282
|
+
</fo:block>
|
3283
|
+
</xsl:otherwise>
|
3284
|
+
</xsl:choose>
|
3285
|
+
</xsl:template><xsl:template name="image_src">
|
3286
|
+
<xsl:choose>
|
3287
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3288
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3289
|
+
</xsl:when>
|
3290
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3291
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3292
|
+
</xsl:when>
|
3293
|
+
<xsl:otherwise>
|
3294
|
+
<xsl:value-of select="@src"/>
|
3295
|
+
</xsl:otherwise>
|
3296
|
+
</xsl:choose>
|
3200
3297
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
|
3201
3298
|
<xsl:apply-templates mode="contents"/>
|
3202
3299
|
<xsl:text> </xsl:text>
|
@@ -3429,6 +3526,8 @@
|
|
3429
3526
|
<xsl:copy>
|
3430
3527
|
<xsl:apply-templates mode="contents_item"/>
|
3431
3528
|
</xsl:copy>
|
3529
|
+
</xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
|
3530
|
+
<xsl:copy-of select="."/>
|
3432
3531
|
</xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
|
3433
3532
|
<xsl:text> </xsl:text>
|
3434
3533
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
|
@@ -3757,10 +3856,11 @@
|
|
3757
3856
|
</xsl:choose>
|
3758
3857
|
|
3759
3858
|
</xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
|
3760
|
-
|
3859
|
+
<xsl:variable name="num"><xsl:number/></xsl:variable>
|
3761
3860
|
<xsl:variable name="element">
|
3762
3861
|
block
|
3763
3862
|
|
3863
|
+
|
3764
3864
|
</xsl:variable>
|
3765
3865
|
<xsl:choose>
|
3766
3866
|
<xsl:when test="normalize-space($element) = 'block'">
|
@@ -3835,11 +3935,13 @@
|
|
3835
3935
|
</xsl:if>
|
3836
3936
|
</xsl:if>
|
3837
3937
|
|
3938
|
+
|
3838
3939
|
<fo:block-container margin-left="0mm">
|
3839
3940
|
|
3840
3941
|
<fo:block xsl:use-attribute-sets="quote-style">
|
3841
3942
|
<!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
|
3842
|
-
|
3943
|
+
|
3944
|
+
<xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
|
3843
3945
|
</fo:block>
|
3844
3946
|
<xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
|
3845
3947
|
<fo:block xsl:use-attribute-sets="quote-source-style">
|
@@ -3862,32 +3964,50 @@
|
|
3862
3964
|
<xsl:text>— </xsl:text>
|
3863
3965
|
<xsl:apply-templates/>
|
3864
3966
|
</xsl:template><xsl:template match="*[local-name() = 'eref']">
|
3865
|
-
|
3866
|
-
|
3867
|
-
|
3868
|
-
|
3869
|
-
|
3870
|
-
|
3871
|
-
|
3872
|
-
|
3873
|
-
|
3874
|
-
|
3875
|
-
|
3876
|
-
|
3877
|
-
|
3878
|
-
|
3879
|
-
|
3880
|
-
|
3881
|
-
|
3882
|
-
|
3883
|
-
|
3884
|
-
|
3885
|
-
|
3886
|
-
|
3887
|
-
|
3888
|
-
|
3889
|
-
|
3890
|
-
|
3967
|
+
|
3968
|
+
<xsl:variable name="bibitemid">
|
3969
|
+
<xsl:choose>
|
3970
|
+
<xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
|
3971
|
+
<xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
|
3972
|
+
<xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
|
3973
|
+
</xsl:choose>
|
3974
|
+
</xsl:variable>
|
3975
|
+
|
3976
|
+
<xsl:choose>
|
3977
|
+
<xsl:when test="normalize-space($bibitemid) != ''">
|
3978
|
+
<fo:inline xsl:use-attribute-sets="eref-style">
|
3979
|
+
<xsl:if test="@type = 'footnote'">
|
3980
|
+
|
3981
|
+
<xsl:attribute name="keep-together.within-line">always</xsl:attribute>
|
3982
|
+
<xsl:attribute name="font-size">80%</xsl:attribute>
|
3983
|
+
<xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
|
3984
|
+
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
3985
|
+
|
3986
|
+
|
3987
|
+
</xsl:if>
|
3988
|
+
|
3989
|
+
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
3990
|
+
<xsl:if test="normalize-space(@citeas) = ''">
|
3991
|
+
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
3992
|
+
</xsl:if>
|
3993
|
+
<xsl:if test="@type = 'inline'">
|
3994
|
+
|
3995
|
+
<xsl:attribute name="color">blue</xsl:attribute>
|
3996
|
+
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
3997
|
+
|
3998
|
+
|
3999
|
+
|
4000
|
+
</xsl:if>
|
4001
|
+
|
4002
|
+
<xsl:apply-templates/>
|
4003
|
+
</fo:basic-link>
|
4004
|
+
|
4005
|
+
</fo:inline>
|
4006
|
+
</xsl:when>
|
4007
|
+
<xsl:otherwise>
|
4008
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4009
|
+
</xsl:otherwise>
|
4010
|
+
</xsl:choose>
|
3891
4011
|
</xsl:template><xsl:template match="*[local-name() = 'tab']">
|
3892
4012
|
<!-- zero-space char -->
|
3893
4013
|
<xsl:variable name="depth">
|
@@ -4071,6 +4191,153 @@
|
|
4071
4191
|
</fo:block>
|
4072
4192
|
</xsl:otherwise>
|
4073
4193
|
</xsl:choose>
|
4194
|
+
</xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
|
4195
|
+
<xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
|
4196
|
+
<bookmark><xsl:value-of select="@id"/></bookmark>
|
4197
|
+
</xsl:for-each>
|
4198
|
+
</xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
|
4199
|
+
<xsl:copy>
|
4200
|
+
<xsl:apply-templates select="@*|node()" mode="index_add_id"/>
|
4201
|
+
</xsl:copy>
|
4202
|
+
</xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
|
4203
|
+
<xsl:variable name="id">
|
4204
|
+
<xsl:call-template name="generateIndexXrefId"/>
|
4205
|
+
</xsl:variable>
|
4206
|
+
<xsl:copy> <!-- add id to xref -->
|
4207
|
+
<xsl:apply-templates select="@*" mode="index_add_id"/>
|
4208
|
+
<xsl:attribute name="id">
|
4209
|
+
<xsl:value-of select="$id"/>
|
4210
|
+
</xsl:attribute>
|
4211
|
+
<xsl:apply-templates mode="index_add_id"/>
|
4212
|
+
</xsl:copy>
|
4213
|
+
<!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
|
4214
|
+
<xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
|
4215
|
+
<xsl:if test="@to">
|
4216
|
+
<xsl:value-of select="$dash"/>
|
4217
|
+
<xsl:copy>
|
4218
|
+
<xsl:copy-of select="@*"/>
|
4219
|
+
<xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
|
4220
|
+
<xsl:attribute name="id">
|
4221
|
+
<xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
|
4222
|
+
</xsl:attribute>
|
4223
|
+
<xsl:apply-templates mode="index_add_id"/>
|
4224
|
+
</xsl:copy>
|
4225
|
+
</xsl:if>
|
4226
|
+
</xsl:template><xsl:template match="@*|node()" mode="index_update">
|
4227
|
+
<xsl:copy>
|
4228
|
+
<xsl:apply-templates select="@*|node()" mode="index_update"/>
|
4229
|
+
</xsl:copy>
|
4230
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
|
4231
|
+
<xsl:copy>
|
4232
|
+
<xsl:apply-templates select="@*" mode="index_update"/>
|
4233
|
+
<xsl:apply-templates select="node()[1]" mode="process_li_element"/>
|
4234
|
+
</xsl:copy>
|
4235
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
|
4236
|
+
<xsl:param name="element"/>
|
4237
|
+
<xsl:param name="remove" select="'false'"/>
|
4238
|
+
<xsl:param name="target"/>
|
4239
|
+
<!-- <node></node> -->
|
4240
|
+
<xsl:choose>
|
4241
|
+
<xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
|
4242
|
+
<!-- skip text (i.e. remove it) and process next element -->
|
4243
|
+
<!-- [removed_<xsl:value-of select="."/>] -->
|
4244
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4245
|
+
<xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
|
4246
|
+
</xsl:apply-templates>
|
4247
|
+
</xsl:when>
|
4248
|
+
<xsl:when test="self::text()">
|
4249
|
+
<xsl:value-of select="."/>
|
4250
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4251
|
+
</xsl:when>
|
4252
|
+
<xsl:when test="self::* and local-name(.) = 'xref'">
|
4253
|
+
<xsl:variable name="id" select="@id"/>
|
4254
|
+
<xsl:variable name="page" select="$index//item[@id = $id]"/>
|
4255
|
+
<xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
|
4256
|
+
<xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
|
4257
|
+
|
4258
|
+
<xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
|
4259
|
+
<xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
|
4260
|
+
|
4261
|
+
<xsl:choose>
|
4262
|
+
<!-- 2nd pass -->
|
4263
|
+
<!-- if page is equal to page for next and page is not the end of range -->
|
4264
|
+
<xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
|
4265
|
+
<!-- skip element (i.e. remove it) and remove next text ',' -->
|
4266
|
+
<!-- [removed_xref] -->
|
4267
|
+
|
4268
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4269
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
4270
|
+
<xsl:with-param name="target">
|
4271
|
+
<xsl:choose>
|
4272
|
+
<xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
|
4273
|
+
<xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
|
4274
|
+
</xsl:choose>
|
4275
|
+
</xsl:with-param>
|
4276
|
+
</xsl:apply-templates>
|
4277
|
+
</xsl:when>
|
4278
|
+
|
4279
|
+
<xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
|
4280
|
+
<!-- remove xref -->
|
4281
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
|
4282
|
+
<xsl:with-param name="remove">true</xsl:with-param>
|
4283
|
+
</xsl:apply-templates>
|
4284
|
+
</xsl:when>
|
4285
|
+
|
4286
|
+
<xsl:otherwise>
|
4287
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
4288
|
+
<xsl:with-param name="target" select="$target"/>
|
4289
|
+
</xsl:apply-templates>
|
4290
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4291
|
+
</xsl:otherwise>
|
4292
|
+
</xsl:choose>
|
4293
|
+
</xsl:when>
|
4294
|
+
<xsl:when test="self::* and local-name(.) = 'ul'">
|
4295
|
+
<!-- ul -->
|
4296
|
+
<xsl:apply-templates select="." mode="index_update"/>
|
4297
|
+
</xsl:when>
|
4298
|
+
<xsl:otherwise>
|
4299
|
+
<xsl:apply-templates select="." mode="xref_copy">
|
4300
|
+
<xsl:with-param name="target" select="$target"/>
|
4301
|
+
</xsl:apply-templates>
|
4302
|
+
<xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
|
4303
|
+
</xsl:otherwise>
|
4304
|
+
</xsl:choose>
|
4305
|
+
</xsl:template><xsl:template match="@*|node()" mode="xref_copy">
|
4306
|
+
<xsl:param name="target"/>
|
4307
|
+
<xsl:copy>
|
4308
|
+
<xsl:apply-templates select="@*" mode="xref_copy"/>
|
4309
|
+
<xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
|
4310
|
+
<xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
|
4311
|
+
</xsl:if>
|
4312
|
+
<xsl:apply-templates select="node()" mode="xref_copy"/>
|
4313
|
+
</xsl:copy>
|
4314
|
+
</xsl:template><xsl:template name="generateIndexXrefId">
|
4315
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
4316
|
+
|
4317
|
+
<xsl:variable name="docid">
|
4318
|
+
<xsl:call-template name="getDocumentId"/>
|
4319
|
+
</xsl:variable>
|
4320
|
+
<xsl:variable name="item_number">
|
4321
|
+
<xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
|
4322
|
+
</xsl:variable>
|
4323
|
+
<xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
|
4324
|
+
<xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
|
4325
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
|
4326
|
+
<xsl:apply-templates/>
|
4327
|
+
<fo:block>
|
4328
|
+
<xsl:if test="following-sibling::*[local-name() = 'clause']">
|
4329
|
+
<fo:block> </fo:block>
|
4330
|
+
</xsl:if>
|
4331
|
+
</fo:block>
|
4332
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
|
4333
|
+
<xsl:apply-templates/>
|
4334
|
+
</xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
|
4335
|
+
<xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
|
4336
|
+
<fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
|
4337
|
+
<xsl:apply-templates/>
|
4338
|
+
</fo:block>
|
4339
|
+
</xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
|
4340
|
+
<fo:inline id="{@id}" font-size="1pt"/>
|
4074
4341
|
</xsl:template><xsl:template match="*[local-name() = 'errata']">
|
4075
4342
|
<!-- <row>
|
4076
4343
|
<date>05-07-2013</date>
|
@@ -4258,7 +4525,7 @@
|
|
4258
4525
|
<xsl:param name="charDelim" select="', '"/>
|
4259
4526
|
<xsl:choose>
|
4260
4527
|
<xsl:when test="$sorting = 'true' or $sorting = 'yes'">
|
4261
|
-
<xsl:for-each select="
|
4528
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4262
4529
|
<xsl:sort data-type="text" order="ascending"/>
|
4263
4530
|
<xsl:call-template name="insertKeyword">
|
4264
4531
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
@@ -4267,7 +4534,7 @@
|
|
4267
4534
|
</xsl:for-each>
|
4268
4535
|
</xsl:when>
|
4269
4536
|
<xsl:otherwise>
|
4270
|
-
<xsl:for-each select="
|
4537
|
+
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
|
4271
4538
|
<xsl:call-template name="insertKeyword">
|
4272
4539
|
<xsl:with-param name="charAtEnd" select="$charAtEnd"/>
|
4273
4540
|
<xsl:with-param name="charDelim" select="$charDelim"/>
|
@@ -4284,63 +4551,71 @@
|
|
4284
4551
|
<xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
|
4285
4552
|
</xsl:choose>
|
4286
4553
|
</xsl:template><xsl:template name="addPDFUAmeta">
|
4287
|
-
<
|
4288
|
-
<
|
4289
|
-
|
4290
|
-
|
4291
|
-
|
4292
|
-
|
4293
|
-
|
4294
|
-
|
4295
|
-
|
4296
|
-
|
4297
|
-
|
4298
|
-
|
4554
|
+
<xsl:variable name="lang">
|
4555
|
+
<xsl:call-template name="getLang"/>
|
4556
|
+
</xsl:variable>
|
4557
|
+
<pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
|
4558
|
+
<pdf:dictionary type="normal" key="ViewerPreferences">
|
4559
|
+
<pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
|
4560
|
+
</pdf:dictionary>
|
4561
|
+
</pdf:catalog>
|
4562
|
+
<x:xmpmeta xmlns:x="adobe:ns:meta/">
|
4563
|
+
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
4564
|
+
<rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
|
4565
|
+
<!-- Dublin Core properties go here -->
|
4566
|
+
<dc:title>
|
4567
|
+
<xsl:variable name="title">
|
4568
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4569
|
+
|
4299
4570
|
|
4300
4571
|
|
4301
4572
|
|
4302
|
-
<xsl:value-of select="
|
4573
|
+
<xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
|
4303
4574
|
|
4304
4575
|
|
4305
4576
|
|
4306
|
-
</xsl:
|
4307
|
-
|
4308
|
-
|
4309
|
-
|
4310
|
-
|
4311
|
-
|
4312
|
-
|
4313
|
-
</xsl:
|
4314
|
-
</xsl:
|
4315
|
-
</
|
4316
|
-
|
4577
|
+
</xsl:for-each>
|
4578
|
+
</xsl:variable>
|
4579
|
+
<xsl:choose>
|
4580
|
+
<xsl:when test="normalize-space($title) != ''">
|
4581
|
+
<xsl:value-of select="$title"/>
|
4582
|
+
</xsl:when>
|
4583
|
+
<xsl:otherwise>
|
4584
|
+
<xsl:text> </xsl:text>
|
4585
|
+
</xsl:otherwise>
|
4586
|
+
</xsl:choose>
|
4587
|
+
</dc:title>
|
4588
|
+
<dc:creator>
|
4589
|
+
<xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
|
4317
4590
|
|
4591
|
+
<xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
|
4592
|
+
<xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
|
4593
|
+
<xsl:if test="position() != last()">; </xsl:if>
|
4594
|
+
</xsl:for-each>
|
4318
4595
|
|
4319
4596
|
|
4320
|
-
|
4321
|
-
|
4322
|
-
|
4323
|
-
|
4324
|
-
|
4325
|
-
|
4326
|
-
|
4327
|
-
|
4328
|
-
|
4329
|
-
|
4330
|
-
|
4331
|
-
|
4332
|
-
|
4333
|
-
<
|
4334
|
-
|
4335
|
-
|
4336
|
-
|
4337
|
-
|
4338
|
-
|
4339
|
-
|
4340
|
-
|
4341
|
-
|
4342
|
-
</x:xmpmeta>
|
4343
|
-
</fo:declarations>
|
4597
|
+
|
4598
|
+
</xsl:for-each>
|
4599
|
+
</dc:creator>
|
4600
|
+
<dc:description>
|
4601
|
+
<xsl:variable name="abstract">
|
4602
|
+
|
4603
|
+
<xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
|
4604
|
+
|
4605
|
+
|
4606
|
+
</xsl:variable>
|
4607
|
+
<xsl:value-of select="normalize-space($abstract)"/>
|
4608
|
+
</dc:description>
|
4609
|
+
<pdf:Keywords>
|
4610
|
+
<xsl:call-template name="insertKeywords"/>
|
4611
|
+
</pdf:Keywords>
|
4612
|
+
</rdf:Description>
|
4613
|
+
<rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
|
4614
|
+
<!-- XMP properties go here -->
|
4615
|
+
<xmp:CreatorTool/>
|
4616
|
+
</rdf:Description>
|
4617
|
+
</rdf:RDF>
|
4618
|
+
</x:xmpmeta>
|
4344
4619
|
</xsl:template><xsl:template name="getId">
|
4345
4620
|
<xsl:choose>
|
4346
4621
|
<xsl:when test="../@id">
|