[Yanel-dev] New XMLDB repository

Michael Wechner michael.wechner at wyona.com
Mon Feb 12 22:52:11 CET 2007


Andreas Wuest wrote:

> Hi
>
> On 12.2.2007 21:02 Uhr, Michael Wechner wrote:
>
>> I am not sure, because XML can also contain binary data (using 
>> CDATA). This is also because one should use application/xml and not 
>> text/xml
>
>
> Just for the record: CDATA cannot contain binary data.


what I mean with binary data are images, etc. sorry for maybe mixing not 
correct technical language here, but one often has reserved XML 
characters within such data and hence it makes sense to embed it within 
CDATA.

Cheers

Michi

> See the definition of CDATA sections as used in the XML specification:
>
>   Definition: CDATA sections may occur anywhere character data may 
> occur; they are used to escape blocks of text containing characters 
> which would otherwise be recognized as markup. CDATA sections begin 
> with the string "<![CDATA[" and end with the string "]]>"
>
> This states explicitely that the content of CDATA sections, is, well, 
> *c*haracter data.
>
> I guess what you are thinking about is embedding binary data in XML 
> documents. From http://www.xml.com/pub/a/98/07/binary/binary.html:
>
>   But can you just put "binary" data into an XML document? Meaning, 
> "Could we just take an arbitrary stream of bits and plunk it into a 
> document?" The answer is no because all the bits in an XML document 
> must be legal characters in legal syntax in the same character 
> encoding as the rest of the document.
>
> There is, of course, a solution (and what I've already tried to tell 
> you this afternoon):
>
>   However, you can encode binary data into characters, and then put 
> the result into an XML document.
>
> So, no, an XML can still not contain binary data. It may though 
> contain binary data encoded using e.g. Base64.
>
> Everything else is NOT XML, so we can ignore it, and treat it as usual.
>


-- 
Michael Wechner
Wyona      -   Open Source Content Management   -    Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
michael.wechner at wyona.com                        michi at apache.org
+41 44 272 91 61




More information about the Yanel-development mailing list