slaw 8.0.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ end
5
5
  def subsection(xml)
6
6
  pre = <<XML
7
7
  <?xml version="1.0" encoding="UTF-8"?>
8
- <akomaNtoso xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.akomantoso.org/2.0" xsi:schemaLocation="http://www.akomantoso.org/2.0 akomantoso20.xsd">
8
+ <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0">
9
9
  <act contains="singleVersion">
10
10
  <body>
11
11
  <section id="section-10">
@@ -30,7 +30,7 @@ end
30
30
  def section(xml)
31
31
  pre = <<XML
32
32
  <?xml version="1.0" encoding="UTF-8"?>
33
- <akomaNtoso xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.akomantoso.org/2.0" xsi:schemaLocation="http://www.akomantoso.org/2.0 akomantoso20.xsd">
33
+ <akomaNtoso xmlns="http://docs.oasis-open.org/legaldocml/ns/akn/3.0">
34
34
  <act contains="singleVersion">
35
35
  <body>
36
36
  <section id="section-10">
@@ -46,20 +46,20 @@ Hello there
46
46
  CROSSHEADING crossheading
47
47
  EOS
48
48
  to_xml(node).should == '<body>
49
- <paragraph id="paragraph0">
49
+ <hcontainer eId="hcontainer_1">
50
50
  <content>
51
51
  <p>Some content before the section</p>
52
52
  </content>
53
- </paragraph>
54
- <section id="section-1">
53
+ </hcontainer>
54
+ <section eId="sec_1">
55
55
  <num>1.</num>
56
56
  <heading>Section</heading>
57
- <paragraph id="section-1.paragraph0">
57
+ <hcontainer eId="sec_1__hcontainer_1">
58
58
  <content>
59
59
  <p>Hello there</p>
60
60
  </content>
61
- </paragraph>
62
- <hcontainer id="section-1.crossheading-0" name="crossheading">
61
+ </hcontainer>
62
+ <hcontainer eId="sec_1__hcontainer_2" name="crossheading">
63
63
  <heading>crossheading</heading>
64
64
  </hcontainer>
65
65
  </section>
@@ -81,33 +81,33 @@ Hello there
81
81
  CROSSHEADING crossheading
82
82
  EOS
83
83
  to_xml(node).should == '<body>
84
- <paragraph id="paragraph0">
84
+ <hcontainer eId="hcontainer_1">
85
85
  <content>
86
86
  <p>Some content before the section</p>
87
- <blockList id="paragraph0.list0" renest="true">
88
- <item id="paragraph0.list0.a">
87
+ <blockList eId="hcontainer_1__list_1" renest="true">
88
+ <item eId="hcontainer_1__list_1__item_a">
89
89
  <num>(a)</num>
90
90
  <p>foo</p>
91
91
  </item>
92
- <item id="paragraph0.list0.b">
92
+ <item eId="hcontainer_1__list_1__item_b">
93
93
  <num>(b)</num>
94
94
  <p>bar</p>
95
95
  </item>
96
96
  </blockList>
97
97
  </content>
98
- </paragraph>
99
- <hcontainer id="crossheading-0" name="crossheading">
98
+ </hcontainer>
99
+ <hcontainer eId="hcontainer_2" name="crossheading">
100
100
  <heading>crossheading</heading>
101
101
  </hcontainer>
102
- <section id="section-1">
102
+ <section eId="sec_1">
103
103
  <num>1.</num>
104
104
  <heading>Section</heading>
105
- <paragraph id="section-1.paragraph0">
105
+ <hcontainer eId="sec_1__hcontainer_1">
106
106
  <content>
107
107
  <p>Hello there</p>
108
108
  </content>
109
- </paragraph>
110
- <hcontainer id="section-1.crossheading-0" name="crossheading">
109
+ </hcontainer>
110
+ <hcontainer eId="sec_1__hcontainer_2" name="crossheading">
111
111
  <heading>crossheading</heading>
112
112
  </hcontainer>
113
113
  </section>
@@ -124,20 +124,20 @@ EOS
124
124
  \\Chapter 2 ignored
125
125
  EOS
126
126
  to_xml(node).should == '<body>
127
- <paragraph id="paragraph0">
127
+ <hcontainer eId="hcontainer_1">
128
128
  <content>
129
129
  <p>1. ignored</p>
130
130
  <p>CROSSHEADING crossheading</p>
131
131
  </content>
132
- </paragraph>
133
- <section id="section-1">
132
+ </hcontainer>
133
+ <section eId="sec_1">
134
134
  <num>1.</num>
135
135
  <heading>Section</heading>
136
- <paragraph id="section-1.paragraph0">
136
+ <hcontainer eId="sec_1__hcontainer_1">
137
137
  <content>
138
138
  <p>Chapter 2 ignored</p>
139
139
  </content>
140
- </paragraph>
140
+ </hcontainer>
141
141
  </section>
142
142
  </body>'
143
143
  end
@@ -152,19 +152,19 @@ Some content before the section
152
152
  Hello there
153
153
  EOS
154
154
  to_xml(node).should == '<body>
155
- <paragraph id="paragraph0">
155
+ <hcontainer eId="hcontainer_1">
156
156
  <content>
157
157
  <p>Some content before the section</p>
158
158
  </content>
159
- </paragraph>
160
- <section id="section-1">
159
+ </hcontainer>
160
+ <section eId="sec_1">
161
161
  <num>1.</num>
162
162
  <heading>Section</heading>
163
- <paragraph id="section-1.paragraph0">
163
+ <hcontainer eId="sec_1__hcontainer_1">
164
164
  <content>
165
165
  <p>Hello there</p>
166
166
  </content>
167
- </paragraph>
167
+ </hcontainer>
168
168
  </section>
169
169
  </body>'
170
170
  end
@@ -206,17 +206,17 @@ The Chapter Heading
206
206
  1. Section
207
207
  Hello there
208
208
  EOS
209
- to_xml(node).should == '<chapter id="chapter-2">
209
+ to_xml(node).should == '<chapter eId="chp_2">
210
210
  <num>2</num>
211
211
  <heading>The Chapter Heading</heading>
212
- <section id="section-1">
212
+ <section eId="sec_1">
213
213
  <num>1.</num>
214
214
  <heading>Section</heading>
215
- <paragraph id="section-1.paragraph0">
215
+ <hcontainer eId="sec_1__hcontainer_1">
216
216
  <content>
217
217
  <p>Hello there</p>
218
218
  </content>
219
- </paragraph>
219
+ </hcontainer>
220
220
  </section>
221
221
  </chapter>'
222
222
  end
@@ -228,16 +228,16 @@ ChaPTEr 2:
228
228
  1. Section
229
229
  Hello there
230
230
  EOS
231
- to_xml(node).should == '<chapter id="chapter-2">
231
+ to_xml(node).should == '<chapter eId="chp_2">
232
232
  <num>2</num>
233
- <section id="section-1">
233
+ <section eId="sec_1">
234
234
  <num>1.</num>
235
235
  <heading>Section</heading>
236
- <paragraph id="section-1.paragraph0">
236
+ <hcontainer eId="sec_1__hcontainer_1">
237
237
  <content>
238
238
  <p>Hello there</p>
239
239
  </content>
240
- </paragraph>
240
+ </hcontainer>
241
241
  </section>
242
242
  </chapter>'
243
243
  end
@@ -253,17 +253,17 @@ Some lines at the start of the chapter.
253
253
  EOS
254
254
  node.num.should == "2"
255
255
  node.heading.heading.text_value.should == "\nThe Chapter Heading"
256
- to_xml(node).should == '<chapter id="chapter-2">
256
+ to_xml(node).should == '<chapter eId="chp_2">
257
257
  <num>2</num>
258
258
  <heading>The Chapter Heading</heading>
259
- <hcontainer id="chapter-2.crossheading-0" name="crossheading">
259
+ <hcontainer eId="chp_2__hcontainer_1" name="crossheading">
260
260
  <heading>crossheading</heading>
