in reply to Re: XML replace password with a specific tag
in thread XML replace password with a specific tag

A bit shorter in XML::XSH2:
open foo.xml ; set /Listens/Listen/param[@name="SSLKeyStorePassword"]/@value 'BLABLA8 +' ; save :b ;

It sets the first such node, i.e. it doesn't warn if there are more than one, but it can be easily extended:

my $l = /Listens/Listen/param[@name="SSLKeyStorePassword"] ; if (count($l) > 1) echo :e 'More than one node found' ; set $l/@value 'BLABLA8' ;

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]