[lxml-dev] Help with an error message
Rob Sanderson
azaroth at liverpool.ac.uk
Thu Jan 3 17:33:33 CET 2008
The null character makes the XML non-well-formed anyway.
The legal character ranges for XML (as per the spec, section 2.2):
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] |
[#x10000-#x10FFFF]
Definitely no \x00!
So ... I would base64 encode any offending data, as suggested by Stefan.
Rob
On Thu, 2008-01-03 at 17:30 +0100, Stefan Behnel wrote:
> Konstantin Ryabitsev wrote:
> > I'm having trouble with the following case. One of my automatic import
> > scripts takes data from one source and submits it to another as an XML
> > feed. Recently, it started failing because one of the entries contains
> > a null.
> My first question is: why do you need a '\x00' here? If you want to pass
> binary data in XML, the best way is to use a safe encoding such as uuencode or
> whatever. That should be part of your XML language spec/schema/...
More information about the lxml-dev
mailing list