Murcia has asked for the wisdom of the Perl Monks concerning the following question:
In my XML file I have a tag named <function>
eg:
<function name='a' start='1'> <function name='b' start='2'> <function name='c' start='3'> <function name='a' start='4'> <function name='b' start='5'>the code comes here, it prints unorded!
is it possible to sort, so that all with name a, then b, then c print out?my $nodes = $data->getElementsByTagName('function'); my $n = $nodes->getLength; for (my $i = 0; $i < $n; $i++) { my $node = $nodes->item ($i); my $start = $node->getAttributeNode ("start"); print $start->getValue . "\n"; }
thanks
Murcia
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::DOM sort
by chromatic (Archbishop) on Jun 04, 2003 at 18:16 UTC | |
by Murcia (Monk) on Jun 05, 2003 at 07:06 UTC |