tDOM

Check-in [4bf39f2571]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Merge from schema.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | localkey
Files: files | file ages | folders
SHA3-256:4bf39f2571dddd5cd9b83eaf7bc1baeacf74996cd6febcdf05b397ae59380ff6
User & Date: rolf 2019-05-10 13:41:19
Context
2019-05-10
16:05
Save work. check-in: 2596c19c35 user: rolf tags: localkey
13:41
Merge from schema. check-in: 4bf39f2571 user: rolf tags: localkey
13:40
Fixed bug (invalid mem access) if a virtual constraint will be called under certain circumstances while looking if pcdata matches. check-in: 4cc96fcd33 user: rolf tags: schema
13:05
Merged from schema. check-in: db1bcdb342 user: rolf tags: localkey
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/schema.c.

1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
                    if (mustMatch (cp->quants[ac], hm)) {
                        SetResult ("Unexpected text content");
                        return 0;
                    }
                    break;

                case SCHEMA_CTYPE_VIRTUAL:
                    if (!evalVirtual (interp, sdata, ic)) return 0;
                    break;
                    
                case SCHEMA_CTYPE_NAME:
                case SCHEMA_CTYPE_ANY:
                    if (mustMatch (cp->quants[ac], hm)) {
                        SetResult ("Unexpected text content");
                        return 0;






|







1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
                    if (mustMatch (cp->quants[ac], hm)) {
                        SetResult ("Unexpected text content");
                        return 0;
                    }
                    break;

                case SCHEMA_CTYPE_VIRTUAL:
                    if (!evalVirtual (interp, sdata, candidate)) return 0;
                    break;
                    
                case SCHEMA_CTYPE_NAME:
                case SCHEMA_CTYPE_ANY:
                    if (mustMatch (cp->quants[ac], hm)) {
                        SetResult ("Unexpected text content");
                        return 0;

Changes to tests/schema.test.

3864
3865
3866
3867
3868
3869
3870
























3871
3872
3873
3874
3875
3876
3877
    }
    set schema-15.3 ""
    set result [s validate {<doc><a><b>foo</b><c/></a><a><b></b><c>bar</c></a></doc>} msg]
    s delete
    lappend result $msg {*}${schema-15.3}
    set result
} {1 {} astart a aend a astart a aend a}

























test schema-16.1 {interleave} {
    tdom::schema s
    s define {
        defelement doc {
            interleave {
                element a






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







3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
    }
    set schema-15.3 ""
    set result [s validate {<doc><a><b>foo</b><c/></a><a><b></b><c>bar</c></a></doc>} msg]
    s delete
    lappend result $msg {*}${schema-15.3}
    set result
} {1 {} astart a aend a astart a aend a}

proc schema-15.4 {text cmd} {
    if {$text ne "in docContent"} {error "unexpected text argument"}
    set ::schema-15.4 [$cmd info stack inside]
}
test schema-15.4 {constraint cmd tcl} {
    tdom::schema s
    s define {
        defelement doc {
            ref docContent
        }
        defpattern docContent {
            element a
            tcl schema-15.4 "in docContent"
            text
            element b
        }
    }
    set schema-15.4 ""
    set result [s validate {<doc><a/>foo<b/></doc>}]
    s delete
    lappend result [set schema-15.4]
    set result
} {1 doc}

test schema-16.1 {interleave} {
    tdom::schema s
    s define {
        defelement doc {
            interleave {
                element a