XML SAX Parser lost data

alonto

New Member
I'm parsing with SAX the next type of XML:\[code\] <?xml version="1.0" encoding="UTF-8" standalone="no"?><ROOT> <MESSAGES> <MESSAGE> <SUBJECT><![CDATA[Some text]]></SUBJECT> <BODY><![CDATA[Some text Some Text ]]></BODY> <RECIPIENTS> <TO><![CDATA[[email protected]]]></TO> <TO><![CDATA[[email protected]]]></TO> </RECIPIENTS> </MESSAGE> <MESSAGE> <SUBJECT><![CDATA[Some text]]></SUBJECT> <BODY><![CDATA[Some text1 Some Text2 ]]></BODY> <RECIPIENTS> <TO><![CDATA[[email protected]]]></TO> <TO><![CDATA[[email protected]]]></TO> </RECIPIENTS> </MESSAGE> <!-- List of 50 MESSAGE ITEM--> </MESSAGES></ROOT>\[/code\]When method characters is called, \[code\]public void characters(char buf[], int offset, int len) throws SAXException { String currentValue = http://stackoverflow.com/questions/10347107/new String(buf, offset, len); System.out.println(currentValue); }\[/code\]at some MESSAGE ITEMS, y recieve incorret values, for example, when i'm parsing the tag BODY i get '1 Some Text2' when i have to recieve 'Some text1 Some Text2' and i can't find the lost data even print to console all data that recieve at this method.At the message 47, ALWAYS cut the data at the same position (and in other messages too,always the same positions). I think this trouble could be because characters are calling twice or more in a moment, but how i just say before, i can't see the lost data even print all to the console.Can you help me please?Thanks
 
Back
Top