Problem parsing XML with SAX in WSAD - Please help!

J

Jonathan

I have written a SAX parser to read a simple XML file using this code
:

SAXParserFactory factory = SAXParserFactory.newInstance();

javax.xml.parsers.SAXParser saxParser = factory.newSAXParser();

saxParser.parse(new File(filePath),new PurgeHandler());

For some reason, when the code enters the characters(char[] buf, int
offset, int len) method of my handler, the 'len' is not correct
sometimes, so the String returned by the code
new String(buf,offset,len)
is just part of the content of my element.

Any help please?

Thanks!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top