switch (_child.getNodeType()) {
case Node.ELEMENT_NODE:
nodeName = ((ElementImpl) _child).getLocalName();
if (nodeName.equals("param")) {
el = ((ElementImpl) _child);
Variable var = new VariableImpl(QName.parse(context, el.getAttribute("name")));
String type = el.getAttribute("as");
if ("xs:date".equals(type)) {
var.setStaticType(Type.DATE);
Sequence res = xquery.execute(el.getAttribute("select"), null, AccessContext.TEST);
Assert.assertEquals(1, res.getItemCount());
var.setValue(res);
} else if ("xs:dateTime".equals(type)) {
var.setStaticType(Type.DATE_TIME);
Sequence res = xquery.execute(el.getAttribute("select"), null, AccessContext.TEST);
Assert.assertEquals(1, res.getItemCount());
var.setValue(res);
} else if ("xs:string".equals(type)) {
var.setStaticType(Type.STRING);
Sequence res = xquery.execute(el.getAttribute("select"), null, AccessContext.TEST);
Assert.assertEquals(1, res.getItemCount());
var.setValue(res);
} else {
Assert.fail("unknown type '" + type + "'");
}
context.declareGlobalVariable(var);
}