metanorma-itu 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eb287ff921a50fb1e0bc7f1c6e6508d96ed8850e973d0dc1da25720fa0e3856f
4
- data.tar.gz: 55782324626afcec59caf220ae8129d0b9bf3acc66197b95146b909cba834590
3
+ metadata.gz: 2ec6ae3e4b2d44ccd7e6ab9addb0f53c6d84aa9750ceddd4e78a17db546c1714
4
+ data.tar.gz: 0e3b9e4225a67f3dfdc9c774e9a1f1bc90b5348fbec12056ae15e03baec7ef8d
5
5
  SHA512:
6
- metadata.gz: 1ffb8747c3b8c3574393a27a1186842a0528840c2d02dc77a1154296db777d98ffbe31072833f08aa8802c39b0e2731cdbd10459ec68ddb0ca4467a341f3303b
7
- data.tar.gz: 5c9519836a9c530132183ff18870764ffa97a6f88c36691cf554d423b1bd23f65ff4bc506fb4dcbe9a90198104b87b7e9ba70e25aae4759ecee9a4510748efb2
6
+ metadata.gz: feb1aff54a346048fbe9fe1ae0e88c2721ce9a95488c74f663942e9db84853c94fc2181eac6c2e84c74724be68108dd567b98fd0eedecaae87a9d2a6efa43e1d
7
+ data.tar.gz: a1e4f89fdbae6f567e1e310e82b4b3c36a6cad23117aa9ee5e3530eefd9a22a8fb7fd3019366a9b0d3b04046eda67c5eb4e98c8f1cfc1c26e9d67e4216ac1fe8
@@ -4,7 +4,8 @@ name: rake
4
4
 
5
5
  on:
6
6
  push:
7
- branches: [ master ]
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
8
9
  pull_request:
9
10
 
10
11
  jobs:
@@ -31,14 +32,32 @@ jobs:
31
32
  steps:
32
33
  - uses: actions/checkout@master
33
34
 
34
- - name: Use Ruby
35
- uses: ruby/setup-ruby@v1
35
+ - uses: ruby/setup-ruby@v1
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
- bundler-cache: true
39
38
 
40
- - name: Update gems
41
- run: bundle install --jobs 4 --retry 3
39
+ - uses: actions/cache@v1
40
+ with:
41
+ path: vendor/bundle
42
+ key: bundle-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('**/*.gemspec') }}
43
+ restore-keys: bundle-${{ matrix.os }}-${{ matrix.ruby }}
44
+
45
+ - run: bundle config set path 'vendor/bundle'
46
+
47
+ - run: bundle install --jobs 4 --retry 3
42
48
 
43
- - name: Run specs
44
- run: bundle exec rake
49
+ - run: bundle exec rake
50
+
51
+ notify:
52
+ name: Trigger notify workflow
53
+ needs: rake
54
+ runs-on: ubuntu-latest
55
+ steps:
56
+ - name: Trigger notify workflow
57
+ uses: Sibz/github-status-action@v1
58
+ with:
59
+ authToken: ${{ secrets.GITHUB_TOKEN }}
60
+ context: 'tests-passed-successfully'
61
+ description: 'Tests passed successfully'
62
+ state: 'success'
63
+ sha: ${{ github.event.pull_request.head.sha || github.sha }}
@@ -1,16 +1,15 @@
1
1
  = metanorma-itu: Metanorma for ITU
2
2
 
3
3
  image:https://img.shields.io/gem/v/metanorma-itu.svg["Gem Version", link="https://rubygems.org/gems/metanorma-itu"]
4
- image:https://github.com/metanorma/metanorma-itu/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-itu/actions?workflow=macos"]
5
- image:https://github.com/metanorma/metanorma-itu/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-itu/actions?workflow=ubuntu"]
6
- image:https://github.com/metanorma/metanorma-itu/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-itu/actions?workflow=windows"]
4
+ image:https://github.com/metanorma/metanorma-itu/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-itu/actions?workflow=rake"]
7
5
  image:https://codeclimate.com/github/metanorma/metanorma-itu/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-itu"]
8
6
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-itu.svg["Pull Requests", link="https://github.com/metanorma/metanorma-itu/pulls"]
9
7
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-itu/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-itu/releases"]
10
8
 
11
9
  == Functionality
12
10
 
13
- This gem processes Metanorma input for generating ITU (ITU-T, ITU-D) documents.
11
+ This gem processes https://www.metanorma.com[Metanorma documents] following a template for generating ITU
12
+ standards and documents.
14
13
 
15
14
  The implementation inherits from https://github.com/metanorma/metanorma-standoc.
16
15
 
@@ -24,6 +24,14 @@
24
24
  <start>
25
25
  <ref name="standard-document"/>
26
26
  </start>
27
+ <define name="doctype">
28
+ <element name="doctype">
29
+ <optional>
30
+ <attribute name="abbreviation"/>
31
+ </optional>
32
+ <ref name="DocumentType"/>
33
+ </element>
34
+ </define>
27
35
  <define name="hyperlink">
28
36
  <element name="link">
29
37
  <attribute name="target">
@@ -141,6 +149,11 @@
141
149
  <data type="boolean"/>
142
150
  </attribute>
143
151
  </optional>
152
+ <optional>
153
+ <attribute name="key">
154
+ <data type="boolean"/>
155
+ </attribute>
156
+ </optional>
144
157
  <oneOrMore>
145
158
  <ref name="dt"/>
146
159
  <ref name="dd"/>
@@ -23,12 +23,6 @@ module IsoDoc
23
23
  end
24
24
  end
25
25
 
26
- def bracket_opt(b)
27
- return b if b.nil?
28
- return b if /^\[.+\]$/.match(b)
29
- "[#{b}]"
30
- end
31
-
32
26
  def clausedelim
33
27
  ""
34
28
  end
@@ -63,8 +63,8 @@
63
63
  <xsl:call-template name="getLang"/>
64
64
  </xsl:variable>
65
65
 
66
- <xsl:variable name="isAmendment" select="normalize-space(/itu:itu-standard/itu:local_bibdata/itu:ext/itu:structuredidentifier/itu:amendment[@language = $lang])"/>
67
- <xsl:variable name="isCorrigendum" select="normalize-space(/itu:itu-standard/itu:local_bibdata/itu:ext/itu:structuredidentifier/itu:corrigendum[@language = $lang])"/>
66
+ <xsl:variable name="isAmendment" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:amendment[@language = $lang])"/>
67
+ <xsl:variable name="isCorrigendum" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:corrigendum[@language = $lang])"/>
68
68
 
69
69
  <xsl:template match="/">
70
70
  <xsl:call-template name="namespaceCheck"/>
@@ -313,8 +313,10 @@
313
313
  <fo:block font-size="16pt" margin-top="3pt">
314
314
  <xsl:value-of select="$doctype"/>
315
315
  <xsl:text>  </xsl:text>
316
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
317
- <xsl:text>-</xsl:text>
316
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation">
317
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
318
+ <xsl:text>-</xsl:text>
319
+ </xsl:if>
318
320
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:bureau"/>
319
321
  <xsl:text>  </xsl:text>
320
322
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
@@ -898,24 +900,38 @@
898
900
  <xsl:apply-templates/>
899
901
  </fo:inline>
900
902
  <xsl:if test="../itu:termsource/itu:origin">
903
+ <xsl:text>: </xsl:text>
901
904
  <xsl:variable name="citeas" select="../itu:termsource/itu:origin/@citeas"/>
902
- <xsl:choose>
903
- <xsl:when test="contains($citeas, '[')">
904
- <xsl:text> </xsl:text><xsl:value-of select="$citeas"/> <!-- disable-output-escaping="yes" -->
905
- </xsl:when>
906
- <xsl:otherwise>
907
- <xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
908
- </xsl:otherwise>
909
- </xsl:choose>
910
- </xsl:if>
911
- <xsl:text>: </xsl:text>
912
- <xsl:apply-templates select="following-sibling::itu:definition/node()" mode="process"/>
905
+ <xsl:variable name="bibitemid" select="../itu:termsource/itu:origin/@bibitemid"/>
906
+ <xsl:variable name="origin_text" select="normalize-space(../itu:termsource/itu:origin/text())"/>
907
+
908
+ <fo:basic-link internal-destination="{$bibitemid}" fox:alt-text="{$citeas}">
909
+ <xsl:choose>
910
+ <xsl:when test="$origin_text != ''">
911
+ <xsl:text> </xsl:text><xsl:apply-templates select="../itu:termsource/itu:origin/node()"/>
912
+ </xsl:when>
913
+ <xsl:when test="contains($citeas, '[')">
914
+ <xsl:text> </xsl:text><xsl:value-of select="$citeas"/> <!-- disable-output-escaping="yes" -->
915
+ </xsl:when>
916
+ <xsl:otherwise>
917
+ <xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
918
+ </xsl:otherwise>
919
+ </xsl:choose>
920
+ </fo:basic-link>
921
+ </xsl:if>
922
+ <xsl:if test="following-sibling::itu:definition/node()">
923
+ <xsl:text>: </xsl:text>
924
+ <xsl:apply-templates select="following-sibling::itu:definition/node()" mode="process"/>
925
+ </xsl:if>
913
926
  </fo:block>
914
927
  <!-- <xsl:if test="following-sibling::itu:table">
915
928
  <fo:block space-after="18pt">&#xA0;</fo:block>
916
929
  </xsl:if> -->
917
930
  </xsl:template>
918
931
 
932
+ <xsl:template match="itu:term[itu:preferred]/itu:termsource" priority="2"/>
933
+
934
+
919
935
  <xsl:template match="itu:definition/itu:p" priority="2"/>
920
936
  <xsl:template match="itu:definition/itu:formula" priority="2"/>
921
937
 
@@ -1309,13 +1325,22 @@
1309
1325
  <title-part lang="en">
1310
1326
 
1311
1327
 
1328
+
1312
1329
  </title-part>
1313
1330
  <title-part lang="fr">
1314
1331
 
1315
1332
 
1333
+
1316
1334
  </title-part>
1317
1335
  <title-part lang="zh">第 # 部分:</title-part>
1318
1336
 
1337
+ <title-subpart lang="en">
1338
+
1339
+ </title-subpart>
1340
+ <title-subpart lang="fr">
1341
+
1342
+ </title-subpart>
1343
+
1319
1344
  <title-modified lang="en">modified</title-modified>
1320
1345
  <title-modified lang="fr">modifiée</title-modified>
1321
1346
 
@@ -1771,7 +1796,9 @@
1771
1796
 
1772
1797
 
1773
1798
 
1774
-
1799
+ <!-- <xsl:if test="$namespace = 'bipm'">
1800
+ <fo:block>&#xA0;</fo:block>
1801
+ </xsl:if> -->
1775
1802
 
1776
1803
  <!-- $namespace = 'iso' or -->
1777
1804
 
@@ -1945,6 +1972,7 @@
1945
1972
  <xsl:if test="normalize-space() != ''">
1946
1973
  <fo:block xsl:use-attribute-sets="table-name-style">
1947
1974
 
1975
+
1948
1976
  <xsl:apply-templates/>
1949
1977
  </fo:block>
1950
1978
  </xsl:if>
@@ -2306,6 +2334,7 @@
2306
2334
 
2307
2335
 
2308
2336
 
2337
+
2309
2338
  <!-- <xsl:if test="$namespace = 'bipm'">
2310
2339
  <xsl:attribute name="height">8mm</xsl:attribute>
2311
2340
  </xsl:if> -->
@@ -2400,7 +2429,8 @@
2400
2429
  </xsl:attribute>
2401
2430
  </xsl:if>
2402
2431
  <xsl:call-template name="display-align"/>
2403
- <fo:block>
2432
+ <fo:block>
2433
+
2404
2434
  <xsl:apply-templates/>
2405
2435
  </fo:block>
2406
2436
  </fo:table-cell>
@@ -2631,7 +2661,11 @@
2631
2661
  <xsl:apply-templates/>
2632
2662
  </fo:inline>
2633
2663
  </xsl:template><xsl:template match="*[local-name()='dl']">
2634
- <fo:block-container margin-left="0mm">
2664
+ <fo:block-container>
2665
+
2666
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2667
+
2668
+
2635
2669
  <xsl:if test="parent::*[local-name() = 'note']">
2636
2670
  <xsl:attribute name="margin-left">
2637
2671
  <xsl:choose>
