I'm using XML::LibXML, I'd like to add a comment such that the the comment is outside the tag. Is it even possible to put it outside the tag? I've tried appendChild, insertBefore | After, no difference ...
<JJ>junk</JJ> <!--My comment Here!-->
# Code excerpt from within a foreach loop:
my $elem = $dom->createElement("JJ");
my $txt_node = $dom->createTextNode("junk");
my $cmt = $dom->createComment("My comment Here!");
$elem->appendChild($txt_node);
$b->appendChild($elem);
$b->appendChild($frag);
$elem->appendChild($cmt);
# but it puts the comment between the tags ...
<JJ>junk<!--My comment Here!--></JJ>