[Xml-compile] Re: Null characters in strings

Mark Overmeer mark at overmeer.net
Tue Dec 10 22:43:40 GMT 2013


* Patrick Powell (papowell at astart.com) [131210 17:17]:
> I ran into a very odd problem today.  Due to a cut and paste update
> of a database field,  a Null (0x00) value was put into a string.

oops

> I ran into some funny problems.   First,  one toolset generated a
> � for the null.  However,  this resulted
> in an error when sent to an XML::SOAP server.  - illegal XMLchar
> value 0 (I do not have the exact error message).

Who did complain?  The server?  XML::Compile has a light task: it
does not look at the content of the strings at all: if anyone
did encode \x0 into &#x0, then that is libxml2.

> I then used an XML::Compile based client and looked at the SOAP
> message that was being sent.  It did not appear to have the null
> value in the string.

Well, never trust editors in this case.  Did you use 'vim' with the
'l' command?

> Question:  Does XML::Compile or its support libraries/facilties
> delete NULL characters before
> doing string encoding (i.e. - translates & to &)?   Does it do
> this for other characters?

libxml2 wrapped by XML::LibXML

> Question:  Is there a magic option/flag for XML::Compile so that it
> will ACCEPT strings with encoded null characters in them?

No, X::C is agnostic about charsets
You have to look at the libxml2 lists for your answers... sorry.
-- 
Regards,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list