@@ -2641,8 +2675,11 @@
2641
2675
  </xsl:attribute>
2642
2676
 
2643
2677
  </xsl:if>
2644
- <fo:block-container margin-left="0mm">
2645
-
2678
+ <fo:block-container>
2679
+
2680
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2681
+
2682
+
2646
2683
  <xsl:variable name="parent" select="local-name(..)"/>
2647
2684
 
2648
2685
  <xsl:variable name="key_iso">
@@ -2656,9 +2693,12 @@
2656
2693
  <fo:block margin-bottom="12pt" text-align="left">
2657
2694
 
2658
2695
  <xsl:variable name="title-where">
2659
- <xsl:call-template name="getTitle">
2660
- <xsl:with-param name="name" select="'title-where'"/>
2661
- </xsl:call-template>
2696
+
2697
+
2698
+ <xsl:call-template name="getTitle">
2699
+ <xsl:with-param name="name" select="'title-where'"/>
2700
+ </xsl:call-template>
2701
+
2662
2702
  </xsl:variable>
2663
2703
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2664
2704
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2676,9 +2716,12 @@
2676
2716
 
2677
2717
 
2678
2718
  <xsl:variable name="title-where">
2679
- <xsl:call-template name="getTitle">
2680
- <xsl:with-param name="name" select="'title-where'"/>
2681
- </xsl:call-template>
2719
+
2720
+
2721
+ <xsl:call-template name="getTitle">
2722
+ <xsl:with-param name="name" select="'title-where'"/>
2723
+ </xsl:call-template>
2724
+
2682
2725
  </xsl:variable>
2683
2726
  <xsl:value-of select="$title-where"/>:
2684
2727
  </fo:block>
@@ -2689,9 +2732,12 @@
2689
2732
 
2690
2733
 
2691
2734
  <xsl:variable name="title-key">
2692
- <xsl:call-template name="getTitle">
2693
- <xsl:with-param name="name" select="'title-key'"/>
2694
- </xsl:call-template>
2735
+
2736
+
2737
+ <xsl:call-template name="getTitle">
2738
+ <xsl:with-param name="name" select="'title-key'"/>
2739
+ </xsl:call-template>
2740
+
2695
2741
  </xsl:variable>
2696
2742
  <xsl:value-of select="$title-key"/>
2697
2743
  </fo:block>
@@ -3279,7 +3325,18 @@
3279
3325
  <xsl:with-param name="previousRow" select="$newRow"/>
3280
3326
  </xsl:apply-templates>
3281
3327
  </xsl:template><xsl:template name="getLang">
3282
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3328
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3329
+ <xsl:variable name="language">
3330
+ <xsl:choose>
3331
+ <xsl:when test="$language_current != ''">
3332
+ <xsl:value-of select="$language_current"/>
3333
+ </xsl:when>
3334
+ <xsl:otherwise>
3335
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3336
+ </xsl:otherwise>
3337
+ </xsl:choose>
3338
+ </xsl:variable>
3339
+
3283
3340
  <xsl:choose>
3284
3341
  <xsl:when test="$language = 'English'">en</xsl:when>
3285
3342
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3314,6 +3371,7 @@
3314
3371
  <xsl:value-of select="substring($str, 2)"/>
3315
3372
  </xsl:template><xsl:template match="mathml:math">
3316
3373
  <fo:inline font-family="STIX Two Math"> <!-- -->
3374
+
3317
3375
  <xsl:variable name="mathml">
3318
3376
  <xsl:apply-templates select="." mode="mathml"/>
3319
3377
  </xsl:variable>
@@ -3396,10 +3454,14 @@
3396
3454
  </fo:inline>
3397
3455
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3398
3456
  <xsl:variable name="title-modified">
3399
- <xsl:call-template name="getTitle">
3400
- <xsl:with-param name="name" select="'title-modified'"/>
3401
- </xsl:call-template>
3457
+
3458
+
3459
+ <xsl:call-template name="getTitle">
3460
+ <xsl:with-param name="name" select="'title-modified'"/>
3461
+ </xsl:call-template>
3462
+
3402
3463
  </xsl:variable>
3464
+
3403
3465
  <xsl:choose>
3404
3466
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3405
3467
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4278,9 +4340,12 @@
4278
4340
  </fo:block>
4279
4341
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4280
4342
  <xsl:variable name="title-deprecated">
4281
- <xsl:call-template name="getTitle">
4282
- <xsl:with-param name="name" select="'title-deprecated'"/>
4283
- </xsl:call-template>
4343
+
4344
+
4345
+ <xsl:call-template name="getTitle">
4346
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4347
+ </xsl:call-template>
4348
+
4284
4349
  </xsl:variable>
4285
4350
  <fo:block xsl:use-attribute-sets="deprecates-style">
4286
4351
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4643,13 +4708,22 @@
4643
4708
  </xsl:template><xsl:template name="split">
4644
4709
  <xsl:param name="pText" select="."/>
4645
4710
  <xsl:param name="sep" select="','"/>
4711
+ <xsl:param name="normalize-space" select="'true'"/>
4646
4712
  <xsl:if test="string-length($pText) &gt;0">
4647
4713
  <item>
4648
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4714
+ <xsl:choose>
4715
+ <xsl:when test="$normalize-space = 'true'">
4716
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4717
+ </xsl:when>
4718
+ <xsl:otherwise>
4719
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4720
+ </xsl:otherwise>
4721
+ </xsl:choose>
4649
4722
  </item>
4650
4723
  <xsl:call-template name="split">
4651
4724
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4652
4725
  <xsl:with-param name="sep" select="$sep"/>
4726
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4653
4727
  </xsl:call-template>
4654
4728
  </xsl:if>
4655
4729
  </xsl:template><xsl:template name="getDocumentId">
@@ -4715,4 +4789,23 @@
4715
4789
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4716
4790
  </xsl:call-template>
4717
4791
  </xsl:if>
