/**
* Iterate over the results of the function
*/
public SequenceIterator iterate(XPathContext c) throws XPathException {
AtomicValue sv = (AtomicValue)argument[0].evaluateItem(c);
if (sv==null) {
return EmptyIterator.getInstance();
}
CharSequence input = sv.getStringValueCS();
if (input.length() == 0) {
return EmptyIterator.getInstance();
}
RegularExpression re = regexp;
if (re == null) {
sv = (AtomicValue)argument[1].evaluateItem(c);
CharSequence pattern = sv.getStringValueCS();
CharSequence flags;
if (argument.length==2) {
flags = "";
} else {
sv = (AtomicValue)argument[2].evaluateItem(c);
flags = sv.getStringValueCS();
}
try {
final Platform platform = Configuration.getPlatform();
final int xmlVersion = c.getConfiguration().getXMLVersion();