Re: Bug (?) in XML::LibXML when creating XML docs with invalid characters

aitor <[email protected]> Wed, 10 Apr 2013 08:34:30 +0200
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
On Tue, Apr 09, 2013 at 07:16:13PM +0200, Bjoern Hoehrmann wrote:
> * Francisco Obispo wrote:
> >Pressed "send" without much testing:
> >
> >$ ./test.pl |xmllint -format - 
> >-:2: parser error : PCDATA invalid Char value 7
> ><elem></elem>
> >      ^
> >
> >So, "7" UTF-8 is a control character, I don't think you can use control 
> >chars in XML at all, however, I guess you can do something like &#x0007; 
> >but I'm not sure about the implications on the parsers.
> 
> You cannot use U+0007 in XML 1.0 documents, and the point of this thread
> is that aitor expected XML::LibXML to enforce that, so adding such text
> should fail, but doesn't. The W3C DOM specifications require throwing an
> exception here, FWIW.

Yes, this is exactly my point. So I assume it is indeed a bug in
XML::LibXML. Looking at the sources, it seems that the appendText
function just calls the libxml2 xmlNodeAddContent function. I'll try to
dig into this and try see whether it is a libxml2 problem or a
XML::LibXML one.

Thank both of you for your help!

best,
                                        aitor
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs