Collator collator; if(getSignature().getArgumentCount() == 2) collator = context.getCollator(getArgument(1).eval(contextSequence, contextItem).getStringValue()); else collator = context.getDefaultCollator();
Collator collator = getCollator(contextSequence, contextItem, 2);
	public Sequence eval(Sequence contextSequence, Item contextItem)		throws XPathException {		Sequence arg = getArgument(0).eval(contextSequence, contextItem);		if (arg.getLength() == 0)			return Sequence.EMPTY_SEQUENCE;		Collator collator;		if(getSignature().getArgumentCount() == 2)			collator = context.getCollator(getArgument(1).eval(contextSequence, contextItem).getStringValue());		else			collator = context.getDefaultCollator();		SequenceIterator iter = arg.iterate();		AtomicValue min = (AtomicValue) iter.nextItem();		AtomicValue current;		while (iter.hasNext()) {			current = (AtomicValue) iter.nextItem();			if (current.getType() == Type.ATOMIC)				current = current.convertTo(Type.DOUBLE);			if (Type.subTypeOf(current.getType(), Type.NUMBER)				&& ((NumericValue) current).isNaN())				return DoubleValue.NaN;			min = min.min(collator, current);		}		return min;	}