Hi,
I'm using a script to extract data from a node of an XML document with (PERL) XML::XPath with a loop :
......
foreach my $row ($xp->findnodes('/Ensemble/item/Attributes')) {
# extract from the XML
my $code = $row->find('code')->string_value;
my $title = $row->find('Title')->string_value;
my $url = $row->find('URL')->string_value;
# insert into the db (using placeholders)
$sth->execute($code, $title, $url) || die $DBI::errstr;}
......
But how could I extract data from SEVERAL nodes in the same loop. (Not only the node '/Ensemble/item/Attributes').
For example:
How could I extract also a data $subtitle in the node
'Ensemble/item/Subinfo' and finally execute the insert in database :
$sth->execute($code, $title, $url, $subtitle) || die $DBI::errstr;}
Thanks if you have the courage to read my post until this line ;-)
I'm using a script to extract data from a node of an XML document with (PERL) XML::XPath with a loop :
......
foreach my $row ($xp->findnodes('/Ensemble/item/Attributes')) {
# extract from the XML
my $code = $row->find('code')->string_value;
my $title = $row->find('Title')->string_value;
my $url = $row->find('URL')->string_value;
# insert into the db (using placeholders)
$sth->execute($code, $title, $url) || die $DBI::errstr;}
......
But how could I extract data from SEVERAL nodes in the same loop. (Not only the node '/Ensemble/item/Attributes').
For example:
How could I extract also a data $subtitle in the node
'Ensemble/item/Subinfo' and finally execute the insert in database :
$sth->execute($code, $title, $url, $subtitle) || die $DBI::errstr;}
Thanks if you have the courage to read my post until this line ;-)