261
261
  </hcontainer>
262
- <paragraph id="chapter-2.paragraph0">
262
+ <hcontainer eId="chp_2__hcontainer_2">
263
263
  <content>
264
264
  <p>Some lines at the start of the chapter.</p>
265
265
  </content>
266
- </paragraph>
266
+ </hcontainer>
267
267
  </chapter>'
268
268
  end
269
269
 
@@ -279,22 +279,22 @@ Section text.
279
279
  EOS
280
280
  node.num.should == "2"
281
281
  node.heading.heading.text_value.should == 'The Chapter Heading'
282
- to_xml(node).should == '<chapter id="chapter-2">
282
+ to_xml(node).should == '<chapter eId="chp_2">
283
283
  <num>2</num>
284
284
  <heading>The Chapter Heading</heading>
285
- <paragraph id="chapter-2.paragraph0">
285
+ <hcontainer eId="chp_2__hcontainer_1">
286
286
  <content>
287
287
  <p>Some lines at the start of the chapter.</p>
288
288
  </content>
289
- </paragraph>
290
- <section id="section-1">
289
+ </hcontainer>
290
+ <section eId="sec_1">
291
291
  <num>1.</num>
292
292
  <heading>Section 1</heading>
293
- <paragraph id="section-1.paragraph0">
293
+ <hcontainer eId="sec_1__hcontainer_1">
294
294
  <content>
295
295
  <p>Section text.</p>
296
296
  </content>
297
- </paragraph>
297
+ </hcontainer>
298
298
  </section>
299
299
  </chapter>'
300
300
  end
@@ -306,17 +306,17 @@ Chapter 2
306
306
  1. Section
307
307
  Hello there
308
308
  EOS
309
- to_xml(node).should == '<chapter id="chapter-2">
309
+ to_xml(node).should == '<chapter eId="chp_2">
310
310
  <num>2</num>
311
311
  <heading>The Chapter Heading</heading>
312
- <section id="section-1">
312
+ <section eId="sec_1">
313
313
  <num>1.</num>
314
314
  <heading>Section</heading>
315
- <paragraph id="section-1.paragraph0">
315
+ <hcontainer eId="sec_1__hcontainer_1">
316
316
  <content>
317
317
  <p>Hello there</p>
318
318
  </content>
319
- </paragraph>
319
+ </hcontainer>
320
320
  </section>
321
321
  </chapter>'
322
322
  end
@@ -329,17 +329,17 @@ Chapter 2
329
329
  1. Section
330
330
  Hello there
331
331
  EOS
332
- to_xml(node).should == '<chapter id="chapter-2">
332
+ to_xml(node).should == '<chapter eId="chp_2">
333
333
  <num>2</num>
334
334
  <heading>The <b>Chapter</b> <ref href="/za/act/1990/1">Heading</ref> <remark status="editorial">[remark]</remark></heading>
335
- <section id="section-1">
335
+ <section eId="sec_1">
336
336
  <num>1.</num>
337
337
  <heading>Section</heading>
338
- <paragraph id="section-1.paragraph0">
338
+ <hcontainer eId="sec_1__hcontainer_1">
339
339
  <content>
340
340
  <p>Hello there</p>
341
341
  </content>
342
- </paragraph>
342
+ </hcontainer>
343
343
  </section>
344
344
  </chapter>'
345
345
  end
@@ -351,17 +351,17 @@ Chapter 2 - The **Chapter** [Heading](/za/act/1990/1) [[remark]]
351
351
  1. Section
352
352
  Hello there
353
353
  EOS
354
- to_xml(node).should == '<chapter id="chapter-2">
354
+ to_xml(node).should == '<chapter eId="chp_2">
355
355
  <num>2</num>
356
356
  <heading>The <b>Chapter</b> <ref href="/za/act/1990/1">Heading</ref> <remark status="editorial">[remark]</remark></heading>
357
- <section id="section-1">
357
+ <section eId="sec_1">
358
358
  <num>1.</num>
359
359
  <heading>Section</heading>
360
- <paragraph id="section-1.paragraph0">
360
+ <hcontainer eId="sec_1__hcontainer_1">
361
361
  <content>
362
362
  <p>Hello there</p>
363
363
  </content>
364
- </paragraph>
364
+ </hcontainer>
365
365
  </section>
366
366
  </chapter>'
367
367
  end
@@ -372,11 +372,11 @@ Chapter 2 The Chapter Heading
372
372
  Chapter 3 The Other Heading
373
373
  EOS
374
374
  to_xml(node).should == '<body>
375
- <chapter id="chapter-2">
375
+ <chapter eId="chp_2">
376
376
  <num>2</num>
377
377
  <heading>The Chapter Heading</heading>
378
378
  </chapter>
379
- <chapter id="chapter-3">
379
+ <chapter eId="chp_3">
380
380
  <num>3</num>
381
381
  <heading>The Other Heading</heading>
382
382
  </chapter>
@@ -391,12 +391,12 @@ Chapter 2 The Chapter
391
391
  | foo
392
392
  |}
393
393
  EOS
394
- to_xml(node).should == '<chapter id="chapter-2">
394
+ to_xml(node).should == '<chapter eId="chp_2">
395
395
  <num>2</num>
396
396
  <heading>The Chapter</heading>
397
- <paragraph id="chapter-2.paragraph0">
397
+ <hcontainer eId="chp_2__hcontainer_1">
398
398
  <content>
399
- <table id="chapter-2.paragraph0.table0">
399
+ <table eId="chp_2__hcontainer_1__table_1">
400
400
  <tr>
401
401
  <td>
402
402
  <p>foo</p>
@@ -404,7 +404,7 @@ EOS
404
404
  </tr>
405
405
  </table>
406
406
  </content>
407
- </paragraph>
407
+ </hcontainer>
408
408
  </chapter>'
409
409
  end
410
410
 
@@ -418,16 +418,16 @@ Stuff
418
418
 
419
419
  More stuff
420
420
  EOS
421
- to_xml(node).should == '<chapter id="chapter-1">
421
+ to_xml(node).should == '<chapter eId="chp_1">
422
422
  <num>1</num>
423
423
  <heading>The Chapter</heading>
424
- <paragraph id="chapter-1.paragraph0">
424
+ <hcontainer eId="chp_1__hcontainer_1">
425
425
  <content>
426
426
  <p>Stuff</p>
427
427
  <p>Chapter 2 - Ignored</p>
428
428
  <p>More stuff</p>
429
429
  </content>
430
- </paragraph>
430
+ </hcontainer>
431
431
  </chapter>'
432
432
  end
433
433
 
@@ -443,26 +443,26 @@ Part 2 - Chapter One Part Two
443
443
 
444
444
  one-two
445
445
  EOS
446
- to_xml(node).should == '<chapter id="chapter-1">
446
+ to_xml(node).should == '<chapter eId="chp_1">
447
447
  <num>1</num>
448
448
  <heading>Chapter One</heading>
449
- <part id="chapter-1.part-1">
449
+ <part eId="chp_1__part_1">
450
450
  <num>1</num>
451
451
  <heading>Chapter One Part One</heading>
452
- <paragraph id="chapter-1.part-1.paragraph0">
452
+ <hcontainer eId="chp_1__part_1__hcontainer_1">
453
453
  <content>
454
454
  <p>one-one</p>
455
455
  </content>
456
- </paragraph>
456
+ </hcontainer>
457
457
  </part>
458
- <part id="chapter-1.part-2">
458
+ <part eId="chp_1__part_2">
459
459
  <num>2</num>
460
460
  <heading>Chapter One Part Two</heading>
461
- <paragraph id="chapter-1.part-2.paragraph0">
461
+ <hcontainer eId="chp_1__part_2__hcontainer_1">
462
462
  <content>
463
463
  <p>one-two</p>
464
464
  </content>
465
- </paragraph>
465
+ </hcontainer>
466
466
  </part>
