Commit ad574875 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

species name is escaped

parent 01cc4707
......@@ -574,7 +574,7 @@ public class ModelToGPML {
String nodeType = getType(species);
result.append(
" <DataNode TextLabel=\"" + species.getName() + "\" "
" <DataNode TextLabel=\"" + XmlParser.escapeXml(species.getName()) + "\" "
+ "GraphId=\"" + species.getElementId() + "\"");
if (nodeType != null) {
result.append(" Type=\"" + nodeType + "\"");
......
......@@ -451,6 +451,17 @@ public class ModelToGPMLTest extends WikipathwaysTestFunctions {
Model model2 = serializeOverGpml(model);
assertEquals(0, new ModelComparator().compare(model, model2));
}
@Test
public void specialCharacterInProteinName() throws Exception {
Model model = createModel();
Element element = createProtein();
element.setName("hello&by");
model.addElement(element);
Model model2 = serializeOverGpml(model);
assertEquals(0, new ModelComparator().compare(model, model2));
}
}
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