Subject: | XML::SimpleObject $xmlobj -> children ("name") will always retun at least 1 element |
Date: | Mon, 30 Aug 2010 12:20:15 +1200 |
To: | <bug-XML-SimpleObject [...] rt.cpan.org> |
From: | "Andrew McLaren" <andrew [...] aratika.co.nz> |
Perl 5.8.8
XML::SimpleObject 0.53
OS Windows XP
The "children" method will always return at least a single element even
if the given name does not exist in the XML.
$xml = "<name></name>";
$xmlobj = XML::SimpleObject -> new (XML => $xml);
foreach $subelement ($xmlobj -> children ("some-nonexistant-element"))
{
# should never reach here, but it does!
}
Regards
Andrew