Is the answer to my original question "yes" or "no"?
AFAIK it is "no". A thorough reading of the documentation will give you a definite answer though.
The calling function does not know, and the called function does not care.
But why? If the sub createOwner is under your control, then the fix suggested by choroba solves the problem in only a few characters. I may be wrong, but I get the feeling from this and the previous questions you have posted that you are trying to bend the module to your wishes instead of accepting the API the way it is and just using it...
But anyway, here's an interesting hack ("just enough rope" etc. etc.): In your code, replace "sub _addNode {" with "sub XML::LibXML::Element::appendTextOrElement {" and then replace "$root = &_addNode($root, $owner);" with "$root->appendTextOrElement($owner);". Does that fit your expectations better? ;-)
In reply to Re^3: XML::LibXML creating nodes with a string OR a node
by Anonymous Monk
in thread XML::LibXML creating nodes with a string OR a node
by worik
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |