From: Mats B. <ma...@pr...> - 2001-09-25 13:59:25
|
The docs for TclXML specify the -errorcommand proc to take two parameters, 'tclProc errorcode errormessage', but browsing through the 'sgmlparser.tcl' file, the error proc is usually called as: uplevel #0 $options(-errorcommand) "$attr around line $state(line)" and in some places as: uplevel #0 $options(-errorcommand) [list $attr around line $state(line)] The uplevel command concatenates all its arguments which breaks the list structure above. I guess that a number of [list [list ....] ...] commands are needed here to build the proper list structure. There are many 'uplevel #0 $options(-errorcommand)' statements to fix. Am I right here? /Mats code------ set data2 {<stream:error>Invalid XML</stream:error>} proc HandleError {errcode errmsg} { puts "Error ==> errcode=$errcode, errmsg=$errmsg" } ... set myParser [xml::parser] $myParser configure -elementstartcommand HandleStart \ -elementendcommand HandleEnd -characterdatacommand HandleText \ -final 0 -errorcommand HandleError $myParser parse $data2 > called "HandleError" with too many arguments |