use strict; use XML::Rules; my $filter = XML::Rules->new( style => 'filter', rules => { ReferenceID => sub { my ($tag, $attr) = @_; if ($attr->{referenceIDType} eq 'FXDD') { $attr->{_content} = "the changed content"; } return $tag => $attr; } } ); $filter->filter(\*DATA); __DATA__ <root> <ReferenceID referenceIDType="FXDD">FXDDILN233</ReferenceID> <ReferenceID referenceIDType="RXDD">FXDDILN233</ReferenceID> </root>
Jenda
Enoch was right!
Enjoy the last years of Rome.
In reply to Re: Update an XML node value based on one of the attribute values.
by Jenda
in thread Update an XML node value based on one of the attribute values.
by amitp2011
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |