Which TDI version are you using? The SAX parser returns node
attributes (if this is enabled for the Parser). Otherwise, in TDI 7
you can use the (new) XML Parser. If you empty out the Entry Tag
parameter of the Parser then it returns a single hierarchical
attribute. You can use dot (.) notation or square-brackets to traverse
the hierarchy. So, for example if you read the above snippet in this
way, you would get a single 'employees' attribute. Then you could do
something like this:
-----
emps = work.employees.getElementsByTagName("employee")
// the above returns a NodeList
// it has only two methods: getLength() and item()
for (i = 0; i < emps.getLength(); i++) {
emp = emps.item(i)
// prepend node attribute names with @
active = emp.@active == "true"
if (!active)
continue;
entry = system.newEntry()
for (att in emp) {
entry[att.getName()] = att.getValue
}
task.dumpEntry(entry)
}
-----
As shown above, the square-bracket technique lets you use variables to
reference attribute names. It also works for sub-nodes of a
hierarchical attribute.
Hope this helps!
-Eddie