MCPcopy Create free account
hub / github.com/BaseXdb/basex / item

Method item

basex-core/src/main/java/org/basex/query/up/expr/Delete.java:34–47  ·  view source on GitHub ↗
(final QueryContext qc, final InputInfo ii)

Source from the content-addressed store, hash-verified

32 }
33
34 @Override
35 public Item item(final QueryContext qc, final InputInfo ii) throws QueryException {
36 final Iter iter = arg(0).unwrappedIter(qc);
37 for(Item item; (item = qc.next(iter)) != null;) {
38 if(!(item instanceof final XNode node)) throw UPTRGDELEMPT_X.get(info, item);
39 // nodes without parents are ignored
40 if(node.parent() == null) continue;
41 final Updates updates = qc.updates();
42 final DBNode dbnode = updates.determineDataRef(node, qc);
43 checkWrite(dbnode, qc);
44 updates.add(new DeleteNode(dbnode.pre(), dbnode.data(), info), qc);
45 }
46 return Empty.VALUE;
47 }
48
49 @Override
50 public Expr copy(final CompileContext cc, final IntObjectMap<Var> vm) {

Callers

nothing calls this directly

Calls 11

determineDataRefMethod · 0.95
addMethod · 0.95
preMethod · 0.95
dataMethod · 0.95
checkWriteMethod · 0.80
nextMethod · 0.65
getMethod · 0.65
unwrappedIterMethod · 0.45
argMethod · 0.45
parentMethod · 0.45
updatesMethod · 0.45

Tested by

no test coverage detected