This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes endElement called twice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "endElement called twice" Watch "endElement called twice" New topic
Author

endElement called twice

Forest Huge
Greenhorn

Joined: Oct 10, 2002
Posts: 15
Hi,
I am using SAX parser, for some reason, the endElement method was called twice for the last element of a document.
I understand that for a large element value, the charaters method might be called many times. But this endElement should not be called twice, right?
Did I miss something?
Thanks!
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Huh? If that's really the case, the only thing you can do is to change the parser implementation or tweak the XML document until the parser behaves correctly, I'm afraid.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
Consider Paul's rocket mass heater.
 
subject: endElement called twice
 
Similar Threads
doubt in SAX
Document Object Tree creation using SAX Parser
SAXParser not calling characters()
SAX
XML Parsing of Empty Tags