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

Overview
Comment:Added validation of the included tmml xml documentation against the included tmml.schema as test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | schema
Files: files | file ages | folders
SHA3-256: 2bee8a3462ac7b4c8fe14db24ba00aa46c7ce00c5ec3a0bd41e93ca373057cdd
User & Date: rolf 2019-11-22 23:54:15
Context
2019-11-24
01:07
Added the xsd data types Name, NCName and QName as text constraint commands name, ncname and qname. check-in: 3201b746cc user: rolf tags: schema
2019-11-22
23:54
Added validation of the included tmml xml documentation against the included tmml.schema as test. check-in: 2bee8a3462 user: rolf tags: schema
23:51
Minor editorial change. check-in: 16866bc56d user: rolf tags: schema
Changes

Changes to tests/schema.test.

1079
1080
1081
1082
1083
1084
1085




























1086
1087
1088
1089
1090
1091
1092
....
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
    set doc [dom parse -validateCmd grammar {
        <elm1><a><c/></a><b/></elm1>
    }]
    $doc delete
    grammar delete
} {}






























test schema-6.1 {expat parser with -validateCmd} {
    tdom::schema create grammar
    grammar defelement doc {
        element e1
        element e2 *
    }
................................................................................
        {defelement doc {attribute foo}}
        {defelement doc {group {attribute foo}}}
        {defpattern some {attribute foo}}
        {defelement doc {element {attribute foo}}}
    }
    set result [list]
    foreach def $defs {
        puts $def
        tdom::schema create s
        lappend result [catch {s define $def}]
        s delete
    }
    set result
} {0 1 1 0}








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







 







<







1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
....
2992
2993
2994
2995
2996
2997
2998

2999
3000
3001
3002
3003
3004
3005
    set doc [dom parse -validateCmd grammar {
        <elm1><a><c/></a><b/></elm1>
    }]
    $doc delete
    grammar delete
} {}

test schema-5.5 {validate tmml doc files} {
    tdom::schema s
    set docdir [file join [file dir [info script]] ../doc]
    set file [file join $docdir tmml.schema]
    set fd [open $file]
    set tmmlschema [read $fd]
    close $fd
    s define $tmmlschema
    set result {}
    foreach tmmlfile {
        domDoc.xml
        domNode.xml
        dom.xml
        expatapi.xml
        expat.xml
        pullparser.xml
        schema.xml
        tdomcmd.xml
    } {
        set file [file join $docdir $tmmlfile]
        set fd [open $file]
        set tmmldoc [read $fd]
        close $fd
        lappend result [s validate $tmmldoc]
    }
    s delete
    set result
} {1 1 1 1 1 1 1 1}

test schema-6.1 {expat parser with -validateCmd} {
    tdom::schema create grammar
    grammar defelement doc {
        element e1
        element e2 *
    }
................................................................................
        {defelement doc {attribute foo}}
        {defelement doc {group {attribute foo}}}
        {defpattern some {attribute foo}}
        {defelement doc {element {attribute foo}}}
    }
    set result [list]
    foreach def $defs {

        tdom::schema create s
        lappend result [catch {s define $def}]
        s delete
    }
    set result
} {0 1 1 0}