metanorma-iec 1.3.7 → 1.3.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5b9cbe5c402a7dbd3a2b074aefdc52fa620a62c515d8a8d32a904c2198d4c5e
4
- data.tar.gz: 43958dfa8f657c760a67c35d10403123fde662527f0c94402a7f32ab2e582ad2
3
+ metadata.gz: 7b94c69e927a8b8c73d26f2cac4b62cf964d0b07808ac439725a3347dcde5c6c
4
+ data.tar.gz: b989a9d79f1702966de258316b6a30195e74e9ea7017a5bf5f9555705f86b9f8
5
5
  SHA512:
6
- metadata.gz: 5fa2ca8ae28b7ae9d060a1900f72a362f2d3f64b7cfb36a3b7e537270720be9c01b7eb5df31ca86ce263cc59b3dc08556d517c8c7aab4f9d4170846261b0a197
7
- data.tar.gz: dd32106b4774c119cdd10ce89944f116d146906f70e0ecb29e8094fe45340319c35e1dcc308ebf1f0c95699b6a398b4f970b5878e7730eee27e169d4360841ee
6
+ metadata.gz: aef2a09662816bee549c437512f053752a849e4c9d9898b3eed57dcb5014ce3633ec783e3bd79251635ca2215f799e7a9a7ee5b0b64b1e84b50c26a6f665552b
7
+ data.tar.gz: 204575179dc2de75eaa6b46e5626b0ee404173b60b5f9bec28b298f37cf59dc58121ccea39ff132958c868ea256a408f755ef1613a18977f02d49424194fe867
@@ -32,6 +32,18 @@
32
32
  <ref name="DocumentType"/>
33
33
  </element>
34
34
  </define>
35
+ <define name="section-title">
36
+ <element name="title">
37
+ <zeroOrMore>
38
+ <ref name="TextElement"/>
39
+ </zeroOrMore>
40
+ </element>
41
+ <zeroOrMore>
42
+ <element name="variant-title">
43
+ <ref name="TypedTitleString"/>
44
+ </element>
45
+ </zeroOrMore>
46
+ </define>
35
47
  <define name="hyperlink">
36
48
  <element name="link">
37
49
  <attribute name="target">
@@ -158,15 +170,17 @@
158
170
  <data type="boolean"/>
159
171
  </attribute>
160
172
  </optional>
161
- <attribute name="type">
162
- <choice>
163
- <value>roman</value>
164
- <value>alphabet</value>
165
- <value>arabic</value>
166
- <value>roman_upper</value>
167
- <value>alphabet_upper</value>
168
- </choice>
169
- </attribute>
173
+ <optional>
174
+ <attribute name="type">
175
+ <choice>
176
+ <value>roman</value>
177
+ <value>alphabet</value>
178
+ <value>arabic</value>
179
+ <value>roman_upper</value>
180
+ <value>alphabet_upper</value>
181
+ </choice>
182
+ </attribute>
183
+ </optional>
170
184
  <oneOrMore>
171
185
  <ref name="li"/>
172
186
  </oneOrMore>
@@ -976,6 +990,16 @@
976
990
  <data type="boolean"/>
977
991
  </attribute>
978
992
  </optional>
993
+ <optional>
994
+ <attribute name="linkmention">
995
+ <data type="boolean"/>
996
+ </attribute>
997
+ </optional>
998
+ <optional>
999
+ <attribute name="linkref">
1000
+ <data type="boolean"/>
1001
+ </attribute>
1002
+ </optional>
979
1003
  <optional>
980
1004
  <element name="refterm">
981
1005
  <zeroOrMore>
@@ -1011,8 +1035,14 @@
1011
1035
  <ref name="imagemap"/>
1012
1036
  <ref name="svgmap"/>
1013
1037
  <ref name="inputform"/>
1038
+ <ref name="toc"/>
1014
1039
  </choice>
1015
1040
  </define>
1041
+ <define name="toc">
1042
+ <element name="toc">
1043
+ <ref name="ul"/>
1044
+ </element>
1045
+ </define>
1016
1046
  <define name="inputform">
1017
1047
  <element name="form">
1018
1048
  <attribute name="id">
@@ -1254,6 +1284,12 @@
1254
1284
  <optional>
1255
1285
  <attribute name="type"/>
1256
1286
  </optional>
1287
+ <optional>
1288
+ <attribute name="identifier"/>
1289
+ </optional>
1290
+ <optional>
1291
+ <attribute name="prefix"/>
1292
+ </optional>
1257
1293
  <text/>
1258
1294
  </define>
1259
1295
  <define name="ics">
@@ -1674,7 +1710,9 @@
1674
1710
  <zeroOrMore>
1675
1711
  <ref name="termgrammar"/>
1676
1712
  </zeroOrMore>
1677
- <ref name="definition"/>
1713
+ <oneOrMore>
1714
+ <ref name="termdefinition"/>
1715
+ </oneOrMore>
1678
1716
  <zeroOrMore>
1679
1717
  <ref name="termnote"/>
1680
1718
  </zeroOrMore>
@@ -1737,7 +1775,7 @@
1737
1775
  </oneOrMore>
1738
1776
  </element>
1739
1777
  </define>
1740
- <define name="definition">
1778
+ <define name="termdefinition">
1741
1779
  <element name="definition">
1742
1780
  <oneOrMore>
1743
1781
  <choice>
@@ -1746,6 +1784,9 @@
1746
1784
  <ref name="formula"/>
1747
1785
  </choice>
1748
1786
  </oneOrMore>
1787
+ <zeroOrMore>
1788
+ <ref name="termsource"/>
1789
+ </zeroOrMore>
1749
1790
  </element>
1750
1791
  </define>
1751
1792
  <define name="termnote">
@@ -174,7 +174,7 @@
174
174
  <optional>
175
175
  <ref name="termdomain"/>
176
176
  </optional>
177
- <ref name="definition"/>
177
+ <ref name="termdefinition"/>
178
178
  <zeroOrMore>
179
179
  <ref name="termnote"/>
180
180
  </zeroOrMore>
@@ -184,6 +184,9 @@
184
184
  <zeroOrMore>
185
185
  <ref name="termsource"/>
