tDOM

Check-in [747de9fb71]
Login
Bounty program for improvements to Tcl and certain Tcl packages.

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

Overview
Comment:Added test for validatefile.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | validatefile
Files: files | file ages | folders
SHA3-256: 747de9fb71a8aa2bae29dcf726fb24f49365892e59f432d7387ce7ef356f600a
User & Date: rolf 2019-12-31 02:05:25
Context
2019-12-31
02:06
Added schema command method validatefile. check-in: cb70253aed user: rolf tags: schema
02:05
Added test for validatefile. Closed-Leaf check-in: 747de9fb71 user: rolf tags: validatefile
00:57
Merged from schema check-in: 75d96d3e0c user: rolf tags: validatefile
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/schema.test.

19
20
21
22
23
24
25

26
27
28
29
30
31
32
....
7165
7166
7167
7168
7169
7170
7171
7172






7173







#    schema-16.*: interleave
#    schema-17.*: info
#    schema-18.*: reportcmd
#    schema-19.*: keyspace
#    schema-20.*: domunique
#    schema-21.*: internal: buffers
#    schema-22.*: defelementtype, elementtype

#
# Copyright (c) 2018-2019 Rolf Ade.

source [file join [file dir [info script]] loadtdom.tcl]

if {[dom featureinfo schema]} {

................................................................................
        {<doc xmlns='http://my.foo'><a><e2/></a><a><e1/></a></doc>}
    } {
        lappend result [s validate $xml]
    }
    s delete
    set result
} {0 0 0 1 0 0}







}













>







 








>
>
>
>
>
>
|
>
>
>
>
>
>
>
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
....
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
#    schema-16.*: interleave
#    schema-17.*: info
#    schema-18.*: reportcmd
#    schema-19.*: keyspace
#    schema-20.*: domunique
#    schema-21.*: internal: buffers
#    schema-22.*: defelementtype, elementtype
#    schema-23.*: validatefile
#
# Copyright (c) 2018-2019 Rolf Ade.

source [file join [file dir [info script]] loadtdom.tcl]

if {[dom featureinfo schema]} {

................................................................................
        {<doc xmlns='http://my.foo'><a><e2/></a><a><e1/></a></doc>}
    } {
        lappend result [s validate $xml]
    }
    s delete
    set result
} {0 0 0 1 0 0}

test schema-23.1 {validatefile} {
    tdom::schema s
    s define {
        set fd [open [file join [file dir [info script]] ../doc/tmml.schema] r]
        eval [read $fd]
        close $fd
    }
    set result [s validatefile [file join [file dir [info script]] ../doc/schema.xml] errMsg]
    puts $errMsg
    s delete
    set result
} 1

}