metanorma-itu 2.8.4 → 2.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 63567364155d68f66099200d1d3568d0c1bfd0a17b74a72c0c7b64342798f1f4
4
- data.tar.gz: 562a0859cd6616cc92fa6fde1d078cd421ba625d34519ccac73fcedcc3559c87
3
+ metadata.gz: e9beadc1757498926938bd9ed4ec9854a2c3d9ef6eb807a23ef439dbd7bd8ccd
4
+ data.tar.gz: 179382a92d8e711cc57a317f12f68c1fc9ce573d0ad58e070faac7cbafadc3ac
5
5
  SHA512:
6
- metadata.gz: 67da2c8835fc974209329ae279bb78db56404d2667f96ddad682a63d7889b94e418f470a34912ae85a0634b478d3fbc64940a5e8057ef19686f727927439b8ed
7
- data.tar.gz: 2ed17169f6e2402d2a76b1d9572883c9b113160ac1a9f86e9be1744cfb289ad4c0c4ae79108bffb9a219a6ba72f0c93ddce85247d4098e5afa3d65241a8c0c37
6
+ metadata.gz: 403b767d5d035963b5b0ef3135fcaacfed8dd8c4032a3f9f835b37079a40ebc8fbd55b82fc67cd5a4383043f4151fd2572b8b005352ea7ff5e8b0392d9107fc6
7
+ data.tar.gz: bbd5937f48fce57149b1bd58c46654ec268025a9394cd682b8a67c31f6cdba419c20ff26ac2ad14623cce1e5537bcbe080ab490e3f28466f5b03c56d979deb19
@@ -312,6 +312,11 @@ svg {
312
312
  display: block; /* ← removes unwanted inline spacing */
313
313
  }
314
314
 
315
+ /* style dfn by override in flavor */
316
+ dfn {
317
+ font-style: inherit;
318
+ }
319
+
315
320
  #standard-band {
316
321
  background-color: #0AC442;
317
322
  }
@@ -312,6 +312,11 @@ svg {
312
312
  display: block; /* ← removes unwanted inline spacing */
313
313
  }
314
314
 
315
+ /* style dfn by override in flavor */
316
+ dfn {
317
+ font-style: inherit;
318
+ }
319
+
315
320
  #standard-band {
316
321
  background-color: #0AC442;
317
322
  }
@@ -371,32 +371,12 @@
371
371
 
372
372
  <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
373
373
 
374
- <fo:page-sequence master-reference="preface" format="i" force-page-count="no-force">
374
+ <!-- <debug><xsl:copy-of select="."/></debug> -->
375
375
 
376
- <xsl:if test="$doctype = 'resolution'">
377
- <xsl:attribute name="font-size">11pt</xsl:attribute>
378
- </xsl:if>
379
- <xsl:if test="$doctype = 'service-publication'">
380
- <xsl:attribute name="font-size">11pt</xsl:attribute>
381
- <xsl:attribute name="font-family">Arial, STIX Two Math</xsl:attribute>
382
- </xsl:if>
383
-
384
- <xsl:attribute name="master-reference">
385
- <xsl:text>preface</xsl:text>
386
- <xsl:call-template name="getPageSequenceOrientation"/>
387
- </xsl:attribute>
388
-
389
- <xsl:if test="$doctype = 'service-publication'">
390
- <xsl:attribute name="master-reference">
391
- <xsl:text>document</xsl:text>
392
- <xsl:call-template name="getPageSequenceOrientation"/>
393
- </xsl:attribute>
394
- <xsl:attribute name="format">1</xsl:attribute>
395
- </xsl:if>
396
-
397
- <xsl:if test="position() = 1">
398
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
399
- </xsl:if>
376
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-preface">
377
+ <xsl:call-template name="refine_page-sequence-preface">
378
+ <xsl:with-param name="doctype" select="$doctype"/>
379
+ </xsl:call-template>
400
380
 
401
381
  <xsl:call-template name="insertHeaderFooter">
402
382
  <xsl:with-param name="doctype" select="$doctype"/>
@@ -506,28 +486,10 @@
506
486
  <xsl:for-each select=".//mn:page_sequence[not(parent::mn:preface)][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
507
487
 
