Index: openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl 10 Jan 2007 21:22:12 -0000 1.3 +++ openacs-4/packages/acs-tcl/tcl/xml-1-dom-procs.tcl 27 Oct 2014 16:40:09 -0000 1.4 @@ -394,7 +394,7 @@ configure { if {[llength $args] == 1} { return [document cget $token [lindex $args 0]] - } elseif {[expr {[llength $args] % 2}]} { + } elseif {[llength $args] % 2} { return -code error "no value specified for option \"[lindex $args end]\"" } else { foreach {option value} $args { @@ -485,7 +485,7 @@ return -code error "wrong number of arguments" } - foreach {name extid dtd entities notations} $args break + lassign $args name extid dtd entities notations set result [CreateDocType $token $name $extid $dtd $entities $notations] } @@ -562,8 +562,9 @@ if {$parent(node:nodeType) eq "documentFragment" } { if {$parent(id) == $parent(documentFragment:masterDoc)} { - if {[info exists parent(document:documentElement)] && \ - [string length $parent(document:documentElement)]} { + if {[info exists parent(document:documentElement)] + && [string length $parent(document:documentElement)] + } { unset docArray($id) return -code error "document element already exists" } else { @@ -866,7 +867,7 @@ if {[llength $args] == 1} { return [document cget $token [lindex $args 0]] - } elseif {[expr {[llength $args] % 2}]} { + } elseif {[llength $args] % 2} { return -code error "no value specified for option \"[lindex $args end]\"" } else { foreach {option value} $args { @@ -1204,7 +1205,7 @@ configure { if {[llength $args] == 1} { return [document cget $token [lindex $args 0]] - } elseif {[expr {[llength $args] % 2}]} { + } elseif {[llength $args] % 2} { return -code error "no value specified for option \"[lindex $args end]\"" } else { foreach {option value} $args { @@ -1308,8 +1309,9 @@ foreach child [set $node(node:childNodes)] { catch {unset childNode} array set childNode [set $child] - if {$childNode(node:nodeType) eq "element" && \ - [GetField childNode(node:nodeName)] eq $name } { + if {$childNode(node:nodeType) eq "element" + && [GetField childNode(node:nodeName)] eq $name + } { lappend result $child } } @@ -1438,7 +1440,7 @@ configure { if {[llength $args] == 1} { return [document cget $token [lindex $args 0]] - } elseif {[expr {[llength $args] % 2}]} { + } elseif {[llength $args] % 2} { return -code error "no value specified for option \"[lindex $args end]\"" } else { foreach {option value} $args { @@ -1519,7 +1521,7 @@ if {![info exists node(document:documentElement)]} { return -code error "document has no document element" - } elseif {![string length $node(document:doctype)]} { + } elseif {$node(document:doctype) eq ""} { return -code error "no document type declaration given" } else { @@ -1743,9 +1745,9 @@ # Handle special characters regsub -all < $value {\<} value - if {![string match *\"* $value]} { + if {![string match "*\"*" $value]} { append result \"$value\" - } elseif {![string match *'* $value]} { + } elseif {![string match "*'*" $value]} { append result '$value' } else { regsub -all \" $value {\"} value @@ -1926,7 +1928,7 @@ switch $node(node:nodeType) { textNode { - if {![string length [string trim $node(node:nodeValue)]]} { + if {[string trim $node(node:nodeValue)] eq ""} { node removeChild $node(node:parentNode) $nodeid } }