metanorma-ogc 1.3.4 → 1.3.8
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 +1 -1
- data/.rubocop.yml +1 -1
- data/Gemfile +2 -2
- data/Rakefile +2 -2
- data/lib/asciidoctor/ogc.rb +0 -1
- data/lib/asciidoctor/ogc/isodoc.rng +62 -8
- data/lib/isodoc/ogc.rb +0 -1
- data/lib/isodoc/ogc/metadata.rb +18 -13
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +583 -73
- data/lib/isodoc/ogc/ogc.best-practice.xsl +583 -73
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +583 -73
- data/lib/isodoc/ogc/ogc.community-practice.xsl +583 -73
- data/lib/isodoc/ogc/ogc.community-standard.xsl +583 -73
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +583 -73
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +583 -73
- data/lib/isodoc/ogc/ogc.other.xsl +583 -73
- data/lib/isodoc/ogc/ogc.policy.xsl +583 -73
- data/lib/isodoc/ogc/ogc.reference-model.xsl +583 -73
- data/lib/isodoc/ogc/ogc.release-notes.xsl +583 -73
- data/lib/isodoc/ogc/ogc.standard.xsl +583 -73
- data/lib/isodoc/ogc/ogc.test-suite.xsl +583 -73
- data/lib/isodoc/ogc/ogc.user-guide.xsl +583 -73
- data/lib/isodoc/ogc/ogc.white-paper.xsl +565 -55
- data/lib/isodoc/ogc/presentation_xml_convert.rb +1 -0
- data/lib/isodoc/ogc/reqt.rb +13 -6
- data/lib/isodoc/ogc/sections.rb +8 -6
- data/lib/isodoc/ogc/word_convert.rb +13 -12
- data/lib/isodoc/ogc/xref.rb +17 -10
- data/lib/metanorma/ogc.rb +3 -4
- data/lib/metanorma/ogc/version.rb +1 -1
- data/metanorma-ogc.gemspec +3 -3
- metadata +7 -7
@@ -7,8 +7,12 @@
|
|
7
7
|
<xsl:variable name="images" select="document($svg_images)"/>
|
8
8
|
<xsl:param name="basepath"/>
|
9
9
|
|
10
|
-
<xsl:variable name="pageWidth" select="
|
11
|
-
<xsl:variable name="pageHeight" select="
|
10
|
+
<xsl:variable name="pageWidth" select="215.9"/>
|
11
|
+
<xsl:variable name="pageHeight" select="279.4"/>
|
12
|
+
<xsl:variable name="marginLeftRight1" select="25.4"/>
|
13
|
+
<xsl:variable name="marginLeftRight2" select="25.4"/>
|
14
|
+
<xsl:variable name="marginTop" select="25.4"/>
|
15
|
+
<xsl:variable name="marginBottom" select="25.4"/>
|
12
16
|
|
13
17
|
|
14
18
|
|
@@ -97,12 +101,12 @@
|
|
97
101
|
<fo:layout-master-set>
|
98
102
|
|
99
103
|
<!-- Document pages -->
|
100
|
-
<fo:simple-page-master master-name="document" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
101
|
-
<fo:region-body margin-top="
|
102
|
-
<fo:region-before region-name="header" extent="
|
103
|
-
<fo:region-after region-name="footer" extent="
|
104
|
-
<fo:region-start region-name="left" extent="
|
105
|
-
<fo:region-end region-name="right" extent="
|
104
|
+
<fo:simple-page-master master-name="document" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
105
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
106
|
+
<fo:region-before region-name="header" extent="{$marginTop}mm" precedence="true"/>
|
107
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm" precedence="true"/>
|
108
|
+
<fo:region-start region-name="left" extent="{$marginLeftRight1}mm"/>
|
109
|
+
<fo:region-end region-name="right" extent="{$marginLeftRight2}mm"/>
|
106
110
|
</fo:simple-page-master>
|
107
111
|
|
108
112
|
</fo:layout-master-set>
|
@@ -1153,7 +1157,7 @@
|
|
1153
1157
|
|
1154
1158
|
|
1155
1159
|
|
1156
|
-
|
1160
|
+
|
1157
1161
|
</xsl:attribute-set><xsl:attribute-set name="example-style">
|
1158
1162
|
|
1159
1163
|
|
@@ -1223,7 +1227,10 @@
|
|
1223
1227
|
|
1224
1228
|
|
1225
1229
|
|
1226
|
-
|
1230
|
+
|
1231
|
+
</xsl:attribute-set><xsl:variable name="table-border_">
|
1232
|
+
|
1233
|
+
</xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
|
1227
1234
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1228
1235
|
|
1229
1236
|
|
@@ -1248,6 +1255,8 @@
|
|
1248
1255
|
|
1249
1256
|
|
1250
1257
|
|
1258
|
+
</xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
|
1259
|
+
|
1251
1260
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
1252
1261
|
|
1253
1262
|
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
@@ -1277,6 +1286,7 @@
|
|
1277
1286
|
</xsl:attribute-set><xsl:attribute-set name="eref-style">
|
1278
1287
|
|
1279
1288
|
|
1289
|
+
|
1280
1290
|
<xsl:attribute name="color">blue</xsl:attribute>
|
1281
1291
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1282
1292
|
|
@@ -1304,6 +1314,7 @@
|
|
1304
1314
|
|
1305
1315
|
|
1306
1316
|
|
1317
|
+
|
1307
1318
|
</xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
|
1308
1319
|
|
1309
1320
|
|
@@ -1347,10 +1358,12 @@
|
|
1347
1358
|
|
1348
1359
|
|
1349
1360
|
|
1361
|
+
|
1350
1362
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
1351
1363
|
|
1352
1364
|
|
1353
1365
|
|
1366
|
+
|
1354
1367
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
1355
1368
|
|
1356
1369
|
<xsl:attribute name="margin-top">12pt</xsl:attribute>
|
@@ -1416,6 +1429,7 @@
|
|
1416
1429
|
|
1417
1430
|
|
1418
1431
|
|
1432
|
+
|
1419
1433
|
|
1420
1434
|
|
1421
1435
|
|
@@ -1494,6 +1508,8 @@
|
|
1494
1508
|
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
1495
1509
|
|
1496
1510
|
|
1511
|
+
</xsl:attribute-set><xsl:attribute-set name="list-style">
|
1512
|
+
|
1497
1513
|
</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:template name="processPrefaceSectionsDefault_Contents">
|
1498
1514
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1499
1515
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -1504,14 +1520,15 @@
|
|
1504
1520
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
1505
1521
|
|
1506
1522
|
<!-- Normative references -->
|
1507
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
1523
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
|
1508
1524
|
<!-- Terms and definitions -->
|
1509
1525
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
|
1510
1526
|
<!-- Another main sections -->
|
1511
1527
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
|
1512
1528
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
1513
1529
|
<!-- Bibliography -->
|
1514
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
1530
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
1531
|
+
|
1515
1532
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
1516
1533
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
1517
1534
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -1547,13 +1564,15 @@
|
|
1547
1564
|
<xsl:variable name="table">
|
1548
1565
|
|
1549
1566
|
<xsl:variable name="simple-table">
|
1550
|
-
<xsl:call-template name="getSimpleTable"/>
|
1567
|
+
<xsl:call-template name="getSimpleTable"/>
|
1551
1568
|
</xsl:variable>
|
1552
1569
|
|
1553
1570
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
1554
|
-
<fo:block> </fo:block>
|
1571
|
+
<fo:block> </fo:block>
|
1555
1572
|
</xsl:if> -->
|
1556
1573
|
|
1574
|
+
|
1575
|
+
<!-- Display table's name before table as standalone block -->
|
1557
1576
|
<!-- $namespace = 'iso' or -->
|
1558
1577
|
|
1559
1578
|
|
@@ -1633,6 +1652,12 @@
|
|
1633
1652
|
|
1634
1653
|
|
1635
1654
|
|
1655
|
+
|
1656
|
+
|
1657
|
+
|
1658
|
+
<!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
|
1659
|
+
|
1660
|
+
|
1636
1661
|
<xsl:variable name="table_width">
|
1637
1662
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1638
1663
|
|
@@ -1657,6 +1682,7 @@
|
|
1657
1682
|
|
1658
1683
|
|
1659
1684
|
|
1685
|
+
|
1660
1686
|
<attribute name="margin-left">0mm</attribute>
|
1661
1687
|
<attribute name="margin-right">0mm</attribute>
|
1662
1688
|
|
@@ -1665,6 +1691,7 @@
|
|
1665
1691
|
|
1666
1692
|
|
1667
1693
|
|
1694
|
+
|
1668
1695
|
</xsl:variable>
|
1669
1696
|
|
1670
1697
|
|
@@ -1805,6 +1832,9 @@
|
|
1805
1832
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
1806
1833
|
|
1807
1834
|
|
1835
|
+
|
1836
|
+
|
1837
|
+
|
1808
1838
|
<xsl:choose>
|
1809
1839
|
<xsl:when test="$continued = 'true'">
|
1810
1840
|
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
@@ -1952,6 +1982,7 @@
|
|
1952
1982
|
<!-- font-weight="bold" -->
|
1953
1983
|
<fo:table-header>
|
1954
1984
|
|
1985
|
+
|
1955
1986
|
<xsl:apply-templates/>
|
1956
1987
|
</fo:table-header>
|
1957
1988
|
</xsl:template><xsl:template name="table-header-title">
|
@@ -2076,6 +2107,8 @@
|
|
2076
2107
|
</xsl:choose>
|
2077
2108
|
</xsl:for-each>
|
2078
2109
|
|
2110
|
+
|
2111
|
+
|
2079
2112
|
<xsl:choose>
|
2080
2113
|
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2081
2114
|
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
@@ -2102,6 +2135,7 @@
|
|
2102
2135
|
|
2103
2136
|
|
2104
2137
|
|
2138
|
+
|
2105
2139
|
<!-- fn will be processed inside 'note' processing -->
|
2106
2140
|
|
2107
2141
|
|
@@ -2110,6 +2144,11 @@
|
|
2110
2144
|
|
2111
2145
|
|
2112
2146
|
|
2147
|
+
|
2148
|
+
|
2149
|
+
<!-- for BSI (not PAS) display Notes before footnotes -->
|
2150
|
+
|
2151
|
+
|
2113
2152
|
<!-- except gb -->
|
2114
2153
|
|
2115
2154
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
@@ -2135,6 +2174,10 @@
|
|
2135
2174
|
<!-- fn processing -->
|
2136
2175
|
<xsl:call-template name="fn_display"/>
|
2137
2176
|
|
2177
|
+
|
2178
|
+
<!-- for PAS display Notes after footnotes -->
|
2179
|
+
|
2180
|
+
|
2138
2181
|
</fo:table-cell>
|
2139
2182
|
</fo:table-row>
|
2140
2183
|
</fo:table-body>
|
@@ -2188,15 +2231,24 @@
|
|
2188
2231
|
|
2189
2232
|
|
2190
2233
|
|
2234
|
+
|
2235
|
+
|
2191
2236
|
</xsl:if>
|
2192
2237
|
<xsl:if test="$parent-name = 'tfoot'">
|
2193
2238
|
|
2194
2239
|
|
2240
|
+
|
2195
2241
|
</xsl:if>
|
2196
2242
|
|
2197
2243
|
|
2198
2244
|
|
2199
2245
|
|
2246
|
+
|
2247
|
+
|
2248
|
+
|
2249
|
+
|
2250
|
+
|
2251
|
+
|
2200
2252
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2201
2253
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
2202
2254
|
</xsl:if> -->
|
@@ -2284,6 +2336,7 @@
|
|
2284
2336
|
|
2285
2337
|
|
2286
2338
|
|
2339
|
+
|
2287
2340
|
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
2288
2341
|
<xsl:attribute name="border">solid 0.5pt rgb(153, 153, 153)</xsl:attribute>
|
2289
2342
|
<xsl:attribute name="height">5mm</xsl:attribute>
|
@@ -2292,6 +2345,9 @@
|
|
2292
2345
|
|
2293
2346
|
|
2294
2347
|
|
2348
|
+
|
2349
|
+
|
2350
|
+
|
2295
2351
|
<xsl:if test=".//*[local-name() = 'table']">
|
2296
2352
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2297
2353
|
</xsl:if>
|
@@ -2321,8 +2377,14 @@
|
|
2321
2377
|
|
2322
2378
|
|
2323
2379
|
|
2380
|
+
|
2381
|
+
|
2382
|
+
<!-- Table's note name (NOTE, for example) -->
|
2383
|
+
|
2324
2384
|
<fo:inline padding-right="2mm">
|
2325
2385
|
|
2386
|
+
|
2387
|
+
|
2326
2388
|
|
2327
2389
|
|
2328
2390
|
|
@@ -2330,6 +2392,8 @@
|
|
2330
2392
|
|
2331
2393
|
</fo:inline>
|
2332
2394
|
|
2395
|
+
|
2396
|
+
|
2333
2397
|
<xsl:apply-templates mode="process"/>
|
2334
2398
|
</fo:block>
|
2335
2399
|
|
@@ -2355,6 +2419,8 @@
|
|
2355
2419
|
<xsl:variable name="reference" select="@reference"/>
|
2356
2420
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
2357
2421
|
<fo:block margin-bottom="12pt">
|
2422
|
+
|
2423
|
+
|
2358
2424
|
|
2359
2425
|
|
2360
2426
|
|
@@ -2370,9 +2436,11 @@
|
|
2370
2436
|
|
2371
2437
|
|
2372
2438
|
|
2439
|
+
|
2373
2440
|
<xsl:value-of select="@reference"/>
|
2374
2441
|
|
2375
2442
|
|
2443
|
+
|
2376
2444
|
</fo:inline>
|
2377
2445
|
<fo:inline>
|
2378
2446
|
|
@@ -2511,6 +2579,9 @@
|
|
2511
2579
|
|
2512
2580
|
|
2513
2581
|
|
2582
|
+
|
2583
|
+
|
2584
|
+
|
2514
2585
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
2515
2586
|
<xsl:attribute name="color">blue</xsl:attribute>
|
2516
2587
|
|
@@ -2518,6 +2589,7 @@
|
|
2518
2589
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
2519
2590
|
|
2520
2591
|
|
2592
|
+
|
2521
2593
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
2522
2594
|
|
2523
2595
|
<xsl:attribute name="internal-destination">
|
@@ -2528,6 +2600,7 @@
|
|
2528
2600
|
|
2529
2601
|
<xsl:value-of select="@reference"/>
|
2530
2602
|
|
2603
|
+
|
2531
2604
|
</fo:basic-link>
|
2532
2605
|
</fo:inline>
|
2533
2606
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -2825,6 +2898,7 @@
|
|
2825
2898
|
|
2826
2899
|
<fo:table-row>
|
2827
2900
|
|
2901
|
+
|
2828
2902
|
<fo:table-cell>
|
2829
2903
|
|
2830
2904
|
<fo:block margin-top="6pt">
|
@@ -2843,6 +2917,7 @@
|
|
2843
2917
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
2844
2918
|
|
2845
2919
|
|
2920
|
+
|
2846
2921
|
<xsl:apply-templates/>
|
2847
2922
|
<!-- <xsl:if test="$namespace = 'gb'">
|
2848
2923
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -3390,7 +3465,15 @@
|
|
3390
3465
|
<xsl:copy>
|
3391
3466
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3392
3467
|
</xsl:copy>
|
3393
|
-
<
|
3468
|
+
<xsl:choose>
|
3469
|
+
<!-- if in msub, then don't add space -->
|
3470
|
+
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
3471
|
+
<!-- if next char in digit, don't add space -->
|
3472
|
+
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
3473
|
+
<xsl:otherwise>
|
3474
|
+
<mathml:mspace width="0.5ex"/>
|
3475
|
+
</xsl:otherwise>
|
3476
|
+
</xsl:choose>
|
3394
3477
|
</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">
|
3395
3478
|
<xsl:variable name="target">
|
3396
3479
|
<xsl:choose>
|
@@ -3414,6 +3497,8 @@
|
|
3414
3497
|
</xsl:variable>
|
3415
3498
|
<fo:inline xsl:use-attribute-sets="link-style">
|
3416
3499
|
|
3500
|
+
|
3501
|
+
|
3417
3502
|
<xsl:choose>
|
3418
3503
|
<xsl:when test="$target_text = ''">
|
3419
3504
|
<xsl:apply-templates/>
|
@@ -3526,6 +3611,7 @@
|
|
3526
3611
|
|
3527
3612
|
|
3528
3613
|
|
3614
|
+
|
3529
3615
|
<fo:block-container margin-left="0mm">
|
3530
3616
|
|
3531
3617
|
|
@@ -3569,6 +3655,7 @@
|
|
3569
3655
|
</xsl:choose>
|
3570
3656
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
3571
3657
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
3658
|
+
|
3572
3659
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
3573
3660
|
|
3574
3661
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
@@ -3644,6 +3731,7 @@
|
|
3644
3731
|
</xsl:call-template>
|
3645
3732
|
|
3646
3733
|
<fo:block>
|
3734
|
+
|
3647
3735
|
<xsl:apply-templates/>
|
3648
3736
|
</fo:block>
|
3649
3737
|
<xsl:call-template name="fn_display_figure"/>
|
@@ -3698,7 +3786,24 @@
|
|
3698
3786
|
</fo:instream-foreign-object>
|
3699
3787
|
</xsl:when>
|
3700
3788
|
<xsl:otherwise>
|
3701
|
-
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"
|
3789
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
3790
|
+
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
3791
|
+
|
3792
|
+
<xsl:variable name="img_src">
|
3793
|
+
<xsl:choose>
|
3794
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
3795
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
3796
|
+
</xsl:choose>
|
3797
|
+
</xsl:variable>
|
3798
|
+
|
3799
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
3800
|
+
<xsl:if test="number($scale) < 100">
|
3801
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
3802
|
+
</xsl:if>
|
3803
|
+
|
3804
|
+
</xsl:if>
|
3805
|
+
|
3806
|
+
</fo:external-graphic>
|
3702
3807
|
</xsl:otherwise>
|
3703
3808
|
</xsl:choose>
|
3704
3809
|
|
@@ -3766,6 +3871,253 @@
|
|
3766
3871
|
<xsl:param name="height"/>
|
3767
3872
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
3768
3873
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
3874
|
+
</xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
|
3875
|
+
<xsl:param name="name"/>
|
3876
|
+
|
3877
|
+
<xsl:variable name="svg_content">
|
3878
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
3879
|
+
</xsl:variable>
|
3880
|
+
|
3881
|
+
<xsl:variable name="alt-text">
|
3882
|
+
<xsl:choose>
|
3883
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
3884
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
3885
|
+
</xsl:when>
|
3886
|
+
<xsl:when test="normalize-space($name) != ''">
|
3887
|
+
<xsl:value-of select="$name"/>
|
3888
|
+
</xsl:when>
|
3889
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
3890
|
+
</xsl:choose>
|
3891
|
+
</xsl:variable>
|
3892
|
+
|
3893
|
+
<xsl:choose>
|
3894
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
3895
|
+
<fo:block>
|
3896
|
+
<xsl:variable name="width" select="@width"/>
|
3897
|
+
<xsl:variable name="height" select="@height"/>
|
3898
|
+
|
3899
|
+
<xsl:variable name="scale_x">
|
3900
|
+
<xsl:choose>
|
3901
|
+
<xsl:when test="$width > $width_effective_px">
|
3902
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
3903
|
+
</xsl:when>
|
3904
|
+
<xsl:otherwise>1</xsl:otherwise>
|
3905
|
+
</xsl:choose>
|
3906
|
+
</xsl:variable>
|
3907
|
+
|
3908
|
+
<xsl:variable name="scale_y">
|
3909
|
+
<xsl:choose>
|
3910
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
3911
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
3912
|
+
</xsl:when>
|
3913
|
+
<xsl:otherwise>1</xsl:otherwise>
|
3914
|
+
</xsl:choose>
|
3915
|
+
</xsl:variable>
|
3916
|
+
|
3917
|
+
<xsl:variable name="scale">
|
3918
|
+
<xsl:choose>
|
3919
|
+
<xsl:when test="$scale_y != 1">
|
3920
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
3921
|
+
</xsl:when>
|
3922
|
+
<xsl:otherwise>
|
3923
|
+
<xsl:value-of select="$scale_x"/>
|
3924
|
+
</xsl:otherwise>
|
3925
|
+
</xsl:choose>
|
3926
|
+
</xsl:variable>
|
3927
|
+
|
3928
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
3929
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
3930
|
+
|
3931
|
+
<fo:table table-layout="fixed" width="100%">
|
3932
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
3933
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
3934
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
3935
|
+
<fo:table-body>
|
3936
|
+
<fo:table-row>
|
3937
|
+
<fo:table-cell column-number="2">
|
3938
|
+
<fo:block>
|
3939
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
3940
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
3941
|
+
<fo:block line-height="0" font-size="0">
|
3942
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
3943
|
+
<xsl:call-template name="bookmark"/>
|
3944
|
+
</xsl:for-each>
|
3945
|
+
</fo:block>
|
3946
|
+
</xsl:if>
|
3947
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
3948
|
+
|
3949
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
3950
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3951
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3952
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3953
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3954
|
+
|
3955
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
3956
|
+
</fo:instream-foreign-object>
|
3957
|
+
</fo:block>
|
3958
|
+
|
3959
|
+
<xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
|
3960
|
+
<xsl:with-param name="scale" select="$scale"/>
|
3961
|
+
</xsl:apply-templates>
|
3962
|
+
</fo:block-container>
|
3963
|
+
</fo:block>
|
3964
|
+
</fo:table-cell>
|
3965
|
+
</fo:table-row>
|
3966
|
+
</fo:table-body>
|
3967
|
+
</fo:table>
|
3968
|
+
</fo:block>
|
3969
|
+
|
3970
|
+
</xsl:when>
|
3971
|
+
<xsl:otherwise>
|
3972
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
3973
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
3974
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3975
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3976
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3977
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
3978
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
3979
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
3980
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
3981
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
3982
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
3983
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
3984
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
3985
|
+
</xsl:if>
|
3986
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3987
|
+
<xsl:copy-of select="$svg_content"/>
|
3988
|
+
</fo:instream-foreign-object>
|
3989
|
+
</fo:block>
|
3990
|
+
</xsl:otherwise>
|
3991
|
+
</xsl:choose>
|
3992
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
3993
|
+
<xsl:copy>
|
3994
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
3995
|
+
</xsl:copy>
|
3996
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
3997
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
3998
|
+
<xsl:value-of select="."/>
|
3999
|
+
</xsl:attribute>
|
4000
|
+
</xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
|
4001
|
+
<xsl:copy>
|
4002
|
+
<xsl:apply-templates select="@*" mode="svg_update"/>
|
4003
|
+
<xsl:variable name="viewbox">
|
4004
|
+
<xsl:call-template name="split">
|
4005
|
+
<xsl:with-param name="pText" select="@viewBox"/>
|
4006
|
+
<xsl:with-param name="sep" select="' '"/>
|
4007
|
+
</xsl:call-template>
|
4008
|
+
</xsl:variable>
|
4009
|
+
<xsl:attribute name="width">
|
4010
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
|
4011
|
+
</xsl:attribute>
|
4012
|
+
<xsl:attribute name="height">
|
4013
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
|
4014
|
+
</xsl:attribute>
|
4015
|
+
<xsl:apply-templates mode="svg_update"/>
|
4016
|
+
</xsl:copy>
|
4017
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
4018
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
4019
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
4020
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
4021
|
+
<xsl:call-template name="image_svg">
|
4022
|
+
<xsl:with-param name="name" select="$name"/>
|
4023
|
+
</xsl:call-template>
|
4024
|
+
</xsl:for-each>
|
4025
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
4026
|
+
<xsl:copy>
|
4027
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
4028
|
+
</xsl:copy>
|
4029
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
4030
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
4031
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
4032
|
+
<xsl:param name="scale"/>
|
4033
|
+
<xsl:variable name="dest">
|
4034
|
+
<xsl:choose>
|
4035
|
+
<xsl:when test="starts-with(@href, '#')">
|
4036
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
4037
|
+
</xsl:when>
|
4038
|
+
<xsl:otherwise>
|
4039
|
+
<xsl:value-of select="@href"/>
|
4040
|
+
</xsl:otherwise>
|
4041
|
+
</xsl:choose>
|
4042
|
+
</xsl:variable>
|
4043
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
4044
|
+
<xsl:call-template name="insertSVGMapLink">
|
4045
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
4046
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
4047
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
4048
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
4049
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4050
|
+
</xsl:call-template>
|
4051
|
+
</xsl:for-each>
|
4052
|
+
|
4053
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
4054
|
+
<xsl:variable name="points">
|
4055
|
+
<xsl:call-template name="split">
|
4056
|
+
<xsl:with-param name="pText" select="@points"/>
|
4057
|
+
</xsl:call-template>
|
4058
|
+
</xsl:variable>
|
4059
|
+
<xsl:variable name="x_coords">
|
4060
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
4061
|
+
<xsl:sort select="." data-type="number"/>
|
4062
|
+
<x><xsl:value-of select="."/></x>
|
4063
|
+
</xsl:for-each>
|
4064
|
+
</xsl:variable>
|
4065
|
+
<xsl:variable name="y_coords">
|
4066
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
4067
|
+
<xsl:sort select="." data-type="number"/>
|
4068
|
+
<y><xsl:value-of select="."/></y>
|
4069
|
+
</xsl:for-each>
|
4070
|
+
</xsl:variable>
|
4071
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
4072
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
4073
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
4074
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
4075
|
+
<xsl:call-template name="insertSVGMapLink">
|
4076
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
4077
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
4078
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
4079
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
4080
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4081
|
+
</xsl:call-template>
|
4082
|
+
</xsl:for-each>
|
4083
|
+
|
4084
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
4085
|
+
<xsl:call-template name="insertSVGMapLink">
|
4086
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
4087
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
4088
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
4089
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
4090
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4091
|
+
</xsl:call-template>
|
4092
|
+
</xsl:for-each>
|
4093
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
4094
|
+
<xsl:call-template name="insertSVGMapLink">
|
4095
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
4096
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
4097
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
4098
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
4099
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4100
|
+
</xsl:call-template>
|
4101
|
+
</xsl:for-each>
|
4102
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
4103
|
+
<xsl:param name="left"/>
|
4104
|
+
<xsl:param name="top"/>
|
4105
|
+
<xsl:param name="width"/>
|
4106
|
+
<xsl:param name="height"/>
|
4107
|
+
<xsl:param name="dest"/>
|
4108
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
4109
|
+
<fo:block font-size="1pt">
|
4110
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
4111
|
+
<fo:inline-container inline-progression-dimension="100%">
|
4112
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
4113
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
4114
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
4115
|
+
</xsl:if> -->
|
4116
|
+
<fo:block> </fo:block></fo:block-container>
|
4117
|
+
</fo:inline-container>
|
4118
|
+
</fo:basic-link>
|
4119
|
+
</fo:block>
|
4120
|
+
</fo:block-container>
|
3769
4121
|
</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">
|
3770
4122
|
<xsl:apply-templates mode="contents"/>
|
3771
4123
|
<xsl:text> </xsl:text>
|
@@ -3794,28 +4146,39 @@
|
|
3794
4146
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
3795
4147
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3796
4148
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
4149
|
+
<xsl:if test="@bundle = 'true'">
|
4150
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
4151
|
+
</xsl:if>
|
3797
4152
|
<fo:bookmark-title>
|
3798
|
-
<xsl:variable name="bookmark-title_">
|
3799
|
-
<xsl:call-template name="getLangVersion">
|
3800
|
-
<xsl:with-param name="lang" select="@lang"/>
|
3801
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
3802
|
-
<xsl:with-param name="title" select="@title-part"/>
|
3803
|
-
</xsl:call-template>
|
3804
|
-
</xsl:variable>
|
3805
4153
|
<xsl:choose>
|
3806
|
-
<xsl:when test="normalize-space(
|
3807
|
-
<xsl:
|
3808
|
-
|
3809
|
-
|
4154
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
4155
|
+
<xsl:variable name="bookmark-title_">
|
4156
|
+
<xsl:call-template name="getLangVersion">
|
4157
|
+
<xsl:with-param name="lang" select="@lang"/>
|
4158
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
4159
|
+
<xsl:with-param name="title" select="@title-part"/>
|
4160
|
+
</xsl:call-template>
|
4161
|
+
</xsl:variable>
|
3810
4162
|
<xsl:choose>
|
3811
|
-
<xsl:when test="
|
3812
|
-
|
3813
|
-
|
3814
|
-
<xsl:otherwise
|
4163
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
4164
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
4165
|
+
</xsl:when>
|
4166
|
+
<xsl:otherwise>
|
4167
|
+
<xsl:choose>
|
4168
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
4169
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
4170
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
4171
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
4172
|
+
</xsl:choose>
|
4173
|
+
</xsl:otherwise>
|
3815
4174
|
</xsl:choose>
|
4175
|
+
</xsl:when>
|
4176
|
+
<xsl:otherwise>
|
4177
|
+
<xsl:value-of select="@title-part"/>
|
3816
4178
|
</xsl:otherwise>
|
3817
4179
|
</xsl:choose>
|
3818
4180
|
</fo:bookmark-title>
|
4181
|
+
|
3819
4182
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3820
4183
|
|
3821
4184
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -3925,20 +4288,28 @@
|
|
3925
4288
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
3926
4289
|
</xsl:choose>
|
3927
4290
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
3928
|
-
<
|
3929
|
-
|
3930
|
-
|
3931
|
-
|
3932
|
-
<xsl:
|
3933
|
-
|
3934
|
-
|
3935
|
-
|
3936
|
-
|
3937
|
-
|
4291
|
+
<xsl:choose>
|
4292
|
+
<xsl:when test="@id != ''">
|
4293
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
4294
|
+
<fo:bookmark-title>
|
4295
|
+
<xsl:if test="@section != ''">
|
4296
|
+
<xsl:value-of select="@section"/>
|
4297
|
+
<xsl:text> </xsl:text>
|
4298
|
+
</xsl:if>
|
4299
|
+
<xsl:value-of select="normalize-space(title)"/>
|
4300
|
+
</fo:bookmark-title>
|
4301
|
+
<xsl:apply-templates mode="bookmark"/>
|
4302
|
+
</fo:bookmark>
|
4303
|
+
</xsl:when>
|
4304
|
+
<xsl:otherwise>
|
4305
|
+
<xsl:apply-templates mode="bookmark"/>
|
4306
|
+
</xsl:otherwise>
|
4307
|
+
</xsl:choose>
|
3938
4308
|
</xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
|
3939
4309
|
<xsl:if test="normalize-space() != ''">
|
3940
4310
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
3941
4311
|
|
4312
|
+
|
3942
4313
|
<xsl:apply-templates/>
|
3943
4314
|
</fo:block>
|
3944
4315
|
</xsl:if>
|
@@ -4019,6 +4390,7 @@
|
|
4019
4390
|
|
4020
4391
|
<fo:block-container margin-left="0mm">
|
4021
4392
|
<xsl:copy-of select="@id"/>
|
4393
|
+
|
4022
4394
|
<xsl:if test="parent::*[local-name() = 'note']">
|
4023
4395
|
<xsl:attribute name="margin-left">
|
4024
4396
|
<xsl:choose>
|
@@ -4029,7 +4401,9 @@
|
|
4029
4401
|
|
4030
4402
|
</xsl:if>
|
4031
4403
|
<fo:block-container margin-left="0mm">
|
4032
|
-
|
4404
|
+
|
4405
|
+
|
4406
|
+
|
4033
4407
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
4034
4408
|
<xsl:variable name="_font-size">
|
4035
4409
|
|
@@ -4058,10 +4432,14 @@
|
|
4058
4432
|
</xsl:choose>
|
4059
4433
|
</xsl:attribute>
|
4060
4434
|
</xsl:if>
|
4061
|
-
|
4062
|
-
|
4435
|
+
|
4436
|
+
<xsl:apply-templates/>
|
4437
|
+
</fo:block>
|
4438
|
+
|
4439
|
+
|
4063
4440
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
4064
4441
|
|
4442
|
+
|
4065
4443
|
</fo:block-container>
|
4066
4444
|
</fo:block-container>
|
4067
4445
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -4415,6 +4793,8 @@
|
|
4415
4793
|
|
4416
4794
|
|
4417
4795
|
|
4796
|
+
|
4797
|
+
|
4418
4798
|
<xsl:call-template name="getTitle">
|
4419
4799
|
<xsl:with-param name="name" select="'title-source'"/>
|
4420
4800
|
</xsl:call-template>
|
@@ -4491,7 +4871,9 @@
|
|
4491
4871
|
|
4492
4872
|
|
4493
4873
|
</xsl:if>
|
4494
|
-
|
4874
|
+
|
4875
|
+
|
4876
|
+
|
4495
4877
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4496
4878
|
<xsl:if test="normalize-space(@citeas) = ''">
|
4497
4879
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
@@ -4503,6 +4885,7 @@
|
|
4503
4885
|
|
4504
4886
|
|
4505
4887
|
|
4888
|
+
|
4506
4889
|
</xsl:if>
|
4507
4890
|
|
4508
4891
|
<xsl:apply-templates/>
|
@@ -4652,6 +5035,7 @@
|
|
4652
5035
|
<xsl:call-template name="setId"/>
|
4653
5036
|
|
4654
5037
|
|
5038
|
+
|
4655
5039
|
<xsl:apply-templates/>
|
4656
5040
|
</fo:block>
|
4657
5041
|
</xsl:template><xsl:template match="*[local-name() = 'definitions']">
|
@@ -5038,17 +5422,17 @@
|
|
5038
5422
|
<xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
|
5039
5423
|
<xsl:choose>
|
5040
5424
|
<xsl:when test="normalize-space($_doc_ident) != ''">
|
5041
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
|
5425
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
|
5042
5426
|
<xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
|
5043
5427
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
5044
|
-
</xsl:if>
|
5428
|
+
</xsl:if> -->
|
5045
5429
|
<xsl:value-of select="$_doc_ident"/>
|
5046
5430
|
</xsl:when>
|
5047
5431
|
<xsl:otherwise>
|
5048
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
5432
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
5049
5433
|
<xsl:if test="$type != ''">
|
5050
5434
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
5051
|
-
</xsl:if>
|
5435
|
+
</xsl:if> -->
|
5052
5436
|
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
|
5053
5437
|
</xsl:otherwise>
|
5054
5438
|
</xsl:choose>
|
@@ -5489,20 +5873,40 @@
|
|
5489
5873
|
</xsl:call-template>
|
5490
5874
|
</xsl:if>
|
5491
5875
|
</xsl:template><xsl:template name="getLocalizedString">
|
5492
|
-
<xsl:param name="key"/>
|
5876
|
+
<xsl:param name="key"/>
|
5877
|
+
<xsl:param name="formatted">false</xsl:param>
|
5493
5878
|
|
5494
5879
|
<xsl:variable name="curr_lang">
|
5495
5880
|
<xsl:call-template name="getLang"/>
|
5496
5881
|
</xsl:variable>
|
5497
5882
|
|
5498
|
-
<xsl:variable name="data_value"
|
5883
|
+
<xsl:variable name="data_value">
|
5884
|
+
<xsl:choose>
|
5885
|
+
<xsl:when test="$formatted = 'true'">
|
5886
|
+
<xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5887
|
+
</xsl:when>
|
5888
|
+
<xsl:otherwise>
|
5889
|
+
<xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
5890
|
+
</xsl:otherwise>
|
5891
|
+
</xsl:choose>
|
5892
|
+
</xsl:variable>
|
5499
5893
|
|
5500
5894
|
<xsl:choose>
|
5501
|
-
<xsl:when test="$data_value != ''">
|
5502
|
-
<xsl:
|
5895
|
+
<xsl:when test="normalize-space($data_value) != ''">
|
5896
|
+
<xsl:choose>
|
5897
|
+
<xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
|
5898
|
+
<xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
|
5899
|
+
</xsl:choose>
|
5503
5900
|
</xsl:when>
|
5504
5901
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
5505
|
-
<xsl:
|
5902
|
+
<xsl:choose>
|
5903
|
+
<xsl:when test="$formatted = 'true'">
|
5904
|
+
<xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5905
|
+
</xsl:when>
|
5906
|
+
<xsl:otherwise>
|
5907
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5908
|
+
</xsl:otherwise>
|
5909
|
+
</xsl:choose>
|
5506
5910
|
</xsl:when>
|
5507
5911
|
<xsl:otherwise>
|
5508
5912
|
<xsl:variable name="key_">
|
@@ -5513,7 +5917,7 @@
|
|
5513
5917
|
<xsl:value-of select="$key_"/>
|
5514
5918
|
</xsl:otherwise>
|
5515
5919
|
</xsl:choose>
|
5516
|
-
|
5920
|
+
|
5517
5921
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
5518
5922
|
<xsl:param name="isAdded"/>
|
5519
5923
|
<xsl:param name="isDeleted"/>
|
@@ -5554,4 +5958,110 @@
|
|
5554
5958
|
<xsl:value-of select="$align"/>
|
5555
5959
|
</xsl:when>
|
5556
5960
|
</xsl:choose>
|
5961
|
+
</xsl:template><xsl:template name="setTextAlignment">
|
5962
|
+
<xsl:param name="default">left</xsl:param>
|
5963
|
+
<xsl:attribute name="text-align">
|
5964
|
+
<xsl:choose>
|
5965
|
+
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
5966
|
+
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
5967
|
+
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
5968
|
+
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
5969
|
+
</xsl:choose>
|
5970
|
+
</xsl:attribute>
|
5971
|
+
</xsl:template><xsl:template name="number-to-words">
|
5972
|
+
<xsl:param name="number"/>
|
5973
|
+
<xsl:param name="first"/>
|
5974
|
+
<xsl:if test="$number != ''">
|
5975
|
+
<xsl:variable name="words">
|
5976
|
+
<words>
|
5977
|
+
<word cardinal="1">One-</word>
|
5978
|
+
<word ordinal="1">First </word>
|
5979
|
+
<word cardinal="2">Two-</word>
|
5980
|
+
<word ordinal="2">Second </word>
|
5981
|
+
<word cardinal="3">Three-</word>
|
5982
|
+
<word ordinal="3">Third </word>
|
5983
|
+
<word cardinal="4">Four-</word>
|
5984
|
+
<word ordinal="4">Fourth </word>
|
5985
|
+
<word cardinal="5">Five-</word>
|
5986
|
+
<word ordinal="5">Fifth </word>
|
5987
|
+
<word cardinal="6">Six-</word>
|
5988
|
+
<word ordinal="6">Sixth </word>
|
5989
|
+
<word cardinal="7">Seven-</word>
|
5990
|
+
<word ordinal="7">Seventh </word>
|
5991
|
+
<word cardinal="8">Eight-</word>
|
5992
|
+
<word ordinal="8">Eighth </word>
|
5993
|
+
<word cardinal="9">Nine-</word>
|
5994
|
+
<word ordinal="9">Ninth </word>
|
5995
|
+
<word ordinal="10">Tenth </word>
|
5996
|
+
<word ordinal="11">Eleventh </word>
|
5997
|
+
<word ordinal="12">Twelfth </word>
|
5998
|
+
<word ordinal="13">Thirteenth </word>
|
5999
|
+
<word ordinal="14">Fourteenth </word>
|
6000
|
+
<word ordinal="15">Fifteenth </word>
|
6001
|
+
<word ordinal="16">Sixteenth </word>
|
6002
|
+
<word ordinal="17">Seventeenth </word>
|
6003
|
+
<word ordinal="18">Eighteenth </word>
|
6004
|
+
<word ordinal="19">Nineteenth </word>
|
6005
|
+
<word cardinal="20">Twenty-</word>
|
6006
|
+
<word ordinal="20">Twentieth </word>
|
6007
|
+
<word cardinal="30">Thirty-</word>
|
6008
|
+
<word ordinal="30">Thirtieth </word>
|
6009
|
+
<word cardinal="40">Forty-</word>
|
6010
|
+
<word ordinal="40">Fortieth </word>
|
6011
|
+
<word cardinal="50">Fifty-</word>
|
6012
|
+
<word ordinal="50">Fiftieth </word>
|
6013
|
+
<word cardinal="60">Sixty-</word>
|
6014
|
+
<word ordinal="60">Sixtieth </word>
|
6015
|
+
<word cardinal="70">Seventy-</word>
|
6016
|
+
<word ordinal="70">Seventieth </word>
|
6017
|
+
<word cardinal="80">Eighty-</word>
|
6018
|
+
<word ordinal="80">Eightieth </word>
|
6019
|
+
<word cardinal="90">Ninety-</word>
|
6020
|
+
<word ordinal="90">Ninetieth </word>
|
6021
|
+
<word cardinal="100">Hundred-</word>
|
6022
|
+
<word ordinal="100">Hundredth </word>
|
6023
|
+
</words>
|
6024
|
+
</xsl:variable>
|
6025
|
+
|
6026
|
+
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
6027
|
+
|
6028
|
+
<xsl:variable name="value">
|
6029
|
+
<xsl:choose>
|
6030
|
+
<xsl:when test="$ordinal != ''">
|
6031
|
+
<xsl:value-of select="$ordinal"/>
|
6032
|
+
</xsl:when>
|
6033
|
+
<xsl:otherwise>
|
6034
|
+
<xsl:choose>
|
6035
|
+
<xsl:when test="$number < 100">
|
6036
|
+
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
6037
|
+
<xsl:variable name="digit" select="substring($number,2)"/>
|
6038
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
6039
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
6040
|
+
</xsl:when>
|
6041
|
+
<xsl:otherwise>
|
6042
|
+
<!-- more 100 -->
|
6043
|
+
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
6044
|
+
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
6045
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
6046
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
6047
|
+
<xsl:call-template name="number-to-words">
|
6048
|
+
<xsl:with-param name="number" select="$digits"/>
|
6049
|
+
</xsl:call-template>
|
6050
|
+
</xsl:otherwise>
|
6051
|
+
</xsl:choose>
|
6052
|
+
</xsl:otherwise>
|
6053
|
+
</xsl:choose>
|
6054
|
+
</xsl:variable>
|
6055
|
+
<xsl:choose>
|
6056
|
+
<xsl:when test="$first = 'true'">
|
6057
|
+
<xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
|
6058
|
+
<xsl:call-template name="capitalize">
|
6059
|
+
<xsl:with-param name="str" select="$value_lc"/>
|
6060
|
+
</xsl:call-template>
|
6061
|
+
</xsl:when>
|
6062
|
+
<xsl:otherwise>
|
6063
|
+
<xsl:value-of select="$value"/>
|
6064
|
+
</xsl:otherwise>
|
6065
|
+
</xsl:choose>
|
6066
|
+
</xsl:if>
|
5557
6067
|
</xsl:template></xsl:stylesheet>
|