metanorma-ogc 1.5.3 → 1.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5bb1ae7e71ccb9893d37252f166f957986676100103a0923a916e305d952c03
4
- data.tar.gz: 3ed27b1075d8dc53266349d70c809427b0c548708a9b6fe4018d8b4666d17f5c
3
+ metadata.gz: b2e4f9332eca0b9782174303dc48ab59580db9fb200c4ab559087ccd01ce7767
4
+ data.tar.gz: b262207ab88b4bdac84cafbc928bd8684e9d565e266fb5e3fbb7e347470c24f9
5
5
  SHA512:
6
- metadata.gz: 63c9dc50ccc0094aa55ddf0313c9a5d1274330537d7af307fb5118dc122352d3ecf5f928dcf6f6a6fb686cee588d013eb656fbf1725e67ca6d17dc776428dc88
7
- data.tar.gz: 73e2d1c0a868d9be6e8320504ffab6062368b95d2af4241e16f4d686e0f4e5bb0d78115a90d1bd3b86d09bc10d50d5ad40380801ac1f2d4ab6d2244bf56cdc94
6
+ metadata.gz: 118b0aeb2ad000d7d476b90264c8d7fd3da4f5b9f476f553d2064d3d55f47e4d68ae5dae9fb891741de162143b226e649bc09453e4d77826b3af48b8982948f2
7
+ data.tar.gz: f9f37c36c790c21620980e72aab940a380b60d5d6b02166bd427c0543fe88aa72fc3629cbcb27a2a309f0767de61b3ef2c28b12415677c1bbe1eaa2eed6d9d79
data/Gemfile CHANGED
@@ -9,3 +9,5 @@ gemspec
9
9
  if File.exist? "Gemfile.devel"
10
10
  eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
11
11
  end
12
+
13
+ gem "metanorma-cli"
@@ -145,7 +145,7 @@ module Asciidoctor
145
145
  def pdf_converter(node)
146
146
  return nil if node.attr("no-pdf")
147
147
 
148
- IsoDoc::Ogc::PdfConvert.new(html_extract_attributes(node))
148
+ IsoDoc::Ogc::PdfConvert.new(pdf_extract_attributes(node))
149
149
  end
150
150
 
151
151
  def doc_converter(node)
@@ -1796,6 +1796,20 @@
1796
1796
  <data type="ID"/>
1797
1797
  </attribute>
1798
1798
  </optional>
1799
+ <optional>
1800
+ <attribute name="language"/>
1801
+ </optional>
1802
+ <optional>
1803
+ <attribute name="script"/>
1804
+ </optional>
1805
+ <optional>
1806
+ <attribute name="tag"/>
1807
+ </optional>
1808
+ <optional>
1809
+ <attribute name="multilingual-rendering">
1810
+ <ref name="MultilingualRenderingType"/>
1811
+ </attribute>
1812
+ </optional>
1799
1813
  <oneOrMore>
1800
1814
  <ref name="preferred"/>
1801
1815
  </oneOrMore>
@@ -17,7 +17,6 @@ $('#toggle').on('click', function(){
17
17
  else {
18
18
  $('nav').show();
19
19
  $('nav').animate({ 'left': '0px' }, 'slow');
20
- $('.container').animate({ 'padding-left': '360px' }, 'slow');
21
20
  }
22
21
  });
23
22
  </script>
@@ -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="215.9"/>
11
13
  <xsl:variable name="pageHeight" select="279.4"/>
12
14
  <xsl:variable name="marginLeftRight1" select="35"/>
@@ -423,7 +425,7 @@
423
425
 
424
426
  <fo:block-container line-height="130%">
425
427
  <fo:block role="TOC">
426
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
428
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true' and normalize-space(@id) != '']">
427
429
 
428
430
  <fo:block role="TOCI">
429
431
  <xsl:if test="@level = 1">
@@ -432,7 +434,7 @@
432
434
  <xsl:if test="@level = 1 or @parent = 'annex'">
433
435
  <xsl:attribute name="font-size">12pt</xsl:attribute>
434
436
  </xsl:if>
435
- <xsl:if test="@level = 2 and not(@parent = 'annex')">
437
+ <xsl:if test="@level &gt;= 2 and not(@parent = 'annex')">
436
438
  <xsl:attribute name="font-size">10pt</xsl:attribute>
437
439
  </xsl:if>
438
440
 
@@ -450,7 +452,10 @@
450
452
  </fo:list-item-label>
451
453
  <fo:list-item-body start-indent="body-start()">
452
454
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
453
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
455
+ <fo:basic-link internal-destination="{@id}">
456
+ <xsl:call-template name="setAltText">
457
+ <xsl:with-param name="value" select="text()"/>
458
+ </xsl:call-template>
454
459
  <xsl:variable name="sectionTitle">
455
460
  <xsl:apply-templates select="title"/>
456
461
  </xsl:variable>
@@ -467,8 +472,17 @@
467
472
  </fo:list-block>
468
473
  </xsl:when>
469
474
  <xsl:otherwise>
470
- <fo:block text-align-last="justify" margin-left="8mm">
471
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
475
+ <xsl:variable name="margin-left">
476
+ <xsl:choose>
477
+ <xsl:when test="number(@level) != 'NaN'"><xsl:value-of select="(@level - 1) * 8"/></xsl:when>
478
+ <xsl:otherwise>8</xsl:otherwise>
479
+ </xsl:choose>
480
+ </xsl:variable>
481
+ <fo:block text-align-last="justify" margin-left="{$margin-left}mm">
482
+ <fo:basic-link internal-destination="{@id}">
483
+ <xsl:call-template name="setAltText">
484
+ <xsl:with-param name="value" select="text()"/>
485
+ </xsl:call-template>
472
486
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@section))"/>
473
487
  <xsl:text> </xsl:text>
474
488
  <xsl:apply-templates select="title"/>
@@ -503,9 +517,12 @@
503
517
  </fo:block-container>
504
518
  </fo:block-container>
505
519
  <fo:block-container line-height="130%">
506
- <xsl:for-each select="//ogc:table[@id and ogc:name]"> <!-- contains(ogc:name, '—') -->
520
+ <xsl:for-each select="//ogc:table[@id and ogc:name and normalize-space(@id) != '']"> <!-- contains(ogc:name, '—') -->
507
521
  <fo:block text-align-last="justify" margin-top="2pt" role="TOCI">
508
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{ogc:name}">
522
+ <fo:basic-link internal-destination="{@id}">
523
+ <xsl:call-template name="setAltText">
524
+ <xsl:with-param name="value" select="ogc:name"/>
525
+ </xsl:call-template>
509
526
  <xsl:apply-templates select="ogc:name" mode="contents"/>
510
527
  <fo:inline keep-together.within-line="always">
511
528
  <fo:leader leader-pattern="dots"/>
@@ -518,7 +535,7 @@
518
535
  </xsl:if>
519
536
 
520
537
  <xsl:variable name="list_of_figures_">
521
- <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] | //*[@id and starts-with(ogc:name, 'Figure ')]">
538
+ <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(ogc:name, 'Figure ') and normalize-space(@id) != '']">
522
539
  <figure id="{@id}" alt-text="{ogc:name}">
523
540
  <xsl:apply-templates select="ogc:name" mode="contents"/>
524
541
  </figure>
@@ -545,7 +562,10 @@
545
562
  <!-- <xsl:for-each select="//ogc:figure[@id and ogc:name and not(@unnumbered = 'true')] or //*[@id and starts-with(ogc:name, 'Figure ')]"> --> <!-- contains(ogc:name, '—') -->
546
563
  <xsl:for-each select="$list_of_figures/figure"> <!-- contains(ogc:name, '—') -->
547
564
  <fo:block text-align-last="justify" margin-top="2pt" role="TOCI">
548
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{@alt-text}">
565
+ <fo:basic-link internal-destination="{@id}">
566
+ <xsl:call-template name="setAltText">
567
+ <xsl:with-param name="value" select="@alt-text"/>
568
+ </xsl:call-template>
549
569
  <!-- <xsl:apply-templates select="ogc:name" mode="contents"/> -->
550
570
  <xsl:copy-of select="node()"/>
551
571
  <fo:inline keep-together.within-line="always">
@@ -576,9 +596,12 @@
576
596
 
577
597
  <fo:block-container line-height="130%">
578
598
  <!-- <xsl:for-each select="//ogc:table[.//ogc:p[@class = 'RecommendationTitle']]"> -->
579
- <xsl:for-each select="xalan:nodeset($toc_recommendations)/*">
599
+ <xsl:for-each select="xalan:nodeset($toc_recommendations)/*[normalize-space(@id) != '']">
580
600
  <fo:block text-align-last="justify" margin-top="6pt" role="TOCI">
581
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{@alt-text}">
601
+ <fo:basic-link internal-destination="{@id}">
602
+ <xsl:call-template name="setAltText">
603
+ <xsl:with-param name="value" select="@alt-text"/>
604
+ </xsl:call-template>
582
605
  <xsl:copy-of select="title/node()"/>
583
606
  <xsl:text> </xsl:text>
584
607
  <fo:inline keep-together.within-line="always">
@@ -758,7 +781,7 @@
758
781
 
759
782
  <xsl:variable name="display">
760
783
  <xsl:choose>
761
- <xsl:when test="$level &gt;= 3">false</xsl:when>
784
+ <xsl:when test="$level &gt; $toc_level">false</xsl:when>
762
785
  <xsl:otherwise>true</xsl:otherwise>
763
786
  </xsl:choose>
764
787
  </xsl:variable>
@@ -1066,32 +1089,6 @@
1066
1089
  </xsl:if>
1067
1090
  </xsl:template>
1068
1091
 
1069
- <!--
1070
- <fn reference="1">
1071
- <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
1072
- </fn>
1073
- -->
1074
- <xsl:template match="ogc:title//ogc:fn | ogc:name//ogc:fn | ogc:p/ogc:fn[not(ancestor::ogc:table)] | ogc:p/*/ogc:fn[not(ancestor::ogc:table)] | ogc:sourcecode/ogc:fn[not(ancestor::ogc:table)]" priority="2" name="fn">
1075
- <fo:footnote keep-with-previous.within-line="always">
1076
- <xsl:variable name="number" select="@reference"/>
1077
-
1078
- <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
1079
- <fo:basic-link internal-destination="footnote_{@reference}" fox:alt-text="footnote {@reference}">
1080
- <xsl:value-of select="$number"/><!-- + count(//ogc:bibitem/ogc:note) -->
1081
- </fo:basic-link>
1082
- </fo:inline>
1083
- <fo:footnote-body>
1084
- <fo:block font-size="10pt" margin-bottom="12pt" font-weight="normal" text-indent="0" start-indent="0" color="{$color_main}" line-height="124%" text-align="justify">
1085
- <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" -->
1086
- <xsl:value-of select="$number "/><!-- + count(//ogc:bibitem/ogc:note) -->
1087
- </fo:inline>
1088
- <xsl:for-each select="ogc:p">
1089
- <xsl:apply-templates/>
1090
- </xsl:for-each>
1091
- </fo:block>
1092
- </fo:footnote-body>
1093
- </fo:footnote>
1094
- </xsl:template>
1095
1092
 
1096
1093
  <xsl:template match="ogc:fn/ogc:p">
1097
1094
  <fo:block>
@@ -2304,6 +2301,80 @@
2304
2301
 
2305
2302
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
2306
2303
  <xsl:attribute name="line-height">135%</xsl:attribute>
2304
+ </xsl:attribute-set><xsl:attribute-set name="fn-style">
2305
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2306
+ </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
2307
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2308
+
2309
+
2310
+
2311
+
2312
+
2313
+
2314
+
2315
+
2316
+
2317
+
2318
+
2319
+
2320
+
2321
+ <xsl:attribute name="font-size">65%</xsl:attribute>
2322
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2323
+
2324
+
2325
+
2326
+
2327
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-style">
2328
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
2329
+ <xsl:attribute name="font-style">normal</xsl:attribute>
2330
+ <xsl:attribute name="text-indent">0</xsl:attribute>
2331
+ <xsl:attribute name="start-indent">0</xsl:attribute>
2332
+
2333
+
2334
+
2335
+
2336
+
2337
+
2338
+
2339
+
2340
+
2341
+
2342
+
2343
+
2344
+
2345
+
2346
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2347
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
2348
+ <xsl:attribute name="color"><xsl:value-of select="$color_main"/></xsl:attribute>
2349
+ <xsl:attribute name="line-height">124%</xsl:attribute>
2350
+ <xsl:attribute name="text-align">justify</xsl:attribute>
2351
+
2352
+
2353
+
2354
+
2355
+
2356
+ </xsl:attribute-set><xsl:attribute-set name="fn-body-num-style">
2357
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
2358
+
2359
+
2360
+
2361
+
2362
+
2363
+
2364
+
2365
+
2366
+
2367
+
2368
+
2369
+
2370
+
2371
+
2372
+ <xsl:attribute name="font-size">60%</xsl:attribute>
2373
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
2374
+
2375
+
2376
+
2377
+
2307
2378
  </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">
2308
2379
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2309
2380
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -3271,6 +3342,102 @@
3271
3342
 
3272
3343
  </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">
3273
3344
  <xsl:apply-templates/>
3345
+ </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">
3346
+
3347
+ <!-- list of footnotes to calculate actual footnotes number -->
3348
+ <xsl:variable name="p_fn_">
3349
+ <xsl:choose>
3350
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
3351
+ <fn gen_id="{generate-id(.)}">
3352
+ <xsl:copy-of select="@*"/>
3353
+ <xsl:copy-of select="node()"/>
3354
+ </fn>
3355
+ </xsl:when>
3356
+ <xsl:otherwise>
3357
+ <!-- itetation for:
3358
+ footnotes in bibdata/title
3359
+ footnotes in bibliography
3360
+ footnotes in document's body (except table's head/body/foot and figure text)
3361
+ -->
3362
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
3363
+ <fn gen_id="{generate-id(.)}">
3364
+ <xsl:copy-of select="@*"/>
3365
+ <xsl:copy-of select="node()"/>
3366
+ </fn>
3367
+ </xsl:for-each>
3368
+ <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']/*">
3369
+ <xsl:sort select="@displayorder" data-type="number"/>
3370
+ <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])]">
3371
+ <!-- copy unique fn -->
3372
+ <fn gen_id="{generate-id(.)}">
3373
+ <xsl:copy-of select="@*"/>
3374
+ <xsl:copy-of select="node()"/>
3375
+ </fn>
3376
+ </xsl:for-each>
3377
+ </xsl:for-each>
3378
+ </xsl:otherwise>
3379
+ </xsl:choose>
3380
+ </xsl:variable>
3381
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3382
+
3383
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
3384
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
3385
+ <xsl:variable name="reference" select="@reference"/>
3386
+ <!-- fn sequence number in document -->
3387
+ <xsl:variable name="current_fn_number">
3388
+ <xsl:choose>
3389
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
3390
+ <xsl:otherwise>
3391
+ <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1"/>
3392
+ </xsl:otherwise>
3393
+ </xsl:choose>
3394
+ </xsl:variable>
3395
+ <xsl:variable name="current_fn_number_text">
3396
+ <xsl:value-of select="$current_fn_number"/>
3397
+
3398
+
3399
+ </xsl:variable>
3400
+
3401
+ <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
3402
+ <xsl:variable name="footnote_inline">
3403
+ <fo:inline xsl:use-attribute-sets="fn-num-style">
3404
+
3405
+ <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3406
+ <xsl:value-of select="$current_fn_number_text"/>
3407
+ </fo:basic-link>
3408
+ </fo:inline>
3409
+ </xsl:variable>
3410
+ <!-- DEBUG: p_fn=<xsl:copy-of select="$p_fn"/>
3411
+ gen_id=<xsl:value-of select="$gen_id"/> -->
3412
+ <xsl:choose>
3413
+ <xsl:when test="normalize-space(@skip_footnote_body) = 'true'">
3414
+ <xsl:copy-of select="$footnote_inline"/>
3415
+ </xsl:when>
3416
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
3417
+ <fo:footnote xsl:use-attribute-sets="fn-style">
3418
+ <xsl:copy-of select="$footnote_inline"/>
3419
+ <fo:footnote-body>
3420
+
3421
+ <fo:block-container text-indent="0" start-indent="0">
3422
+
3423
+
3424
+ <fo:block xsl:use-attribute-sets="fn-body-style">
3425
+
3426
+
3427
+ <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3428
+
3429
+ <xsl:value-of select="$current_fn_number_text"/>
3430
+ </fo:inline>
3431
+ <xsl:apply-templates/>
3432
+ </fo:block>
3433
+ </fo:block-container>
3434
+ </fo:footnote-body>
3435
+ </fo:footnote>
3436
+ </xsl:when>
3437
+ <xsl:otherwise>
3438
+ <xsl:copy-of select="$footnote_inline"/>
3439
+ </xsl:otherwise>
3440
+ </xsl:choose>
3274
3441
  </xsl:template><xsl:template name="fn_display">
3275
3442
  <xsl:variable name="references">
3276
3443
 
@@ -3476,6 +3643,8 @@
3476
3643
 
3477
3644
  </fo:basic-link>
3478
3645
  </fo:inline>
3646
+ </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
3647
+ <fo:inline><xsl:value-of select="."/></fo:inline>
3479
3648
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
3480
3649
  <fo:inline>
3481
3650
  <xsl:apply-templates/>
@@ -4471,22 +4640,6 @@
4471
4640
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
4472
4641
  <xsl:apply-templates/>
4473
4642
  </fo:inline>
4474
- </xsl:template><xsl:template match="*[local-name() = 'modification']">
4475
- <xsl:variable name="title-modified">
4476
-
4477
-
4478
- <xsl:call-template name="getTitle">
4479
- <xsl:with-param name="name" select="'title-modified'"/>
4480
- </xsl:call-template>
4481
-
4482
- </xsl:variable>
4483
-
4484
- <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
4485
- <xsl:choose>
4486
- <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>
4487
- <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>
4488
- </xsl:choose>
4489
- <xsl:apply-templates/>
4490
4643
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
4491
4644
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
4492
4645
 
@@ -5820,59 +5973,71 @@
5820
5973
  <xsl:variable name="termsource_text">
5821
5974
  <xsl:apply-templates/>
5822
5975
  </xsl:variable>
5823
-
5824
- <xsl:choose>
5976
+ <xsl:copy-of select="$termsource_text"/>
5977
+ <!-- <xsl:choose>
5825
5978
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
5826
- <!-- <xsl:apply-templates /> -->
5827
5979
  <xsl:copy-of select="$termsource_text"/>
5828
5980
  </xsl:when>
5829
5981
  <xsl:otherwise>
5830
-
5831
-
5832
- <!-- <xsl:apply-templates /> -->
5982
+ <xsl:if test="$namespace = 'bsi'">
5983
+ <xsl:choose>
5984
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>{</xsl:text></xsl:when>
5985
+ <xsl:otherwise><xsl:text>[</xsl:text></xsl:otherwise>
5986
+ </xsl:choose>
5987
+ </xsl:if>
5988
+ <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'">
5989
+ <xsl:text>[</xsl:text>
5990
+ </xsl:if>
5833
5991
  <xsl:copy-of select="$termsource_text"/>
5834
-
5835
-
5992
+ <xsl:if test="$namespace = 'bsi'">
5993
+ <xsl:choose>
5994
+ <xsl:when test="$document_type = 'PAS' and starts-with(*[local-name() = 'origin']/@citeas, '[')"><xsl:text>}</xsl:text></xsl:when>
5995
+ <xsl:otherwise><xsl:text>]</xsl:text></xsl:otherwise>
5996
+ </xsl:choose>
5997
+ </xsl:if>
5998
+ <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'">
5999
+ <xsl:text>]</xsl:text>
6000
+ </xsl:if>
5836
6001
  </xsl:otherwise>
5837
- </xsl:choose>
6002
+ </xsl:choose> -->
5838
6003
  </fo:block>
5839
6004
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
5840
6005
  <xsl:if test="normalize-space() != ''">
5841
6006
  <xsl:value-of select="."/>
5842
6007
  </xsl:if>
