}
XdmNode queryDocument = source.read();
String queryString = queryDocument.getStringValue();
ContentSource contentSource;
try {
if ("".equals(contentBase)) {
contentSource = ContentSourceFactory.newContentSource(host, port, user, password);
} else {
contentSource = ContentSourceFactory.newContentSource(host, port, user, password, contentBase);
}
} catch (Exception e) {
throw new XProcException(e);
}
if ("basic".equals(getOption(_auth_method, ""))) {
contentSource.setAuthenticationPreemptive(true);
}
Session session;
try {
session = contentSource.newSession ();
Request request = session.newAdhocQuery (queryString);
for (QName name : params.keySet()) {
XSString value = ValueFactory.newXSString (params.get(name));
XName xname = new XName(name.getNamespaceURI(), name.getLocalName());