in reply to Re^2: XML::LibXML creating nodes with a string OR a node
in thread XML::LibXML creating nodes with a string OR a node
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? ;-)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: XML::LibXML creating nodes with a string OR a node
by worik (Sexton) on Jun 08, 2015 at 21:38 UTC |