xrust 2.0.3

Support for XPath and XSLT
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
/*

Sun Microsystems test cases

*/
#[cfg(all(test, feature = "test-conformance-xml"))]
use std::fs;
#[cfg(all(test, feature = "test-conformance-xml"))]
use xrust::item::Node;
#[cfg(all(test, feature = "test-conformance-xml"))]
use xrust::parser::{ParseError, ParserStateBuilder, StaticStateBuilder, xml};
#[cfg(all(test, feature = "test-conformance-xml"))]
use xrust::trees::smite::RNode;
#[cfg(all(test, feature = "test-conformance-xml"))]
use xrust::{Error, ErrorKind};

#[cfg(all(test, feature = "test-conformance-xml"))]
fn test_sun_notwf(xmldoc: &str) {
    let testxml = RNode::new_document();
    let parseresult = xml::parse(
        testxml,
        xmldoc,
        Some(|_: &_| Err(ParseError::MissingNameSpace)),
    );

    assert!(parseresult.is_err());
}
#[cfg(all(test, feature = "test-conformance-xml"))]
fn dtdfileresolve() -> fn(Option<String>, String) -> Result<String, Error> {
    move |locdir, uri| {
        let u = match locdir {
            None => uri,
            Some(ld) => ld + uri.as_str(),
        };
        match fs::read_to_string(u) {
            Err(_) => Err(Error::new(
                ErrorKind::Unknown,
                "Unable to read external DTD".to_string(),
            )),
            Ok(s) => Ok(s),
        }
    }
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn notwfsa03() {
    /*
        Test ID:not-wf-sa03
        Test URI:not-wf/not-sa03.xml
        Spec Sections:2.9
        Description:Tests the Entity Declared WFC, ensuring that a reference to externally defined entity causes a well-formedness error.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/not-sa03.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist01() {
    /*
        Test ID:attlist01
        Test URI:not-wf/attlist01.xml
        Spec Sections:3.3.1 [56]
        Description:SGML's NUTOKEN is not allowed.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist01.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist02() {
    /*
        Test ID:attlist02
        Test URI:not-wf/attlist02.xml
        Spec Sections:3.3.1 [56]
        Description:SGML's NUTOKENS attribute type is not allowed.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist02.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist03() {
    /*
        Test ID:attlist03
        Test URI:not-wf/attlist03.xml
        Spec Sections:3.3.1 [59]
        Description:Comma doesn't separate enumerations, unlike in SGML.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist03.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist04() {
    /*
        Test ID:attlist04
        Test URI:not-wf/attlist04.xml
        Spec Sections:3.3.1 [56]
        Description:SGML's NUMBER attribute type is not allowed.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist04.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist05() {
    /*
        Test ID:attlist05
        Test URI:not-wf/attlist05.xml
        Spec Sections:3.3.1 [56]
        Description:SGML's NUMBERS attribute type is not allowed.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist05.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist06() {
    /*
        Test ID:attlist06
        Test URI:not-wf/attlist06.xml
        Spec Sections:3.3.1 [56]
        Description:SGML's NAME attribute type is not allowed.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist06.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist07() {
    /*
        Test ID:attlist07
        Test URI:not-wf/attlist07.xml
        Spec Sections:3.3.1 [56]
        Description:SGML's NAMES attribute type is not allowed.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist07.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist08() {
    /*
        Test ID:attlist08
        Test URI:not-wf/attlist08.xml
        Spec Sections:3.3.1 [56]
        Description:SGML's #CURRENT is not allowed.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist08.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist09() {
    /*
        Test ID:attlist09
        Test URI:not-wf/attlist09.xml
        Spec Sections:3.3.1 [56]
        Description:SGML's #CONREF is not allowed.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist09.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist10() {
    /*
        Test ID:attlist10
        Test URI:not-wf/attlist10.xml
        Spec Sections:3.1 [40]
        Description:Whitespace required between attributes
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist10.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn attlist11() {
    /*
        Test ID:attlist11
        Test URI:not-wf/attlist11.xml
        Spec Sections:3.1 [44]
        Description:Whitespace required between attributes
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/attlist11.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn cond01() {
    /*
        Test ID:cond01
        Test URI:not-wf/cond01.xml
        Spec Sections:3.4 [61]
        Description:Only INCLUDE and IGNORE are conditional section keywords
    */

    let ss = StaticStateBuilder::new()
        .dtd_resolver(dtdfileresolve())
        .namespace(|_: &_| Err(ParseError::MissingNameSpace))
        .build();

    let testxml = RNode::new_document();
    let ps = ParserStateBuilder::new()
        .doc(testxml)
        .document_location("tests/conformance/xml/xmlconf/sun/not-wf/".to_string())
        .build();
    let parseresult = xml::parse_with_state(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/cond01.xml")
            .unwrap()
            .as_str(),
        ps,
        ss,
    );

    assert!(parseresult.is_err());
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn cond02() {
    /*
        Test ID:cond02
        Test URI:not-wf/cond02.xml
        Spec Sections:3.4 [61]
        Description:Must have keyword in conditional sections
    */

    let ss = StaticStateBuilder::new()
        .dtd_resolver(dtdfileresolve())
        .namespace(|_: &_| Err(ParseError::MissingNameSpace))
        .build();

    let testxml = RNode::new_document();
    let ps = ParserStateBuilder::new()
        .doc(testxml)
        .document_location("tests/conformance/xml/xmlconf/sun/not-wf/".to_string())
        .build();
    let parseresult = xml::parse_with_state(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/cond02.xml")
            .unwrap()
            .as_str(),
        ps,
        ss,
    );

    assert!(parseresult.is_err());
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn content01() {
    /*
        Test ID:content01
        Test URI:not-wf/content01.xml
        Spec Sections:3.2.1 [48]
        Description:No whitespace before "?" in content model
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/content01.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn content02() {
    /*
        Test ID:content02
        Test URI:not-wf/content02.xml
        Spec Sections:3.2.1 [48]
        Description:No whitespace before "*" in content model
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/content02.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn content03() {
    /*
        Test ID:content03
        Test URI:not-wf/content03.xml
        Spec Sections:3.2.1 [48]
        Description:No whitespace before "+" in content model
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/content03.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn decl01() {
    /*
        Test ID:decl01
        Test URI:not-wf/decl01.xml
        Spec Sections:4.3.1 [77]
        Description:External entities may not have standalone decls.
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/decl01.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn nwfdtd00() {
    /*
        Test ID:nwf-dtd00
        Test URI:not-wf/dtd00.xml
        Spec Sections:3.2.1 [55]
        Description:Comma mandatory in content model
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/dtd00.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn nwfdtd01() {
    /*
        Test ID:nwf-dtd01
        Test URI:not-wf/dtd01.xml
        Spec Sections:3.2.1 [55]
        Description:Can't mix comma and vertical bar in content models
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/dtd01.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn dtd02() {
    /*
        Test ID:dtd02
        Test URI:not-wf/dtd02.xml
        Spec Sections:4.1 [69]
        Description:PE name immediately after "%"
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/dtd02.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn dtd03() {
    /*
        Test ID:dtd03
        Test URI:not-wf/dtd03.xml
        Spec Sections:4.1 [69]
        Description:PE name immediately followed by ";"
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/dtd03.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn dtd04() {
    /*
        Test ID:dtd04
        Test URI:not-wf/dtd04.xml
        Spec Sections:4.2.2 [75]
        Description:PUBLIC literal must be quoted
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/dtd04.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn dtd05() {
    /*
        Test ID:dtd05
        Test URI:not-wf/dtd05.xml
        Spec Sections:4.2.2 [75]
        Description:SYSTEM identifier must be quoted
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/dtd05.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn dtd07() {
    /*
        Test ID:dtd07
        Test URI:not-wf/dtd07.xml
        Spec Sections:4.3.1 [77]
        Description:        Text declarations (which optionally begin any external entity)        are required to have "encoding=...".
    */

    let ss = StaticStateBuilder::new()
        .dtd_resolver(dtdfileresolve())
        .namespace(|_: &_| Err(ParseError::MissingNameSpace))
        .build();

    let testxml = RNode::new_document();
    let ps = ParserStateBuilder::new()
        .doc(testxml)
        .document_location("tests/conformance/xml/xmlconf/sun/not-wf/".to_string())
        .build();
    let parseresult = xml::parse_with_state(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/dtd07.xml")
            .unwrap()
            .as_str(),
        ps,
        ss,
    );

    assert!(parseresult.is_err());
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn element00() {
    /*
        Test ID:element00
        Test URI:not-wf/element00.xml
        Spec Sections:3.1 [42]
        Description:EOF in middle of incomplete ETAG
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/element00.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn element01() {
    /*
        Test ID:element01
        Test URI:not-wf/element01.xml
        Spec Sections:3.1 [42]
        Description:EOF in middle of incomplete ETAG
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/element01.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn element02() {
    /*
        Test ID:element02
        Test URI:not-wf/element02.xml
        Spec Sections:3.1 [43]
        Description:Illegal markup (<%@ ... %>)
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/element02.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn element03() {
    /*
        Test ID:element03
        Test URI:not-wf/element03.xml
        Spec Sections:3.1 [43]
        Description:Illegal markup (<% ... %>)
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/element03.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn element04() {
    /*
        Test ID:element04
        Test URI:not-wf/element04.xml
        Spec Sections:3.1 [43]
        Description:Illegal markup (<!ELEMENT ... >)
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/element04.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn encoding01() {
    /*
        Test ID:encoding01
        Test URI:not-wf/encoding01.xml
        Spec Sections:4.3.3 [81]
        Description:Illegal character " " in encoding name
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/encoding01.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn encoding02() {
    /*
        Test ID:encoding02
        Test URI:not-wf/encoding02.xml
        Spec Sections:4.3.3 [81]
        Description:Illegal character "/" in encoding name
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/encoding02.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn encoding03() {
    /*
        Test ID:encoding03
        Test URI:not-wf/encoding03.xml
        Spec Sections:4.3.3 [81]
        Description:Illegal character reference in encoding name
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/encoding03.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn encoding04() {
    /*
        Test ID:encoding04
        Test URI:not-wf/encoding04.xml
        Spec Sections:4.3.3 [81]
        Description:Illegal character ":" in encoding name
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/encoding04.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn encoding05() {
    /*
        Test ID:encoding05
        Test URI:not-wf/encoding05.xml
        Spec Sections:4.3.3 [81]
        Description:Illegal character "@" in encoding name
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/encoding05.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn encoding06() {
    /*
        Test ID:encoding06
        Test URI:not-wf/encoding06.xml
        Spec Sections:4.3.3 [81]
        Description:Illegal character "+" in encoding name
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/encoding06.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn encoding07() {
    /*
        Test ID:encoding07
        Test URI:not-wf/encoding07.xml
        Spec Sections:4.3.1 [77]
        Description:Text declarations (which optionally begin any external entity)are required to have "encoding=...".
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/encoding07.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn pi() {
    /*
        Test ID:pi
        Test URI:not-wf/pi.xml
        Spec Sections:2.6 [16]
        Description:No space between PI target name and data
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/pi.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn pubid01() {
    /*
        Test ID:pubid01
        Test URI:not-wf/pubid01.xml
        Spec Sections:2.3 [12]
        Description:Illegal entity ref in public ID
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/pubid01.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn pubid02() {
    /*
        Test ID:pubid02
        Test URI:not-wf/pubid02.xml
        Spec Sections:2.3 [12]
        Description:Illegal characters in public ID
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/pubid02.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn pubid03() {
    /*
        Test ID:pubid03
        Test URI:not-wf/pubid03.xml
        Spec Sections:2.3 [12]
        Description:Illegal characters in public ID
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/pubid03.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn pubid04() {
    /*
        Test ID:pubid04
        Test URI:not-wf/pubid04.xml
        Spec Sections:2.3 [12]
        Description:Illegal characters in public ID
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/pubid04.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn pubid05() {
    /*
        Test ID:pubid05
        Test URI:not-wf/pubid05.xml
        Spec Sections:2.3 [12]
        Description:SGML-ism: public ID without system ID
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/pubid05.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml01() {
    /*
        Test ID:sgml01
        Test URI:not-wf/sgml01.xml
        Spec Sections:3 [39]
        Description:SGML-ism: omitted end tag for EMPTY content
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml01.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml02() {
    /*
        Test ID:sgml02
        Test URI:not-wf/sgml02.xml
        Spec Sections:2.8
        Description:XML declaration must be at the very beginning of a document;it"s not a processing instruction
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml02.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml03() {
    /*
        Test ID:sgml03
        Test URI:not-wf/sgml03.xml
        Spec Sections:2.5 [15]
        Description:Comments may not contain "--"
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml03.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml04() {
    /*
        Test ID:sgml04
        Test URI:not-wf/sgml04.xml
        Spec Sections:3.3 [52]
        Description:ATTLIST declarations apply to only one element, unlike SGML
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml04.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml05() {
    /*
        Test ID:sgml05
        Test URI:not-wf/sgml05.xml
        Spec Sections:3.2 [45]
        Description:ELEMENT declarations apply to only one element, unlike SGML
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml05.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml06() {
    /*
        Test ID:sgml06
        Test URI:not-wf/sgml06.xml
        Spec Sections:3.3 [52]
        Description:ATTLIST declarations are never global, unlike in SGML
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml06.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml07() {
    /*
        Test ID:sgml07
        Test URI:not-wf/sgml07.xml
        Spec Sections:3.2 [45]
        Description:SGML Tag minimization specifications are not allowed
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml07.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml08() {
    /*
        Test ID:sgml08
        Test URI:not-wf/sgml08.xml
        Spec Sections:3.2 [45]
        Description:SGML Tag minimization specifications are not allowed
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml08.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml09() {
    /*
        Test ID:sgml09
        Test URI:not-wf/sgml09.xml
        Spec Sections:3.2 [45]
        Description:SGML Content model exception specifications are not allowed
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml09.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml10() {
    /*
        Test ID:sgml10
        Test URI:not-wf/sgml10.xml
        Spec Sections:3.2 [45]
        Description:SGML Content model exception specifications are not allowed
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml10.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml11() {
    /*
        Test ID:sgml11
        Test URI:not-wf/sgml11.xml
        Spec Sections:3.2 [46]
        Description:CDATA is not a valid content model spec
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml11.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml12() {
    /*
        Test ID:sgml12
        Test URI:not-wf/sgml12.xml
        Spec Sections:3.2 [46]
        Description:RCDATA is not a valid content model spec
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml12.xml")
            .unwrap()
            .as_str(),
    );
}

#[test]
#[cfg(all(test, feature = "test-conformance-xml"))]
fn sgml13() {
    /*
        Test ID:sgml13
        Test URI:not-wf/sgml13.xml
        Spec Sections:3.2.1 [47]
        Description:SGML Unordered content models not allowed
    */

    test_sun_notwf(
        fs::read_to_string("tests/conformance/xml/xmlconf/sun/not-wf/sgml13.xml")
            .unwrap()
            .as_str(),
    );
}