"Ryan Dewell" <[EMAIL PROTECTED]> writes:

> I'm using XML::Xerces v1.6 on Solaris 2.6.  I've found that when
> calling "getChildNodes" on a TEXT_NODE, the array which is returned
> contains a single, zero length string.  The more appropriate
> behavior would be to return a zero element array, as text nodes do
> not have children.

Actually what is happening, is that it is returning undef which you
are assigning to the first element of the list.

Here's the code:

  sub getChildNodes {
      my @args = @_;
      my $result = XML::Xercesc::IDOM_Node_getChildNodes(@args);
      return undef if (!defined($result));
      return $result->to_list() if wantarray;
      $IDOM_NodeList::OWNER{$result} = 1; 
      my %resulthash;
      tie %resulthash, ref($result), $result;
      return bless \%resulthash, ref($result);
  }

for some (unknown) reason, XML::Xercesc::IDOM_Node_getChildNodes() -
the internal C++ method - is returning undef, and so that is what
get's returned by the Perl wrapper method.

I don't know why it's returning undef, which is one problem, but in
anycase it should be returning an empty list, and not undef.

Thanks for finding this bug, too,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to