4792
+ </xsl:template><xsl:template name="repeat">
4793
+ <xsl:param name="char" select="'*'"/>
4794
+ <xsl:param name="count"/>
4795
+ <xsl:if test="$count &gt; 0">
4796
+ <xsl:value-of select="$char"/>
4797
+ <xsl:call-template name="repeat">
4798
+ <xsl:with-param name="char" select="$char"/>
4799
+ <xsl:with-param name="count" select="$count - 1"/>
4800
+ </xsl:call-template>
4801
+ </xsl:if>
4802
+ </xsl:template><xsl:template name="getLocalizedString">
4803
+ <xsl:param name="key"/>
4804
+
4805
+ <xsl:variable name="curr_lang">
4806
+ <xsl:call-template name="getLang"/>
4807
+ </xsl:variable>
4808
+
4809
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4810
+
4718
4811
  </xsl:template></xsl:stylesheet>
@@ -63,8 +63,8 @@
63
63
  <xsl:call-template name="getLang"/>
64
64
  </xsl:variable>
65
65
 
66
- <xsl:variable name="isAmendment" select="normalize-space(/itu:itu-standard/itu:local_bibdata/itu:ext/itu:structuredidentifier/itu:amendment[@language = $lang])"/>
67
- <xsl:variable name="isCorrigendum" select="normalize-space(/itu:itu-standard/itu:local_bibdata/itu:ext/itu:structuredidentifier/itu:corrigendum[@language = $lang])"/>
66
+ <xsl:variable name="isAmendment" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:amendment[@language = $lang])"/>
67
+ <xsl:variable name="isCorrigendum" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:corrigendum[@language = $lang])"/>
68
68
 
69
69
  <xsl:template match="/">
70
70
  <xsl:call-template name="namespaceCheck"/>
@@ -313,8 +313,10 @@
313
313
  <fo:block font-size="16pt" margin-top="3pt">
314
314
  <xsl:value-of select="$doctype"/>
315
315
  <xsl:text>  </xsl:text>
316
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
317
- <xsl:text>-</xsl:text>
316
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation">
317
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
318
+ <xsl:text>-</xsl:text>
319
+ </xsl:if>
318
320
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:bureau"/>
319
321
  <xsl:text>  </xsl:text>
320
322
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
@@ -898,24 +900,38 @@
898
900
  <xsl:apply-templates/>
899
901
  </fo:inline>
900
902
  <xsl:if test="../itu:termsource/itu:origin">
903
+ <xsl:text>: </xsl:text>
901
904
  <xsl:variable name="citeas" select="../itu:termsource/itu:origin/@citeas"/>
902
- <xsl:choose>
903
- <xsl:when test="contains($citeas, '[')">
904
- <xsl:text> </xsl:text><xsl:value-of select="$citeas"/> <!-- disable-output-escaping="yes" -->
905
- </xsl:when>
906
- <xsl:otherwise>
907
- <xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
908
- </xsl:otherwise>
909
- </xsl:choose>
910
- </xsl:if>
911
- <xsl:text>: </xsl:text>
912
- <xsl:apply-templates select="following-sibling::itu:definition/node()" mode="process"/>
905
+ <xsl:variable name="bibitemid" select="../itu:termsource/itu:origin/@bibitemid"/>
906
+ <xsl:variable name="origin_text" select="normalize-space(../itu:termsource/itu:origin/text())"/>
907
+
908
+ <fo:basic-link internal-destination="{$bibitemid}" fox:alt-text="{$citeas}">
909
+ <xsl:choose>
910
+ <xsl:when test="$origin_text != ''">
911
+ <xsl:text> </xsl:text><xsl:apply-templates select="../itu:termsource/itu:origin/node()"/>
912
+ </xsl:when>
913
+ <xsl:when test="contains($citeas, '[')">
914
+ <xsl:text> </xsl:text><xsl:value-of select="$citeas"/> <!-- disable-output-escaping="yes" -->
915
+ </xsl:when>
916
+ <xsl:otherwise>
917
+ <xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
918
+ </xsl:otherwise>
919
+ </xsl:choose>
920
+ </fo:basic-link>
921
+ </xsl:if>
922
+ <xsl:if test="following-sibling::itu:definition/node()">
923
+ <xsl:text>: </xsl:text>
924
+ <xsl:apply-templates select="following-sibling::itu:definition/node()" mode="process"/>
925
+ </xsl:if>
913
926
  </fo:block>
914
927
  <!-- <xsl:if test="following-sibling::itu:table">
915
928
  <fo:block space-after="18pt">&#xA0;</fo:block>
916
929
  </xsl:if> -->
917
930
  </xsl:template>
918
931
 
932
+ <xsl:template match="itu:term[itu:preferred]/itu:termsource" priority="2"/>
933
+
934
+
919
935
  <xsl:template match="itu:definition/itu:p" priority="2"/>
920
936
  <xsl:template match="itu:definition/itu:formula" priority="2"/>
921
937
 
@@ -1309,13 +1325,22 @@
1309
1325
  <title-part lang="en">
1310
1326
 
1311
1327
 
1328
+
1312
1329
  </title-part>
1313
1330
  <title-part lang="fr">
1314
1331
 
1315
1332
 
1333
+
1316
1334
  </title-part>
1317
1335
  <title-part lang="zh">第 # 部分:</title-part>
1318
1336
 
1337
+ <title-subpart lang="en">
1338
+
1339
+ </title-subpart>
1340
+ <title-subpart lang="fr">
1341
+
1342
+ </title-subpart>
1343
+
1319
1344
  <title-modified lang="en">modified</title-modified>
1320
1345
  <title-modified lang="fr">modifiée</title-modified>
1321
1346
 
@@ -1771,7 +1796,9 @@
1771
1796
 
1772
1797
 
1773
1798
 
1774
-
1799
+ <!-- <xsl:if test="$namespace = 'bipm'">
1800
+ <fo:block>&#xA0;</fo:block>
1801
+ </xsl:if> -->
1775
1802
 
1776
1803
  <!-- $namespace = 'iso' or -->
1777
1804
 
@@ -1945,6 +1972,7 @@
1945
1972
  <xsl:if test="normalize-space() != ''">
1946
1973
  <fo:block xsl:use-attribute-sets="table-name-style">
1947
1974
 
1975
+
1948
1976
  <xsl:apply-templates/>
1949
1977
  </fo:block>
1950
1978
  </xsl:if>
@@ -2306,6 +2334,7 @@
2306
2334
 
2307
2335
 
2308
2336
 
2337
+
2309
2338
  <!-- <xsl:if test="$namespace = 'bipm'">
2310
2339
  <xsl:attribute name="height">8mm</xsl:attribute>
2311
2340
  </xsl:if> -->
@@ -2400,7 +2429,8 @@
2400
2429
  </xsl:attribute>
2401
2430
  </xsl:if>
2402
2431
  <xsl:call-template name="display-align"/>
2403
- <fo:block>
2432
+ <fo:block>
2433
+
2404
2434
  <xsl:apply-templates/>
2405
2435
  </fo:block>
2406
2436
  </fo:table-cell>
@@ -2631,7 +2661,11 @@
2631
2661
  <xsl:apply-templates/>
2632
2662
  </fo:inline>
2633
2663
  </xsl:template><xsl:template match="*[local-name()='dl']">
2634
- <fo:block-container margin-left="0mm">
2664
+ <fo:block-container>
2665
+
2666
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2667
+
2668
+
2635
2669
  <xsl:if test="parent::*[local-name() = 'note']">
2636
2670
  <xsl:attribute name="margin-left">
2637
2671
  <xsl:choose>
@@ -2641,8 +2675,11 @@
2641
2675
  </xsl:attribute>
2642
2676
 
2643
2677
  </xsl:if>
2644
- <fo:block-container margin-left="0mm">
2645
-
2678
+ <fo:block-container>
2679
+
2680
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2681
+
2682
+
2646
2683
  <xsl:variable name="parent" select="local-name(..)"/>
2647
2684
 
2648
2685
  <xsl:variable name="key_iso">
@@ -2656,9 +2693,12 @@
2656
2693
  <fo:block margin-bottom="12pt" text-align="left">
2657
2694
 
2658
2695
  <xsl:variable name="title-where">
2659
- <xsl:call-template name="getTitle">
2660
- <xsl:with-param name="name" select="'title-where'"/>
2661
- </xsl:call-template>
2696
+
2697
+
2698
+ <xsl:call-template name="getTitle">
2699
+ <xsl:with-param name="name" select="'title-where'"/>
2700
+ </xsl:call-template>
2701
+
2662
2702
  </xsl:variable>
2663
2703
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2664
2704
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2676,9 +2716,12 @@
2676
2716
 
2677
2717
 
2678
2718
  <xsl:variable name="title-where">
2679
- <xsl:call-template name="getTitle">
2680
- <xsl:with-param name="name" select="'title-where'"/>
2681
- </xsl:call-template>
2719
+
2720
+
2721
+ <xsl:call-template name="getTitle">
2722
+ <xsl:with-param name="name" select="'title-where'"/>
2723
+ </xsl:call-template>
2724
+
2682
2725
  </xsl:variable>
2683
2726
  <xsl:value-of select="$title-where"/>:
2684
2727
  </fo:block>
@@ -2689,9 +2732,12 @@
2689
2732
 
2690
2733
 
2691
2734
  <xsl:variable name="title-key">
2692
- <xsl:call-template name="getTitle">
2693
- <xsl:with-param name="name" select="'title-key'"/>
2694
- </xsl:call-template>
2735
+
2736
+
2737
+ <xsl:call-template name="getTitle">
2738
+ <xsl:with-param name="name" select="'title-key'"/>
2739
+ </xsl:call-template>
2740
+
2695
2741
  </xsl:variable>
2696
2742
  <xsl:value-of select="$title-key"/>
2697
2743
  </fo:block>
@@ -3279,7 +3325,18 @@
3279
3325
  <xsl:with-param name="previousRow" select="$newRow"/>
3280
3326
  </xsl:apply-templates>
3281
3327
  </xsl:template><xsl:template name="getLang">
3282
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3328
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3329
+ <xsl:variable name="language">
3330
+ <xsl:choose>
3331
+ <xsl:when test="$language_current != ''">
3332
+ <xsl:value-of select="$language_current"/>
3333
+ </xsl:when>
3334
+ <xsl:otherwise>
3335
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3336
+ </xsl:otherwise>
3337
+ </xsl:choose>
3338
+ </xsl:variable>
3339
+
3283
3340
  <xsl:choose>
3284
3341
  <xsl:when test="$language = 'English'">en</xsl:when>
3285
3342
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3314,6 +3371,7 @@
3314
3371
  <xsl:value-of select="substring($str, 2)"/>
3315
3372
  </xsl:template><xsl:template match="mathml:math">
3316
3373
  <fo:inline font-family="STIX Two Math"> <!-- -->
3374
+
3317
3375
  <xsl:variable name="mathml">
3318
3376
  <xsl:apply-templates select="." mode="mathml"/>
3319
3377
  </xsl:variable>
@@ -3396,10 +3454,14 @@
3396
3454
  </fo:inline>
3397
3455
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3398
3456
  <xsl:variable name="title-modified">
3399
- <xsl:call-template name="getTitle">
3400
- <xsl:with-param name="name" select="'title-modified'"/>
3401
- </xsl:call-template>
3457
+
3458
+
3459
+ <xsl:call-template name="getTitle">
3460
+ <xsl:with-param name="name" select="'title-modified'"/>
3461
+ </xsl:call-template>
3462
+
3402
3463
  </xsl:variable>
3464
+
3403
3465
  <xsl:choose>
3404
3466
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3405
3467
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4278,9 +4340,12 @@
4278
4340
  </fo:block>
4279
4341
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4280
4342
  <xsl:variable name="title-deprecated">
4281
- <xsl:call-template name="getTitle">
4282
- <xsl:with-param name="name" select="'title-deprecated'"/>
4283
- </xsl:call-template>
4343
+
4344
+
4345
+ <xsl:call-template name="getTitle">
4346
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4347
+ </xsl:call-template>
4348
+
4284
4349
  </xsl:variable>
4285
4350
  <fo:block xsl:use-attribute-sets="deprecates-style">
4286
4351
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4643,13 +4708,22 @@
4643
4708
  </xsl:template><xsl:template name="split">
4644
4709
  <xsl:param name="pText" select="."/>
4645
4710
  <xsl:param name="sep" select="','"/>
4711
+ <xsl:param name="normalize-space" select="'true'"/>
4646
4712
  <xsl:if test="string-length($pText) &gt;0">
4647
4713
  <item>
4648
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4714
+ <xsl:choose>
4715
+ <xsl:when test="$normalize-space = 'true'">
4716
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4717
+ </xsl:when>
4718
+ <xsl:otherwise>
4719
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4720
+ </xsl:otherwise>
4721
+ </xsl:choose>
4649
4722
  </item>
4650
4723
  <xsl:call-template name="split">
4651
4724
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4652
4725
  <xsl:with-param name="sep" select="$sep"/>
4726
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4653
4727
  </xsl:call-template>
4654
4728
  </xsl:if>
4655
4729
  </xsl:template><xsl:template name="getDocumentId">
@@ -4715,4 +4789,23 @@
4715
4789
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4716
4790
  </xsl:call-template>
4717
4791
  </xsl:if>
4792
+ </xsl:template><xsl:template name="repeat">
4793
+ <xsl:param name="char" select="'*'"/>
4794
+ <xsl:param name="count"/>
4795
+ <xsl:if test="$count &gt; 0">
4796
+ <xsl:value-of select="$char"/>
4797
+ <xsl:call-template name="repeat">
4798
+ <xsl:with-param name="char" select="$char"/>
4799
+ <xsl:with-param name="count" select="$count - 1"/>
4800
+ </xsl:call-template>
4801
+ </xsl:if>
4802
+ </xsl:template><xsl:template name="getLocalizedString">
4803
+ <xsl:param name="key"/>
4804
+
4805
+ <xsl:variable name="curr_lang">
4806
+ <xsl:call-template name="getLang"/>
4807
+ </xsl:variable>
4808
+
4809
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4810
+
4718
4811
  </xsl:template></xsl:stylesheet>
@@ -63,8 +63,8 @@
63
63
  <xsl:call-template name="getLang"/>
64
64
  </xsl:variable>
65
65
 
66
- <xsl:variable name="isAmendment" select="normalize-space(/itu:itu-standard/itu:local_bibdata/itu:ext/itu:structuredidentifier/itu:amendment[@language = $lang])"/>
67
- <xsl:variable name="isCorrigendum" select="normalize-space(/itu:itu-standard/itu:local_bibdata/itu:ext/itu:structuredidentifier/itu:corrigendum[@language = $lang])"/>
66
+ <xsl:variable name="isAmendment" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:amendment[@language = $lang])"/>
67
+ <xsl:variable name="isCorrigendum" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:corrigendum[@language = $lang])"/>
68
68
 
69
69
  <xsl:template match="/">
70
70
  <xsl:call-template name="namespaceCheck"/>
@@ -313,8 +313,10 @@
313
313
  <fo:block font-size="16pt" margin-top="3pt">
314
314
  <xsl:value-of select="$doctype"/>
315
315
  <xsl:text>  </xsl:text>
316
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
317
- <xsl:text>-</xsl:text>
316
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation">
317
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
318
+ <xsl:text>-</xsl:text>
319
+ </xsl:if>
318
320
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:bureau"/>
319
321
  <xsl:text>  </xsl:text>
320
322
  <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
@@ -898,24 +900,38 @@
898
900
  <xsl:apply-templates/>
899
901
  </fo:inline>
900
902
  <xsl:if test="../itu:termsource/itu:origin">
903
+ <xsl:text>: </xsl:text>
901
904
  <xsl:variable name="citeas" select="../itu:termsource/itu:origin/@citeas"/>
902
- <xsl:choose>
903
- <xsl:when test="contains($citeas, '[')">
904
- <xsl:text> </xsl:text><xsl:value-of select="$citeas"/> <!-- disable-output-escaping="yes" -->
905
- </xsl:when>
906
- <xsl:otherwise>
907
- <xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
908
- </xsl:otherwise>
909
- </xsl:choose>
910
- </xsl:if>
911
- <xsl:text>: </xsl:text>
912
- <xsl:apply-templates select="following-sibling::itu:definition/node()" mode="process"/>
905
+ <xsl:variable name="bibitemid" select="../itu:termsource/itu:origin/@bibitemid"/>
906
+ <xsl:variable name="origin_text" select="normalize-space(../itu:termsource/itu:origin/text())"/>
907
+
908
+ <fo:basic-link internal-destination="{$bibitemid}" fox:alt-text="{$citeas}">
909
+ <xsl:choose>
910
+ <xsl:when test="$origin_text != ''">
911
+ <xsl:text> </xsl:text><xsl:apply-templates select="../itu:termsource/itu:origin/node()"/>
912
+ </xsl:when>
913
+ <xsl:when test="contains($citeas, '[')">
914
+ <xsl:text> </xsl:text><xsl:value-of select="$citeas"/> <!-- disable-output-escaping="yes" -->
915
+ </xsl:when>
916
+ <xsl:otherwise>
917
+ <xsl:text> [</xsl:text><xsl:value-of select="$citeas"/><xsl:text>]</xsl:text>
918
+ </xsl:otherwise>
919
+ </xsl:choose>
920
+ </fo:basic-link>
921
+ </xsl:if>
922
+ <xsl:if test="following-sibling::itu:definition/node()">
923
+ <xsl:text>: </xsl:text>
924
+ <xsl:apply-templates select="following-sibling::itu:definition/node()" mode="process"/>
925
+ </xsl:if>
913
926
  </fo:block>
914
927
  <!-- <xsl:if test="following-sibling::itu:table">
915
928
  <fo:block space-after="18pt">&#xA0;</fo:block>
916
929
  </xsl:if> -->
917
930
  </xsl:template>
918
931
 
932
+ <xsl:template match="itu:term[itu:preferred]/itu:termsource" priority="2"/>
933
+
934
+
919
935
  <xsl:template match="itu:definition/itu:p" priority="2"/>
920
936
  <xsl:template match="itu:definition/itu:formula" priority="2"/>
921
937
 
@@ -1309,13 +1325,22 @@
1309
1325
  <title-part lang="en">
1310
1326
 
1311
1327
 
1328
+
1312
1329
  </title-part>
1313
1330
  <title-part lang="fr">
1314
1331
 
1315
1332
 
1333
+
1316
1334
  </title-part>
1317
1335
  <title-part lang="zh">第 # 部分:</title-part>
1318
1336
 
1337
+ <title-subpart lang="en">
1338
+
1339
+ </title-subpart>
1340
+ <title-subpart lang="fr">
1341
+
1342
+ </title-subpart>
1343
+
1319
1344
  <title-modified lang="en">modified</title-modified>
1320
1345
  <title-modified lang="fr">modifiée</title-modified>
1321
1346
 
@@ -1771,7 +1796,9 @@
1771
1796
 
1772
1797
 
1773
1798
 
1774
-
1799
+ <!-- <xsl:if test="$namespace = 'bipm'">
1800
+ <fo:block>&#xA0;</fo:block>
1801
+ </xsl:if> -->
1775
1802
 
1776
1803
  <!-- $namespace = 'iso' or -->
1777
1804
 
@@ -1945,6 +1972,7 @@
1945
1972
  <xsl:if test="normalize-space() != ''">
1946
1973
  <fo:block xsl:use-attribute-sets="table-name-style">
1947
1974
 
1975
+
1948
1976
  <xsl:apply-templates/>
1949
1977
  </fo:block>
1950
1978
  </xsl:if>
@@ -2306,6 +2334,7 @@
2306
2334
 
2307
2335
 
2308
2336
 
2337
+
2309
2338
  <!-- <xsl:if test="$namespace = 'bipm'">
2310
2339
  <xsl:attribute name="height">8mm</xsl:attribute>
2311
2340
  </xsl:if> -->
@@ -2400,7 +2429,8 @@
2400
2429
  </xsl:attribute>
2401
2430
  </xsl:if>
2402
2431
  <xsl:call-template name="display-align"/>
2403
- <fo:block>
2432
+ <fo:block>
2433
+
2404
2434
  <xsl:apply-templates/>
2405
2435
  </fo:block>
2406
2436
  </fo:table-cell>
@@ -2631,7 +2661,11 @@
2631
2661
  <xsl:apply-templates/>
2632
2662
  </fo:inline>
2633
2663
  </xsl:template><xsl:template match="*[local-name()='dl']">
2634
- <fo:block-container margin-left="0mm">
2664
+ <fo:block-container>
2665
+
2666
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2667
+
2668
+
2635
2669
  <xsl:if test="parent::*[local-name() = 'note']">
2636
2670
  <xsl:attribute name="margin-left">
2637
2671
  <xsl:choose>
@@ -2641,8 +2675,11 @@
2641
2675
  </xsl:attribute>
2642
2676
 
2643
2677
  </xsl:if>
2644
- <fo:block-container margin-left="0mm">
2645
-
2678
+ <fo:block-container>
2679
+
2680
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2681
+
2682
+
2646
2683
  <xsl:variable name="parent" select="local-name(..)"/>
2647
2684
 
2648
2685
  <xsl:variable name="key_iso">
@@ -2656,9 +2693,12 @@
2656
2693
  <fo:block margin-bottom="12pt" text-align="left">
2657
2694
 
2658
2695
  <xsl:variable name="title-where">
2659
- <xsl:call-template name="getTitle">
2660
- <xsl:with-param name="name" select="'title-where'"/>
2661
- </xsl:call-template>
2696
+
2697
+
2698
+ <xsl:call-template name="getTitle">
2699
+ <xsl:with-param name="name" select="'title-where'"/>
2700
+ </xsl:call-template>
2701
+
2662
2702
  </xsl:variable>
2663
2703
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2664
2704
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2676,9 +2716,12 @@
2676
2716
 
2677
2717
 
2678
2718
  <xsl:variable name="title-where">
2679
- <xsl:call-template name="getTitle">
2680
- <xsl:with-param name="name" select="'title-where'"/>
2681
- </xsl:call-template>
2719
+
2720
+
2721
+ <xsl:call-template name="getTitle">
2722
+ <xsl:with-param name="name" select="'title-where'"/>
2723
+ </xsl:call-template>
2724
+
2682
2725
  </xsl:variable>
2683
2726
  <xsl:value-of select="$title-where"/>:
2684
2727
  </fo:block>
@@ -2689,9 +2732,12 @@
2689
2732
 
2690
2733
 
2691
2734
  <xsl:variable name="title-key">
2692
- <xsl:call-template name="getTitle">
2693
- <xsl:with-param name="name" select="'title-key'"/>
2694
- </xsl:call-template>
2735
+
2736
+
2737
+ <xsl:call-template name="getTitle">
2738
+ <xsl:with-param name="name" select="'title-key'"/>
2739
+ </xsl:call-template>
2740
+
2695
2741
  </xsl:variable>
2696
2742
  <xsl:value-of select="$title-key"/>
2697
2743
  </fo:block>
@@ -3279,7 +3325,18 @@
3279
3325
  <xsl:with-param name="previousRow" select="$newRow"/>
3280
3326
  </xsl:apply-templates>
3281
3327
  </xsl:template><xsl:template name="getLang">
3282
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3328
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3329
+ <xsl:variable name="language">
3330
+ <xsl:choose>
3331
+ <xsl:when test="$language_current != ''">
3332
+ <xsl:value-of select="$language_current"/>
3333
+ </xsl:when>
3334
+ <xsl:otherwise>
3335
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3336
+ </xsl:otherwise>
3337
+ </xsl:choose>
3338
+ </xsl:variable>
3339
+
3283
3340
  <xsl:choose>
3284
3341
  <xsl:when test="$language = 'English'">en</xsl:when>
3285
3342
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3314,6 +3371,7 @@
3314
3371
  <xsl:value-of select="substring($str, 2)"/>
3315
3372
  </xsl:template><xsl:template match="mathml:math">
3316
3373
  <fo:inline font-family="STIX Two Math"> <!-- -->
3374
+
3317
3375
  <xsl:variable name="mathml">
3318
3376
  <xsl:apply-templates select="." mode="mathml"/>
3319
3377
  </xsl:variable>
@@ -3396,10 +3454,14 @@
3396
3454
  </fo:inline>
3397
3455
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3398
3456
  <xsl:variable name="title-modified">
3399
- <xsl:call-template name="getTitle">
3400
- <xsl:with-param name="name" select="'title-modified'"/>
3401
- </xsl:call-template>
3457
+
3458
+
3459
+ <xsl:call-template name="getTitle">
3460
+ <xsl:with-param name="name" select="'title-modified'"/>
3461
+ </xsl:call-template>
3462
+
3402
3463
  </xsl:variable>
3464
+
3403
3465
  <xsl:choose>
3404
3466
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3405
3467
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4278,9 +4340,12 @@
4278
4340
  </fo:block>
4279
4341
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4280
4342
  <xsl:variable name="title-deprecated">
4281
- <xsl:call-template name="getTitle">
4282
- <xsl:with-param name="name" select="'title-deprecated'"/>
4283
- </xsl:call-template>
4343
+
4344
+
4345
+ <xsl:call-template name="getTitle">
4346
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4347
+ </xsl:call-template>
4348
+
4284
4349
  </xsl:variable>
4285
4350
  <fo:block xsl:use-attribute-sets="deprecates-style">
4286
4351
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4643,13 +4708,22 @@
4643
4708
  </xsl:template><xsl:template name="split">
4644
4709
  <xsl:param name="pText" select="."/>
4645
4710
  <xsl:param name="sep" select="','"/>
4711
+ <xsl:param name="normalize-space" select="'true'"/>
4646
4712
  <xsl:if test="string-length($pText) &gt;0">
4647
4713
  <item>
4648
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4714
+ <xsl:choose>
4715
+ <xsl:when test="$normalize-space = 'true'">
4716
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4717
+ </xsl:when>
4718
+ <xsl:otherwise>
4719
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4720
+ </xsl:otherwise>
4721
+ </xsl:choose>
4649
4722
  </item>
4650
4723
  <xsl:call-template name="split">
4651
4724
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
4652
4725
  <xsl:with-param name="sep" select="$sep"/>
4726
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
4653
4727
  </xsl:call-template>
4654
4728
  </xsl:if>
4655
4729
  </xsl:template><xsl:template name="getDocumentId">
@@ -4715,4 +4789,23 @@
4715
4789
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4716
4790
  </xsl:call-template>
4717
4791
  </xsl:if>
4792
+ </xsl:template><xsl:template name="repeat">
4793
+ <xsl:param name="char" select="'*'"/>
4794
+ <xsl:param name="count"/>
4795
+ <xsl:if test="$count &gt; 0">
4796
+ <xsl:value-of select="$char"/>
4797
+ <xsl:call-template name="repeat">
4798
+ <xsl:with-param name="char" select="$char"/>
4799
+ <xsl:with-param name="count" select="$count - 1"/>
4800
+ </xsl:call-template>
4801
+ </xsl:if>
4802
+ </xsl:template><xsl:template name="getLocalizedString">
4803
+ <xsl:param name="key"/>
4804
+
4805
+ <xsl:variable name="curr_lang">
4806
+ <xsl:call-template name="getLang"/>
4807
+ </xsl:variable>
4808
+
4809
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4810
+
4718
4811
  </xsl:template></xsl:stylesheet>
@@ -60,6 +60,10 @@ module IsoDoc
60
60
  end
61
61
  end
62
62
 
63
+ def twitter_cldr_localiser_symbols
64
+ {group: "'"}
65
+ end
66
+
63
67
  include Init
64
68
  end
65
69
  end
@@ -1,35 +1,6 @@
1
1
  module IsoDoc
2
2
  module ITU
3
3
  module BaseConvert
4
- =begin
5
- def terms_defs(node, out, num)
6
- f = node.at(ns(IsoDoc::Convert::TERM_CLAUSE)) or return num
7
- out.div **attr_code(id: f["id"]) do |div|
8
- num = num + 1
9
- clause_name(num, f.at(ns("./title")), div, nil)
10
- if f.at(ns("./clause | ./terms | ./term")).nil? then out.p "None."
11
- else
12
- f.children.reject { |c1| c1.name == "title" }.each do |c1|
13
- parse(c1, div)
14
- end
15
- end
16
- end
17
- num
18
- end
19
-
20
- def terms_parse(node, out)
21
- out.div **attr_code(id: node["id"]) do |div|
22
- clause_parse_title(node, div, node.at(ns("./title")), out)
23
- if node.at(ns("./clause | ./term")).nil? then out.p "None."
24
- else
25
- node.children.reject { |c1| c1.name == "title" }.each do |c1|
26
- parse(c1, div)
27
- end
28
- end
29
- end
30
- end
31
- =end
32
-
33
4
  def termdef_parse1(node, div, defn, source)
34
5
  div.p **{ class: "TermNum", id: node["id"] } do |p|
35
6
  p.b do |b|
@@ -37,8 +8,8 @@ module IsoDoc
37
8
  insert_tab(b, 1)
38
9
  node&.at(ns("./preferred"))&.children&.each { |n| parse(n, b) }
39
10
  end
40
- source and p << " #{bracket_opt(source.value)}"
41
11
  p << ": "
12
+ source and p << "#{bracket_opt(source.value)} "
42
13
  end
43
14
  defn and defn.children.each { |n| parse(n, div) }
44
15
  end
@@ -56,6 +27,12 @@ module IsoDoc
56
27
  end
57
28
  end
58
29
 
30
+ def bracket_opt(b)
31
+ return b if b.nil?
32
+ return b if /^\[.+\]$/.match(b)
33
+ "[#{b}]"
34
+ end
35
+
59
36
  def termnote_delim
60
37
  " &ndash; "
61
38
  end
@@ -20,7 +20,7 @@ module IsoDoc
20
20
  @labels["appendix"] : @labels["annex"]
21
21
  @anchors[clause["id"]] =
22
22
  { label: annex_name_lbl(clause, num), type: "clause",
23
- xref: "#{lbl} #{num}", level: 1, value: num }
23
+ xref: l10n("#{lbl} #{num}"), level: 1, value: num }
24
24
  if a = single_annex_special_section(clause)
25
25
  annex_names1(a, "#{num}", 1)
26
26
  else
@@ -51,7 +51,7 @@ module IsoDoc
51
51
 
52
52
  def annex_names1(clause, num, level)
53
53
  @anchors[clause["id"]] =
54
- { label: num, xref: "#{@labels["annex_subclause"]} #{num}",
54
+ { label: num, xref: l10n("#{@labels["annex_subclause"]} #{num}"),
55
55
  level: level, type: "clause" }
56
56
  clause.xpath(ns("./clause | ./references | ./terms | ./definitions"))
57
57
  .each_with_index do |c, i|
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ITU
3
- VERSION = "1.2.6"
3
+ VERSION = "1.2.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-itu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-25 00:00:00.000000000 Z
11
+ date: 2020-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities