slaw 2.1.0 → 2.2.0

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
  SHA1:
3
- metadata.gz: 7d6568ecf090d3d0d00c81b8520d10453ffaa029
4
- data.tar.gz: bf9930b8861e0fa70d299745a5ac39f6f8e3b1e4
3
+ metadata.gz: aa23761ec680b927115914fd421ee7492984b78f
4
+ data.tar.gz: 80da01e30b41401f66b5784302f92002432535f2
5
5
  SHA512:
6
- metadata.gz: e013db41d8b282b60fa070dd24356d5ffb66978327384387a0d00fc768d485d7775c1b5de65ff1619b7fb2e960bb88769de7906bae07c2662e36b0a996922390
7
- data.tar.gz: 1242f46a95b269a9a4673ff9dbc037699f67af7b362f34975afd265ea7834da53fa5d01bc53e1722c455771f80757df5f6da99df8623a4df48ec944d11d43752
6
+ metadata.gz: 28c4c706a2dd46256ea6a669d242576dc970195060b42e45e1c940c34c53b72520781a7d8e9f6171f4df7c6265040462626072ebc3bbd44c6c824e6e50c24de5
7
+ data.tar.gz: 9df4834b9134ad84f78f43bebc1a46956987876d6f6ffcf54b643d6f1b7addc7bff25273e859fb78fff428e1150211525b985ed37b368753bb578514f064d5ba
data/README.md CHANGED
@@ -84,6 +84,11 @@ You can create your own grammar by creating a gem that provides these files and
84
84
 
85
85
  ## Changelog
86
86
 
87
+ ### 2.2.0 (18 March 2019)
88
+
89
+ * Schedules use hcontainer, not article
90
+ * Schedules allow rich content in title and heading
91
+
87
92
  ### 2.1.0 (18 March 2019)
88
93
 
89
94
  * Make subclassing preface statements easier
@@ -20,8 +20,8 @@ module Slaw
20
20
  end
21
21
 
22
22
  rule schedule_title
23
- space? schedule_title_prefix space? "\""? num:alphanums? "\""? [ \t:.-]* title:(content)?
24
- heading:(newline space? content)?
23
+ space? schedule_title_prefix space? "\""? num:alphanums? "\""? [ \t:.-]* title:clauses?
24
+ subheading:(newline space? clauses)?
25
25
  eol
26
26
  end
27
27
 
@@ -26,7 +26,8 @@ module Slaw
26
26
 
27
27
  def alias
28
28
  if not schedule_title.title.text_value.blank?
29
- schedule_title.title.text_value
29
+ # plain-text elements only
30
+ schedule_title.title.elements.select { |x| !x.respond_to? :to_xml }.map { |x| x.text_value }.join('').strip
30
31
  elsif num
31
32
  "Schedule #{num}"
32
33
  else
@@ -34,9 +35,17 @@ module Slaw
34
35
  end
35
36
  end
36
37
 
37
- def heading
38
- if schedule_title.heading.respond_to? :content
39
- schedule_title.heading.content.text_value
38
+ def title
39
+ if not schedule_title.title.text_value.blank?
40
+ schedule_title.title
41
+ else
42
+ nil
43
+ end
44
+ end
45
+
46
+ def subheading
47
+ if not schedule_title.subheading.text_value.blank?
48
+ schedule_title.subheading.clauses
40
49
  else
41
50
  nil
42
51
  end
@@ -86,9 +95,14 @@ module Slaw
86
95
  idprefix = "#{id}."
87
96
 
88
97
  # there is no good AKN hierarchy container for schedules, so we
89
- # just use article because we don't use it anywhere else.
90
- b.article(id: id) { |b|
91
- b.heading(heading) if heading
98
+ # use hcontainer instead
99
+ b.hcontainer(id: id, name: "schedule") { |b|
100
+ if title and title.elements
101
+ b.heading { |b| title.to_xml(b, idprefix) }
102
+ else
103
+ b.heading(self.alias)
104
+ end
105
+ b.subheading { |b| subheading.to_xml(b, idprefix) } if subheading
92
106
  body.children.elements.each_with_index { |e| e.to_xml(b, idprefix, i) } if body.is_a? Body
93
107
  }
94
108
  }
@@ -11,7 +11,8 @@
11
11
  <xsl:param name="value"/>
12
12
 
13
13
  <xsl:variable name="prefix" select="translate(substring($value, 1, 10), 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')" />
14
- <xsl:variable name="numprefix" select="translate(substring($value, 1, 3), '1234567890', 'NNNNNNNNNN')" />
14
+ <!-- '(' is considered special, so translate numbers into '(' so we can find and escape them -->
15
+ <xsl:variable name="numprefix" select="translate(substring($value, 1, 3), '1234567890', '((((((((((')" />
15
16
 
16
17
  <!-- p tags must escape initial content that looks like a block element marker -->
17
18
  <xsl:if test="$prefix = 'BODY' or
@@ -21,8 +22,7 @@
21
22
  starts-with($prefix, 'PART ') or
22
23
  starts-with($prefix, 'SCHEDULE ') or
23
24
  starts-with($prefix, '{|') or
24
- starts-with($numprefix, '(') or
25
- starts-with($numprefix, 'N.')">
25
+ starts-with($numprefix, '(')">
26
26
  <xsl:text>\</xsl:text>
27
27
  </xsl:if>
28
28
  <xsl:value-of select="$value"/>
@@ -38,51 +38,44 @@
38
38
 
39
39
  <xsl:template match="a:preface">
40
40
  <xsl:text>PREFACE</xsl:text>
41
- <xsl:text>
41
+ <xsl:text>&#10;&#10;</xsl:text>
42
42
 
43
- </xsl:text>
44
43
  <xsl:apply-templates />
45
44
  </xsl:template>
46
45
 
47
46
  <xsl:template match="a:preamble">
48
47
  <xsl:text>PREAMBLE</xsl:text>
49
- <xsl:text>
48
+ <xsl:text>&#10;&#10;</xsl:text>
50
49
 
51
- </xsl:text>
52
50
  <xsl:apply-templates />
53
51
  </xsl:template>
54
52
 
55
53
  <xsl:template match="a:part">
56
54
  <xsl:text>Part </xsl:text>
57
- <xsl:value-of select="./a:num" />
55
+ <xsl:value-of select="a:num" />
58
56
  <xsl:text> - </xsl:text>
59
- <xsl:value-of select="./a:heading" />
60
- <xsl:text>
57
+ <xsl:apply-templates select="a:heading" />
58
+ <xsl:text>&#10;&#10;</xsl:text>
61
59
 
62
- </xsl:text>
63
60
  <xsl:apply-templates select="./*[not(self::a:num) and not(self::a:heading)]" />
64
61
  </xsl:template>
65
62
 
66
63
  <xsl:template match="a:chapter">
67
64
  <xsl:text>Chapter </xsl:text>
68
- <xsl:value-of select="./a:num" />
65
+ <xsl:value-of select="a:num" />
69
66
  <xsl:text> - </xsl:text>
70
- <xsl:value-of select="./a:heading" />
71
- <xsl:text>
67
+ <xsl:apply-templates select="a:heading" />
68
+ <xsl:text>&#10;&#10;</xsl:text>
72
69
 
73
- </xsl:text>
74
70
  <xsl:apply-templates select="./*[not(self::a:num) and not(self::a:heading)]" />
75
71
  </xsl:template>
76
72
 
77
73
  <xsl:template match="a:section">
78
74
  <xsl:value-of select="a:num" />
79
75
  <xsl:text> </xsl:text>
80
- <xsl:if test="a:heading != ''">
81
- <xsl:value-of select="a:heading" />
82
- </xsl:if>
83
- <xsl:text>
76
+ <xsl:apply-templates select="a:heading" />
77
+ <xsl:text>&#10;&#10;</xsl:text>
84
78
 
85
- </xsl:text>
86
79
  <xsl:apply-templates select="./*[not(self::a:num) and not(self::a:heading)]" />
87
80
  </xsl:template>
88
81
 
@@ -91,47 +84,34 @@
91
84
  <xsl:value-of select="a:num" />
92
85
  <xsl:text> </xsl:text>
93
86
  </xsl:if>
94
- <xsl:apply-templates select="./*[not(self::a:num) and not(self::a:heading)]" />
95
- </xsl:template>
96
-
97
- <!-- these are block elements and have a newline at the end -->
98
- <xsl:template match="a:heading">
99
- <xsl:apply-templates />
100
- <xsl:text>
101
87
 
102
- </xsl:text>
88
+ <xsl:apply-templates select="./*[not(self::a:num) and not(self::a:heading)]" />
103
89
  </xsl:template>
104
90
 
91
+ <!-- p tags must end with a blank line -->
105
92
  <xsl:template match="a:p">
106
93
  <xsl:apply-templates/>
107
- <!-- p tags must end with a newline -->
108
- <xsl:text>
109
-
110
- </xsl:text>
94
+ <xsl:text>&#10;&#10;</xsl:text>
111
95
  </xsl:template>
112
96
 
113
97
  <xsl:template match="a:blockList">
114
98
  <xsl:if test="a:listIntroduction != ''">
115
99
  <xsl:apply-templates select="a:listIntroduction" />
116
- <xsl:text>
117
-
118
- </xsl:text>
100
+ <xsl:text>&#10;&#10;</xsl:text>
119
101
  </xsl:if>
120
102
  <xsl:apply-templates select="./*[not(self::a:listIntroduction)]" />
121
103
  </xsl:template>
122
104
 
123
105
  <xsl:template match="a:item">
124
- <xsl:value-of select="./a:num" />
106
+ <xsl:value-of select="a:num" />
125
107
  <xsl:text> </xsl:text>
126
108
  <xsl:apply-templates select="./*[not(self::a:num)]" />
127
109
  </xsl:template>
128
110
 
129
111
  <xsl:template match="a:list">
130
112
  <xsl:if test="a:intro != ''">
131
- <xsl:value-of select="a:intro" />
132
- <xsl:text>
133
-
134
- </xsl:text>
113
+ <xsl:apply-templates select="a:intro" />
114
+ <xsl:text>&#10;&#10;</xsl:text>
135
115
  </xsl:if>
136
116
  <xsl:apply-templates select="./*[not(self::a:intro)]" />
137
117
  </xsl:template>
@@ -143,26 +123,38 @@
143
123
  </xsl:call-template>
144
124
  </xsl:template>
145
125
 
126
+
146
127
  <!-- components/schedules -->
147
- <xsl:template match="a:doc">
128
+ <!-- new-style schedules, "article" elements -->
129
+ <xsl:template match="a:hcontainer[@name='schedule']">
148
130
  <xsl:text>Schedule - </xsl:text>
149
- <xsl:value-of select="a:meta/a:identification/a:FRBRWork/a:FRBRalias/@value" />
131
+ <xsl:apply-templates select="a:heading" />
132
+ <xsl:text>&#10;</xsl:text>
150
133
 
151
- <xsl:if test="a:mainBody/a:article/a:heading">
152
- <xsl:text>
153
- </xsl:text>
154
- <xsl:value-of select="a:mainBody/a:article/a:heading" />
134
+ <xsl:if test="a:subheading">
135
+ <xsl:apply-templates select="a:subheading" />
136
+ <xsl:text>&#10;</xsl:text>
155
137
  </xsl:if>
156
138
 
