in reply to Re: XML::LibXML::Element appendChild/addChild not inheriting namespace?
in thread XML::LibXML::Element appendChild/addChild not inheriting namespace?

Thank you for the reply. Yes, your method appears to work.

One thing is still bugging me though, in regards to $child->localname yielding foo:child, which doesn't seem to be XML 1.0 compliant, as a colon usually isn't allowed in the localname or prefix parts, as it's reserved as the separator, yet localname contains it in my original test case above.

Would this constitute a bug, or is this desired behavior somehow?

Replies are listed 'Best First'.
Re^3: XML::LibXML::Element appendChild/addChild not inheriting namespace?
by choroba (Cardinal) on Jan 01, 2016 at 19:28 UTC
    I think the problem is already in createElement which accepts 'foo:child' without checking the prefix. I'm not sure whether it's a problem on the Perl or underlying C side, though.
    ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,