SAXParser sometimes give me back a bad value

Johnny

New Member
This is weird..I've a DefaultHandler that is actually handling everything well but sometimes, for no apparent reasons, it will give me 0 instead of the correct value. This is happening everytime in the same place so there is something wrong but I cannot figure out what!The problem is this. I'm parsing a time like "17:00:00". When the parser arrive at the "strange time" it will parse it like this -> "17:00:0", call one more time the method characters(char[] ch, int start, int end), and parse the last "0".WTF?Pratically it will set the end to 7 instead of 8. And this is working for everything except for a few values!The code is pretty straightforward, it's just a simple saxparser. This is the characters method:\[code\] public void characters(char[] ch, int start, int end) { if(on_element) value = http://stackoverflow.com/questions/11281491/new String(ch, start, end); }\[/code\]Any hint?
 
Back
Top