in reply to Vertical Tab (\x0b) in XML::LibXML

Do I miss something? Should I file a bug report?

Use the option to not die on errors

'XML::LibXML'->new( qw/ recover 2 / )->load_xml(string => $doc->toStri +ng)
  • Comment on Re: Vertical Tab (\x0b) in XML::LibXML 'XML::LibXML'->new( qw/ recover 2 / )->load_xml
  • Download Code

Replies are listed 'Best First'.
Re^2: Vertical Tab (\x0b) in XML::LibXML 'XML::LibXML'->new( qw/ recover 2 / )->load_xml
by choroba (Cardinal) on Jul 23, 2014 at 22:15 UTC
    That's not my problem. I need to generate well-formed XML that can be loaded by other tools, too. Some of them don't use XML::LibXML nor Perl.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      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 :)

        So if you make two passes through libxml you get valid xml?
        No. I make one pass and use something (libxml in this case) to parse the result. If a result was produced, I'd expect the second tool to accept it.

        Sanitizing input seems reasonable, but for such a complex data format, something like

        $text = 'XML::LibXML::Text'->removeInvalidChars($str, $version)
        would be handy.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