Now when I install from an updated cvs head checkout there are complaints in the error log about
invalid command name "xml_doc_get_first_node_by_name"
. Checking packages/acs-tcl/tcl/30-xml-utils-procs.tcl
I see the proc doesn't exist, as it does in a previous checkout. That proc might be implemented using tDOM like this:
# Get first node with a given name
proc xml_doc_get_first_node_by_name {doc_id name} {
set root [$doc_id documentElement]
return [$root child 1 $name]
}
Assuming that the first child of the root element with the given name is what you want. But the previous nsxml implementation seems to assume that you might also be searching for the root element by name, which just seems weird to me. Either you explicitly ask for the root element or search for one of it's decendants. But I guess that behaviour might be implemented by using
domDoc's getElementsByTagName method.
It is lang::catalog::parse
that is missing xml_doc_get_first_node_by_name
. Since it is using it to get the message_catalog
root element, I just changed it to use xml_doc_get_first_node
instead.
But still there where errors. Changing the xml_parse proc in packages/acs-tcl/tcl/30-xml-utils-procs.tcl
from
proc xml_parse args {
# ns_log notice "xml_parse $args"
if {[lindex $args 0] == "-persist"} {
return [dom parse -simple [lindex $args 1]]
} else {
dom parse -simple [lindex $args 0] doc
return $doc
}
}
to
proc xml_parse args {
# ns_log notice "xml_parse $args"
if {[lindex $args 0] == "-persist"} {
return [dom parse -simple [lindex $args 1]]
} else {
return [dom parse -simple [lindex $args 0]]
}
}
fixed those. The DOM tree and the associated Tcl command object was probably being freed automatically:
http://tdom.org/dom.html