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

Overview
Comment:Added #text to the possible next events in case of mixed.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wip
Files: files | file ages | folders
SHA3-256: f1a7ec26da4ca23833320fee6a1476ad970a4ccf6e7e06f220472e06d5837237
User & Date: rolf 2019-10-03 11:29:09
Context
2019-10-03
22:39
More work on introspection of validation state. check-in: 4328236591 user: rolf tags: wip
11:29
Added #text to the possible next events in case of mixed. check-in: f1a7ec26da user: rolf tags: wip
02:23
Added another test. check-in: 05cfa07ebf user: rolf tags: wip
Changes

Changes to generic/schema.c.

2838
2839
2840
2841
2842
2843
2844




2845
2846
2847
2848
2849
2850
2851

            case SCHEMA_CTYPE_TEXT:
                Tcl_ListObjAppendElement (interp, rObj,
                                          Tcl_NewStringObj ("#text", 5));
                break;
                
            case SCHEMA_CTYPE_CHOICE:




                for (i = 0; i < ic->nc; i++) {
                    jc = ic->content[i];
                    switch (jc->type) {
                    case SCHEMA_CTYPE_NAME:
                        Tcl_ListObjAppendElement (
                            interp, rObj, serializeElementName (interp, jc)
                            );







>
>
>
>







2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855

            case SCHEMA_CTYPE_TEXT:
                Tcl_ListObjAppendElement (interp, rObj,
                                          Tcl_NewStringObj ("#text", 5));
                break;
                
            case SCHEMA_CTYPE_CHOICE:
                if (ic->flags & MIXED_CONTENT) {
                    Tcl_ListObjAppendElement (interp, rObj,
                                              Tcl_NewStringObj ("#text", 5));
                }
                for (i = 0; i < ic->nc; i++) {
                    jc = ic->content[i];
                    switch (jc->type) {
                    case SCHEMA_CTYPE_NAME:
                        Tcl_ListObjAppendElement (
                            interp, rObj, serializeElementName (interp, jc)
                            );

Changes to tests/schema.test.

4803
4804
4805
4806
4807
4808
4809























4810
4811
4812
4813
4814
4815
4816
    }
    s event start doc
    set result [s info frontexpected]
    s delete
    set result
} {a c b toplevel {musthave http://foo.bar}}
























proc schema-18 {args} {
    lappend ::result {*}$args
}
test schema-18.1 {reportcmd} {
    tdom::schema s
    s define {
        defelement doc {







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







4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
    }
    s event start doc
    set result [s info frontexpected]
    s delete
    set result
} {a c b toplevel {musthave http://foo.bar}}

test schema-17.7 {info frontexpected} {
    tdom::schema s
    s prefixns {foo http://foo.bar}
    s define {
        defelement doc {
            mixed {
                element a
                element c
                element b
            }
            element toplevel ?
            namespace foo {
                element musthave
            }
            element aftermust
        }
    }
    s event start doc
    set result [s info frontexpected]
    s delete
    set result
} {{#text} a c b toplevel {musthave http://foo.bar}}

proc schema-18 {args} {
    lappend ::result {*}$args
}
test schema-18.1 {reportcmd} {
    tdom::schema s
    s define {
        defelement doc {