Commit 5f0844e7 authored by Thibault Ehrhart's avatar Thibault Ehrhart

Set headline language to article language if there is no language tag

parent 4867e57d
......@@ -84,9 +84,12 @@ public final class AgenceFrancePresseMethods {
}
break;
case "HeadLine":
news.addHeadline(
streamReader.getAttributeValue("http://www.w3.org/XML/1998/namespace", "lang"),
streamReader.getElementText());
String headLineLanguage =
streamReader.getAttributeValue("http://www.w3.org/XML/1998/namespace", "lang");
if (headLineLanguage == null) {
headLineLanguage = news.getLanguage();
}
news.addHeadline(headLineLanguage, streamReader.getElementText());
break;
case "Subject":
case "SubjectDetail":
......@@ -152,7 +155,7 @@ public final class AgenceFrancePresseMethods {
streamReader.next();
}
} catch (final XMLStreamException e) {
AgenceFrancePresseMethods.LOGGER.error(e.toString());
AgenceFrancePresseMethods.LOGGER.error("Error when parsing XML file: " + e.toString());
}
return news;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment