C
CarlosRivera
I am using apache xerces J 2.5.0. I have \r\n feed combinations in the
CDATA sections that get converted to \n (or rather \r gets lost. I am
using sax parsing. I can see in the buffer that is passed that when I
have \n, one character back it has the \r, but the start offset is on
the \n. The source is an XML string, so it did not get lost while
reading the file. In any case, it seems that it should not be removing
the \r in the cdata section during my sax events. I am running this on
windows; so it seems like the bahavior is converting \r\n to \n might be
related. If this is related, this means that the code would not be
portable between unix and windows. It should give it to me as is.
Isn't this one of the purposes of the CDATA? I know that one can put
character entities in the XML and it works, but this is real ugly. We
just want to get some text from source location and put it into the XML
without having to replace \r with
.
CDATA sections that get converted to \n (or rather \r gets lost. I am
using sax parsing. I can see in the buffer that is passed that when I
have \n, one character back it has the \r, but the start offset is on
the \n. The source is an XML string, so it did not get lost while
reading the file. In any case, it seems that it should not be removing
the \r in the cdata section during my sax events. I am running this on
windows; so it seems like the bahavior is converting \r\n to \n might be
related. If this is related, this means that the code would not be
portable between unix and windows. It should give it to me as is.
Isn't this one of the purposes of the CDATA? I know that one can put
character entities in the XML and it works, but this is real ugly. We
just want to get some text from source location and put it into the XML
without having to replace \r with
.