Why don't you do something like this:
Hope this helps,,,foreach (@node) { my $xml = traverse($_); print $xml; } sub traverse { my($node)= @_; if ($node->getType == XML_ELEMENT_NODE) { my $txt = "<" . $node->getName . ">"; foreach my $child ($node->childNodes()) { $txt .= traverse($child); } return $txt . "</" . $node->getName . ">"; } elsif ($node->getType() == XML_TEXT_NODE) { return $node->getData; } }
Aziz,,,
In reply to Re: Code Logic
by abstracts
in thread Grouping output statements into one location during recursive operation
by toadi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |