Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Vertical Tab (\x0b) in XML::LibXML

by ikegami (Pope)
on Jul 24, 2014 at 17:23 UTC ( #1094943=note: print w/ replies, xml ) Need Help??


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

Vertical tabs (U+000B) are not allowed in XML documents.

Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]

I don't know why I get a different error from the two inputs in your example, but I do get an error from both.

Update: Just noticed you knew U+000B isn't allowed in XML, in which case I don't get the question.


Comment on Re: Vertical Tab (\x0b) in XML::LibXML
Download Code
Re^2: Vertical Tab (\x0b) in XML::LibXML
by choroba (Abbot) on Jul 24, 2014 at 17:39 UTC
    When the encoding is specified, toString generates invalid XML without any error. In real life, this gets sent to a different XML processor that chokes on it. My question is why the behaviour is different, and whether there is something that should prevent me from submitting a bug report.
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      I get an error for that too.
        #!/usr/bin/perl use warnings; use strict; use XML::LibXML; my $doc = 'XML::LibXML::Document'->createDocument('1.0', 'utf-8'); $doc->setDocumentElement(my $root = $doc->createElement('root')); $root->appendText("\x0b"); print $doc->toString;

        Output:

        <?xml version="1.0" encoding="utf-8"?> <root> </root>

        No errors, no warnings. Maybe a different version of the underlying C library?

        Update: Thanks anonymous. 2.9.1, 2.0018 here.

        لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1094943]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-09-22 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (208 votes), past polls