metanorma-ogc 1.2.8 → 1.2.13

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: 6245ace03109e272fe254101d73a9cc5480d88d381c55d74559a947765996927
4
- data.tar.gz: b26cf5092c6612aca2b976587bcca88a6779d8df5a71c65e83c906ca50448f92
3
+ metadata.gz: fd89758a6852f556b8e3396a369e64727dd6555c062804fc29fef131fd646796
4
+ data.tar.gz: 2c73d25ef997c720b536b795ea4f46f17d3cf5f8f3e5367138f9e67ffe99dc5a
5
5
  SHA512:
6
- metadata.gz: 6a043cf809b33c32c3f5fba14a6b626bde3a3a0b17378fc09d5de47d5d3ea1f469b8b2a2e47d4a04ef603b7a9d57a17977e9d37e8f3ff71ec2af7892aa0df20d
7
- data.tar.gz: 3535cca021ddde7151343fb0b281685bcda3e2800256eb2e2f3a60a3508ae11a39c9a57cd866642b4ca31b18692cdcff10b0707fed54caadb8eff61fd4cc8d89
6
+ metadata.gz: 1b9e5efae9844487dc75ddb2b4e234f448c8c1aab778c974b34e24906b91f2abb2f1a612c50211207599c641e2134e0573a0ec8f6c27a7308b5ec9fa3c06caf0
7
+ data.tar.gz: 6374eb0d0cca8771262d11c06cd925429cfc3bfbf1cf9376703abd09eb79399feaba8228c232150b9f32a857e6622d032eae3572f2fa492de396743ec3d3fb5b
@@ -36,6 +36,9 @@ jobs:
36
36
  with:
37
37
  ruby-version: ${{ matrix.ruby }}
38
38
 
39
+ - if: matrix.os == 'macos-latest'
40
+ run: brew install autoconf automake libtool
41
+
39
42
  - uses: actions/cache@v2
40
43
  with:
41
44
  path: vendor/bundle
data/.rubocop.yml CHANGED
@@ -4,7 +4,3 @@
4
4
 
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
- AllCops:
8
- TargetRubyVersion: 2.3
9
- Rails:
10
- Enabled: true
@@ -596,6 +596,7 @@
596
596
  <ref name="bookmark"/>
597
597
  <ref name="image"/>
598
598
  <ref name="index"/>
599
+ <ref name="index-xref"/>
599
600
  </choice>
600
601
  </define>
601
602
  <define name="PureTextElement">
@@ -728,13 +729,61 @@
728
729
  </define>
729
730
  <define name="index">
730
731
  <element name="index">
731
- <attribute name="primary"/>
732
732
  <optional>
733
- <attribute name="secondary"/>
733
+ <attribute name="to">
734
+ <data type="IDREF"/>
735
+ </attribute>
736
+ </optional>
737
+ <element name="primary">
738
+ <oneOrMore>
739
+ <ref name="PureTextElement"/>
740
+ </oneOrMore>
741
+ </element>
742
+ <optional>
743
+ <element name="secondary">
744
+ <oneOrMore>
745
+ <ref name="PureTextElement"/>
746
+ </oneOrMore>
747
+ </element>
748
+ </optional>
749
+ <optional>
750
+ <element name="tertiary">
751
+ <oneOrMore>
752
+ <ref name="PureTextElement"/>
753
+ </oneOrMore>
754
+ </element>
755
+ </optional>
756
+ </element>
757
+ </define>
758
+ <define name="index-xref">
759
+ <element name="index-xref">
760
+ <attribute name="also">
761
+ <data type="boolean"/>
762
+ </attribute>
763
+ <element name="primary">
764
+ <oneOrMore>
765
+ <ref name="PureTextElement"/>
766
+ </oneOrMore>
767
+ </element>
768
+ <optional>
769
+ <element name="secondary">
770
+ <oneOrMore>
771
+ <ref name="PureTextElement"/>
772
+ </oneOrMore>
773
+ </element>
734
774
  </optional>
735
775
  <optional>
736
- <attribute name="tertiary"/>
776
+ <element name="tertiary">
777
+ <oneOrMore>
778
+ <ref name="PureTextElement"/>
779
+ </oneOrMore>
780
+ </element>
737
781
  </optional>
782
+ <element name="target">
783
+ <oneOrMore>
784
+ <ref name="PureTextElement"/>
785
+ </oneOrMore>
786
+ </element>
738
787
  </element>
739
788
  </define>
740
789
  <!-- bare ID element, used for referencing arbitrary spans of text -->
@@ -87,19 +87,19 @@ module Asciidoctor
87
87
  end
88
88
 
89
89
  def insert_security(x, s)
90
- preface = s.at("//preface") ||
91
- s.add_previous_sibling("<preface/>").first
90
+ doctype = s&.at("//bibdata/ext/doctype")&.text
91
+ description = %w(standard community-standard).include?(doctype) ? "standard" : "document"
92
+ preface = s.at("//preface") || s.add_previous_sibling("<preface/>").first
92
93
  s = x&.at("//clause[@type = 'security']")&.remove ||
