slaw 9.2.0 → 10.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/spec/xml_helpers.rb CHANGED
@@ -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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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" name="hcontainer">
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,26 +730,26 @@ 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" name="hcontainer">
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" name="hcontainer">
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
@@ -766,17 +766,17 @@ SUBPART 2 - Heading
766
766
  1. Section
767
767
  Hello there
768
768
  EOS
769
- to_xml(node).should == '<subpart id="subpart-2">
769
+ to_xml(node).should == '<subpart eId="subpart_2">
770
770
  <num>2</num>
771
771
  <heading>Heading</heading>
772
- <section id="section-1">
772
+ <section eId="sec_1">
773
773
  <num>1.</num>
774
774
  <heading>Section</heading>
775
- <paragraph id="section-1.paragraph0">
775
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
776
776
  <content>
777
777
  <p>Hello there</p>
778
778
  </content>
779
- </paragraph>
779
+ </hcontainer>
780
780
  </section>
781
781
  </subpart>'
782
782
  end
@@ -797,33 +797,33 @@ SUBPART 2 - The Subpart 2
797
797
 
798
798
  Bye
799
799
  EOS
800
- to_xml(node).should == '<part id="part-A">
800
+ to_xml(node).should == '<part eId="part_A">
801
801
  <num>A</num>
802
802
  <heading>The Part</heading>
803
- <subpart id="part-A.subpart-1">
803
+ <subpart eId="part_A__subpart_1">
804
804
  <num>1</num>
805
805
  <heading>The Subpart 1</heading>
806
- <section id="section-1">
806
+ <section eId="sec_1">
807
807
  <num>1.</num>
808
808
  <heading>Section</heading>
809
- <paragraph id="section-1.paragraph0">
809
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
810
810
  <content>
811
811
  <p>Hello</p>
812
812
  </content>
813
- </paragraph>
813
+ </hcontainer>
814
814
  </section>
815
815
  </subpart>
816
- <subpart id="part-A.subpart-2">
816
+ <subpart eId="part_A__subpart_2">
817
817
  <num>2</num>
818
818
  <heading>The Subpart 2</heading>
819
- <section id="section-2">
819
+ <section eId="sec_2">
820
820
  <num>2.</num>
821
821
  <heading>Section</heading>
822
- <paragraph id="section-2.paragraph0">
822
+ <hcontainer eId="sec_2__hcontainer_1" name="hcontainer">
823
823
  <content>
824
824
  <p>Bye</p>
825
825
  </content>
826
- </paragraph>
826
+ </hcontainer>
827
827
  </section>
828
828
  </subpart>
829
829
  </part>'
@@ -836,16 +836,16 @@ SUBPART - Heading - with a dash
836
836
  1. Section
837
837
  Hello there
838
838
  EOS
839
- to_xml(node).should == '<subpart id="subpart-0">
839
+ to_xml(node).should == '<subpart eId="subpart_1">
840
840
  <heading>Heading - with a dash</heading>
841
- <section id="section-1">
841
+ <section eId="sec_1">
842
842
  <num>1.</num>
843
843
  <heading>Section</heading>
844
- <paragraph id="section-1.paragraph0">
844
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
845
845
  <content>
846
846
  <p>Hello there</p>
847
847
  </content>
848
- </paragraph>
848
+ </hcontainer>
849
849
  </section>
850
850
  </subpart>'
851
851
  end
@@ -869,24 +869,24 @@ EOS
869
869
  (c) three
870
870
  (i) four
871
871
  EOS
872
- to_xml(node, "", 1).should == '<subsection id="2">
872
+ to_xml(node, "", 1).should == '<subsection eId="subsec_2">
873
873
  <num>(2)</num>
874
874
  <content>
875
875
  <p>title</p>
876
- <blockList id="2.list0" renest="true">
877
- <item id="2.list0.a">
876
+ <blockList eId="subsec_2__list_1" renest="true">
877
+ <item eId="subsec_2__list_1__item_a">
878
878
  <num>(a)</num>
879
879
  <p>one</p>
880
880
  </item>
881
- <item id="2.list0.b">
881
+ <item eId="subsec_2__list_1__item_b">
882
882
  <num>(b)</num>
883
883
  <p>two</p>
884
884
  </item>