157
- <xsl:text>
139
+ <xsl:text>&#10;&#10;</xsl:text>
140
+ <xsl:apply-templates select="./*[not(self::a:heading) and not(self::a:subheading)]" />
141
+ </xsl:template>
142
+
143
+
144
+ <!-- old-style schedules, "article" elements -->
145
+ <xsl:template match="a:doc/a:mainBody/a:article">
146
+ <xsl:text>Schedule - </xsl:text>
147
+ <xsl:value-of select="../../a:meta/a:identification/a:FRBRWork/a:FRBRalias/@value" />
148
+ <xsl:text>&#10;</xsl:text>
149
+
150
+ <xsl:if test="not(a:mainBody/a:article/a:heading)">
151
+ <!-- ensure an extra blank line if there is no heading -->
152
+ <xsl:text>&#10;</xsl:text>
153
+ </xsl:if>
158
154
 
159
- </xsl:text>
160
155
  <xsl:apply-templates select="a:mainBody" />
161
156
  </xsl:template>
162
157
 
163
- <xsl:template match="a:mainBody/a:article/a:heading">
164
- <!-- no-op, this is handled by the schedules template above -->
165
- </xsl:template>
166
158
 
167
159
  <!-- tables -->
168
160
  <xsl:template match="a:table">
@@ -247,8 +239,7 @@
247
239
  </xsl:template>
248
240
 
249
241
  <xsl:template match="a:eol">
250
- <xsl:text>
251
- </xsl:text>
242
+ <xsl:text>&#10;</xsl:text>
252
243
  </xsl:template>
253
244
 
254
245
 
data/lib/slaw/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Slaw
2
- VERSION = "2.1.0"
2
+ VERSION = "2.2.0"
3
3
  end
@@ -1413,7 +1413,8 @@ EOS
1413
1413
  </identification>
1414
1414
  </meta>
1415
1415
  <mainBody>
1416
- <article id="schedule">
1416
+ <hcontainer id="schedule" name="schedule">
1417
+ <heading>Schedule</heading>
1417
1418
  <paragraph id="schedule.paragraph-0">
1418
1419
  <content>
1419
1420
  <p>Subject to approval in terms of this By-Law, the erection:</p>
@@ -1427,7 +1428,7 @@ EOS
1427
1428
  <num>2.</num>
1428
1429
  <heading>Bar</heading>
1429
1430
  </section>
1430
- </article>
1431
+ </hcontainer>
1431
1432
  </mainBody>
1432
1433
  </doc>
1433
1434
  </component>'
@@ -1477,8 +1478,9 @@ EOS
1477
1478
  </identification>
1478
1479
  </meta>
1479
1480
  <mainBody>
1480
- <article id="schedule2">
1481
- <heading>A Title</heading>
1481
+ <hcontainer id="schedule2" name="schedule">
1482
+ <heading>Schedule 2</heading>
1483
+ <subheading>A Title</subheading>
1482
1484
  <section id="section-1">
1483
1485
  <num>1.</num>
1484
1486
  <heading>Foo</heading>
@@ -1487,7 +1489,7 @@ EOS
1487
1489
  <num>2.</num>
1488
1490
  <heading>Bar</heading>
1489
1491
  </section>
1490
- </article>
1492
+ </hcontainer>
1491
1493
  </mainBody>
1492
1494
  </doc>
1493
1495
  </component>
@@ -1519,15 +1521,16 @@ EOS
1519
1521
  </identification>
1520
1522
  </meta>
1521
1523
  <mainBody>
1522
- <article id="schedule3">
1523
- <heading>Another Title</heading>
1524
+ <hcontainer id="schedule3" name="schedule">
1525
+ <heading>Schedule 3</heading>
1526
+ <subheading>Another Title</subheading>
1524
1527
  <paragraph id="schedule3.paragraph-0">
1525
1528
  <content>
1526
1529
  <p>Baz</p>
1527
1530
  <p>Boom</p>
1528
1531
  </content>
1529
1532
  </paragraph>
1530
- </article>
1533
+ </hcontainer>
1531
1534
  </mainBody>
1532
1535
  </doc>
1533
1536
  </component>
@@ -1576,8 +1579,9 @@ EOS
1576
1579
  </identification>
1577
1580
  </meta>
1578
1581
  <mainBody>
1579
- <article id="schedule1">
1580
- <heading>Schedule Heading</heading>
1582
+ <hcontainer id="schedule1" name="schedule">
1583
+ <heading>First Schedule</heading>
1584
+ <subheading>Schedule Heading</subheading>
1581
1585
  <paragraph id="schedule1.paragraph-0">
1582
1586
  <content>
1583
1587
  <p>Subject to approval in terms of this By-Law, the erection:</p>
@@ -1591,7 +1595,7 @@ EOS
1591
1595
  <num>2.</num>
1592
1596
  <heading>Bar</heading>
1593
1597
  </section>
1594
- </article>
1598
+ </hcontainer>
1595
1599
  </mainBody>
1596
1600
  </doc>
1597
1601
  </component>'
@@ -1636,8 +1640,9 @@ EOS
1636
1640
  </identification>
1637
1641
  </meta>
1638
1642
  <mainBody>
1639
- <article id="schedule1">
1640
- <heading>Schedule Heading</heading>
1643
+ <hcontainer id="schedule1" name="schedule">
1644
+ <heading>First Schedule</heading>
1645
+ <subheading>Schedule Heading</subheading>
1641
1646
  <paragraph id="schedule1.paragraph-0">
1642
1647
  <content>
1643
1648
  <p>Subject to approval in terms of this By-Law, the erection:</p>
@@ -1651,7 +1656,7 @@ EOS
1651
1656
  <num>2.</num>
1652
1657
  <heading>Bar</heading>
1653
1658
  </section>
1654
- </article>
1659
+ </hcontainer>
1655
1660
  </mainBody>
1656
1661
  </doc>
1657
1662
  </component>'
@@ -1695,7 +1700,8 @@ EOS
1695
1700
  </identification>
1696
1701
  </meta>
1697
1702
  <mainBody>
1698
- <article id="firstschedule">
1703
+ <hcontainer id="firstschedule" name="schedule">
1704
+ <heading>First Schedule</heading>
1699
1705
  <paragraph id="firstschedule.paragraph-0">
1700
1706
  <content>
1701
1707
  <p>Subject to approval in terms of this By-Law, the erection:</p>
@@ -1709,7 +1715,7 @@ EOS
1709
1715
  <num>2.</num>
1710
1716
  <heading>Bar</heading>
1711
1717
  </section>
1712
- </article>
1718
+ </hcontainer>
1713
1719
  </mainBody>
1714
1720
  </doc>
1715
1721
  </component>'
@@ -1755,7 +1761,8 @@ EOS
1755
1761
  </identification>
1756
1762
  </meta>
1757
1763
  <mainBody>
1758
- <article id="schedule1">
1764
+ <hcontainer id="schedule1" name="schedule">
1765
+ <heading>Schedule 1</heading>
1759
1766
  <paragraph id="schedule1.paragraph-0">
1760
1767
  <content>
1761
1768
  <p>Other than as is set out hereinbelow, no signs other than locality bound signs, temporary signs including loose portable sign, estate agents signs, newspaper headline posters and posters (the erection of which must comply with the appropriate schedules pertinent thereto) shall be erected on Municipal owned land.</p>
@@ -1769,7 +1776,7 @@ EOS
1769
1776
  <num>2.</num>
1770
1777
  <heading>Bar</heading>
1771
1778
  </section>
1772
- </article>
1779
+ </hcontainer>
1773
1780
  </mainBody>
1774
1781
  </doc>
1775
1782
  </component>
@@ -1824,8 +1831,9 @@ EOS
1824
1831
  </identification>
1825
1832
  </meta>
1826
1833
  <mainBody>
1827
- <article id="schedule1">
1828
- <heading>Forms</heading>
1834
+ <hcontainer id="schedule1" name="schedule">
1835
+ <heading>Schedule 1</heading>
1836
+ <subheading>Forms</subheading>
1829
1837
  <part id="part-I">
1830
1838
  <num>I</num>
1831
1839
  <heading>Form of authentication statement</heading>
@@ -1844,7 +1852,7 @@ EOS
1844
1852
  </content>
1845
1853
  </paragraph>
1846
1854
  </part>
1847
- </article>
1855
+ </hcontainer>
1848
1856
  </mainBody>
1849
1857
  </doc>
1850
1858
  </component>
@@ -1901,7 +1909,8 @@ EOS
1901
1909
  </identification>
1902
1910
  </meta>
1903
1911
  <mainBody>
1904
- <article id="schedule">
1912
+ <hcontainer id="schedule" name="schedule">
1913
+ <heading>Schedule</heading>
1905
1914
  <paragraph id="schedule.paragraph-0">
1906
1915
  <content>
1907
1916
  <p>Subject to approval in terms of this By-Law.</p>
@@ -1909,7 +1918,7 @@ EOS
1909
1918
  <p>More stuff</p>
1910
1919
  </content>
1911
1920
  </paragraph>
1912
- </article>
1921
+ </hcontainer>
1913
1922
  </mainBody>
1914
1923
  </doc>
1915
1924
  </component>'
@@ -169,8 +169,9 @@ EOS
169
169
  </identification>
170
170
  </meta>
171
171
  <mainBody>
172
- <article id="schedule1">
173
- <heading>A Title</heading>
172
+ <hcontainer id="schedule1" name="schedule">
173
+ <heading>Schedule 1</heading>
174
+ <subheading>A Title</subheading>
174
175
  <paragraph id="schedule1.paragraph-0">
175
176
  <content>
176
177
  <p>
@@ -179,7 +180,7 @@ EOS
179
180
  <p>Some content</p>
180
181
  </content>
181
182
  </paragraph>
182
- </article>
183
+ </hcontainer>
183
184
  </mainBody>
184
185
  </doc>
185
186
  </component>'
@@ -69,7 +69,8 @@ EOS
69
69
  </identification>
70
70
  </meta>
71
71
  <mainBody>
72
- <article id="schedule">
72
+ <hcontainer id="schedule" name="schedule">
73
+ <heading>Schedule</heading>
73
74
  <paragraph id="schedule.paragraph-0">
74
75
  <content>
75
76
  <p>Subject to approval in terms of this By-Law, the erection:</p>
@@ -83,7 +84,7 @@ EOS
83
84
  <num>2.</num>
84
85
  <heading>Bar</heading>
85
86
  </section>
86
- </article>
87
+ </hcontainer>
87
88
  </mainBody>
88
89
  </doc>
89
90
  </component>'
@@ -133,8 +134,9 @@ EOS
133
134
  </identification>
134
135
  </meta>
135
136
  <mainBody>
136
- <article id="schedule2">
137
- <heading>A Title</heading>
137
+ <hcontainer id="schedule2" name="schedule">
138
+ <heading>Schedule 2</heading>
139
+ <subheading>A Title</subheading>
138
140
  <section id="section-1">
139
141
  <num>1.</num>
140
142
  <heading>Foo</heading>
@@ -143,7 +145,7 @@ EOS
143
145
  <num>2.</num>
144
146
  <heading>Bar</heading>
145
147
  </section>
146
- </article>
148
+ </hcontainer>
147
149
  </mainBody>
148
150
  </doc>
149
151
  </component>
@@ -175,15 +177,16 @@ EOS
175
177
  </identification>
176
178
  </meta>
177
179
  <mainBody>
178
- <article id="schedule3">
179
- <heading>Another Title</heading>
180
+ <hcontainer id="schedule3" name="schedule">
181
+ <heading>Schedule 3</heading>
182
+ <subheading>Another Title</subheading>
180
183
  <paragraph id="schedule3.paragraph-0">
181
184
  <content>
182
185
  <p>Baz</p>
183
186
  <p>Boom</p>
184
187
  </content>
185
188
  </paragraph>
186
- </article>
189
+ </hcontainer>
187
190
  </mainBody>
188
191
  </doc>
189
192
  </component>
@@ -232,8 +235,9 @@ EOS
232
235
  </identification>
233
236
  </meta>
234
237
  <mainBody>
235
- <article id="schedule1">
236
- <heading>Schedule Heading</heading>
238
+ <hcontainer id="schedule1" name="schedule">
239
+ <heading>First Schedule</heading>
240
+ <subheading>Schedule Heading</subheading>
237
241
  <paragraph id="schedule1.paragraph-0">
238
242
  <content>
239
243
  <p>Subject to approval in terms of this By-Law, the erection:</p>
@@ -247,7 +251,7 @@ EOS
247
251
  <num>2.</num>
248
252
  <heading>Bar</heading>
249
253
  </section>
250
- </article>
254
+ </hcontainer>
251
255
  </mainBody>
252
256
  </doc>
253
257
  </component>'
@@ -292,8 +296,9 @@ EOS
292
296
  </identification>
293
297
  </meta>
294
298
  <mainBody>
295
- <article id="schedule1">
296
- <heading>Schedule Heading</heading>
299
+ <hcontainer id="schedule1" name="schedule">
300
+ <heading>First Schedule</heading>
301
+ <subheading>Schedule Heading</subheading>
297
302
  <paragraph id="schedule1.paragraph-0">
298
303
  <content>
299
304
  <p>Subject to approval in terms of this By-Law, the erection:</p>
@@ -307,7 +312,7 @@ EOS
307
312
  <num>2.</num>
308
313
  <heading>Bar</heading>
309
314
  </section>
310
- </article>
315
+ </hcontainer>
311
316
  </mainBody>
312
317
  </doc>
313
318
  </component>'
@@ -351,7 +356,8 @@ EOS
351
356
  </identification>
352
357
  </meta>
353
358
  <mainBody>
354
- <article id="firstschedule">
359
+ <hcontainer id="firstschedule" name="schedule">
360
+ <heading>First Schedule</heading>
355
361
  <paragraph id="firstschedule.paragraph-0">
356
362
  <content>
357
363
  <p>Subject to approval in terms of this By-Law, the erection:</p>
@@ -365,7 +371,7 @@ EOS
365
371
  <num>2.</num>
366
372
  <heading>Bar</heading>
367
373
  </section>
368
- </article>
374
+ </hcontainer>
369
375
  </mainBody>
370
376
  </doc>
371
377
  </component>'
@@ -411,7 +417,8 @@ EOS
411
417
  </identification>
412
418
  </meta>
413
419
  <mainBody>
414
- <article id="schedule1">
420
+ <hcontainer id="schedule1" name="schedule">
421
+ <heading>Schedule 1</heading>
415
422
  <paragraph id="schedule1.paragraph-0">
416
423
  <content>
417
424
  <p>Other than as is set out hereinbelow, no signs other than locality bound signs, temporary signs including loose portable sign, estate agents signs, newspaper headline posters and posters (the erection of which must comply with the appropriate schedules pertinent thereto) shall be erected on Municipal owned land.</p>
@@ -425,7 +432,7 @@ EOS
425
432
  <num>2.</num>
426
433
  <heading>Bar</heading>
427
434
  </section>
428
- </article>
435
+ </hcontainer>
429
436
  </mainBody>
430
437
  </doc>
431
438
  </component>
@@ -480,8 +487,9 @@ EOS
480
487
  </identification>
481
488
  </meta>
482
489
  <mainBody>
483
- <article id="schedule1">
484
- <heading>Forms</heading>
490
+ <hcontainer id="schedule1" name="schedule">
491
+ <heading>Schedule 1</heading>
492
+ <subheading>Forms</subheading>
485
493
  <part id="part-I">
486
494
  <num>I</num>
487
495
  <heading>Form of authentication statement</heading>
@@ -500,7 +508,7 @@ EOS
500
508
  </content>
501
509
  </paragraph>
502
510
  </part>
503
- </article>
511
+ </hcontainer>
504
512
  </mainBody>
505
513
  </doc>
506
514
  </component>
@@ -557,7 +565,8 @@ EOS
557
565
  </identification>
558
566
  </meta>
559
567
  <mainBody>
560
- <article id="schedule">
568
+ <hcontainer id="schedule" name="schedule">
569
+ <heading>Schedule</heading>
561
570
  <paragraph id="schedule.paragraph-0">
562
571
  <content>
563
572
  <p>Subject to approval in terms of this By-Law.</p>
@@ -565,7 +574,58 @@ EOS
565
574
  <p>More stuff</p>
566
575
  </content>
567
576
  </paragraph>
568
- </article>
577
+ </hcontainer>
578
+ </mainBody>
579
+ </doc>
580
+ </component>'
581
+ end
582
+
583
+ it 'should handle rich content in titles and subheandings' do
584
+ node = parse :schedules, <<EOS
585
+ Schedule - First Schedule [[remark]]
586
+ Subheading [[another]]
587
+
588
+ Subject to approval in terms of this By-Law.
589
+ EOS
590
+ s = to_xml(node)
591
+ today = Time.now.strftime('%Y-%m-%d')
592
+ s.should == '<component id="component-firstschedule">
593
+ <doc name="firstschedule">
594
+ <meta>
595
+ <identification source="#slaw">
596
+ <FRBRWork>
597
+ <FRBRthis value="/za/act/1980/01/firstschedule"/>
598
+ <FRBRuri value="/za/act/1980/01"/>
599
+ <FRBRalias value="First Schedule"/>
600
+ <FRBRdate date="1980-01-01" name="Generation"/>
601
+ <FRBRauthor href="#council"/>
602
+ <FRBRcountry value="za"/>
603
+ </FRBRWork>
604
+ <FRBRExpression>
605
+ <FRBRthis value="/za/act/1980/01/eng@/firstschedule"/>
606
+ <FRBRuri value="/za/act/1980/01/eng@"/>
607
+ <FRBRdate date="1980-01-01" name="Generation"/>
608
+ <FRBRauthor href="#council"/>
609
+ <FRBRlanguage language="eng"/>
610
+ </FRBRExpression>
611
+ <FRBRManifestation>
612
+ <FRBRthis value="/za/act/1980/01/eng@/firstschedule"/>
613
+ <FRBRuri value="/za/act/1980/01/eng@"/>
614
+ <FRBRdate date="' + today + '" name="Generation"/>
615
+ <FRBRauthor href="#slaw"/>
616
+ </FRBRManifestation>
617
+ </identification>
618
+ </meta>
619
+ <mainBody>
620
+ <hcontainer id="firstschedule" name="schedule">
621
+ <heading>First Schedule <remark status="editorial">[remark]</remark></heading>
622
+ <subheading>Subheading <remark status="editorial">[another]</remark></subheading>
623
+ <paragraph id="firstschedule.paragraph-0">
624
+ <content>
625
+ <p>Subject to approval in terms of this By-Law.</p>
626
+ </content>
627
+ </paragraph>
628
+ </hcontainer>
569
629
  </mainBody>
570
630
  </doc>
571
631
  </component>'
@@ -248,7 +248,8 @@ EOS
248
248
  </identification>
249
249
  </meta>
250
250
  <mainBody>
251
- <article id="schedule1">
251
+ <hcontainer id="schedule1" name="schedule">
252
+ <heading>Schedule 1</heading>
252
253
  <paragraph id="schedule1.paragraph-0">
253
254
  <content>
254
255
  <p>Heres a table:</p>
@@ -272,7 +273,7 @@ EOS
272
273
  </table>
273
274
  </content>
274
275
  </paragraph>
275
- </article>
276
+ </hcontainer>
276
277
  </mainBody>
277
278
  </doc>
278
279
  </component>'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slaw
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Kempe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-18 00:00:00.000000000 Z
11
+ date: 2019-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake