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

Overview
Comment:Merged from schema.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wip
Files: files | file ages | folders
SHA3-256: 6165f6c2039233695cfba89e5bf3ef74b3e1531b1e0e09f059d424bcfd82efba
User & Date: rolf 2019-10-11 11:54:13
Context
2019-10-12
01:27
Save work. check-in: aa6a292606 user: rolf tags: wip
2019-10-11
11:54
Merged from schema. check-in: 6165f6c203 user: rolf tags: wip
00:29
Added a few tests to document the behaviour in case of validation against forward defined elements or refs. check-in: bb898f3778 user: rolf tags: schema
2019-10-10
01:50
Started info subcommand pastexpected. check-in: 78b0aac051 user: rolf tags: wip
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/schema.test.

636
637
638
639
640
641
642












































































643
644
645
646
647
648
649
        ref thisPattern
        ref thatPattern ?
    }
    lappend result [grammar nrForwardDefinitions]
    grammar delete
    set result
} {0 2}













































































test schema-3.1 {grammar definition: choice} {
    tdom::schema create grammar
    grammar defelement doc {
        element elm
        choice {
            element fooElem







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







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
        ref thisPattern
        ref thatPattern ?
    }
    lappend result [grammar nrForwardDefinitions]
    grammar delete
    set result
} {0 2}

test schema-2.3 {forward definded ref} {
    set defs {
        {
            ref thisPattern ?
        }
        {
            ref thatPattern
        }
        {
            ref thisPattern ?
            ref thatPattern
        }
        {
            ref thisPattern ?
            element a
        }
        {
            ref thatPattern
            element a
        }
    }
    set xmlinput {
        <doc/>
        <doc><a/></doc>
        <doc><unknown/></doc>
    }
    set result [list]
    foreach def $defs {
        tdom::schema create s
        s defelement doc $def
        foreach xml $xmlinput {
            lappend result [s validate $xml errMsg]
        }
        s delete
    }
    set result
} {1 0 0 1 0 0 1 0 0 0 1 0 0 1 0}

test schema-2.4 {forward definded element} {
    set defs {
        {
            element thisElement ?
        }
        {
            element thatElement
        }
        {
            element thisElement ?
            element thatElement
        }
        {
            element thisElement ?
            element a
        }
        {
            element thatElement
            element a
        }
    }
    set xmlinput {
        <doc/>
        <doc><a/></doc>
        <doc><unknown/></doc>
    }
    set result [list]
    foreach def $defs {
        tdom::schema create s
        s defelement doc $def
        foreach xml $xmlinput {
            lappend result [s validate $xml errMsg]
        }
        s delete
    }
    set result
} {1 0 0 0 0 0 0 0 0 0 1 0 0 0 0}

test schema-3.1 {grammar definition: choice} {
    tdom::schema create grammar
    grammar defelement doc {
        element elm
        choice {
            element fooElem