public void supplyStaticContext(StaticContext context, int locationId, Expression[] arguments) throws XPathException {
staticContext = context;
}
public Sequence call(XPathContext xPathContext, Sequence[] sequences) throws XPathException {
StructuredQName propertyName = null;
XProcRuntime runtime = registry.getRuntime(xdef);
XStep step = runtime.getXProcData().getStep();
// FIXME: this can't be the best way to do this...
// FIXME: And what, exactly, is this even supposed to be doing!?
if (step != null && !(step instanceof XCompoundStep)) {
throw XProcException.dynamicError(23);
}
try {
String lexicalQName = sequences[0].head().getStringValue();
propertyName = StructuredQName.fromLexicalQName(
lexicalQName,
false,
false,
xPathContext.getConfiguration().getNameChecker(),
staticContext.getNamespaceResolver());
} catch (XPathException e) {
if (e.getErrorCodeLocalPart()==null || e.getErrorCodeLocalPart().equals("FOCA0002")
|| e.getErrorCodeLocalPart().equals("FONS0004")) {
e.setErrorCode("XTDE1390");
}
throw e;
}
String uri = propertyName.getURI();
String local = propertyName.getLocalPart();
String value = "";
if (uri.equals(XProcConstants.NS_XPROC)) {
if ("episode".equals(local)) {
value = runtime.getEpisode();