885
- <item id="2.list0.c">
885
+ <item eId="subsec_2__list_1__item_c">
886
886
  <num>(c)</num>
887
887
  <p>three</p>
888
888
  </item>
889
- <item id="2.list0.i">
889
+ <item eId="subsec_2__list_1__item_i">
890
890
  <num>(i)</num>
891
891
  <p>four</p>
892
892
  </item>
@@ -903,23 +903,23 @@ EOS
903
903
  (i) four
904
904
  EOS
905
905
  )
906
- to_xml(node, "", 1).should == '<subsection id="1">
906
+ to_xml(node, "", 1).should == '<subsection eId="subsec_1">
907
907
  <num>(1)</num>
908
908
  <content>
909
- <blockList id="1.list0" renest="true">
910
- <item id="1.list0.a">
909
+ <blockList eId="subsec_1__list_1" renest="true">
910
+ <item eId="subsec_1__list_1__item_a">
911
911
  <num>(a)</num>
912
912
  <p>one</p>
913
913
  </item>
914
- <item id="1.list0.b">
914
+ <item eId="subsec_1__list_1__item_b">
915
915
  <num>(b)</num>
916
916
  <p>two</p>
917
917
  </item>
918
- <item id="1.list0.c">
918
+ <item eId="subsec_1__list_1__item_c">
919
919
  <num>(c)</num>
920
920
  <p>three</p>
921
921
  </item>
922
- <item id="1.list0.i">
922
+ <item eId="subsec_1__list_1__item_i">
923
923
  <num>(i)</num>
924
924
  <p>four</p>
925
925
  </item>
@@ -935,15 +935,15 @@ EOS
935
935
  (b) two
936
936
  EOS
937
937
  )
938
- to_xml(node, "", 1).should == '<subsection id="1">
938
+ to_xml(node, "", 1).should == '<subsection eId="subsec_1">
939
939
  <num>(1)</num>
940
940
  <content>
941
- <blockList id="1.list0" renest="true">
942
- <item id="1.list0.a">
941
+ <blockList eId="subsec_1__list_1" renest="true">
942
+ <item eId="subsec_1__list_1__item_a">
943
943
  <num>(a)</num>
944
944
  <p>one</p>
945
945
  </item>
946
- <item id="1.list0.b">
946
+ <item eId="subsec_1__list_1__item_b">
947
947
  <num>(b)</num>
948
948
  <p>two</p>
949
949
  </item>
@@ -961,22 +961,22 @@ EOS
961
961
  (3) third
962
962
  EOS
963
963
  )
964
- to_xml(node).should == '<section id="section-1">
964
+ to_xml(node).should == '<section eId="sec_1">
965
965
  <num>1.</num>
966
966
  <heading>Section</heading>
967
- <subsection id="section-1.1">
967
+ <subsection eId="sec_1__subsec_1">
968
968
  <num>(1)</num>
969
969
  <content>
970
970
  <p/>
971
971
  </content>
972
972
  </subsection>
973
- <subsection id="section-1.2">
973
+ <subsection eId="sec_1__subsec_2">
974
974
  <num>(2)</num>
975
975
  <content>
976
976
  <p>next line</p>
977
977
  </content>
978
978
  </subsection>
979
- <subsection id="section-1.3">
979
+ <subsection eId="sec_1__subsec_3">
980
980
  <num>(3)</num>
981
981
  <content>
982
982
  <p>third</p>
@@ -993,24 +993,24 @@ EOS
993
993
  (ii) double
994
994
  EOS
995
995
  )
996
- to_xml(node, "", 1).should == '<subsection id="1">
996
+ to_xml(node, "", 1).should == '<subsection eId="subsec_1">
997
997
  <num>(1)</num>
998
998
  <content>
999
999
  <p>here\'s my really cool list,</p>
1000
- <blockList id="1.list0" renest="true">
1001
- <item id="1.list0.a">
1000
+ <blockList eId="subsec_1__list_1" renest="true">
1001
+ <item eId="subsec_1__list_1__item_a">
1002
1002
  <num>(a)</num>
1003
1003
  <p>one</p>
1004
1004
  </item>
1005
- <item id="1.list0.b">
1005
+ <item eId="subsec_1__list_1__item_b">
1006
1006
  <num>(b)</num>
1007
1007
  <p/>
1008
1008
  </item>