508
488
  <!-- BODY -->
509
- <fo:page-sequence master-reference="document" force-page-count="no-force">
510
-
511
- <xsl:if test="$doctype = 'resolution'">
512
- <xsl:attribute name="font-size">11pt</xsl:attribute>
513
- </xsl:if>
514
- <xsl:if test="$doctype = 'service-publication'">
515
- <xsl:attribute name="font-size">11pt</xsl:attribute>
516
- <xsl:attribute name="font-family">Arial, STIX Two Math</xsl:attribute>
517
- </xsl:if>
518
-
519
- <xsl:attribute name="master-reference">
520
- <xsl:text>document</xsl:text>
521
- <xsl:call-template name="getPageSequenceOrientation"/>
522
- </xsl:attribute>
523
-
524
- <xsl:if test="position() = 1">
525
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
526
- </xsl:if>
527
-
528
- <xsl:if test="$doctype = 'service-publication'">
529
- <xsl:attribute name="initial-page-number">auto</xsl:attribute>
530
- </xsl:if>
489
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-main">
490
+ <xsl:call-template name="refine_page-sequence-main">
491
+ <xsl:with-param name="doctype" select="$doctype"/>
492
+ </xsl:call-template>
531
493
 
532
494
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
533
495
 
@@ -1881,7 +1843,7 @@
1881
1843
  </xsl:call-template>
1882
1844
  <xsl:apply-templates select="." mode="contents"/>
1883
1845
  <fo:inline keep-together.within-line="always">
1884
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1846
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
1885
1847
  <fo:page-number-citation ref-id="{@id}"/>
1886
1848
  </fo:inline>
1887
1849
  </fo:basic-link>
@@ -1943,7 +1905,7 @@
1943
1905
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}">
1944
1906
  <xsl:apply-templates select="mnx:title"/>
1945
1907
  <fo:inline keep-together.within-line="always">
1946
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1908
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
1947
1909
  <fo:page-number-citation ref-id="{@id}"/>
1948
1910
  </fo:inline>
1949
1911
  </fo:basic-link>
@@ -3257,20 +3219,71 @@
3257
3219
  </xsl:variable>
3258
3220
 
3259
3221
  <xsl:attribute-set name="page-sequence-preface">
3222
+ <xsl:attribute name="master-reference">preface</xsl:attribute>
3260
3223
  <xsl:attribute name="format">i</xsl:attribute>
3261
- </xsl:attribute-set>
3224
+ <xsl:attribute name="force-page-count">no-force</xsl:attribute>
3225
+ </xsl:attribute-set> <!-- page-sequence-preface -->
3262
3226
 
3263
3227
  <xsl:template name="refine_page-sequence-preface">
3264
3228
  <xsl:param name="layoutVersion"/>
3265
- </xsl:template>
3229
+ <xsl:param name="doctype"/>
3230
+ <xsl:param name="num"/>
3231
+ <xsl:param name="skip_force_page_count">false</xsl:param>
3232
+ <xsl:if test="$doctype = 'resolution'">
3233
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
3234
+ </xsl:if>
3235
+ <xsl:if test="$doctype = 'service-publication'">
3236
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
3237
+ <xsl:attribute name="font-family">Arial, STIX Two Math</xsl:attribute>
3238
+ </xsl:if>
3266
3239
 
3267
- <xsl:attribute-set name="page-sequence-main">
3240
+ <xsl:attribute name="master-reference">
3241
+ <xsl:text>preface</xsl:text>
3242
+ <xsl:call-template name="getPageSequenceOrientation"/>
3243
+ </xsl:attribute>
3268
3244
 
3269
- </xsl:attribute-set>
3245
+ <xsl:if test="$doctype = 'service-publication'">
3246
+ <xsl:attribute name="master-reference">
3247
+ <xsl:text>document</xsl:text>
3248
+ <xsl:call-template name="getPageSequenceOrientation"/>
3249
+ </xsl:attribute>
3250
+ <xsl:attribute name="format">1</xsl:attribute>
3251
+ </xsl:if>
3252
+
3253
+ <xsl:if test="position() = 1">
3254
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
3255
+ </xsl:if>
3256
+ </xsl:template> <!-- refine_page-sequence-preface -->
3257
+
3258
+ <xsl:attribute-set name="page-sequence-main">
3259
+ <xsl:attribute name="master-reference">document</xsl:attribute>
3260
+ <xsl:attribute name="force-page-count">no-force</xsl:attribute>
3261
+ </xsl:attribute-set> <!-- page-sequence-main -->
3270
3262
 
3271
3263
  <xsl:template name="refine_page-sequence-main">
3272
3264
  <xsl:param name="layoutVersion"/>
3273
- </xsl:template>
3265
+ <xsl:param name="doctype"/>
3266
+ <xsl:if test="$doctype = 'resolution'">
3267
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
3268
+ </xsl:if>
3269
+ <xsl:if test="$doctype = 'service-publication'">
3270
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
3271
+ <xsl:attribute name="font-family">Arial, STIX Two Math</xsl:attribute>
3272
+ </xsl:if>
3273
+
3274
+ <xsl:attribute name="master-reference">
3275
+ <xsl:text>document</xsl:text>
3276
+ <xsl:call-template name="getPageSequenceOrientation"/>
3277
+ </xsl:attribute>
3278
+
3279
+ <xsl:if test="position() = 1">
3280
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
3281
+ </xsl:if>
3282
+
3283
+ <xsl:if test="$doctype = 'service-publication'">
3284
+ <xsl:attribute name="initial-page-number">auto</xsl:attribute>
3285
+ </xsl:if>
3286
+ </xsl:template> <!-- refine_page-sequence-main -->
3274
3287
 
3275
3288
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
3276
3289
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
@@ -14250,6 +14263,7 @@
14250
14263
  </xsl:attribute-set>
14251
14264
 
14252
14265
  <xsl:template name="refine_toc-style">
14266
+ <xsl:copy-of select="@id"/>
14253
14267
  </xsl:template>
14254
14268
 
14255
14269
  <xsl:attribute-set name="toc-title-style">
@@ -14334,13 +14348,13 @@
14334
14348
 
14335
14349
  <xsl:template name="processPrefaceSectionsDefault_Contents">
14336
14350
  <xsl:variable name="nodes_preface_">
14337
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
14351
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
14338
14352
  <node id="{@id}"/>
14339
14353
  </xsl:for-each>
14340
14354
  </xsl:variable>
14341
14355
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
14342
14356
 
14343
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
14357
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
14344
14358
  <xsl:sort select="@displayorder" data-type="number"/>
14345
14359
 
14346
14360
  <!-- process Section's title -->
@@ -14353,6 +14367,23 @@
14353
14367
  </xsl:for-each>
14354
14368
  </xsl:template>
14355
14369
 
14370
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
14371
+ <xsl:variable name="title">
14372
+ <xsl:call-template name="getName"/>
14373
+ </xsl:variable>
14374
+ <xsl:variable name="root">
14375
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
14376
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
14377
+ </xsl:variable>
14378
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
14379
+ <mnx:title>
14380
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
14381
+ <xsl:with-param name="element" select="$root"/>
14382
+ </xsl:apply-templates>
14383
+ </mnx:title>
14384
+ </mnx:item>
14385
+ </xsl:template>
14386
+
14356
14387
  <xsl:template name="processMainSectionsDefault_Contents">
14357
14388
 
14358
14389
  <xsl:variable name="nodes_sections_">
@@ -16213,16 +16244,17 @@
16213
16244
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
16214
16245
  <xsl:template name="insert_basic_link">
16215
16246
  <xsl:param name="element"/>
16247
+ <xsl:param name="wrapper">true</xsl:param>
16216
16248
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
16217
16249
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
16218
16250
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
16219
16251
  <xsl:choose>
16220
- <xsl:when test="$internal-destination = 'true'">
16252
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
16221
16253
  <fo:wrapper role="Reference">
16222
16254
  <xsl:copy-of select="$element_node"/>
16223
16255
  </fo:wrapper>
16224
16256
  </xsl:when>
16225
- <xsl:when test="$external-destination = 'true'">
16257
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
16226
16258
  <xsl:copy-of select="$element_node"/>
16227
16259
  </xsl:when>
16228
16260
  <xsl:otherwise>
