metanorma-ogc 1.2.6 → 1.2.7

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: 4f4ede26f8e1b13ab6f0ad902f2bd43fa03e17ce923feae18c8e4b1af67418ea
4
- data.tar.gz: 16f48b39d7afc5d0a3858a6643d76c96a42b402e9d1688fb56264fb69641efc0
3
+ metadata.gz: c98825fb2e3aa0602fac7aa4728f9d0754ae573cb83d2a9675a737a8bbab0554
4
+ data.tar.gz: a955eb128743c632b0d6bbae3473a40989fc0e74d8393cfb7e2a0885388594e9
5
5
  SHA512:
6
- metadata.gz: 422db95a5b4b10a1241cf55efd7daaa4d4bba2e642c76e4455068fe3553cdf27e7e229e2c3ace03cfffdc2a93c1fccaae7b504db4e887ea4fea821664e7a5066
7
- data.tar.gz: 66ccf79741efd88899f443b70c235794d6af2551e8fee4d57e5bb6319dc0b91751179f0b2a50c39920dd19f55638566cf7718d44ee21622e071415aad6993804
6
+ metadata.gz: e530139fcb35e28a16c3aa2833517b924313cb3ffd02b9cfba814483f2f51aa4e8ec96b12995221219b0ad540667b6acdd3b6add457a55c75c789537551a936d
7
+ data.tar.gz: a1b57a97cc3920430ce966d421f3bba843c6ca0f280b4c562abbbdf2af10f325e4ba8d09c406c42006eac9275d4a9d78f760aa2705204d15c5ac22039461fcfc
@@ -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-ogc: Metanorma processor for the Open Geospatial Consortium document class
2
2
 
3
3
  image:https://img.shields.io/gem/v/metanorma-ogc.svg["Gem Version", link="https://rubygems.org/gems/metanorma-ogc"]
4
- image:https://github.com/metanorma/metanorma-ogc/workflows/macos/badge.svg["Build Status (macOS)", link="https://github.com/metanorma/metanorma-ogc/actions?workflow=macos"]
5
- image:https://github.com/metanorma/metanorma-ogc/workflows/ubuntu/badge.svg["Build Status (ubuntu)", link="https://github.com/metanorma/metanorma-ogc/actions?workflow=ubuntu"]
6
- image:https://github.com/metanorma/metanorma-ogc/workflows/windows/badge.svg["Build Status (Windows)", link="https://github.com/metanorma/metanorma-ogc/actions?workflow=windows"]
4
+ image:https://github.com/metanorma/metanorma-ogc/workflows/rake/badge.svg["Build Status", link="https://github.com/metanorma/metanorma-ogc/actions?workflow=rake"]
7
5
  image:https://codeclimate.com/github/metanorma/metanorma-ogc/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/metanorma/metanorma-ogc"]
8
6
  image:https://img.shields.io/github/issues-pr-raw/metanorma/metanorma-ogc.svg["Pull Requests", link="https://github.com/metanorma/metanorma-ogc/pulls"]
9
7
  image:https://img.shields.io/github/commits-since/metanorma/metanorma-ogc/latest.svg["Commits since latest",link="https://github.com/metanorma/metanorma-ogc/releases"]
10
8
 
11
9
  == Functionality
12
10
 
13
- This gem processes Metanorma documents into the OGC document class.
11
+ This gem processes https://www.metanorma.com[Metanorma documents] following
12
+ a template for generating OGC standards and documents.
14
13
 
15
14
  It provides the following functions:
16
15
 
@@ -92,7 +92,7 @@
92
92
  </license-statement>
93
93
 
94
94
  <legal-statement>
95
- {% if doctype == "Standard" or doctype == "Community Standard" %}
95
+ {% if doctype == "Standard" or doctype == "Community Standard" or doctype == "Abstract Specification" %}
96
96
  {% if stage == "Approved" or stage == "Withdrawn" %}
97
97
  <clause>
98
98
  <title>Warning</title>
@@ -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"/>
@@ -7,7 +7,6 @@ module IsoDoc
7
7
  module Ogc
8
8
  module BaseConvert
9
9
  def cleanup(docxml)
10
- #requirement_table_cleanup(docxml)
11
10
  super
12
11
  term_cleanup(docxml)
13
12
  end
@@ -12,6 +12,7 @@ module IsoDoc
12
12
  list.p **attr_code(iso_bibitem_entry_attrs(b, bibliography)) do |r|
13
13
  id = bibitem_ref_code(b)
14
14
  identifier = render_identifier(id)
15
+ identifier[1] = nil
15
16
  if bibliography
16
17
  ref_entry_code(r, ordinal, identifier, id)
17
18
  end
@@ -201,7 +201,8 @@
201
201
  </xsl:call-template>
202
202
  </fo:block>
203
203
  <fo:block font-size="12pt" font-weight="bold">
204
- <xsl:variable name="stage" select="java:toUpperCase(java:java.lang.String.new(//ogc:local_bibdata/ogc:status/ogc:stage))"/>
204
+ <xsl:variable name="curr_lang" select="/ogc:ogc-standard/ogc:bibdata/ogc:language[@current = 'true']"/>
205
+ <xsl:variable name="stage" select="java:toUpperCase(java:java.lang.String.new(/ogc:ogc-standard/ogc:bibdata/ogc:status/ogc:stage[@language = $curr_lang]))"/>
205
206
  <xsl:call-template name="addLetterSpacing">
206
207
  <xsl:with-param name="text" select="$stage"/>
207
208
  </xsl:call-template>
@@ -1515,13 +1516,22 @@
1515
1516
  <title-part lang="en">
1516
1517
 
1517
1518
 
1519
+
1518
1520
  </title-part>
1519
1521
  <title-part lang="fr">
1520
1522
 
1521
1523
 
1524
+
1522
1525
  </title-part>
1523
1526
  <title-part lang="zh">第 # 部分:</title-part>
1524
1527
 
1528
+ <title-subpart lang="en">
1529
+
1530
+ </title-subpart>
1531
+ <title-subpart lang="fr">
1532
+
1533
+ </title-subpart>
1534
+
1525
1535
  <title-modified lang="en">modified</title-modified>
1526
1536
  <title-modified lang="fr">modifiée</title-modified>
1527
1537
 
@@ -2039,7 +2049,9 @@
2039
2049
  <fo:block> </fo:block>
2040
2050
 
2041
2051
 
2042
-
2052
+ <!-- <xsl:if test="$namespace = 'bipm'">
2053
+ <fo:block>&#xA0;</fo:block>
2054
+ </xsl:if> -->
2043
2055
 
2044
2056
  <!-- $namespace = 'iso' or -->
2045
2057
 
@@ -2213,6 +2225,7 @@
2213
2225
  <xsl:if test="normalize-space() != ''">
2214
2226
  <fo:block xsl:use-attribute-sets="table-name-style">
2215
2227
 
2228
+
2216
2229
  <xsl:apply-templates/>
2217
2230
  </fo:block>
2218
2231
  </xsl:if>
@@ -2582,6 +2595,7 @@
2582
2595
  </xsl:if>
2583
2596
  </xsl:if>
2584
2597
 
2598
+
2585
2599
  <!-- <xsl:if test="$namespace = 'bipm'">
2586
2600
  <xsl:attribute name="height">8mm</xsl:attribute>
2587
2601
  </xsl:if> -->
@@ -2671,7 +2685,8 @@
2671
2685
  </xsl:attribute>
2672
2686
  </xsl:if>
2673
2687
  <xsl:call-template name="display-align"/>
2674
- <fo:block>
2688
+ <fo:block>
2689
+
2675
2690
  <xsl:apply-templates/>
2676
2691
  </fo:block>
2677
2692
  </fo:table-cell>
@@ -2896,7 +2911,11 @@
2896
2911
  <xsl:apply-templates/>
2897
2912
  </fo:inline>
2898
2913
  </xsl:template><xsl:template match="*[local-name()='dl']">
2899
- <fo:block-container margin-left="0mm">
2914
+ <fo:block-container>
2915
+
2916
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2917
+
2918
+
2900
2919
  <xsl:if test="parent::*[local-name() = 'note']">
2901
2920
  <xsl:attribute name="margin-left">
2902
2921
  <xsl:choose>
@@ -2906,8 +2925,11 @@
2906
2925
  </xsl:attribute>
2907
2926
 
2908
2927
  </xsl:if>
2909
- <fo:block-container margin-left="0mm">
2910
-
2928
+ <fo:block-container>
2929
+
2930
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2931
+
2932
+
2911
2933
  <xsl:variable name="parent" select="local-name(..)"/>
2912
2934
 
2913
2935
  <xsl:variable name="key_iso">
@@ -2921,9 +2943,12 @@
2921
2943
  <fo:block margin-bottom="12pt" text-align="left">
2922
2944
 
2923
2945
  <xsl:variable name="title-where">
2924
- <xsl:call-template name="getTitle">
2925
- <xsl:with-param name="name" select="'title-where'"/>
2926
- </xsl:call-template>
2946
+
2947
+
2948
+ <xsl:call-template name="getTitle">
2949
+ <xsl:with-param name="name" select="'title-where'"/>
2950
+ </xsl:call-template>
2951
+
2927
2952
  </xsl:variable>
2928
2953
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2929
2954
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2939,9 +2964,12 @@
2939
2964
 
2940
2965
 
2941
2966
  <xsl:variable name="title-where">
2942
- <xsl:call-template name="getTitle">
2943
- <xsl:with-param name="name" select="'title-where'"/>
2944
- </xsl:call-template>
2967
+
2968
+
2969
+ <xsl:call-template name="getTitle">
2970
+ <xsl:with-param name="name" select="'title-where'"/>
2971
+ </xsl:call-template>
2972
+
2945
2973
  </xsl:variable>
2946
2974
  <xsl:value-of select="$title-where"/>
2947
2975
  </fo:block>
@@ -2952,9 +2980,12 @@
2952
2980
 
2953
2981
 
2954
2982
  <xsl:variable name="title-key">
2955
- <xsl:call-template name="getTitle">
2956
- <xsl:with-param name="name" select="'title-key'"/>
2957
- </xsl:call-template>
2983
+
2984
+
2985
+ <xsl:call-template name="getTitle">
2986
+ <xsl:with-param name="name" select="'title-key'"/>
2987
+ </xsl:call-template>
2988
+
2958
2989
  </xsl:variable>
2959
2990
  <xsl:value-of select="$title-key"/>
2960
2991
  </fo:block>
@@ -3530,7 +3561,18 @@
3530
3561
  <xsl:with-param name="previousRow" select="$newRow"/>
3531
3562
  </xsl:apply-templates>
3532
3563
  </xsl:template><xsl:template name="getLang">
3533
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3564
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3565
+ <xsl:variable name="language">
3566
+ <xsl:choose>
3567
+ <xsl:when test="$language_current != ''">
3568
+ <xsl:value-of select="$language_current"/>
3569
+ </xsl:when>
3570
+ <xsl:otherwise>
3571
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3572
+ </xsl:otherwise>
3573
+ </xsl:choose>
3574
+ </xsl:variable>
3575
+
3534
3576
  <xsl:choose>
3535
3577
  <xsl:when test="$language = 'English'">en</xsl:when>
3536
3578
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3565,6 +3607,7 @@
3565
3607
  <xsl:value-of select="substring($str, 2)"/>
3566
3608
  </xsl:template><xsl:template match="mathml:math">
3567
3609
  <fo:inline font-family="STIX Two Math"> <!-- -->
3610
+
3568
3611
  <xsl:variable name="mathml">
3569
3612
  <xsl:apply-templates select="." mode="mathml"/>
3570
3613
  </xsl:variable>
@@ -3647,10 +3690,14 @@
3647
3690
  </fo:inline>
3648
3691
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3649
3692
  <xsl:variable name="title-modified">
3650
- <xsl:call-template name="getTitle">
3651
- <xsl:with-param name="name" select="'title-modified'"/>
3652
- </xsl:call-template>
3693
+
3694
+
3695
+ <xsl:call-template name="getTitle">
3696
+ <xsl:with-param name="name" select="'title-modified'"/>
3697
+ </xsl:call-template>
3698
+
3653
3699
  </xsl:variable>
3700
+
3654
3701
  <xsl:choose>
3655
3702
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3656
3703
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4433,9 +4480,14 @@
4433
4480
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4434
4481
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
4435
4482
 
4436
- <xsl:call-template name="getTitle">
4437
- <xsl:with-param name="name" select="'title-source'"/>
4438
- </xsl:call-template>
4483
+
4484
+
4485
+
4486
+ <xsl:call-template name="getTitle">
4487
+ <xsl:with-param name="name" select="'title-source'"/>
4488
+ </xsl:call-template>
4489
+
4490
+
4439
4491
  <xsl:text>: </xsl:text>
4440
4492
  </fo:inline>
4441
4493
 
@@ -4585,9 +4637,12 @@
4585
4637
  </fo:block>
4586
4638
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4587
4639
  <xsl:variable name="title-deprecated">
4588
- <xsl:call-template name="getTitle">
4589
- <xsl:with-param name="name" select="'title-deprecated'"/>
4590
- </xsl:call-template>
4640
+
4641
+
4642
+ <xsl:call-template name="getTitle">
4643
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4644
+ </xsl:call-template>
4645
+
4591
4646
  </xsl:variable>
4592
4647
  <fo:block xsl:use-attribute-sets="deprecates-style">
4593
4648
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5095,13 +5150,22 @@
5095
5150
  </xsl:template><xsl:template name="split">
5096
5151
  <xsl:param name="pText" select="."/>
5097
5152
  <xsl:param name="sep" select="','"/>
5153
+ <xsl:param name="normalize-space" select="'true'"/>
5098
5154
  <xsl:if test="string-length($pText) &gt;0">
5099
5155
  <item>
5100
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5156
+ <xsl:choose>
5157
+ <xsl:when test="$normalize-space = 'true'">
5158
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5159
+ </xsl:when>
5160
+ <xsl:otherwise>
5161
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5162
+ </xsl:otherwise>
5163
+ </xsl:choose>
5101
5164
  </item>
5102
5165
  <xsl:call-template name="split">
5103
5166
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
5104
5167
  <xsl:with-param name="sep" select="$sep"/>
5168
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
5105
5169
  </xsl:call-template>
5106
5170
  </xsl:if>
5107
5171
  </xsl:template><xsl:template name="getDocumentId">
@@ -5167,4 +5231,23 @@
5167
5231
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5168
5232
  </xsl:call-template>
5169
5233
  </xsl:if>
5234
+ </xsl:template><xsl:template name="repeat">
5235
+ <xsl:param name="char" select="'*'"/>
5236
+ <xsl:param name="count"/>
5237
+ <xsl:if test="$count &gt; 0">
5238
+ <xsl:value-of select="$char"/>
5239
+ <xsl:call-template name="repeat">
5240
+ <xsl:with-param name="char" select="$char"/>
5241
+ <xsl:with-param name="count" select="$count - 1"/>
5242
+ </xsl:call-template>
5243
+ </xsl:if>
5244
+ </xsl:template><xsl:template name="getLocalizedString">
5245
+ <xsl:param name="key"/>
5246
+
5247
+ <xsl:variable name="curr_lang">
5248
+ <xsl:call-template name="getLang"/>
5249
+ </xsl:variable>
5250
+
5251
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5252
+
5170
5253
  </xsl:template></xsl:stylesheet>
@@ -201,7 +201,8 @@
201
201
  </xsl:call-template>
202
202
  </fo:block>
203
203
  <fo:block font-size="12pt" font-weight="bold">
204
- <xsl:variable name="stage" select="java:toUpperCase(java:java.lang.String.new(//ogc:local_bibdata/ogc:status/ogc:stage))"/>
204
+ <xsl:variable name="curr_lang" select="/ogc:ogc-standard/ogc:bibdata/ogc:language[@current = 'true']"/>
205
+ <xsl:variable name="stage" select="java:toUpperCase(java:java.lang.String.new(/ogc:ogc-standard/ogc:bibdata/ogc:status/ogc:stage[@language = $curr_lang]))"/>
205
206
  <xsl:call-template name="addLetterSpacing">
206
207
  <xsl:with-param name="text" select="$stage"/>
207
208
  </xsl:call-template>
@@ -1515,13 +1516,22 @@
1515
1516
  <title-part lang="en">
1516
1517
 
1517
1518
 
1519
+
1518
1520
  </title-part>
1519
1521
  <title-part lang="fr">
1520
1522
 
1521
1523
 
1524
+
1522
1525
  </title-part>
1523
1526
  <title-part lang="zh">第 # 部分:</title-part>
1524
1527
 
1528
+ <title-subpart lang="en">
1529
+
1530
+ </title-subpart>
1531
+ <title-subpart lang="fr">
1532
+
1533
+ </title-subpart>
1534
+
1525
1535
  <title-modified lang="en">modified</title-modified>
1526
1536
  <title-modified lang="fr">modifiée</title-modified>
1527
1537
 
@@ -2039,7 +2049,9 @@
2039
2049
  <fo:block> </fo:block>
2040
2050
 
2041
2051
 
2042
-
2052
+ <!-- <xsl:if test="$namespace = 'bipm'">
2053
+ <fo:block>&#xA0;</fo:block>
2054
+ </xsl:if> -->
2043
2055
 
2044
2056
  <!-- $namespace = 'iso' or -->
2045
2057
 
@@ -2213,6 +2225,7 @@
2213
2225
  <xsl:if test="normalize-space() != ''">
2214
2226
  <fo:block xsl:use-attribute-sets="table-name-style">
2215
2227
 
2228
+
2216
2229
  <xsl:apply-templates/>
2217
2230
  </fo:block>
2218
2231
  </xsl:if>
@@ -2582,6 +2595,7 @@
2582
2595
  </xsl:if>
2583
2596
  </xsl:if>
2584
2597
 
2598
+
2585
2599
  <!-- <xsl:if test="$namespace = 'bipm'">
2586
2600
  <xsl:attribute name="height">8mm</xsl:attribute>
2587
2601
  </xsl:if> -->
@@ -2671,7 +2685,8 @@
2671
2685
  </xsl:attribute>
2672
2686
  </xsl:if>
2673
2687
  <xsl:call-template name="display-align"/>
2674
- <fo:block>
2688
+ <fo:block>
2689
+
2675
2690
  <xsl:apply-templates/>
2676
2691
  </fo:block>
2677
2692
  </fo:table-cell>
@@ -2896,7 +2911,11 @@
2896
2911
  <xsl:apply-templates/>
2897
2912
  </fo:inline>
2898
2913
  </xsl:template><xsl:template match="*[local-name()='dl']">
2899
- <fo:block-container margin-left="0mm">
2914
+ <fo:block-container>
2915
+
2916
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2917
+
2918
+
2900
2919
  <xsl:if test="parent::*[local-name() = 'note']">
2901
2920
  <xsl:attribute name="margin-left">
2902
2921
  <xsl:choose>
@@ -2906,8 +2925,11 @@
2906
2925
  </xsl:attribute>
2907
2926
 
2908
2927
  </xsl:if>
2909
- <fo:block-container margin-left="0mm">
2910
-
2928
+ <fo:block-container>
2929
+
2930
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2931
+
2932
+
2911
2933
  <xsl:variable name="parent" select="local-name(..)"/>
2912
2934
 
2913
2935
  <xsl:variable name="key_iso">
@@ -2921,9 +2943,12 @@
2921
2943
  <fo:block margin-bottom="12pt" text-align="left">
2922
2944
 
2923
2945
  <xsl:variable name="title-where">
2924
- <xsl:call-template name="getTitle">
2925
- <xsl:with-param name="name" select="'title-where'"/>
2926
- </xsl:call-template>
2946
+
2947
+
2948
+ <xsl:call-template name="getTitle">
2949
+ <xsl:with-param name="name" select="'title-where'"/>
2950
+ </xsl:call-template>
2951
+
2927
2952
  </xsl:variable>
2928
2953
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2929
2954
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -2939,9 +2964,12 @@
2939
2964
 
2940
2965
 
2941
2966
  <xsl:variable name="title-where">
2942
- <xsl:call-template name="getTitle">
2943
- <xsl:with-param name="name" select="'title-where'"/>
2944
- </xsl:call-template>
2967
+
2968
+
2969
+ <xsl:call-template name="getTitle">
2970
+ <xsl:with-param name="name" select="'title-where'"/>
2971
+ </xsl:call-template>
2972
+
2945
2973
  </xsl:variable>
2946
2974
  <xsl:value-of select="$title-where"/>
2947
2975
  </fo:block>
@@ -2952,9 +2980,12 @@
2952
2980
 
2953
2981
 
2954
2982
  <xsl:variable name="title-key">
2955
- <xsl:call-template name="getTitle">
2956
- <xsl:with-param name="name" select="'title-key'"/>
2957
- </xsl:call-template>
2983
+
2984
+
2985
+ <xsl:call-template name="getTitle">
2986
+ <xsl:with-param name="name" select="'title-key'"/>
2987
+ </xsl:call-template>
2988
+
2958
2989
  </xsl:variable>
2959
2990
  <xsl:value-of select="$title-key"/>
2960
2991
  </fo:block>
@@ -3530,7 +3561,18 @@
3530
3561
  <xsl:with-param name="previousRow" select="$newRow"/>
3531
3562
  </xsl:apply-templates>
3532
3563
  </xsl:template><xsl:template name="getLang">
3533
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3564
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
3565
+ <xsl:variable name="language">
3566
+ <xsl:choose>
3567
+ <xsl:when test="$language_current != ''">
3568
+ <xsl:value-of select="$language_current"/>
3569
+ </xsl:when>
3570
+ <xsl:otherwise>
3571
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
3572
+ </xsl:otherwise>
3573
+ </xsl:choose>
3574
+ </xsl:variable>
3575
+
3534
3576
  <xsl:choose>