186
186
  </zeroOrMore>
187
+ <zeroOrMore>
188
+ <ref name="term"/>
189
+ </zeroOrMore>
187
190
  </element>
188
191
  </define>
189
192
  <define name="annex">
@@ -64,9 +64,9 @@
64
64
  <optional>
65
65
  <ref name="label"/>
66
66
  </optional>
67
- <optional>
67
+ <zeroOrMore>
68
68
  <ref name="subject"/>
69
- </optional>
69
+ </zeroOrMore>
70
70
  <zeroOrMore>
71
71
  <ref name="reqinherit"/>
72
72
  </zeroOrMore>
@@ -80,6 +80,7 @@
80
80
  <ref name="verification"/>
81
81
  <ref name="import"/>
82
82
  <ref name="description"/>
83
+ <ref name="component"/>
83
84
  </choice>
84
85
  </zeroOrMore>
85
86
  <optional>
@@ -105,12 +106,16 @@
105
106
  </define>
106
107
  <define name="subject">
107
108
  <element name="subject">
108
- <text/>
109
+ <oneOrMore>
110
+ <ref name="TextElement"/>
111
+ </oneOrMore>
109
112
  </element>
110
113
  </define>
111
114
  <define name="reqinherit">
112
115
  <element name="inherit">
113
- <text/>
116
+ <oneOrMore>
117
+ <ref name="TextElement"/>
118
+ </oneOrMore>
114
119
  </element>
115
120
  </define>
116
121
  <define name="measurementtarget">
@@ -138,6 +143,12 @@
138
143
  <ref name="RequirementSubpart"/>
139
144
  </element>
140
145
  </define>
146
+ <define name="component">
147
+ <element name="component">
148
+ <attribute name="class"/>
149
+ <ref name="RequirementSubpart"/>
150
+ </element>
151
+ </define>
141
152
  <define name="reqt_references">
142
153
  <element name="references">
143
154
  <oneOrMore>
@@ -1353,7 +1353,7 @@
1353
1353
  </fo:block-container>
1354
1354
  <fo:block-container margin-left="8.5mm">
1355
1355
  <fo:block-container margin-left="0mm">
1356
- <fo:block font-size="12pt" font-weight="bold" color="{$color_blue}" margin-bottom="16pt">
1356
+ <fo:block font-size="12pt" font-weight="bold" color="{$color_blue}" margin-bottom="16pt" role="H1">
1357
1357
  <!-- Example:
1358
1358
  Electromagnetic compatibility (EMC) –
1359
1359
  Part 4-5: Testing and measurement techniques – Surge immunity test
@@ -1379,7 +1379,7 @@
1379
1379
  <xsl:value-of select="$title-part"/>
1380
1380
  </xsl:if>
1381
1381
  </fo:block>
1382
- <fo:block font-size="12pt" font-weight="bold">
1382
+ <fo:block font-size="12pt" font-weight="bold" role="H1">
1383
1383
  <!-- Example: Compatibilité électromagnétique (CEM) –
1384
1384
  Partie 4-5: Techniques d'essai et de mesure – Essai d'immunité aux ondes de
1385
1385
  choc -->
@@ -1423,111 +1423,112 @@
1423
1423
  <xsl:template name="insertTOCpages">
1424
1424
  <xsl:param name="contents"/>
1425
1425
  <fo:block-container>
1426
- <fo:block font-size="12pt" text-align="center" margin-bottom="22pt">
1427
- <xsl:variable name="title-toc">
1428
- <xsl:call-template name="getTitle">
1429
- <xsl:with-param name="name" select="'title-toc'"/>
1426
+ <fo:block role="TOC">
1427
+ <fo:block font-size="12pt" text-align="center" margin-bottom="22pt" role="H1">
1428
+ <xsl:variable name="title-toc">
1429
+ <xsl:call-template name="getTitle">
1430
+ <xsl:with-param name="name" select="'title-toc'"/>
1431
+ </xsl:call-template>
1432
+ </xsl:variable>
1433
+ <xsl:call-template name="addLetterSpacing">
1434
+ <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($title-toc))"/>
1430
1435
  </xsl:call-template>
1431
- </xsl:variable>
1432
- <xsl:call-template name="addLetterSpacing">
1433
- <xsl:with-param name="text" select="java:toUpperCase(java:java.lang.String.new($title-toc))"/>
1434
- </xsl:call-template>
1435
- </fo:block>
1436
-
1437
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [@display = 'true']
1438
- [@level &lt;= 3]
1439
- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1440
- <fo:block text-align-last="justify">
1441
- <xsl:if test="@level = 1">
1442
- <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
1443
- </xsl:if>
1444
- <xsl:if test="@level = 2">
1445
- <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
1446
- </xsl:if>
1447
- <xsl:if test="@level = 3">
1448
- <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
1449
- </xsl:if>
1450
- <!-- <xsl:if test="@level &gt;= 2 and @section != ''">
1451
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
1452
- </xsl:if> -->
1453
-
1454
- <!-- <xsl:choose>
1455
- <xsl:when test="@section != '' and not(@display-section = 'false')"> -->
1456
- <fo:list-block>
1457
- <xsl:attribute name="margin-left">
1458
- <xsl:choose>
1459
- <xsl:when test="@level = 2">8mm</xsl:when>
1460
- <xsl:when test="@level = 3">23mm</xsl:when>
1461
- <xsl:otherwise>0mm</xsl:otherwise>
1462
- </xsl:choose>
1463
- </xsl:attribute>
1464
- <xsl:attribute name="provisional-distance-between-starts">
1465
- <xsl:choose>
1466
- <xsl:when test="@section = ''">0mm</xsl:when>
1467
- <xsl:when test="@level = 1">8mm</xsl:when>
1468
- <xsl:when test="@level = 2">15mm</xsl:when>
1469
- <xsl:when test="@level = 3">19mm</xsl:when>
1470
- <xsl:otherwise>0mm</xsl:otherwise>
1471
- </xsl:choose>
1472
- </xsl:attribute>
1473
- <fo:list-item>
1474
- <fo:list-item-label end-indent="label-end()">
1475
- <fo:block>
1476
- <xsl:value-of select="@section"/>
1477
- </fo:block>
1478
- </fo:list-item-label>
1479
- <fo:list-item-body start-indent="body-start()">
1480
- <fo:block text-align-last="justify">
1481
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1482
- <xsl:variable name="title">
1483
- <xsl:apply-templates select="title"/>
1484
- </xsl:variable>
1485
- <xsl:call-template name="addLetterSpacing">
1486
- <xsl:with-param name="text" select="$title"/>
1487
- </xsl:call-template>
1488
- <xsl:text> </xsl:text>
1489
- <fo:inline keep-together.within-line="always">
1490
- <fo:leader leader-pattern="dots"/>
1491
- <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1492
- </fo:inline>
1493
- </fo:basic-link>
1494
- </fo:block>
1495
- </fo:list-item-body>
1496
- </fo:list-item>
1497
- </fo:list-block>
1498
1436
  </fo:block>
