ken Foskey wrote:
> Updated to fix memory problem, you have to purge. Takes over 30
> minutes for 120K records.
>
> I am sure that the whole process can be done better with a good
> understanding of the module. Will benchmark XML::Rules though.
Not knowing the structure of the XML you are processing makes it a bit
hard to give you advice, but descendants is an expensive method, so if
by any chance the elements you are interested in ( member, add1...) are
in known position in the mem element, then use first_child and the likes
to get to them. For example if member is a direct child of mem, then
my $mem_no = get_value( $mem_ref, 'member' );
can be replaced by
my $mem_no= $mem_ref->first_child( 'member')->text;
and even shorter:
my $mem_no= $mem_ref->field( 'member'); # which doesn't die if there is
# no member child
If you don't know where the elements are, at least you can use
first_descendant, to avoid going through the entire list of descendants
(it will stop once the first matching descendant is found).
OTH
--
mirod
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/