From: <da...@de...> - 2004-12-14 12:43:59
|
Steve Ball <Ste...@zv...> writes: > First I've heard of this... TclXML v3.0 is a major version change, > but the API has not changed *that* much. > TclXML v3.X passes all of its regression tests. including the > parsing API and parsing empty element syntax. I will investigate > further, back a small sample XML source document and Tcl script > would be helpful. Here's a script that Massimo, the guy who noticed this, sent me. -- David N. Welton Personal: http://www.dedasys.com/davidw/ Apache Tcl: http://tcl.apache.org/ Free Software: http://www.dedasys.com/freesoftware/ Linux Incompatibility List: http://www.leenooks.com/ ---- package require xml proc elemStartCmd {elem_type attr_list args} { puts [list >>>>>>>>>> open $elem_type ($attr_list $args)] } proc elemEndCmd {elem_type args} { puts [list >>>>>>>>>> close $elem_type ($args)] } proc descriptiveData {cdata} { puts [list cdata: $cdata] } set theParser [::xml::parser \ -elementendcommand elemEndCmd \ -elementstartcommand elemStartCmd \ -characterdatacommand descriptiveData ] set xmldata "" append xmldata "<toplevel> Document root\n" append xmldata " <livello1> Tag for generic element </livello1>\n" append xmldata " <livello1 attr1_1=\"v1\" attr1_2=\"v2\"> Nuovo Elemento contenente altri Elementi\n" append xmldata " <livello2 attr2_1=\"v1\" attr2_2=\"v2\"/>\n" append xmldata " <livello2 attr2_1=\"v3\" attr2_2=\"v4\"/>\n" append xmldata " <livello2> Tag chiuso in modo \"canonico\" </livello2>\n" append xmldata " </livello1>\n" append xmldata "</toplevel>\n" $theParser parse $xmldata |