RosettaCodeData/Task/XML-Input/Tcl/xml-input-1.tcl

8 lines
229 B
Tcl
Raw Permalink Normal View History

2013-04-11 01:07:29 -07:00
package require tdom
set tree [dom parse $xml]
set studentNodes [$tree getElementsByTagName Student] ;# or: set studentNodes [[$tree documentElement] childNodes]
foreach node $studentNodes {
puts [$node getAttribute Name]
}