467
467
  </chapter>'
468
468
  end
@@ -482,20 +482,20 @@ CROSSHEADING crossheading
482
482
  1. Section
483
483
  Hello there
484
484
  EOS
485
- to_xml(node).should == '<part id="part-2">
485
+ to_xml(node).should == '<part eId="part_2">
486
486
  <num>2</num>
487
487
  <heading>The Part Heading</heading>
488
- <hcontainer id="part-2.crossheading-0" name="crossheading">
488
+ <hcontainer eId="part_2__hcontainer_1" name="crossheading">
489
489
  <heading>crossheading</heading>
490
490
  </hcontainer>
491
- <section id="section-1">
491
+ <section eId="sec_1">
492
492
  <num>1.</num>
493
493
  <heading>Section</heading>
494
- <paragraph id="section-1.paragraph0">
494
+ <hcontainer eId="sec_1__hcontainer_1">
495
495
  <content>
496
496
  <p>Hello there</p>
497
497
  </content>
498
- </paragraph>
498
+ </hcontainer>
499
499
  </section>
500
500
  </part>'
501
501
  end
@@ -506,17 +506,17 @@ Part 2 - The Part Heading
506
506
  1. Section
507
507
  Hello there
508
508
  EOS
509
- to_xml(node).should == '<part id="part-2">
509
+ to_xml(node).should == '<part eId="part_2">
510
510
  <num>2</num>
511
511
  <heading>The Part Heading</heading>
512
- <section id="section-1">
512
+ <section eId="sec_1">
513
513
  <num>1.</num>
514
514
  <heading>Section</heading>
515
- <paragraph id="section-1.paragraph0">
515
+ <hcontainer eId="sec_1__hcontainer_1">
516
516
  <content>
517
517
  <p>Hello there</p>
518
518
  </content>
519
- </paragraph>
519
+ </hcontainer>
520
520
  </section>
521
521
  </part>'
522
522
  end
@@ -527,17 +527,17 @@ Part 2: The Part Heading
527
527
  1. Section
528
528
  Hello there
529
529
  EOS
530
- to_xml(node).should == '<part id="part-2">
530
+ to_xml(node).should == '<part eId="part_2">
531
531
  <num>2</num>
532
532
  <heading>The Part Heading</heading>
533
- <section id="section-1">
533
+ <section eId="sec_1">
534
534
  <num>1.</num>
535
535
  <heading>Section</heading>
536
- <paragraph id="section-1.paragraph0">
536
+ <hcontainer eId="sec_1__hcontainer_1">
537
537
  <content>
538
538
  <p>Hello there</p>
539
539
  </content>
540
- </paragraph>
540
+ </hcontainer>
541
541
  </section>
542
542
  </part>'
543
543
  end
@@ -549,16 +549,16 @@ Part 2:
549
549
  1. Section
550
550
  Hello there
551
551
  EOS
552
- to_xml(node).should == '<part id="part-2">
552
+ to_xml(node).should == '<part eId="part_2">
553
553
  <num>2</num>
554
- <section id="section-1">
554
+ <section eId="sec_1">
555
555
  <num>1.</num>
556
556
  <heading>Section</heading>
557
- <paragraph id="section-1.paragraph0">
557
+ <hcontainer eId="sec_1__hcontainer_1">
558
558
  <content>
559
559
  <p>Hello there</p>
560
560
  </content>
561
- </paragraph>
561
+ </hcontainer>
562
562
  </section>
563
563
  </part>'
564
564
  end
@@ -570,17 +570,17 @@ Part 2
570
570
  1. Section
571
571
  Hello there
572
572
  EOS
573
- to_xml(node).should == '<part id="part-2">
573
+ to_xml(node).should == '<part eId="part_2">
574
574
  <num>2</num>
575
575
  <heading>The Part Heading</heading>
576
- <section id="section-1">
576
+ <section eId="sec_1">
577
577
  <num>1.</num>
578
578
  <heading>Section</heading>
579
- <paragraph id="section-1.paragraph0">
579
+ <hcontainer eId="sec_1__hcontainer_1">
580
580
  <content>
581
581
  <p>Hello there</p>
582
582
  </content>
583
- </paragraph>
583
+ </hcontainer>
584
584
  </section>
585
585
  </part>'
586
586
  end
@@ -592,17 +592,17 @@ Part 2
592
592
  1. Section
593
593
  Hello there
594
594
  EOS
595
- to_xml(node).should == '<part id="part-2">
595
+ to_xml(node).should == '<part eId="part_2">
596
596
  <num>2</num>
597
597
  <heading>The <b>Part</b> Heading</heading>
598
- <section id="section-1">
598
+ <section eId="sec_1">
599
599
  <num>1.</num>
600
600
  <heading>Section</heading>
601
- <paragraph id="section-1.paragraph0">
601
+ <hcontainer eId="sec_1__hcontainer_1">
602
602
  <content>
603
603
  <p>Hello there</p>
604
604
  </content>
605
- </paragraph>
605
+ </hcontainer>
606
606
  </section>
607
607
  </part>'
608
608
  end
@@ -613,17 +613,17 @@ Part 2 The **Part** Heading
613
613
  1. Section
614
614
  Hello there
615
615
  EOS
616
- to_xml(node).should == '<part id="part-2">
616
+ to_xml(node).should == '<part eId="part_2">
617
617
  <num>2</num>
618
618
  <heading>The <b>Part</b> Heading</heading>
619
- <section id="section-1">
619
+ <section eId="sec_1">
620
620
  <num>1.</num>
621
621
  <heading>Section</heading>
622
- <paragraph id="section-1.paragraph0">
622
+ <hcontainer eId="sec_1__hcontainer_1">
623
623
  <content>
624
624
  <p>Hello there</p>
625
625
  </content>
626
- </paragraph>
626
+ </hcontainer>
627
627
  </section>
628
628
  </part>'
629
629
  end
@@ -636,17 +636,17 @@ PREVENTION AND SUPPRESSION OF HEALTH NUISANCES
636
636
  1.
637
637
  No owner or occupier of any shop or business premises or vacant land adjoining a shop or business premises shall cause a health nuisance.
638
638
  EOS
639
- to_xml(node).should == '<part id="part-1">
639
+ to_xml(node).should == '<part eId="part_1">
640
640
  <num>1</num>
641
641
  <heading>PREVENTION AND SUPPRESSION OF HEALTH NUISANCES</heading>
642
- <section id="section-1">
642
+ <section eId="sec_1">
643
643
  <num>1.</num>
644
644
  <heading/>
645
- <paragraph id="section-1.paragraph0">
645
+ <hcontainer eId="sec_1__hcontainer_1">
646
646
  <content>
647
647
  <p>No owner or occupier of any shop or business premises or vacant land adjoining a shop or business premises shall cause a health nuisance.</p>
648
648
  </content>
649
- </paragraph>
649
+ </hcontainer>
650
650
  </section>
651
651
  </part>'
652
652
  end
@@ -663,22 +663,22 @@ Hello there
663
663
  EOS
664
664
  node.num.should == "2"
665
665
  node.heading.heading.text_value.should == "\nThe Part Heading"
666
- to_xml(node).should == '<part id="part-2">
666
+ to_xml(node).should == '<part eId="part_2">
667
667
  <num>2</num>
668
668
  <heading>The Part Heading</heading>
669
- <paragraph id="part-2.paragraph0">
669
+ <hcontainer eId="part_2__hcontainer_1">
670
670
  <content>
671
671
  <p>Some text before the part.</p>
672
672
  </content>
673
- </paragraph>
674
- <section id="section-1">
673
+ </hcontainer>
674
+ <section eId="sec_1">
675
675
  <num>1.</num>
676
676
  <heading>Section</heading>
677
- <paragraph id="section-1.paragraph0">
677
+ <hcontainer eId="sec_1__hcontainer_1">
678
678
  <content>
679
679
  <p>Hello there</p>
680
680
  </content>
