}
private void handleStartDocument(final XMLEvent event) throws SAXException {
if (event.isStartDocument()) {
StartDocument startDocument = (StartDocument) event;
String xmlVersion = startDocument.getVersion();
if (StringUtils.hasLength(xmlVersion)) {
this.xmlVersion = xmlVersion;
}
if (startDocument.encodingSet()) {
this.encoding = startDocument.getCharacterEncodingScheme();
}
}
if (getContentHandler() != null) {
final Location location = event.getLocation();
getContentHandler().setDocumentLocator(new Locator2() {