1499
- </xsl:for-each>
1500
-
1501
- <xsl:if test="//iec:figure[@id and iec:name]">
1502
- <fo:block margin-bottom="5pt"> </fo:block>
1503
- <xsl:for-each select="//iec:figure[@id and iec:name]">
1504
- <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm">
1505
- <fo:basic-link internal-destination="{@id}" fox:alt-text="Figure {@id}">
1506
- <xsl:apply-templates select="iec:name" mode="contents"/>
1507
- <fo:inline keep-together.within-line="always">
1508
- <fo:leader leader-pattern="dots"/>
1509
- <fo:page-number-citation ref-id="{@id}"/>
1510
- </fo:inline>
1511
- </fo:basic-link>
1512
- </fo:block>
1513
- </xsl:for-each>
1514
- </xsl:if>
1515
-
1516
- <xsl:if test="//iec:table[@id and iec:name]">
1517
- <fo:block margin-bottom="5pt"> </fo:block>
1518
- <xsl:for-each select="//iec:table[@id and iec:name]">
1519
- <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm">
1520
- <fo:basic-link internal-destination="{@id}" fox:alt-text="Table {@id}">
1521
- <xsl:apply-templates select="iec:name" mode="contents"/>
1522
- <fo:inline keep-together.within-line="always">
1523
- <fo:leader leader-pattern="dots"/>
1524
- <fo:page-number-citation ref-id="{@id}"/>
1525
- </fo:inline>
1526
- </fo:basic-link>
1437
+
1438
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [@display = 'true']
1439
+ [@level &lt;= 3]
1440
+ [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1441
+ <fo:block text-align-last="justify" role="TOCI">
1442
+ <xsl:if test="@level = 1">
1443
+ <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
1444
+ </xsl:if>
1445
+ <xsl:if test="@level = 2">
1446
+ <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
1447
+ </xsl:if>
1448
+ <xsl:if test="@level = 3">
1449
+ <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
1450
+ </xsl:if>
1451
+ <!-- <xsl:if test="@level &gt;= 2 and @section != ''">
1452
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
1453
+ </xsl:if> -->
1454
+
1455
+ <!-- <xsl:choose>
1456
+ <xsl:when test="@section != '' and not(@display-section = 'false')"> -->
1457
+ <fo:list-block>
1458
+ <xsl:attribute name="margin-left">
1459
+ <xsl:choose>
1460
+ <xsl:when test="@level = 2">8mm</xsl:when>
1461
+ <xsl:when test="@level = 3">23mm</xsl:when>
1462
+ <xsl:otherwise>0mm</xsl:otherwise>
1463
+ </xsl:choose>
1464
+ </xsl:attribute>
1465
+ <xsl:attribute name="provisional-distance-between-starts">
1466
+ <xsl:choose>
1467
+ <xsl:when test="@section = ''">0mm</xsl:when>
1468
+ <xsl:when test="@level = 1">8mm</xsl:when>
1469
+ <xsl:when test="@level = 2">15mm</xsl:when>
1470
+ <xsl:when test="@level = 3">19mm</xsl:when>
1471
+ <xsl:otherwise>0mm</xsl:otherwise>
1472
+ </xsl:choose>
1473
+ </xsl:attribute>
1474
+ <fo:list-item>
1475
+ <fo:list-item-label end-indent="label-end()">
1476
+ <fo:block>
1477
+ <xsl:value-of select="@section"/>
1478
+ </fo:block>
1479
+ </fo:list-item-label>
1480
+ <fo:list-item-body start-indent="body-start()">
1481
+ <fo:block text-align-last="justify">
1482
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1483
+ <xsl:variable name="title">
1484
+ <xsl:apply-templates select="title"/>
1485
+ </xsl:variable>
1486
+ <xsl:call-template name="addLetterSpacing">
1487
+ <xsl:with-param name="text" select="$title"/>
1488
+ </xsl:call-template>
1489
+ <xsl:text> </xsl:text>
1490
+ <fo:inline keep-together.within-line="always">
1491
+ <fo:leader leader-pattern="dots"/>
1492
+ <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
1493
+ </fo:inline>
1494
+ </fo:basic-link>
1495
+ </fo:block>
1496
+ </fo:list-item-body>
1497
+ </fo:list-item>
1498
+ </fo:list-block>
1527
1499
  </fo:block>
1528
1500
  </xsl:for-each>
1529
- </xsl:if>
1530
-
1501
+
1502
+ <xsl:if test="//iec:figure[@id and iec:name]">
1503
+ <fo:block margin-bottom="5pt"> </fo:block>
1504
+ <xsl:for-each select="//iec:figure[@id and iec:name]">
1505
+ <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm" role="TOCI">
1506
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="Figure {@id}">
1507
+ <xsl:apply-templates select="iec:name" mode="contents"/>
1508
+ <fo:inline keep-together.within-line="always">
1509
+ <fo:leader leader-pattern="dots"/>
1510
+ <fo:page-number-citation ref-id="{@id}"/>
1511
+ </fo:inline>
1512
+ </fo:basic-link>
1513
+ </fo:block>
1514
+ </xsl:for-each>
1515
+ </xsl:if>
1516
+
1517
+ <xsl:if test="//iec:table[@id and iec:name]">
1518
+ <fo:block margin-bottom="5pt"> </fo:block>
1519
+ <xsl:for-each select="//iec:table[@id and iec:name]">
1520
+ <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm" role="TOCI">
1521
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="Table {@id}">
1522
+ <xsl:apply-templates select="iec:name" mode="contents"/>
1523
+ <fo:inline keep-together.within-line="always">
1524
+ <fo:leader leader-pattern="dots"/>
1525
+ <fo:page-number-citation ref-id="{@id}"/>
1526
+ </fo:inline>
1527
+ </fo:basic-link>
1528
+ </fo:block>
1529
+ </xsl:for-each>
1530
+ </xsl:if>
1531
+ </fo:block>
1531
1532
  </fo:block-container>
1532
1533
  </xsl:template>
1533
1534
 
@@ -1539,7 +1540,7 @@
1539
1540
  <fo:block><xsl:value-of select="/iec:iec-standard/iec:localized-strings/iec:localized-string[@key='IEC' and @language=$lang]"/></fo:block>
1540
1541
  <fo:block>___________</fo:block>
1541
1542
  <fo:block> </fo:block>
1542
- <fo:block font-weight="bold">
1543
+ <fo:block font-weight="bold" role="H1">
1543
1544
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-intro']))"/>
1544
1545
  <xsl:text> — </xsl:text>
1545
1546
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-main']))"/>
@@ -1582,7 +1583,7 @@
1582
1583
  <!-- <fo:block><xsl:value-of select="$organization"/></fo:block>
1583
1584
  <fo:block>____________</fo:block>
1584
1585
  <fo:block>&#xa0;</fo:block> -->
1585
- <fo:block font-weight="bold">
1586
+ <fo:block font-weight="bold" role="H1">
1586
1587
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-intro']))"/>
1587
1588
  <xsl:text> — </xsl:text>
1588
1589
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(/iec:iec-standard/iec:bibdata/iec:title[@language = $lang and @type = 'title-main']))"/>
@@ -1626,7 +1627,10 @@
1626
1627
  </xsl:template>
1627
1628
 
1628
1629
  <xsl:template match="iec:feedback-statement/iec:clause[@id = 'boilerplate-cenelec-attention']//iec:title" priority="3">
1629
- <fo:block font-size="8pt" font-weight="bold" margin-bottom="10pt">
1630
+ <xsl:variable name="level">
1631
+ <xsl:call-template name="getLevel"/>
1632
+ </xsl:variable>
1633
+ <fo:block font-size="8pt" font-weight="bold" margin-bottom="10pt" role="H{$level}">
1630
1634
  <xsl:apply-templates/>
1631
1635
  </fo:block>
1632
1636
  </xsl:template>
@@ -1653,7 +1657,10 @@
1653
1657
  </xsl:template>
1654
1658
 
1655
1659
  <xsl:template match="iec:feedback-statement//iec:clause/iec:title" priority="2">
1656
- <fo:block font-weight="bold" keep-with-next="always"><xsl:apply-templates/></fo:block>
1660
+ <xsl:variable name="level">
1661
+ <xsl:call-template name="getLevel"/>
1662
+ </xsl:variable>
1663
+ <fo:block font-weight="bold" keep-with-next="always" role="H{$level}"><xsl:apply-templates/></fo:block>
1657
1664
  </xsl:template>
1658
1665
 
1659
1666
  <xsl:template match="iec:feedback-statement//iec:clause/iec:p" priority="2">
@@ -1756,7 +1763,10 @@
1756
1763
  <!-- ============================= -->
1757
1764
 
1758
1765
  <xsl:template match="iec:license-statement//iec:title">
1759
- <fo:block text-align="center" font-weight="bold">
1766
+ <xsl:variable name="level">
1767
+ <xsl:call-template name="getLevel"/>
1768
+ </xsl:variable>
1769
+ <fo:block text-align="center" font-weight="bold" role="H{$level}">
1760
1770
  <xsl:apply-templates/>
1761
1771
  </fo:block>
1762
1772
  </xsl:template>
@@ -1772,7 +1782,10 @@
1772
1782
  </xsl:template>
1773
1783
 
1774
1784
  <xsl:template match="iec:license-statement//iec:title" mode="cover-page-internal">
1775
- <fo:block text-align="center" font-weight="bold">
1785
+ <xsl:variable name="level">
1786
+ <xsl:call-template name="getLevel"/>
1787
+ </xsl:variable>
1788
+ <fo:block text-align="center" font-weight="bold" role="H{$level}">
1776
1789
  <xsl:apply-templates/>
1777
1790
  </fo:block>
1778
1791
  </xsl:template>
@@ -1890,8 +1903,9 @@
1890
1903
  <!-- title -->
1891
1904
  <!-- ====== -->
1892
1905
  <xsl:template match="iec:introduction/iec:title">
1893
- <fo:block font-size="12pt" text-align="center" margin-bottom="12pt">
1906
+ <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" role="H1">
1894
1907
  <xsl:apply-templates/>
1908
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1895
1909
  </fo:block>
1896
1910
  </xsl:template>
1897
1911
  <xsl:template match="iec:introduction/iec:title/text()">
@@ -1901,14 +1915,15 @@
1901
1915
  </xsl:template>
1902
1916
 
1903
1917
  <xsl:template match="iec:annex/iec:title">
1904
- <fo:block font-size="12pt" text-align="center" margin-bottom="32pt" keep-with-next="always">
1918
+ <fo:block font-size="12pt" text-align="center" margin-bottom="32pt" keep-with-next="always" role="H1">
1905
1919
  <xsl:apply-templates/>
1920
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1906
1921
  </fo:block>
1907
1922
  </xsl:template>
1908
1923
 
1909
1924
  <!-- Bibliography -->
1910
1925
  <xsl:template match="iec:references[not(@normative='true')]/iec:title">
1911
- <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always">
1926
+ <fo:block font-size="12pt" text-align="center" margin-bottom="12pt" keep-with-next="always" role="H1">
1912
1927
  <xsl:apply-templates/>
1913
1928
  </fo:block>
1914
1929
  </xsl:template>
@@ -1936,12 +1951,12 @@
1936
1951
 
1937
1952
  <xsl:choose>
1938
1953
  <xsl:when test="../@inline-header = 'true'">
1939
- <fo:inline font-size="{$font-size}" font-weight="bold">
1954
+ <fo:inline font-size="{$font-size}" font-weight="bold" role="H{$level}">
1940
1955
  <xsl:apply-templates/>
1941
1956
  </fo:inline>
1942
1957
  </xsl:when>
1943
1958
  <xsl:otherwise>
1944
- <fo:block font-size="{$font-size}" font-weight="bold" keep-with-next="always">
1959
+ <fo:block font-size="{$font-size}" font-weight="bold" keep-with-next="always" role="H{$level}">
1945
1960
  <xsl:attribute name="space-before"> <!-- margin-top -->
1946
1961
  <xsl:choose>
1947
1962
  <xsl:when test="$level = 2 and ancestor::iec:annex">22pt</xsl:when>
@@ -1959,6 +1974,7 @@
1959
1974
  </xsl:choose>
1960
1975
  </xsl:attribute>
1961
1976
  <xsl:apply-templates/>
1977
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
1962
1978
  </fo:block>
1963
1979
  </xsl:otherwise>
1964
1980
  </xsl:choose>
@@ -2202,8 +2218,10 @@
2202
2218
 
2203
2219
 
2204
2220
  <xsl:template match="iec:preferred">
2205
-
2206
- <fo:block line-height="1.1" space-before="14pt">
2221
+ <xsl:variable name="levelTerm">
2222
+ <xsl:call-template name="getLevelTermName"/>
2223
+ </xsl:variable>
2224
+ <fo:block line-height="1.1" space-before="14pt" role="H{$levelTerm}">
2207
2225
  <fo:block font-weight="bold" keep-with-next="always">
2208
2226
  <xsl:apply-templates select="ancestor::iec:term/iec:name" mode="presentation"/>
2209
2227
  </fo:block>
@@ -2320,7 +2338,7 @@
2320
2338
 
2321
2339
 
2322
2340
  <xsl:template name="insertHeaderFooter">
2323
- <fo:static-content flow-name="header-even">
2341
+ <fo:static-content flow-name="header-even" role="artifact">
2324
2342
  <fo:block-container height="25mm" display-align="after">
2325
2343
  <fo:table table-layout="fixed" width="100%">
2326
2344
  <fo:table-column column-width="45%"/>
@@ -2345,7 +2363,7 @@
2345
2363
  </fo:block-container>
2346
2364
  </fo:static-content>
2347
2365
 
2348
- <fo:static-content flow-name="header-odd">
2366
+ <fo:static-content flow-name="header-odd" role="artifact">
2349
2367
  <fo:block-container height="25mm" display-align="after">
2350
2368
  <fo:table table-layout="fixed" width="100%">
2351
2369
  <fo:table-column column-width="45%"/>
@@ -2653,11 +2671,12 @@
2653
2671
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2654
2672
  <xsl:attribute name="white-space">pre</xsl:attribute>
2655
2673
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
2674
+ <xsl:attribute name="role">Code</xsl:attribute>
2656
2675
 
2657
2676
 
2658
2677
 
2659
2678
 
2660
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2679
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2661
2680
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
2662
2681
  <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
2663
2682
 
@@ -2678,8 +2697,13 @@
2678
2697
 
2679
2698
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
2680
2699
 
2681
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
2682
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
2700
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
2701
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
2702
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
2703
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
2704
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
2705
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
2706
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
2683
2707
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
2684
2708
 
2685
2709
 
@@ -2750,6 +2774,7 @@
2750
2774
 
2751
2775
 
2752
2776
 
2777
+
2753
2778
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
2754
2779
 
2755
2780
  <xsl:attribute name="padding-right">10mm</xsl:attribute>
@@ -2758,7 +2783,9 @@
2758
2783
 
2759
2784
 
2760
2785
 
2761
- </xsl:attribute-set><xsl:attribute-set name="table-name-style">
2786
+ </xsl:attribute-set><xsl:variable name="table-border_">
2787
+
2788
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
2762
2789
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2763
2790
 
2764
2791
 
@@ -2879,7 +2906,8 @@
2879
2906
 
2880
2907
 
2881
2908
 
2882
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
2909
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
2910
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
2883
2911
 
2884
2912
 
2885
2913
 
@@ -2972,7 +3000,7 @@
2972
3000
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
2973
3001
 
2974
3002
 
2975
- <xsl:attribute name="font-family">Courier</xsl:attribute>
3003
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2976
3004
 
2977
3005
 
2978
3006
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
@@ -3082,11 +3110,15 @@
3082
3110
  <fo:block>&#xA0;</fo:block>
3083
3111
  </xsl:if> -->
3084
3112
 
3113
+
3114
+ <!-- Display table's name before table as standalone block -->
3085
3115
  <!-- $namespace = 'iso' or -->
3086
3116
 
3087
3117
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3088
3118
 
3089
-
3119
+
3120
+
3121
+
3090
3122
 
3091
3123
  <xsl:call-template name="fn_name_display"/>
3092
3124
 
@@ -3163,6 +3195,12 @@
3163
3195
 
3164
3196
 
3165
3197
 
3198
+
3199
+
3200
+
3201
+ <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
3202
+
3203
+
3166
3204
  <xsl:variable name="table_width">
3167
3205
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
3168
3206
  100%
@@ -3179,6 +3217,7 @@
3179
3217
 
3180
3218
 
3181
3219
 
3220
+
3182
3221
  <attribute name="border">0.5pt solid black</attribute>
3183
3222
 
3184
3223
 
@@ -3206,6 +3245,8 @@
3206
3245
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3207
3246
  </xsl:if>
3208
3247
 
3248
+
3249
+
3209
3250
  <xsl:choose>
3210
3251
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3211
3252
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -3493,9 +3534,9 @@
3493
3534
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3494
3535
  <xsl:with-param name="continued">true</xsl:with-param>
3495
3536
  </xsl:apply-templates>
3496
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3497
- <xsl:call-template name="fn_name_display"/>
3498
- </xsl:for-each>
3537
+
3538
+
3539
+
3499
3540
 
