public NodePointer createChild(
JXPathContext context,
QName name,
int index) {
Object collection = createCollection(context, index);
if (!isActual() || (index != 0 && index != WHOLE_COLLECTION)) {
AbstractFactory factory = getAbstractFactory(context);
boolean success =
factory.createObject(
context,
this,
collection,
getName().toString(),
index);
if (!success) {
throw new JXPathAbstractFactoryException(
"Factory could not create object path: " + asPath());
}
NodePointer cln = (NodePointer) clone();
cln.setIndex(index);
return cln;
}
return this;
}