Syntactic Confectionery Delight | |
PerlMonks |
String substituion with XML::Twigby slugger415 (Monk) |
on Jul 26, 2014 at 01:12 UTC ( [id://1095127]=perlquestion: print w/replies, xml ) | Need Help?? |
slugger415 has asked for the wisdom of the Perl Monks concerning the following question: Hello Monks, still trying to learn XML::Twig, in this case string substitution. If I have a block of XML, e.g.: <p>String AAA <b>varname</b> and string AAA and BBB</p>How do I go about replacing string AAA without clobbering the b element? I know I can do this (while evaluating the p element):
But that will remove the inner element: String ZZZ varname and string ZZZ and BBBI've looked at getting children and descendants but nothing seems to give me just the text elements that I can manipulate separately. Sorry if its a naive question, and thanks for the advice. Scott
Back to
Seekers of Perl Wisdom
|
|