metanorma-bipm 2.7.6 → 2.7.8

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.
@@ -1384,6 +1384,9 @@
1384
1384
 
1385
1385
  <xsl:template name="cover-page">
1386
1386
  <xsl:choose>
1387
+ <xsl:when test="/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = 'coverpage-image']/mn:value/mn:image and normalize-space(/mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/mn:full-coverpage-replacement) = 'true'">
1388
+ <xsl:call-template name="insertCoverPageFullImage"/>
1389
+ </xsl:when>
1387
1390
  <xsl:when test="$doctype = 'guide'">
1388
1391
  <xsl:call-template name="insertCoverPageAppendix"/>
1389
1392
  </xsl:when>
@@ -2295,71 +2298,18 @@
2295
2298
  <xsl:call-template name="getLevel"/>
2296
2299
  </xsl:variable>
2297
2300
 
2298
- <xsl:variable name="font-size">
2299
- <xsl:choose>
2300
- <xsl:when test="$level = 1">16pt</xsl:when>
2301
- <xsl:when test="$level = 2 and ancestor::mn:annex and ../@type = 'toc'">16pt</xsl:when>
2302
- <xsl:when test="$level = 2 and ancestor::mn:annex">10.5pt</xsl:when>
2303
- <xsl:when test="$level = 2">14pt</xsl:when>
2304
- <xsl:when test="$level &gt;= 3 and ancestor::mn:annex and ../@type = 'toc'">9pt</xsl:when>
2305
- <xsl:when test="$level = 3 and ancestor::mn:annex">10pt</xsl:when>
2306
- <xsl:when test="$level &gt;= 4 and ancestor::mn:annex">9pt</xsl:when>
2307
- <xsl:when test="$level = 3">12pt</xsl:when>
2308
- <xsl:otherwise>11pt</xsl:otherwise>
2309
- </xsl:choose>
2310
- </xsl:variable>
2311
-
2312
- <xsl:variable name="element-name">
2313
- <xsl:choose>
2314
- <xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
2315
- <xsl:otherwise>fo:block</xsl:otherwise>
2316
- </xsl:choose>
2301
+ <xsl:variable name="title_styles">
2302
+ <styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles>
2317
2303
  </xsl:variable>
2318
2304
 
2319
- <fo:block-container margin-left="-14mm" font-family="Arial" font-size="{$font-size}" font-weight="bold" keep-with-next="always" line-height="130%"> <!-- line-height="145%" -->
2320
- <xsl:if test="local-name(preceding-sibling::*[1]) = 'clause'">
2321
- <xsl:attribute name="id"><xsl:value-of select="preceding-sibling::*[1]/@id"/></xsl:attribute>
2322
- </xsl:if>
2323
- <xsl:attribute name="margin-bottom">
2324
- <xsl:choose>
2325
- <xsl:when test="$level = 1 and (parent::mn:annex or ancestor::mn:annex or parent::mn:abstract or ancestor::mn:preface)">84pt</xsl:when>
2326
- <xsl:when test="$level = 1">6pt</xsl:when>
2327
- <xsl:when test="$level = 2 and ancestor::mn:annex and ../@type = 'toc'">29mm</xsl:when>
2328
- <xsl:when test="$level = 2 and ancestor::mn:annex">6pt</xsl:when>
2329
- <xsl:when test="$level = 2">10pt</xsl:when>
2330
- <xsl:otherwise>6pt</xsl:otherwise>
2331
- </xsl:choose>
2332
- </xsl:attribute>
2333
-
2334
- <xsl:if test="$level = 2 and ancestor::mn:annex">
2335
- <xsl:attribute name="space-before">18pt</xsl:attribute> <!-- 24 pt -->
2336
- </xsl:if>
2337
- <xsl:if test="$level = 2 and not(ancestor::mn:annex)">
2338
- <xsl:attribute name="space-before">30pt</xsl:attribute>
2339
- </xsl:if>
2340
- <xsl:if test="$level = 3 and ancestor::mn:annex">
2341
- <xsl:attribute name="space-before">12pt</xsl:attribute> <!-- 6pt -->
2342
- </xsl:if>
2343
- <xsl:if test="$level = 4 and ancestor::mn:annex">
2344
- <xsl:attribute name="space-before">12pt</xsl:attribute>
2345
- </xsl:if>
2346
- <xsl:if test="$level = 3 and not(ancestor::mn:annex)">
2347
- <xsl:attribute name="space-before">20pt</xsl:attribute>
2348
- </xsl:if>
2349
-
2350
- <xsl:if test="$level &gt;= 3 and ancestor::mn:annex and ../@type = 'toc'">
2351
- <xsl:attribute name="space-before">0pt</xsl:attribute>
2352
- </xsl:if>
2353
-
2354
- <xsl:if test="@type = 'quoted'">
2355
- <xsl:attribute name="font-weight">normal</xsl:attribute>
2356
- </xsl:if>
2305
+ <fo:block-container xsl:use-attribute-sets="title-style">
2306
+ <xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
2357
2307
 