3535
3577
  <xsl:when test="$language = 'English'">en</xsl:when>
3536
3578
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3565,6 +3607,7 @@
3565
3607
  <xsl:value-of select="substring($str, 2)"/>
3566
3608
  </xsl:template><xsl:template match="mathml:math">
3567
3609
  <fo:inline font-family="STIX Two Math"> <!-- -->
3610
+
3568
3611
  <xsl:variable name="mathml">
3569
3612
  <xsl:apply-templates select="." mode="mathml"/>
3570
3613
  </xsl:variable>
@@ -3647,10 +3690,14 @@
3647
3690
  </fo:inline>
3648
3691
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3649
3692
  <xsl:variable name="title-modified">
3650
- <xsl:call-template name="getTitle">
3651
- <xsl:with-param name="name" select="'title-modified'"/>
3652
- </xsl:call-template>
3693
+
3694
+
3695
+ <xsl:call-template name="getTitle">
3696
+ <xsl:with-param name="name" select="'title-modified'"/>
3697
+ </xsl:call-template>
3698
+
3653
3699
  </xsl:variable>
3700
+
3654
3701
  <xsl:choose>
3655
3702
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3656
3703
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -4433,9 +4480,14 @@
4433
4480
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4434
4481
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
4435
4482
 
4436
- <xsl:call-template name="getTitle">
4437
- <xsl:with-param name="name" select="'title-source'"/>
4438
- </xsl:call-template>
4483
+
4484
+
4485
+
4486
+ <xsl:call-template name="getTitle">
4487
+ <xsl:with-param name="name" select="'title-source'"/>
4488
+ </xsl:call-template>
4489
+
4490
+
4439
4491
  <xsl:text>: </xsl:text>
4440
4492
  </fo:inline>
4441
4493
 
@@ -4585,9 +4637,12 @@
4585
4637
  </fo:block>
4586
4638
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4587
4639
  <xsl:variable name="title-deprecated">
4588
- <xsl:call-template name="getTitle">
4589
- <xsl:with-param name="name" select="'title-deprecated'"/>
4590
- </xsl:call-template>
4640
+
4641
+
4642
+ <xsl:call-template name="getTitle">
4643
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4644
+ </xsl:call-template>
4645
+
4591
4646
  </xsl:variable>
4592
4647
  <fo:block xsl:use-attribute-sets="deprecates-style">
4593
4648
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -5095,13 +5150,22 @@
5095
5150
  </xsl:template><xsl:template name="split">
5096
5151
  <xsl:param name="pText" select="."/>
5097
5152
  <xsl:param name="sep" select="','"/>
5153
+ <xsl:param name="normalize-space" select="'true'"/>
5098
5154
  <xsl:if test="string-length($pText) &gt;0">
5099
5155
  <item>
5100
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5156
+ <xsl:choose>
5157
+ <xsl:when test="$normalize-space = 'true'">
5158
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5159
+ </xsl:when>
5160
+ <xsl:otherwise>
5161
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5162
+ </xsl:otherwise>
5163
+ </xsl:choose>
5101
5164
  </item>
5102
5165
  <xsl:call-template name="split">
5103
5166
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
5104
5167
  <xsl:with-param name="sep" select="$sep"/>
5168
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
5105
5169
  </xsl:call-template>
5106
5170
  </xsl:if>
5107
5171
  </xsl:template><xsl:template name="getDocumentId">
@@ -5167,4 +5231,23 @@
5167
5231
  <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5168
5232
  </xsl:call-template>
5169
5233
  </xsl:if>
5234
+ </xsl:template><xsl:template name="repeat">
5235
+ <xsl:param name="char" select="'*'"/>
5236
+ <xsl:param name="count"/>
5237
+ <xsl:if test="$count &gt; 0">
5238
+ <xsl:value-of select="$char"/>
5239
+ <xsl:call-template name="repeat">
5240
+ <xsl:with-param name="char" select="$char"/>
5241
+ <xsl:with-param name="count" select="$count - 1"/>
5242
+ </xsl:call-template>
5243
+ </xsl:if>
5244
+ </xsl:template><xsl:template name="getLocalizedString">
5245
+ <xsl:param name="key"/>
5246
+
5247
+ <xsl:variable name="curr_lang">
5248
+ <xsl:call-template name="getLang"/>
5249
+ </xsl:variable>
5250
+
5251
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5252
+
5170
5253
  </xsl:template></xsl:stylesheet>