xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas B. Passin" <tpas...@mitretek.org>
Subject Re: Binary data in XML documents
Date Fri, 06 Oct 2000 13:14:15 GMT
Sean Kelly asked about encoding binary data -

>
> I'm working on a project that returns an XML document as the result of
a
> query.  Sometimes, we want to return a small binary object, like an
image or
> a sound bite, in the document.  As an example:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE result ...>
> <result>
>   <name>John Q. Public</name>
>   <phone>+1 234 567 8900</phone>
>   <portrait>...</portrait>
> </result>
>
> where the <portrait> tag in this case would contain some binary data.
> Normally, we'd just put the URL to a portrait in there, but often the
binary
> data lives somewhere that's not HTTP accessible.
>

Remember, you can't encode illegal characters in XML no matter how you
disguise them (references, CDATA, etc.).  Without checking, I think char
#0 is illegal.  It would be a bug for the serializer to output it,
though it's easy to see how the bug might have come about.

Tom Passin


Mime
View raw message