@@ -371,32 +371,12 @@
371
371
 
372
372
  <xsl:for-each select=".//mn:page_sequence[parent::mn:preface][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
373
373
 
374
- <fo:page-sequence master-reference="preface" format="i" force-page-count="no-force">
374
+ <!-- <debug><xsl:copy-of select="."/></debug> -->
375
375
 
376
- <xsl:if test="$doctype = 'resolution'">
377
- <xsl:attribute name="font-size">11pt</xsl:attribute>
378
- </xsl:if>
379
- <xsl:if test="$doctype = 'service-publication'">
380
- <xsl:attribute name="font-size">11pt</xsl:attribute>
381
- <xsl:attribute name="font-family">Arial, STIX Two Math</xsl:attribute>
382
- </xsl:if>
383
-
384
- <xsl:attribute name="master-reference">
385
- <xsl:text>preface</xsl:text>
386
- <xsl:call-template name="getPageSequenceOrientation"/>
387
- </xsl:attribute>
388
-
389
- <xsl:if test="$doctype = 'service-publication'">
390
- <xsl:attribute name="master-reference">
391
- <xsl:text>document</xsl:text>
392
- <xsl:call-template name="getPageSequenceOrientation"/>
393
- </xsl:attribute>
394
- <xsl:attribute name="format">1</xsl:attribute>
395
- </xsl:if>
396
-
397
- <xsl:if test="position() = 1">
398
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
399
- </xsl:if>
376
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-preface">
377
+ <xsl:call-template name="refine_page-sequence-preface">
378
+ <xsl:with-param name="doctype" select="$doctype"/>
379
+ </xsl:call-template>
400
380
 
401
381
  <xsl:call-template name="insertHeaderFooter">
402
382
  <xsl:with-param name="doctype" select="$doctype"/>
@@ -506,28 +486,10 @@
506
486
  <xsl:for-each select=".//mn:page_sequence[not(parent::mn:preface)][normalize-space() != '' or .//mn:image or .//*[local-name() = 'svg']]">
507
487
 
508
488
  <!-- BODY -->
509
- <fo:page-sequence master-reference="document" force-page-count="no-force">
510
-
511
- <xsl:if test="$doctype = 'resolution'">
512
- <xsl:attribute name="font-size">11pt</xsl:attribute>
513
- </xsl:if>
514
- <xsl:if test="$doctype = 'service-publication'">
515
- <xsl:attribute name="font-size">11pt</xsl:attribute>
516
- <xsl:attribute name="font-family">Arial, STIX Two Math</xsl:attribute>
517
- </xsl:if>
518
-
519
- <xsl:attribute name="master-reference">
520
- <xsl:text>document</xsl:text>
521
- <xsl:call-template name="getPageSequenceOrientation"/>
522
- </xsl:attribute>
523
-
524
- <xsl:if test="position() = 1">
525
- <xsl:attribute name="initial-page-number">1</xsl:attribute>
526
- </xsl:if>
527
-
528
- <xsl:if test="$doctype = 'service-publication'">
529
- <xsl:attribute name="initial-page-number">auto</xsl:attribute>
530
- </xsl:if>
489
+ <fo:page-sequence xsl:use-attribute-sets="page-sequence-main">
490
+ <xsl:call-template name="refine_page-sequence-main">
491
+ <xsl:with-param name="doctype" select="$doctype"/>
492
+ </xsl:call-template>
531
493
 
532
494
  <xsl:call-template name="insertFootnoteSeparatorCommon"/>
533
495
 
@@ -1881,7 +1843,7 @@
1881
1843
  </xsl:call-template>
1882
1844
  <xsl:apply-templates select="." mode="contents"/>
1883
1845
  <fo:inline keep-together.within-line="always">
1884
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1846
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
1885
1847
  <fo:page-number-citation ref-id="{@id}"/>
1886
1848
  </fo:inline>
1887
1849
  </fo:basic-link>
@@ -1943,7 +1905,7 @@
1943
1905
  <fo:basic-link internal-destination="{@id}" fox:alt-text="{mnx:title}">
1944
1906
  <xsl:apply-templates select="mnx:title"/>
1945
1907
  <fo:inline keep-together.within-line="always">
