Subject: | Perl XML::TinyXML getNode returning undef() |
As per stackoverflow.com:
http://stackoverflow.com/questions/18724723/perl-xmltinyxml-getnode-returning-undef
This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi
Debian Wheezy 7.1
Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux
-------------
I seem to be having issues with the CPAN module for XML::TinyXML such that when I create a new xml object, any subsequent call to getNode always returns undef.
Currently using TinyXML 0.33 This worked previously with TinyXML 0.11, and all the examples suggest this should work.
A simple example.
----------
#!/usr/bin/perl
use strict;
use warnings;
use XML::TinyXML;
my $node = XML::TinyXML::Node->new ('rowset', 'foo', {
"xmlns:xsi" => "http://www.w3.org/2001/XMLSchema-instance"
});
my $xml = XML::TinyXML->new($node);
our $rootNode;
printf("%s \n", $xml->dump);
$rootNode = $xml->getNode("rowset");
print $rootNode;
--------------
Produces the following output:
<?xml version="1.0" encoding="utf-8"?>
<rowset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">foo</rowset>
Use of uninitialized value $rootNode in print at ./z.pl line 18.
--------------
I'm stumped... Nothing I do will return the node object.