* an empty iterator.
*/
public SequenceIterator resolve(String href, String base, XPathContext context) throws XPathException {
if (href == null) {
IEnumerable ie = (IEnumerable)registeredCollections.get("");
if (ie == null) {
return super.resolve(href, base, context);
// XPathException de = new XPathException("Default collection is undefined");
// de.setErrorCode("FODC0002");
// de.setXPathContext(context);
// throw de;
}
return new UriIterator(ie.GetEnumerator());
}
URI abs;
try {
abs = new URI(base).resolve(href);
} catch (URISyntaxException err) {
XPathException de = new XPathException("Invalid collection URI " + base + ", " + href);
de.setErrorCode("FODC0002");
de.setXPathContext(context);
throw de;
}
IEnumerable ie = (IEnumerable)registeredCollections.get(abs.toString());
if (ie == null) {
return super.resolve(href, base, context);
// XPathException err = new XPathException("Unknown collection " + abs);
// err.setErrorCode("FODC0004");
// err.setXPathContext(context);
// throw err;
}
return new UriIterator(ie.GetEnumerator());
}