metanorma-itu 2.8.1 → 2.8.2

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.
@@ -382,7 +382,21 @@
382
382
 
383
383
  <fo:flow flow-name="xsl-region-body">
384
384
 
385
- <xsl:if test="/mn:metanorma/mn:preface/*[not(@type = 'toc')] or /mn:metanorma/mn:bibdata/mn:keyword">
385
+ <xsl:variable name="showKeywords_">
386
+ <!-- From: https://github.com/metanorma/metanorma-itu/issues/730#issuecomment-3576320261
387
+ we removed keywords Metadata field from the cover page of Cs and TDs since the start of the precious study period. It no longer figures in the C and TD template file.
388
+ Keywords continue to be mandatory in the text of Recs and Suppls and Tech Papers / Reports. -->
389
+ <xsl:if test="/mn:metanorma/mn:bibdata/mn:keyword">
390
+ <xsl:choose>
391
+ <xsl:when test="$doctype = 'contribution'">false</xsl:when>
392
+ <xsl:when test="$TDnumber != ''">false</xsl:when>
393
+ <xsl:otherwise>true</xsl:otherwise>
394
+ </xsl:choose>
395
+ </xsl:if>
396
+ </xsl:variable>
397
+ <xsl:variable name="showKeywords" select="normalize-space($showKeywords_)"/>
398
+
399
+ <xsl:if test="/mn:metanorma/mn:preface/*[not(@type = 'toc')] or $showKeywords = 'true'">
386
400
 
387
401
  <xsl:if test="position() = 1">
388
402
  <fo:block-container font-size="14pt" font-weight="bold">
@@ -419,16 +433,20 @@
419
433
 
420
434
  <xsl:if test="position() = last()">
421
435
  <!-- Keywords -->
422
- <xsl:if test="/mn:metanorma/mn:bibdata/mn:keyword">
436
+ <xsl:if test="$showKeywords = 'true'">
423
437
  <fo:block font-size="12pt">
438
+ <xsl:if test="*[last()]/mn:table">
439
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
440
+ </xsl:if>
424
441
  <xsl:value-of select="$linebreak"/>
425
442
  <xsl:value-of select="$linebreak"/>
426
- </fo:block>
427
- <fo:block font-weight="bold" margin-top="18pt" margin-bottom="18pt">
428
- <xsl:value-of select="$i18n_keywords"/>
429
- </fo:block>
430
- <fo:block>
431
- <xsl:call-template name="insertKeywords"/>
443
+
444
+ <fo:block font-weight="bold" margin-top="18pt" margin-bottom="18pt" keep-with-next="always">
445
+ <xsl:value-of select="$i18n_keywords"/>
446
+ </fo:block>
447
+ <fo:block>
448
+ <xsl:call-template name="insertKeywords"/>
449
+ </fo:block>
432
450
  </fo:block>
433
451
  </xsl:if>
434
452
 
@@ -2383,29 +2401,6 @@
2383
2401
  </fo:footnote>
2384
2402
  </xsl:template> -->
2385
2403
 
2386
- <xsl:template match="mn:tt" priority="2">
2387
- <xsl:variable name="element-name">
2388
- <xsl:choose>
2389
- <xsl:when test="$isGenerateTableIF = 'true'">fo:inline</xsl:when>
2390
- <xsl:when test="ancestor::mn:dd">fo:inline</xsl:when>
2391
- <xsl:when test="ancestor::mn:fmt-title">fo:inline</xsl:when>
2392
- <xsl:when test="normalize-space(ancestor::mn:p[1]//text()[not(parent::mn:tt)]) != ''">fo:inline</xsl:when>
2393
- <xsl:otherwise>fo:block</xsl:otherwise>
2394
- </xsl:choose>
2395
- </xsl:variable>
2396
- <xsl:element name="{$element-name}">
2397
- <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2398
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2399
- <xsl:if test="not(parent::mn:dt) and not(ancestor::mn:dd) and not(ancestor::mn:fmt-title) and $isGenerateTableIF = 'false'">
2400
- <xsl:attribute name="text-align">center</xsl:attribute>
2401
- </xsl:if>
2402
- <xsl:if test="ancestor::mn:fmt-title">
2403
- <xsl:attribute name="font-size">11pt</xsl:attribute>
2404
- </xsl:if>
2405
- <xsl:apply-templates/>
2406
- </xsl:element>
2407
- </xsl:template>
2408
-
2409
2404
  <xsl:template match="mn:ul | mn:ol | mn:sections/mn:ul | mn:sections/mn:ol" mode="list" priority="2">
