Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Added a few tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | schema
Files: files | file ages | folders
SHA3-256: d1c94a212f7838e5d2f3b139e2b02682499f37e91857bcfb4747eb642a0221af
User & Date: rolf 2020-02-10 22:38:01
Context
2020-02-11
16:28
Better handling of validation command using SAX parser in partial parsing mode (-final 0). check-in: 266d76531f user: rolf tags: schema
2020-02-10
22:38
Added a few tests. check-in: d1c94a212f user: rolf tags: schema
2020-02-06
23:41
Code fix. check-in: 106ae257a7 user: rolf tags: schema
Changes

Changes to tests/schema.test.

680
681
682
683
684
685
686










































687
688
689
690
691
692
693
    } {
        lappend result [s validate $xml]
    }
    s delete
    set result
} {0 0 1 0}











































test schema-2.1 {grammar definition: ref} {
    tdom::schema create grammar
    grammar defpattern thisPattern {
        element a
        element b
    }
    grammar defpattern thatPattern {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







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
    } {
        lappend result [s validate $xml]
    }
    s delete
    set result
} {0 0 1 0}

test schema-1.30 {recurive allowed element} {
    tdom::schema s
    s define {
        defelement doc {
            element n
        }
        defelement n {
            element n ?
        }
    }
    set xml "<doc>"
    # That's 200000 (and one) nesting level
    append xml [string repeat "<n><n><n><n><n><n><n><n><n><n>" 20000]
    append xml "<n/>"
    append xml [string repeat "</n></n></n></n></n></n></n></n></n></n>" 20000]
    append xml "</doc>"
    set result [s validate $xml]
    s delete
    set result
} 1

test schema-1.31 {recurive allowed element} {
    tdom::schema s
    s define {
        defelement doc {
            element n
        }
        defelement n {
            element n ?
        }
    }
    set xml "<doc>"
    # That's 200000 (and one) nesting level
    append xml [string repeat "<n><n><n><n><n><n><n><n><n><n>" 20000]
    append xml "<a/>"
    append xml [string repeat "</n></n></n></n></n></n></n></n></n></n>" 20000]
    append xml "</doc>"
    set result [s validate $xml errMsg]
    s delete
    list $result $errMsg
} {0 {error "Element "a" doesn't match" at line 1 character 600009}}

test schema-2.1 {grammar definition: ref} {
    tdom::schema create grammar
    grammar defpattern thisPattern {
        element a
        element b
    }
    grammar defpattern thatPattern {