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

2006-05-10 Thread Dennis Sosnoski

Hi Stefano,

Your fix looks right to me. I'm trying to recreate the problem in a test 
case now (and having a hard time for some unknown reason). I'll verify 
and add the fix in the 1.1 code. The same code is used in all the stream 
writer variations, so the fix needs to apply to all as well. Thanks for 
finding this!


 - Dennis

Dennis M. Sosnoski
SOA, Web Services, and XML
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117



Stefano Nichele wrote:


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




---
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-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