use of org.exist.dom.memtree.NodeImpl in project exist by eXist-db.
the class ArrayListValueSequence method getFollowing.
@Override
public Sequence getFollowing(final NodeTest test, final int position) throws XPathException {
final ArrayListValueSequence nodes = new ArrayListValueSequence();
for (final Item value : values) {
final NodeImpl node = (NodeImpl) value;
node.selectFollowing(test, nodes, position);
}
return nodes;
}
use of org.exist.dom.memtree.NodeImpl in project exist by eXist-db.
the class ArrayListValueSequence method getDescendants.
@Override
public Sequence getDescendants(final boolean includeSelf, final NodeTest test) throws XPathException {
final ArrayListValueSequence nodes = new ArrayListValueSequence();
for (final Item value : values) {
final NodeImpl node = (NodeImpl) value;
node.selectDescendants(includeSelf, test, nodes);
}
return nodes;
}
use of org.exist.dom.memtree.NodeImpl in project exist by eXist-db.
the class ArrayListValueSequence method getAttributes.
// <editor-fold desc="Methods of MemoryNodeSet">
@Override
public Sequence getAttributes(final NodeTest test) throws XPathException {
final ArrayListValueSequence nodes = new ArrayListValueSequence();
for (final Item value : values) {
final NodeImpl node = (NodeImpl) value;
node.selectAttributes(test, nodes);
}
return nodes;
}
use of org.exist.dom.memtree.NodeImpl in project exist by eXist-db.
the class ContentReceiver method sendDataToCallback.
/**
* Send data to callback handler
*/
private void sendDataToCallback() {
// Retrieve result as document
Document doc = docBuilderReceiver.getDocument();
// Get the root
NodeImpl root = (NodeImpl) doc.getDocumentElement();
// Construct parameters
Sequence[] params = new Sequence[3];
params[0] = root;
params[1] = userData;
params[2] = prevReturnData;
try {
// Send data to callback function
Sequence ret = ref.evalFunction(null, null, params);
prevReturnData = ret;
result.addAll(ret);
} catch (XPathException e) {
LOG.warn(e.getMessage(), e);
}
}
use of org.exist.dom.memtree.NodeImpl in project exist by eXist-db.
the class CommentConstructor method eval.
/* (non-Javadoc)
* @see org.exist.xquery.Expression#eval(org.exist.xquery.StaticContext, org.exist.dom.persistent.DocumentSet, org.exist.xquery.value.Sequence, org.exist.xquery.value.Item)
*/
public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathException {
if (newDocumentContext) {
context.pushDocumentContext();
}
try {
final MemTreeBuilder builder = context.getDocumentBuilder();
final int nodeNr = builder.comment(data);
final NodeImpl node = builder.getDocument().getNode(nodeNr);
return node;
} finally {
if (newDocumentContext) {
context.popDocumentContext();
}
}
}
Aggregations