93
94
  "<clause type='security' #{add_id}>"\
94
95
  "<title>Security Considerations</title>"\
95
- "<p>#{@i18n.security_empty}</p></clause>"
96
+ "<p>#{@i18n.security_empty.sub(/%/, description)}</p></clause>"
96
97
  preface.add_child s
97
98
  end
98
99
 
99
100
  def insert_submitters(x, s)
100
101
  if x.at("//submitters")
101
- preface = s.at("//preface") ||
102
- s.add_previous_sibling("<preface/>").first
102
+ preface = s.at("//preface") || s.add_previous_sibling("<preface/>").first
103
103
  submitters = x.at("//submitters").remove
104
104
  preface.add_child submitters.remove
105
105
  end
@@ -127,7 +127,6 @@ module Asciidoctor
127
127
  end
128
128
 
129
129
  def termdef_boilerplate_cleanup(xmldoc)
130
- return
131
130
  end
132
131
 
133
132
  def bibdata_cleanup(xmldoc)
@@ -55,6 +55,13 @@
55
55
  <param name="pattern">\i\c*|\c+#\c+</param>
56
56
  </data>
57
57
  </attribute>
58
+ <optional>
59
+ <attribute name="to">
60
+ <data type="string">
61
+ <param name="pattern">\i\c*|\c+#\c+</param>
62
+ </data>
63
+ </attribute>
64
+ </optional>
58
65
  <optional>
59
66
  <attribute name="type">
60
67
  <ref name="ReferenceFormat"/>
@@ -246,6 +253,12 @@
246
253
  <data type="boolean"/>
247
254
  </attribute>
248
255
  </optional>
256
+ <optional>
257
+ <attribute name="width"/>
258
+ </optional>
259
+ <optional>
260
+ <ref name="colgroup"/>
261
+ </optional>
249
262
  <optional>
250
263
  <ref name="tname"/>
251
264
  </optional>
@@ -764,6 +777,21 @@
764
777
  </define>
765
778
  </include>
766
779
  <!-- end overrides -->
780
+ <define name="colgroup">
781
+ <element name="colgroup">
782
+ <oneOrMore>
783
+ <ref name="col"/>
784
+ </oneOrMore>
785
+ </element>
786
+ </define>
787
+ <define name="col">
788
+ <element name="col">
789
+ <attribute name="width"/>
790
+ </element>
791
+ </define>
792
+ <define name="BibItemType" combine="choice">
793
+ <value>internal</value>
794
+ </define>
767
795
  <define name="TextElement" combine="choice">
768
796
  <ref name="concept"/>
769
797
  </define>
@@ -784,6 +812,8 @@
784
812
  <ref name="requirement"/>
785
813
  <ref name="recommendation"/>
786
814
  <ref name="permission"/>
815
+ <ref name="imagemap"/>
816
+ <ref name="svgmap"/>
787
817
  </choice>
788
818
  </define>
789
819
  <define name="bibliography">
@@ -814,6 +844,9 @@
814
844
  <data type="boolean"/>
815
845
  </attribute>
816
846
  </optional>
847
+ <optional>
848
+ <attribute name="number"/>
849
+ </optional>
817
850
  <optional>
818
851
  <attribute name="obligation">
819
852
  <choice>
@@ -869,9 +902,11 @@
869
902
  <element name="code">
870
903
  <text/>
871
904
  </element>
872
- <element name="text">
873
- <text/>
874
- </element>
905
+ <optional>
906
+ <element name="text">
907
+ <text/>
908
+ </element>
909
+ </optional>
875
910
  </element>
876
911
  </define>
877
912
  <define name="standard-document">
@@ -1041,6 +1076,9 @@
1041
1076
  </choice>
1042
1077
  </attribute>
1043
1078
  </optional>
1079
+ <optional>
1080
+ <attribute name="number"/>
1081
+ </optional>
1044
1082
  <optional>
1045
1083
  <attribute name="type"/>
1046
1084
  </optional>
@@ -1094,6 +1132,9 @@
1094
1132
  <optional>
1095
1133
  <attribute name="type"/>
1096
1134
  </optional>
1135
+ <optional>
1136
+ <attribute name="number"/>
1137
+ </optional>
1097
1138
  <optional>
1098
1139
  <ref name="section-title"/>
1099
1140
  </optional>
@@ -1196,6 +1237,9 @@
1196
1237
  <optional>
1197
1238
  <attribute name="type"/>
1198
1239
  </optional>
1240
+ <optional>
1241
+ <attribute name="number"/>
1242
+ </optional>
1199
1243
  <optional>
1200
1244
  <attribute name="obligation">
1201
1245
  <choice>
@@ -1524,6 +1568,7 @@
1524
1568
  <value>add</value>
1525
1569
  <value>modify</value>
1526
1570
  <value>delete</value>
1571
+ <value>replace</value>
1527
1572
  </choice>
1528
1573
  </attribute>
1529
1574
  <optional>
@@ -1554,6 +1599,11 @@
1554
1599
  </optional>
1555
1600
  <optional>
1556
1601
  <element name="newcontent">
1602
+ <optional>
1603
+ <attribute name="id">
1604
+ <data type="ID"/>
1605
+ </attribute>
1606
+ </optional>
1557
1607
  <zeroOrMore>
1558
1608
  <ref name="BasicBlock"/>
1559
1609
  </zeroOrMore>
@@ -1587,4 +1637,65 @@
1587
1637
  <text/>
1588
1638
  </element>
1589
1639
  </define>
1640
+ <define name="imagemap">
1641
+ <element name="imagemap">
1642
+ <ref name="figure"/>
1643
+ <zeroOrMore>
1644
+ <element name="area">
1645
+ <attribute name="type">
1646
+ <choice>
1647
+ <value>rect</value>
1648
+ <value>circle</value>
1649
+ <value>ellipse</value>
1650
+ <value>poly</value>
1651
+ </choice>
1652
+ </attribute>
1653
+ <choice>
1654
+ <ref name="xref"/>
1655
+ <ref name="hyperlink"/>
1656
+ <ref name="eref"/>
1657
+ </choice>
1658
+ <oneOrMore>
1659
+ <element name="coords">
1660
+ <attribute name="x">
1661
+ <data type="float"/>
1662
+ </attribute>
1663
+ <attribute name="y">
1664
+ <data type="float"/>
1665
+ </attribute>
1666
+ </element>
1667
+ </oneOrMore>
1668
+ <optional>
1669
+ <element name="radius">
1670
+ <attribute name="x">
1671
+ <data type="float"/>
1672
+ </attribute>
1673
+ <optional>
1674
+ <attribute name="y">
1675
+ <data type="float"/>
1676
+ </attribute>
1677
+ </optional>
1678
+ </element>
1679
+ </optional>
1680
+ </element>
1681
+ </zeroOrMore>
1682
+ </element>
1683
+ </define>
1684
+ <define name="svgmap">
1685
+ <element name="svgmap">
1686
+ <ref name="figure"/>
1687
+ <zeroOrMore>
1688
+ <element name="target">
1689
+ <attribute name="href">
1690
+ <data type="anyURI"/>
1691
+ </attribute>
1692
+ <choice>
1693
+ <ref name="xref"/>
1694
+ <ref name="hyperlink"/>
1695
+ <ref name="eref"/>
1696
+ </choice>
1697
+ </element>
1698
+ </zeroOrMore>
1699
+ </element>
1700
+ </define>
1590
1701
  </grammar>
@@ -35,7 +35,7 @@ module IsoDoc
35
35
  end
36
36
  end
37
37
 
38
- def middle_clause
38
+ def middle_clause(_docxml)
39
39
  "//clause[parent::sections][not(@type = 'scope' or "\
40
40
  "@type = 'conformance')][not(descendant::terms)]"
41
41
  end
@@ -46,7 +46,7 @@ module IsoDoc
46
46
  end
47
47
 
48
48
  def middle(isoxml, out)
49
- middle_title(out)
49
+ middle_title(isoxml, out)
50
50
  middle_admonitions(isoxml, out)
51
51
  i = scope isoxml, out, 0
52
52
  i = conformance isoxml, out, i
@@ -18,8 +18,8 @@ module IsoDoc
18
18
 
19
19
  def default_fonts(options)
20
20
  {
21
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
22
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
21
+ bodyfont: '"Overpass",sans-serif',
22
+ headerfont: '"Overpass",sans-serif',
23
23
  monospacefont: '"Space Mono",monospace',
24
24
  normalfontsize: "16px",
25
25
  monospacefontsize: "0.8em",
@@ -9,7 +9,7 @@ permissionclass: Permission Class
9
9
  abstracttest: Abstract Test
10
10
  conformanceclass: Conformance Class
11
11
  example: Example
12
- security_empty: No security considerations have been made for this standard.
12
+ security_empty: No security considerations have been made for this %.
13
13
  stage_dict:
14
14
  swg-draft: Candidate SWG Draft
15
15
  oab-review: Candidate OAB Review Draft
@@ -118,14 +118,14 @@
118
118
  <fo:flow flow-name="xsl-region-body" color="white">
119
119
 
120
120
  <!-- background image -->
121
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm">
121
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0">
122
122
  <fo:block>
123
123
  <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Cover-Background))}" width="{$pageWidth}" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
124
124
  </fo:block>
125
125
  </fo:block-container>
126
126
 
127
127
  <!-- background color -->
128
- <fo:block-container absolute-position="fixed" left="0" top="0">
128
+ <fo:block-container absolute-position="fixed" left="0" top="0" font-size="0">
129
129
  <fo:block>