681
- </paragraph>
681
+ </hcontainer>
682
682
  </section>
683
683
  </part>'
684
684
  end
@@ -689,11 +689,11 @@ Part 2 The Part Heading
689
689
  Part 3 The Other Heading
690
690
  EOS
691
691
  to_xml(node).should == '<body>
692
- <part id="part-2">
692
+ <part eId="part_2">
693
693
  <num>2</num>
694
694
  <heading>The Part Heading</heading>
695
695
  </part>
696
- <part id="part-3">
696
+ <part eId="part_3">
697
697
  <num>3</num>
698
698
  <heading>The Other Heading</heading>
699
699
  </part>
@@ -706,14 +706,14 @@ Part 2 The Part Heading
706
706
  \\Part 3 ignored
707
707
  EOS
708
708
  to_xml(node).should == '<body>
709
- <part id="part-2">
709
+ <part eId="part_2">
710
710
  <num>2</num>
711
711
  <heading>The Part Heading</heading>
712
- <paragraph id="part-2.paragraph0">
712
+ <hcontainer eId="part_2__hcontainer_1">
713
713
  <content>
714
714
  <p>Part 3 ignored</p>
715
715
  </content>
716
- </paragraph>
716
+ </hcontainer>
717
717
  </part>
718
718
  </body>'
719
719
  end
@@ -730,31 +730,127 @@ Chapter 2 - Part One Chapter Two
730
730
 
731
731
  one-two
732
732
  EOS
733
- to_xml(node).should == '<part id="part-1">
733
+ to_xml(node).should == '<part eId="part_1">
734
734
  <num>1</num>
735
735
  <heading>Part One</heading>
736
- <chapter id="part-1.chapter-1">
736
+ <chapter eId="part_1__chp_1">
737
737
  <num>1</num>
738
738
  <heading>Part One Chapter One</heading>
739
- <paragraph id="part-1.chapter-1.paragraph0">
739
+ <hcontainer eId="part_1__chp_1__hcontainer_1">
740
740
  <content>
741
741
  <p>one-one</p>
742
742
  </content>
743
- </paragraph>
743
+ </hcontainer>
744
744
  </chapter>
745
- <chapter id="part-1.chapter-2">
745
+ <chapter eId="part_1__chp_2">
746
746
  <num>2</num>
747
747
  <heading>Part One Chapter Two</heading>
748
- <paragraph id="part-1.chapter-2.paragraph0">
748
+ <hcontainer eId="part_1__chp_2__hcontainer_1">
749
749
  <content>
750
750
  <p>one-two</p>
751
751
  </content>
752
- </paragraph>
752
+ </hcontainer>
753
753
  </chapter>
754
754
  </part>'
755
755
  end
756
756
  end
757
757
 
758
+ #-------------------------------------------------------------------------------
759
+ # Subparts
760
+
761
+ describe 'subparts' do
762
+ it 'should handle subparts' do
763
+ node = parse :subpart, <<EOS
764
+ SUBPART 2 - Heading
765
+
766
+ 1. Section
767
+ Hello there
768
+ EOS
769
+ to_xml(node).should == '<subpart eId="subpart_2">
770
+ <num>2</num>
771
+ <heading>Heading</heading>
772
+ <section eId="sec_1">
773
+ <num>1.</num>
774
+ <heading>Section</heading>
775
+ <hcontainer eId="sec_1__hcontainer_1">
776
+ <content>
777
+ <p>Hello there</p>
778
+ </content>
779
+ </hcontainer>
780
+ </section>
781
+ </subpart>'
782
+ end
783
+
784
+ it 'should handle subparts in parts' do
785
+ node = parse :part, <<EOS
786
+ PART A - The Part
787
+
788
+ SUBPART 1 - The Subpart 1
789
+
790
+ 1. Section
791
+
792
+ Hello
793
+
794
+ SUBPART 2 - The Subpart 2
795
+
796
+ 2. Section
797
+
798
+ Bye
799
+ EOS
800
+ to_xml(node).should == '<part eId="part_A">
801
+ <num>A</num>
802
+ <heading>The Part</heading>
803
+ <subpart eId="part_A__subpart_1">
804
+ <num>1</num>
805
+ <heading>The Subpart 1</heading>
806
+ <section eId="sec_1">
807
+ <num>1.</num>
808
+ <heading>Section</heading>
809
+ <hcontainer eId="sec_1__hcontainer_1">
810
+ <content>
811
+ <p>Hello</p>
812
+ </content>
813
+ </hcontainer>
814
+ </section>
815
+ </subpart>
816
+ <subpart eId="part_A__subpart_2">
817
+ <num>2</num>
818
+ <heading>The Subpart 2</heading>
819
+ <section eId="sec_2">
820
+ <num>2.</num>
821
+ <heading>Section</heading>
822
+ <hcontainer eId="sec_2__hcontainer_1">
823
+ <content>
824
+ <p>Bye</p>
825
+ </content>
826
+ </hcontainer>
827
+ </section>
828
+ </subpart>
829
+ </part>'
830
+ end
831
+
832
+ it 'should allow optional numbers' do
833
+ node = parse :subpart, <<EOS
834
+ SUBPART - Heading - with a dash
835
+
836
+ 1. Section
837
+ Hello there
838
+ EOS
839
+ to_xml(node).should == '<subpart eId="subpart_1">
840
+ <heading>Heading - with a dash</heading>
841
+ <section eId="sec_1">
842
+ <num>1.</num>
843
+ <heading>Section</heading>
844
+ <hcontainer eId="sec_1__hcontainer_1">
845
+ <content>
846
+ <p>Hello there</p>
847
+ </content>
848
+ </hcontainer>
849
+ </section>
850
+ </subpart>'
851
+ end
852
+ end
853
+
758
854
  #-------------------------------------------------------------------------------
759
855
  # Subsections
760
856
 
@@ -773,24 +869,24 @@ EOS
773
869
  (c) three
774
870
  (i) four
775
871
  EOS
776
- to_xml(node, "", 1).should == '<subsection id="2">
872
+ to_xml(node, "", 1).should == '<subsection eId="subsec_2">
777
873
  <num>(2)</num>
778
874
  <content>
779
875
  <p>title</p>
780
- <blockList id="2.list0" renest="true">
781
- <item id="2.list0.a">
876
+ <blockList eId="subsec_2__list_1" renest="true">
877
+ <item eId="subsec_2__list_1__item_a">
782
878
  <num>(a)</num>
783
879
  <p>one</p>
784
880
  </item>
785
- <item id="2.list0.b">
881
+ <item eId="subsec_2__list_1__item_b">
786
882
  <num>(b)</num>
787
883
  <p>two</p>
788
884
  </item>
789
- <item id="2.list0.c">
885
+ <item eId="subsec_2__list_1__item_c">
790
886
  <num>(c)</num>
791
887
  <p>three</p>
792
888
  </item>
793
- <item id="2.list0.i">
889
+ <item eId="subsec_2__list_1__item_i">
794
890
  <num>(i)</num>
795
891
  <p>four</p>
796
892
  </item>
@@ -807,23 +903,23 @@ EOS
807
903
  (i) four
808
904
  EOS
809
905
  )
810
- to_xml(node, "", 1).should == '<subsection id="1">
906
+ to_xml(node, "", 1).should == '<subsection eId="subsec_1">
811
907
  <num>(1)</num>
812
908
  <content>
813
- <blockList id="1.list0" renest="true">
814
- <item id="1.list0.a">
909
+ <blockList eId="subsec_1__list_1" renest="true">
910
+ <item eId="subsec_1__list_1__item_a">
815
911
  <num>(a)</num>
816
912
  <p>one</p>
817
913
  </item>
818
- <item id="1.list0.b">
914
+ <item eId="subsec_1__list_1__item_b">
819
915
  <num>(b)</num>
820
916
  <p>two</p>
821
917
  </item>
822
- <item id="1.list0.c">
918
+ <item eId="subsec_1__list_1__item_c">
823
919
  <num>(c)</num>
824
920
  <p>three</p>
825
921
  </item>
826
- <item id="1.list0.i">
922
+ <item eId="subsec_1__list_1__item_i">
827
923
  <num>(i)</num>
828
924
  <p>four</p>
829
925
  </item>
@@ -839,15 +935,15 @@ EOS
839
935
  (b) two
840
936
  EOS
841
937
  )
842
- to_xml(node, "", 1).should == '<subsection id="1">
938
+ to_xml(node, "", 1).should == '<subsection eId="subsec_1">
843
939
  <num>(1)</num>
844
940
  <content>
845
- <blockList id="1.list0" renest="true">
846
- <item id="1.list0.a">
941
+ <blockList eId="subsec_1__list_1" renest="true">
942
+ <item eId="subsec_1__list_1__item_a">
847
943
  <num>(a)</num>
848
944
  <p>one</p>
849
945
  </item>
850
- <item id="1.list0.b">
946
+ <item eId="subsec_1__list_1__item_b">
851
947
  <num>(b)</num>
852
948
  <p>two</p>
853
949
  </item>
@@ -865,22 +961,22 @@ EOS
865
961
  (3) third
866
962
  EOS
867
963
  )
868
- to_xml(node).should == '<section id="section-1">
964
+ to_xml(node).should == '<section eId="sec_1">
869
965
  <num>1.</num>
870
966
  <heading>Section</heading>
871
- <subsection id="section-1.1">
967
+ <subsection eId="sec_1__subsec_1">
872
968
  <num>(1)</num>
873
969
  <content>
874
970
  <p/>
875
971
  </content>
876
972
  </subsection>
877
- <subsection id="section-1.2">
973
+ <subsection eId="sec_1__subsec_2">
878
974
  <num>(2)</num>
879
975
  <content>
880
976
  <p>next line</p>
881
977
  </content>
882
978
  </subsection>
883
- <subsection id="section-1.3">
979
+ <subsection eId="sec_1__subsec_3">
884
980
  <num>(3)</num>
885
981
  <content>
886
982
  <p>third</p>
@@ -897,24 +993,24 @@ EOS
897
993
  (ii) double
898
994
  EOS
899
995
  )
900
- to_xml(node, "", 1).should == '<subsection id="1">
996
+ to_xml(node, "", 1).should == '<subsection eId="subsec_1">
901
997
  <num>(1)</num>
902
998
  <content>
903
999
  <p>here\'s my really cool list,</p>
904
- <blockList id="1.list0" renest="true">
905
- <item id="1.list0.a">
1000
+ <blockList eId="subsec_1__list_1" renest="true">
1001
+ <item eId="subsec_1__list_1__item_a">
906
1002
  <num>(a)</num>
907
1003
  <p>one</p>
908
1004
  </item>
909
- <item id="1.list0.b">
1005
+ <item eId="subsec_1__list_1__item_b">
910
1006
  <num>(b)</num>
911
1007
  <p/>
912
1008
  </item>
913
- <item id="1.list0.i">
1009
+ <item eId="subsec_1__list_1__item_i">
914
1010
  <num>(i)</num>
915
1011
  <p>single</p>
916
1012
  </item>
917
- <item id="1.list0.ii">
1013
+ <item eId="subsec_1__list_1__item_ii">
918
1014
  <num>(ii)</num>
919
1015
  <p>double</p>
920
1016
  </item>
@@ -931,24 +1027,24 @@ EOS
931
1027
  (ii) double
932
1028
  EOS
933
1029
  )
934
- to_xml(node, "", 1).should == '<subsection id="1">
1030
+ to_xml(node, "", 1).should == '<subsection eId="subsec_1">
935
1031
  <num>(1)</num>
936
1032
  <content>
937
1033
  <p>here\'s my really cool list,</p>
938
- <blockList id="1.list0" renest="true">
939
- <item id="1.list0.a">
1034
+ <blockList eId="subsec_1__list_1" renest="true">
1035
+ <item eId="subsec_1__list_1__item_a">
940
1036
  <num>(a)</num>
941
1037
  <p/>
942
1038
  </item>
943
- <item id="1.list0.b">
1039
+ <item eId="subsec_1__list_1__item_b">
944
1040
  <num>(b)</num>
945
1041
  <p/>
946
1042
  </item>
947
- <item id="1.list0.i">
1043
+ <item eId="subsec_1__list_1__item_i">
948
1044
  <num>(i)</num>
949
1045
  <p>single</p>
950
1046
  </item>
951
- <item id="1.list0.ii">
1047
+ <item eId="subsec_1__list_1__item_ii">
952
1048
  <num>(ii)</num>
953
1049
  <p>double</p>
954
1050
  </item>
@@ -961,10 +1057,32 @@ EOS
961
1057
  it 'should handle dotted number subsection numbers' do
962
1058
  node = parse :subsection, <<EOS
963
1059
  9.9. foo
1060
+ EOS
1061
+ node.num.should == "9.9"
1062
+
1063
+ node = parse :subsection, <<EOS
1064
+ 9.9 foo
964
1065
  EOS
965
1066
  node.num.should == "9.9"
966
1067
  end
967
1068
 
1069
+ it 'should handle dotted number and letter subsection numbers' do
1070
+ node = parse :subsection, <<EOS
1071
+ 9.9A. foo
1072
+ EOS
1073
+ node.num.should == "9.9A"
1074
+
1075
+ node = parse :subsection, <<EOS
1076
+ 9.9bis foo
1077
+ EOS
1078
+ node.num.should == "9.9bis"
1079
+
1080
+ node = parse :subsection, <<EOS
1081
+ 9.9A foo
1082
+ EOS
1083
+ node.num.should == "9.9A"
1084
+ end
1085
+
968
1086
  it 'should handle dotted number sublists' do
969
1087
  node = parse(:subsection, <<EOS
970
1088
  9.9 foo
@@ -973,20 +1091,20 @@ EOS
973
1091
  9.9.2.1 item3
974
1092
  EOS
975
1093
  )
976
- to_xml(node, '', 1).should == '<subsection id="9.9">
1094
+ to_xml(node, '', 1).should == '<subsection eId="subsec_9-9">
977
1095
  <num>9.9</num>
978
1096
  <content>
979
1097
  <p>foo</p>
980
- <blockList id="9.9.list0" renest="true">
981
- <item id="9.9.list0.9.9.1">
1098
+ <blockList eId="subsec_9-9__list_1" renest="true">
1099
+ <item eId="subsec_9-9__list_1__item_9-9-1">
982
1100
  <num>9.9.1</num>
983
1101
  <p>item1</p>
984
1102
  </item>
985
- <item id="9.9.list0.9.9.2">
1103
+ <item eId="subsec_9-9__list_1__item_9-9-2">
986
1104
  <num>9.9.2</num>
987
1105
  <p>item2</p>
988
1106
  </item>
989
- <item id="9.9.list0.9.9.2.1">
1107
+ <item eId="subsec_9-9__list_1__item_9-9-2-1">
990
1108
  <num>9.9.2.1</num>
991
1109
  <p>item3</p>
992
1110
  </item>
@@ -1007,27 +1125,27 @@ EOS
1007
1125
  EOS
1008
1126
  )
1009
1127
 
1010
- to_xml(node, '', 1).should == '<subsection id="1">
1128
+ to_xml(node, '', 1).should == '<subsection eId="subsec_1">
1011
1129
  <num>(1)</num>
1012
1130
  <content>
1013
1131
  <p>a list</p>
1014
- <blockList id="1.list0" renest="true">
1015
- <item id="1.list0.a">
1132
+ <blockList eId="subsec_1__list_1" renest="true">
1133
+ <item eId="subsec_1__list_1__item_a">
1016
1134
  <num>(a)</num>
1017
1135
  <p>item 1</p>
1018
1136
  </item>
