tDOM

Check-in [a00292f6a2]
Login

Check-in [a00292f6a2]

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

Overview
Comment:Still work on validation error recovering.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | wip
Files: files | file ages | folders
SHA3-256: a00292f6a2e0183ff594a01286afb8263fd07fedf7d4589da78912972aa12016
User & Date: rolf 2019-04-19 15:57:01.522
Context
2019-04-21
23:06
Added (so far simplistic) validation error recovering with error reporting via tcl callback. check-in: cd6dce16a1 user: rolf tags: schema
2019-04-19
15:57
Still work on validation error recovering. Closed-Leaf check-in: a00292f6a2 user: rolf tags: wip
2019-04-16
23:28
Still work on validation error recovering. check-in: e1eaa5909b user: rolf tags: wip
Changes
Unified Diff Ignore Whitespace Patch
Changes to generic/schema.c.
1767
1768
1769
1770
1771
1772
1773



1774
1775
1776
1777
1778
1779
1780
            break;
        }
        if (only_whites)  return TCL_OK;
        if (matchText (interp, sdata, text)) {
            return TCL_OK;
        }
    }



    SetResult ("Text content doesn't match");
    return TCL_ERROR;
}

static void
startElement(
    void         *userData,







>
>
>







1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
            break;
        }
        if (only_whites)  return TCL_OK;
        if (matchText (interp, sdata, text)) {
            return TCL_OK;
        }
    }
    if (recover (interp, sdata, S("WRONG_VALUE"))) {
        return TCL_OK;
    }            
    SetResult ("Text content doesn't match");
    return TCL_ERROR;
}

static void
startElement(
    void         *userData,
Changes to tests/schema.test.
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
            element e
            text {minLength 1}
            element e
        }
    }
    s reportcmd schema-18
    set result ""
    set rc [s validate {<doc><e/></doc>} errMsg]
    puts $errMsg
    lappend result $rc
    s delete
    set result
} {s MISSING_TEXT s MISSING_ELEMENT 1}

test schema-18.1a {reportcmd} {
    tdom::schema s







|
<







3782
3783
3784
3785
3786
3787
3788
3789

3790
3791
3792
3793
3794
3795
3796
            element e
            text {minLength 1}
            element e
        }
    }
    s reportcmd schema-18
    set result ""
    set rc [s validate {<doc><e/></doc>}]

    lappend result $rc
    s delete
    set result
} {s MISSING_TEXT s MISSING_ELEMENT 1}

test schema-18.1a {reportcmd} {
    tdom::schema s