[jibx-users] Bug in UTF8StreamWriter.writeTextContent(String text) ?

2006-05-08 Thread Stefano Nichele

Hi All,
i think that i found a bug in UTF8StreamWriter.writeTextContent(String
text).
In this method the entity ,  are replaced by their escape sequence.
Moreover if:

else if (chr == ''  i  2  text.charAt(i-1) == ']' 
   text.charAt(i-2) == ']') {
   m_buffer[fill++] = (byte)']';
   m_buffer[fill++] = (byte)']';
   fill = writeEntity(GT_ENTITY, fill);
}

the  is replaced with gt;.
The code above means:
if the current char is  and the previous chars are ]] escape the .

Well, i have a java class that contains a text with:
this is my ![CDATA[text]] with some problem

My expected xml is:

Datathis is my ![CDATA[text]] with some problem/Data

but the result is:
Datathis is my lt;![CDATA[textgt; with some problem/Data

So the ]] are now . I think this is caused because my text doesn't
start with CDATA so it is handled as simple text.


I fixed it removing:

   m_buffer[fill++] = (byte)']';
   m_buffer[fill++] = (byte)']';


What do you thing about that ?

Thanks a lot
Stefano



---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users


[jibx-users] Bug in UTF8StreamWriter.writeTextContent(String text) ?

2006-05-06 Thread Stefano Nichele

Hi All,
i think that i found a bug in UTF8StreamWriter.writeTextContent(String 
text).
In this method the entity ,  are replaced by their escape sequence. 
Moreover if:


else if (chr == ''  i  2  text.charAt(i-1) == ']' 
   text.charAt(i-2) == ']') {
   m_buffer[fill++] = (byte)']';
   m_buffer[fill++] = (byte)']';
   fill = writeEntity(GT_ENTITY, fill);
}

the  is replaced with gt;.
The code above means:
if the current char is  and the previous chars are ]] escape the .

Well, i have a java class that contains a text with:
this is my ![CDATA[text]] with some problem

My expected xml is:

Datathis is my ![CDATA[text]] with some problem/Data

but the result is:
Datathis is my lt;![CDATA[textgt; with some problem/Data

So the ]] are now . I think this is caused because my text doesn't 
start with CDATA so it is handled as simple text.



I fixed it removing:

   m_buffer[fill++] = (byte)']';
   m_buffer[fill++] = (byte)']';
   
   
What do you thing about that ?


Thanks a lot
Stefano


---
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users