1009
- <item id="1.list0.i">
1009
+ <item eId="subsec_1__list_1__item_i">
1010
1010
  <num>(i)</num>
1011
1011
  <p>single</p>
1012
1012
  </item>
1013
- <item id="1.list0.ii">
1013
+ <item eId="subsec_1__list_1__item_ii">
1014
1014
  <num>(ii)</num>
1015
1015
  <p>double</p>
1016
1016
  </item>
@@ -1027,24 +1027,24 @@ EOS
1027
1027
  (ii) double
1028
1028
  EOS
1029
1029
  )
1030
- to_xml(node, "", 1).should == '<subsection id="1">
1030
+ to_xml(node, "", 1).should == '<subsection eId="subsec_1">
1031
1031
  <num>(1)</num>
1032
1032
  <content>
1033
1033
  <p>here\'s my really cool list,</p>
1034
- <blockList id="1.list0" renest="true">
1035
- <item id="1.list0.a">
1034
+ <blockList eId="subsec_1__list_1" renest="true">
1035
+ <item eId="subsec_1__list_1__item_a">
1036
1036
  <num>(a)</num>
1037
1037
  <p/>
1038
1038
  </item>
1039
- <item id="1.list0.b">
1039
+ <item eId="subsec_1__list_1__item_b">
1040
1040
  <num>(b)</num>
1041
1041
  <p/>
1042
1042
  </item>
1043
- <item id="1.list0.i">
1043
+ <item eId="subsec_1__list_1__item_i">
1044
1044
  <num>(i)</num>
1045
1045
  <p>single</p>
1046
1046
  </item>
1047
- <item id="1.list0.ii">
1047
+ <item eId="subsec_1__list_1__item_ii">
1048
1048
  <num>(ii)</num>
1049
1049
  <p>double</p>
1050
1050
  </item>
@@ -1091,20 +1091,20 @@ EOS
1091
1091
  9.9.2.1 item3
1092
1092
  EOS
1093
1093
  )
1094
- to_xml(node, '', 1).should == '<subsection id="9.9">
1094
+ to_xml(node, '', 1).should == '<subsection eId="subsec_9-9">
1095
1095
  <num>9.9</num>
1096
1096
  <content>
1097
1097
  <p>foo</p>
1098
- <blockList id="9.9.list0" renest="true">
1099
- <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">
1100
1100
  <num>9.9.1</num>
1101
1101
  <p>item1</p>
1102
1102
  </item>
1103
- <item id="9.9.list0.9.9.2">
1103
+ <item eId="subsec_9-9__list_1__item_9-9-2">
1104
1104
  <num>9.9.2</num>
1105
1105
  <p>item2</p>
1106
1106
  </item>
1107
- <item id="9.9.list0.9.9.2.1">
1107
+ <item eId="subsec_9-9__list_1__item_9-9-2-1">
1108
1108
  <num>9.9.2.1</num>
1109
1109
  <p>item3</p>
1110
1110
  </item>
@@ -1125,27 +1125,27 @@ EOS
1125
1125
  EOS
1126
1126
  )
1127
1127
 
1128
- to_xml(node, '', 1).should == '<subsection id="1">
1128
+ to_xml(node, '', 1).should == '<subsection eId="subsec_1">
1129
1129
  <num>(1)</num>
1130
1130
  <content>
1131
1131
  <p>a list</p>
1132
- <blockList id="1.list0" renest="true">
1133
- <item id="1.list0.a">
1132
+ <blockList eId="subsec_1__list_1" renest="true">
1133
+ <item eId="subsec_1__list_1__item_a">
1134
1134
  <num>(a)</num>
1135
1135
  <p>item 1</p>
1136
1136
  </item>
1137
- <item id="1.list0.b">
1137
+ <item eId="subsec_1__list_1__item_b">
1138
1138
  <num>(b)</num>
1139
1139
  <p>item 2</p>
1140
1140
  </item>
1141
1141
  </blockList>
1142
1142
  <p>some text</p>
1143
- <blockList id="1.list1" renest="true">
1144
- <item id="1.list1.c">
1143
+ <blockList eId="subsec_1__list_2" renest="true">
1144
+ <item eId="subsec_1__list_2__item_c">
1145
1145
  <num>(c)</num>
1146
1146
  <p>item 3</p>
