in reply to Replace xml first id
say 'id: ', $object11->findvalue('@id');
But with XML::LibXML, you can get to an attribute value by a shortcut: you can pretend the element is a hash reference and ask for a key:
say 'id: ', $object11->{id};
In xsh, the whole program can be shortened to
open test.xml ; cd header/idset ; echo (a) ; echo (b) ; echo @id ;
|
|---|