metanorma-cc 1.8.1 → 1.8.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,6 +7,8 @@
7
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
8
  <xsl:param name="basepath"/>
9
9
 
10
+ <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
11
+
10
12
  <xsl:variable name="pageWidth" select="210"/>
11
13
  <xsl:variable name="pageHeight" select="297"/>
12
14
  <xsl:variable name="marginLeftRight1" select="19"/>
@@ -329,7 +331,7 @@
329
331
 
330
332
  <xsl:variable name="display">
331
333
  <xsl:choose>
332
- <xsl:when test="$level &gt; 2">false</xsl:when>
334
+ <xsl:when test="$level &gt; $toc_level">false</xsl:when>
333
335
  <xsl:otherwise>true</xsl:otherwise>
334
336
  </xsl:choose>
335
337
  </xsl:variable>
@@ -417,7 +419,7 @@
417
419
 
418
420
 
419
421
 
420
- <xsl:template match="csd:title">
422
+ <xsl:template match="csd:title" name="title">
421
423
 
422
424
  <xsl:variable name="level">
423
425
  <xsl:call-template name="getLevel"/>
@@ -500,35 +502,7 @@
500
502
  </xsl:if>
501
503
  </xsl:template>
502
504
 
503
- <!--
504
- <fn reference="1">
505
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
506
- </fn>
507
- -->
508
- <xsl:template match="csd:p/csd:fn">
509
- <fo:footnote>
510
- <xsl:variable name="number">
511
- <xsl:number level="any" count="csd:p/csd:fn"/>
512
- </xsl:variable>
513
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
514
- <fo:basic-link internal-destination="footnote_{@reference}" fox:alt-text="footnote {@reference}">
515
- <!-- <xsl:value-of select="@reference"/> -->
516
- <xsl:value-of select="$number + count(//csd:bibitem/csd:note)"/><!-- <xsl:text>)</xsl:text> -->
517
- </fo:basic-link>
518
- </fo:inline>
519
- <fo:footnote-body>
520
- <fo:block font-size="10pt" margin-bottom="12pt">
521
- <fo:inline id="footnote_{@reference}" keep-with-next.within-line="always" font-size="60%" vertical-align="super"> <!-- baseline-shift="30%" padding-right="3mm" font-size="60%" alignment-baseline="hanging" -->
522
- <xsl:value-of select="$number + count(//csd:bibitem/csd:note)"/><!-- <xsl:text>)</xsl:text> -->
523
- </fo:inline>
524
- <xsl:for-each select="csd:p">
525
- <xsl:apply-templates/>
526
- </xsl:for-each>
527
- </fo:block>
528
- </fo:footnote-body>
529
- </fo:footnote>
530
- </xsl:template>
531
-
505
+
532
506
  <xsl:template match="csd:p/csd:fn/csd:p">
533
507
  <xsl:apply-templates/>
534
508
  </xsl:template>
@@ -608,7 +582,9 @@
608
582
  <fo:list-item-label end-indent="label-end()">
609
583
  <fo:block>
610
584
  <xsl:choose>
611
- <xsl:when test="local-name(..) = 'ul'">—</xsl:when> <!-- dash -->
585
+ <xsl:when test="local-name(..) = 'ul'">
586
+ <xsl:call-template name="setULLabel"/>
587
+ </xsl:when>
612
588
  <xsl:otherwise> <!-- for ordered lists -->
613
589
  <xsl:choose>
614
590
  <xsl:when test="../@type = 'arabic'">
@@ -652,6 +628,7 @@
652
628
  <xsl:apply-templates select="ancestor::csd:term[1]/csd:name" mode="presentation"/>
653
629
  </fo:block>
654
630
  <fo:block font-weight="bold" keep-with-next="always">
631
+ <xsl:call-template name="setStyle_preferred"/>
655
632
  <xsl:apply-templates/>
656
633
  </fo:block>
657
634
  </fo:block>
@@ -1377,6 +1354,77 @@
1377
1354
 
1378
1355
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
1379
1356
  <xsl:attribute name="line-height">135%</xsl:attribute>
1357
+ </xsl:attribute-set><xsl:attribute-set name="fn-style">
1358
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1359
+ </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
1360
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1361
+
1362
+
1363
+
1364
+
1365
+ <xsl:attribute name="font-size">65%</xsl:attribute>
1366
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1367
+
1368
+
1369
+
1370
+
1371
+
1372
+
1373
+
1374
+
1375
+
1376
+
1377
+
1378
+
1379
+
1380
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
1381
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
1382
+ <xsl:attribute name="font-style">normal</xsl:attribute>
1383
+ <xsl:attribute name="text-indent">0</xsl:attribute>
1384
+ <xsl:attribute name="start-indent">0</xsl:attribute>
1385
+
1386
+
1387
+
1388
+
1389
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1390
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1391
+
1392
+
1393
+
1394
+
1395
+
1396
+
1397
+
1398
+
1399
+
1400
+
1401
+
1402
+
1403
+
1404
+
1405
+
1406
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
1407
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1408
+
1409
+
1410
+
1411
+
1412
+ <xsl:attribute name="font-size">60%</xsl:attribute>
1413
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1414
+
1415
+
1416
+
1417
+
1418
+
1419
+
1420
+
1421
+
1422
+
1423
+
1424
+
1425
+
1426
+
1427
+
1380
1428
  </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
1381
1429
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1382
1430
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -1402,7 +1450,8 @@
1402
1450
  <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
1403
1451
 
1404
1452
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1405
- <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1453
+
1454
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
1406
1455
  <xsl:sort select="@displayorder" data-type="number"/>
1407
1456
  <xsl:apply-templates select="." mode="contents"/>
1408
1457
  </xsl:for-each>
@@ -1412,7 +1461,7 @@
1412
1461
  <xsl:apply-templates select="." mode="contents"/>
1413
1462
  </xsl:for-each>
1414
1463
 
1415
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1464
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
1416
1465
  <xsl:sort select="@displayorder" data-type="number"/>
1417
1466
  <xsl:apply-templates select="." mode="contents"/>
1418
1467
  </xsl:for-each>
@@ -2308,6 +2357,102 @@
2308
2357
 
2309
2358
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2310
2359
  <xsl:apply-templates/>
