From: Mats B. <ma...@pr...> - 2002-12-10 17:18:03
|
Hi all, I checked out a fresh copy of tclxml (version 2.5 released today), and found that most (all?) of my changes already were applied (by Steve Ball presumably). I've been running my patched tclxml daily for a year, with a lot of chopped off xml, and that works fine. However, the cvs version does not work as previously noted. There are some more changes to the cvs version compared to my version. The main difference seems to be in sgmlparser, and after some search I found the code: # Patch from bug report #596959, Marshall Rose to be the reason. Just do: if {0} { # Patch from bug report #596959, Marshall Rose if {[string compare [lindex $sgml 4] ""]} { set sgml [linsert $sgml 0 {} {} {} {} {}] } } I don't know the reason for this code. This must be sorted out by the author. This would never have happened if there were a test case with -final 0 and chopped off xml. So, please someone, add this so we wont see bugs like this again. There remains a question of how to actually use the -final option. I use it always when there is a risc of incomplete xml. Is there any reason for using -final 1? What's the advantage? In case there are remaining problems you can always extract my patched TclXML form my whiteboard application. See "http://hem.fyristorg.com/matben/" Best Wishes, Mats Test case on mac (I've a special pkgIndex file that sets version to 3.0 in order to not interfere with other installations): % package require xml 3.0 (Build) 2 % (Build) 3 % proc cdata {data args} { > puts $data > } (Build) 4 % (Build) 5 % set parser [::xml::parser parseit \ > -characterdatacommand cdata -final 0] parseit (Build) 6 % (Build) 7 % $parser parse "<the>" (Build) 8 % $parser parse "world" world (Build) 9 % $parser parse "</the>" |