metanorma-iec 2.0.4 → 2.0.7

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: 639e09dbd719fcb6a10c419069b7b0595b62f5ad89469193d459637fe8ca0e6a
4
- data.tar.gz: 2d684743e60262edb21ab5dc12076e3231fad3503203fc7bb7ade94b29739eab
3
+ metadata.gz: fd38c355c3d2dd1cdf7e109be5e326c18f18c9f5d7b9f5cbe815c58687eafd56
4
+ data.tar.gz: 8441df7cd2ba4eed2d0015391b06b4058fb74f428a7e8cd27beeafe6d10d7f6b
5
5
  SHA512:
6
- metadata.gz: ca56e7c582289ef5f6b6b7e0de438def4a9eb1a8145c6379f1ddb405d50678c3ddf97a33810d44438da0a0423c5347c4d067fdb9969fe70f063032525b893482
7
- data.tar.gz: acec50f81d878e1ef29333a9bdcb0544d4a91b981757a36f60ae054a5a2e054cdb9dc457e6751fe8071f3d4b5b2f17d5391a8b8524367d90e166751ae8f4e552
6
+ metadata.gz: f568d89fbe727d8b21040c8f56a2457ac08acc67b598e2a9ad8a03a03ff67974162ad687096df66d6eb6c153dd72abec30ec717307fbdf59373954dfbc28b66e
7
+ data.tar.gz: af527efbfcdeb9cd6ffa68bfe1f598b08fb57201bd217a90f860e62e20e3588f5a7ec4e90f7e263634f9dba417ed6c15db332ce913a718466da9dd98f03383f0
@@ -1410,6 +1410,26 @@ p.MsoIndexHeading, li.MsoIndexHeading, div.MsoIndexHeading {
1410
1410
  mso-fareast-language: ZH-CN;
1411
1411
  font-weight: bold; }
1412
1412
 
1413
+ p.TOCTitle, li.TOCTitle, div.TOCTitle {
1414
+ mso-style-name: "TOC Title";
1415
+ mso-style-unhide: no;
1416
+ margin-top: 0in;
1417
+ margin-right: 0in;
1418
+ margin-bottom: {{normalfontsize}};
1419
+ margin-left: 0in;
1420
+ text-align: left;
1421
+ page-break-after: avoid;
1422
+ mso-pagination: none;
1423
+ mso-hyphenate: none;
1424
+ mso-layout-grid-align: none;
1425
+ font-size: {{normalfontsize}};
1426
+ mso-bidi-font-size: 10.0pt;
1427
+ font-weight: bold;
1428
+ font-family: {{headerfont}};
1429
+ mso-fareast-font-family: {{headerfont}};
1430
+ mso-bidi-font-family: {{headerfont}};
1431
+ mso-fareast-language: EN-US; }
1432
+
1413
1433
  /* Page Definitions */
1414
1434
  @page {
1415
1435
  mso-mirror-margins: yes;
@@ -1324,6 +1324,25 @@ p.MsoIndexHeading, li.MsoIndexHeading, div.MsoIndexHeading
1324
1324
  mso-ansi-language:EN-GB;
1325
1325
  mso-fareast-language:ZH-CN;
1326
1326
  font-weight:bold;}
1327
+ p.TOCTitle, li.TOCTitle, div.TOCTitle
1328
+ {mso-style-name:"TOC Title";
1329
+ mso-style-unhide:no;
1330
+ margin-top:0in;
1331
+ margin-right:0in;
1332
+ margin-bottom:$normalfontsize;
1333
+ margin-left:0in;
1334
+ text-align:left;
1335
+ page-break-after:avoid;
1336
+ mso-pagination:none;
1337
+ mso-hyphenate:none;
1338
+ mso-layout-grid-align:none;
1339
+ font-size:$normalfontsize;
1340
+ mso-bidi-font-size:10.0pt;
1341
+ font-weight:bold;
1342
+ font-family:$headerfont;
1343
+ mso-fareast-font-family:$headerfont;
1344
+ mso-bidi-font-family:$headerfont;
1345
+ mso-fareast-language:EN-US;}
1327
1346
 
1328
1347
  /* Page Definitions */
1329
1348
  @page
@@ -74,7 +74,7 @@
74
74
  <item level="1" id="Foreword" display="true">Foreword</item>
75
75
  <item id="term-script" display="false">3.2</item>
76
76
  -->
77
- <xsl:variable name="contents">
77
+ <xsl:variable name="contents_">
78
78
 
79
79
  <xsl:for-each select="//iec:iec-standard">
80
80
  <xsl:variable name="lang" select="*[local-name()='bibdata']/*[local-name()='language'][@current = 'true']"/>
@@ -92,22 +92,16 @@
92
92
  </xsl:for-each>
93
93
 
94
94
  </xsl:variable>
95
+ <xsl:variable name="contents" select="xalan:nodeset($contents_)"/>
95
96
 
96
97
  <xsl:template name="generateContents">
97
98
  <contents>
98
99
  <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
99
100
  <xsl:call-template name="processMainSectionsDefault_Contents"/>
100
101
  <xsl:apply-templates select="//iec:indexsect" mode="contents"/>
101
- <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name']]">
102
- <figure id="{@id}">
103
- <title><xsl:value-of select="*[local-name() = 'name']/text()"/></title>
104
- </figure>
105
- </xsl:for-each>
106
- <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name']]">
107
- <table id="{@id}">
108
- <title><xsl:value-of select="*[local-name() = 'name']/text()"/></title>
109
- </table>
110
- </xsl:for-each>
102
+ <xsl:call-template name="processTablesFigures_Contents">
103
+ <xsl:with-param name="always">true</xsl:with-param>
104
+ </xsl:call-template>
111
105
  </contents>
112
106
  </xsl:template>
113
107
 