2360
+ </xsl:template><xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" priority="2" name="fn">
2361
+
2362
+ <!-- list of footnotes to calculate actual footnotes number -->
2363
+ <xsl:variable name="p_fn_">
2364
+ <xsl:choose>
2365
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
2366
+ <fn gen_id="{generate-id(.)}">
2367
+ <xsl:copy-of select="@*"/>
2368
+ <xsl:copy-of select="node()"/>
2369
+ </fn>
2370
+ </xsl:when>
2371
+ <xsl:otherwise>
2372
+ <!-- itetation for:
2373
+ footnotes in bibdata/title
2374
+ footnotes in bibliography
2375
+ footnotes in document's body (except table's head/body/foot and figure text)
2376
+ -->
2377
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
2378
+ <fn gen_id="{generate-id(.)}">
2379
+ <xsl:copy-of select="@*"/>
2380
+ <xsl:copy-of select="node()"/>
2381
+ </fn>
2382
+ </xsl:for-each>
2383
+ <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']/*">
2384
+ <xsl:sort select="@displayorder" data-type="number"/>
2385
+ <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])]">
2386
+ <!-- copy unique fn -->
2387
+ <fn gen_id="{generate-id(.)}">
2388
+ <xsl:copy-of select="@*"/>
2389
+ <xsl:copy-of select="node()"/>
2390
+ </fn>
2391
+ </xsl:for-each>
2392
+ </xsl:for-each>
2393
+ </xsl:otherwise>
2394
+ </xsl:choose>
2395
+ </xsl:variable>
2396
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
2397
+
2398
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
2399
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
2400
+ <xsl:variable name="reference" select="@reference"/>
2401
+ <!-- fn sequence number in document -->
2402
+ <xsl:variable name="current_fn_number">
2403
+ <xsl:choose>
2404
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
2405
+ <xsl:otherwise>
2406
+ <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
2407
+ </xsl:otherwise>
2408
+ </xsl:choose>
2409
+ </xsl:variable>
2410
+ <xsl:variable name="current_fn_number_text">
2411
+ <xsl:value-of select="$current_fn_number"/>
2412
+
2413
+
2414
+ </xsl:variable>
2415
+
2416
+ <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
2417
+ <xsl:variable name="footnote_inline">
2418
+ <fo:inline xsl:use-attribute-sets="fn-num-style">
2419
+
2420
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
2421
+ <xsl:value-of select="$current_fn_number_text"/>
2422
+ </fo:basic-link>
2423
+ </fo:inline>
2424
+ </xsl:variable>
2425
+ <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
2426
+ gen_id=<xsl:value-of select="$gen_id"/> -->
2427
+ <xsl:choose>
2428
+ <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
2429
+ <xsl:copy-of select="$footnote_inline"/>
2430
+ </xsl:when>
2431
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
2432
+ <fo:footnote xsl:use-attribute-sets="fn-style">
2433
+ <xsl:copy-of select="$footnote_inline"/>
2434
+ <fo:footnote-body>
2435
+
2436
+ <fo:block-container text-indent="0" start-indent="0">
2437
+
2438
+
2439
+ <fo:block xsl:use-attribute-sets="fn-body-style">
2440
+
2441
+
2442
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
2443
+
2444
+ <xsl:value-of select="$current_fn_number_text"/>
2445
+ </fo:inline>
2446
+ <xsl:apply-templates/>
2447
+ </fo:block>
2448
+ </fo:block-container>
2449
+ </fo:footnote-body>
2450
+ </fo:footnote>
2451
+ </xsl:when>
2452
+ <xsl:otherwise>
2453
+ <xsl:copy-of select="$footnote_inline"/>
2454
+ </xsl:otherwise>
2455
+ </xsl:choose>
2311
2456
  </xsl:template><xsl:template name="fn_display">
2312
2457
  <xsl:variable name="references">
2313
2458
 
@@ -2500,6 +2645,8 @@
2500
2645
 
2501
2646
  </fo:basic-link>
2502
2647
  </fo:inline>
2648
+ </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
2649
+ <fo:inline><xsl:value-of select="."/></fo:inline>
2503
2650
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
2504
2651
  <fo:inline>
2505
2652
  <xsl:apply-templates/>
@@ -2859,6 +3006,7 @@
2859
3006
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2860
3007
  <xsl:apply-templates/>
2861
3008
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
3009
+ <xsl:apply-templates select="@language"/>
2862
3010
  <xsl:apply-templates/>
2863
3011
  </xsl:template><xsl:template match="*[local-name()='dd']/*[local-name()='p']" mode="inline">
2864
3012
  <fo:inline><xsl:text> </xsl:text><xsl:apply-templates/></fo:inline>
@@ -3492,22 +3640,6 @@
3492
3640
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
3493
3641
  <xsl:apply-templates/>
3494
3642
  </fo:inline>
3495
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
3496
- <xsl:variable name="title-modified">
3497
-
3498
-
3499
- <xsl:call-template name="getTitle">
3500
- <xsl:with-param name="name" select="'title-modified'"/>
3501
- </xsl:call-template>
3502
-
3503
- </xsl:variable>
3504
-
3505
- <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3506
- <xsl:choose>
3507
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
3508
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
3509
- </xsl:choose>
3510
- <xsl:apply-templates/>
3511
3643
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
3512
3644
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
3513
3645
 
@@ -4072,12 +4204,12 @@
4072
4204
  </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
4073
4205
  <xsl:apply-templates mode="contents"/>
4074
4206
  <xsl:text> </xsl:text>
4075
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
4207
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
4076
4208
  <xsl:apply-templates mode="bookmarks"/>
4077
4209
  <xsl:text> </xsl:text>
4078
4210
  </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
4079
4211
  <xsl:value-of select="."/>
