Re: [xml] raw data

On Thu, Jun 12, 2008 at 09:10:40AM +0200, K.Karamazen wrote:
On Wed, 2008-06-11 at 15:59 +0100, Pete Cordell wrote:
Original Message From: "Daniel Veillard"
On Wed, Jun 11, 2008 at 08:52:06AM +0200, K.Karamazen wrote:
What is the standard way to encode raw data into CDATA section?


And you don't actually need to wrap the base64 in a CDATA section.  Just 
make the base64 your element or attribute content.


Pete Cordell
For XML C++ data binding visit

Yes, thank you. I forgot to say that only characters 0x20-0x7e may be
used in the encoding and that they are not escaped if not needed (i.e.
in that range only ']]>' escaped) so that:
1) the text remains readable
2) the text can be edited with a simple editor 

Is there such possibility in libxml2?

  Libxml2 follows the XML spec. What you need to read is

You will need to "invent" a way to encode characters which are not text
from an XML perspective, and "decode" them on the receiving side.
I doubt any standard editor will do that for you.
Basically XML was designed so that you can't just dump garbage in an XML
document and let the receiving side deal with the mess. You need to clean
up when creating the documents. That's true for CDATA or normal text, there
is no workaround.


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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