1147
1147
  </item>
1148
- <item id="1.list1.d">
1148
+ <item eId="subsec_1__list_2__item_d">
1149
1149
  <num>(d)</num>
1150
1150
  <p>item 4</p>
1151
1151
  </item>
@@ -1165,7 +1165,7 @@ EOS
1165
1165
  EOS
1166
1166
  )
1167
1167
 
1168
- to_xml(node, '', 1).should == '<subsection id="1">
1168
+ to_xml(node, '', 1).should == '<subsection eId="subsec_1">
1169
1169
  <num>(1)</num>
1170
1170
  <content>
1171
1171
  <p>a subsection</p>
@@ -1186,16 +1186,16 @@ EOS
1186
1186
  (3) Part 1
1187
1187
  EOS
1188
1188
  to_xml(node).should == '<body>
1189
- <section id="section-1">
1189
+ <section eId="sec_1">
1190
1190
  <num>1.</num>
1191
1191
  <heading>Section</heading>
1192
- <subsection id="section-1.2">
1192
+ <subsection eId="sec_1__subsec_2">
1193
1193
  <num>(2)</num>
1194
1194
  <content>
1195
1195
  <p>Schedule 1 is cool.</p>
1196
1196
  </content>
1197
1197
  </subsection>
1198
- <subsection id="section-1.3">
1198
+ <subsection eId="sec_1__subsec_3">
1199
1199
  <num>(3)</num>
1200
1200
  <content>
1201
1201
  <p>Part 1</p>
@@ -1246,13 +1246,13 @@ baz
1246
1246
  </preface>'
1247
1247
 
1248
1248
  today = Time.now.strftime('%Y-%m-%d')
1249
- to_xml(node, "").should == '<act contains="originalVersion">
1249
+ to_xml(node, "").should == '<act contains="originalVersion" name="act">
1250
1250
  <meta>
1251
1251
  <identification source="#slaw">
1252
1252
  <FRBRWork>
1253
1253
  <FRBRthis value="/za/act/1980/01/main"/>
1254
1254
  <FRBRuri value="/za/act/1980/01"/>
1255
- <FRBRalias value="Short Title"/>
1255
+ <FRBRalias value="Short Title" name="title"/>
1256
1256
  <FRBRdate date="1980-01-01" name="Generation"/>
1257
1257
  <FRBRauthor href="#council"/>
1258
1258
  <FRBRcountry value="za"/>
@@ -1272,8 +1272,8 @@ baz
1272
1272
  </FRBRManifestation>
1273
1273
  </identification>
1274
1274
  <references source="#this">
1275
- <TLCOrganization id="slaw" href="https://github.com/longhotsummer/slaw" showAs="Slaw"/>
1276
- <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"/>
1277
1277
  </references>
1278
1278
  </meta>
1279
1279
  <preface>
@@ -1284,10 +1284,10 @@ baz
1284
1284
  <p>baz</p>
1285
1285
  </preface>
1286
1286
  <body>
1287
- <section id="section-1">
1287
+ <section eId="sec_1">
1288
1288
  <num>1.</num>
1289
1289
  <heading>Section</heading>
1290
- <subsection id="section-1.1">
1290
+ <subsection eId="sec_1__subsec_1">
1291
1291
  <num>(1)</num>
1292
1292
  <content>
1293
1293
  <p>hello</p>
@@ -1417,11 +1417,11 @@ EOS
1417
1417
  <p>this is in the preamble</p>
1418
1418
  </preamble>'
1419
1419
  to_xml(node.body).should == '<body>
1420
- <paragraph id="paragraph0">
1420
+ <hcontainer eId="hcontainer_1" name="hcontainer">
1421
1421
  <content>
1422
1422
  <p>this is in the body</p>
1423
1423
  </content>
1424
- </paragraph>
1424
+ </hcontainer>
1425
1425
  </body>'
1426
1426
  end
1427
1427
  end
@@ -1507,12 +1507,12 @@ this is actually in the body
1507
1507
  EOS
1508
1508
 
1509
1509
  to_xml(node.body).should == '<body>
1510
- <paragraph id="paragraph0">
1510
+ <hcontainer eId="hcontainer_1" name="hcontainer">
1511
1511
  <content>
1512
1512
  <p>PREAMBLE</p>