130
130
  <fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
131
131
  <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="215.9mm" height="279.4mm">
@@ -268,7 +268,7 @@
268
268
  </xsl:if>
269
269
 
270
270
  <!-- crossing lines -->
271
- <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}">
271
+ <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
272
272
  <fo:block>
273
273
  <fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
274
274
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
@@ -301,7 +301,7 @@
301
301
  <fo:flow flow-name="xsl-region-body">
302
302
 
303
303
  <!-- crossing lines -->
304
- <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}">
304
+ <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
305
305
  <fo:block>
306
306
  <fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
307
307
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
@@ -595,7 +595,7 @@
595
595
  </xsl:call-template>
596
596
  <fo:flow flow-name="xsl-region-body">
597
597
  <!-- background color -->
598
- <fo:block-container absolute-position="fixed" left="0" top="0">
598
+ <fo:block-container absolute-position="fixed" left="0" top="0" font-size="0">
599
599
  <fo:block>
600
600
  <fo:instream-foreign-object content-height="{$pageHeight}" fox:alt-text="Background color">
601
601
  <svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="{$pageWidth}" height="{$pageHeight}">
@@ -1069,13 +1069,13 @@
1069
1069
  <xsl:otherwise> <!-- for ordered lists -->
1070
1070
  <xsl:choose>
1071
1071
  <xsl:when test="../@type = 'arabic'">
1072
- <xsl:number format="a)"/>
1072
+ <xsl:number format="a)" lang="en"/>
1073
1073
  </xsl:when>
1074
1074
  <xsl:when test="../@type = 'alphabet'">
1075
1075
  <xsl:number format="1)"/>
1076
1076
  </xsl:when>
1077
1077
  <xsl:when test="../@type = 'alphabet_upper'">
1078
- <xsl:number format="A)"/>
1078
+ <xsl:number format="A)" lang="en"/>
1079
1079
  </xsl:when>
1080
1080
 
1081
1081
  <xsl:when test="../@type = 'roman'">
@@ -1328,7 +1328,7 @@
1328
1328
  <xsl:variable name="sectionNum">
1329
1329
  <xsl:choose>
1330
1330
  <xsl:when test="normalize-space($sectionNum_) = '' and local-name() = 'annex'">
1331
- <xsl:number format="A" count="ogc:annex"/>
1331
+ <xsl:number format="A" count="ogc:annex" lang="en"/>
1332
1332
  </xsl:when>
1333
1333
  <xsl:otherwise>
1334
1334
  <xsl:value-of select="$sectionNum_"/>
@@ -1351,7 +1351,7 @@
1351
1351
  </xsl:template>
1352
1352
 
1353
1353
  <xsl:template name="insertCrossingLines">
1354
- <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}">
1354
+ <fo:block-container absolute-position="fixed" width="{$pageWidth}" height="{$pageHeight}" font-size="0">
1355
1355
  <fo:block>
1356
1356
  <fo:instream-foreign-object content-height="{$pageHeight}" content-width="{$pageWidth}" fox:alt-text="Crossing lines">
1357
1357
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 2159 2794" width="{$pageWidth}" height="{$pageHeight}">
@@ -1887,6 +1887,7 @@
1887
1887
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1888
1888
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
1889
1889
 
1890
+
1890
1891
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1891
1892
 
1892
1893
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1898,6 +1899,7 @@
1898
1899
 
1899
1900
 
1900
1901
 
1902
+
1901
1903
  </xsl:attribute-set><xsl:attribute-set name="quote-source-style">
1902
1904
 
1903
1905
  <xsl:attribute name="text-align">right</xsl:attribute>
@@ -2038,7 +2040,7 @@
2038
2040
  </xsl:template><xsl:template match="*[local-name()='td']//text() | *[local-name()='th']//text() | *[local-name()='dt']//text() | *[local-name()='dd']//text()" priority="1">
2039
2041
  <!-- <xsl:call-template name="add-zero-spaces"/> -->
2040
2042
  <xsl:call-template name="add-zero-spaces-java"/>
2041
- </xsl:template><xsl:template match="*[local-name()='table']">
2043
+ </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2042
2044
 
2043
2045
  <xsl:variable name="simple-table">
2044
2046
  <xsl:call-template name="getSimpleTable"/>
@@ -2086,10 +2088,12 @@
2086
2088
 
2087
2089
 
2088
2090
  <xsl:variable name="colwidths">
2089
- <xsl:call-template name="calculate-column-widths">
2090
- <xsl:with-param name="cols-count" select="$cols-count"/>
2091
- <xsl:with-param name="table" select="$simple-table"/>
2092
- </xsl:call-template>
2091
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2092
+ <xsl:call-template name="calculate-column-widths">
2093
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2094
+ <xsl:with-param name="table" select="$simple-table"/>
2095
+ </xsl:call-template>
2096
+ </xsl:if>
2093
2097
  </xsl:variable>
2094
2098
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2095
2099
 
@@ -2136,7 +2140,12 @@
2136
2140
 
2137
2141
  <xsl:variable name="table_attributes">
2138
2142
  <attribute name="table-layout">fixed</attribute>
2139
- <attribute name="width">100%</attribute>
2143
+ <attribute name="width">
2144
+ <xsl:choose>
2145
+ <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
2146
+ <xsl:otherwise>100%</xsl:otherwise>
2147
+ </xsl:choose>
2148
+ </attribute>
2140
2149
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2141
2150
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2142
2151
 
@@ -2168,16 +2177,25 @@
2168
2177
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2169
2178
  </xsl:if>
2170
2179
 
2171
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2172
- <xsl:choose>
2173
- <xsl:when test=". = 1 or . = 0">
2174
- <fo:table-column column-width="proportional-column-width(2)"/>
2175
- </xsl:when>
2176
- <xsl:otherwise>
2177
- <fo:table-column column-width="proportional-column-width({.})"/>
2178
- </xsl:otherwise>
2179
- </xsl:choose>
2180
- </xsl:for-each>
2180
+ <xsl:choose>
2181
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2182
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2183
+ <fo:table-column column-width="{@width}"/>
2184
+ </xsl:for-each>
2185
+ </xsl:when>
2186
+ <xsl:otherwise>
2187
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2188
+ <xsl:choose>
2189
+ <xsl:when test=". = 1 or . = 0">
2190
+ <fo:table-column column-width="proportional-column-width(2)"/>
2191
+ </xsl:when>
2192
+ <xsl:otherwise>
2193
+ <fo:table-column column-width="proportional-column-width({.})"/>
2194
+ </xsl:otherwise>
2195
+ </xsl:choose>
2196
+ </xsl:for-each>
2197
+ </xsl:otherwise>
2198
+ </xsl:choose>
2181
2199
 
2182
2200
  <xsl:choose>
2183
2201
  <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
@@ -2190,10 +2208,12 @@
2190
2208
 
2191
2209
  </fo:table>
2192
2210
 
2211
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2193
2212
  <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2194
2213
  <xsl:call-template name="insertTableFooterInSeparateTable">
2195
2214
  <xsl:with-param name="table_attributes" select="$table_attributes"/>
2196
2215
  <xsl:with-param name="colwidths" select="$colwidths"/>
2216
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2197
2217
  </xsl:call-template>
2198
2218
  </xsl:for-each>
2199
2219
 
@@ -2449,12 +2469,22 @@
2449
2469
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2450
2470
  <xsl:param name="table_attributes"/>
2451
2471
  <xsl:param name="colwidths"/>
2472
+ <xsl:param name="colgroup"/>
2452
2473
 
2453
2474
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2454
2475
 
2455
2476
  <xsl:if test="$isNoteOrFnExist = 'true'">
2456
2477
 
2457
- <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
2478
+ <xsl:variable name="cols-count">
2479
+ <xsl:choose>
2480
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2481
+ <xsl:value-of select="count(xalan:nodeset($colgroup)//*[local-name()='col'])"/>
2482
+ </xsl:when>
2483
+ <xsl:otherwise>
2484
+ <xsl:value-of select="count(xalan:nodeset($colwidths)//column)"/>
2485
+ </xsl:otherwise>
2486
+ </xsl:choose>
2487
+ </xsl:variable>
2458
2488
 
2459
2489
  <fo:table keep-with-previous="always">
2460
2490
  <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
@@ -2472,16 +2502,25 @@
2472
2502
  </xsl:choose>
2473
2503
  </xsl:for-each>
2474
2504
 
2475
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2476
- <xsl:choose>
2477
- <xsl:when test=". = 1 or . = 0">
2478
- <fo:table-column column-width="proportional-column-width(2)"/>
2479
- </xsl:when>
2480
- <xsl:otherwise>
2481
- <fo:table-column column-width="proportional-column-width({.})"/>
2482
- </xsl:otherwise>
2483
- </xsl:choose>
2484
- </xsl:for-each>
2505
+ <xsl:choose>
2506
+ <xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
2507
+ <xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
2508
+ <fo:table-column column-width="{@width}"/>
2509
+ </xsl:for-each>
2510
+ </xsl:when>
2511
+ <xsl:otherwise>
2512
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2513
+ <xsl:choose>
2514
+ <xsl:when test=". = 1 or . = 0">
2515
+ <fo:table-column column-width="proportional-column-width(2)"/>
2516
+ </xsl:when>
2517
+ <xsl:otherwise>
2518
+ <fo:table-column column-width="proportional-column-width({.})"/>
2519
+ </xsl:otherwise>
2520
+ </xsl:choose>
2521
+ </xsl:for-each>
2522
+ </xsl:otherwise>
2523
+ </xsl:choose>
2485
2524
 
2486
2525
  <fo:table-body>
2487
2526
  <fo:table-row>
@@ -2914,7 +2953,9 @@
2914
2953
  </xsl:template><xsl:template match="*[local-name()='dl']">
2915
2954
  <fo:block-container>
2916
2955
 
2917
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2956
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2957
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2958
+ </xsl:if>
2918
2959
 
2919
2960
 
2920
2961
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -2929,6 +2970,7 @@
2929
2970
  <fo:block-container>
2930
2971
 
2931
2972
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
2973
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2932
2974
 
2933
2975
 
2934
2976
  <xsl:variable name="parent" select="local-name(..)"/>
@@ -3112,12 +3154,32 @@
3112
3154
  </xsl:otherwise>
3113
3155
  </xsl:choose>
3114
3156
  </xsl:template><xsl:template name="getMaxLength_dt">
3115
- <xsl:for-each select="*[local-name()='dt']">
3116
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3117
- <xsl:if test="position() = 1">
3118
- <xsl:value-of select="string-length(normalize-space(.))"/>
3119
- </xsl:if>
3120
- </xsl:for-each>
3157
+ <xsl:variable name="lengths">
3158
+ <xsl:for-each select="*[local-name()='dt']">
3159
+ <xsl:variable name="maintext_length" select="string-length(normalize-space(.))"/>
3160
+ <xsl:variable name="attributes">
3161
+ <xsl:for-each select=".//@open"><xsl:value-of select="."/></xsl:for-each>
3162
+ <xsl:for-each select=".//@close"><xsl:value-of select="."/></xsl:for-each>
3163
+ </xsl:variable>
3164
+ <length><xsl:value-of select="string-length(normalize-space(.)) + string-length($attributes)"/></length>
3165
+ </xsl:for-each>
3166
+ </xsl:variable>
3167
+ <xsl:variable name="maxLength">
3168
+ <!-- <xsl:for-each select="*[local-name()='dt']">
3169
+ <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
3170
+ <xsl:if test="position() = 1">
3171
+ <xsl:value-of select="string-length(normalize-space(.))"/>
3172
+ </xsl:if>
3173
+ </xsl:for-each> -->
3174
+ <xsl:for-each select="xalan:nodeset($lengths)/length">
3175
+ <xsl:sort select="." data-type="number" order="descending"/>
3176
+ <xsl:if test="position() = 1">
3177
+ <xsl:value-of select="."/>
3178
+ </xsl:if>
3179
+ </xsl:for-each>
3180
+ </xsl:variable>
3181
+ <!-- <xsl:message>DEBUG:<xsl:value-of select="$maxLength"/></xsl:message> -->
3182
+ <xsl:value-of select="$maxLength"/>
3121
3183
  </xsl:template><xsl:template match="*[local-name()='dl']/*[local-name()='note']" priority="2">
3122
3184
  <xsl:param name="key_iso"/>
3123
3185
 
@@ -3258,6 +3320,7 @@
3258
3320
 
3259
3321
 
3260
3322
 
3323
+
3261
3324
  10
3262
3325
 
3263
3326
 
@@ -3274,6 +3337,10 @@
3274
3337
  </xsl:if>
3275
3338
  <xsl:apply-templates/>
3276
3339
  </fo:inline>
3340
+ </xsl:template><xsl:template match="*[local-name()='underline']">
3341
+ <fo:inline text-decoration="underline">
3342
+ <xsl:apply-templates/>
3343
+ </fo:inline>
3277
3344
  </xsl:template><xsl:template match="*[local-name()='del']">
3278
3345
  <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3279
3346
  <xsl:apply-templates/>
@@ -3858,7 +3925,7 @@
3858
3925
  </xsl:if> -->
3859
3926
  </fo:inline>
3860
3927
  </xsl:if>
3861
- </xsl:template><xsl:template match="*[local-name() = 'figure']">
3928
+ </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
3862
3929
  <fo:block-container id="{@id}">
3863
3930
 
3864
3931
  <fo:block>
@@ -3927,6 +3994,8 @@
3927
3994
  <xsl:variable name="bookmark-title_">
3928
3995
  <xsl:call-template name="getLangVersion">
3929
3996
  <xsl:with-param name="lang" select="@lang"/>
3997
+ <xsl:with-param name="doctype" select="@doctype"/>
3998
+ <xsl:with-param name="title" select="@title-part"/>
3930
3999
  </xsl:call-template>
3931
4000
  </xsl:variable>
3932
4001
  <xsl:choose>
@@ -3944,13 +4013,34 @@
3944
4013
  </xsl:choose>
3945
4014
  </fo:bookmark-title>
3946
4015
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4016
+
4017
+ <xsl:call-template name="insertFigureBookmarks">
4018
+ <xsl:with-param name="contents" select="contents"/>
4019
+ </xsl:call-template>
4020
+
4021
+ <xsl:call-template name="insertTableBookmarks">
4022
+ <xsl:with-param name="contents" select="contents"/>
4023
+ <xsl:with-param name="lang" select="@lang"/>
4024
+ </xsl:call-template>
4025
+
3947
4026
  </fo:bookmark>
