Re: [xml] Newline handling



On Tue, May 20, 2008 at 05:31:01PM +0200, Piotr Gaczkowski wrote:
On Tue, May 20, 2008 at 5:01 PM, Daniel Veillard <veillard redhat com> wrote:
On Tue, May 20, 2008 at 04:22:58PM +0200, Piotr Gaczkowski wrote:

binary data in XML is impossible in general. And even if the xmlTextWriter
did not tweak newline on output any conformant XML parser will normalize
at parse time, it's mandatory from the spec
 http://www.w3.org/TR/REC-xml/#sec-line-ends
You're trying to use the wrong tool, read the spec. Or UUencode your
data.

It's not that way. Actually I don't want to create XML stream
containing binary data, but write _only_ raw binary data, (ab)using
the xmlTextWriter API.

The program I'm writing was supposed to only return data in XML, but
there is a need now to return binaries in some cases. xmlTextWriter is
still the only interface to the world, so I'm trying to push those
BLOBs through it.

  Hum, very weird. Let's face it those entry points were not designed
for that.

But maybe you're right and UUEncoding could be used instead.

  Maybe you can find another encoding which is less verbose while still
safe for use.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]