Skip to content

Commit 2b32c9c

Browse files
author
Nico Verwer
committed
[bugfix] XdmValue of(item) could not handle NodeProxy items
1 parent 196d70c commit 2b32c9c

File tree

1 file changed

+4
-0
lines changed
  • exist-core/src/main/java/org/exist/xquery/functions/fn/transform

1 file changed

+4
-0
lines changed

exist-core/src/main/java/org/exist/xquery/functions/fn/transform/Convert.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import net.sf.saxon.type.BuiltInAtomicType;
2727
import org.exist.dom.QName;
2828
import org.exist.dom.memtree.DocumentImpl;
29+
import org.exist.dom.persistent.NodeProxy;
2930
import org.exist.xquery.ErrorCodes;
3031
import org.exist.xquery.XPathException;
3132
import org.exist.xquery.functions.array.ArrayType;
@@ -119,6 +120,9 @@ static net.sf.saxon.s9api.QName of(final QNameValue qName) {
119120
}
120121

121122
XdmValue of(final Item item) throws XPathException {
123+
if (item instanceof NodeProxy) {
124+
return ofNode(((NodeProxy) item).getNode());
125+
}
122126
final int itemType = item.getType();
123127
if (Type.subTypeOf(itemType, Type.ATOMIC)) {
124128
return ofAtomic((AtomicValue) item);

0 commit comments

Comments
 (0)