1513
1513
  <p>this is actually in the body</p>
1514
1514
  </content>
1515
- </paragraph>
1515
+ </hcontainer>
1516
1516
  </body>'
1517
1517
  end
1518
1518
 
@@ -1528,12 +1528,12 @@ this is actually in the body
1528
1528
  EOS
1529
1529
 
1530
1530
  to_xml(node.body).should == '<body>
1531
- <paragraph id="paragraph0">
1531
+ <hcontainer eId="hcontainer_1" name="hcontainer">
1532
1532
  <content>
1533
1533
  <p>PREFACE</p>
1534
1534
  <p>this is actually in the body</p>
1535
1535
  </content>
1536
- </paragraph>
1536
+ </hcontainer>
1537
1537
  </body>'
1538
1538
  end
1539
1539
  end
@@ -1550,10 +1550,10 @@ Section
1550
1550
  EOS
1551
1551
 
1552
1552
  s = to_xml(node)
1553
- s.should == '<section id="section-1">
1553
+ s.should == '<section eId="sec_1">
1554
1554
  <num>1.</num>
1555
1555
  <heading>Section</heading>
1556
- <subsection id="section-1.1">
1556
+ <subsection eId="sec_1__subsec_1">
1557
1557
  <num>(1)</num>
1558
1558
  <content>
1559
1559
  <p>hello</p>
@@ -1569,10 +1569,10 @@ EOS
1569
1569
  (1) hello
1570
1570
  EOS
1571
1571
  s = to_xml(node)
1572
- s.should == '<section id="section-1">
1572
+ s.should == '<section eId="sec_1">
1573
1573
  <num>1.</num>
1574
1574
  <heading>Section</heading>
1575
- <subsection id="section-1.1">
1575
+ <subsection eId="sec_1__subsec_1">
1576
1576
  <num>(1)</num>
1577
1577
  <content>
1578
1578
  <p>hello</p>
@@ -1591,20 +1591,20 @@ EOS
1591
1591
  EOS
1592
1592
  s = to_xml(node)
1593
1593
  s.should == '<body>
1594
- <section id="section-1">
1594
+ <section eId="sec_1">
1595
1595
  <num>1.</num>
1596
1596
  <heading>A section</heading>
1597
- <subsection id="section-1.1">
1597
+ <subsection eId="sec_1__subsec_1">
1598
1598
  <num>(1)</num>
1599
1599
  <content>
1600
1600
  <p>hello</p>
1601
1601
  </content>
1602
1602
  </subsection>
1603
1603
  </section>
1604
- <section id="section-2">
1604
+ <section eId="sec_2">
1605
1605
  <num>2.</num>
1606
1606
  <heading>Another section</heading>
1607
- <subsection id="section-2.2">
1607
+ <subsection eId="sec_2__subsec_2">
1608
1608
  <num>(2)</num>
1609
1609
  <content>
1610
1610
  <p>Another line</p>
@@ -1621,16 +1621,16 @@ EOS
1621
1621
  (2) Without limiting generality, stuff.
1622
1622
  EOS
1623
1623
  s = to_xml(node)
1624
- s.should == '<section id="section-10">
1624
+ s.should == '<section eId="sec_10">
1625
1625
  <num>10.</num>
1626
1626
  <heading/>
1627
- <subsection id="section-10.1">
1627
+ <subsection eId="sec_10__subsec_1">
1628
1628
  <num>(1)</num>
1629
1629
  <content>
1630
1630
  <p>Transporters must remove medical waste.</p>
1631
1631
  </content>
1632
1632
  </subsection>
1633
- <subsection id="section-10.2">
1633
+ <subsection eId="sec_10__subsec_2">
1634
1634
  <num>(2)</num>
1635
1635
  <content>
1636
1636
  <p>Without limiting generality, stuff.</p>
@@ -1649,24 +1649,24 @@ and some stuff
1649
1649
  EOS
1650
1650
 
1651
1651
  s = to_xml(node)
1652
- s.should == '<section id="section-1">
1652
+ s.should == '<section eId="sec_1">
1653
1653
  <num>1.</num>
1654
1654
  <heading>Section</heading>
1655
- <paragraph id="section-1.paragraph0">
1655
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
1656
1656
  <content>
