Y
yann.pambou
Hi,
I'm trying to update an XML file using Perl, but he does not work:
I'm trying to extract the value of the last tag and store it in the
first tag. See below:
From:
<TroubleTicket>
<TroubleID>12345</TroubleID>
<Descr>No SYNCH</Descr>
<SwitchID>HDLOPER</SwitchID>
</TroubleTicket>
To:
<TroubleTicket>
<TroubleID>HDLOPER</TroubleID>
<Descr>No SYNCH</Descr>
<SwitchID>HDLOPER</SwitchID>
</TroubleTicket>
Here are the syntaxes i'm using:
my(@records) = $xp->findnodes( 'TroubleTicket' );
foreach my $record ( @records ) {
$record-> find('SwitchID')-> string_value = $record->
findvalue('TroubleID');
}
Anyone would have any idea about how to modify a node value? Thanks,
Yann
I'm trying to update an XML file using Perl, but he does not work:
I'm trying to extract the value of the last tag and store it in the
first tag. See below:
From:
<TroubleTicket>
<TroubleID>12345</TroubleID>
<Descr>No SYNCH</Descr>
<SwitchID>HDLOPER</SwitchID>
</TroubleTicket>
To:
<TroubleTicket>
<TroubleID>HDLOPER</TroubleID>
<Descr>No SYNCH</Descr>
<SwitchID>HDLOPER</SwitchID>
</TroubleTicket>
Here are the syntaxes i'm using:
my(@records) = $xp->findnodes( 'TroubleTicket' );
foreach my $record ( @records ) {
$record-> find('SwitchID')-> string_value = $record->
findvalue('TroubleID');
}
Anyone would have any idea about how to modify a node value? Thanks,
Yann