Skip to content
Snippets Groups Projects
Commit f0e67680 authored by Marcel Dominik Wever's avatar Marcel Dominik Wever
Browse files

Fixed the issue that complex tokens get lost while reading in XML files.

parent 1e92cd47
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ public class XMLText extends TextImpl {
final JAXBContext jaxbContext = JAXBContext.newInstance(de.upb.intergramm.serialization.xml.model.Text.class);
final Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
this.text = (de.upb.intergramm.serialization.xml.model.Text) jaxbUnmarshaller.unmarshal(new ByteArrayInputStream(xml.getBytes("UTF-8")));
} catch (final JAXBException e) {
e.printStackTrace();
logger.error("Exception", e);
......@@ -256,10 +257,11 @@ public class XMLText extends TextImpl {
phrases.add(phrase);
}
// replace phrases in text
this.text.getPhrase().clear();
// this.text.getPhrase().clear();
this.text.getPhrase().addAll(phrases);
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
final JAXBContext jaxbContext = JAXBContext.newInstance(de.upb.intergramm.serialization.xml.model.Text.class);
final Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment