So if you make two passes through libxml you get valid xml? But then you lose the vertical tab ...
If I try using toFile I get error : xmlEscapeEntities : char out of range
Error seems to be coming from libxml2 itself ... this says sanitize your inputs first so ascii control chars aren't in there :/
I'd report it to XML::LibXML maintainer , for the clues he might provide :)
| [reply] [Watch: Dir/Any] [d/l] |
$text = 'XML::LibXML::Text'->removeInvalidChars($str, $version)
would be handy.
| [reply] [Watch: Dir/Any] [d/l] |
sub XML::LibXML::Node::toSanitaryString {
my( $node ) = @_;
return 'XML::LibXML'->new( qw/ recover 2 / )
->load_xml(string => $node->toString )->toString;
}
All that is left is to supress the "xmlEscapeEntities : char out of range" warning toSanitaryString generates | [reply] [Watch: Dir/Any] [d/l] |