Hi All,
Using perl, v5.8.2,
I have a XML file(mytest.xml) with content like this
Some title 2 [HTML]
Some title 1
somename.pdf
Some title 2
[/HTML]
and I am pulling the data of the
nodes, so I wrote this to get the value of the pdf nodes.
use XML:

OM;
use XML:

arser;
my $file = "/myhome/local/mytest.xml";
my $parser = new XML:

OM:

arser;
my $doc = $parser->parsefile($file);
my $appCount = $doc->getElementsByTagName("pdf");
my $appCounter = $appCount->getLength;
for(my $i=0;$i<$appCounter;$i++){
my $pdfValue = $doc->getElementsByTagName("pdf")->item($i)->getFirstChild->getData;
print"$pdfValue\n";
}
when the value of $i is '0' , i am getting the value "somename.pdf" but when the value of $i is 1 then i get this error " Can't call method "getData" on an undefined value at test.ipl" , since the pdf node is empty. How to handle this , how to know if the node is empty . Please suggest