neo4j-apoc-procedures icon indicating copy to clipboard operation
neo4j-apoc-procedures copied to clipboard

Fix double escaping graphml

Open vga91 opened this issue 3 years ago • 2 comments

The javax.xml.stream.XMLStreamWriter escape some chars, e.g from & to &, so we cannot use StringEscapeUtils.escapeXml10() because we would escape twice. We just have to remove the invalid xml chars.

The bug is occurred here, and not in 4.4, because of different retrieving order of node.getPropertyKeys(). Therefore, I added more chars in test cases.


Also, added missing @Test in testExportGraphGraphMLQueryTinkerPop

vga91 avatar Sep 22 '22 12:09 vga91

Looks good, out of curiosity, where did you get the list for the invalid characters? are we sure that contains all of them? :)

gem-neo4j avatar Sep 23 '22 12:09 gem-neo4j

I've extracted the char list from the previous implementation, StringEscapeUtils.escapeXml10.

Alternatively we could change the pattern in a negative way, to ^[setOfAllowedChars], like here. However, the results match each other.

vga91 avatar Sep 23 '22 15:09 vga91