@@ -816,7 +810,7 @@
816
810
  <xsl:if test="$debug = 'true'">
817
811
  <xsl:text disable-output-escaping="yes">&lt;!--</xsl:text>
818
812
  DEBUG
819
- contents=<xsl:copy-of select="xalan:nodeset($contents)"/>
813
+ contents=<xsl:copy-of select="$contents"/>
820
814
  <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
821
815
  </xsl:if>
822
816
 
@@ -845,7 +839,7 @@
845
839
  <fo:flow flow-name="xsl-region-body">
846
840
 
847
841
  <xsl:call-template name="insertTOCpages">
848
- <xsl:with-param name="contents" select="xalan:nodeset($contents)/doc[@id = $docid]"/>
842
+ <xsl:with-param name="contents" select="$contents/doc[@id = $docid]"/>
849
843
  </xsl:call-template>
850
844
 
851
845
  <xsl:call-template name="insertPrefacepages">
@@ -1192,39 +1186,36 @@
1192
1186
  </fo:block>
1193
1187
  </xsl:for-each>
1194
1188
 
1195
- <xsl:if test="//iec:figure[@id and iec:name]">
1196
- <fo:block margin-bottom="5pt"> </fo:block>
1197
- <xsl:for-each select="//iec:figure[@id and iec:name]">
1198
- <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm" role="TOCI">
1199
- <fo:basic-link internal-destination="{@id}" fox:alt-text="Figure {@id}">
1200
- <xsl:apply-templates select="iec:name" mode="contents"/>
1201
- <fo:inline keep-together.within-line="always">
1202
- <fo:leader leader-pattern="dots"/>
1203
- <fo:page-number-citation ref-id="{@id}"/>
1204
- </fo:inline>
1205
- </fo:basic-link>
1206
- </fo:block>
1189
+ <xsl:if test="$contents//figures/figure">
1190
+ <fo:block margin-bottom="5pt"> </fo:block>
1191
+ <xsl:for-each select="$contents//figures/figure">
1192
+ <xsl:call-template name="insertListOf_Item"/>
1207
1193
  </xsl:for-each>
1208
1194
  </xsl:if>
1209
1195
 
1210
- <xsl:if test="//iec:table[@id and iec:name]">
1211
- <fo:block margin-bottom="5pt"> </fo:block>
1212
- <xsl:for-each select="//iec:table[@id and iec:name]">
1213
- <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm" role="TOCI">
1214
- <fo:basic-link internal-destination="{@id}" fox:alt-text="Table {@id}">
1215
- <xsl:apply-templates select="iec:name" mode="contents"/>
1216
- <fo:inline keep-together.within-line="always">
1217
- <fo:leader leader-pattern="dots"/>
1218
- <fo:page-number-citation ref-id="{@id}"/>
1219
- </fo:inline>
1220
- </fo:basic-link>
1221
- </fo:block>
1196
+ <xsl:if test="$contents//tables/table">
1197
+ <fo:block margin-bottom="5pt"> </fo:block>
1198
+ <xsl:for-each select="$contents//tables/table">
1199
+ <xsl:call-template name="insertListOf_Item"/>
1222
1200
  </xsl:for-each>
1223
1201
  </xsl:if>
1202
+
1224
1203
  </fo:block>
1225
1204
  </fo:block-container>
1226
1205
  </xsl:template>
1227
1206
 
1207
+ <xsl:template name="insertListOf_Item">
1208
+ <fo:block text-align-last="justify" margin-bottom="5pt" margin-left="8mm" text-indent="-8mm" role="TOCI">
1209
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{local-name()} {@id}">
1210
+ <xsl:apply-templates select="." mode="contents"/>
1211
+ <fo:inline keep-together.within-line="always">
1212
+ <fo:leader leader-pattern="dots"/>
1213
+ <fo:page-number-citation ref-id="{@id}"/>
1214
+ </fo:inline>
1215
+ </fo:basic-link>
1216
+ </fo:block>
1217
+ </xsl:template>
1218
+
1228
1219
  <xsl:template name="insertPrefacepages">
1229
1220
  <xsl:param name="lang" select="$lang"/>
1230
1221
  <fo:block break-after="page"/>
@@ -1975,7 +1966,7 @@
1975
1966
  <xsl:text>Contents</xsl:text>
1976
1967
 
1977
1968
  </title-toc>
1978
-
1969
+
1979
1970
  <title-descriptors lang="en">Descriptors</title-descriptors>
1980
1971
 
1981
1972
  <title-part lang="en">
@@ -2017,7 +2008,31 @@
2017
2008
  <title-continued lang="en">(continued)</title-continued>
2018
2009
  <title-continued lang="fr">(continué)</title-continued>
2019
2010
 
2020
- </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
2011
+ </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="title-list-tables">
2012
+ <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
2013
+ <xsl:value-of select="$toc_table_title"/>
2014
+ <xsl:if test="normalize-space($toc_table_title) = ''">
2015
+ <xsl:call-template name="getTitle">
2016
+ <xsl:with-param name="name" select="'title-list-tables'"/>
2017
+ </xsl:call-template>
2018
+ </xsl:if>
2019
+ </xsl:variable><xsl:variable name="title-list-figures">
2020
+ <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
2021
+ <xsl:value-of select="$toc_figure_title"/>
2022
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
2023
+ <xsl:call-template name="getTitle">
2024
+ <xsl:with-param name="name" select="'title-list-figures'"/>
2025
+ </xsl:call-template>
2026
+ </xsl:if>
2027
+ </xsl:variable><xsl:variable name="title-list-recommendations">
2028
+ <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
2029
+ <xsl:value-of select="$toc_requirement_title"/>
2030
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
2031
+ <xsl:call-template name="getTitle">
2032
+ <xsl:with-param name="name" select="'title-list-recommendations'"/>
2033
+ </xsl:call-template>
2034
+ </xsl:if>
2035
+ </xsl:variable><xsl:variable name="bibdata">
2021
2036
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
2022
2037
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
2023
2038
  </xsl:variable><xsl:variable name="linebreak">&#8232;</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:variable name="non_breaking_hyphen">‑</xsl:variable><xsl:variable name="thin_space"> </xsl:variable><xsl:variable name="zero_width_space">​</xsl:variable><xsl:variable name="en_dash">–</xsl:variable><xsl:template name="getTitle">