1946
- <fo:leader xsl:use-attribute-sets="toc-leader-style"/>
1908
+ <fo:leader xsl:use-attribute-sets="toc-leader-style"><xsl:call-template name="refine_toc-leader-style"/></fo:leader>
1947
1909
  <fo:page-number-citation ref-id="{@id}"/>
1948
1910
  </fo:inline>
1949
1911
  </fo:basic-link>
@@ -3257,20 +3219,71 @@
3257
3219
  </xsl:variable>
3258
3220
 
3259
3221
  <xsl:attribute-set name="page-sequence-preface">
3222
+ <xsl:attribute name="master-reference">preface</xsl:attribute>
3260
3223
  <xsl:attribute name="format">i</xsl:attribute>
3261
- </xsl:attribute-set>
3224
+ <xsl:attribute name="force-page-count">no-force</xsl:attribute>
3225
+ </xsl:attribute-set> <!-- page-sequence-preface -->
3262
3226
 
3263
3227
  <xsl:template name="refine_page-sequence-preface">
3264
3228
  <xsl:param name="layoutVersion"/>
3265
- </xsl:template>
3229
+ <xsl:param name="doctype"/>
3230
+ <xsl:param name="num"/>
3231
+ <xsl:param name="skip_force_page_count">false</xsl:param>
3232
+ <xsl:if test="$doctype = 'resolution'">
3233
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
3234
+ </xsl:if>
3235
+ <xsl:if test="$doctype = 'service-publication'">
3236
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
3237
+ <xsl:attribute name="font-family">Arial, STIX Two Math</xsl:attribute>
3238
+ </xsl:if>
3266
3239
 
3267
- <xsl:attribute-set name="page-sequence-main">
3240
+ <xsl:attribute name="master-reference">
3241
+ <xsl:text>preface</xsl:text>
3242
+ <xsl:call-template name="getPageSequenceOrientation"/>
3243
+ </xsl:attribute>
3268
3244
 
3269
- </xsl:attribute-set>
3245
+ <xsl:if test="$doctype = 'service-publication'">
3246
+ <xsl:attribute name="master-reference">
3247
+ <xsl:text>document</xsl:text>
3248
+ <xsl:call-template name="getPageSequenceOrientation"/>
3249
+ </xsl:attribute>
3250
+ <xsl:attribute name="format">1</xsl:attribute>
3251
+ </xsl:if>
3252
+
3253
+ <xsl:if test="position() = 1">
3254
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
3255
+ </xsl:if>
3256
+ </xsl:template> <!-- refine_page-sequence-preface -->
3257
+
3258
+ <xsl:attribute-set name="page-sequence-main">
3259
+ <xsl:attribute name="master-reference">document</xsl:attribute>
3260
+ <xsl:attribute name="force-page-count">no-force</xsl:attribute>
3261
+ </xsl:attribute-set> <!-- page-sequence-main -->
3270
3262
 
3271
3263
  <xsl:template name="refine_page-sequence-main">
3272
3264
  <xsl:param name="layoutVersion"/>
3273
- </xsl:template>
3265
+ <xsl:param name="doctype"/>
3266
+ <xsl:if test="$doctype = 'resolution'">
3267
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
3268
+ </xsl:if>
3269
+ <xsl:if test="$doctype = 'service-publication'">
3270
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
3271
+ <xsl:attribute name="font-family">Arial, STIX Two Math</xsl:attribute>
3272
+ </xsl:if>
3273
+
3274
+ <xsl:attribute name="master-reference">
3275
+ <xsl:text>document</xsl:text>
3276
+ <xsl:call-template name="getPageSequenceOrientation"/>
3277
+ </xsl:attribute>
3278
+
3279
+ <xsl:if test="position() = 1">
3280
+ <xsl:attribute name="initial-page-number">1</xsl:attribute>
3281
+ </xsl:if>
3282
+
3283
+ <xsl:if test="$doctype = 'service-publication'">
3284
+ <xsl:attribute name="initial-page-number">auto</xsl:attribute>
3285
+ </xsl:if>
3286
+ </xsl:template> <!-- refine_page-sequence-main -->
3274
3287
 
3275
3288
  <xsl:variable name="font_noto_sans">Noto Sans, Noto Sans HK, Noto Sans JP, Noto Sans KR, Noto Sans SC, Noto Sans TC</xsl:variable>
3276
3289
  <xsl:variable name="font_noto_sans_mono">Noto Sans Mono, Noto Sans Mono CJK HK, Noto Sans Mono CJK JP, Noto Sans Mono CJK KR, Noto Sans Mono CJK SC, Noto Sans Mono CJK TC</xsl:variable>
@@ -14250,6 +14263,7 @@
14250
14263
  </xsl:attribute-set>
14251
14264
 
14252
14265
  <xsl:template name="refine_toc-style">
14266
+ <xsl:copy-of select="@id"/>
14253
14267
  </xsl:template>
14254
14268
 
14255
14269
  <xsl:attribute-set name="toc-title-style">
@@ -14334,13 +14348,13 @@
14334
14348
 
14335
14349
  <xsl:template name="processPrefaceSectionsDefault_Contents">
14336
14350
  <xsl:variable name="nodes_preface_">
14337
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
14351
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
14338
14352
  <node id="{@id}"/>
14339
14353
  </xsl:for-each>
14340
14354
  </xsl:variable>
14341
14355
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
14342
14356
 
14343
- <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition or @type = 'toc')]">
14357
+ <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]"> <!-- or @type = 'toc' -->
14344
14358
  <xsl:sort select="@displayorder" data-type="number"/>
14345
14359
 
14346
14360
  <!-- process Section's title -->
@@ -14353,6 +14367,23 @@
14353
14367
  </xsl:for-each>
14354
14368
  </xsl:template>
14355
14369
 
14370
+ <xsl:template match="*[@type = 'toc'][mn:title or mn:fmt-title]" mode="contents" priority="2">
14371
+ <xsl:variable name="title">
14372
+ <xsl:call-template name="getName"/>
14373
+ </xsl:variable>
14374
+ <xsl:variable name="root">
14375
+ <xsl:if test="ancestor-or-self::mn:preface">preface</xsl:if>
14376
+ <xsl:if test="ancestor-or-self::mn:annex">annex</xsl:if>
14377
+ </xsl:variable>
14378
+ <mnx:item id="{@id}" level="1" section="" type="toc" root="{$root}" display="false">
14379
+ <mnx:title>
14380
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item">
14381
+ <xsl:with-param name="element" select="$root"/>
14382
+ </xsl:apply-templates>
14383
+ </mnx:title>
14384
+ </mnx:item>
14385
+ </xsl:template>
14386
+
14356
14387
  <xsl:template name="processMainSectionsDefault_Contents">
14357
14388
 
14358
14389
  <xsl:variable name="nodes_sections_">
@@ -16213,16 +16244,17 @@
16213
16244
  <!-- insert fo:basic-link, if external-destination or internal-destination is non-empty, otherwise insert fo:inline -->
16214
16245
  <xsl:template name="insert_basic_link">
16215
16246
  <xsl:param name="element"/>
16247
+ <xsl:param name="wrapper">true</xsl:param>
16216
16248
  <xsl:variable name="element_node" select="xalan:nodeset($element)"/>
16217
16249
  <xsl:variable name="external-destination" select="normalize-space(count($element_node/fo:basic-link/@external-destination[. != '']) = 1)"/>
16218
16250
  <xsl:variable name="internal-destination" select="normalize-space(count($element_node/fo:basic-link/@internal-destination[. != '']) = 1)"/>
16219
16251
  <xsl:choose>
16220
- <xsl:when test="$internal-destination = 'true'">
16252
+ <xsl:when test="$internal-destination = 'true' and $wrapper = 'true'">
16221
16253
  <fo:wrapper role="Reference">
16222
16254
  <xsl:copy-of select="$element_node"/>
16223
16255
  </fo:wrapper>
16224
16256
  </xsl:when>
16225
- <xsl:when test="$external-destination = 'true'">
16257
+ <xsl:when test="$internal-destination = 'true' or $external-destination = 'true'">
16226
16258
  <xsl:copy-of select="$element_node"/>
16227
16259
  </xsl:when>
16228
16260
  <xsl:otherwise>