metanorma-cc 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/cc/cc.standard.xsl +275 -28
- data/lib/metanorma/cc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c42376000b8e82f820c6fdd7f5c3ca85d0d810eb3de71705ac6df2269e50d2db
|
4
|
+
data.tar.gz: fa9bf780b497c2e67c07d83399b3d4ed9228b1a1731ab31eb4532ab16afd16f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78f7007e3975b048c53b85573cb2e6668f9ac5d6eeb80c77becd9d51d7c0cdd2c30c3931c8b0c8aea049d1426b654788a0537631c32609c4b142431840155836
|
7
|
+
data.tar.gz: 83d8577f2edf35a56eea0e4ad8f467ab7102554f91cfa873e0aa40673c7e78146fced42f8ce8ac45a9e1984e7813d489405984724f7eab5fab780fbfb9eff853
|
@@ -957,6 +957,7 @@
|
|
957
957
|
</xsl:choose>
|
958
958
|
</xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'
'"/><xsl:attribute-set name="root-style">
|
959
959
|
|
960
|
+
|
960
961
|
</xsl:attribute-set><xsl:attribute-set name="link-style">
|
961
962
|
|
962
963
|
<xsl:attribute name="color">blue</xsl:attribute>
|
@@ -1292,13 +1293,25 @@
|
|
1292
1293
|
|
1293
1294
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
1294
1295
|
|
1295
|
-
</xsl:attribute-set><xsl:
|
1296
|
+
</xsl:attribute-set><xsl:variable name="color-added-text">
|
1297
|
+
<xsl:text>rgb(0, 255, 0)</xsl:text>
|
1298
|
+
</xsl:variable><xsl:attribute-set name="add-style">
|
1296
1299
|
<xsl:attribute name="color">red</xsl:attribute>
|
1297
1300
|
<xsl:attribute name="text-decoration">underline</xsl:attribute>
|
1298
|
-
|
1299
|
-
<xsl:attribute name="color"
|
1301
|
+
<!-- <xsl:attribute name="color">black</xsl:attribute>
|
1302
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
1303
|
+
<xsl:attribute name="padding-top">1mm</xsl:attribute>
|
1304
|
+
<xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
|
1305
|
+
</xsl:attribute-set><xsl:variable name="color-deleted-text">
|
1306
|
+
<xsl:text>red</xsl:text>
|
1307
|
+
</xsl:variable><xsl:attribute-set name="del-style">
|
1308
|
+
<xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
1300
1309
|
<xsl:attribute name="text-decoration">line-through</xsl:attribute>
|
1301
|
-
</xsl:attribute-set><xsl:
|
1310
|
+
</xsl:attribute-set><xsl:attribute-set name="mathml-style">
|
1311
|
+
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
1312
|
+
|
1313
|
+
|
1314
|
+
</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">
|
1302
1315
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
1303
1316
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
1304
1317
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
|
@@ -1343,16 +1356,17 @@
|
|
1343
1356
|
<xsl:call-template name="add-zero-spaces-java"/>
|
1344
1357
|
</xsl:template><xsl:template match="*[local-name()='table']" name="table">
|
1345
1358
|
|
1359
|
+
<xsl:variable name="table-preamble">
|
1360
|
+
|
1361
|
+
|
1362
|
+
</xsl:variable>
|
1363
|
+
|
1346
1364
|
<xsl:variable name="table">
|
1347
1365
|
|
1348
1366
|
<xsl:variable name="simple-table">
|
1349
1367
|
<xsl:call-template name="getSimpleTable"/>
|
1350
1368
|
</xsl:variable>
|
1351
1369
|
|
1352
|
-
|
1353
|
-
|
1354
|
-
|
1355
|
-
|
1356
1370
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
1357
1371
|
<fo:block> </fo:block>
|
1358
1372
|
</xsl:if> -->
|
@@ -1367,7 +1381,7 @@
|
|
1367
1381
|
|
1368
1382
|
|
1369
1383
|
|
1370
|
-
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)
|
1384
|
+
<xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
|
1371
1385
|
|
1372
1386
|
<!-- <xsl:variable name="cols-count">
|
1373
1387
|
<xsl:choose>
|
@@ -1386,8 +1400,6 @@
|
|
1386
1400
|
<!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
|
1387
1401
|
<!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
|
1388
1402
|
|
1389
|
-
|
1390
|
-
|
1391
1403
|
<xsl:variable name="colwidths">
|
1392
1404
|
<xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
|
1393
1405
|
<xsl:call-template name="calculate-column-widths">
|
@@ -1415,6 +1427,7 @@
|
|
1415
1427
|
</xsl:choose>
|
1416
1428
|
</xsl:variable>
|
1417
1429
|
|
1430
|
+
|
1418
1431
|
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
|
1419
1432
|
|
1420
1433
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
@@ -1448,6 +1461,7 @@
|
|
1448
1461
|
|
1449
1462
|
|
1450
1463
|
|
1464
|
+
|
1451
1465
|
|
1452
1466
|
|
1453
1467
|
|
@@ -1537,7 +1551,8 @@
|
|
1537
1551
|
</fo:block-container>
|
1538
1552
|
</xsl:variable>
|
1539
1553
|
|
1540
|
-
|
1554
|
+
<xsl:variable name="isAdded" select="@added"/>
|
1555
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
1541
1556
|
|
1542
1557
|
<xsl:choose>
|
1543
1558
|
<xsl:when test="@width">
|
@@ -1551,7 +1566,14 @@
|
|
1551
1566
|
<fo:table-body>
|
1552
1567
|
<fo:table-row>
|
1553
1568
|
<fo:table-cell column-number="2">
|
1554
|
-
<
|
1569
|
+
<xsl:copy-of select="$table-preamble"/>
|
1570
|
+
<fo:block>
|
1571
|
+
<xsl:call-template name="setTrackChangesStyles">
|
1572
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
1573
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
1574
|
+
</xsl:call-template>
|
1575
|
+
<xsl:copy-of select="$table"/>
|
1576
|
+
</fo:block>
|
1555
1577
|
</fo:table-cell>
|
1556
1578
|
</fo:table-row>
|
1557
1579
|
</fo:table-body>
|
@@ -1562,7 +1584,22 @@
|
|
1562
1584
|
|
1563
1585
|
</xsl:when>
|
1564
1586
|
<xsl:otherwise>
|
1565
|
-
<xsl:
|
1587
|
+
<xsl:choose>
|
1588
|
+
<xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
|
1589
|
+
<xsl:copy-of select="$table-preamble"/>
|
1590
|
+
<fo:block>
|
1591
|
+
<xsl:call-template name="setTrackChangesStyles">
|
1592
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
1593
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
1594
|
+
</xsl:call-template>
|
1595
|
+
<xsl:copy-of select="$table"/>
|
1596
|
+
</fo:block>
|
1597
|
+
</xsl:when>
|
1598
|
+
<xsl:otherwise>
|
1599
|
+
<xsl:copy-of select="$table-preamble"/>
|
1600
|
+
<xsl:copy-of select="$table"/>
|
1601
|
+
</xsl:otherwise>
|
1602
|
+
</xsl:choose>
|
1566
1603
|
</xsl:otherwise>
|
1567
1604
|
</xsl:choose>
|
1568
1605
|
|
@@ -1623,7 +1660,7 @@
|
|
1623
1660
|
</xsl:for-each>
|
1624
1661
|
</xsl:when>
|
1625
1662
|
<xsl:otherwise>
|
1626
|
-
<xsl:for-each select="xalan:nodeset($table)
|
1663
|
+
<xsl:for-each select="xalan:nodeset($table)/*/tr">
|
1627
1664
|
<xsl:variable name="td_text">
|
1628
1665
|
<xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
|
1629
1666
|
|
@@ -1963,7 +2000,8 @@
|
|
1963
2000
|
<xsl:attribute name="text-align">
|
1964
2001
|
<xsl:choose>
|
1965
2002
|
<xsl:when test="@align">
|
1966
|
-
<xsl:
|
2003
|
+
<xsl:call-template name="setAlignment"/>
|
2004
|
+
<!-- <xsl:value-of select="@align"/> -->
|
1967
2005
|
</xsl:when>
|
1968
2006
|
<xsl:otherwise>center</xsl:otherwise>
|
1969
2007
|
</xsl:choose>
|
@@ -1979,6 +2017,9 @@
|
|
1979
2017
|
|
1980
2018
|
|
1981
2019
|
|
2020
|
+
<xsl:if test="$lang = 'ar'">
|
2021
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2022
|
+
</xsl:if>
|
1982
2023
|
<xsl:if test="@colspan">
|
1983
2024
|
<xsl:attribute name="number-columns-spanned">
|
1984
2025
|
<xsl:value-of select="@colspan"/>
|
@@ -2010,11 +2051,15 @@
|
|
2010
2051
|
<xsl:attribute name="text-align">
|
2011
2052
|
<xsl:choose>
|
2012
2053
|
<xsl:when test="@align">
|
2013
|
-
<xsl:
|
2054
|
+
<xsl:call-template name="setAlignment"/>
|
2055
|
+
<!-- <xsl:value-of select="@align"/> -->
|
2014
2056
|
</xsl:when>
|
2015
2057
|
<xsl:otherwise>left</xsl:otherwise>
|
2016
2058
|
</xsl:choose>
|
2017
2059
|
</xsl:attribute>
|
2060
|
+
<xsl:if test="$lang = 'ar'">
|
2061
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2062
|
+
</xsl:if>
|
2018
2063
|
|
2019
2064
|
|
2020
2065
|
|
@@ -2026,6 +2071,9 @@
|
|
2026
2071
|
|
2027
2072
|
|
2028
2073
|
|
2074
|
+
<xsl:if test=".//*[local-name() = 'table']">
|
2075
|
+
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
2076
|
+
</xsl:if>
|
2029
2077
|
<xsl:if test="@colspan">
|
2030
2078
|
<xsl:attribute name="number-columns-spanned">
|
2031
2079
|
<xsl:value-of select="@colspan"/>
|
@@ -2153,13 +2201,13 @@
|
|
2153
2201
|
</xsl:choose>
|
2154
2202
|
</xsl:variable>
|
2155
2203
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2156
|
-
<xsl:element name="{$ns}:table">
|
2204
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
2157
2205
|
<xsl:for-each select="*[local-name() = 'dl'][1]">
|
2158
2206
|
<tbody>
|
2159
2207
|
<xsl:apply-templates mode="dl"/>
|
2160
2208
|
</tbody>
|
2161
2209
|
</xsl:for-each>
|
2162
|
-
</xsl:element>
|
2210
|
+
<!-- </xsl:element> -->
|
2163
2211
|
</xsl:variable>
|
2164
2212
|
|
2165
2213
|
<xsl:call-template name="calculate-column-widths">
|
@@ -2250,6 +2298,8 @@
|
|
2250
2298
|
<xsl:apply-templates/>
|
2251
2299
|
</fo:inline>
|
2252
2300
|
</xsl:template><xsl:template match="*[local-name()='dl']">
|
2301
|
+
<xsl:variable name="isAdded" select="@added"/>
|
2302
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
2253
2303
|
<fo:block-container>
|
2254
2304
|
|
2255
2305
|
<xsl:if test="not(ancestor::*[local-name() = 'quote'])">
|
@@ -2266,6 +2316,12 @@
|
|
2266
2316
|
</xsl:attribute>
|
2267
2317
|
|
2268
2318
|
</xsl:if>
|
2319
|
+
|
2320
|
+
<xsl:call-template name="setTrackChangesStyles">
|
2321
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
2322
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
2323
|
+
</xsl:call-template>
|
2324
|
+
|
2269
2325
|
<fo:block-container>
|
2270
2326
|
|
2271
2327
|
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
@@ -2373,11 +2429,11 @@
|
|
2373
2429
|
</xsl:choose>
|
2374
2430
|
</xsl:variable>
|
2375
2431
|
<!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
|
2376
|
-
<xsl:element name="{$ns}:table">
|
2432
|
+
<!-- <xsl:element name="{$ns}:table"> -->
|
2377
2433
|
<tbody>
|
2378
2434
|
<xsl:apply-templates mode="dl"/>
|
2379
2435
|
</tbody>
|
2380
|
-
</xsl:element>
|
2436
|
+
<!-- </xsl:element> -->
|
2381
2437
|
</xsl:variable>
|
2382
2438
|
<!-- html-table<xsl:copy-of select="$html-table"/> -->
|
2383
2439
|
<xsl:variable name="colwidths">
|
@@ -2647,9 +2703,71 @@
|
|
2647
2703
|
<xsl:apply-templates/>
|
2648
2704
|
</fo:inline>
|
2649
2705
|
</xsl:template><xsl:template match="*[local-name()='add']">
|
2650
|
-
<
|
2651
|
-
<xsl:
|
2652
|
-
|
2706
|
+
<xsl:choose>
|
2707
|
+
<xsl:when test="@amendment">
|
2708
|
+
<fo:inline>
|
2709
|
+
<xsl:call-template name="insertTag">
|
2710
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
2711
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
2712
|
+
</xsl:call-template>
|
2713
|
+
<xsl:apply-templates/>
|
2714
|
+
<xsl:call-template name="insertTag">
|
2715
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
2716
|
+
<xsl:with-param name="kind">A</xsl:with-param>
|
2717
|
+
<xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
|
2718
|
+
</xsl:call-template>
|
2719
|
+
</fo:inline>
|
2720
|
+
</xsl:when>
|
2721
|
+
<xsl:when test="@corrigenda">
|
2722
|
+
<fo:inline>
|
2723
|
+
<xsl:call-template name="insertTag">
|
2724
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
2725
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
2726
|
+
</xsl:call-template>
|
2727
|
+
<xsl:apply-templates/>
|
2728
|
+
<xsl:call-template name="insertTag">
|
2729
|
+
<xsl:with-param name="type">closing</xsl:with-param>
|
2730
|
+
<xsl:with-param name="kind">C</xsl:with-param>
|
2731
|
+
<xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
|
2732
|
+
</xsl:call-template>
|
2733
|
+
</fo:inline>
|
2734
|
+
</xsl:when>
|
2735
|
+
<xsl:otherwise>
|
2736
|
+
<fo:inline xsl:use-attribute-sets="add-style">
|
2737
|
+
<xsl:apply-templates/>
|
2738
|
+
</fo:inline>
|
2739
|
+
</xsl:otherwise>
|
2740
|
+
</xsl:choose>
|
2741
|
+
|
2742
|
+
</xsl:template><xsl:template name="insertTag">
|
2743
|
+
<xsl:param name="type"/>
|
2744
|
+
<xsl:param name="kind"/>
|
2745
|
+
<xsl:param name="value"/>
|
2746
|
+
<xsl:variable name="add_width" select="string-length($value) * 20"/>
|
2747
|
+
<xsl:variable name="maxwidth" select="60 + $add_width"/>
|
2748
|
+
<fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
|
2749
|
+
<!-- <xsl:attribute name="width">7mm</xsl:attribute>
|
2750
|
+
<xsl:attribute name="content-height">100%</xsl:attribute> -->
|
2751
|
+
<xsl:attribute name="height">5mm</xsl:attribute>
|
2752
|
+
<xsl:attribute name="content-width">100%</xsl:attribute>
|
2753
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
2754
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
2755
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
|
2756
|
+
<g>
|
2757
|
+
<xsl:if test="$type = 'closing'">
|
2758
|
+
<xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
|
2759
|
+
</xsl:if>
|
2760
|
+
<polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
|
2761
|
+
<line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
|
2762
|
+
</g>
|
2763
|
+
<text font-family="Arial" x="15" y="57" font-size="40pt">
|
2764
|
+
<xsl:if test="$type = 'closing'">
|
2765
|
+
<xsl:attribute name="x">25</xsl:attribute>
|
2766
|
+
</xsl:if>
|
2767
|
+
<xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
|
2768
|
+
</text>
|
2769
|
+
</svg>
|
2770
|
+
</fo:instream-foreign-object>
|
2653
2771
|
</xsl:template><xsl:template match="*[local-name()='del']">
|
2654
2772
|
<fo:inline xsl:use-attribute-sets="del-style">
|
2655
2773
|
<xsl:apply-templates/>
|
@@ -2992,13 +3110,23 @@
|
|
2992
3110
|
<xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
|
2993
3111
|
<xsl:value-of select="substring($str, 2)"/>
|
2994
3112
|
</xsl:template><xsl:template match="mathml:math">
|
2995
|
-
<
|
3113
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3114
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3115
|
+
|
3116
|
+
<fo:inline xsl:use-attribute-sets="mathml-style">
|
3117
|
+
|
3118
|
+
|
3119
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3120
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3121
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3122
|
+
</xsl:call-template>
|
2996
3123
|
|
2997
3124
|
<xsl:variable name="mathml">
|
2998
3125
|
<xsl:apply-templates select="." mode="mathml"/>
|
2999
3126
|
</xsl:variable>
|
3000
3127
|
<fo:instream-foreign-object fox:alt-text="Math">
|
3001
3128
|
|
3129
|
+
|
3002
3130
|
<!-- <xsl:copy-of select="."/> -->
|
3003
3131
|
<xsl:copy-of select="xalan:nodeset($mathml)"/>
|
3004
3132
|
</fo:instream-foreign-object>
|
@@ -3242,8 +3370,15 @@
|
|
3242
3370
|
</fo:inline>
|
3243
3371
|
</xsl:if>
|
3244
3372
|
</xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
|
3373
|
+
<xsl:variable name="isAdded" select="@added"/>
|
3374
|
+
<xsl:variable name="isDeleted" select="@deleted"/>
|
3245
3375
|
<fo:block-container id="{@id}">
|
3246
3376
|
|
3377
|
+
<xsl:call-template name="setTrackChangesStyles">
|
3378
|
+
<xsl:with-param name="isAdded" select="$isAdded"/>
|
3379
|
+
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
3380
|
+
</xsl:call-template>
|
3381
|
+
|
3247
3382
|
<fo:block>
|
3248
3383
|
<xsl:apply-templates/>
|
3249
3384
|
</fo:block>
|
@@ -3263,6 +3398,8 @@
|
|
3263
3398
|
<xsl:apply-templates/>
|
3264
3399
|
</fo:block>
|
3265
3400
|
</xsl:template><xsl:template match="*[local-name() = 'image']">
|
3401
|
+
<xsl:variable name="isAdded" select="../@added"/>
|
3402
|
+
<xsl:variable name="isDeleted" select="../@deleted"/>
|
3266
3403
|
<xsl:choose>
|
3267
3404
|
<xsl:when test="ancestor::*[local-name() = 'title']">
|
3268
3405
|
<fo:inline padding-left="1mm" padding-right="1mm">
|
@@ -3278,7 +3415,26 @@
|
|
3278
3415
|
<xsl:variable name="src">
|
3279
3416
|
<xsl:call-template name="image_src"/>
|
3280
3417
|
</xsl:variable>
|
3281
|
-
|
3418
|
+
|
3419
|
+
<xsl:choose>
|
3420
|
+
<xsl:when test="$isDeleted = 'true'">
|
3421
|
+
<!-- enclose in svg -->
|
3422
|
+
<fo:instream-foreign-object fox:alt-text="Image {@alt}">
|
3423
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
3424
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
3425
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
3426
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
3427
|
+
|
3428
|
+
|
3429
|
+
<xsl:apply-templates select="." mode="cross_image"/>
|
3430
|
+
|
3431
|
+
</fo:instream-foreign-object>
|
3432
|
+
</xsl:when>
|
3433
|
+
<xsl:otherwise>
|
3434
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
|
3435
|
+
</xsl:otherwise>
|
3436
|
+
</xsl:choose>
|
3437
|
+
|
3282
3438
|
</fo:block>
|
3283
3439
|
</xsl:otherwise>
|
3284
3440
|
</xsl:choose>
|
@@ -3294,6 +3450,55 @@
|
|
3294
3450
|
<xsl:value-of select="@src"/>
|
3295
3451
|
</xsl:otherwise>
|
3296
3452
|
</xsl:choose>
|
3453
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image">
|
3454
|
+
<xsl:choose>
|
3455
|
+
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
|
3456
|
+
<xsl:variable name="src">
|
3457
|
+
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
|
3458
|
+
</xsl:variable>
|
3459
|
+
<xsl:variable name="width" select="document($src)/@width"/>
|
3460
|
+
<xsl:variable name="height" select="document($src)/@height"/>
|
3461
|
+
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
|
3462
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
|
3463
|
+
</svg>
|
3464
|
+
</xsl:when>
|
3465
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
3466
|
+
<xsl:variable name="src">
|
3467
|
+
<xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
|
3468
|
+
</xsl:variable>
|
3469
|
+
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
3470
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
3471
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
3472
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
3473
|
+
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
|
3474
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
|
3475
|
+
</svg>
|
3476
|
+
</xsl:when>
|
3477
|
+
<xsl:otherwise>
|
3478
|
+
<xsl:variable name="base64String" select="substring-after(@src, 'base64,')"/>
|
3479
|
+
<xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/>
|
3480
|
+
<xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/>
|
3481
|
+
<xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
|
3482
|
+
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
|
3483
|
+
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
|
3484
|
+
<!-- width=<xsl:value-of select="$width"/> -->
|
3485
|
+
<xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
|
3486
|
+
<!-- height=<xsl:value-of select="$height"/> -->
|
3487
|
+
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
|
3488
|
+
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
|
3489
|
+
<xsl:call-template name="svg_cross">
|
3490
|
+
<xsl:with-param name="width" select="$width"/>
|
3491
|
+
<xsl:with-param name="height" select="$height"/>
|
3492
|
+
</xsl:call-template>
|
3493
|
+
</svg>
|
3494
|
+
</xsl:otherwise>
|
3495
|
+
</xsl:choose>
|
3496
|
+
|
3497
|
+
</xsl:template><xsl:template name="svg_cross">
|
3498
|
+
<xsl:param name="width"/>
|
3499
|
+
<xsl:param name="height"/>
|
3500
|
+
<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; "/>
|
3501
|
+
<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; "/>
|
3297
3502
|
</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">
|
3298
3503
|
<xsl:apply-templates mode="contents"/>
|
3299
3504
|
<xsl:text> </xsl:text>
|
@@ -3836,6 +4041,7 @@
|
|
3836
4041
|
<xsl:variable name="element">
|
3837
4042
|
block
|
3838
4043
|
|
4044
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
|
3839
4045
|
</xsl:variable>
|
3840
4046
|
<xsl:choose>
|
3841
4047
|
<xsl:when test="ancestor::*[local-name() = 'appendix']">
|
@@ -3843,7 +4049,7 @@
|
|
3843
4049
|
<xsl:apply-templates/>
|
3844
4050
|
</fo:inline>
|
3845
4051
|
</xsl:when>
|
3846
|
-
<xsl:when test="normalize-space($element)
|
4052
|
+
<xsl:when test="contains(normalize-space($element), 'block')">
|
3847
4053
|
<fo:block xsl:use-attribute-sets="example-name-style">
|
3848
4054
|
<xsl:apply-templates/>
|
3849
4055
|
</fo:block>
|
@@ -4066,7 +4272,8 @@
|
|
4066
4272
|
</fo:inline>
|
4067
4273
|
</xsl:when>
|
4068
4274
|
<xsl:otherwise>
|
4069
|
-
<
|
4275
|
+
<xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
|
4276
|
+
<fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/></fo:inline>
|
4070
4277
|
</xsl:otherwise>
|
4071
4278
|
</xsl:choose>
|
4072
4279
|
|
@@ -4779,4 +4986,44 @@
|
|
4779
4986
|
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
|
4780
4987
|
</xsl:choose>
|
4781
4988
|
|
4989
|
+
</xsl:template><xsl:template name="setTrackChangesStyles">
|
4990
|
+
<xsl:param name="isAdded"/>
|
4991
|
+
<xsl:param name="isDeleted"/>
|
4992
|
+
<xsl:choose>
|
4993
|
+
<xsl:when test="local-name() = 'math'">
|
4994
|
+
<xsl:if test="$isAdded = 'true'">
|
4995
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
|
4996
|
+
</xsl:if>
|
4997
|
+
<xsl:if test="$isDeleted = 'true'">
|
4998
|
+
<xsl:attribute name="background-color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
|
4999
|
+
</xsl:if>
|
5000
|
+
</xsl:when>
|
5001
|
+
<xsl:otherwise>
|
5002
|
+
<xsl:if test="$isAdded = 'true'">
|
5003
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-added"/></xsl:attribute>
|
5004
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
5005
|
+
</xsl:if>
|
5006
|
+
<xsl:if test="$isDeleted = 'true'">
|
5007
|
+
<xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute>
|
5008
|
+
<xsl:if test="local-name() = 'table'">
|
5009
|
+
<xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
|
5010
|
+
</xsl:if>
|
5011
|
+
<!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
|
5012
|
+
<xsl:attribute name="padding">2mm</xsl:attribute>
|
5013
|
+
</xsl:if>
|
5014
|
+
</xsl:otherwise>
|
5015
|
+
</xsl:choose>
|
5016
|
+
</xsl:template><xsl:variable name="LRM" select="''"/><xsl:variable name="RLM" select="''"/><xsl:template name="setWritingMode">
|
5017
|
+
<xsl:if test="$lang = 'ar'">
|
5018
|
+
<xsl:attribute name="writing-mode">rl-tb</xsl:attribute>
|
5019
|
+
</xsl:if>
|
5020
|
+
</xsl:template><xsl:template name="setAlignment">
|
5021
|
+
<xsl:param name="align" select="normalize-space(@align)"/>
|
5022
|
+
<xsl:choose>
|
5023
|
+
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
5024
|
+
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
5025
|
+
<xsl:when test="$align != ''">
|
5026
|
+
<xsl:value-of select="$align"/>
|
5027
|
+
</xsl:when>
|
5028
|
+
</xsl:choose>
|
4782
5029
|
</xsl:template></xsl:stylesheet>
|
data/lib/metanorma/cc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-cc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|