Skip to content

Commit e7e8dac

Browse files
committed
[bugfix] NodeProxy should be able to locate a document-node()
1 parent 447521c commit e7e8dac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

exist-core/src/main/java/org/exist/dom/persistent/NodeProxy.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,11 +1168,11 @@ public boolean getProcessInReverseOrder() {
11681168
@Override
11691169
public NodeSet getParents(final int contextId) {
11701170
final NodeId pid = nodeId.getParentId();
1171-
if(pid == null || pid == NodeId.DOCUMENT_NODE) {
1171+
if (pid == null) {
11721172
return NodeSet.EMPTY_SET;
11731173
}
11741174

1175-
final NodeProxy parent = new NodeProxy(expression, doc, pid, Node.ELEMENT_NODE);
1175+
final NodeProxy parent = new NodeProxy(expression, doc, pid, pid == NodeId.DOCUMENT_NODE ? Node.DOCUMENT_NODE : Node.ELEMENT_NODE);
11761176
if(contextId != Expression.NO_CONTEXT_ID) {
11771177
parent.addContextNode(contextId, this);
11781178
} else {

0 commit comments

Comments
 (0)