2358
2308
  <fo:block-container margin-left="0mm">
2359
2309
 
2360
2310
  <xsl:choose>
2361
2311
  <xsl:when test="mn:tab and not(ancestor::mn:annex) "><!-- split number and title -->
2362
- <fo:table table-layout="fixed" width="100%" role="H{$level}">
2312
+ <fo:table table-layout="fixed" width="100%" role="SKIP">
2363
2313
  <fo:table-column column-width="14mm"/>
2364
2314
  <fo:table-column column-width="136mm"/>
2365
2315
  <fo:table-body>
@@ -2380,7 +2330,7 @@
2380
2330
  </fo:table>
2381
2331
  </xsl:when>
2382
2332
  <xsl:otherwise>
2383
- <fo:block role="H{$level}">
2333
+ <fo:block role="SKIP">
2384
2334
 
2385
2335
  <xsl:if test="ancestor::mn:clause[@type = 'toc'] and $level &gt;= 3">
2386
2336
  <xsl:attribute name="role">Caption</xsl:attribute>
@@ -2901,42 +2851,15 @@
2901
2851
  </xsl:choose>
2902
2852
  </xsl:variable>
2903
2853
 
2854
+ <xsl:variable name="p_styles">
2855
+ <styles xsl:use-attribute-sets="p-style">
2856
+ <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
2857
+ </styles>
2858
+ </xsl:variable>
2859
+
2904
2860
  <xsl:element name="{$element-name}">
2905
- <xsl:attribute name="id">
2906
- <xsl:value-of select="@id"/>
2907
- </xsl:attribute>
2908
- <xsl:attribute name="text-align">
2909
- <xsl:choose>
2910
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
2911
- <xsl:when test="ancestor::mn:note_side">left</xsl:when>
2912
- <xsl:when test="../@align"><xsl:value-of select="../@align"/></xsl:when>
2913
- <xsl:otherwise>justify</xsl:otherwise>
2914
- </xsl:choose>
2915
- </xsl:attribute>
2916
- <xsl:call-template name="setKeepAttributes"/>
2917
- <xsl:copy-of select="@font-family"/>
2918
- <xsl:if test="not(ancestor::mn:table)">
2919
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2920
- </xsl:if>
2921
- <xsl:if test="ancestor::mn:table and ancestor::mn:preface">
2922
- <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2923
- </xsl:if>
2924
- <xsl:if test="parent::mn:li">
2925
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2926
- </xsl:if>
2927
- <xsl:if test="@align = 'center'">
2928
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2929
- </xsl:if>
2930
- <xsl:if test="*[1][self::mn:strong] and normalize-space(.) = normalize-space(*[1])">
2931
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
2932
- </xsl:if>
2933
- <xsl:if test="@parent-type = 'quote'">
2934
- <xsl:attribute name="font-family">Arial</xsl:attribute>
2935
- <xsl:attribute name="font-size">9pt</xsl:attribute>
2936
- <xsl:attribute name="line-height">130%</xsl:attribute>
2937
- <xsl:attribute name="role">BlockQuote</xsl:attribute>
2938
- </xsl:if>
2939
- <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
2861
+ <xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
2862
+
2940
2863
  <xsl:apply-templates>
2941
2864
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
2942
2865
  </xsl:apply-templates>
@@ -3071,8 +2994,8 @@
3071
2994
  </xsl:template>
3072
2995
 
3073
2996
  <xsl:template match="mn:fmt-preferred" priority="2">
3074
- <fo:block font-weight="bold" keep-with-next="always" space-before="8pt" margin-bottom="6pt">
3075
- <xsl:call-template name="refine_preferred-term-style"/>
2997
+ <fo:block xsl:use-attribute-sets="term-preferred-style">
2998
+ <xsl:call-template name="refine_term-preferred-style"/>
3076
2999
  <xsl:if test="ancestor::mn:term[1]/mn:fmt-name">
3077
3000
  <xsl:variable name="level">