@@ -3283,6 +3298,30 @@
3283
3298
  <xsl:sort select="@displayorder" data-type="number"/>
3284
3299
  <xsl:apply-templates select="." mode="contents"/>
3285
3300
  </xsl:for-each>
3301
+ </xsl:template><xsl:template name="processTablesFigures_Contents">
3302
+ <xsl:param name="always"/>
3303
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
3304
+ <xsl:call-template name="processTables_Contents"/>
3305
+ </xsl:if>
3306
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
3307
+ <xsl:call-template name="processFigures_Contents"/>
3308
+ </xsl:if>
3309
+ </xsl:template><xsl:template name="processTables_Contents">
3310
+ <tables>
3311
+ <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
3312
+ <table id="{@id}" alt-text="{*[local-name() = 'name']}">
3313
+ <xsl:copy-of select="*[local-name() = 'name']"/>
3314
+ </table>
3315
+ </xsl:for-each>
3316
+ </tables>
3317
+ </xsl:template><xsl:template name="processFigures_Contents">
3318
+ <figures>
3319
+ <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ') and normalize-space(@id) != '']">
3320
+ <figure id="{@id}" alt-text="{*[local-name() = 'name']}">
3321
+ <xsl:copy-of select="*[local-name() = 'name']"/>
3322
+ </figure>
3323
+ </xsl:for-each>
3324
+ </figures>
3286
3325
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
3287
3326
  <xsl:for-each select="/*/*[local-name()='preface']/*">
3288
3327
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -3304,8 +3343,27 @@
3304
3343
  <xsl:sort select="@displayorder" data-type="number"/>
3305
3344
  <xsl:apply-templates select="."/>
3306
3345
  </xsl:for-each>
3307
- </xsl:template><xsl:template match="text()">
3308
- <xsl:value-of select="."/>
3346
+ </xsl:template><xsl:variable name="tag_open">###fo:inline###</xsl:variable><xsl:variable name="tag_close">###/fo:inline###</xsl:variable><xsl:template match="text()" name="text">
3347
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
3348
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_open,'$1',$tag_close))"/>
3349
+ <xsl:call-template name="replace_fo_inline">
3350
+ <xsl:with-param name="text" select="$text"/>
3351
+ </xsl:call-template>
3352
+ </xsl:template><xsl:template name="replace_fo_inline">
3353
+ <xsl:param name="text"/>
3354
+ <xsl:choose>
3355
+ <xsl:when test="contains($text, $tag_open)">
3356
+ <xsl:value-of select="substring-before($text, $tag_open)"/>
3357
+ <xsl:text disable-output-escaping="yes">&lt;fo:inline keep-together.within-line="always"&gt;</xsl:text>
3358
+ <xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
3359
+ <xsl:value-of select="substring-before($text_after, $tag_close)"/>
3360
+ <xsl:text disable-output-escaping="yes">&lt;/fo:inline&gt;</xsl:text>
3361
+ <xsl:call-template name="replace_fo_inline">
3362
+ <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
3363
+ </xsl:call-template>
3364
+ </xsl:when>
3365
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
3366
+ </xsl:choose>
3309
3367
  </xsl:template><xsl:template match="*[local-name()='br']">
3310
3368
  <xsl:value-of select="$linebreak"/>
3311
3369
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
@@ -4087,37 +4145,7 @@
4087
4145
 
4088
4146
  <!-- list of footnotes to calculate actual footnotes number -->
4089
4147
  <xsl:variable name="p_fn_">
4090
- <xsl:choose>
4091
- <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
4092
- <fn gen_id="{generate-id(.)}">
4093
- <xsl:copy-of select="@*"/>
4094
- <xsl:copy-of select="node()"/>
4095
- </fn>
4096
- </xsl:when>
4097
- <xsl:otherwise>
4098
- <!-- itetation for:
4099
- footnotes in bibdata/title
4100
- footnotes in bibliography
4101
- footnotes in document's body (except table's head/body/foot and figure text)
4102
- -->
4103
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
4104
- <fn gen_id="{generate-id(.)}">
4105
- <xsl:copy-of select="@*"/>
4106
- <xsl:copy-of select="node()"/>
4107
- </fn>
4108
- </xsl:for-each>
4109
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
4110
- <xsl:sort select="@displayorder" data-type="number"/>
4111
- <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4112
- <!-- copy unique fn -->
4113
- <fn gen_id="{generate-id(.)}">
4114
- <xsl:copy-of select="@*"/>
4115
- <xsl:copy-of select="node()"/>
4116
- </fn>
4117
- </xsl:for-each>
4118
- </xsl:for-each>
4119
- </xsl:otherwise>
4120
- </xsl:choose>
4148
+ <xsl:call-template name="get_fn_list"/>
4121
4149
  </xsl:variable>
4122
4150
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
4123
4151
 
@@ -4178,6 +4206,38 @@
4178
4206
  <xsl:copy-of select="$footnote_inline"/>
4179
4207
  </xsl:otherwise>
4180
4208
  </xsl:choose>