2410
2405
  <xsl:variable name="doctype" select="ancestor::mn:metanorma/mn:bibdata/mn:ext/mn:doctype[not(@language) or @language = '']"/>
2411
2406
  <xsl:if test="preceding-sibling::*[1][self::mn:fmt-title] and $doctype != 'service-publication'">
@@ -2520,16 +2515,16 @@
2520
2515
  </fo:block>
2521
2516
  </xsl:template>
2522
2517
 
2523
- <xsl:template match="mn:fmt-link" priority="2">
2518
+ <!-- <xsl:template match="mn:fmt-link" priority="2">
2524
2519
  <fo:inline color="blue">
2525
2520
  <xsl:if test="parent::mn:formattedref or ancestor::mn:preface">
2526
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
2521
+ <xsl:attribute name="text-decoration">underline</xsl:attribute> -->
2527
2522
  <!-- <xsl:attribute name="font-family">Arial</xsl:attribute>
2528
2523
  <xsl:attribute name="font-size">8pt</xsl:attribute> -->
2529
- </xsl:if>
2524
+ <!-- </xsl:if>
2530
2525
  <xsl:call-template name="link"/>
2531
2526
  </fo:inline>
2532
- </xsl:template>
2527
+ </xsl:template> -->
2533
2528
 
2534
2529
  <!-- https://github.com/metanorma/metanorma-itu/issues/607 -->
2535
2530
  <xsl:template match="mn:references/mn:bibitem[1]" priority="5">
@@ -4124,7 +4119,7 @@
4124
4119
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
4125
4120
  <xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
4126
4121
 
4127
- <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
4122
+ <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
4128
4123
 
4129
4124
  <xsl:variable name="parent" select="local-name(..)"/>
4130
4125
 
@@ -4711,9 +4706,15 @@
4711
4706
  <!-- ================================= -->
4712
4707
 
4713
4708
  <xsl:attribute-set name="link-style">
4709
+ <xsl:attribute name="color">blue</xsl:attribute>
4710
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4714
4711
  </xsl:attribute-set>
4715
4712
 
4716
4713
  <xsl:template name="refine_link-style">
4714
+ <xsl:if test="@style = 'url'">
4715
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
4716
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
4717
+ </xsl:if>
4717
4718
  </xsl:template> <!-- refine_link-style -->
4718
4719
 
4719
4720
  <xsl:template match="mn:fmt-link" name="link">
@@ -5373,10 +5374,15 @@
5373
5374
  </xsl:template>
5374
5375
 
5375
5376
  <xsl:attribute-set name="tt-style">
5377
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
5376
5378
  </xsl:attribute-set>
5377
5379
 
5378
5380
  <xsl:template name="refine_tt-style">
5379
5381
  <xsl:variable name="_font-size"> <!-- inherit -->
5382
+ <xsl:choose>
5383
+ <xsl:when test="ancestor::mn:fmt-title">11</xsl:when>
5384
+ <xsl:otherwise>10</xsl:otherwise>
5385
+ </xsl:choose>
5380
5386
  </xsl:variable>
5381
5387
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
5382
5388
  <xsl:if test="$font-size != ''">
@@ -15311,9 +15317,12 @@
15311
15317
  </xsl:template> <!-- refine_title-style -->
15312
15318
 
15313
15319
  <xsl:template name="processPrefaceSectionsDefault">
15320
+ <xsl:param name="num"/>
15314
15321
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
15315
15322
  <xsl:sort select="@displayorder" data-type="number"/>
15316
- <xsl:apply-templates select="."/>
15323
+ <xsl:apply-templates select=".">
15324
+ <xsl:with-param name="num" select="$num"/>
15325
+ </xsl:apply-templates>
15317
15326
  </xsl:for-each>
