setting notes that is invalid xml throws com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '<'
piotr-gawron opened this issue · comments
Here is an example that leads to this exception:
SBMLDocument doc = new SBMLDocument(3, 1);
Model result = doc.createModel("");
result.setNotes("x=y<z");
The solution to such problem would be encoding the string before surrounding it with xml tags here:
https://github.com/sbmlteam/jsbml/blob/master/core/src/org/sbml/jsbml/util/StringTools.java#L651
Normally I would use something like StringEscapeUtils from the Apache Commons Lang but because you are not using external libraries (at least I don't see them), you might at least check what they are doing and apply something similar.