|
From: Ted N. S. A. GA <te...@ag...> - 2002-12-06 23:14:37
|
Hello folks,
I am transitioning a program I had running with tclexpat to use
tclxml. I had some problems with -final in tclexpat, (had to patch the
code someway or another) and seem to be finding something similar here
also.
I am using the pure tcl version of tclxml version 2.4. It is installed
in a director "lib" beneath my current directory, as is tcllib1.2
Here is my first test script
====Start====
#!/usr/local/bin/tclsh8.4
lappend auto_path lib
package require xml
proc cdata {data args} {
puts $data
}
set parser [::xml::parser parseit \
-characterdatacommand cdata ]
$parser parse "<the>world</the>"
====End====
As expected, it prints
world
Here is my second test script
====Start====
#!/usr/local/bin/tclsh8.4
lappend auto_path lib
package require xml
proc cdata {data args} {
puts $data
}
set parser [::xml::parser parseit \
-characterdatacommand cdata -final 0]
$parser parse "<the>"
$parser parse "world"
$parser parse "</the>"
====End====
It does not print "world" and errors out with a long backtrace:
====Start====
can't read "opts(-statevariable)": no such variable
while executing
"upvar #0 $opts(-statevariable) state"
(procedure "::sgml::tokenise" line 29)
invoked from within
"::sgml::tokenise $xml $tokExpr $substExpr -internaldtdvariable ::xml::tclparser::parseit(internaldtd) -statevariable ::xml::tclparser::parseit -final ..."
("eval" body line 1)
invoked from within
"eval {::sgml::tokenise $xml $tokExpr $substExpr} $tokenOptions"
(procedure "parse" line 57)
invoked from within
"parse parseit <the>"
(in namespace inscope "::xml::tclparser" script line 1)
invoked from within
"::namespace inscope ::xml::tclparser parse parseit <the>"
("eval" body line 1)
invoked from within
"eval $classinfo(-parsecommand) [list $name] $args"
("parse" arm line 5)
invoked from within
"switch -- $method {
configure {
# BUG: We're not checking for legal options
array set data $args
eval $classinfo(-configurecommand) [..."
(procedure "::xml::ParserCmd" line 7)
invoked from within
"::xml::ParserCmd parseit parse <the>"
("eval" body line 1)
invoked from within
"eval ::xml::ParserCmd parseit [list $method] $args"
(procedure "parseit" line 1)
invoked from within
"$parser parse "<the>""
(file "./doit2" line 14)
====End====
This seems like a pretty basic thing. Any suggestions?
Please reply directly to me as well as to the list because sourceforge
seems to be unhappy today, and I have not been able to subscribe so
far.
Thanks,
Ted Nolan
|