I've never used Win32::OLE before or this object, but I'm guessing it's:
my $reports = $DOM_document->DocumentElement(); foreach my $report (in $reports->childNodes()) { foreach my $report_child (in $report->childNodes()) { if ($report_child->{'nodeName'} eq 'report-name') { print($report_child->text(), "\n"); next; } } }
Update: I initially forgot to put in the calls to childNodes. Fixed. Tested. Works.
By the way, the following is a better error message for loading:
my $DOM_document = Win32::OLE->new('MSXML2.DOMDocument')
or die("Unable to load object MSXML2.DOMDocument: $^E\n");
It's more descriptive, and the $^E will display why it wasn't able to load the object.
In reply to Re: Extracting information from XML file
by ikegami
in thread Extracting information from XML file
by Nesh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |