*/
public Source dereference(String uri) throws TransformerException {
//System.err.println("Resolving " + href + " against " + base);
// TODO: handle fragment identifiers
try {
Uri abs = new Uri(uri);
Object obj = resolver.GetEntity(abs, mediaType, Type.GetType("System.IO.Stream"));
// expect cli.System.IO.FileNotFoundException if this fails
if (obj instanceof Stream) {
StreamSource source = new StreamSource(new DotNetInputStream((Stream)obj));
source.setSystemId(abs.toString());
return source;
} else if (obj instanceof TextReader) {
StreamSource source = new StreamSource(new DotNetReader((TextReader)obj));
source.setSystemId(abs.toString());
return source;
} else if (obj instanceof Source) {
return ((Source)obj);
} else {
throw new TransformerException(