Hi All
I wrote a simple SAX parser to parse my document having the following format
<data>
<element>
<record>
</record>
<record>
</record>
</element>
</data>
The data in between the record tags are unicode characters(of chinese).
However, i face problem at times as the character() call back method is called twice at times.Its totally random,can't predict.
So if my unicode data is 1234 4567 1234, it at times reads it as
1234 4 and then as 567 1234
so when i convert my unicode back to
string, i get special characters.
I've checked the XML before sending, its proper and well formatted.
The converted unicode is added to an arraylist.
Thankful if someone could throw some light.
In the mean time, I've added 2 int variables.I increment one of them when the start element method is called and other when the Character method is called. I check if both are equal before converting the unicode to string, if not, i remove the last added element in the arraylist and concat it to teh current one.This has solved my problem, but want to know the reason for the improper behaviour.
Jhakda Velu