15318
15327
  </xsl:template>
15319
15328
 
@@ -15717,7 +15726,6 @@
15717
15726
  </xsl:template> <!-- sections_element_style -->
15718
15727
 
15719
15728
  <xsl:template match="//mn:metanorma/mn:preface/*" priority="2" name="preface_node"> <!-- /*/mn:preface/* -->
15720
- <fo:block break-after="page"/>
15721
15729
  <xsl:call-template name="setNamedDestination"/>
15722
15730
  <fo:block>
15723
15731
  <xsl:call-template name="setId"/>
@@ -382,7 +382,21 @@
382
382
 
383
383
  <fo:flow flow-name="xsl-region-body">
384
384
 
385
- <xsl:if test="/mn:metanorma/mn:preface/*[not(@type = 'toc')] or /mn:metanorma/mn:bibdata/mn:keyword">
385
+ <xsl:variable name="showKeywords_">
386
+ <!-- From: https://github.com/metanorma/metanorma-itu/issues/730#issuecomment-3576320261
387
+ we removed keywords Metadata field from the cover page of Cs and TDs since the start of the precious study period. It no longer figures in the C and TD template file.
388
+ Keywords continue to be mandatory in the text of Recs and Suppls and Tech Papers / Reports. -->
389
+ <xsl:if test="/mn:metanorma/mn:bibdata/mn:keyword">
390
+ <xsl:choose>
391
+ <xsl:when test="$doctype = 'contribution'">false</xsl:when>
392
+ <xsl:when test="$TDnumber != ''">false</xsl:when>
393
+ <xsl:otherwise>true</xsl:otherwise>
394
+ </xsl:choose>
395
+ </xsl:if>
396
+ </xsl:variable>
397
+ <xsl:variable name="showKeywords" select="normalize-space($showKeywords_)"/>
398
+
399
+ <xsl:if test="/mn:metanorma/mn:preface/*[not(@type = 'toc')] or $showKeywords = 'true'">
386
400
 
387
401
  <xsl:if test="position() = 1">
388
402
  <fo:block-container font-size="14pt" font-weight="bold">
@@ -419,16 +433,20 @@
419
433
 
420
434
  <xsl:if test="position() = last()">
421
435
  <!-- Keywords -->
422
- <xsl:if test="/mn:metanorma/mn:bibdata/mn:keyword">
436
+ <xsl:if test="$showKeywords = 'true'">
423
437
  <fo:block font-size="12pt">
438
+ <xsl:if test="*[last()]/mn:table">
439
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
440
+ </xsl:if>
424
441
  <xsl:value-of select="$linebreak"/>
425
442
  <xsl:value-of select="$linebreak"/>
426
- </fo:block>
427
- <fo:block font-weight="bold" margin-top="18pt" margin-bottom="18pt">
428
- <xsl:value-of select="$i18n_keywords"/>
429
- </fo:block>
430
- <fo:block>
431
- <xsl:call-template name="insertKeywords"/>
443
+
444
+ <fo:block font-weight="bold" margin-top="18pt" margin-bottom="18pt" keep-with-next="always">
445
+ <xsl:value-of select="$i18n_keywords"/>
446
+ </fo:block>
447
+ <fo:block>
448
+ <xsl:call-template name="insertKeywords"/>
449
+ </fo:block>
432
450
  </fo:block>
433
451
  </xsl:if>
434
452
 
@@ -2383,29 +2401,6 @@
2383
2401
  </fo:footnote>
2384
2402
  </xsl:template> -->
2385
2403
 
2386
- <xsl:template match="mn:tt" priority="2">
2387
- <xsl:variable name="element-name">
2388
- <xsl:choose>
2389
- <xsl:when test="$isGenerateTableIF = 'true'">fo:inline</xsl:when>
2390
- <xsl:when test="ancestor::mn:dd">fo:inline</xsl:when>
2391
- <xsl:when test="ancestor::mn:fmt-title">fo:inline</xsl:when>
2392
- <xsl:when test="normalize-space(ancestor::mn:p[1]//text()[not(parent::mn:tt)]) != ''">fo:inline</xsl:when>
2393
- <xsl:otherwise>fo:block</xsl:otherwise>
2394
- </xsl:choose>
2395
- </xsl:variable>
2396
- <xsl:element name="{$element-name}">
2397
- <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2398
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2399
- <xsl:if test="not(parent::mn:dt) and not(ancestor::mn:dd) and not(ancestor::mn:fmt-title) and $isGenerateTableIF = 'false'">
2400
- <xsl:attribute name="text-align">center</xsl:attribute>
2401
- </xsl:if>
2402
- <xsl:if test="ancestor::mn:fmt-title">
2403
- <xsl:attribute name="font-size">11pt</xsl:attribute>
2404
- </xsl:if>
2405
- <xsl:apply-templates/>
2406
- </xsl:element>
2407
- </xsl:template>
2408
-
2409
2404
  <xsl:template match="mn:ul | mn:ol | mn:sections/mn:ul | mn:sections/mn:ol" mode="list" priority="2">
2410
2405
  <xsl:variable name="doctype" select="ancestor::mn:metanorma/mn:bibdata/mn:ext/mn:doctype[not(@language) or @language = '']"/>
2411
2406
  <xsl:if test="preceding-sibling::*[1][self::mn:fmt-title] and $doctype != 'service-publication'">
@@ -2520,16 +2515,16 @@
2520
2515
  </fo:block>
2521
2516
  </xsl:template>
2522
2517
 
2523
- <xsl:template match="mn:fmt-link" priority="2">
2518
+ <!-- <xsl:template match="mn:fmt-link" priority="2">
2524
2519
  <fo:inline color="blue">
2525
2520
  <xsl:if test="parent::mn:formattedref or ancestor::mn:preface">
2526
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
2521
+ <xsl:attribute name="text-decoration">underline</xsl:attribute> -->
2527
2522
  <!-- <xsl:attribute name="font-family">Arial</xsl:attribute>
2528
2523
  <xsl:attribute name="font-size">8pt</xsl:attribute> -->
2529
- </xsl:if>
2524
+ <!-- </xsl:if>
2530
2525
  <xsl:call-template name="link"/>
2531
2526
  </fo:inline>
2532
- </xsl:template>
2527
+ </xsl:template> -->
2533
2528
 
2534
2529
  <!-- https://github.com/metanorma/metanorma-itu/issues/607 -->
2535
2530
  <xsl:template match="mn:references/mn:bibitem[1]" priority="5">
@@ -4124,7 +4119,7 @@
4124
4119
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
4125
4120
  <xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
4126
4121
 
4127
- <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
4122
+ <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
4128
4123
 
4129
4124
  <xsl:variable name="parent" select="local-name(..)"/>
4130
4125
 
@@ -4711,9 +4706,15 @@
4711
4706
  <!-- ================================= -->
4712
4707
 
4713
4708
  <xsl:attribute-set name="link-style">
4709
+ <xsl:attribute name="color">blue</xsl:attribute>
4710
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4714
4711
  </xsl:attribute-set>
4715
4712
 
4716
4713
  <xsl:template name="refine_link-style">
4714
+ <xsl:if test="@style = 'url'">
4715
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
4716
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
4717
+ </xsl:if>
4717
4718
  </xsl:template> <!-- refine_link-style -->
4718
4719
 
4719
4720
  <xsl:template match="mn:fmt-link" name="link">
@@ -5373,10 +5374,15 @@
5373
5374
  </xsl:template>
5374
5375
 
5375
5376
  <xsl:attribute-set name="tt-style">
5377
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
5376
5378
  </xsl:attribute-set>
5377
5379
 
5378
5380
  <xsl:template name="refine_tt-style">
5379
5381
  <xsl:variable name="_font-size"> <!-- inherit -->
5382
+ <xsl:choose>
5383
+ <xsl:when test="ancestor::mn:fmt-title">11</xsl:when>
5384
+ <xsl:otherwise>10</xsl:otherwise>
5385
+ </xsl:choose>
5380
5386
  </xsl:variable>
5381
5387
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
5382
5388
  <xsl:if test="$font-size != ''">
@@ -15311,9 +15317,12 @@
15311
15317
  </xsl:template> <!-- refine_title-style -->
15312
15318
 
15313
15319
  <xsl:template name="processPrefaceSectionsDefault">
15320
+ <xsl:param name="num"/>
15314
15321
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
15315
15322
  <xsl:sort select="@displayorder" data-type="number"/>
15316
- <xsl:apply-templates select="."/>
15323
+ <xsl:apply-templates select=".">
15324
+ <xsl:with-param name="num" select="$num"/>
15325
+ </xsl:apply-templates>
15317
15326
  </xsl:for-each>
15318
15327
  </xsl:template>
15319
15328
 
@@ -15717,7 +15726,6 @@
15717
15726
  </xsl:template> <!-- sections_element_style -->
15718
15727
 
15719
15728
  <xsl:template match="//mn:metanorma/mn:preface/*" priority="2" name="preface_node"> <!-- /*/mn:preface/* -->
15720
- <fo:block break-after="page"/>
15721
15729
  <xsl:call-template name="setNamedDestination"/>
15722
15730
  <fo:block>
15723
15731
  <xsl:call-template name="setId"/>
@@ -382,7 +382,21 @@
382
382
 
383
383
  <fo:flow flow-name="xsl-region-body">
384
384
 
385
- <xsl:if test="/mn:metanorma/mn:preface/*[not(@type = 'toc')] or /mn:metanorma/mn:bibdata/mn:keyword">
385
+ <xsl:variable name="showKeywords_">
386
+ <!-- From: https://github.com/metanorma/metanorma-itu/issues/730#issuecomment-3576320261
387
+ we removed keywords Metadata field from the cover page of Cs and TDs since the start of the precious study period. It no longer figures in the C and TD template file.
388
+ Keywords continue to be mandatory in the text of Recs and Suppls and Tech Papers / Reports. -->
389
+ <xsl:if test="/mn:metanorma/mn:bibdata/mn:keyword">
390
+ <xsl:choose>
391
+ <xsl:when test="$doctype = 'contribution'">false</xsl:when>
392
+ <xsl:when test="$TDnumber != ''">false</xsl:when>
393
+ <xsl:otherwise>true</xsl:otherwise>
394
+ </xsl:choose>
395
+ </xsl:if>
396
+ </xsl:variable>
397
+ <xsl:variable name="showKeywords" select="normalize-space($showKeywords_)"/>
398
+
399
+ <xsl:if test="/mn:metanorma/mn:preface/*[not(@type = 'toc')] or $showKeywords = 'true'">
386
400
 
387
401
  <xsl:if test="position() = 1">
388
402
  <fo:block-container font-size="14pt" font-weight="bold">
@@ -419,16 +433,20 @@
419
433
 
420
434
  <xsl:if test="position() = last()">
421
435
  <!-- Keywords -->
422
- <xsl:if test="/mn:metanorma/mn:bibdata/mn:keyword">
436
+ <xsl:if test="$showKeywords = 'true'">
423
437
  <fo:block font-size="12pt">
438
+ <xsl:if test="*[last()]/mn:table">
439
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
440
+ </xsl:if>
424
441
  <xsl:value-of select="$linebreak"/>
425
442
  <xsl:value-of select="$linebreak"/>
426
- </fo:block>
427
- <fo:block font-weight="bold" margin-top="18pt" margin-bottom="18pt">
428
- <xsl:value-of select="$i18n_keywords"/>
429
- </fo:block>
430
- <fo:block>
431
- <xsl:call-template name="insertKeywords"/>
443
+
444
+ <fo:block font-weight="bold" margin-top="18pt" margin-bottom="18pt" keep-with-next="always">
445
+ <xsl:value-of select="$i18n_keywords"/>
446
+ </fo:block>
447
+ <fo:block>
448
+ <xsl:call-template name="insertKeywords"/>
449
+ </fo:block>
432
450
  </fo:block>
433
451
  </xsl:if>
434
452
 
@@ -2383,29 +2401,6 @@
2383
2401
  </fo:footnote>
2384
2402
  </xsl:template> -->
2385
2403
 
2386
- <xsl:template match="mn:tt" priority="2">
2387
- <xsl:variable name="element-name">
2388
- <xsl:choose>
2389
- <xsl:when test="$isGenerateTableIF = 'true'">fo:inline</xsl:when>
2390
- <xsl:when test="ancestor::mn:dd">fo:inline</xsl:when>
2391
- <xsl:when test="ancestor::mn:fmt-title">fo:inline</xsl:when>
2392
- <xsl:when test="normalize-space(ancestor::mn:p[1]//text()[not(parent::mn:tt)]) != ''">fo:inline</xsl:when>
2393
- <xsl:otherwise>fo:block</xsl:otherwise>
2394
- </xsl:choose>
2395
- </xsl:variable>
2396
- <xsl:element name="{$element-name}">
2397
- <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
2398
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2399
- <xsl:if test="not(parent::mn:dt) and not(ancestor::mn:dd) and not(ancestor::mn:fmt-title) and $isGenerateTableIF = 'false'">
2400
- <xsl:attribute name="text-align">center</xsl:attribute>
2401
- </xsl:if>
2402
- <xsl:if test="ancestor::mn:fmt-title">
2403
- <xsl:attribute name="font-size">11pt</xsl:attribute>
2404
- </xsl:if>
2405
- <xsl:apply-templates/>
2406
- </xsl:element>
2407
- </xsl:template>
2408
-
2409
2404
  <xsl:template match="mn:ul | mn:ol | mn:sections/mn:ul | mn:sections/mn:ol" mode="list" priority="2">
2410
2405
  <xsl:variable name="doctype" select="ancestor::mn:metanorma/mn:bibdata/mn:ext/mn:doctype[not(@language) or @language = '']"/>
2411
2406
  <xsl:if test="preceding-sibling::*[1][self::mn:fmt-title] and $doctype != 'service-publication'">
@@ -2520,16 +2515,16 @@
2520
2515
  </fo:block>
2521
2516
  </xsl:template>
2522
2517
 
2523
- <xsl:template match="mn:fmt-link" priority="2">
2518
+ <!-- <xsl:template match="mn:fmt-link" priority="2">
2524
2519
  <fo:inline color="blue">
2525
2520
  <xsl:if test="parent::mn:formattedref or ancestor::mn:preface">
2526
- <xsl:attribute name="text-decoration">underline</xsl:attribute>
2521
+ <xsl:attribute name="text-decoration">underline</xsl:attribute> -->
2527
2522
  <!-- <xsl:attribute name="font-family">Arial</xsl:attribute>
2528
2523
  <xsl:attribute name="font-size">8pt</xsl:attribute> -->
2529
- </xsl:if>
2524
+ <!-- </xsl:if>
2530
2525
  <xsl:call-template name="link"/>
2531
2526
  </fo:inline>
2532
- </xsl:template>
2527
+ </xsl:template> -->
2533
2528
 
2534
2529
  <!-- https://github.com/metanorma/metanorma-itu/issues/607 -->
2535
2530
  <xsl:template match="mn:references/mn:bibitem[1]" priority="5">
@@ -4124,7 +4119,7 @@
4124
4119
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
4125
4120
  <xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
4126
4121
 
4127
- <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
4122
+ <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
4128
4123
 
4129
4124
  <xsl:variable name="parent" select="local-name(..)"/>
4130
4125
 
@@ -4711,9 +4706,15 @@
4711
4706
  <!-- ================================= -->
4712
4707
 
4713
4708
  <xsl:attribute-set name="link-style">
4709
+ <xsl:attribute name="color">blue</xsl:attribute>
4710
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
4714
4711
  </xsl:attribute-set>
4715
4712
 
4716
4713
  <xsl:template name="refine_link-style">
4714
+ <xsl:if test="@style = 'url'">
4715
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
4716
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
4717
+ </xsl:if>
4717
4718
  </xsl:template> <!-- refine_link-style -->
4718
4719
 
4719
4720
  <xsl:template match="mn:fmt-link" name="link">
@@ -5373,10 +5374,15 @@
5373
5374
  </xsl:template>
5374
5375
 
5375
5376
  <xsl:attribute-set name="tt-style">
5377
+ <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
5376
5378
  </xsl:attribute-set>
5377
5379
 
5378
5380
  <xsl:template name="refine_tt-style">
5379
5381
  <xsl:variable name="_font-size"> <!-- inherit -->
5382
+ <xsl:choose>
5383
+ <xsl:when test="ancestor::mn:fmt-title">11</xsl:when>
5384
+ <xsl:otherwise>10</xsl:otherwise>
5385
+ </xsl:choose>
5380
5386
  </xsl:variable>
5381
5387
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
5382
5388
  <xsl:if test="$font-size != ''">
@@ -15311,9 +15317,12 @@
15311
15317
  </xsl:template> <!-- refine_title-style -->
15312
15318
 
15313
15319
  <xsl:template name="processPrefaceSectionsDefault">
15320
+ <xsl:param name="num"/>
15314
15321
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
15315
15322
  <xsl:sort select="@displayorder" data-type="number"/>
15316
- <xsl:apply-templates select="."/>
15323
+ <xsl:apply-templates select=".">
15324
+ <xsl:with-param name="num" select="$num"/>
15325
+ </xsl:apply-templates>
15317
15326
  </xsl:for-each>
15318
15327
  </xsl:template>
15319
15328
 
@@ -15717,7 +15726,6 @@
15717
15726
  </xsl:template> <!-- sections_element_style -->
15718
15727
 
15719
15728
  <xsl:template match="//mn:metanorma/mn:preface/*" priority="2" name="preface_node"> <!-- /*/mn:preface/* -->
15720
- <fo:block break-after="page"/>
15721
15729
  <xsl:call-template name="setNamedDestination"/>
15722
15730
  <fo:block>
15723
15731
  <xsl:call-template name="setId"/>
@@ -6,13 +6,16 @@ module IsoDoc
6
6
  class Metadata < IsoDoc::Metadata
7
7
  def initialize(lang, script, locale, labels)
8
8
  super
9
+ @isodoc = IsoDoc::Itu::HtmlConvert.new({})
10
+ end
11
+
12
+ def images(isoxml, xml)
9
13
  n = "International_Telecommunication_Union_Logo.svg"
10
14
  set(:logo_html, fileloc(n))
11
15
  set(:logo_comb, fileloc("itu-document-comb.png"))
12
16
  set(:logo_word, fileloc(n))
13
17
  set(:logo_sp, fileloc("logo-sp.png"))
14
18
  set(:logo_small, fileloc("logo-small.png"))
15
- @isodoc = IsoDoc::Itu::HtmlConvert.new({})
16
19
  end
17
20
 
18
21
  def fileloc(file)
@@ -50,7 +50,7 @@ module IsoDoc
50
50
  end
51
51
 
52
52
  def contribution_table_contacts
53
- n = (0..@meta.get[:authors]&.size).each_with_object([]) do |i, ret|
53
+ n = (0...@meta.get[:authors]&.size).each_with_object([]) do |i, ret|
54
54
  ret << contribution_table_contact(i)
55
55
  end
56
56
  n.map do |x|
@@ -90,7 +90,7 @@ module IsoDoc
90
90
  end
91
91
 
92
92
  def contrib_justification_contacts
93
- (0..@meta.get[:authors]&.size).each_with_object([]) do |i, ret|
93
+ (0...@meta.get[:authors]&.size).each_with_object([]) do |i, ret|
94
94
  ret << contribution_justification_contact(i)
95
95
  end
96
96
  end
@@ -82,8 +82,8 @@ module IsoDoc
82
82
  bibitem["hidden"] == "true" || bibitem.parent["hidden"] == "true"
83
83
  end
84
84
 
85
- def norm_ref_entry_code(_ordinal, idents, _ids, _standard, datefn, _bib)
86
- ret = (idents[:metanorma] || idents[:ordinal] || idents[:sdo]).to_s
85
+ def norm_ref_entry_code(_ordinal, ids, _standard, datefn, _bib)
86
+ ret = (ids[:content] || ids[:metanorma] || ids[:ordinal] || ids[:sdo]).to_s
87
87
  ret.empty? and return ""
88
88
  ret = ret.sub(/^\[(.+)\]$/, "\\1")
89
89
  ret = "[#{esc ret}]"
@@ -91,8 +91,8 @@ module IsoDoc
91
91
  ret.gsub("-", "&#x2011;").gsub(/ /, "&#xa0;")
92
92
  end
93
93
 
94
- def biblio_ref_entry_code(_ordinal, idents, _id, _standard, datefn, _bib)
95
- ret = (idents[:metanorma] || idents[:ordinal] || idents[:sdo]).to_s
94
+ def biblio_ref_entry_code(_ordinal, ids, _standard, datefn, _bib)
95
+ ret = (ids[:content] || ids[:metanorma] || ids[:ordinal] || ids[:sdo]).to_s
96
96
  ret = ret.sub(/^\[(.+)\]$/, "\\1")
97
97
  ret = "[#{esc ret}]"
98
98
  ret += datefn
@@ -157,6 +157,16 @@ module IsoDoc
157
157
  l10n(" &#x2013; ", { prev: lbl })
158
158
  end
159
159
 
160
+ def link(docxml)
161
+ (docxml.xpath(ns("//fmt-link")) -
162
+ docxml.xpath(ns("//boilerplate//fmt-link")) -
163
+ docxml.xpath(ns("//preface//fmt-link"))).each do |l|
164
+ l.text.empty? || l.text.match?(URI::DEFAULT_PARSER.make_regexp) or
165
+ next
166
+ l["style"] ||= "url"
167
+ end
168
+ end
169
+
160
170
  include Init
161
171
  end
162
172
  end
@@ -106,17 +106,6 @@ module IsoDoc
106
106
  start: node["start"] }
107
107
  end
108
108
 
109
- def link_parse(node, out)
110
- out.a **attr_code(href: node["target"], title: node["alt"],
111
- class: "url") do |l|
112
- if node.text.empty?
113
- l << node["target"].sub(/^mailto:/, "")
114
- else
115
- node.children.each { |n| parse(n, l) }
116
- end
117
- end
118
- end
119
-
120
109
  def clause_attrs(node)
121
110
  ret = {}
122
111
  %w(source history).include?(node["type"]) and
@@ -466,11 +466,11 @@ Editorial and advisory groups are represented as consecutive subdivisions of the
466
466
  <a:documentation>Contact information for the organization, including address, phone number, and email</a:documentation>
467
467
  </ref>
468
468
  </optional>
469
- <optional>
469
+ <zeroOrMore>
470
470
  <ref name="logo">
471
471
  <a:documentation>A logo for the organization</a:documentation>
472
472
  </ref>
473
- </optional>
473
+ </zeroOrMore>
474
474
  </define>
475
475
  <define name="orgname">
476
476
  <element name="name">
@@ -502,6 +502,11 @@ Editorial and advisory groups are represented as consecutive subdivisions of the
502
502
  </define>
503
503
  <define name="logo">
504
504
  <element name="logo">
505
+ <optional>
506
+ <attribute name="type">
507
+ <a:documentation>The type of logo</a:documentation>
508
+ </attribute>
509
+ </optional>
505
510
  <ref name="image-no-id"/>
506
511
  </element>
507
512
  </define>
@@ -513,6 +518,11 @@ Editorial and advisory groups are represented as consecutive subdivisions of the
513
518
  <a:documentation>Description of what is being depicted</a:documentation>
514
519
  </attribute>
515
520
  </optional>
521
+ <optional>
522
+ <attribute name="type">
523
+ <a:documentation>Description of what kind of depiction this</a:documentation>
524
+ </attribute>
525
+ </optional>
516
526
  <zeroOrMore>
517
527
  <ref name="image-no-id">
518
528
  <a:documentation>A visual depiction of the bibliographic item</a:documentation>
@@ -1236,9 +1246,9 @@ Refer to `BibliographicItem` for definitions</a:documentation>
1236
1246
  <optional>
1237
1247
  <ref name="validity"/>
1238
1248
  </optional>
1239
- <optional>
1249
+ <zeroOrMore>
1240
1250
  <ref name="depiction"/>
1241
- </optional>
1251
+ </zeroOrMore>
1242
1252
  </define>
1243
1253
  <define name="btitle">
1244
1254
  <a:documentation>A title of a bibliographic item, associated with a type of title</a:documentation>