5843
- </xsl:template><xsl:variable name="localized.source">
5844
- <xsl:call-template name="getLocalizedString">
5845
- <xsl:with-param name="key">source</xsl:with-param>
5846
- </xsl:call-template>
5847
- </xsl:variable><xsl:template match="*[local-name() = 'origin']">
6008
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
6009
+ <fo:inline>
6010
+
6011
+
6012
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
6013
+
6014
+ <xsl:value-of select="."/>
6015
+ </fo:inline>
6016
+ </xsl:template><xsl:template match="*[local-name() = 'origin']">
5848
6017
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5849
6018
  <xsl:if test="normalize-space(@citeas) = ''">
5850
6019
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5851
6020
  </xsl:if>
5852
-
5853
- <xsl:text>[</xsl:text>
5854
- <fo:inline>
5855
-
5856
- <xsl:attribute name="font-weight">bold</xsl:attribute>
5857
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
5858
-
5859
-
5860
-
5861
-
5862
-
5863
- <xsl:value-of select="$localized.source"/>
5864
- <xsl:text>: </xsl:text>
5865
-
5866
-
5867
-
5868
-
5869
- </fo:inline>
5870
-
5871
6021
  <fo:inline xsl:use-attribute-sets="origin-style">
5872
6022
  <xsl:apply-templates/>
5873
6023
  </fo:inline>
5874
- <xsl:text>]</xsl:text>
5875
- </fo:basic-link>
6024
+ </fo:basic-link>
6025
+ </xsl:template><xsl:template match="*[local-name() = 'modification']">
6026
+ <xsl:variable name="title-modified">
6027
+
6028
+
6029
+ <xsl:call-template name="getTitle">
6030
+ <xsl:with-param name="name" select="'title-modified'"/>
6031
+ </xsl:call-template>
6032
+
6033
+ </xsl:variable>
6034
+
6035
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
6036
+ <xsl:choose>
6037
+ <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>
6038
+ <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>
6039
+ </xsl:choose>
6040
+ <xsl:apply-templates/>
5876
6041
  </xsl:template><xsl:template match="*[local-name() = 'modification']/*[local-name() = 'p']">
5877
6042
  <fo:inline><xsl:apply-templates/></fo:inline>
5878
6043
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
@@ -6618,7 +6783,31 @@
6618
6783
  <fo:block-container border="1pt solid black" width="50%">
6619
6784
  <fo:block> </fo:block>
6620
6785
  </fo:block-container>
6621
- </xsl:template><xsl:template match="*[local-name() = 'toc']">
6786
+ </xsl:template><xsl:variable name="toc_level">
6787
+ <xsl:choose>
6788
+ <xsl:when test="1 = 2"/> <!-- to do https://github.com/metanorma/mn-native-pdf/issues/337: if there is value in xml -->
6789
+ <xsl:otherwise><!-- default value -->
6790
+
6791
+
6792
+
6793
+
6794
+
6795
+
6796
+
6797
+
6798
+
6799
+
6800
+
6801
+
6802
+
6803
+ 2
6804
+
6805
+
6806
+
6807
+
6808
+ </xsl:otherwise>
6809
+ </xsl:choose>
6810
+ </xsl:variable><xsl:template match="*[local-name() = 'toc']">
6622
6811
  <xsl:param name="colwidths"/>
6623
6812
  <xsl:variable name="colwidths_">
6624
6813
  <xsl:choose>
@@ -7258,4 +7447,14 @@
7258
7447
  </xsl:otherwise>
7259
7448
  </xsl:choose>
7260
7449
  </xsl:if>
7450
+ </xsl:template><xsl:template name="setAltText">
7451
+ <xsl:param name="value"/>
7452
+ <xsl:attribute name="fox:alt-text">
7453
+ <xsl:choose>
7454
+ <xsl:when test="normalize-space($value) != ''">
7455
+ <xsl:value-of select="$value"/>
7456
+ </xsl:when>
7457
+ <xsl:otherwise>_</xsl:otherwise>
7458
+ </xsl:choose>
7459
+ </xsl:attribute>
7261
7460
  </xsl:template></xsl:stylesheet>