public AtomicValue next() throws XPathException { while (true) { if (results != null) { if (atomicPosition < results.getLength()) { return results.itemAt(atomicPosition++); } else { results = null; continue; } } AtomicSequence atomized = base.nextAtomizedValue(); if (atomized == null) { results = null; return null; } if (atomized instanceof AtomicValue) { // common case (the atomized value of the node is a single atomic value) results = null; return (AtomicValue) atomized; } else { results = atomized; atomicPosition = 0; // continue } } }
public AtomicValue next() throws XPathException { while (true) { if (results != null) { if (atomicPosition < results.getLength()) { return results.itemAt(atomicPosition++); } else { results = null; continue; } } AtomicSequence atomized = base.nextAtomizedValue(); if (atomized == null) { results = null; return null; } if (atomized instanceof AtomicValue) { // common case (the atomized value of the node is a single atomic value) results = null; return (AtomicValue) atomized; } else { results = atomized; atomicPosition = 0; // continue } } }
public AtomicValue next() throws XPathException { while (true) { if (currentValue != null) { if (currentValuePosition < currentValueSize) { return currentValue.itemAt(currentValuePosition++); } else { currentValue = null; } } Item nextSource = base.next(); if (nextSource != null) { AtomicSequence v = nextSource.atomize(); if (v instanceof AtomicValue) { return (AtomicValue) v; } else { currentValue = v; currentValuePosition = 0; currentValueSize = currentValue.getLength(); // now go round the loop to get the first item from the atomized value } } else { currentValue = null; return null; } } }
if (currentValue != null) { if (currentValuePosition < currentValueSize) { return currentValue.itemAt(currentValuePosition++); } else { currentValue = null;