![]() |
|
The stupid question is the question not asked | |
PerlMonks |
XML::Twig inserting a new element, not first or lastby slugger415 (Scribe) |
on Mar 04, 2013 at 17:16 UTC ( #1021679=perlquestion: print w/replies, xml ) | Need Help?? |
slugger415 has asked for the
wisdom of the Perl Monks concerning the following question:
Hello esteemed monks, I'm learning XML::Twig and have not been able to figure out how to insert an element in a particular location other that first_child or last_child. For example, here is my XML source:
I want to insert a new element "short_desc" in between "title" and "prolog". How do I do that? I can do this using first_child and last_child thusly:
which results in
but what I want is:
Any pointers appreciated. I have been scanning the Twig doc but am not sure what to look for. I see mention of $opt_position but this is not defined anywhere. (The xml twig site seems to have been dead for a while...) Thank you -- Scott
Back to
Seekers of Perl Wisdom
|
|