"I-Borduas, Eric V" <[EMAIL PROTECTED]> writes:
> Things are strange! Instead of running the test through the debugger,
> I just added a Data::Dumper and a print statement to the function
> XML::Xerces::AttributeList::to_hash() in Xerces.pm. When I ran the
> tests again (make test), the test that was failing succeeded!
Huh, sounds pretty bad, actually. There is some wierd Perl <-> C++
pointer crap going on that is affected by whether you access the
object method.
One thing to be aware of though, is the 5.6.1 is has very funky
support for Unicode - which is absolutely critical for Xerces to work
- and I can't guarantee that things will work properly. I would
*seriously* consider upgrading to 5.8.1 - things run much more
smoothly.
> use Data::Dumper;
>
> package XML::Xerces::AttributeList; sub to_hash {
> my $self = shift;
> my %hash; print STDERR Data::Dumper->Dump( [$self], "*" . ref($self)
> );
> for (my $i=0;$i<$self->getLength();$i++) {
> print STDERR ref($self) . "::to_hash: getName($i) returned: ",
> $self->getName($i), "\n";
> $hash{$self->getName($i)} = $self->getValue($i)
> }
> return %hash;
> }
>
>
> make[1]: Entering directory `/home/v600968/XML-Xerces-2.3.0-3/Handler'
> make[1]: Leaving directory `/home/v600968/XML-Xerces-2.3.0-3/Handler'
> PERL_DL_NONLAZY=1 /usr/bin/perl -Iblib/arch -Iblib/lib
> -I/usr/lib/perl5/5.6.1/i386-linux -I/usr/lib/perl5/5.6.1 -e 'use
> Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;'
> t/*.t t/actualCast..............ok t/AttributeList...........Using
> /home/v600968/XML-Xerces-2.3.0-3/blib $VAR1 = bless( do{\(my $o =
> 137122652)}, 'XML::Xerces::AttributeList' );
> XML::Xerces::AttributeList::to_hash: getName(0) returned: xmlns:Scout
> XML::Xerces::AttributeList::to_hash: getName(1) returned: Role
> XML::Xerces::AttributeList::to_hash: getName(2) returned: Scout:Rank
> ok t/Attributes..............Using
As you can see, the Data::Dumper output isn't so useful - the object
is really a C++ object with a light coating of Perl, so Dump() doesn't
really do anything.
Probably the bit that is actually enabling the test to succeed is the
call to $self->getName() in the print statement. Check that out for
me, would you?
Cheers,
jas.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]