1657
- <blockList id="section-1.paragraph0.list0" renest="true">
1658
- <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">
1659
1659
  <num>(a)</num>
1660
1660
  <p>first</p>
1661
1661
  </item>
1662
- <item id="section-1.paragraph0.list0.b">
1662
+ <item eId="sec_1__hcontainer_1__list_1__item_b">
1663
1663
  <num>(b)</num>
1664
1664
  <p>second</p>
1665
1665
  </item>
1666
1666
  </blockList>
1667
1667
  <p>and some stuff</p>
1668
1668
  </content>
1669
- </paragraph>
1669
+ </hcontainer>
1670
1670
  </section>'
1671
1671
  end
1672
1672
 
@@ -1679,14 +1679,14 @@ something
1679
1679
  EOS
1680
1680
 
1681
1681
  s = to_xml(node)
1682
- s.should == '<section id="section-1">
1682
+ s.should == '<section eId="sec_1">
1683
1683
  <num>1.</num>
1684
1684
  <heading>Section <b>bold</b> <ref href="/za/act/1990/1">foo</ref></heading>
1685
- <paragraph id="section-1.paragraph0">
1685
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
1686
1686
  <content>
1687
1687
  <p>something</p>
1688
1688
  </content>
1689
- </paragraph>
1689
+ </hcontainer>
1690
1690
  </section>'
1691
1691
  end
1692
1692
 
@@ -1700,14 +1700,14 @@ something
1700
1700
  EOS
1701
1701
 
1702
1702
  s = to_xml(node)
1703
- s.should == '<section id="section-1">
1703
+ s.should == '<section eId="sec_1">
1704
1704
  <num>1.</num>
1705
1705
  <heading>Section <b>bold</b> <ref href="/za/act/1990/1">foo</ref></heading>
1706
- <paragraph id="section-1.paragraph0">
1706
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
1707
1707
  <content>
1708
1708
  <p>something</p>
1709
1709
  </content>
1710
- </paragraph>
1710
+ </hcontainer>
1711
1711
  </section>'
1712
1712
  end
1713
1713
 
@@ -1726,24 +1726,24 @@ naked statement (c) blah
1726
1726
  (a) foo
1727
1727
  (b) bar
1728
1728
  EOS
1729
- to_xml(node, "").should == '<section id="section-1">
1729
+ to_xml(node, "").should == '<section eId="sec_1">
1730
1730
  <num>1.</num>
1731
1731
  <heading>Section</heading>
1732
- <paragraph id="section-1.paragraph0">
1732
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
1733
1733
  <content>
1734
1734
  <p>naked statement (c) blah</p>
1735
- <blockList id="section-1.paragraph0.list0" renest="true">
1736
- <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">
1737
1737
  <num>(a)</num>
1738
1738
  <p>foo</p>
1739
1739
  </item>
1740
- <item id="section-1.paragraph0.list0.b">
1740
+ <item eId="sec_1__hcontainer_1__list_1__item_b">
1741
1741
  <num>(b)</num>
1742
1742
  <p>bar</p>
1743
1743
  </item>
1744
1744
  </blockList>
1745
1745
  </content>
1746
- </paragraph>
1746
+ </hcontainer>
1747
1747
  </section>'
1748
1748
  end
1749
1749
 
@@ -1761,25 +1761,25 @@ something
1761
1761
 
1762
1762
  (b) thing
1763
1763
  EOS
1764
- to_xml(node, "").should == '<section id="section-1">
1764
+ to_xml(node, "").should == '<section eId="sec_1">
1765
1765
  <num>1.</num>
1766
1766
  <heading>Section</heading>
1767
- <subsection id="section-1.1">
1767
+ <subsection eId="sec_1__subsec_1">
1768
1768
  <num>(1)</num>
1769
1769
  <content>
1770
1770
  <p>something</p>
1771
1771
  </content>
1772
1772
  </subsection>
1773
- <subsection id="section-1.2">
1773
+ <subsection eId="sec_1__subsec_2">
1774
1774
  <num>(2)</num>
1775
1775
  <content>
1776
1776
  <p>Schedule 1</p>
1777
- <blockList id="section-1.2.list0" renest="true">
1778
- <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">
1779
1779
  <num>(a)</num>
1780
1780
  <p>Part 1</p>
1781
1781
  </item>
1782
- <item id="section-1.2.list0.b">
1782
+ <item eId="sec_1__subsec_2__list_1__item_b">
1783
1783
  <num>(b)</num>
1784
1784
  <p>thing</p>
1785
1785
  </item>
@@ -1798,17 +1798,17 @@ EOS
1798
1798
  stuff
1799
1799
  \\3. a third
1800
1800
  EOS
1801
- to_xml(node, "").should == '<section id="section-1">
1801
+ to_xml(node, "").should == '<section eId="sec_1">
1802
1802
  <num>1.</num>
1803
1803
  <heading>Section</heading>
1804
- <paragraph id="section-1.paragraph0">
1804
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
1805
1805
  <content>
1806
1806
  <p>1. ignored</p>
1807
1807
  <p>2. another line</p>
1808
1808
  <p>stuff</p>
1809
1809
  <p>3. a third</p>
1810
1810
  </content>
1811
- </paragraph>
1811
+ </hcontainer>
1812
1812
  </section>'
1813
1813
  end
1814
1814
 
@@ -1820,14 +1820,14 @@ EOS
1820
1820
 
1821
1821
  stuff
1822
1822
  EOS
1823
- to_xml(node, "").should == '<section id="section-1">
1823
+ to_xml(node, "").should == '<section eId="sec_1">
1824
1824
  <num>1.</num>
1825
1825
  <heading>Section</heading>
1826
- <paragraph id="section-1.paragraph0">
1826
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
1827
1827
  <content>
1828
1828
  <p>stuff</p>
1829
1829
  </content>
1830
- </paragraph>
1830
+ </hcontainer>
1831
1831
  </section>'
1832
1832
  end
1833
1833
 
@@ -1839,19 +1839,19 @@ Informal trading may include, amongst others:-
1839
1839
  3.1.1 street trading;
1840
1840
  3.1.2 trading in pedestrian malls;
1841
1841
  EOS
1842
- to_xml(node, '').should == '<section id="section-3">
1842
+ to_xml(node, '').should == '<section eId="sec_3">
1843
1843
  <num>3.</num>
1844
1844
  <heading>Types of informal trading</heading>
1845
- <subsection id="section-3.3.1">
1845
+ <subsection eId="sec_3__subsec_3-1">
1846
1846
  <num>3.1</num>
1847
1847
  <content>
1848
1848
  <p>Informal trading may include, amongst others:-</p>
1849
- <blockList id="section-3.3.1.list0" renest="true">
1850
- <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">
1851
1851
  <num>3.1.1</num>
1852
1852
  <p>street trading;</p>
1853
1853
  </item>
1854
- <item id="section-3.3.1.list0.3.1.2">
1854
+ <item eId="sec_3__subsec_3-1__list_1__item_3-1-2">
1855
1855
  <num>3.1.2</num>
1856
1856
  <p>trading in pedestrian malls;</p>
1857
1857
  </item>
@@ -1868,7 +1868,7 @@ EOS
1868
1868
  context 'crossheadings' do
1869
1869
  it 'should handle a inline_items in crossheadings' do
1870
1870
  node = parse :crossheading, "CROSSHEADING something [[remark]] [link](/foo/bar)\n"
1871
- to_xml(node, '').should == '<hcontainer id="crossheading-0" name="crossheading">
1871
+ to_xml(node, '').should == '<hcontainer eId="hcontainer_1" name="crossheading">
1872
1872
  <heading>something <remark status="editorial">[remark]</remark> <ref href="/foo/bar">link</ref></heading>
1873
1873
  </hcontainer>'
1874
1874
  end
@@ -1886,13 +1886,13 @@ CROSSHEADING In the body
1886
1886
  Text
1887
1887
  '
1888
1888
  today = Time.now.strftime('%Y-%m-%d')
1889
- to_xml(node, "").should == '<act contains="originalVersion">
1889
+ to_xml(node, "").should == '<act contains="originalVersion" name="act">
1890
1890
  <meta>
1891
1891
  <identification source="#slaw">
1892
1892
  <FRBRWork>
1893
1893
  <FRBRthis value="/za/act/1980/01/main"/>
1894
1894
  <FRBRuri value="/za/act/1980/01"/>
1895
- <FRBRalias value="Short Title"/>
1895
+ <FRBRalias value="Short Title" name="title"/>
1896
1896
  <FRBRdate date="1980-01-01" name="Generation"/>
1897
1897
  <FRBRauthor href="#council"/>
1898
1898
  <FRBRcountry value="za"/>
@@ -1912,25 +1912,25 @@ Text
1912
1912
  </FRBRManifestation>
1913
1913
  </identification>
1914
1914
  <references source="#this">
1915
- <TLCOrganization id="slaw" href="https://github.com/longhotsummer/slaw" showAs="Slaw"/>
1916
- <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"/>
1917
1917
  </references>
1918
1918
  </meta>
1919
1919
  <preface>
1920
1920
  <p>Some text</p>
1921
1921
  </preface>
1922
1922
  <body>
1923
- <hcontainer id="crossheading-0" name="crossheading">
1923
+ <hcontainer eId="hcontainer_1" name="crossheading">
1924
1924
  <heading>In the body</heading>
1925
1925
  </hcontainer>
1926
- <section id="section-1">
1926
+ <section eId="sec_1">
1927
1927
  <num>1.</num>
1928
1928
  <heading>Section 1</heading>
1929
- <paragraph id="section-1.paragraph0">
1929
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
1930
1930
  <content>
1931
1931
  <p>Text</p>
1932
1932
  </content>
1933
- </paragraph>
1933
+ </hcontainer>
1934
1934
  </section>
1935
1935
  </body>
1936
1936
  </act>'
@@ -1949,13 +1949,13 @@ CROSSHEADING In the body
1949
1949
  Text
1950
1950
  '
1951
1951
  today = Time.now.strftime('%Y-%m-%d')
1952
- to_xml(node, "").should == '<act contains="originalVersion">
1952
+ to_xml(node, "").should == '<act contains="originalVersion" name="act">
1953
1953
  <meta>
1954
1954
  <identification source="#slaw">
1955
1955
  <FRBRWork>
1956
1956
  <FRBRthis value="/za/act/1980/01/main"/>
1957
1957
  <FRBRuri value="/za/act/1980/01"/>
1958
- <FRBRalias value="Short Title"/>
1958
+ <FRBRalias value="Short Title" name="title"/>
1959
1959
  <FRBRdate date="1980-01-01" name="Generation"/>
1960
1960
  <FRBRauthor href="#council"/>
1961
1961
  <FRBRcountry value="za"/>
@@ -1975,25 +1975,25 @@ Text
1975
1975
  </FRBRManifestation>
1976
1976
  </identification>
1977
1977
  <references source="#this">
1978
- <TLCOrganization id="slaw" href="https://github.com/longhotsummer/slaw" showAs="Slaw"/>
1979
- <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"/>
1980
1980
  </references>
1981
1981
  </meta>
1982
1982
  <preamble>
1983
1983
  <p>Some text</p>
1984
1984
  </preamble>
1985
1985
  <body>
1986
- <hcontainer id="crossheading-0" name="crossheading">
1986
+ <hcontainer eId="hcontainer_1" name="crossheading">
1987
1987
  <heading>In the body</heading>
1988
1988
  </hcontainer>
1989
- <section id="section-1">
1989
+ <section eId="sec_1">
1990
1990
  <num>1.</num>
1991
1991
  <heading>Section 1</heading>
1992
- <paragraph id="section-1.paragraph0">
1992
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
1993
1993
  <content>
1994
1994
  <p>Text</p>
1995
1995
  </content>
1996
- </paragraph>
1996
+ </hcontainer>
1997
1997
  </section>
1998
1998
  </body>
1999
1999
  </act>'
@@ -2057,14 +2057,14 @@ LONGTITLE a long title
2057
2057
  EOS
2058
2058
 
2059
2059
  to_xml(node).should == '<body>
2060
- <section id="section-1">
2060
+ <section eId="sec_1">
2061
2061
  <num>1.</num>
2062
2062
  <heading>Section</heading>
2063
- <paragraph id="section-1.paragraph0">
2063
+ <hcontainer eId="sec_1__hcontainer_1" name="hcontainer">
2064
2064
  <content>
2065
2065
  <p>LONGTITLE a long title</p>
2066
2066
  </content>
2067
- </paragraph>
2067
+ </hcontainer>
2068
2068
  </section>
2069
2069
  </body>'
2070
2070
  end