Skip to content

Commit

Permalink
[NOID] fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vga91 committed Dec 19, 2024
1 parent e913737 commit 746763d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions core/src/main/java/apoc/export/graphml/XmlGraphMLReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,16 @@ public XmlGraphMLReader(GraphDatabaseService db, Transaction tx) {
}

public enum ReaderType {
GRAPHML("attvalue", KEY, LABEL, LABELS),
GEXF("data", FOR, KIND, LABEL);
GRAPHML("data", KEY, LABEL, LABELS),
GEXF("attvalue", FOR, KIND, LABEL);

public String attvalue;
public String data;
public QName key;
public QName label;
public QName labels;

ReaderType(String attvalue, QName key, QName label, QName labels) {
this.attvalue = attvalue;
ReaderType(String data, QName key, QName label, QName labels) {
this.data = data;
this.key = key;
this.label = label;
this.labels = labels;
Expand Down Expand Up @@ -301,6 +301,7 @@ public long parseXML(Reader input, TerminationGuard terminationGuard, ReaderType
getAttribute(element, TYPE),
getAttribute(element, LIST),
getAttribute(element, FOR));

XMLEvent next = peek(reader);
if (next.isStartElement()
&& next.asStartElement()
Expand All @@ -314,7 +315,7 @@ public long parseXML(Reader input, TerminationGuard terminationGuard, ReaderType
else relKeys.put(id, key);
continue;
}
if (name.equals(readerType.attvalue)) {
if (name.equals(readerType.data)) {
if (last == null) continue;
String id = getAttribute(element, readerType.key);
boolean isNode = last instanceof Node;
Expand Down

0 comments on commit 746763d

Please sign in to comment.