3078
3001
  <xsl:call-template name="getLevelTermName"/>
@@ -3514,6 +3437,22 @@
3514
3437
  <xsl:param name="orientation"/>
3515
3438
  <xsl:param name="isDraft"/>
3516
3439
  <xsl:param name="lang"/>
3440
+
3441
+ <xsl:call-template name="insertHeader">
3442
+ <xsl:with-param name="header-title" select="$header-title"/>
3443
+ <xsl:with-param name="orientation" select="$orientation"/>
3444
+ <xsl:with-param name="isDraft" select="$isDraft"/>
3445
+ <xsl:with-param name="lang" select="$lang"/>
3446
+ </xsl:call-template>
3447
+ <xsl:call-template name="insertFooter"/>
3448
+ </xsl:template>
3449
+
3450
+ <xsl:template name="insertHeader">
3451
+ <xsl:param name="header-title"/>
3452
+ <xsl:param name="orientation"/>
3453
+ <xsl:param name="isDraft"/>
3454
+ <xsl:param name="lang"/>
3455
+
3517
3456
  <fo:static-content flow-name="header-odd" role="artifact">
3518
3457
  <xsl:call-template name="insertDraftWatermark">
3519
3458
  <xsl:with-param name="isDraft" select="$isDraft"/>
@@ -3564,6 +3503,9 @@
3564
3503
  </fo:static-content>
3565
3504
  </xsl:template>
3566
3505
 
3506
+ <xsl:template name="insertFooter">
3507
+ </xsl:template>
3508
+
3567
3509
  <xsl:template match="@*|node()" mode="header_title_remove_link_embedded">
3568
3510
  <xsl:copy>
3569
3511
  <xsl:apply-templates select="@*|node()" mode="header_title_remove_link_embedded"/>
@@ -6050,6 +5992,10 @@
6050
5992
  </xsl:element>
6051
5993
  </xsl:template>
6052
5994
 
5995
+ <!-- show sourcecode's name 'before' or 'after' source code -->
5996
+ <xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
5997
+ </xsl:variable>
5998
+
6053
5999
  <xsl:template match="mn:sourcecode" name="sourcecode">
6054
6000
 
6055
6001
  <xsl:variable name="sourcecode_attributes">
@@ -6073,7 +6019,12 @@
6073
6019
 
6074
6020
  <xsl:call-template name="refine_sourcecode-container-style"/>
6075
6021
 
6076
- <fo:block-container margin-left="0mm" role="SKIP">
6022
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6023
+
6024
+ <!-- <xsl:if test="$namespace = 'rsd'"> -->
6025
+ <xsl:if test="$sourcecode-name-position = 'before'">
6026
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
6027
+ </xsl:if>
6077
6028
 
6078
6029
  <fo:block xsl:use-attribute-sets="sourcecode-style">
6079
6030
 
@@ -6095,7 +6046,16 @@
6095
6046
  </fo:block>
6096
6047
 
6097
6048
  <xsl:apply-templates select="mn:dl"/> <!-- Key table -->
6098
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
6049
+
6050
+ <!-- <xsl:choose>
6051
+ <xsl:when test="$namespace = 'rsd'"></xsl:when>
6052
+ <xsl:otherwise>
6053
+ <xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
6054
+ <!-- </xsl:otherwise>
6055
+ </xsl:choose> -->
6056
+ <xsl:if test="$sourcecode-name-position = 'after'">
6057
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
6058
+ </xsl:if>
6099
6059
 
6100
6060
  </fo:block-container>
6101
6061
  </fo:block-container>
@@ -7349,83 +7309,79 @@
7349
7309
  <xsl:template name="refine_term-style">
7350
7310
  </xsl:template>
7351
7311
 
7352
- <xsl:attribute-set name="term-name-style">
7312
+ <xsl:attribute-set name="term-number-style">
7353
7313
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
7354
7314
  <xsl:attribute name="font-weight">bold</xsl:attribute>
7355
7315
  </xsl:attribute-set> <!-- term-name-style -->
7356
7316
 
7357
- <xsl:template name="refine_term-name-style">
7358
- </xsl:template>
7359
-
7360
- <xsl:attribute-set name="preferred-style">
7361
- </xsl:attribute-set> <!-- preferred-style -->
7362
-
7363
- <xsl:template name="refine_preferred-style">
7317
+ <xsl:template name="refine_term-number-style">
7364
7318
  </xsl:template>
7365
7319
 
7366
- <xsl:attribute-set name="preferred-block-style">
7320
+ <xsl:attribute-set name="term-preferred-block-style">
7367
7321
  </xsl:attribute-set> <!-- preferred-block-style -->
7368
7322
 
7369
- <xsl:template name="refine_preferred-block-style">
7323
+ <xsl:template name="refine_term-preferred-block-style">
7370
7324
  </xsl:template>
7371
7325
 
7372
- <xsl:attribute-set name="preferred-term-style">
7326
+ <xsl:attribute-set name="term-preferred-style">
7373
7327
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
7374
7328
  <xsl:attribute name="font-weight">bold</xsl:attribute>
7329
+ <xsl:attribute name="space-before">8pt</xsl:attribute>
7330
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
7375
7331
  </xsl:attribute-set> <!-- preferred-term-style -->
7376
7332
 
7377
- <xsl:template name="refine_preferred-term-style">
7333
+ <xsl:template name="refine_term-preferred-style">
7378
7334
  <xsl:if test="mn:strong">
7379
7335
  <xsl:attribute name="font-weight">normal</xsl:attribute>
7380
7336
  </xsl:if>
7381
7337
  </xsl:template>
7382
7338
 
7383
- <xsl:attribute-set name="domain-style">
7384
- </xsl:attribute-set> <!-- domain-style -->
7339
+ <xsl:attribute-set name="term-domain-style">
7340
+ </xsl:attribute-set> <!-- term-domain-style -->
7385
7341
 
7386
- <xsl:template name="refine_domain-style">
7342
+ <xsl:template name="refine_term-domain-style">
7387
7343
  </xsl:template>
7388
7344
 
7389
- <xsl:attribute-set name="admitted-style">
7390
- </xsl:attribute-set> <!-- admitted-style -->
7345
+ <xsl:attribute-set name="term-admitted-style">
7346
+ </xsl:attribute-set> <!-- term-admitted-style -->
7391
7347
 
7392
- <xsl:template name="refine_admitted-style">
7348
+ <xsl:template name="refine_term-admitted-style">
7393
7349
  </xsl:template>
7394
7350
 
7395
- <xsl:attribute-set name="deprecates-style">
7396
- </xsl:attribute-set> <!-- deprecates-style -->
7351
+ <xsl:attribute-set name="term-deprecates-style">
7352
+ </xsl:attribute-set> <!-- term-deprecates-style -->
7397
7353
 
7398
- <xsl:template name="refine_deprecates-style">
7354
+ <xsl:template name="refine_term-deprecates-style">
7399
7355
  </xsl:template>
7400
7356
 
7401
- <xsl:attribute-set name="related-block-style" use-attribute-sets="preferred-block-style">
7357
+ <xsl:attribute-set name="term-related-block-style" use-attribute-sets="term-preferred-block-style">
7402
7358
  </xsl:attribute-set>
7403
7359
 
7404
- <xsl:template name="refine_related-block-style">
7360
+ <xsl:template name="refine_term-related-block-style">
7405
7361
  </xsl:template>
7406
7362
 
7407
- <xsl:attribute-set name="definition-style">
7408
- </xsl:attribute-set> <!-- definition-style -->
7363
+ <xsl:attribute-set name="term-definition-style">
7364
+ </xsl:attribute-set> <!-- term-definition-style -->
7409
7365
 
7410
- <xsl:template name="refine_definition-style">
7366
+ <xsl:template name="refine_term-definition-style">
7411
7367
  </xsl:template>
7412
7368
 
7413
- <xsl:attribute-set name="termsource-style">
7414
- </xsl:attribute-set> <!-- termsource-style -->
7369
+ <xsl:attribute-set name="term-termsource-style">
7370
+ </xsl:attribute-set> <!-- term-termsource-style -->
7415
7371
 
7416
- <xsl:template name="refine_termsource-style">
7417
- </xsl:template> <!-- refine_termsource-style -->
7372
+ <xsl:template name="refine_term-termsource-style">
7373
+ </xsl:template> <!-- refine_term-termsource-style -->
7418
7374
 
7419
- <xsl:attribute-set name="termsource-text-style">
7420
- </xsl:attribute-set> <!-- termsource-text-style -->
7375
+ <xsl:attribute-set name="term-termsource-text-style">
7376
+ </xsl:attribute-set> <!-- term-termsource-text-style -->
7421
7377
 
7422
- <xsl:template name="refine_termsource-text-style">
7378
+ <xsl:template name="refine_term-termsource-text-style">
7423
7379
  </xsl:template>
7424
7380
 
7425
- <xsl:attribute-set name="origin-style">
7426
- </xsl:attribute-set> <!-- origin-style -->
7381
+ <xsl:attribute-set name="term-origin-style">
7382
+ </xsl:attribute-set> <!-- term-origin-style -->
7427
7383
 
7428
- <xsl:template name="refine_origin-style">
7384
+ <xsl:template name="refine_term-origin-style">
7429
7385
  </xsl:template>
7430
7386
 
7431
7387
  <!-- ====== -->
@@ -7469,9 +7425,9 @@
7469
7425
  <!-- modification -->
7470
7426
  <!-- ====== -->
7471
7427
  <xsl:template match="mn:fmt-termsource" name="termsource">
7472
- <fo:block xsl:use-attribute-sets="termsource-style">
7428
+ <fo:block xsl:use-attribute-sets="term-termsource-style">
7473
7429
 
7474
- <xsl:call-template name="refine_termsource-style"/>
7430
+ <xsl:call-template name="refine_term-termsource-style"/>
7475
7431
 
7476
7432
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
7477
7433
  <xsl:variable name="termsource_text">
@@ -7519,8 +7475,8 @@
7519
7475
 
7520
7476
  <!-- text SOURCE: -->
7521
7477
  <xsl:template match="mn:fmt-termsource/mn:strong[1][following-sibling::*[1][self::mn:fmt-origin]]/text()">
7522
- <fo:inline xsl:use-attribute-sets="termsource-text-style">
7523
- <xsl:call-template name="refine_termsource-text-style"/>
7478
+ <fo:inline xsl:use-attribute-sets="term-termsource-text-style">
7479
+ <xsl:call-template name="refine_term-termsource-text-style"/>
7524
7480
  <xsl:value-of select="."/>
7525
7481
  </fo:inline>
7526
7482
  </xsl:template>
@@ -7532,8 +7488,8 @@
7532
7488
  <xsl:if test="normalize-space(@citeas) = ''">
7533
7489
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
7534
7490
  </xsl:if>
7535
- <fo:inline xsl:use-attribute-sets="origin-style">
7536
- <xsl:call-template name="refine_origin-style"/>
7491
+ <fo:inline xsl:use-attribute-sets="term-origin-style">
7492
+ <xsl:call-template name="refine_term-origin-style"/>
7537
7493
  <xsl:apply-templates/>
7538
7494
  </fo:inline>
7539
7495
  </fo:basic-link>
@@ -7581,14 +7537,14 @@
7581
7537
  <xsl:variable name="levelTerm">
7582
7538
  <xsl:call-template name="getLevelTermName"/>
7583
7539
  </xsl:variable>
7584
- <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
7540
+ <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="term-preferred-block-style">
7585
7541
 
7586
- <xsl:call-template name="refine_preferred-block-style"/>
7542
+ <xsl:call-template name="refine_term-preferred-block-style"/>
7587
7543
 
7588
7544
  <xsl:if test="parent::mn:term and not(preceding-sibling::mn:fmt-preferred)"> <!-- if first preffered in term, then display term's name -->
7589
7545
 
7590
- <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
7591
- <xsl:call-template name="refine_term-name-style"/>
7546
+ <fo:block xsl:use-attribute-sets="term-number-style" role="SKIP">
7547
+ <xsl:call-template name="refine_term-number-style"/>
7592
7548
 
7593
7549
  <xsl:for-each select="ancestor::mn:term[1]/mn:fmt-name"><!-- change context -->
7594
7550
  <xsl:call-template name="setIDforNamedDestination"/>
@@ -7598,8 +7554,8 @@
7598
7554
  </fo:block>
7599
7555
  </xsl:if>
7600
7556
 
7601
- <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
7602
- <xsl:call-template name="refine_preferred-term-style"/>
7557
+ <fo:block xsl:use-attribute-sets="term-preferred-style" role="SKIP">
7558
+ <xsl:call-template name="refine_term-preferred-style"/>
7603
7559
 
7604
7560
  <xsl:apply-templates/>
7605
7561
  </fo:block>
@@ -7619,15 +7575,15 @@
7619
7575
  <xsl:template match="mn:domain"/>
7620
7576
 
7621
7577
  <xsl:template match="mn:fmt-admitted">
7622
- <fo:block xsl:use-attribute-sets="admitted-style">
7623
- <xsl:call-template name="refine_admitted-style"/>
7578
+ <fo:block xsl:use-attribute-sets="term-admitted-style">
7579
+ <xsl:call-template name="refine_term-admitted-style"/>
7624
7580
  <xsl:apply-templates/>
