metanorma-ogc 1.3.5 → 1.4.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 +1 -1
- data/lib/asciidoctor/ogc/isodoc.rng +62 -8
- data/lib/asciidoctor/ogc/ogc.rng +13 -13
- data/lib/asciidoctor/ogc/reqt.rng +15 -4
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +567 -91
- data/lib/isodoc/ogc/ogc.best-practice.xsl +567 -91
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +567 -91
- data/lib/isodoc/ogc/ogc.community-practice.xsl +567 -91
- data/lib/isodoc/ogc/ogc.community-standard.xsl +567 -91
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +567 -91
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +567 -91
- data/lib/isodoc/ogc/ogc.other.xsl +567 -91
- data/lib/isodoc/ogc/ogc.policy.xsl +567 -91
- data/lib/isodoc/ogc/ogc.reference-model.xsl +567 -91
- data/lib/isodoc/ogc/ogc.release-notes.xsl +567 -91
- data/lib/isodoc/ogc/ogc.standard.xsl +567 -91
- data/lib/isodoc/ogc/ogc.test-suite.xsl +567 -91
- data/lib/isodoc/ogc/ogc.user-guide.xsl +567 -91
- data/lib/isodoc/ogc/ogc.white-paper.xsl +552 -76
- data/lib/isodoc/ogc/reqt.rb +58 -14
- data/lib/isodoc/ogc/word_convert.rb +13 -12
- data/lib/isodoc/ogc/xref.rb +58 -41
- data/lib/metanorma/ogc/processor.rb +2 -1
- data/lib/metanorma/ogc/version.rb +1 -1
- data/metanorma-ogc.gemspec +2 -2
- metadata +6 -6
@@ -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>
|
@@ -1076,7 +1080,7 @@
|
|
1076
1080
|
|
1077
1081
|
|
1078
1082
|
|
1079
|
-
<xsl:attribute name="font-family">Courier</xsl:attribute>
|
1083
|
+
<xsl:attribute name="font-family">Courier New</xsl:attribute>
|
1080
1084
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
1081
1085
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1082
1086
|
<xsl:attribute name="line-height">113%</xsl:attribute>
|
@@ -1208,6 +1212,7 @@
|
|
1208
1212
|
|
1209
1213
|
|
1210
1214
|
|
1215
|
+
|
1211
1216
|
|
1212
1217
|
<xsl:attribute name="margin-bottom">14pt</xsl:attribute>
|
1213
1218
|
|
@@ -1224,7 +1229,9 @@
|
|
1224
1229
|
|
1225
1230
|
|
1226
1231
|
|
1227
|
-
</xsl:attribute-set><xsl:
|
1232
|
+
</xsl:attribute-set><xsl:variable name="table-border_">
|
1233
|
+
|
1234
|
+
</xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
|
1228
1235
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
1229
1236
|
|
1230
1237
|
|
@@ -1280,6 +1287,7 @@
|
|
1280
1287
|
</xsl:attribute-set><xsl:attribute-set name="eref-style">
|
1281
1288
|
|
1282
1289
|
|
1290
|
+
|
1283
1291
|
<xsl:attribute name="color">blue</xsl:attribute>
|
1284
1292
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1285
1293
|
|
@@ -1456,7 +1464,7 @@
|
|
1456
1464
|
</xsl:attribute-set><xsl:attribute-set name="tt-style">
|
1457
1465
|
|
1458
1466
|
|
1459
|
-
<xsl:attribute name="font-family">Courier</xsl:attribute>
|
1467
|
+
<xsl:attribute name="font-family">Courier New</xsl:attribute>
|
1460
1468
|
|
1461
1469
|
|
1462
1470
|
</xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
|
@@ -1513,14 +1521,15 @@
|
|
1513
1521
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
1514
1522
|
|
1515
1523
|
<!-- Normative references -->
|
1516
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
1524
|
+
<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"/>
|
1517
1525
|
<!-- Terms and definitions -->
|
1518
1526
|
<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"/>
|
1519
1527
|
<!-- Another main sections -->
|
1520
1528
|
<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"/>
|
1521
1529
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
1522
1530
|
<!-- Bibliography -->
|
1523
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
1531
|
+
<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"/>
|
1532
|
+
|
1524
1533
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
1525
1534
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
1526
1535
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -1563,6 +1572,8 @@
|
|
1563
1572
|
<fo:block> </fo:block>
|
1564
1573
|
</xsl:if> -->
|
1565
1574
|
|
1575
|
+
|
1576
|
+
<!-- Display table's name before table as standalone block -->
|
1566
1577
|
<!-- $namespace = 'iso' or -->
|
1567
1578
|
|
1568
1579
|
|
@@ -1642,6 +1653,12 @@
|
|
1642
1653
|
|
1643
1654
|
|
1644
1655
|
|
1656
|
+
|
1657
|
+
|
1658
|
+
|
1659
|
+
<!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
|
1660
|
+
|
1661
|
+
|
1645
1662
|
<xsl:variable name="table_width">
|
1646
1663
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
1647
1664
|
|
@@ -1666,6 +1683,7 @@
|
|
1666
1683
|
|
1667
1684
|
|
1668
1685
|
|
1686
|
+
|
1669
1687
|
<attribute name="margin-left">0mm</attribute>
|
1670
1688
|
<attribute name="margin-right">0mm</attribute>
|
1671
1689
|
|
@@ -1691,6 +1709,8 @@
|
|
1691
1709
|
<xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
|
1692
1710
|
</xsl:if>
|
1693
1711
|
|
1712
|
+
|
1713
|
+
|
1694
1714
|
<xsl:choose>
|
1695
1715
|
<xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
|
1696
1716
|
<xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
|
@@ -1977,9 +1997,9 @@
|
|
1977
1997
|
<xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
|
1978
1998
|
<xsl:with-param name="continued">true</xsl:with-param>
|
1979
1999
|
</xsl:apply-templates>
|
1980
|
-
|
1981
|
-
|
1982
|
-
|
2000
|
+
|
2001
|
+
|
2002
|
+
|
1983
2003
|
|
1984
2004
|
</fo:table-cell>
|
1985
2005
|
</fo:table-row>
|
@@ -2061,7 +2081,11 @@
|
|
2061
2081
|
|
2062
2082
|
<xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
|
2063
2083
|
|
2064
|
-
<xsl:
|
2084
|
+
<xsl:variable name="isNoteOrFnExistShowAfterTable">
|
2085
|
+
|
2086
|
+
</xsl:variable>
|
2087
|
+
|
2088
|
+
<xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
|
2065
2089
|
|
2066
2090
|
<xsl:variable name="cols-count">
|
2067
2091
|
<xsl:choose>
|
@@ -2090,6 +2114,8 @@
|
|
2090
2114
|
</xsl:choose>
|
2091
2115
|
</xsl:for-each>
|
2092
2116
|
|
2117
|
+
|
2118
|
+
|
2093
2119
|
<xsl:choose>
|
2094
2120
|
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
2095
2121
|
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
@@ -2116,6 +2142,7 @@
|
|
2116
2142
|
|
2117
2143
|
|
2118
2144
|
|
2145
|
+
|
2119
2146
|
<!-- fn will be processed inside 'note' processing -->
|
2120
2147
|
|
2121
2148
|
|
@@ -2124,6 +2151,11 @@
|
|
2124
2151
|
|
2125
2152
|
|
2126
2153
|
|
2154
|
+
|
2155
|
+
|
2156
|
+
<!-- for BSI (not PAS) display Notes before footnotes -->
|
2157
|
+
|
2158
|
+
|
2127
2159
|
<!-- except gb -->
|
2128
2160
|
|
2129
2161
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
@@ -2149,6 +2181,10 @@
|
|
2149
2181
|
<!-- fn processing -->
|
2150
2182
|
<xsl:call-template name="fn_display"/>
|
2151
2183
|
|
2184
|
+
|
2185
|
+
<!-- for PAS display Notes after footnotes -->
|
2186
|
+
|
2187
|
+
|
2152
2188
|
</fo:table-cell>
|
2153
2189
|
</fo:table-row>
|
2154
2190
|
</fo:table-body>
|
@@ -2190,6 +2226,19 @@
|
|
2190
2226
|
|
2191
2227
|
</fo:table-body>
|
2192
2228
|
|
2229
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
|
2230
|
+
<xsl:choose>
|
2231
|
+
<xsl:when test="substring-after(., '—') != ''">
|
2232
|
+
<xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
|
2233
|
+
</xsl:when>
|
2234
|
+
<xsl:otherwise>
|
2235
|
+
<xsl:value-of select="."/>
|
2236
|
+
</xsl:otherwise>
|
2237
|
+
</xsl:choose>
|
2238
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
|
2239
|
+
<xsl:apply-templates mode="presentation_name"/>
|
2240
|
+
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
|
2241
|
+
<xsl:apply-templates select="."/>
|
2193
2242
|
</xsl:template><xsl:template match="*[local-name()='tr']">
|
2194
2243
|
<xsl:variable name="parent-name" select="local-name(..)"/>
|
2195
2244
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
@@ -2202,10 +2251,13 @@
|
|
2202
2251
|
|
2203
2252
|
|
2204
2253
|
|
2254
|
+
|
2255
|
+
|
2205
2256
|
</xsl:if>
|
2206
2257
|
<xsl:if test="$parent-name = 'tfoot'">
|
2207
2258
|
|
2208
2259
|
|
2260
|
+
|
2209
2261
|
</xsl:if>
|
2210
2262
|
|
2211
2263
|
|
@@ -2215,6 +2267,8 @@
|
|
2215
2267
|
|
2216
2268
|
|
2217
2269
|
|
2270
|
+
|
2271
|
+
|
2218
2272
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
2219
2273
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
2220
2274
|
</xsl:if> -->
|
@@ -2302,6 +2356,7 @@
|
|
2302
2356
|
|
2303
2357
|
|
2304
2358
|
|
2359
|
+
|
2305
2360
|
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
2306
2361
|
<xsl:attribute name="border">solid 0.5pt rgb(153, 153, 153)</xsl:attribute>
|
2307
2362
|
<xsl:attribute name="height">5mm</xsl:attribute>
|
@@ -2342,8 +2397,14 @@
|
|
2342
2397
|
|
2343
2398
|
|
2344
2399
|
|
2400
|
+
|
2401
|
+
|
2402
|
+
<!-- Table's note name (NOTE, for example) -->
|
2403
|
+
|
2345
2404
|
<fo:inline padding-right="2mm">
|
2346
2405
|
|
2406
|
+
|
2407
|
+
|
2347
2408
|
|
2348
2409
|
|
2349
2410
|
|
@@ -2351,6 +2412,8 @@
|
|
2351
2412
|
|
2352
2413
|
</fo:inline>
|
2353
2414
|
|
2415
|
+
|
2416
|
+
|
2354
2417
|
<xsl:apply-templates mode="process"/>
|
2355
2418
|
</fo:block>
|
2356
2419
|
|
@@ -2358,24 +2421,18 @@
|
|
2358
2421
|
<xsl:apply-templates/>
|
2359
2422
|
</xsl:template><xsl:template name="fn_display">
|
2360
2423
|
<xsl:variable name="references">
|
2424
|
+
|
2361
2425
|
<xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
|
2362
|
-
<
|
2363
|
-
|
2364
|
-
|
2365
|
-
<xsl:attribute name="id">
|
2366
|
-
<xsl:value-of select="@reference"/>
|
2367
|
-
<xsl:text>_</xsl:text>
|
2368
|
-
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
2369
|
-
</xsl:attribute>
|
2370
|
-
|
2371
|
-
<xsl:apply-templates/>
|
2372
|
-
</fn>
|
2426
|
+
<xsl:call-template name="create_fn"/>
|
2373
2427
|
</xsl:for-each>
|
2374
2428
|
</xsl:variable>
|
2429
|
+
|
2375
2430
|
<xsl:for-each select="xalan:nodeset($references)//fn">
|
2376
2431
|
<xsl:variable name="reference" select="@reference"/>
|
2377
2432
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
2378
2433
|
<fo:block margin-bottom="12pt">
|
2434
|
+
|
2435
|
+
|
2379
2436
|
|
2380
2437
|
|
2381
2438
|
|
@@ -2391,9 +2448,11 @@
|
|
2391
2448
|
|
2392
2449
|
|
2393
2450
|
|
2451
|
+
|
2394
2452
|
<xsl:value-of select="@reference"/>
|
2395
2453
|
|
2396
2454
|
|
2455
|
+
|
2397
2456
|
</fo:inline>
|
2398
2457
|
<fo:inline>
|
2399
2458
|
|
@@ -2403,6 +2462,18 @@
|
|
2403
2462
|
</fo:block>
|
2404
2463
|
</xsl:if>
|
2405
2464
|
</xsl:for-each>
|
2465
|
+
</xsl:template><xsl:template name="create_fn">
|
2466
|
+
<fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
|
2467
|
+
|
2468
|
+
|
2469
|
+
<xsl:attribute name="id">
|
2470
|
+
<xsl:value-of select="@reference"/>
|
2471
|
+
<xsl:text>_</xsl:text>
|
2472
|
+
<xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
|
2473
|
+
</xsl:attribute>
|
2474
|
+
|
2475
|
+
<xsl:apply-templates/>
|
2476
|
+
</fn>
|
2406
2477
|
</xsl:template><xsl:template name="fn_name_display">
|
2407
2478
|
<!-- <xsl:variable name="references">
|
2408
2479
|
<xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
|
@@ -2532,6 +2603,9 @@
|
|
2532
2603
|
|
2533
2604
|
|
2534
2605
|
|
2606
|
+
|
2607
|
+
|
2608
|
+
|
2535
2609
|
<xsl:attribute name="vertical-align">super</xsl:attribute>
|
2536
2610
|
<xsl:attribute name="color">blue</xsl:attribute>
|
2537
2611
|
|
@@ -2550,6 +2624,7 @@
|
|
2550
2624
|
|
2551
2625
|
<xsl:value-of select="@reference"/>
|
2552
2626
|
|
2627
|
+
|
2553
2628
|
</fo:basic-link>
|
2554
2629
|
</fo:inline>
|
2555
2630
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -3410,19 +3485,6 @@
|
|
3410
3485
|
<!-- replace start and end spaces to non-break space -->
|
3411
3486
|
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
|
3412
3487
|
</xsl:copy>
|
3413
|
-
</xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
|
3414
|
-
<xsl:copy>
|
3415
|
-
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
3416
|
-
</xsl:copy>
|
3417
|
-
<xsl:choose>
|
3418
|
-
<!-- if in msub, then don't add space -->
|
3419
|
-
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
3420
|
-
<!-- if next char in digit, don't add space -->
|
3421
|
-
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
3422
|
-
<xsl:otherwise>
|
3423
|
-
<mathml:mspace width="0.5ex"/>
|
3424
|
-
</xsl:otherwise>
|
3425
|
-
</xsl:choose>
|
3426
3488
|
</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">
|
3427
3489
|
<xsl:variable name="target">
|
3428
3490
|
<xsl:choose>
|
@@ -3447,6 +3509,7 @@
|
|
3447
3509
|
<fo:inline xsl:use-attribute-sets="link-style">
|
3448
3510
|
|
3449
3511
|
|
3512
|
+
|
3450
3513
|
<xsl:choose>
|
3451
3514
|
<xsl:when test="$target_text = ''">
|
3452
3515
|
<xsl:apply-templates/>
|
@@ -3559,6 +3622,7 @@
|
|
3559
3622
|
|
3560
3623
|
|
3561
3624
|
|
3625
|
+
|
3562
3626
|
<fo:block-container margin-left="0mm">
|
3563
3627
|
|
3564
3628
|
|
@@ -3733,7 +3797,24 @@
|
|
3733
3797
|
</fo:instream-foreign-object>
|
3734
3798
|
</xsl:when>
|
3735
3799
|
<xsl:otherwise>
|
3736
|
-
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"
|
3800
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
3801
|
+
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
3802
|
+
|
3803
|
+
<xsl:variable name="img_src">
|
3804
|
+
<xsl:choose>
|
3805
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
3806
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
3807
|
+
</xsl:choose>
|
3808
|
+
</xsl:variable>
|
3809
|
+
|
3810
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
3811
|
+
<xsl:if test="number($scale) < 100">
|
3812
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
3813
|
+
</xsl:if>
|
3814
|
+
|
3815
|
+
</xsl:if>
|
3816
|
+
|
3817
|
+
</fo:external-graphic>
|
3737
3818
|
</xsl:otherwise>
|
3738
3819
|
</xsl:choose>
|
3739
3820
|
|
@@ -3801,6 +3882,253 @@
|
|
3801
3882
|
<xsl:param name="height"/>
|
3802
3883
|
<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; "/>
|
3803
3884
|
<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; "/>
|
3885
|
+
</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">
|
3886
|
+
<xsl:param name="name"/>
|
3887
|
+
|
3888
|
+
<xsl:variable name="svg_content">
|
3889
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
3890
|
+
</xsl:variable>
|
3891
|
+
|
3892
|
+
<xsl:variable name="alt-text">
|
3893
|
+
<xsl:choose>
|
3894
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
3895
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
3896
|
+
</xsl:when>
|
3897
|
+
<xsl:when test="normalize-space($name) != ''">
|
3898
|
+
<xsl:value-of select="$name"/>
|
3899
|
+
</xsl:when>
|
3900
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
3901
|
+
</xsl:choose>
|
3902
|
+
</xsl:variable>
|
3903
|
+
|
3904
|
+
<xsl:choose>
|
3905
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
3906
|
+
<fo:block>
|
3907
|
+
<xsl:variable name="width" select="@width"/>
|
3908
|
+
<xsl:variable name="height" select="@height"/>
|
3909
|
+
|
3910
|
+
<xsl:variable name="scale_x">
|
3911
|
+
<xsl:choose>
|
3912
|
+
<xsl:when test="$width > $width_effective_px">
|
3913
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
3914
|
+
</xsl:when>
|
3915
|
+
<xsl:otherwise>1</xsl:otherwise>
|
3916
|
+
</xsl:choose>
|
3917
|
+
</xsl:variable>
|
3918
|
+
|
3919
|
+
<xsl:variable name="scale_y">
|
3920
|
+
<xsl:choose>
|
3921
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
3922
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
3923
|
+
</xsl:when>
|
3924
|
+
<xsl:otherwise>1</xsl:otherwise>
|
3925
|
+
</xsl:choose>
|
3926
|
+
</xsl:variable>
|
3927
|
+
|
3928
|
+
<xsl:variable name="scale">
|
3929
|
+
<xsl:choose>
|
3930
|
+
<xsl:when test="$scale_y != 1">
|
3931
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
3932
|
+
</xsl:when>
|
3933
|
+
<xsl:otherwise>
|
3934
|
+
<xsl:value-of select="$scale_x"/>
|
3935
|
+
</xsl:otherwise>
|
3936
|
+
</xsl:choose>
|
3937
|
+
</xsl:variable>
|
3938
|
+
|
3939
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
3940
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
3941
|
+
|
3942
|
+
<fo:table table-layout="fixed" width="100%">
|
3943
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
3944
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
3945
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
3946
|
+
<fo:table-body>
|
3947
|
+
<fo:table-row>
|
3948
|
+
<fo:table-cell column-number="2">
|
3949
|
+
<fo:block>
|
3950
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
3951
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
3952
|
+
<fo:block line-height="0" font-size="0">
|
3953
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
3954
|
+
<xsl:call-template name="bookmark"/>
|
3955
|
+
</xsl:for-each>
|
3956
|
+
</fo:block>
|
3957
|
+
</xsl:if>
|
3958
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
3959
|
+
|
3960
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
3961
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3962
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3963
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3964
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3965
|
+
|
3966
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
3967
|
+
</fo:instream-foreign-object>
|
3968
|
+
</fo:block>
|
3969
|
+
|
3970
|
+
<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">
|
3971
|
+
<xsl:with-param name="scale" select="$scale"/>
|
3972
|
+
</xsl:apply-templates>
|
3973
|
+
</fo:block-container>
|
3974
|
+
</fo:block>
|
3975
|
+
</fo:table-cell>
|
3976
|
+
</fo:table-row>
|
3977
|
+
</fo:table-body>
|
3978
|
+
</fo:table>
|
3979
|
+
</fo:block>
|
3980
|
+
|
3981
|
+
</xsl:when>
|
3982
|
+
<xsl:otherwise>
|
3983
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
3984
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
3985
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3986
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3987
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3988
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
3989
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
3990
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
3991
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
3992
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
3993
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
3994
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
3995
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
3996
|
+
</xsl:if>
|
3997
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3998
|
+
<xsl:copy-of select="$svg_content"/>
|
3999
|
+
</fo:instream-foreign-object>
|
4000
|
+
</fo:block>
|
4001
|
+
</xsl:otherwise>
|
4002
|
+
</xsl:choose>
|
4003
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
4004
|
+
<xsl:copy>
|
4005
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
4006
|
+
</xsl:copy>
|
4007
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
4008
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
4009
|
+
<xsl:value-of select="."/>
|
4010
|
+
</xsl:attribute>
|
4011
|
+
</xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
|
4012
|
+
<xsl:copy>
|
4013
|
+
<xsl:apply-templates select="@*" mode="svg_update"/>
|
4014
|
+
<xsl:variable name="viewbox">
|
4015
|
+
<xsl:call-template name="split">
|
4016
|
+
<xsl:with-param name="pText" select="@viewBox"/>
|
4017
|
+
<xsl:with-param name="sep" select="' '"/>
|
4018
|
+
</xsl:call-template>
|
4019
|
+
</xsl:variable>
|
4020
|
+
<xsl:attribute name="width">
|
4021
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
|
4022
|
+
</xsl:attribute>
|
4023
|
+
<xsl:attribute name="height">
|
4024
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
|
4025
|
+
</xsl:attribute>
|
4026
|
+
<xsl:apply-templates mode="svg_update"/>
|
4027
|
+
</xsl:copy>
|
4028
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
4029
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
4030
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
4031
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
4032
|
+
<xsl:call-template name="image_svg">
|
4033
|
+
<xsl:with-param name="name" select="$name"/>
|
4034
|
+
</xsl:call-template>
|
4035
|
+
</xsl:for-each>
|
4036
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
4037
|
+
<xsl:copy>
|
4038
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
4039
|
+
</xsl:copy>
|
4040
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
4041
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
4042
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
4043
|
+
<xsl:param name="scale"/>
|
4044
|
+
<xsl:variable name="dest">
|
4045
|
+
<xsl:choose>
|
4046
|
+
<xsl:when test="starts-with(@href, '#')">
|
4047
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
4048
|
+
</xsl:when>
|
4049
|
+
<xsl:otherwise>
|
4050
|
+
<xsl:value-of select="@href"/>
|
4051
|
+
</xsl:otherwise>
|
4052
|
+
</xsl:choose>
|
4053
|
+
</xsl:variable>
|
4054
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
4055
|
+
<xsl:call-template name="insertSVGMapLink">
|
4056
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
4057
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
4058
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
4059
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
4060
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4061
|
+
</xsl:call-template>
|
4062
|
+
</xsl:for-each>
|
4063
|
+
|
4064
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
4065
|
+
<xsl:variable name="points">
|
4066
|
+
<xsl:call-template name="split">
|
4067
|
+
<xsl:with-param name="pText" select="@points"/>
|
4068
|
+
</xsl:call-template>
|
4069
|
+
</xsl:variable>
|
4070
|
+
<xsl:variable name="x_coords">
|
4071
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
4072
|
+
<xsl:sort select="." data-type="number"/>
|
4073
|
+
<x><xsl:value-of select="."/></x>
|
4074
|
+
</xsl:for-each>
|
4075
|
+
</xsl:variable>
|
4076
|
+
<xsl:variable name="y_coords">
|
4077
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
4078
|
+
<xsl:sort select="." data-type="number"/>
|
4079
|
+
<y><xsl:value-of select="."/></y>
|
4080
|
+
</xsl:for-each>
|
4081
|
+
</xsl:variable>
|
4082
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
4083
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
4084
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
4085
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
4086
|
+
<xsl:call-template name="insertSVGMapLink">
|
4087
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
4088
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
4089
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
4090
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
4091
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4092
|
+
</xsl:call-template>
|
4093
|
+
</xsl:for-each>
|
4094
|
+
|
4095
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
4096
|
+
<xsl:call-template name="insertSVGMapLink">
|
4097
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
4098
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
4099
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
4100
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
4101
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4102
|
+
</xsl:call-template>
|
4103
|
+
</xsl:for-each>
|
4104
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
4105
|
+
<xsl:call-template name="insertSVGMapLink">
|
4106
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
4107
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
4108
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
4109
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
4110
|
+
<xsl:with-param name="dest" select="$dest"/>
|
4111
|
+
</xsl:call-template>
|
4112
|
+
</xsl:for-each>
|
4113
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
4114
|
+
<xsl:param name="left"/>
|
4115
|
+
<xsl:param name="top"/>
|
4116
|
+
<xsl:param name="width"/>
|
4117
|
+
<xsl:param name="height"/>
|
4118
|
+
<xsl:param name="dest"/>
|
4119
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
4120
|
+
<fo:block font-size="1pt">
|
4121
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
4122
|
+
<fo:inline-container inline-progression-dimension="100%">
|
4123
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
4124
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
4125
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
4126
|
+
</xsl:if> -->
|
4127
|
+
<fo:block> </fo:block></fo:block-container>
|
4128
|
+
</fo:inline-container>
|
4129
|
+
</fo:basic-link>
|
4130
|
+
</fo:block>
|
4131
|
+
</fo:block-container>
|
3804
4132
|
</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">
|
3805
4133
|
<xsl:apply-templates mode="contents"/>
|
3806
4134
|
<xsl:text> </xsl:text>
|
@@ -3829,28 +4157,39 @@
|
|
3829
4157
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
3830
4158
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
3831
4159
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
4160
|
+
<xsl:if test="@bundle = 'true'">
|
4161
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
4162
|
+
</xsl:if>
|
3832
4163
|
<fo:bookmark-title>
|
3833
|
-
<xsl:variable name="bookmark-title_">
|
3834
|
-
<xsl:call-template name="getLangVersion">
|
3835
|
-
<xsl:with-param name="lang" select="@lang"/>
|
3836
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
3837
|
-
<xsl:with-param name="title" select="@title-part"/>
|
3838
|
-
</xsl:call-template>
|
3839
|
-
</xsl:variable>
|
3840
4164
|
<xsl:choose>
|
3841
|
-
<xsl:when test="normalize-space(
|
3842
|
-
<xsl:
|
3843
|
-
|
3844
|
-
|
4165
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
4166
|
+
<xsl:variable name="bookmark-title_">
|
4167
|
+
<xsl:call-template name="getLangVersion">
|
4168
|
+
<xsl:with-param name="lang" select="@lang"/>
|
4169
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
4170
|
+
<xsl:with-param name="title" select="@title-part"/>
|
4171
|
+
</xsl:call-template>
|
4172
|
+
</xsl:variable>
|
3845
4173
|
<xsl:choose>
|
3846
|
-
<xsl:when test="
|
3847
|
-
|
3848
|
-
|
3849
|
-
<xsl:otherwise
|
4174
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
4175
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
4176
|
+
</xsl:when>
|
4177
|
+
<xsl:otherwise>
|
4178
|
+
<xsl:choose>
|
4179
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
4180
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
4181
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
4182
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
4183
|
+
</xsl:choose>
|
4184
|
+
</xsl:otherwise>
|
3850
4185
|
</xsl:choose>
|
4186
|
+
</xsl:when>
|
4187
|
+
<xsl:otherwise>
|
4188
|
+
<xsl:value-of select="@title-part"/>
|
3851
4189
|
</xsl:otherwise>
|
3852
4190
|
</xsl:choose>
|
3853
4191
|
</fo:bookmark-title>
|
4192
|
+
|
3854
4193
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
3855
4194
|
|
3856
4195
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -3960,16 +4299,23 @@
|
|
3960
4299
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
3961
4300
|
</xsl:choose>
|
3962
4301
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
3963
|
-
<
|
3964
|
-
|
3965
|
-
|
3966
|
-
|
3967
|
-
<xsl:
|
3968
|
-
|
3969
|
-
|
3970
|
-
|
3971
|
-
|
3972
|
-
|
4302
|
+
<xsl:choose>
|
4303
|
+
<xsl:when test="@id != ''">
|
4304
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
4305
|
+
<fo:bookmark-title>
|
4306
|
+
<xsl:if test="@section != ''">
|
4307
|
+
<xsl:value-of select="@section"/>
|
4308
|
+
<xsl:text> </xsl:text>
|
4309
|
+
</xsl:if>
|
4310
|
+
<xsl:value-of select="normalize-space(title)"/>
|
4311
|
+
</fo:bookmark-title>
|
4312
|
+
<xsl:apply-templates mode="bookmark"/>
|
4313
|
+
</fo:bookmark>
|
4314
|
+
</xsl:when>
|
4315
|
+
<xsl:otherwise>
|
4316
|
+
<xsl:apply-templates mode="bookmark"/>
|
4317
|
+
</xsl:otherwise>
|
4318
|
+
</xsl:choose>
|
3973
4319
|
</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">
|
3974
4320
|
<xsl:if test="normalize-space() != ''">
|
3975
4321
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
@@ -4343,7 +4689,19 @@
|
|
4343
4689
|
</fo:inline>
|
4344
4690
|
</xsl:if>
|
4345
4691
|
</xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
|
4346
|
-
<
|
4692
|
+
<xsl:variable name="element">inline
|
4693
|
+
|
4694
|
+
</xsl:variable>
|
4695
|
+
<xsl:choose>
|
4696
|
+
<xsl:when test="contains($element, 'block')">
|
4697
|
+
<fo:block xsl:use-attribute-sets="example-p-style">
|
4698
|
+
<xsl:apply-templates/>
|
4699
|
+
</fo:block>
|
4700
|
+
</xsl:when>
|
4701
|
+
<xsl:otherwise>
|
4702
|
+
<fo:inline><xsl:apply-templates/></fo:inline>
|
4703
|
+
</xsl:otherwise>
|
4704
|
+
</xsl:choose>
|
4347
4705
|
</xsl:template><xsl:template match="*[local-name() = 'example']">
|
4348
4706
|
<fo:block id="{@id}" xsl:use-attribute-sets="example-style">
|
4349
4707
|
|
@@ -4536,7 +4894,9 @@
|
|
4536
4894
|
|
4537
4895
|
|
4538
4896
|
</xsl:if>
|
4539
|
-
|
4897
|
+
|
4898
|
+
|
4899
|
+
|
4540
4900
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
4541
4901
|
<xsl:if test="normalize-space(@citeas) = ''">
|
4542
4902
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
@@ -4548,6 +4908,7 @@
|
|
4548
4908
|
|
4549
4909
|
|
4550
4910
|
|
4911
|
+
|
4551
4912
|
</xsl:if>
|
4552
4913
|
|
4553
4914
|
<xsl:apply-templates/>
|
@@ -4930,7 +5291,6 @@
|
|
4930
5291
|
</xsl:template><xsl:template name="processBibitem">
|
4931
5292
|
|
4932
5293
|
|
4933
|
-
<!-- end BIPM bibitem processing-->
|
4934
5294
|
|
4935
5295
|
|
4936
5296
|
<!-- start OGC bibtem processing -->
|
@@ -5535,20 +5895,40 @@
|
|
5535
5895
|
</xsl:call-template>
|
5536
5896
|
</xsl:if>
|
5537
5897
|
</xsl:template><xsl:template name="getLocalizedString">
|
5538
|
-
<xsl:param name="key"/>
|
5898
|
+
<xsl:param name="key"/>
|
5899
|
+
<xsl:param name="formatted">false</xsl:param>
|
5539
5900
|
|
5540
5901
|
<xsl:variable name="curr_lang">
|
5541
5902
|
<xsl:call-template name="getLang"/>
|
5542
5903
|
</xsl:variable>
|
5543
5904
|
|
5544
|
-
<xsl:variable name="data_value"
|
5905
|
+
<xsl:variable name="data_value">
|
5906
|
+
<xsl:choose>
|
5907
|
+
<xsl:when test="$formatted = 'true'">
|
5908
|
+
<xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5909
|
+
</xsl:when>
|
5910
|
+
<xsl:otherwise>
|
5911
|
+
<xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
5912
|
+
</xsl:otherwise>
|
5913
|
+
</xsl:choose>
|
5914
|
+
</xsl:variable>
|
5545
5915
|
|
5546
5916
|
<xsl:choose>
|
5547
|
-
<xsl:when test="$data_value != ''">
|
5548
|
-
<xsl:
|
5917
|
+
<xsl:when test="normalize-space($data_value) != ''">
|
5918
|
+
<xsl:choose>
|
5919
|
+
<xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
|
5920
|
+
<xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
|
5921
|
+
</xsl:choose>
|
5549
5922
|
</xsl:when>
|
5550
5923
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
5551
|
-
<xsl:
|
5924
|
+
<xsl:choose>
|
5925
|
+
<xsl:when test="$formatted = 'true'">
|
5926
|
+
<xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5927
|
+
</xsl:when>
|
5928
|
+
<xsl:otherwise>
|
5929
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
5930
|
+
</xsl:otherwise>
|
5931
|
+
</xsl:choose>
|
5552
5932
|
</xsl:when>
|
5553
5933
|
<xsl:otherwise>
|
5554
5934
|
<xsl:variable name="key_">
|
@@ -5559,7 +5939,7 @@
|
|
5559
5939
|
<xsl:value-of select="$key_"/>
|
5560
5940
|
</xsl:otherwise>
|
5561
5941
|
</xsl:choose>
|
5562
|
-
|
5942
|
+
|
5563
5943
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
5564
5944
|
<xsl:param name="isAdded"/>
|
5565
5945
|
<xsl:param name="isDeleted"/>
|
@@ -5610,4 +5990,100 @@
|
|
5610
5990
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
5611
5991
|
</xsl:choose>
|
5612
5992
|
</xsl:attribute>
|
5993
|
+
</xsl:template><xsl:template name="number-to-words">
|
5994
|
+
<xsl:param name="number"/>
|
5995
|
+
<xsl:param name="first"/>
|
5996
|
+
<xsl:if test="$number != ''">
|
5997
|
+
<xsl:variable name="words">
|
5998
|
+
<words>
|
5999
|
+
<word cardinal="1">One-</word>
|
6000
|
+
<word ordinal="1">First </word>
|
6001
|
+
<word cardinal="2">Two-</word>
|
6002
|
+
<word ordinal="2">Second </word>
|
6003
|
+
<word cardinal="3">Three-</word>
|
6004
|
+
<word ordinal="3">Third </word>
|
6005
|
+
<word cardinal="4">Four-</word>
|
6006
|
+
<word ordinal="4">Fourth </word>
|
6007
|
+
<word cardinal="5">Five-</word>
|
6008
|
+
<word ordinal="5">Fifth </word>
|
6009
|
+
<word cardinal="6">Six-</word>
|
6010
|
+
<word ordinal="6">Sixth </word>
|
6011
|
+
<word cardinal="7">Seven-</word>
|
6012
|
+
<word ordinal="7">Seventh </word>
|
6013
|
+
<word cardinal="8">Eight-</word>
|
6014
|
+
<word ordinal="8">Eighth </word>
|
6015
|
+
<word cardinal="9">Nine-</word>
|
6016
|
+
<word ordinal="9">Ninth </word>
|
6017
|
+
<word ordinal="10">Tenth </word>
|
6018
|
+
<word ordinal="11">Eleventh </word>
|
6019
|
+
<word ordinal="12">Twelfth </word>
|
6020
|
+
<word ordinal="13">Thirteenth </word>
|
6021
|
+
<word ordinal="14">Fourteenth </word>
|
6022
|
+
<word ordinal="15">Fifteenth </word>
|
6023
|
+
<word ordinal="16">Sixteenth </word>
|
6024
|
+
<word ordinal="17">Seventeenth </word>
|
6025
|
+
<word ordinal="18">Eighteenth </word>
|
6026
|
+
<word ordinal="19">Nineteenth </word>
|
6027
|
+
<word cardinal="20">Twenty-</word>
|
6028
|
+
<word ordinal="20">Twentieth </word>
|
6029
|
+
<word cardinal="30">Thirty-</word>
|
6030
|
+
<word ordinal="30">Thirtieth </word>
|
6031
|
+
<word cardinal="40">Forty-</word>
|
6032
|
+
<word ordinal="40">Fortieth </word>
|
6033
|
+
<word cardinal="50">Fifty-</word>
|
6034
|
+
<word ordinal="50">Fiftieth </word>
|
6035
|
+
<word cardinal="60">Sixty-</word>
|
6036
|
+
<word ordinal="60">Sixtieth </word>
|
6037
|
+
<word cardinal="70">Seventy-</word>
|
6038
|
+
<word ordinal="70">Seventieth </word>
|
6039
|
+
<word cardinal="80">Eighty-</word>
|
6040
|
+
<word ordinal="80">Eightieth </word>
|
6041
|
+
<word cardinal="90">Ninety-</word>
|
6042
|
+
<word ordinal="90">Ninetieth </word>
|
6043
|
+
<word cardinal="100">Hundred-</word>
|
6044
|
+
<word ordinal="100">Hundredth </word>
|
6045
|
+
</words>
|
6046
|
+
</xsl:variable>
|
6047
|
+
|
6048
|
+
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
6049
|
+
|
6050
|
+
<xsl:variable name="value">
|
6051
|
+
<xsl:choose>
|
6052
|
+
<xsl:when test="$ordinal != ''">
|
6053
|
+
<xsl:value-of select="$ordinal"/>
|
6054
|
+
</xsl:when>
|
6055
|
+
<xsl:otherwise>
|
6056
|
+
<xsl:choose>
|
6057
|
+
<xsl:when test="$number < 100">
|
6058
|
+
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
6059
|
+
<xsl:variable name="digit" select="substring($number,2)"/>
|
6060
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
6061
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
6062
|
+
</xsl:when>
|
6063
|
+
<xsl:otherwise>
|
6064
|
+
<!-- more 100 -->
|
6065
|
+
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
6066
|
+
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
6067
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
6068
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
6069
|
+
<xsl:call-template name="number-to-words">
|
6070
|
+
<xsl:with-param name="number" select="$digits"/>
|
6071
|
+
</xsl:call-template>
|
6072
|
+
</xsl:otherwise>
|
6073
|
+
</xsl:choose>
|
6074
|
+
</xsl:otherwise>
|
6075
|
+
</xsl:choose>
|
6076
|
+
</xsl:variable>
|
6077
|
+
<xsl:choose>
|
6078
|
+
<xsl:when test="$first = 'true'">
|
6079
|
+
<xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
|
6080
|
+
<xsl:call-template name="capitalize">
|
6081
|
+
<xsl:with-param name="str" select="$value_lc"/>
|
6082
|
+
</xsl:call-template>
|
6083
|
+
</xsl:when>
|
6084
|
+
<xsl:otherwise>
|
6085
|
+
<xsl:value-of select="$value"/>
|
6086
|
+
</xsl:otherwise>
|
6087
|
+
</xsl:choose>
|
6088
|
+
</xsl:if>
|
5613
6089
|
</xsl:template></xsl:stylesheet>
|