throws SAXException {
// Process the last contents as required.
// Do now, as characters() may be called more than once
- if(nextIsString) {
+ if(nextIsString && !lastContents.trim().isEmpty()) {
Integer idx = Integer.valueOf(lastContents);
lastContents = lruCache.get(idx);
if (lastContents == null && !lruCache.containsKey(idx)) {
//noinspection ResultOfMethodCallIgnored
Double.parseDouble(formattedValue);
output.append(formattedValue);
- } catch (NumberFormatException e) {
+ } catch (Exception e) {
output.append('"');
output.append(formattedValue);
output.append('"');