• No replies
1830 Posts

Pinned topic Sax Parser - error : empty string

‏2012-07-30T21:47:43Z |
I am new to Sax parser and I am trying to parse an xml document. I am not validating it against the schema as I have no control over it and this is just a project.

In the xml file some of the elements are empty - and this is OK as they dont always need to have a value. It is getting as far as the below element and then it bombs out.


The error I am getting is :
java.lang.NumberFormatException: empty String
at sun.misc.FloatingDecimal.readJavaFormatString(
at java.lang.Float.valueOf(

It errors in the endElement. I am using the defaultHandler. Is their anyway I can get the parser to ignore empty strings and keep parsing the document?
Thanks in advance