"be consistent" | |
PerlMonks |
XML::Twig - setting text and elementsby slugger415 (Monk) |
on Sep 08, 2015 at 21:34 UTC ( [id://1141371]=perlquestion: print w/replies, xml ) | Need Help?? |
slugger415 has asked for the wisdom of the Perl Monks concerning the following question: Hello Monks, I have some XML such as this, where the linktext element contains a combination of text and other elements:
I can capture this with XML::Twig by creating an array, and referencing it thusly, where $citref is my handler:
Simple enough. The question I'm having is how to extract that into another element elsewhere? I couldn't find that in the documentation. Something like:
That doesn't work right, but I'm getting something in the output: <xref>ARRAY(0x4128670)</xref>I suspect the $e->set_text() function only applies to text (not elements) and I suspect if there's more than one text segment each will clobber the previous. Hence I'm cautious about iterating through the array. Any tips on how to do this? Thank you.
Back to
Seekers of Perl Wisdom
|
|