tDOM

Check-in [fd2f1e3238]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Prepare for more converters to come.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | schema
Files: files | file ages | folders
SHA3-256: fd2f1e32380aba3329d4b3348926683ed574ab1f3250e783d87a3b5e37adfda5
User & Date: rolf 2019-04-27 00:33:15
Context
2019-04-27
00:38
Added text constraint command strip which tests all text constraints in the evaluated argument with the text to test striped of all white space at start and end. check-in: b6738cb9c3 user: rolf tags: schema
00:33
Prepare for more converters to come. check-in: fd2f1e3238 user: rolf tags: schema
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to apps/toschema.tcl.

221
222
223
224
225
226
227














228






















        -enddoctypedeclcommand fromDTD_endDoctypeDecl \
        -elementdeclcommand fromDTD_elementDecl \
        -attlistdeclcommand fromDTD_attlistDecl
        
    p parse [tdom::xmlReadFile $file]
}















fromDTD $argv




























>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
        -enddoctypedeclcommand fromDTD_endDoctypeDecl \
        -elementdeclcommand fromDTD_elementDecl \
        -attlistdeclcommand fromDTD_attlistDecl
        
    p parse [tdom::xmlReadFile $file]
}

proc usage {} {
    puts "$argv0 ?options? file"
}

proc run {args} {
    if {[llength $args] == 1} {
        set file [lindex $args 0]
        if {![file readable $file] || ![file isfile $file]} {
            puts stderr "Can't open '$file'"
            exit 1
        }
        set needToGuess 0
        switch [file extension $file] {
            ".xml" {
                fromDTD $file
            }
            default {
                set needToGuess 1
            }
        }
        if {$needToGuess} {
            # Just probe everything we have in no specific order
            foreach reader {
                fromDTD
            } {
                if {![catch {$reader $file}]} {
                    return
                }
            }
        }
        return
    }
    usage
}

run {*}$argv