public SequenceIterator iterate(final XPathContext c) throws XPathException {
SequenceIterator i1 = operand0.iterate(c);
//return Type.isNodeType(getItemType()) && isSingleton();
// this is a sufficient condition, but other expressions override this method
if ((operand0.getSpecialProperties() & StaticProperty.ORDERED_NODESET) == 0) {
i1 = new DocumentOrderIterator(i1, GlobalOrderComparer.getInstance());
}
SequenceIterator i2 = operand1.iterate(c);
//return Type.isNodeType(getItemType()) && isSingleton();
// this is a sufficient condition, but other expressions override this method
if ((operand1.getSpecialProperties() & StaticProperty.ORDERED_NODESET) == 0) {
i2 = new DocumentOrderIterator(i2, GlobalOrderComparer.getInstance());
}
switch (operator) {
case Token.UNION:
return new UnionEnumeration(i1, i2,
GlobalOrderComparer.getInstance());