metanorma-ogc 2.2.4 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -4192,8 +4192,10 @@
4192
4192
 
4193
4193
  <!-- 10 -->
4194
4194
 
4195
- 9.5
4196
-
4195
+ <xsl:choose>
4196
+ <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
4197
+ <xsl:otherwise>9.5</xsl:otherwise>
4198
+ </xsl:choose>
4197
4199
 
4198
4200
  </xsl:variable>
4199
4201
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -4211,8 +4213,17 @@
4211
4213
  </fo:inline>
4212
4214
  </xsl:template> <!-- tt -->
4213
4215
 
4216
+ <xsl:variable name="regex_url_start">^(http://|https://|www\.)?(.*)</xsl:variable>
4214
4217
  <xsl:template match="*[local-name()='tt']/text()" priority="2">
4215
- <xsl:call-template name="add_spaces_to_sourcecode"/>
4218
+ <xsl:choose>
4219
+ <xsl:when test="java:replaceAll(java:java.lang.String.new(.), '$2', '') != ''">
4220
+ <!-- url -->
4221
+ <xsl:call-template name="add-zero-spaces-link-java"/>
4222
+ </xsl:when>
4223
+ <xsl:otherwise>
4224
+ <xsl:call-template name="add_spaces_to_sourcecode"/>
4225
+ </xsl:otherwise>
4226
+ </xsl:choose>
4216
4227
  </xsl:template>
4217
4228
 
4218
4229
  <xsl:template match="*[local-name()='underline']">
@@ -4568,8 +4579,11 @@
4568
4579
 
4569
4580
  <xsl:template name="add-zero-spaces-link-java">
4570
4581
  <xsl:param name="text" select="."/>
4582
+
4583
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
4584
+ <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
4571
4585
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4572
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
4586
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
4573
4587
  </xsl:template>
4574
4588
 
4575
4589
  <!-- add zero space after dash character (for table's entries) -->
@@ -6650,8 +6664,10 @@
6650
6664
  <xsl:if test="$current_template = 'standard'">8</xsl:if>
6651
6665
  </xsl:if> -->
6652
6666
 
6653
- 9.5
6654
-
6667
+ <xsl:choose>
6668
+ <xsl:when test="ancestor::*[local-name() = 'table']">8.5</xsl:when>
6669
+ <xsl:otherwise>9.5</xsl:otherwise>
6670
+ </xsl:choose>
6655
6671
 
6656
6672
  </xsl:variable>
6657
6673
 
@@ -7190,7 +7206,8 @@
7190
7206
  <xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
7191
7207
  <fo:block font-size="11pt">
7192
7208
 
7193
- <xsl:attribute name="color"><xsl:value-of select="$color_design"/></xsl:attribute>
7209
+ <!-- <xsl:attribute name="color"><xsl:value-of select="$color_design"/></xsl:attribute> -->
7210
+ <xsl:attribute name="color">white</xsl:attribute>
7194
7211
 
7195
7212
  <xsl:apply-templates/>
7196
7213
  </fo:block>
@@ -9003,7 +9020,7 @@
9003
9020
 
9004
9021
  <xsl:variable name="element_name_keep-together_within-line">keep-together_within-line</xsl:variable>
9005
9022
 
9006
- <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'])]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
9023
+ <xsl:template match="text()[not(ancestor::*[local-name() = 'bibdata'] or ancestor::*[local-name() = 'link'][not(contains(.,' '))] or ancestor::*[local-name() = 'sourcecode'] or ancestor::*[local-name() = 'math'] or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
9007
9024
 
9008
9025
  <!-- enclose standard's number into tag 'keep-together_within-line' -->
9009
9026
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
@@ -6,17 +6,17 @@ module IsoDoc
6
6
  class Xref < IsoDoc::Xref
7
7
  def initial_anchor_names(doc)
8
8
  if @parse_settings.empty? || @parse_settings[:clauses]
9
- preface_anchor_names(doc)
10
- n = Counter.new
11
- n = section_names(doc.at(ns("//clause[@type = 'scope']")), n, 1)
12
- n = section_names(doc.at(ns("//clause[@type = 'conformance']")), n, 1)
13
- n = section_names(doc.at(ns(@klass.norm_ref_xpath)), n, 1)
14
- n = section_names(
15
- doc.at(ns("//sections/terms | //sections/clause[descendant::terms]")),
16
- n, 1
17
- )
18
- n = section_names(doc.at(ns("//sections/definitions")), n, 1)
19
- clause_names(doc, n)
9
+ preface_anchor_names(doc)
10
+ n = Counter.new
11
+ n = section_names(doc.at(ns("//clause[@type = 'scope']")), n, 1)
12
+ n = section_names(doc.at(ns("//clause[@type = 'conformance']")), n, 1)
13
+ n = section_names(doc.at(ns(@klass.norm_ref_xpath)), n, 1)
14
+ n = section_names(
15
+ doc.at(ns("//sections/terms | //sections/clause[descendant::terms]")),
16
+ n, 1
17
+ )
18
+ n = section_names(doc.at(ns("//sections/definitions")), n, 1)
19
+ clause_names(doc, n)
20
20
  end
21
21
  end
22
22
 
@@ -29,23 +29,23 @@ module IsoDoc
29
29
  "//introduction"].each do |path|
30
30
  preface_names_numbered(doc.at(ns(path)))
31
31
  end
32
- doc.xpath(ns("//preface/clause[not(@type = 'keywords' or "\
33
- "@type = 'submitting_orgs' or @type = 'security' or "\
32
+ doc.xpath(ns("//preface/clause[not(@type = 'keywords' or " \
33
+ "@type = 'submitting_orgs' or @type = 'security' or " \
34
34
  "@type = 'executivesummary')]"))
35
35
  .each { |c| preface_names_numbered(c) }
36
36
  preface_names_numbered(doc.at(ns("//acknowledgements")))
37
37
  sequential_asset_names(
38
- doc.xpath(ns("//preface/abstract | //foreword | //introduction | "\
38
+ doc.xpath(ns("//preface/abstract | //foreword | //introduction | " \
39
39
  "//submitters | //acknowledgements | //preface/clause")),
40
40
  )
41
41
  end
42
42
 
43
43
  def middle_section_asset_names(doc)
44
44
  middle_sections =
45
- "//clause[@type = 'scope' or @type = 'conformance'] | //foreword | "\
46
- "//introduction | //preface/abstract | //submitters | "\
47
- "//acknowledgements | //preface/clause | "\
48
- " #{@klass.norm_ref_xpath} | //sections/terms | "\
45
+ "//clause[@type = 'scope' or @type = 'conformance'] | //foreword | " \
46
+ "//introduction | //preface/abstract | //submitters | " \
47
+ "//acknowledgements | //preface/clause | " \
48
+ "#{@klass.norm_ref_xpath} | //sections/terms | " \
49
49
  "//sections/definitions | //clause[parent::sections]"
50
50
  sequential_asset_names(doc.xpath(ns(middle_sections)))
51
51
  end
@@ -57,7 +57,7 @@ module IsoDoc
57
57
  pref = preface_number(@prefacenum, 1)
58
58
  @anchors[clause["id"]] =
59
59
  { label: pref,
60
- level: 1, xref: preface_clause_name(clause), type: "clause" }
60
+ level: 1, xref: clause_title(clause), type: "clause" }
61
61
  clause.xpath(ns(SUBCLAUSES)).each_with_index do |c, i|
62
62
  preface_names_numbered1(c, "#{pref}.#{preface_number(i + 1, 2)}", 2)
63
63
  end
@@ -1,10 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <include href="biblio.rng">
4
- <start>
5
- <ref name="document"/>
6
- </start>
7
- </include>
8
3
  <define name="document">
9
4
  <element name="document">
10
5
  <optional>
@@ -1125,26 +1120,4 @@
1125
1120
  </zeroOrMore>
1126
1121
  </element>
1127
1122
  </define>
1128
- <define name="ext">
1129
- <element name="ext">
1130
- <ref name="BibDataExtensionType"/>
1131
- </element>
1132
- </define>
1133
- <define name="BibDataExtensionType">
1134
- <ref name="doctype"/>
1135
- </define>
1136
- <define name="doctype">
1137
- <element name="doctype">
1138
- <ref name="DocumentType"/>
1139
- </element>
1140
- </define>
1141
- <define name="DocumentType">
1142
- <value>document</value>
1143
- </define>
1144
- <define name="BibData">
1145
- <ref name="BibliographicItem"/>
1146
- <optional>
1147
- <ref name="ext"/>
1148
- </optional>
1149
- </define>
1150
1123
  </grammar>
@@ -0,0 +1,164 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0">
3
+ <!--
4
+ Add-ons to biblio.rnc for standoc model: defines the extension point BibDataExtensionType
5
+ of relaton
6
+
7
+ Specialisations as for biblio.rnc. Extension point can be redefined completely for a flavour of standoc
8
+ (SDO); but other elements in Bibdata can only be extended (more specialised vocabularies for Bibdata)
9
+ -->
10
+ <include href="biblio.rng">
11
+ <define name="BibData">
12
+ <ref name="BibliographicItem"/>
13
+ <optional>
14
+ <ref name="ext"/>
15
+ </optional>
16
+ </define>
17
+ </include>
18
+ <define name="ext">
19
+ <element name="ext">
20
+ <ref name="BibDataExtensionType"/>
21
+ </element>
22
+ </define>
23
+ <define name="BibDataExtensionType">
24
+ <optional>
25
+ <attribute name="schema-version"/>
26
+ </optional>
27
+ <ref name="doctype"/>
28
+ <optional>
29
+ <ref name="docsubtype"/>
30
+ </optional>
31
+ <optional>
32
+ <ref name="editorialgroup"/>
33
+ </optional>
34
+ <zeroOrMore>
35
+ <ref name="ics"/>
36
+ </zeroOrMore>
37
+ <zeroOrMore>
38
+ <ref name="structuredidentifier"/>
39
+ </zeroOrMore>
40
+ </define>
41
+ <define name="doctype">
42
+ <element name="doctype">
43
+ <optional>
44
+ <attribute name="abbreviation"/>
45
+ </optional>
46
+ <ref name="DocumentType"/>
47
+ </element>
48
+ </define>
49
+ <define name="DocumentType">
50
+ <value>document</value>
51
+ </define>
52
+ <define name="docsubtype">
53
+ <element name="subdoctype">
54
+ <ref name="DocumentSubtype"/>
55
+ </element>
56
+ </define>
57
+ <define name="DocumentSubtype">
58
+ <text/>
59
+ </define>
60
+ <define name="editorialgroup">
61
+ <element name="editorialgroup">
62
+ <oneOrMore>
63
+ <ref name="technical-committee"/>
64
+ </oneOrMore>
65
+ </element>
66
+ </define>
67
+ <define name="technical-committee">
68
+ <element name="technical-committee">
69
+ <ref name="IsoWorkgroup"/>
70
+ </element>
71
+ </define>
72
+ <define name="IsoWorkgroup">
73
+ <optional>
74
+ <attribute name="number"/>
75
+ </optional>
76
+ <optional>
77
+ <attribute name="type"/>
78
+ </optional>
79
+ <optional>
80
+ <attribute name="identifier"/>
81
+ </optional>
82
+ <optional>
83
+ <attribute name="prefix"/>
84
+ </optional>
85
+ <text/>
86
+ </define>
87
+ <define name="ics">
88
+ <element name="ics">
89
+ <element name="code">
90
+ <text/>
91
+ </element>
92
+ <optional>
93
+ <element name="text">
94
+ <text/>
95
+ </element>
96
+ </optional>
97
+ </element>
98
+ </define>
99
+ <define name="structuredidentifier">
100
+ <element name="structuredidentifier">
101
+ <optional>
102
+ <attribute name="type"/>
103
+ </optional>
104
+ <oneOrMore>
105
+ <element name="agency">
106
+ <text/>
107
+ </element>
108
+ </oneOrMore>
109
+ <optional>
110
+ <element name="class">
111
+ <text/>
112
+ </element>
113
+ </optional>
114
+ <element name="docnumber">
115
+ <text/>
116
+ </element>
117
+ <optional>
118
+ <element name="partnumber">
119
+ <text/>
120
+ </element>
121
+ </optional>
122
+ <optional>
123
+ <element name="edition">
124
+ <text/>
125
+ </element>
126
+ </optional>
127
+ <optional>
128
+ <element name="version">
129
+ <text/>
130
+ </element>
131
+ </optional>
132
+ <optional>
133
+ <element name="supplementtype">
134
+ <text/>
135
+ </element>
136
+ </optional>
137
+ <optional>
138
+ <element name="supplementnumber">
139
+ <text/>
140
+ </element>
141
+ </optional>
142
+ <optional>
143
+ <element name="amendment">
144
+ <text/>
145
+ </element>
146
+ </optional>
147
+ <optional>
148
+ <element name="corrigendum">
149
+ <text/>
150
+ </element>
151
+ </optional>
152
+ <optional>
153
+ <element name="language">
154
+ <text/>
155
+ </element>
156
+ </optional>
157
+ <optional>
158
+ <element name="year">
159
+ <text/>
160
+ </element>
161
+ </optional>
162
+ </element>
163
+ </define>
164
+ </grammar>
@@ -33,9 +33,10 @@
33
33
  <param name="pattern">([\+\-]?\d{4})((-?)((0[1-9]|1[0-2])((-?)([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6]))))?</param>
34
34
  </data>
35
35
  </define>
36
- <start>
37
- <ref name="bibitem"/>
38
- </start>
36
+ <!-- start = bibitem -->
37
+ <define name="BibData">
38
+ <ref name="BibliographicItem"/>
39
+ </define>
39
40
  <define name="status">
40
41
  <element name="status">
41
42
  <ref name="stage"/>
@@ -170,27 +171,25 @@
170
171
  </define>
171
172
  <define name="contributor">
172
173
  <element name="contributor">
173
- <zeroOrMore>
174
+ <oneOrMore>
174
175
  <ref name="role"/>
175
- </zeroOrMore>
176
+ </oneOrMore>
176
177
  <ref name="ContributorInfo"/>
177
178
  </element>
178
179
  </define>
179
180
  <define name="role">
180
181
  <element name="role">
181
- <optional>
182
- <attribute name="type">
183
- <choice>
184
- <value>author</value>
185
- <value>performer</value>
186
- <value>publisher</value>
187
- <value>editor</value>
188
- <value>adapter</value>
189
- <value>translator</value>
190
- <value>distributor</value>
191
- </choice>
192
- </attribute>
193
- </optional>
182
+ <attribute name="type">
183
+ <choice>
184
+ <value>author</value>
185
+ <value>performer</value>
186
+ <value>publisher</value>
187
+ <value>editor</value>
188
+ <value>adapter</value>
189
+ <value>translator</value>
190
+ <value>distributor</value>
191
+ </choice>
192
+ </attribute>
194
193
  <zeroOrMore>
195
194
  <ref name="roledescription"/>
196
195
  </zeroOrMore>
@@ -512,6 +511,17 @@
512
511
  </define>
513
512
  <define name="localityStack">
514
513
  <element name="localityStack">
514
+ <optional>
515
+ <attribute name="connective">
516
+ <choice>
517
+ <value>and</value>
518
+ <value>or</value>
519
+ <value>from</value>
520
+ <value>to</value>
521
+ <value/>
522
+ </choice>
523
+ </attribute>
524
+ </optional>
515
525
  <zeroOrMore>
516
526
  <ref name="locality"/>
517
527
  </zeroOrMore>
@@ -524,6 +534,17 @@
524
534
  </define>
525
535
  <define name="sourceLocalityStack">
526
536
  <element name="sourceLocalityStack">
537
+ <optional>
538
+ <attribute name="connective">
539
+ <choice>
540
+ <value>and</value>
541
+ <value>or</value>
542
+ <value>from</value>
543
+ <value>to</value>
544
+ <value/>
545
+ </choice>
546
+ </attribute>
547
+ </optional>
527
548
  <zeroOrMore>
528
549
  <ref name="sourceLocality"/>
529
550
  </zeroOrMore>
@@ -626,6 +647,9 @@
626
647
  <ref name="BibItemType"/>
627
648
  </attribute>
628
649
  </optional>
650
+ <optional>
651
+ <attribute name="schema-version"/>
652
+ </optional>
629
653
  <optional>
630
654
  <ref name="fetched"/>
631
655
  </optional>
@@ -720,6 +744,9 @@
720
744
  <ref name="BibItemType"/>
721
745
  </attribute>
722
746
  </optional>
747
+ <optional>
748
+ <attribute name="schema-version"/>
749
+ </optional>
723
750
  <optional>
724
751
  <ref name="fetched"/>
725
752
  </optional>