From: Kala V. <kv...@ci...> - 2002-03-04 12:07:45
|
Hi, I need to parse the xml document using a TCL Function, by passing a tag name to retrieve the value of the tag. Something similar to "Simple.pm" in perl. For example i have an example xml document : <Outer> <Inner> Testing </Inner> </Outer> <Another> AnotherTag </Another> Say to retrive the value contained in the tag "Another", i should pass "Another" to a TCL function, which should retreive me "AnotherTag". How can i use TCLXML to implement this? Moreover, i tried to run the flatten.tcl with the sample xml file given in the examples, it is giving an error. The error is as follows : emch-sp22-ultra# tclsh8.3 flatten.tcl REC-xml-20001006.xml can't read "config(wantElementDecls)": no such variable while executing "if {$config(wantElementDecls)} { $parser configure -elementdeclcommand [list ElementDeclaration $out] }" (procedure "Process" line 13) invoked from within "Process [read $ch] [expr {[file extension $filename] == ".dtd" ? "dtd" : "xml"}] stdout -baseurl file://[file join [pwd] $filename]" ("foreach" body line 6) invoked from within "foreach filename $argv { if {$filename == "-"} { Process [read stdin] xml stdout } else { set ch [open $filename] Process [read $ch] [..." ("default" arm line 2) invoked from within "switch [llength $argv] { 0 { if {![catch {package require Tk}]} { # Create a nice little GUI array set config {wantElementDecls 1 wantP..." (file "flatten.tcl" line 270) emch-sp22-ultra# Can you let me know what the problem is? Is there any detailed documentation for TCLXML implementation? Thanks in Advance, Kala |