3948
4027
 
3949
4028
  </xsl:for-each>
3950
4029
  </xsl:when>
3951
4030
  <xsl:otherwise>
3952
4031
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4032
+
3953
4033
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4034
+
4035
+ <xsl:call-template name="insertFigureBookmarks">
4036
+ <xsl:with-param name="contents" select="contents"/>
4037
+ </xsl:call-template>
4038
+
4039
+ <xsl:call-template name="insertTableBookmarks">
4040
+ <xsl:with-param name="contents" select="contents"/>
4041
+ <xsl:with-param name="lang" select="@lang"/>
4042
+ </xsl:call-template>
4043
+
3954
4044
  </xsl:for-each>
3955
4045
  </xsl:otherwise>
3956
4046
  </xsl:choose>
@@ -4012,8 +4102,44 @@
4012
4102
 
4013
4103
  </fo:bookmark-tree>
4014
4104
  </xsl:if>
4105
+ </xsl:template><xsl:template name="insertFigureBookmarks">
4106
+ <xsl:param name="contents"/>
4107
+ <xsl:if test="xalan:nodeset($contents)/figure">
4108
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
4109
+ <fo:bookmark-title>Figures</fo:bookmark-title>
4110
+ <xsl:for-each select="xalan:nodeset($contents)/figure">
4111
+ <fo:bookmark internal-destination="{@id}">
4112
+ <fo:bookmark-title>
4113
+ <xsl:value-of select="normalize-space(title)"/>
4114
+ </fo:bookmark-title>
4115
+ </fo:bookmark>
4116
+ </xsl:for-each>
4117
+ </fo:bookmark>
4118
+ </xsl:if>
4119
+ </xsl:template><xsl:template name="insertTableBookmarks">
4120
+ <xsl:param name="contents"/>
4121
+ <xsl:param name="lang"/>
4122
+ <xsl:if test="xalan:nodeset($contents)/table">
4123
+ <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
4124
+ <fo:bookmark-title>
4125
+ <xsl:choose>
4126
+ <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
4127
+ <xsl:otherwise>Tables</xsl:otherwise>
4128
+ </xsl:choose>
4129
+ </fo:bookmark-title>
4130
+ <xsl:for-each select="xalan:nodeset($contents)/table">
4131
+ <fo:bookmark internal-destination="{@id}">
4132
+ <fo:bookmark-title>
4133
+ <xsl:value-of select="normalize-space(title)"/>
4134
+ </fo:bookmark-title>
4135
+ </fo:bookmark>
4136
+ </xsl:for-each>
4137
+ </fo:bookmark>
4138
+ </xsl:if>
4015
4139
  </xsl:template><xsl:template name="getLangVersion">
4016
4140
  <xsl:param name="lang"/>
4141
+ <xsl:param name="doctype" select="''"/>
4142
+ <xsl:param name="title" select="''"/>
4017
4143
  <xsl:choose>
4018
4144
  <xsl:when test="$lang = 'en'">
4019
4145
 
@@ -4049,6 +4175,12 @@
4049
4175
  <!-- <xsl:text> </xsl:text> -->
4050
4176
  </xsl:template><xsl:template name="getSection">
4051
4177
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4178
+ <!--
4179
+ <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
4180
+ <xsl:value-of select="."/>
4181
+ </xsl:for-each>
4182
+ -->
4183
+
4052
4184
  </xsl:template><xsl:template name="getName">
4053
4185
  <xsl:choose>
4054
4186
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -4101,6 +4233,10 @@
4101
4233
  <xsl:copy>
4102
4234
  <xsl:apply-templates mode="contents_item"/>
4103
4235
  </xsl:copy>
4236
+ </xsl:template><xsl:template match="*[local-name() = 'em']" mode="contents_item">
4237
+ <xsl:copy>
4238
+ <xsl:apply-templates mode="contents_item"/>
4239
+ </xsl:copy>
4104
4240
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4105
4241
  <xsl:text> </xsl:text>
4106
4242
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -4126,6 +4262,7 @@
4126
4262
 
4127
4263
 
4128
4264
 
4265
+
4129
4266
 
4130
4267
 
4131
4268
 
@@ -4516,7 +4653,8 @@
4516
4653
  <fo:block-container margin-left="0mm">
4517
4654
 
4518
4655
  <fo:block xsl:use-attribute-sets="quote-style">
4519
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4656
+ <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4657
+ <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4520
4658
  </fo:block>
4521
4659
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4522
4660
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -4668,6 +4806,7 @@
4668
4806
 
4669
4807
 
4670
4808
 
4809
+
4671
4810
 
4672
4811
 
4673
4812
 
@@ -4684,7 +4823,7 @@
4684
4823
 
4685
4824
 
4686
4825
 
4687
- </xsl:template><xsl:template match="/*/*[local-name() = 'preface']/*" priority="2">
4826
+ </xsl:template><xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
4688
4827
  <fo:block break-after="page"/>
4689
4828
  <fo:block>
4690
4829
  <xsl:call-template name="setId"/>
@@ -4692,7 +4831,8 @@
4692
4831
  </fo:block>
4693
4832
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
4694
4833
  <fo:block>
4695
- <xsl:call-template name="setId"/>
4834
+ <xsl:call-template name="setId"/>
4835
+
4696
4836
 
4697
4837
  <xsl:apply-templates/>
4698
4838
  </fo:block>
@@ -4757,7 +4897,8 @@
4757
4897
  <fo:table-column column-width="107mm"/>
4758
4898
  <fo:table-column column-width="15mm"/>
4759
4899
  <fo:table-body>
4760
- <fo:table-row font-family="Arial" text-align="center" font-weight="bold" background-color="black" color="white">
4900
+ <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
4901
+
4761
4902
  <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
4762
4903
  <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
4763
4904
  <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
@@ -4776,6 +4917,10 @@
4776
4917
  </fo:table-cell>
4777
4918
  </xsl:template><xsl:template name="processBibitem">
4778
4919
 
4920
+
4921
+ <!-- end BIPM bibitem processing-->
4922
+
4923
+
4779
4924
  <!-- start OGC bibtem processing -->
4780
4925
  <xsl:choose>
4781
4926
  <xsl:when test="*[local-name() = 'formattedref']">
@@ -4975,6 +5120,8 @@
4975
5120
  <xsl:value-of select="translate(.,'. ','')"/>
4976
5121
  </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4977
5122
  <xsl:value-of select="substring(.,1,1)"/>
5123
+ </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5124
+ <fo:inline><xsl:apply-templates/></fo:inline>
4978
5125
  </xsl:template><xsl:template name="convertDate">
4979
5126
  <xsl:param name="date"/>
4980
5127
  <xsl:param name="format" select="'short'"/>
@@ -4999,6 +5146,57 @@
4999
5146
  </xsl:variable>
5000
5147
  <xsl:variable name="result">
5001
5148
  <xsl:choose>
5149
+ <xsl:when test="$format = 'ddMMyyyy'">
5150
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5151
+ <xsl:text> </xsl:text>
5152
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5153
+ </xsl:when>
5154
+ <xsl:when test="$format = 'ddMM'">
5155
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5156
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5157
+ </xsl:when>
5158
+ <xsl:when test="$format = 'short' or $day = ''">
5159
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5160
+ </xsl:when>
5161
+ <xsl:otherwise>
5162
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
5163
+ </xsl:otherwise>
5164
+ </xsl:choose>
5165
+ </xsl:variable>
5166
+ <xsl:value-of select="$result"/>
5167
+ </xsl:template><xsl:template name="convertDateLocalized">
5168
+ <xsl:param name="date"/>
5169
+ <xsl:param name="format" select="'short'"/>
5170
+ <xsl:variable name="year" select="substring($date, 1, 4)"/>
5171
+ <xsl:variable name="month" select="substring($date, 6, 2)"/>
5172
+ <xsl:variable name="day" select="substring($date, 9, 2)"/>
5173
+ <xsl:variable name="monthStr">
5174
+ <xsl:choose>
5175
+ <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
5176
+ <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
5177
+ <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
5178
+ <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
5179
+ <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
5180
+ <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
5181
+ <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
5182
+ <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
5183
+ <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
5184
+ <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
5185
+ <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
5186
+ <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
5187
+ </xsl:choose>
5188
+ </xsl:variable>
5189
+ <xsl:variable name="result">
5190
+ <xsl:choose>
5191
+ <xsl:when test="$format = 'ddMMyyyy'">
5192
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5193
+ <xsl:text> </xsl:text>
5194
+ <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5195
+ </xsl:when>
5196
+ <xsl:when test="$format = 'ddMM'">
5197
+ <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5198
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5199
+ </xsl:when>
5002
5200
  <xsl:when test="$format = 'short' or $day = ''">
5003
5201
  <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5004
5202
  </xsl:when>
@@ -5193,6 +5391,7 @@
5193
5391
 
5194
5392
 
5195
5393
 
5394
+
5196
5395
  </xsl:variable>
5197
5396
  <xsl:if test="$documentNS != $XSLNS">
5198
5397
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -5252,6 +5451,11 @@
5252
5451
  <xsl:call-template name="getLang"/>
5253
5452
  </xsl:variable>
5254
5453
 
5255
- <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5454
+ <xsl:choose>
5455
+ <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5456
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5457
+ </xsl:when>
5458
+ <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5459
+ </xsl:choose>
5256
5460
 
5257
5461
  </xsl:template></xsl:stylesheet>