1019
- <item id="1.list0.b">
1137
+ <item eId="subsec_1__list_1__item_b">
1020
1138
  <num>(b)</num>
1021
1139
  <p>item 2</p>
1022
1140
  </item>
1023
1141
  </blockList>
1024
1142
  <p>some text</p>
1025
- <blockList id="1.list1" renest="true">
1026
- <item id="1.list1.c">
1143
+ <blockList eId="subsec_1__list_2" renest="true">
1144
+ <item eId="subsec_1__list_2__item_c">
1027
1145
  <num>(c)</num>
1028
1146
  <p>item 3</p>
1029
1147
  </item>
1030
- <item id="1.list1.d">
1148
+ <item eId="subsec_1__list_2__item_d">
1031
1149
  <num>(d)</num>
1032
1150
  <p>item 4</p>
1033
1151
  </item>
@@ -1047,7 +1165,7 @@ EOS
1047
1165
  EOS
1048
1166
  )
1049
1167
 
1050
- to_xml(node, '', 1).should == '<subsection id="1">
1168
+ to_xml(node, '', 1).should == '<subsection eId="subsec_1">
1051
1169
  <num>(1)</num>
1052
1170
  <content>
1053
1171
  <p>a subsection</p>
@@ -1068,16 +1186,16 @@ EOS
1068
1186
  (3) Part 1
1069
1187
  EOS
1070
1188
  to_xml(node).should == '<body>
1071
- <section id="section-1">
1189
+ <section eId="sec_1">
1072
1190
  <num>1.</num>
1073
1191
  <heading>Section</heading>
1074
- <subsection id="section-1.2">
1192
+ <subsection eId="sec_1__subsec_2">
1075
1193
  <num>(2)</num>
1076
1194
  <content>
1077
1195
  <p>Schedule 1 is cool.</p>
1078
1196
  </content>
1079
1197
  </subsection>
1080
- <subsection id="section-1.3">
1198
+ <subsection eId="sec_1__subsec_3">
1081
1199
  <num>(3)</num>
1082
1200
  <content>
1083
1201
  <p>Part 1</p>
@@ -1128,13 +1246,13 @@ baz
1128
1246
  </preface>'
1129
1247
 
1130
1248
  today = Time.now.strftime('%Y-%m-%d')
1131
- to_xml(node, "").should == '<act contains="originalVersion">
1249
+ to_xml(node, "").should == '<act contains="originalVersion" name="act">
1132
1250
  <meta>
1133
1251
  <identification source="#slaw">
1134
1252
  <FRBRWork>
1135
1253
  <FRBRthis value="/za/act/1980/01/main"/>
1136
1254
  <FRBRuri value="/za/act/1980/01"/>
1137
- <FRBRalias value="Short Title"/>
1255
+ <FRBRalias value="Short Title" name="title"/>
1138
1256
  <FRBRdate date="1980-01-01" name="Generation"/>
1139
1257
  <FRBRauthor href="#council"/>
1140
1258
  <FRBRcountry value="za"/>
@@ -1154,8 +1272,8 @@ baz
1154
1272
  </FRBRManifestation>
1155
1273
  </identification>
1156
1274
  <references source="#this">
1157
- <TLCOrganization id="slaw" href="https://github.com/longhotsummer/slaw" showAs="Slaw"/>
1158
- <TLCOrganization id="council" href="/ontology/organization/za/council" showAs="Council"/>
1275
+ <TLCOrganization eId="slaw" href="https://github.com/longhotsummer/slaw" showAs="Slaw"/>
1276
+ <TLCOrganization eId="council" href="/ontology/organization/za/council" showAs="Council"/>
1159
1277
  </references>
1160
1278
  </meta>
1161
1279
  <preface>
@@ -1166,10 +1284,10 @@ baz
1166
1284
  <p>baz</p>
1167
1285
  </preface>
1168
1286
  <body>
1169
- <section id="section-1">
1287
+ <section eId="sec_1">
1170
1288
  <num>1.</num>
1171
1289
  <heading>Section</heading>
1172
- <subsection id="section-1.1">
1290
+ <subsection eId="sec_1__subsec_1">
1173
1291
  <num>(1)</num>
1174
1292
  <content>
1175
1293
  <p>hello</p>
@@ -1299,11 +1417,11 @@ EOS
1299
1417
  <p>this is in the preamble</p>
1300
1418
  </preamble>'
1301
1419
  to_xml(node.body).should == '<body>
1302
- <paragraph id="paragraph0">
1420
+ <hcontainer eId="hcontainer_1">
1303
1421
  <content>
1304
1422
  <p>this is in the body</p>
1305
1423
  </content>
1306
- </paragraph>
1424
+ </hcontainer>
1307
1425
  </body>'
1308
1426
  end
1309
1427
  end
@@ -1389,12 +1507,12 @@ this is actually in the body
1389
1507
  EOS
1390
1508
 
1391
1509
  to_xml(node.body).should == '<body>
1392
- <paragraph id="paragraph0">
1510
+ <hcontainer eId="hcontainer_1">
1393
1511
  <content>
1394
1512
  <p>PREAMBLE</p>
1395
1513
  <p>this is actually in the body</p>
1396
1514
  </content>
1397
- </paragraph>
1515
+ </hcontainer>
1398
1516
  </body>'
1399
1517
  end
1400
1518
 
@@ -1410,12 +1528,12 @@ this is actually in the body
1410
1528
  EOS
1411
1529
 
1412
1530
  to_xml(node.body).should == '<body>
1413
- <paragraph id="paragraph0">
1531
+ <hcontainer eId="hcontainer_1">
1414
1532
  <content>
1415
1533
  <p>PREFACE</p>
1416
1534
  <p>this is actually in the body</p>
1417
1535
  </content>
1418
- </paragraph>
1536
+ </hcontainer>
1419
1537
  </body>'
1420
1538
  end
1421
1539
  end
@@ -1432,10 +1550,10 @@ Section
1432
1550
  EOS
1433
1551
 
1434
1552
  s = to_xml(node)
1435
- s.should == '<section id="section-1">
1553
+ s.should == '<section eId="sec_1">
1436
1554
  <num>1.</num>
1437
1555
  <heading>Section</heading>
1438
- <subsection id="section-1.1">
1556
+ <subsection eId="sec_1__subsec_1">
1439
1557
  <num>(1)</num>
1440
1558
  <content>
1441
1559
  <p>hello</p>
@@ -1451,10 +1569,10 @@ EOS
1451
1569
  (1) hello
1452
1570
  EOS
1453
1571
  s = to_xml(node)
1454
- s.should == '<section id="section-1">
1572
+ s.should == '<section eId="sec_1">
1455
1573
  <num>1.</num>
1456
1574
  <heading>Section</heading>
1457
- <subsection id="section-1.1">
1575
+ <subsection eId="sec_1__subsec_1">
1458
1576
  <num>(1)</num>
1459
1577
  <content>
1460
1578
  <p>hello</p>
@@ -1473,20 +1591,20 @@ EOS
1473
1591
  EOS
1474
1592
  s = to_xml(node)
1475
1593
  s.should == '<body>
1476
- <section id="section-1">
1594
+ <section eId="sec_1">
1477
1595
  <num>1.</num>
1478
1596
  <heading>A section</heading>
1479
- <subsection id="section-1.1">
1597
+ <subsection eId="sec_1__subsec_1">
1480
1598
  <num>(1)</num>
1481
1599
  <content>
1482
1600
  <p>hello</p>
1483
1601
  </content>
1484
1602
  </subsection>
1485
1603
  </section>
1486
- <section id="section-2">
1604
+ <section eId="sec_2">
1487
1605
  <num>2.</num>
1488
1606
  <heading>Another section</heading>
1489
- <subsection id="section-2.2">
1607
+ <subsection eId="sec_2__subsec_2">
1490
1608
  <num>(2)</num>
1491
1609
  <content>
1492
1610
  <p>Another line</p>
@@ -1503,16 +1621,16 @@ EOS
1503
1621
  (2) Without limiting generality, stuff.
1504
1622
  EOS
1505
1623
  s = to_xml(node)
1506
- s.should == '<section id="section-10">
1624
+ s.should == '<section eId="sec_10">
1507
1625
  <num>10.</num>
1508
1626
  <heading/>
1509
- <subsection id="section-10.1">
1627
+ <subsection eId="sec_10__subsec_1">
1510
1628
  <num>(1)</num>
1511
1629
  <content>
1512
1630
  <p>Transporters must remove medical waste.</p>
1513
1631
  </content>
1514
1632
  </subsection>
1515
- <subsection id="section-10.2">
1633
+ <subsection eId="sec_10__subsec_2">
1516
1634
  <num>(2)</num>
1517
1635
  <content>
1518
1636
  <p>Without limiting generality, stuff.</p>
@@ -1531,24 +1649,24 @@ and some stuff
1531
1649
  EOS
1532
1650
 
1533
1651
  s = to_xml(node)
1534
- s.should == '<section id="section-1">
1652
+ s.should == '<section eId="sec_1">
1535
1653
  <num>1.</num>
1536
1654
  <heading>Section</heading>
1537
- <paragraph id="section-1.paragraph0">
1655
+ <hcontainer eId="sec_1__hcontainer_1">
1538
1656
  <content>
1539
- <blockList id="section-1.paragraph0.list0" renest="true">
1540
- <item id="section-1.paragraph0.list0.a">
1657
+ <blockList eId="sec_1__hcontainer_1__list_1" renest="true">
1658
+ <item eId="sec_1__hcontainer_1__list_1__item_a">
1541
1659
  <num>(a)</num>
1542
1660
  <p>first</p>
1543
1661
  </item>
1544
- <item id="section-1.paragraph0.list0.b">
1662
+ <item eId="sec_1__hcontainer_1__list_1__item_b">
1545
1663
  <num>(b)</num>
1546
1664
  <p>second</p>
1547
1665
  </item>
1548
1666
  </blockList>
1549
1667
  <p>and some stuff</p>
1550
1668
  </content>
1551
- </paragraph>
1669
+ </hcontainer>
1552
1670
  </section>'
1553
1671
  end
1554
1672
 
@@ -1561,14 +1679,14 @@ something
1561
1679
  EOS
1562
1680
 
1563
1681
  s = to_xml(node)
1564
- s.should == '<section id="section-1">
1682
+ s.should == '<section eId="sec_1">
1565
1683
  <num>1.</num>
1566
1684
  <heading>Section <b>bold</b> <ref href="/za/act/1990/1">foo</ref></heading>
1567
- <paragraph id="section-1.paragraph0">
1685
+ <hcontainer eId="sec_1__hcontainer_1">
1568
1686
  <content>
1569
1687
  <p>something</p>
1570
1688
  </content>
1571
- </paragraph>
1689
+ </hcontainer>
1572
1690
  </section>'
1573
1691
  end
1574
1692
 
@@ -1582,14 +1700,14 @@ something
1582
1700
  EOS
1583
1701
 
1584
1702
  s = to_xml(node)
1585
- s.should == '<section id="section-1">
1703
+ s.should == '<section eId="sec_1">
1586
1704
  <num>1.</num>
1587
1705
  <heading>Section <b>bold</b> <ref href="/za/act/1990/1">foo</ref></heading>
1588
- <paragraph id="section-1.paragraph0">
1706
+ <hcontainer eId="sec_1__hcontainer_1">
1589
1707
  <content>
1590
1708
  <p>something</p>
1591
1709
  </content>
1592
- </paragraph>
1710
+ </hcontainer>
1593
1711
  </section>'
1594
1712
  end
1595
1713
 
@@ -1608,24 +1726,24 @@ naked statement (c) blah
1608
1726
  (a) foo
1609
1727
  (b) bar
1610
1728
  EOS
1611
- to_xml(node, "").should == '<section id="section-1">
1729
+ to_xml(node, "").should == '<section eId="sec_1">
1612
1730
  <num>1.</num>
1613
1731
  <heading>Section</heading>
1614
- <paragraph id="section-1.paragraph0">
1732
+ <hcontainer eId="sec_1__hcontainer_1">
1615
1733
  <content>
1616
1734
  <p>naked statement (c) blah</p>
1617
- <blockList id="section-1.paragraph0.list0" renest="true">
1618
- <item id="section-1.paragraph0.list0.a">
1735
+ <blockList eId="sec_1__hcontainer_1__list_1" renest="true">
1736
+ <item eId="sec_1__hcontainer_1__list_1__item_a">
1619
1737
  <num>(a)</num>
1620
1738
  <p>foo</p>
1621
1739
  </item>
1622
- <item id="section-1.paragraph0.list0.b">
1740
+ <item eId="sec_1__hcontainer_1__list_1__item_b">
1623
1741
  <num>(b)</num>
1624
1742
  <p>bar</p>
1625
1743
  </item>
1626
1744
  </blockList>
1627
1745
  </content>
1628
- </paragraph>
1746
+ </hcontainer>
1629
1747
  </section>'
1630
1748
  end
1631
1749
 
@@ -1643,25 +1761,25 @@ something
1643
1761
 
1644
1762
  (b) thing
1645
1763
  EOS
1646
- to_xml(node, "").should == '<section id="section-1">
1764
+ to_xml(node, "").should == '<section eId="sec_1">
1647
1765
  <num>1.</num>
1648
1766
  <heading>Section</heading>
1649
- <subsection id="section-1.1">
1767
+ <subsection eId="sec_1__subsec_1">
1650
1768
  <num>(1)</num>
1651
1769
  <content>
1652
1770
  <p>something</p>
1653
1771
  </content>
1654
1772
  </subsection>
1655
- <subsection id="section-1.2">
1773
+ <subsection eId="sec_1__subsec_2">
1656
1774
  <num>(2)</num>
1657
1775
  <content>
1658
1776
  <p>Schedule 1</p>
1659
- <blockList id="section-1.2.list0" renest="true">
1660
- <item id="section-1.2.list0.a">
1777
+ <blockList eId="sec_1__subsec_2__list_1" renest="true">
1778
+ <item eId="sec_1__subsec_2__list_1__item_a">
1661
1779
  <num>(a)</num>
1662
1780
  <p>Part 1</p>
1663
1781
  </item>
1664
- <item id="section-1.2.list0.b">
1782
+ <item eId="sec_1__subsec_2__list_1__item_b">
1665
1783
  <num>(b)</num>
1666
1784
  <p>thing</p>
1667
1785
  </item>
@@ -1680,17 +1798,17 @@ EOS
1680
1798
  stuff
1681
1799
  \\3. a third
1682
1800
  EOS
1683
- to_xml(node, "").should == '<section id="section-1">
1801
+ to_xml(node, "").should == '<section eId="sec_1">
1684
1802
  <num>1.</num>
1685
1803
  <heading>Section</heading>
1686
- <paragraph id="section-1.paragraph0">
1804
+ <hcontainer eId="sec_1__hcontainer_1">
1687
1805
  <content>
1688
1806
  <p>1. ignored</p>
1689
1807
  <p>2. another line</p>
1690
1808
  <p>stuff</p>
1691
1809
  <p>3. a third</p>
1692
1810
  </content>
1693
- </paragraph>
1811
+ </hcontainer>
1694
1812
  </section>'
1695
1813
  end
1696
1814
 
@@ -1702,14 +1820,14 @@ EOS
1702
1820
 
1703
1821
  stuff
1704
1822
  EOS
1705
- to_xml(node, "").should == '<section id="section-1">
1823
+ to_xml(node, "").should == '<section eId="sec_1">
1706
1824
  <num>1.</num>
1707
1825
  <heading>Section</heading>
1708
- <paragraph id="section-1.paragraph0">
1826
+ <hcontainer eId="sec_1__hcontainer_1">
1709
1827
  <content>
1710
1828
  <p>stuff</p>
1711
1829
  </content>
1712
- </paragraph>
1830
+ </hcontainer>
1713
1831
  </section>'
1714
1832
  end
1715
1833
 
@@ -1721,19 +1839,19 @@ Informal trading may include, amongst others:-
1721
1839
  3.1.1 street trading;
1722
1840
  3.1.2 trading in pedestrian malls;
1723
1841
  EOS
1724
- to_xml(node, '').should == '<section id="section-3">
1842
+ to_xml(node, '').should == '<section eId="sec_3">
1725
1843
  <num>3.</num>
1726
1844
  <heading>Types of informal trading</heading>
1727
- <subsection id="section-3.3.1">
1845
+ <subsection eId="sec_3__subsec_3-1">
1728
1846
  <num>3.1</num>
1729
1847
  <content>
1730
1848
  <p>Informal trading may include, amongst others:-</p>
1731
- <blockList id="section-3.3.1.list0" renest="true">
1732
- <item id="section-3.3.1.list0.3.1.1">
1849
+ <blockList eId="sec_3__subsec_3-1__list_1" renest="true">
1850
+ <item eId="sec_3__subsec_3-1__list_1__item_3-1-1">
1733
1851
  <num>3.1.1</num>
1734
1852
  <p>street trading;</p>
1735
1853
  </item>
1736
- <item id="section-3.3.1.list0.3.1.2">
1854
+ <item eId="sec_3__subsec_3-1__list_1__item_3-1-2">
1737
1855
  <num>3.1.2</num>
1738
1856
  <p>trading in pedestrian malls;</p>
1739
1857
  </item>
@@ -1750,7 +1868,7 @@ EOS
1750
1868
  context 'crossheadings' do
1751
1869
  it 'should handle a inline_items in crossheadings' do
1752
1870
  node = parse :crossheading, "CROSSHEADING something [[remark]] [link](/foo/bar)\n"
1753
- to_xml(node, '').should == '<hcontainer id="crossheading-0" name="crossheading">
1871
+ to_xml(node, '').should == '<hcontainer eId="hcontainer_1" name="crossheading">
1754
1872
  <heading>something <remark status="editorial">[remark]</remark> <ref href="/foo/bar">link</ref></heading>
1755
1873
  </hcontainer>'
1756
1874
  end
@@ -1768,13 +1886,13 @@ CROSSHEADING In the body
1768
1886
  Text
1769
1887
  '
1770
1888
  today = Time.now.strftime('%Y-%m-%d')
1771
- to_xml(node, "").should == '<act contains="originalVersion">
1889
+ to_xml(node, "").should == '<act contains="originalVersion" name="act">
1772
1890
  <meta>
1773
1891
  <identification source="#slaw">
1774
1892
  <FRBRWork>
1775
1893
  <FRBRthis value="/za/act/1980/01/main"/>
1776
1894
  <FRBRuri value="/za/act/1980/01"/>
1777
- <FRBRalias value="Short Title"/>
1895
+ <FRBRalias value="Short Title" name="title"/>
1778
1896
  <FRBRdate date="1980-01-01" name="Generation"/>
1779
1897
  <FRBRauthor href="#council"/>
1780
1898
  <FRBRcountry value="za"/>
@@ -1794,25 +1912,25 @@ Text
1794
1912
  </FRBRManifestation>
1795
1913
  </identification>
1796
1914
  <references source="#this">
1797
- <TLCOrganization id="slaw" href="https://github.com/longhotsummer/slaw" showAs="Slaw"/>
1798
- <TLCOrganization id="council" href="/ontology/organization/za/council" showAs="Council"/>
1915
+ <TLCOrganization eId="slaw" href="https://github.com/longhotsummer/slaw" showAs="Slaw"/>
1916
+ <TLCOrganization eId="council" href="/ontology/organization/za/council" showAs="Council"/>
1799
1917
  </references>
1800
1918
  </meta>
1801
1919
  <preface>
1802
1920
  <p>Some text</p>
1803
1921
  </preface>
1804
1922
  <body>
1805
- <hcontainer id="crossheading-0" name="crossheading">
1923
+ <hcontainer eId="hcontainer_1" name="crossheading">
1806
1924
  <heading>In the body</heading>
1807
1925
  </hcontainer>
1808
- <section id="section-1">
1926
+ <section eId="sec_1">
1809
1927
  <num>1.</num>
1810
1928
  <heading>Section 1</heading>
1811
- <paragraph id="section-1.paragraph0">
1929
+ <hcontainer eId="sec_1__hcontainer_1">
1812
1930
  <content>
1813
1931
  <p>Text</p>
1814
1932
  </content>
1815
- </paragraph>
1933
+ </hcontainer>
1816
1934
  </section>
1817
1935
  </body>
1818
1936
  </act>'
@@ -1831,13 +1949,13 @@ CROSSHEADING In the body
1831
1949
  Text
1832
1950
  '
1833
1951
  today = Time.now.strftime('%Y-%m-%d')
1834
- to_xml(node, "").should == '<act contains="originalVersion">
1952
+ to_xml(node, "").should == '<act contains="originalVersion" name="act">
1835
1953
  <meta>
1836
1954
  <identification source="#slaw">
1837
1955
  <FRBRWork>
1838
1956
  <FRBRthis value="/za/act/1980/01/main"/>
1839
1957
  <FRBRuri value="/za/act/1980/01"/>
1840
- <FRBRalias value="Short Title"/>
1958
+ <FRBRalias value="Short Title" name="title"/>
1841
1959
  <FRBRdate date="1980-01-01" name="Generation"/>
1842
1960
  <FRBRauthor href="#council"/>
1843
1961
  <FRBRcountry value="za"/>
@@ -1857,25 +1975,25 @@ Text
1857
1975
  </FRBRManifestation>
1858
1976
  </identification>
1859
1977
  <references source="#this">
1860
- <TLCOrganization id="slaw" href="https://github.com/longhotsummer/slaw" showAs="Slaw"/>
1861
- <TLCOrganization id="council" href="/ontology/organization/za/council" showAs="Council"/>
1978
+ <TLCOrganization eId="slaw" href="https://github.com/longhotsummer/slaw" showAs="Slaw"/>
1979
+ <TLCOrganization eId="council" href="/ontology/organization/za/council" showAs="Council"/>
1862
1980
  </references>
1863
1981
  </meta>
1864
1982
  <preamble>
1865
1983
  <p>Some text</p>
1866
1984
  </preamble>
1867
1985
  <body>
1868
- <hcontainer id="crossheading-0" name="crossheading">
1986
+ <hcontainer eId="hcontainer_1" name="crossheading">
1869
1987
  <heading>In the body</heading>
1870
1988
  </hcontainer>
1871
- <section id="section-1">
1989
+ <section eId="sec_1">
1872
1990
  <num>1.</num>
1873
1991
  <heading>Section 1</heading>
1874
- <paragraph id="section-1.paragraph0">
1992
+ <hcontainer eId="sec_1__hcontainer_1">
1875
1993
  <content>
1876
1994
  <p>Text</p>
1877
1995
  </content>
1878
- </paragraph>
1996
+ </hcontainer>
1879
1997
  </section>
1880
1998
  </body>
1881
1999
  </act>'
@@ -1939,14 +2057,14 @@ LONGTITLE a long title
1939
2057
  EOS
1940
2058
 
1941
2059
  to_xml(node).should == '<body>
1942
- <section id="section-1">
2060
+ <section eId="sec_1">
1943
2061
  <num>1.</num>
1944
2062
  <heading>Section</heading>
1945
- <paragraph id="section-1.paragraph0">
2063
+ <hcontainer eId="sec_1__hcontainer_1">
1946
2064
  <content>
1947
2065
  <p>LONGTITLE a long title</p>
1948
2066
  </content>
1949
- </paragraph>
2067
+ </hcontainer>
1950
2068
  </section>
1951
2069
  </body>'
1952
2070
  end