Commits

Anonymous committed 8982b81

Added IO::Handle
Fixed bug in find() where no nodes found.

Comments (0)

Files changed (1)

 use vars qw($VERSION @ISA @EXPORT $ORIGINAL_STRING);
 use Carp;
 use XML::LibXML::NodeList;
+use IO::Handle; # for FH reads called as methods
 
 $VERSION = "1.31";
 require Exporter;
 sub XML::LibXML::Node::find {
     my ($node, $xpath) = @_;
     my ($type, @params) = $node->_find($xpath);
-    return $type->new(@params);
+    if ($type) {
+        return $type->new(@params);
+    }
+    return undef;
 }
 
 sub XML::LibXML::Element::getElementsByTagName {