7625
7581
  </fo:block>
7626
7582
  </xsl:template>
7627
7583
 
7628
7584
  <xsl:template match="mn:fmt-deprecates">
7629
- <fo:block xsl:use-attribute-sets="deprecates-style">
7630
- <xsl:call-template name="refine_deprecates-style"/>
7585
+ <fo:block xsl:use-attribute-sets="term-deprecates-style">
7586
+ <xsl:call-template name="refine_term-deprecates-style"/>
7631
7587
  <xsl:apply-templates/>
7632
7588
  </fo:block>
7633
7589
  </xsl:template>
@@ -7640,8 +7596,8 @@
7640
7596
  <!-- End Preferred, admitted, deprecated -->
7641
7597
 
7642
7598
  <xsl:template match="mn:fmt-related">
7643
- <fo:block role="SKIP" xsl:use-attribute-sets="related-block-style">
7644
- <xsl:call-template name="refine_related-block-style"/>
7599
+ <fo:block role="SKIP" xsl:use-attribute-sets="term-related-block-style">
7600
+ <xsl:call-template name="refine_term-related-block-style"/>
7645
7601
  <xsl:apply-templates/>
7646
7602
  </fo:block>
7647
7603
  </xsl:template>
@@ -7655,8 +7611,8 @@
7655
7611
  <!-- definition -->
7656
7612
  <!-- ========== -->
7657
7613
  <xsl:template match="mn:fmt-definition">
7658
- <fo:block xsl:use-attribute-sets="definition-style" role="SKIP">
7659
- <xsl:call-template name="refine_definition-style"/>
7614
+ <fo:block xsl:use-attribute-sets="term-definition-style" role="SKIP">
7615
+ <xsl:call-template name="refine_term-definition-style"/>
7660
7616
  <xsl:apply-templates/>
7661
7617
  </fo:block>
7662
7618
  </xsl:template>
@@ -11948,6 +11904,10 @@
11948
11904
  <!-- image -->
11949
11905
  <!-- ====== -->
11950
11906
 
11907
+ <!-- show figure's name 'before' or 'after' image -->
11908
+ <xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
11909
+ </xsl:variable>
11910
+
11951
11911
  <xsl:template match="mn:figure" name="figure">
11952
11912
  <xsl:variable name="isAdded" select="@added"/>
11953
11913
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -11960,6 +11920,10 @@
11960
11920
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
11961
11921
  </xsl:call-template>
11962
11922
 
11923
+ <xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
11924
+ <xsl:apply-templates select="mn:fmt-name"/>
11925
+ </xsl:if>
11926
+
11963
11927
  <!-- Example: Dimensions in millimeters -->
11964
11928
  <xsl:apply-templates select="mn:note[@type = 'units']"/>
11965
11929
 
@@ -11980,7 +11944,16 @@
11980
11944
  <xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
11981
11945
  <xsl:call-template name="showFigureKey"/>
11982
11946
  </xsl:if>
11983
- <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
11947
+
11948
+ <!-- <xsl:choose>
11949
+ <xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
11950
+ <xsl:otherwise>
11951
+ <xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
11952
+ <!-- </xsl:otherwise>
11953
+ </xsl:choose> -->
11954
+ <xsl:if test="$figure-name-position = 'after'">
11955
+ <xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
11956
+ </xsl:if>
11984
11957
 
11985
11958
  </fo:block-container>
11986
11959
  </xsl:template>
@@ -14103,7 +14076,6 @@
14103
14076
  </xsl:attribute-set>
14104
14077
 
14105
14078
  <xsl:template name="refine_references-non-normative-title-style">
14106
-
14107
14079
  </xsl:template>
14108
14080
 
14109
14081
  <!-- bibitem in Normative References (references/@normative="true") -->
@@ -16216,7 +16188,7 @@
16216
16188
  <!-- ===================================== -->
16217
16189
 
16218
16190
  <xsl:attribute-set name="annex-title-style">
16219
- </xsl:attribute-set>
16191
+ </xsl:attribute-set> <!-- annex-title-style -->
16220
16192
 
16221
16193
  <xsl:template name="refine_annex-title-style">
16222
16194
  </xsl:template>
@@ -16227,6 +16199,125 @@
16227
16199
  <xsl:template name="refine_p-zzSTDTitle1-style">
16228
16200
  </xsl:template>
16229
16201
 
16202
+ <xsl:attribute-set name="p-style">
16203
+ <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
16204
+ </xsl:attribute-set> <!-- p-style -->
16205
+
16206
+ <xsl:template name="refine_p-style">
16207
+ <xsl:param name="element-name"/>
16208
+ <xsl:param name="margin"/>
16209
+ <xsl:copy-of select="@id"/>
16210
+ <xsl:attribute name="text-align">
16211
+ <xsl:choose>
16212
+ <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
16213
+ <xsl:when test="ancestor::mn:note_side">left</xsl:when>
16214
+ <xsl:when test="../@align"><xsl:value-of select="../@align"/></xsl:when>
16215
+ <xsl:otherwise>justify</xsl:otherwise>
16216
+ </xsl:choose>
16217
+ </xsl:attribute>
16218
+ <xsl:call-template name="setKeepAttributes"/>
16219
+ <xsl:copy-of select="@font-family"/>
16220
+ <xsl:if test="not(ancestor::mn:table)">
16221
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
16222
+ </xsl:if>
16223
+ <xsl:if test="ancestor::mn:table and ancestor::mn:preface">
16224
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
16225
+ </xsl:if>
16226
+ <xsl:if test="parent::mn:li">
16227
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
16228
+ </xsl:if>
16229
+ <xsl:if test="@align = 'center'">
16230
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
16231
+ </xsl:if>
16232
+ <xsl:if test="*[1][self::mn:strong] and normalize-space(.) = normalize-space(*[1])">
16233
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
16234
+ </xsl:if>
16235
+ <xsl:if test="@parent-type = 'quote'">
16236
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
16237
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
16238
+ <xsl:attribute name="line-height">130%</xsl:attribute>
16239
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
16240
+ </xsl:if>
16241
+ <!-- $namespace = 'bipm' -->
16242
+
16243
+ </xsl:template> <!-- refine_p-style -->
16244
+
16245
+ <xsl:attribute-set name="title-style">
16246
+ <!-- Note: font-size for level 1 title -->
16247
+ <xsl:attribute name="font-size">16pt</xsl:attribute>
16248
+ <xsl:attribute name="margin-left">-14mm</xsl:attribute>
16249
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
16250
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
16251
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
16252
+ <xsl:attribute name="line-height">130%</xsl:attribute>
16253
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
16254
+ </xsl:attribute-set> <!-- title-style -->
16255
+
16256
+ <xsl:template name="refine_title-style">
16257
+ <xsl:param name="element-name"/>
16258
+ <xsl:variable name="level">
16259
+ <xsl:call-template name="getLevel"/>
16260
+ </xsl:variable>
16261
+
16262
+ <xsl:if test="$level = 1">
16263
+ <xsl:if test="parent::mn:annex or ancestor::mn:annex or parent::mn:abstract or ancestor::mn:preface">
16264
+ <xsl:attribute name="margin-bottom">84pt</xsl:attribute>
16265
+ </xsl:if>
16266
+ </xsl:if>
16267
+
16268
+ <xsl:if test="$level = 2">
16269
+ <xsl:attribute name="font-size">14pt</xsl:attribute>
16270
+ <xsl:attribute name="space-before">30pt</xsl:attribute>
16271
+ <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
16272
+ <xsl:if test="ancestor::mn:annex">
16273
+ <xsl:attribute name="font-size">10.5pt</xsl:attribute>
16274
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
16275
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
16276
+ <xsl:if test="../@type = 'toc'">
16277
+ <xsl:attribute name="font-size">16pt</xsl:attribute>
16278
+ <xsl:attribute name="margin-bottom">29mm</xsl:attribute>
16279
+ </xsl:if>
16280
+ </xsl:if>
16281
+ </xsl:if>
16282
+
16283
+ <xsl:if test="$level = 3">
16284
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
16285
+ <xsl:attribute name="space-before">20pt</xsl:attribute>
16286
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
16287
+ <xsl:if test="ancestor::mn:annex">
16288
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
16289
+ <xsl:attribute name="space-before">12pt</xsl:attribute>
16290
+ <xsl:if test="../@type = 'toc'">
16291
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
16292
+ <xsl:attribute name="space-before">0pt</xsl:attribute>
16293
+ </xsl:if>
16294
+ </xsl:if>
16295
+ </xsl:if>
16296
+
16297
+ <xsl:if test="$level &gt;= 4">
16298
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
16299
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
16300
+ <xsl:if test="ancestor::mn:annex">
16301
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
16302
+ <xsl:if test="$level = 4">
16303
+ <xsl:attribute name="space-before">12pt</xsl:attribute>
16304
+ </xsl:if>
16305
+ <xsl:if test="../@type = 'toc'">
16306
+ <xsl:attribute name="space-before">0pt</xsl:attribute>
16307
+ </xsl:if>
16308
+ </xsl:if>
16309
+ </xsl:if>
16310
+
16311
+ <xsl:if test="local-name(preceding-sibling::*[1]) = 'clause'">
16312
+ <xsl:attribute name="id"><xsl:value-of select="preceding-sibling::*[1]/@id"/></xsl:attribute>
16313
+ </xsl:if>
16314
+ <xsl:if test="@type = 'quoted'">
16315
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
16316
+ </xsl:if>
16317
+ <!-- $namespace = 'bipm' -->
16318
+ <xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
16319
+ </xsl:template> <!-- refine_title-style -->
16320
+
16230
16321
  <xsl:template name="processPrefaceSectionsDefault">
16231
16322
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
16232
16323
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -16565,6 +16656,12 @@
16565
16656
  </xsl:choose>
16566
16657
  </xsl:template>
16567
16658
 
16659
+ <xsl:attribute-set name="reset-margins-style">
16660
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
16661
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
16662
+ <xsl:attribute name="role">SKIP</xsl:attribute>
16663
+ </xsl:attribute-set>
16664
+
16568
16665
  <xsl:attribute-set name="clause-style">
16569
16666
 
16570
16667
  </xsl:attribute-set>
@@ -17601,8 +17698,9 @@
17601
17698
 
17602
17699
  <xsl:template name="setTextAlignment">
17603
17700
  <xsl:param name="default">left</xsl:param>
17701
+ <xsl:param name="skip_default">false</xsl:param>
17604
17702
  <xsl:variable name="align" select="normalize-space(@align)"/>
17605
- <xsl:attribute name="text-align">
17703
+ <xsl:variable name="text_align">
17606
17704
  <xsl:choose>
17607
17705
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
17608
17706
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
@@ -17610,9 +17708,13 @@
17610
17708
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
17611
17709
  <xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
17612
17710
  <xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
17711
+ <xsl:when test="$skip_default = 'true'"/>
17613
17712
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
17614
17713
  </xsl:choose>
17615
- </xsl:attribute>
17714
+ </xsl:variable>
17715
+ <xsl:if test="normalize-space($text_align) != ''">
17716
+ <xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
17717
+ </xsl:if>
17616
17718
  <xsl:if test="$align = 'indent'">
17617
17719
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
17618
17720
  </xsl:if>
@@ -17620,8 +17722,10 @@
17620
17722
 
17621
17723
  <xsl:template name="setBlockAttributes">
17622
17724
  <xsl:param name="text_align_default">left</xsl:param>
17725
+ <xsl:param name="skip_text_align_default">false</xsl:param>
17623
17726
  <xsl:call-template name="setTextAlignment">
17624
17727
  <xsl:with-param name="default" select="$text_align_default"/>
17728
+ <xsl:with-param name="skip_default" select="$skip_text_align_default"/>
17625
17729
  </xsl:call-template>
17626
17730
  <xsl:call-template name="setKeepAttributes"/>
17627
17731
  <xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
@@ -17664,6 +17768,21 @@
17664
17768
  </fo:block-container>
17665
17769
  </xsl:template>
17666
17770
 
17771
+ <!-- for https://github.com/metanorma/mn-native-pdf/issues/845 -->
17772
+ <xsl:template name="insertCoverPageFullImage">
17773
+ <xsl:param name="name">coverpage-image</xsl:param>
17774
+ <xsl:for-each select="//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata[mn:name = $name][1]/mn:value/mn:image">
17775
+ <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
17776
+ <xsl:attribute name="force-page-count">even</xsl:attribute>
17777
+ <fo:flow flow-name="xsl-region-body">
17778
+ <xsl:call-template name="insertBackgroundPageImage">
17779
+ <xsl:with-param name="number" select="position()"/>
17780
+ </xsl:call-template>
17781
+ </fo:flow>
17782
+ </fo:page-sequence>
17783
+ </xsl:for-each>
17784
+ </xsl:template>
17785
+
17667
17786
  <xsl:template name="insertPageImage">
17668
17787
  <xsl:param name="svg_content_height" select="$pageHeight"/>
17669
17788
  <xsl:param name="bitmap_width" select="$pageWidth"/>