4209
+ </xsl:template><xsl:template name="get_fn_list">
4210
+ <xsl:choose>
4211
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
4212
+ <fn gen_id="{generate-id(.)}">
4213
+ <xsl:copy-of select="@*"/>
4214
+ <xsl:copy-of select="node()"/>
4215
+ </fn>
4216
+ </xsl:when>
4217
+ <xsl:otherwise>
4218
+ <!-- itetation for:
4219
+ footnotes in bibdata/title
4220
+ footnotes in bibliography
4221
+ footnotes in document's body (except table's head/body/foot and figure text)
4222
+ -->
4223
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
4224
+ <fn gen_id="{generate-id(.)}">
4225
+ <xsl:copy-of select="@*"/>
4226
+ <xsl:copy-of select="node()"/>
4227
+ </fn>
4228
+ </xsl:for-each>
4229
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
4230
+ <xsl:sort select="@displayorder" data-type="number"/>
4231
+ <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4232
+ <!-- copy unique fn -->
4233
+ <fn gen_id="{generate-id(.)}">
4234
+ <xsl:copy-of select="@*"/>
4235
+ <xsl:copy-of select="node()"/>
4236
+ </fn>
4237
+ </xsl:for-each>
4238
+ </xsl:for-each>
4239
+ </xsl:otherwise>
4240
+ </xsl:choose>
4181
4241
  </xsl:template><xsl:template name="table_fn_display">
4182
4242
  <xsl:variable name="references">
4183
4243
 
@@ -4354,7 +4414,7 @@
4354
4414
  </fo:inline>
4355
4415
  </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
4356
4416
  <fo:inline><xsl:value-of select="."/></fo:inline>
4357
- </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
4417
+ </xsl:template><xsl:template match="*[local-name()='fn']//*[local-name()='p']">
4358
4418
  <fo:inline>
4359
4419
  <xsl:apply-templates/>
4360
4420
  </fo:inline>
@@ -6062,13 +6122,14 @@
6062
6122
  <xsl:apply-templates mode="bookmarks"/>
6063
6123
  </xsl:template><xsl:template name="addBookmarks">
6064
6124
  <xsl:param name="contents"/>
6065
- <xsl:if test="xalan:nodeset($contents)//item">
6125
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
6126
+ <xsl:if test="$contents_nodes//item">
6066
6127
  <fo:bookmark-tree>
6067
6128
  <xsl:choose>
6068
- <xsl:when test="xalan:nodeset($contents)/doc">
6129
+ <xsl:when test="$contents_nodes/doc">
6069
6130
  <xsl:choose>
6070
- <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
6071
- <xsl:for-each select="xalan:nodeset($contents)/doc">
6131
+ <xsl:when test="count($contents_nodes/doc) &gt; 1">
6132
+ <xsl:for-each select="$contents_nodes/doc">
6072
6133
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
6073
6134
  <xsl:if test="@bundle = 'true'">
6074
6135
  <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
@@ -6119,7 +6180,7 @@
6119
6180
  </xsl:for-each>
6120
6181
  </xsl:when>
6121
6182
  <xsl:otherwise>
6122
- <xsl:for-each select="xalan:nodeset($contents)/doc">
6183
+ <xsl:for-each select="$contents_nodes/doc">
6123
6184
 
6124
6185
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
6125
6186
 
@@ -6137,25 +6198,36 @@
6137
6198
  </xsl:choose>
6138
6199
  </xsl:when>
6139
6200
  <xsl:otherwise>
6140
- <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
6201
+ <xsl:apply-templates select="$contents_nodes/contents/item" mode="bookmark"/>
6202
+
6203
+ <xsl:call-template name="insertFigureBookmarks">
6204
+ <xsl:with-param name="contents" select="$contents_nodes/contents"/>
6205
+ </xsl:call-template>
6206
+
6207
+ <xsl:call-template name="insertTableBookmarks">
6208
+ <xsl:with-param name="contents" select="$contents_nodes/contents"/>
6209
+ <xsl:with-param name="lang" select="@lang"/>
6210
+ </xsl:call-template>
6211
+
6141
6212
  </xsl:otherwise>
6142
6213
  </xsl:choose>
6143
6214
 
6215
+
6144
6216
 
6145
6217
 
6146
6218
 
6147
6219
 
6148
-
6149
-
6220
+
6150
6221
 
6151
6222
  </fo:bookmark-tree>
6152
6223
  </xsl:if>
6153
6224
  </xsl:template><xsl:template name="insertFigureBookmarks">
6154
6225
  <xsl:param name="contents"/>
6155
- <xsl:if test="xalan:nodeset($contents)/figure">
6156
- <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
6226
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
6227
+ <xsl:if test="$contents_nodes/figure">
6228
+ <fo:bookmark internal-destination="{$contents_nodes/figure[1]/@id}" starting-state="hide">
6157
6229
  <fo:bookmark-title>Figures</fo:bookmark-title>
6158
- <xsl:for-each select="xalan:nodeset($contents)/figure">
6230
+ <xsl:for-each select="$contents_nodes/figure">
6159
6231
  <fo:bookmark internal-destination="{@id}">
6160
6232
  <fo:bookmark-title>
6161
6233
  <xsl:value-of select="normalize-space(title)"/>
@@ -6164,18 +6236,42 @@
6164
6236
  </xsl:for-each>
6165
6237
  </fo:bookmark>
6166
6238
  </xsl:if>
6239
+
6240
+
6241
+ <xsl:if test="$contents_nodes//figures/figure">
6242
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
6243
+
6244
+
6245
+ <xsl:attribute name="internal-destination">
6246
+ <xsl:value-of select="$contents_nodes//figures/figure[1]/@id"/>
6247
+ </xsl:attribute>
6248
+
6249
+
6250
+ <xsl:variable name="bookmark-title">
6251
+ Figures
6252
+ </xsl:variable>
6253
+ <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
6254
+ <xsl:for-each select="$contents_nodes//figures/figure">
6255
+ <fo:bookmark internal-destination="{@id}">
6256
+ <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
6257
+ </fo:bookmark>
6258
+ </xsl:for-each>
6259
+ </fo:bookmark>
6260
+ </xsl:if>
6261
+
6167
6262
  </xsl:template><xsl:template name="insertTableBookmarks">
6168
6263
  <xsl:param name="contents"/>
6169
6264
  <xsl:param name="lang"/>
6170
- <xsl:if test="xalan:nodeset($contents)/table">
6171
- <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
6265
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
6266
+ <xsl:if test="$contents_nodes/table">
6267
+ <fo:bookmark internal-destination="{$contents_nodes/table[1]/@id}" starting-state="hide">
6172
6268
  <fo:bookmark-title>
6173
6269
  <xsl:choose>
6174
6270
  <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
6175
6271
  <xsl:otherwise>Tables</xsl:otherwise>
6176
6272
  </xsl:choose>
6177
6273
  </fo:bookmark-title>
6178
- <xsl:for-each select="xalan:nodeset($contents)/table">
6274
+ <xsl:for-each select="$contents_nodes/table">
6179
6275
  <fo:bookmark internal-destination="{@id}">
6180
6276
  <fo:bookmark-title>
6181
6277
  <xsl:value-of select="normalize-space(title)"/>
@@ -6184,6 +6280,36 @@
6184
6280
  </xsl:for-each>
6185
6281
  </fo:bookmark>
6186
6282
  </xsl:if>
6283
+
6284
+
6285
+ <xsl:if test="$contents_nodes//tables/table">
6286
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
6287
+
6288
+
6289
+ <xsl:attribute name="internal-destination">
6290
+ <xsl:value-of select="$contents_nodes//tables/table[1]/@id"/>
6291
+ </xsl:attribute>
6292
+
6293
+
6294
+ <xsl:variable name="bookmark-title">
6295
+
6296
+ <xsl:choose>
6297
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
6298
+ <xsl:otherwise>Tables</xsl:otherwise>
6299
+ </xsl:choose>
6300
+
6301
+ </xsl:variable>
6302
+
6303
+ <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
6304
+
6305
+ <xsl:for-each select="$contents_nodes//tables/table">
6306
+ <fo:bookmark internal-destination="{@id}">
6307
+ <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
6308
+ </fo:bookmark>
6309
+ </xsl:for-each>
6310
+ </fo:bookmark>
6311
+ </xsl:if>
6312
+
6187
6313
  </xsl:template><xsl:template name="getLangVersion">
6188
6314
  <xsl:param name="lang"/>
6189
6315
  <xsl:param name="doctype" select="''"/>
@@ -6408,7 +6534,51 @@
6408
6534
  <xsl:with-param name="text" select="$text_step1"/>
6409
6535
  </xsl:call-template>
6410
6536
  </xsl:variable>
6411
- <xsl:value-of select="$text_step2"/>
6537
+
6538
+ <!-- <xsl:value-of select="$text_step2"/> -->
6539
+
6540
+ <!-- add zero-width space after space -->
6541
+ <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/>
6542
+
6543
+ <!-- split text by zero-width space -->
6544
+ <xsl:variable name="text_step4">
6545
+ <xsl:call-template name="split">
6546
+ <xsl:with-param name="pText" select="$text_step3"/>
6547
+ <xsl:with-param name="sep" select="$zero_width_space"/>
6548
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
6549
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
6550
+ </xsl:call-template>
6551
+ </xsl:variable>
6552
+
6553
+ <xsl:for-each select="xalan:nodeset($text_step4)/item">
6554
+ <xsl:choose>
6555
+ <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6556
+ <xsl:call-template name="interspers">
6557
+ <xsl:with-param name="str" select="."/>
6558
+ </xsl:call-template>
6559
+ </xsl:when>
6560
+ <xsl:otherwise>
6561
+ <xsl:value-of select="."/>
6562
+ </xsl:otherwise>
6563
+ </xsl:choose>
6564
+ </xsl:for-each>
6565
+
6566
+ </xsl:template><xsl:template name="interspers">
6567
+ <xsl:param name="str"/>
6568
+ <xsl:param name="char" select="$zero_width_space"/>
6569
+ <xsl:if test="$str != ''">
6570
+ <xsl:value-of select="substring($str, 1, 1)"/>
6571
+
6572
+ <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
6573
+ <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
6574
+ <xsl:value-of select="$char"/>
6575
+ </xsl:if>
6576
+
6577
+ <xsl:call-template name="interspers">
6578
+ <xsl:with-param name="str" select="substring($str, 2)"/>
6579
+ <xsl:with-param name="char" select="$char"/>
6580
+ </xsl:call-template>
6581
+ </xsl:if>
6412
6582
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
6413
6583
  <xsl:apply-templates mode="syntax_highlight"/>
6414
6584
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -6846,6 +7016,8 @@
6846
7016
  </xsl:otherwise>
6847
7017
  </xsl:choose> -->
6848
7018
  </fo:block>
7019
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
7020
+ <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
6849
7021
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
6850
7022
  <xsl:if test="normalize-space() != ''">
6851
7023
  <xsl:value-of select="."/>
@@ -6880,7 +7052,8 @@
6880
7052
  <fo:inline><xsl:apply-templates/></fo:inline>
6881
7053
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
6882
7054
  <xsl:if test="normalize-space() != ''">
6883
- <xsl:value-of select="."/>
7055
+ <!-- <xsl:value-of select="."/> -->
7056
+ <xsl:call-template name="text"/>
6884
7057
  </xsl:if>
6885
7058
  </xsl:template><xsl:template match="*[local-name() = 'quote']">
6886
7059
  <fo:block-container margin-left="0mm">
@@ -6920,26 +7093,24 @@
6920
7093
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6921
7094
  <xsl:text>— </xsl:text>
6922
7095
  <xsl:apply-templates/>
6923
- </xsl:template><xsl:variable name="bibitem_hidden_">
7096
+ </xsl:template><xsl:variable name="bibitems_">
7097
+ <xsl:for-each select="//*[local-name() = 'bibitem']">
7098
+ <xsl:copy-of select="."/>
7099
+ </xsl:for-each>
7100
+ </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
6924
7101
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6925
7102
  <xsl:copy-of select="."/>
6926
7103
  </xsl:for-each>
6927
- <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
7104
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
6928
7105
  <xsl:copy-of select="."/>
6929
7106
  </xsl:for-each>
6930
- </xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6931
-
6932
- <xsl:variable name="bibitemid">
6933
- <xsl:choose>
6934
- <!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
6935
- <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
6936
- <xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6937
- <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
6938
- </xsl:choose>
6939
- </xsl:variable>
6940
-
7107
+ </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
7108
+ <xsl:variable name="current_bibitemid" select="@bibitemid"/>
7109
+ <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
7110
+ <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
6941
7111
  <xsl:choose>
6942
- <xsl:when test="normalize-space($bibitemid) != ''"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link -->
7112
+ <!-- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> --> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
7113
+ <xsl:when test="$external-destination != '' or not($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid])"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6943
7114
  <fo:inline xsl:use-attribute-sets="eref-style">
6944
7115
  <xsl:if test="@type = 'footnote'">
6945
7116
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -6953,8 +7124,8 @@
6953
7124
  <xsl:variable name="text" select="normalize-space()"/>
6954
7125
 
6955
7126
 
6956
-
6957
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
7127
+
7128
+ <fo:basic-link fox:alt-text="{@citeas}">
6958
7129
  <xsl:if test="normalize-space(@citeas) = ''">
6959
7130
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
6960
7131
  </xsl:if>
@@ -6964,14 +7135,21 @@
6964
7135
 
6965
7136
  </xsl:if>
6966
7137
 
6967
-
7138
+ <xsl:choose>
7139
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
7140
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
7141
+ </xsl:when>
7142
+ <xsl:otherwise>
7143
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
7144
+ </xsl:otherwise>
7145
+ </xsl:choose>
6968
7146
 
6969
7147
  <xsl:apply-templates/>
6970
7148
  </fo:basic-link>
6971
-
7149
+
6972
7150
  </fo:inline>
6973
7151
  </xsl:when>
6974
- <xsl:otherwise>
7152
+ <xsl:otherwise> <!-- if there is key('bibitems_hidden', $current_bibitemid) -->
6975
7153
  <fo:inline><xsl:apply-templates/></fo:inline>
6976
7154
  </xsl:otherwise>
6977
7155
  </xsl:choose>
@@ -7712,23 +7890,45 @@
7712
7890
  <xsl:apply-templates/>
7713
7891
  </fo:inline>
7714
7892
  </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
7893
+
7894
+ <!-- list of footnotes to calculate actual footnotes number -->
7895
+ <xsl:variable name="p_fn_">
7896
+ <xsl:call-template name="get_fn_list"/>
7897
+ </xsl:variable>
7898
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
7899
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
7900
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
7901
+ <!-- fn sequence number in document -->
7902
+ <xsl:variable name="current_fn_number">
7903
+ <xsl:choose>
7904
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
7905
+ <xsl:otherwise>
7906
+ <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
7907
+ <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
7908
+ </xsl:otherwise>
7909
+ </xsl:choose>
7910
+ </xsl:variable>
7715
7911
  <fo:footnote>
7716
7912
  <xsl:variable name="number">
7717
7913
 
7718
- <xsl:number level="any" count="*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
7914
+ <xsl:value-of select="$current_fn_number"/>
7719
7915
 
7720
7916
  </xsl:variable>
7917
+
7918
+ <xsl:variable name="current_fn_number_text">
7919
+ <xsl:value-of select="$number"/>
7920
+
7921
+ </xsl:variable>
7922
+
7721
7923
  <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
7722
- <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
7723
- <xsl:value-of select="$number"/>
7724
-
7924
+ <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
7925
+ <xsl:value-of select="$current_fn_number_text"/>
7725
7926
  </fo:basic-link>
7726
7927
  </fo:inline>
7727
7928
  <fo:footnote-body>
7728
7929
  <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
7729
- <fo:inline id="{generate-id()}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
7730
- <xsl:value-of select="$number"/>
7731
-
7930
+ <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
7931
+ <xsl:value-of select="$current_fn_number_text"/>
7732
7932
  </fo:inline>
7733
7933
  <xsl:apply-templates/>
7734
7934
  </fo:block>
@@ -7970,6 +8170,78 @@
7970
8170
  <!-- processing for admonition/p found in the template for 'p' -->
7971
8171
  <xsl:call-template name="paragraph"/>
7972
8172
 