4080
- </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
4212
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'sourcecode']/*[local-name() = 'name']//text()" mode="bookmarks" priority="2">
4081
4213
  <xsl:value-of select="."/>
4082
4214
  </xsl:template><xsl:template match="node()" mode="contents">
4083
4215
  <xsl:apply-templates mode="contents"/>
@@ -4347,6 +4479,8 @@
4347
4479
 
4348
4480
 
4349
4481
 
4482
+
4483
+
4350
4484
  <fo:block xsl:use-attribute-sets="sourcecode-style">
4351
4485
  <xsl:variable name="_font-size">
4352
4486
 
@@ -4380,13 +4514,17 @@
4380
4514
 
4381
4515
 
4382
4516
 
4517
+
4518
+
4383
4519
  <xsl:apply-templates/>
4384
4520
  </fo:block>
4385
-
4521
+
4386
4522
 
4387
4523
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4388
4524
 
4389
4525
 
4526
+
4527
+
4390
4528
  </fo:block-container>
4391
4529
  </fo:block-container>
4392
4530
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -4733,62 +4871,69 @@
4733
4871
  <xsl:variable name="termsource_text">
4734
4872
  <xsl:apply-templates/>
4735
4873
  </xsl:variable>
4736
-
4737
- <xsl:choose>
4874
+ <xsl:copy-of select="$termsource_text"/>
4875
+ <!-- <xsl:choose>
4738
4876
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
4739
- <!-- <xsl:apply-templates /> -->
4740
4877
  <xsl:copy-of select="$termsource_text"/>
4741
4878
  </xsl:when>
4742
4879
  <xsl:otherwise>
4743
-
4744
-
4880
+ <xsl:if test="$namespace = 'bsi'">
4881
+ <xsl:choose>
4882
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
4883
+ <xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
4884
+ </xsl:choose>
4885
+ </xsl:if>
4886
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
4745
4887
  <xsl:text>[</xsl:text>
4746
-
4747
- <!-- <xsl:apply-templates /> -->
4888
+ </xsl:if>
4748
4889
  <xsl:copy-of select="$termsource_text"/>
4749
-
4750
-
4890
+ <xsl:if test="$namespace = 'bsi'">
4891
+ <xsl:choose>
4892
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
4893
+ <xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
4894
+ </xsl:choose>
4895
+ </xsl:if>
4896
+ <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc-white-paper' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'bipm' or $namespace = 'jcgm'">
4751
4897
  <xsl:text>]</xsl:text>
4752
-
4898
+ </xsl:if>
4753
4899
  </xsl:otherwise>
4754
- </xsl:choose>
4900
+ </xsl:choose> -->
4755
4901
  </fo:block>
4756
4902
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
4757
4903
  <xsl:if test="normalize-space() != ''">
4758
4904
  <xsl:value-of select="."/>
4759
4905
  </xsl:if>
4760
- </xsl:template><xsl:variable name="localized.source">
4761
- <xsl:call-template name="getLocalizedString">
4762
- <xsl:with-param name="key">source</xsl:with-param>
4763
- </xsl:call-template>
4764
- </xsl:variable><xsl:template match="*[local-name() = 'origin']">
4906
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
4907
+ <fo:inline>
4908
+
4909
+
4910
+ <xsl:value-of select="."/>
4911
+ </fo:inline>
4912
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
4765
4913
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4766
4914
  <xsl:if test="normalize-space(@citeas) = ''">
4767
4915
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
4768
4916
  </xsl:if>
4769
-
4770
-
4771
- <fo:inline>
4772
-
4773
-
4774
-
4775
-
4776
-
4777
-
4778
-
4779
- <xsl:call-template name="getTitle">
4780
- <xsl:with-param name="name" select="'title-source'"/>
4781
- </xsl:call-template>
4782
- <xsl:text>: </xsl:text>
4783
-
4784
-
4785
- </fo:inline>
4786
-
4787
4917
  <fo:inline xsl:use-attribute-sets="origin-style">
4788
4918
  <xsl:apply-templates/>
4789
4919
  </fo:inline>
4920
+ </fo:basic-link>
4921
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
4922
+ <xsl:variable name="title-modified">
4790
4923
 
4791
- </fo:basic-link>
4924
+
4925
+ <xsl:call-template name="getTitle">
4926
+ <xsl:with-param name="name" select="'title-modified'"/>
4927
+ </xsl:call-template>
4928
+
4929
+ </xsl:variable>
4930
+
4931
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4932
+ <xsl:choose>
4933
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
4934
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
4935
+ </xsl:choose>
4936
+ <xsl:apply-templates/>
4792
4937
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
4793
4938
  <fo:inline><xsl:apply-templates/></fo:inline>
4794
4939
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
@@ -4983,15 +5128,20 @@
4983
5128
  <fo:block xsl:use-attribute-sets="deprecates-style">
4984
5129
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
4985
5130
  </fo:block>
5131
+ </xsl:template><xsl:template name="setStyle_preferred">
5132
+ <xsl:if test="*[local-name() = 'strong']">
5133
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
5134
+ </xsl:if>
4986
5135
  </xsl:template><xsl:template match="*[local-name() = 'definition']">
4987
5136
  <fo:block xsl:use-attribute-sets="definition-style">
4988
5137
  <xsl:apply-templates/>
4989
5138
  </fo:block>
4990
5139
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]">
4991
5140
  <xsl:apply-templates/>
4992
- </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p']">
5141
+ </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
4993
5142
  <fo:inline> <xsl:apply-templates/></fo:inline>
4994
- <fo:block> </fo:block>
5143
+ <!-- <fo:block>&#xA0;</fo:block> -->
5144
+ <fo:block/>
4995
5145
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
4996
5146
 
4997
5147
  <fo:block>
@@ -5052,6 +5202,51 @@
5052
5202
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
5053
5203
  <!-- 0xA0 to space replacement -->
5054
5204
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
5205
+ </xsl:template><xsl:variable name="ul_labels_">
5206
+
5207
+
5208
+
5209
+
5210
+ <label>—</label> <!-- em dash -->
5211
+
5212
+
5213
+
5214
+
5215
+
5216
+
5217
+
5218
+
5219
+
5220
+
5221
+
5222
+
5223
+
5224
+
5225
+ </xsl:variable><xsl:variable name="ul_labels" select="xalan:nodeset($ul_labels_)"/><xsl:template name="setULLabel">
5226
+ <xsl:variable name="list_level_" select="count(ancestor::*[local-name() = 'ul']) + count(ancestor::*[local-name() = 'ol'])"/>
5227
+ <xsl:variable name="list_level">
5228
+ <xsl:choose>
5229
+ <xsl:when test="$list_level_ &lt;= 3"><xsl:value-of select="$list_level_"/></xsl:when>
5230
+ <xsl:otherwise><xsl:value-of select="$list_level_ mod 3"/></xsl:otherwise>
5231
+ </xsl:choose>
5232
+ </xsl:variable>
5233
+ <xsl:choose>
5234
+ <xsl:when test="$ul_labels/label[not(@level)]"> <!-- one label for all levels -->
5235
+ <xsl:apply-templates select="$ul_labels/label[not(@level)]" mode="ul_labels"/>
5236
+ </xsl:when>
5237
+ <xsl:when test="$list_level mod 3 = 0">
5238
+ <xsl:apply-templates select="$ul_labels/label[@level = 3]" mode="ul_labels"/>
5239
+ </xsl:when>
5240
+ <xsl:when test="$list_level mod 2 = 0">
5241
+ <xsl:apply-templates select="$ul_labels/label[@level = 2]" mode="ul_labels"/>
5242
+ </xsl:when>
5243
+ <xsl:otherwise>
5244
+ <xsl:apply-templates select="$ul_labels/label[@level = 1]" mode="ul_labels"/>
5245
+ </xsl:otherwise>
5246
+ </xsl:choose>
5247
+ </xsl:template><xsl:template match="label" mode="ul_labels">
5248
+ <xsl:copy-of select="@*[not(local-name() = 'level')]"/>
5249
+ <xsl:value-of select="."/>
5055
5250
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
5056
5251
  <xsl:choose>
5057
5252
  <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
@@ -5390,7 +5585,31 @@
5390
5585
  <fo:block-container border="1pt solid black" width="50%">
5391
5586
  <fo:block> </fo:block>
5392
5587
  </fo:block-container>
5393
- </xsl:template><xsl:template match="*[local-name() = 'toc']">
5588
+ </xsl:template><xsl:variable name="toc_level">
5589
+ <xsl:choose>
5590
+ <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
5591
+ <xsl:otherwise><!-- default value -->
5592
+
5593
+
5594
+
5595
+ 2
5596
+
5597
+
5598
+
5599
+
5600
+
5601
+
5602
+
5603
+
5604
+
5605
+
5606
+
5607
+
5608
+
5609
+
5610
+ </xsl:otherwise>
5611
+ </xsl:choose>
5612
+ </xsl:variable><xsl:template match="*[local-name() = 'toc']">
5394
5613
  <xsl:param name="colwidths"/>
5395
5614
  <xsl:variable name="colwidths_">
5396
5615
  <xsl:choose>
@@ -5481,6 +5700,10 @@
5481
5700
  </svg>
5482
5701
  </fo:instream-foreign-object>
5483
5702
  </fo:inline>
5703
+ </xsl:template><xsl:template match="@language">
5704
+ <xsl:copy-of select="."/>
5705
+ </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
5706
+ <xsl:call-template name="title"/>
5484
5707
  </xsl:template><xsl:template name="convertDate">
5485
5708
  <xsl:param name="date"/>
5486
5709
  <xsl:param name="format" select="'short'"/>
@@ -5925,12 +6148,15 @@
5925
6148
  <xsl:param name="default">left</xsl:param>
5926
6149
  <xsl:attribute name="text-align">
5927
6150
  <xsl:choose>
5928
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
6151
+ <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
5929
6152
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
5930
6153
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
5931
6154
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
5932
6155
  </xsl:choose>
5933
6156
  </xsl:attribute>
6157
+ <xsl:if test="@align = 'indent'">
6158
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
6159
+ </xsl:if>
5934
6160
  </xsl:template><xsl:template name="number-to-words">
5935
6161
  <xsl:param name="number"/>
5936
6162
  <xsl:param name="first"/>
@@ -6027,4 +6253,14 @@
6027
6253
  </xsl:otherwise>
6028
6254
  </xsl:choose>
6029
6255
  </xsl:if>
6256
+ </xsl:template><xsl:template name="setAltText">
6257
+ <xsl:param name="value"/>
6258
+ <xsl:attribute name="fox:alt-text">
6259
+ <xsl:choose>
6260
+ <xsl:when test="normalize-space($value) != ''">
6261
+ <xsl:value-of select="$value"/>
6262
+ </xsl:when>
6263
+ <xsl:otherwise>_</xsl:otherwise>
6264
+ </xsl:choose>
6265
+ </xsl:attribute>
6030
6266
  </xsl:template></xsl:stylesheet>
@@ -68,6 +68,12 @@ code *, pre *, tt *, kbd *, samp * {
68
68
  font-family: {{monospacefont}} !important;
69
69
  font-variant-ligatures: none; }
70
70
 
71
+ p code, dt code, li code, label code, legend code, caption code, th code, td code,
72
+ p tt, dt tt, li tt, label tt, legend tt, caption tt, th tt, td tt,
73
+ p kbd, dt kbd, li kbd, label kbd, legend kbd, caption kbd, th kbd, td kbd,
74
+ p samp, dt samp, li samp, label samp, legend samp, caption samp, th samp, td samp {
75
+ font-size: {{monospacefontsize}}; }
76
+
71
77
  article, aside, details, figcaption, figure,
72
78
  footer, header, hgroup, menu, nav, section {
73
79
  display: block; }
@@ -79,6 +85,9 @@ table {
79
85
  h1, h2, h3, h4, h5, h6 {
80
86
  font-family: {{headerfont}}; }
81
87
 
88
+ .h1, .h2, .h3, .h4, .h5, .h6 {
89
+ font-family: {{headerfont}}; }
90
+
82
91
  blockquote, q {
83
92
  quotes: none; }
84
93
  blockquote:before, blockquote:after, q:before, q:after {