[Axl] Auto-discard notification

Francis Brosnan Blazquez francis at aspl.es
Tue Jun 16 10:19:50 CEST 2009


Hi Maik,

> I want to implement a function storing strings as well as binary data. 
> I'd like to handle strings
> as binary data to avoid parsing problems. 

Ok, then CDATA support implemented in Axl is a perfect match for you.

> Maybe in the future I'd like 
> to store unicode strings as well without
> changing the encoding of the xml. In other words the xml should not care 
> about what is stored in the node.
> I'm using raw and base64 encoding for that kind of data. In case of 
> base64 encoding, I can store whatever
> I like without any problems, but in case of raw data I can get into 
> trouble with strings contaning special characters.

Ok. Current CDATA support implemented in Axl won't give you any problem
because, as you know, CDATA sections won't look at your strings but
still pays attention to special CDATA string termination "]]>". 

However, this will not be a problem because Axl library detects the
presence of such string to properly escape it so you can fully store raw
binary data (utf-8 bytes) without worrying about end user or external
application introducing such termination into your xml tree.

> >>         2. does axl support CDATA sections ?
> >>     
> >
> > Sure. CDATA support is provided using:
> >
> > - axl_node_set_cdata_content
> > http://www.aspl.es/xml/html/group__axl__node__module_g3eecc764f6ce874a4b0a7ecca843f915.html#g3eecc764f6ce874a4b0a7ecca843f915
> >
> > In fact CDATA support provided by axl can hold any binary data including
> > CDATA termination ]]> which is detected and properly escaped before
> > placing the content into the node.
> >
> > In the other hand, axl properly unmarshalls CDATA content having in mind
> > this support when you call to axl_node_get_content.
> > http://www.aspl.es/xml/html/group__axl__node__module_g61e95ef4a2d3e05b0f6973513c79c126.html#g61e95ef4a2d3e05b0f6973513c79c126
> >
> > Let me know if this solves your problem Maik. Cheers!
> >
> >   
> I guess that solves my problem.
> Thanks

Fine Maik. Cheers!
-- 
Francis Brosnan Blazquez <francis at aspl.es>
ASPL



More information about the Axl mailing list