[Expat-discuss] CRLF conversion question

Armin Bauer armin.bauer at desscon.com
Tue Sep 7 16:09:18 CEST 2004


On Tue, 2004-09-07 at 15:44, Fred L. Drake, Jr. wrote:
> On Tuesday 07 September 2004 09:16 am, Armin Bauer wrote:
>  > Im working on multisync, which uses syncml. i have to send VCARD data
>  > over syncml. A vcard looks like this:
>  >
>  > BEGIN:VCARD\r\n...
> ...
>  > Is this a known bug and is there anything i can do about this?
> 
> I would strongly suspect that this is related to Expat myself.  Here's why.
> 
> XML requires normalization of line-ened sequences to \n.  There are ways to 
> encode \r\n so that you get it back; the easiest is:
> 
> BEGIN:VCARD
\n
> 
> I don't know anything about syncml, but if there's some way to encode binary 
> data, that may be an option as well.
> 
> 
>   -Fred

I suspect that this is a bug in the parser which manufactures the xml
tree.

the wbxml lib goes through the cdata which consist of a lot of nodes
like this:

WBXML Encoder> CDATA Begin
WBXML Encoder> Text: <BEGIN:VCARD>
WBXML Encoder> Text: <
>
WBXML Encoder> Text: <VERSION:2.1>
WBXML Encoder> Text: <
>

But it should be only one node which holds all the cdata. By the way:
the <
> node holds a 0x0a.

So i guess the parser just creates a node for every 0x0d it encounters
even it is in the cdata. That doesnt sound right to me.

The correct fix to this (if my assumptions are correct) would be to not
parse the cdata into nodes but to leave it as is.

BTW: the &#13; fix did not work. It was left as is.

Armin



More information about the Expat-discuss mailing list