3500
3541
  </fo:table-cell>
3501
3542
  </fo:table-row>
@@ -3589,7 +3630,11 @@
3589
3630
 
3590
3631
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3591
3632
 
3592
- <xsl:if test="$isNoteOrFnExist = 'true'">
3633
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
3634
+
3635
+ </xsl:variable>
3636
+
3637
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
3593
3638
 
3594
3639
  <xsl:variable name="cols-count">
3595
3640
  <xsl:choose>
@@ -3618,6 +3663,8 @@
3618
3663
  </xsl:choose>
3619
3664
  </xsl:for-each>
3620
3665
 
3666
+
3667
+
3621
3668
  <xsl:choose>
3622
3669
  <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
3623
3670
  <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
@@ -3660,6 +3707,7 @@
3660
3707
 
3661
3708
 
3662
3709
 
3710
+
3663
3711
  <!-- for BSI (not PAS) display Notes before footnotes -->
3664
3712
 
3665
3713
 
@@ -3739,6 +3787,19 @@
3739
3787
 
3740
3788
  </fo:table-body>
3741
3789
 
3790
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
3791
+ <xsl:choose>
3792
+ <xsl:when test="substring-after(., '—') != ''">
3793
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
3794
+ </xsl:when>
3795
+ <xsl:otherwise>
3796
+ <xsl:value-of select="."/>
3797
+ </xsl:otherwise>
3798
+ </xsl:choose>
3799
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
3800
+ <xsl:apply-templates mode="presentation_name"/>
3801
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
3802
+ <xsl:apply-templates select="."/>
3742
3803
  </xsl:template><xsl:template match="*[local-name()='tr']">
3743
3804
  <xsl:variable name="parent-name" select="local-name(..)"/>
3744
3805
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -3754,6 +3815,8 @@
3754
3815
  <xsl:attribute name="border-bottom">solid black 0.5pt</xsl:attribute>
3755
3816
 
3756
3817
 
3818
+
3819
+
3757
3820
  </xsl:if>
3758
3821
  <xsl:if test="$parent-name = 'tfoot'">
3759
3822
 
@@ -3771,6 +3834,8 @@
3771
3834
 
3772
3835
 
3773
3836
 
3837
+
3838
+
3774
3839
  <!-- <xsl:if test="$namespace = 'bipm'">
3775
3840
  <xsl:attribute name="height">8mm</xsl:attribute>
3776
3841
  </xsl:if> -->
@@ -3935,14 +4000,12 @@
3935
4000
  <xsl:apply-templates/>
3936
4001
  </xsl:template><xsl:template name="fn_display">
3937
4002
  <xsl:variable name="references">
4003
+
3938
4004
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
3939
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3940
-
3941
-
3942
- <xsl:apply-templates/>
3943
- </fn>
4005
+ <xsl:call-template name="create_fn"/>
3944
4006
  </xsl:for-each>
3945
4007
  </xsl:variable>
4008
+
3946
4009
  <xsl:for-each select="xalan:nodeset($references)//fn">
3947
4010
  <xsl:variable name="reference" select="@reference"/>
3948
4011
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -3984,6 +4047,12 @@
3984
4047
  </fo:block>
3985
4048
  </xsl:if>
3986
4049
  </xsl:for-each>
4050
+ </xsl:template><xsl:template name="create_fn">
4051
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
4052
+
4053
+
4054
+ <xsl:apply-templates/>
4055
+ </fn>
3987
4056
  </xsl:template><xsl:template name="fn_name_display">
3988
4057
  <!-- <xsl:variable name="references">
3989
4058
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -4121,7 +4190,7 @@
4121
4190
 
4122
4191
 
4123
4192
 
4124
- <xsl:if test="ancestor::*[local-name()='td']">
4193
+ <xsl:if test="ancestor::*[local-name()='table']">
4125
4194
  <xsl:attribute name="font-weight">normal</xsl:attribute>
4126
4195
  <!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
4127
4196
  <xsl:attribute name="baseline-shift">15%</xsl:attribute>
@@ -4998,16 +5067,68 @@
4998
5067
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
4999
5068
  </xsl:call-template>
5000
5069
 
5070
+
5071
+
5001
5072
  <xsl:variable name="mathml">
5002
5073
  <xsl:apply-templates select="." mode="mathml"/>
5003
5074
  </xsl:variable>
5004
5075
  <fo:instream-foreign-object fox:alt-text="Math">
5005
5076
 
5006
5077
 
5078
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
5079
+ <xsl:variable name="comment_text_">
5080
+ <xsl:choose>
5081
+ <xsl:when test="normalize-space($comment_text_following) != ''">
5082
+ <xsl:value-of select="$comment_text_following"/>
5083
+ </xsl:when>
5084
+ <xsl:otherwise>
5085
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
5086
+ </xsl:otherwise>
5087
+ </xsl:choose>
5088
+ </xsl:variable>
5089
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
5090
+
5091
+ <xsl:if test="normalize-space($comment_text) != ''">
5092
+ <!-- put Mathin Alternate Text -->
5093
+ <xsl:attribute name="fox:alt-text">
5094
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
5095
+ </xsl:attribute>
5096
+ </xsl:if>
5097
+
5098
+ <xsl:variable name="mathml_content">
5099
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
5100
+ </xsl:variable>
5101
+ <!-- put MathML in Actual Text -->
5102
+ <xsl:attribute name="fox:actual-text">
5103
+ <xsl:value-of select="$mathml_content"/>
5104
+ </xsl:attribute>
5105
+
5106
+
5007
5107
  <!-- <xsl:copy-of select="."/> -->
5008
5108
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
5009
5109
  </fo:instream-foreign-object>
5010
5110
  </fo:inline>
5111
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
5112
+ <!-- <xsl:text>a+b</xsl:text> -->
5113
+ <xsl:text>&lt;</xsl:text>
5114
+ <xsl:value-of select="local-name()"/>
5115
+ <xsl:if test="local-name() = 'math'">
5116
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
5117
+ </xsl:if>
5118
+ <xsl:for-each select="@*">
5119
+ <xsl:text> </xsl:text>
5120
+ <xsl:value-of select="local-name()"/>
5121
+ <xsl:text>="</xsl:text>
5122
+ <xsl:value-of select="."/>
5123
+ <xsl:text>"</xsl:text>
5124
+ </xsl:for-each>
5125
+ <xsl:text>&gt;</xsl:text>
5126
+ <xsl:apply-templates mode="mathml_actual_text"/>
5127
+ <xsl:text>&lt;/</xsl:text>
5128
+ <xsl:value-of select="local-name()"/>
5129
+ <xsl:text>&gt;</xsl:text>
5130
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
5131
+ <xsl:value-of select="normalize-space()"/>
5011
5132
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
5012
5133
  <xsl:copy>
5013
5134
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -5017,19 +5138,6 @@
5017
5138
  <!-- replace start and end spaces to non-break space -->
5018
5139
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
5019
5140
  </xsl:copy>
5020
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
5021
- <xsl:copy>
5022
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
5023
- </xsl:copy>
5024
- <xsl:choose>
5025
- <!-- if in msub, then don't add space -->
5026
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
5027
- <!-- if next char in digit, don't add space -->
5028
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
5029
- <xsl:otherwise>
5030
- <mathml:mspace width="0.5ex"/>
5031
- </xsl:otherwise>
5032
- </xsl:choose>
5033
5141
  </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">
5034
5142
  <xsl:variable name="target">
5035
5143
  <xsl:choose>
@@ -5086,7 +5194,10 @@
5086
5194
  </fo:block>
5087
5195
  <xsl:apply-templates/>
5088
5196
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
5089
- <fo:inline><xsl:apply-templates/></fo:inline>
5197
+ <xsl:variable name="level">
5198
+ <xsl:call-template name="getLevel"/>
5199
+ </xsl:variable>
5200
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
5090
5201
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
5091
5202
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
5092
5203
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -5121,9 +5232,10 @@
5121
5232
 
5122
5233
  </xsl:variable>
5123
5234
 
5235
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
5124
5236
  <xsl:choose>
5125
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
5126
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
5237
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
5238
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
5127
5239
  </xsl:choose>
5128
5240
  <xsl:apply-templates/>
5129
5241
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -5269,7 +5381,10 @@
5269
5381
  </fo:block>
5270
5382
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
5271
5383
  <xsl:if test="normalize-space() != ''">
5272
- <fo:inline>
5384
+ <xsl:variable name="level">
5385
+ <xsl:call-template name="getLevelTermName"/>
5386
+ </xsl:variable>
5387
+ <fo:inline role="H{$level}">
5273
5388
  <xsl:apply-templates/>
5274
5389
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
5275
5390
  <xsl:text>.</xsl:text>
@@ -5342,7 +5457,24 @@
5342
5457
  </fo:instream-foreign-object>
5343
5458
  </xsl:when>
5344
5459
  <xsl:otherwise>
5345
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
5460
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
5461
+ <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
5462
+
5463
+ <xsl:variable name="img_src">
5464
+ <xsl:choose>
5465
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
5466
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
5467
+ </xsl:choose>
5468
+ </xsl:variable>
5469
+
5470
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
5471
+ <xsl:if test="number($scale) &lt; 100">
5472
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
5473
+ </xsl:if>
5474
+
5475
+ </xsl:if>
5476
+
5477
+ </fo:external-graphic>
5346
5478
  </xsl:otherwise>
5347
5479
  </xsl:choose>
5348
5480
 
@@ -5513,11 +5645,13 @@
5513
5645
  <xsl:attribute name="width">100%</xsl:attribute>
5514
5646
  <xsl:attribute name="content-height">100%</xsl:attribute>
5515
5647
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5648
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
5649
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
5516
5650
  <!-- effective height 297 - 27.4 - 13 = 256.6 -->
5517
5651
  <!-- effective width 210 - 12.5 - 25 = 172.5 -->
5518
5652
  <!-- effective height / width = 1.48, 1.4 - with title -->
5519
- <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
5520
- <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
5653
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
5654
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
5521
5655
  <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
5522
5656
  </xsl:if>
5523
5657
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -5534,6 +5668,23 @@
5534
5668
  <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
5535
5669
  <xsl:value-of select="."/>
5536
5670
  </xsl:attribute>
5671
+ </xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
5672
+ <xsl:copy>
5673
+ <xsl:apply-templates select="@*" mode="svg_update"/>
5674
+ <xsl:variable name="viewbox">
5675
+ <xsl:call-template name="split">
5676
+ <xsl:with-param name="pText" select="@viewBox"/>
5677
+ <xsl:with-param name="sep" select="' '"/>
5678
+ </xsl:call-template>
5679
+ </xsl:variable>
5680
+ <xsl:attribute name="width">
5681
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
5682
+ </xsl:attribute>
5683
+ <xsl:attribute name="height">
5684
+ <xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
5685
+ </xsl:attribute>
5686
+ <xsl:apply-templates mode="svg_update"/>
5687
+ </xsl:copy>
5537
5688
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
5538
5689
  <xsl:variable name="svg_content" select="document(@src)"/>
5539
5690
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -5864,6 +6015,7 @@
5864
6015
  </xsl:when>
5865
6016
  <xsl:otherwise>
5866
6017
  <xsl:apply-templates/>
6018
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
5867
6019
  </xsl:otherwise>
5868
6020
  </xsl:choose>
5869
6021
  </fo:block>
@@ -6004,14 +6156,6 @@
6004
6156
  <fo:block>
6005
6157
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
6006
6158
  </fo:block>
6007
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
6008
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
6009
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6010
- </fo:block>
6011
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
6012
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
6013
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
6014
- </fo:block>
6015
6159
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
6016
6160
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
6017
6161
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -6028,6 +6172,38 @@
6028
6172
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
6029
6173
  <xsl:apply-templates/>
6030
6174
  </fo:block>
6175
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
6176
+ <fo:block xsl:use-attribute-sets="subject-style">
6177
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6178
+ </fo:block>
6179
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
6180
+ <fo:block xsl:use-attribute-sets="subject-style">
6181
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
6182
+ </fo:block>
6183
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
6184
+ <fo:block xsl:use-attribute-sets="inherit-style">
6185
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
6186
+ </fo:block>
6187
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
6188
+ <fo:block xsl:use-attribute-sets="description-style">
6189
+ <xsl:apply-templates/>
6190
+ </fo:block>
6191
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
6192
+ <fo:block xsl:use-attribute-sets="specification-style">
6193
+ <xsl:apply-templates/>
6194
+ </fo:block>
6195
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
6196
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
6197
+ <xsl:apply-templates/>
6198
+ </fo:block>
6199
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
6200
+ <fo:block xsl:use-attribute-sets="verification-style">
6201
+ <xsl:apply-templates/>
6202
+ </fo:block>
6203
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
6204
+ <fo:block xsl:use-attribute-sets="import-style">
6205
+ <xsl:apply-templates/>
6206
+ </fo:block>
6031
6207
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
6032
6208
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
6033
6209
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -6179,7 +6355,19 @@
6179
6355
  </fo:inline>
6180
6356
  </xsl:if>
6181
6357
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
6182
- <fo:inline><xsl:apply-templates/></fo:inline>
6358
+ <xsl:variable name="element">inline
6359
+
6360
+ </xsl:variable>
6361
+ <xsl:choose>
6362
+ <xsl:when test="contains($element, 'block')">
6363
+ <fo:block xsl:use-attribute-sets="example-p-style">
6364
+ <xsl:apply-templates/>
6365
+ </fo:block>
6366
+ </xsl:when>
6367
+ <xsl:otherwise>
6368
+ <fo:inline><xsl:apply-templates/></fo:inline>
6369
+ </xsl:otherwise>
6370
+ </xsl:choose>
6183
6371
  </xsl:template><xsl:template match="*[local-name() = 'example']">
6184
6372
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
6185
6373
 
@@ -6720,6 +6908,7 @@
6720
6908
  </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
6721
6909
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
6722
6910
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
6911
+
6723
6912
  <xsl:apply-templates/>
6724
6913
  </fo:block>
6725
6914
  </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
@@ -6759,7 +6948,6 @@
6759
6948
  </xsl:template><xsl:template name="processBibitem">
6760
6949
 
6761
6950
 
6762
- <!-- end BIPM bibitem processing-->
6763
6951
 
6764
6952
 
6765
6953
 
@@ -6889,6 +7077,9 @@
6889
7077
  <fo:block-container border="1pt solid black" width="50%">
6890
7078
  <fo:block> </fo:block>
6891
7079
  </fo:block-container>
7080
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
7081
+ <fo:inline padding-right="5mm"> </fo:inline>
7082
+ <fo:inline><xsl:apply-templates/></fo:inline>
6892
7083
  </xsl:template><xsl:template name="convertDate">
6893
7084
  <xsl:param name="date"/>
6894
7085
  <xsl:param name="format" select="'short'"/>
@@ -7127,6 +7318,26 @@
7127
7318
  <xsl:value-of select="$level"/>
7128
7319
  </xsl:otherwise>
7129
7320
  </xsl:choose>
7321
+ </xsl:template><xsl:template name="getLevelTermName">
7322
+ <xsl:choose>
7323
+ <xsl:when test="normalize-space(../@depth) != ''">
7324
+ <xsl:value-of select="../@depth"/>
7325
+ </xsl:when>
7326
+ <xsl:otherwise>
7327
+ <xsl:variable name="title_level_">
7328
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
7329
+ <xsl:call-template name="getLevel"/>
7330
+ </xsl:for-each>
7331
+ </xsl:variable>
7332
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
7333
+ <xsl:choose>
7334
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
7335
+ <xsl:otherwise>
7336
+ <xsl:call-template name="getLevel"/>
7337
+ </xsl:otherwise>
7338
+ </xsl:choose>
7339
+ </xsl:otherwise>
7340
+ </xsl:choose>
7130
7341
  </xsl:template><xsl:template name="split">
7131
7342
  <xsl:param name="pText" select="."/>
7132
7343
  <xsl:param name="sep" select="','"/>
@@ -7224,20 +7435,40 @@
7224
7435
  </xsl:call-template>
7225
7436
  </xsl:if>
7226
7437
  </xsl:template><xsl:template name="getLocalizedString">
7227
- <xsl:param name="key"/>
7438
+ <xsl:param name="key"/>
7439
+ <xsl:param name="formatted">false</xsl:param>
7228
7440
 
7229
7441
  <xsl:variable name="curr_lang">
7230
7442
  <xsl:call-template name="getLang"/>
7231
7443
  </xsl:variable>
7232
7444
 
7233
- <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
7445
+ <xsl:variable name="data_value">
7446
+ <xsl:choose>
7447
+ <xsl:when test="$formatted = 'true'">
7448
+ <xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7449
+ </xsl:when>
7450
+ <xsl:otherwise>
7451
+ <xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
7452
+ </xsl:otherwise>
7453
+ </xsl:choose>
7454
+ </xsl:variable>
7234
7455
 
7235
7456
  <xsl:choose>
7236
- <xsl:when test="$data_value != ''">
7237
- <xsl:value-of select="$data_value"/>
7457
+ <xsl:when test="normalize-space($data_value) != ''">
7458
+ <xsl:choose>
7459
+ <xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
7460
+ <xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
7461
+ </xsl:choose>
7238
7462
  </xsl:when>
7239
7463
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
7240
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7464
+ <xsl:choose>
7465
+ <xsl:when test="$formatted = 'true'">
7466
+ <xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7467
+ </xsl:when>
7468
+ <xsl:otherwise>
7469
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
7470
+ </xsl:otherwise>
7471
+ </xsl:choose>
7241
7472
  </xsl:when>
7242
7473
  <xsl:otherwise>
7243
7474
  <xsl:variable name="key_">
@@ -7248,7 +7479,7 @@
7248
7479
  <xsl:value-of select="$key_"/>
7249
7480
  </xsl:otherwise>
7250
7481
  </xsl:choose>
7251
-
7482
+
7252
7483
  </xsl:template><xsl:template name="setTrackChangesStyles">
7253
7484
  <xsl:param name="isAdded"/>
7254
7485
  <xsl:param name="isDeleted"/>