|
|
|
@ -80,7 +80,7 @@ class StaxEventXMLReader extends AbstractStaxXMLReader { |
|
|
|
|
StaxEventXMLReader(XMLEventReader reader) { |
|
|
|
|
try { |
|
|
|
|
XMLEvent event = reader.peek(); |
|
|
|
|
if (event == null || !(event.isStartDocument() || event.isStartElement())) { |
|
|
|
|
if (event != null && !(event.isStartDocument() || event.isStartElement())) { |
|
|
|
|
throw new IllegalStateException("XMLEventReader not at start of document or element"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -146,7 +146,7 @@ class StaxEventXMLReader extends AbstractStaxXMLReader { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!documentEnded) { |
|
|
|
|
if (documentStarted && !documentEnded) { |
|
|
|
|
handleEndDocument(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -169,19 +169,19 @@ class StaxEventXMLReader extends AbstractStaxXMLReader { |
|
|
|
|
getContentHandler().setDocumentLocator(new Locator2() { |
|
|
|
|
|
|
|
|
|
public int getColumnNumber() { |
|
|
|
|
return location.getColumnNumber(); |
|
|
|
|
return location != null ? location.getColumnNumber() : -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int getLineNumber() { |
|
|
|
|
return location.getLineNumber(); |
|
|
|
|
return location != null ? location.getLineNumber() : -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getPublicId() { |
|
|
|
|
return location.getPublicId(); |
|
|
|
|
return location != null ? location.getPublicId() : null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getSystemId() { |
|
|
|
|
return location.getSystemId(); |
|
|
|
|
return location != null ? location.getSystemId() : null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getXMLVersion() { |
|
|
|
|