8173
+ </xsl:template><xsl:template match="@*|node()" mode="update_xml_step1">
8174
+ <xsl:copy>
8175
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
8176
+ </xsl:copy>
8177
+ </xsl:template><xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1">
8178
+ <xsl:copy>
8179
+ <xsl:copy-of select="@*"/>
8180
+
8181
+ <xsl:variable name="nodes_preface_">
8182
+ <xsl:for-each select="*">
8183
+ <node id="{@id}"/>
8184
+ </xsl:for-each>
8185
+ </xsl:variable>
8186
+ <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
8187
+
8188
+ <xsl:for-each select="*">
8189
+ <xsl:sort select="@displayorder" data-type="number"/>
8190
+
8191
+ <!-- process Section's title -->
8192
+ <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
8193
+ <xsl:if test="$preceding-sibling_id != ''">
8194
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="update_xml_step1"/>
8195
+ </xsl:if>
8196
+
8197
+ <xsl:choose>
8198
+ <xsl:when test="@type = 'section-title' and not(@displayorder)"><!-- skip, don't copy, because copied in above 'apply-templates' --></xsl:when>
8199
+ <xsl:otherwise>
8200
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
8201
+ </xsl:otherwise>
8202
+ </xsl:choose>
8203
+
8204
+ </xsl:for-each>
8205
+ </xsl:copy>
8206
+ </xsl:template><xsl:template match="*[local-name() = 'sections']" mode="update_xml_step1">
8207
+ <xsl:copy>
8208
+ <xsl:copy-of select="@*"/>
8209
+
8210
+ <xsl:variable name="nodes_sections_">
8211
+ <xsl:for-each select="*">
8212
+ <node id="{@id}"/>
8213
+ </xsl:for-each>
8214
+ </xsl:variable>
8215
+ <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
8216
+
8217
+ <!-- move section 'Normative references' inside 'sections' -->
8218
+ <xsl:for-each select="* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
8219
+ <xsl:sort select="@displayorder" data-type="number"/>
8220
+
8221
+ <!-- process Section's title -->
8222
+ <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
8223
+ <xsl:if test="$preceding-sibling_id != ''">
8224
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="update_xml_step1"/>
8225
+ </xsl:if>
8226
+
8227
+ <xsl:choose>
8228
+ <xsl:when test="@type = 'section-title' and not(@displayorder)"><!-- skip, don't copy, because copied in above 'apply-templates' --></xsl:when>
8229
+ <xsl:otherwise>
8230
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
8231
+ </xsl:otherwise>
8232
+ </xsl:choose>
8233
+
8234
+ </xsl:for-each>
8235
+ </xsl:copy>
8236
+ </xsl:template><xsl:template match="*[local-name() = 'bibliography']" mode="update_xml_step1">
8237
+ <xsl:copy>
8238
+ <xsl:copy-of select="@*"/>
8239
+ <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
8240
+ <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
8241
+ <xsl:sort select="@displayorder" data-type="number"/>
8242
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
8243
+ </xsl:for-each>
8244
+ </xsl:copy>
7973
8245
  </xsl:template><xsl:template name="convertDate">
7974
8246
  <xsl:param name="date"/>
7975
8247
  <xsl:param name="format" select="'short'"/>
@@ -8214,22 +8486,25 @@
8214
8486
  <xsl:param name="pText" select="."/>
8215
8487
  <xsl:param name="sep" select="','"/>
8216
8488
  <xsl:param name="normalize-space" select="'true'"/>
8489
+ <xsl:param name="keep_sep" select="'false'"/>
8217
8490
  <xsl:if test="string-length($pText) &gt;0">
8218
- <item>
8219
- <xsl:choose>
8220
- <xsl:when test="$normalize-space = 'true'">
8221
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8222
- </xsl:when>
8223
- <xsl:otherwise>
8224
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8225
- </xsl:otherwise>
8226
- </xsl:choose>
8227
- </item>
8228
- <xsl:call-template name="split">
8229
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8230
- <xsl:with-param name="sep" select="$sep"/>
8231
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
8232
- </xsl:call-template>
8491
+ <item>
8492
+ <xsl:choose>
8493
+ <xsl:when test="$normalize-space = 'true'">
8494
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8495
+ </xsl:when>
8496
+ <xsl:otherwise>
8497
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8498
+ </xsl:otherwise>
8499
+ </xsl:choose>
8500
+ </item>
8501
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
8502
+ <xsl:call-template name="split">
8503
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8504
+ <xsl:with-param name="sep" select="$sep"/>
8505
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
8506
+ <xsl:with-param name="keep_sep" select="$keep_sep"/>
8507
+ </xsl:call-template>
8233
8508
  </xsl:if>
8234
8509
  </xsl:template><xsl:template name="getDocumentId">
8235
8510
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.0.4".freeze
3
+ VERSION = "2.0.7".freeze
4
4
  end
5
5
  end
6
6
 
@@ -399,9 +399,7 @@ RSpec.describe IsoDoc do
399
399
  </ul>
400
400
  </div>
401
401
  <p>
402
- SOURCE:
403
- <a href='#ISO7301'>ISO 7301:2011, 3.1</a>
404
- , modified &#8211; The term "cargo rice" is shown as deprecated, and
402
+ SOURCE: ISO 7301:2011, 3.1, modified &#8211; The term "cargo rice" is shown as deprecated, and
405
403
  Note 1 to entry is not included here
406
404
  </p>
407
405
  <p class='TermNum' id='paddy'>192-01-02</p>
@@ -440,10 +438,7 @@ RSpec.describe IsoDoc do
440
438
  </p>
441
439
  </p>
442
440
  </div>
443
- <p>
444
- SOURCE:
445
- <a href='#ISO7301'>ISO 7301:2011, 3.1</a>
446
- </p>
441
+ <p>SOURCE: ISO 7301:2011, 3.1 </p>
447
442
  </div>
448
443
  </div>
449
444
  </div>
@@ -553,9 +548,7 @@ RSpec.describe IsoDoc do
553
548
  rice retaining its husk after threshing
554
549
  </p>
555
550
  <p class='MsoNormal'>
556
- SOURCE:
557
- <a href='#ISO7301'>ISO 7301:2011, 3.1</a>
558
- , modified &#x2013; The term "cargo rice" is shown as deprecated, and
551
+ SOURCE: ISO 7301:2011, 3.1, modified &#x2013; The term "cargo rice" is shown as deprecated, and
559
552
  Note 1 to entry is not included here
560
553
  </p>
561
554
  </div>
@@ -147,7 +147,7 @@ RSpec.describe IsoDoc do
147
147
  <div><a name="_terms_and_definitions" id="_terms_and_definitions"></a><h1 class="main">1<span style="mso-tab-count:1">&#xA0; </span>Terms and Definitions</h1>
148
148
  <p class="TermNum"><a name="paddy1" id="paddy1"></a>1.1</p><p class="Terms" style="text-align:left;">paddy</p>
149
149
  <p class="MsoNormal"><a name="_eb29b35e-123e-4d1c-b50b-2714d41e747f" id="_eb29b35e-123e-4d1c-b50b-2714d41e747f"></a>rice retaining its husk after threshing</p>
150
- <p class="MsoNormal">[SOURCE: <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified &#x2014; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
150
+ <p class="MsoNormal">[SOURCE: ISO 7301:2011, 3.1, modified &#x2014; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p></div>
151
151
  </div>
152
152
  OUTPUT
153
153
  end
@@ -220,7 +220,7 @@ RSpec.describe IsoDoc::Iec do
220
220
  <note><name>NOTE</name><p>This is another annotation of document ISSN.</p></note>
221
221
  <bibitem id="ISO3696" type="standard">
222
222
  <title format="text/plain">Water for analytical laboratory use</title>
223
- <docidentifier type='metanorma-ordinal'>[1]</docidentifier>
223
+ <docidentifier type='metanorma-ordinal'>[3]</docidentifier>
224
224
  <docidentifier type="ISO">ISO 3696</docidentifier>
225
225
  <contributor>
226
226
  <role type="publisher"/>
@@ -235,7 +235,7 @@ RSpec.describe IsoDoc::Iec do
235
235
  </bibitem>
236
236
  <bibitem id="ref11">
237
237
  <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
238
- <docidentifier type='metanorma-ordinal'>[2]</docidentifier>
238
+ <docidentifier type='metanorma-ordinal'>[4]</docidentifier>
239
239
  <docidentifier type="IETF">IETF RFC 10</docidentifier>
240
240
  </bibitem>
241
241
  <bibitem id="ref12">
@@ -337,7 +337,7 @@ RSpec.describe IsoDoc::Iec do
337
337
  </p>
338
338
  </div>
339
339
  <p id='ISO3696' class='Biblio'>
340
- [1]&#160; ISO 3696,
340
+ [3]&#160; ISO 3696,
341
341
  <i>Water for analytical laboratory use</i>
342
342
  </p>
343
343
  <p id='ref10' class='Biblio'>
@@ -354,7 +354,7 @@ RSpec.describe IsoDoc::Iec do
354
354
  )
355
355
  </p>
356
356
  <p id='ref11' class='Biblio'>
357
- [2]&#160; IETF RFC 10,
357
+ [4]&#160; IETF RFC 10,
358
358
  <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>
359
359
  </p>
360
360
  <p id='ref12' class='Biblio'>
@@ -129,7 +129,7 @@ RSpec.describe IsoDoc do
129
129
  </div>
130
130
 
131
131
  <p>[SOURCE:
132
- <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified &#8211; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
132
+ ISO 7301:2011, 3.1, modified &#8211; The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]
133
133
  </p><p class="TermNum" id="paddy">1.2</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
134
134
  <p class="AltTerms" style="text-align:left;">rough rice</p>
135
135
  <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
@@ -141,8 +141,7 @@ RSpec.describe IsoDoc do
141
141
  </div>
142
142
  <div id="_671a1994-4783-40d0-bc81-987d06ffb74e" class="Note"><p>Note 1 to entry: The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></div>
143
143
  <div id='_671a1994-4783-40d0-bc81-987d06ffb74f' class="Note"><p>Note 2 to entry: <ul><li>A</li></ul><p id="_19830f33-e46c-42cc-94ca-a5ef101132d5">The starch of waxy rice consists almost entirely of amylopectin. The kernels have a tendency to stick together after cooking.</p></p></div>
144
- <p>[SOURCE:
145
- <a href="#ISO7301">ISO 7301:2011, 3.1</a>]</p></div>
144
+ <p>[SOURCE: ISO 7301:2011, 3.1]</p></div>
146
145
  </div>
147
146
  </body>
148
147
  </html>
@@ -162,8 +161,7 @@ RSpec.describe IsoDoc do
162
161
  </ul>
163
162
  </div>
164
163
 
165
- <p>[SOURCE:
166
- <a href="#ISO7301">ISO 7301:2011, 3.1</a>, modified &#8211;
164
+ <p>[SOURCE: ISO 7301:2011, 3.1, modified &#8211;
167
165
  The term "cargo rice" is shown as deprecated, and Note 1 to entry is not included here]</p><p class="TermNum" id="paddy">1.2</p><p class="Terms" style="text-align:left;">paddy</p><p class="AltTerms" style="text-align:left;">paddy rice</p>
168
166
  <p class="AltTerms" style="text-align:left;">rough rice</p>
169
167
  <p class="DeprecatedTerms" style="text-align:left;">DEPRECATED: cargo rice</p>
@@ -176,8 +174,7 @@ RSpec.describe IsoDoc do
176
174
 
177
175
 
178
176
 
179
- <p>[SOURCE:
180
- <a href="#ISO7301">ISO 7301:2011, 3.1</a>]</p></div>
177
+ <p>[SOURCE: ISO 7301:2011, 3.1]</p></div>
181
178
  OUTPUT
182
179
  expect(xmlpp(IsoDoc::Iec::PresentationXMLConvert.new({})
183
180
  .convert("test", input, true)))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-21 00:00:00.000000000 Z
11
+ date: 2022-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  - !ruby/object:Gem::Version
299
299
  version: '0'
300
300
  requirements: []
301
- rubygems_version: 3.2.32
301
+ rubygems_version: 3.3.9
302
302
  signing_key:
303
303
  specification_version: 4
304
304
  summary: metanorma-iec lets you write IEC standards in AsciiDoc.