org.xml.sax.helper Event problems

Y

yhou

Trying to use org.xml.sax parser, extended DefaultHandler to
handle my xml while parsing.

However, DefaultHandler.characters(...) were called twice while
parsing one text element. Seems two events were fired instead of one,
and this only happens occasionally.

Any idea what could have caused this behavior?

Sam Zhang
 
S

Sudsy

yhou wrote:
However, DefaultHandler.characters(...) were called twice while
parsing one text element. Seems two events were fired instead of one,
and this only happens occasionally.

Ah, but it happens consistently, i.e. consistent with the format
of the data in the XML. Take a close look at the source file,
paying particular attention to line-splitting (esp. before and
after start/end tags). Then correlate this with the behaviour
you see.
 

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

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top