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

Overview
Comment:Made more info about the validation state available for recover scripts.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wip
Files: files | file ages | folders
SHA3-256: 2c03ac9cd68a78ceddceae203d81d04f97d88ea14968338490695ee10acd8721
User & Date: rolf 2019-08-22 21:23:28
Context
2019-08-23
17:36
Cleanly close open keyspace constraints even in case of error recovering by skiping the remaining content model of the enclosing element after validation error. Fixed interleave checking (which could miss to complained about missing childs in the interleave content). check-in: 37403bd128 user: rolf tags: schema
2019-08-22
21:23
Made more info about the validation state available for recover scripts. Closed-Leaf check-in: 2c03ac9cd6 user: rolf tags: wip
2019-08-17
13:54
wip check-in: 0625bcaa4c user: rolf tags: wip
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to generic/schema.c.

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
    const char *errType,
    int len,
    int popStack,
    int ac
    )
{
    Tcl_Obj *cmdPtr;
    int rc;

    if (!sdata->reportCmd) return 0;
    cmdPtr = Tcl_DuplicateObj (sdata->reportCmd);
    Tcl_IncrRefCount(cmdPtr);
    Tcl_ListObjAppendElement (interp, cmdPtr,
                              sdata->self);
    Tcl_ListObjAppendElement (
        interp, cmdPtr,
        Tcl_NewStringObj (errType, len)
        );
    sdata->currentEvals++;




    rc = Tcl_EvalObjEx (interp, cmdPtr,
                        TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT);



    sdata->currentEvals--;
    Tcl_DecrRefCount (cmdPtr);
    if (rc != TCL_OK) {
        sdata->evalError = 1;
        return 0;
    }
    if (popStack) {







|











>
>
>
>


>
>
>







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
    const char *errType,
    int len,
    int popStack,
    int ac
    )
{
    Tcl_Obj *cmdPtr;
    int rc, savedac;

    if (!sdata->reportCmd) return 0;
    cmdPtr = Tcl_DuplicateObj (sdata->reportCmd);
    Tcl_IncrRefCount(cmdPtr);
    Tcl_ListObjAppendElement (interp, cmdPtr,
                              sdata->self);
    Tcl_ListObjAppendElement (
        interp, cmdPtr,
        Tcl_NewStringObj (errType, len)
        );
    sdata->currentEvals++;
    if (sdata->stack) {
        savedac = sdata->stack->activeChild;
        sdata->stack->activeChild = ac;
    }
    rc = Tcl_EvalObjEx (interp, cmdPtr,
                        TCL_EVAL_GLOBAL | TCL_EVAL_DIRECT);
    if (sdata->stack) {
        sdata->stack->activeChild = savedac;
    }
    sdata->currentEvals--;
    Tcl_DecrRefCount (cmdPtr);
    if (rc != TCL_OK) {
        sdata->evalError = 1;
        return 0;
    }
    if (popStack) {

Changes to tests/schema.test.

4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
        {<doc><items><item>12</item><item>12</item></items><items><item>ab</item><item>cd</item></items><items><item>12</item><item>12</item></items></doc>}
    } {
        lappend result [s validate $xml errMsg]
        puts $errMsg
    }
    s delete
    set result
} {}

proc validatedSAX {g xml {keepEmpties 1}} {
    set args [list -validateCmd $g]
    if {!$keepEmpties} {
        lappend args -ignorewhitespace 1
    }
    xml::parser p {*}$args







|







4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
        {<doc><items><item>12</item><item>12</item></items><items><item>ab</item><item>cd</item></items><items><item>12</item><item>12</item></items></doc>}
    } {
        lappend result [s validate $xml errMsg]
        puts $errMsg
    }
    s delete
    set result
} {1 s WRONG_VALUE 1 s WRONG_VALUE 1 s WRONG_VALUE s WRONG_VALUE 1}

proc validatedSAX {g xml {keepEmpties 1}} {
    set args [list -validateCmd $g]
    if {!$keepEmpties} {
        lappend args -ignorewhitespace 1
    }
    xml::parser p {*}$args