/** * Construct a javax.xml.namespace.QName from this QualifiedNameValue * * @return an equivalent instance of the JAXP QName class */ public QName toJaxpQName() { return qName.toJaxpQName(); }
/** * Construct a javax.xml.namespace.QName from this QualifiedNameValue * * @return an equivalent instance of the JAXP QName class */ public QName toJaxpQName() { return qName.toJaxpQName(); }
public void addFunction(ExtensionFunctionDefinition functionDefinition) throws XPathException{ mLogger.info("Adding extension function definition to registry {}",functionDefinition.getFunctionQName().toString()); mFunctions.put(functionDefinition.getFunctionQName().toJaxpQName(), functionDefinition); }
public void removeFunction(ExtensionFunctionDefinition functionDefinition){ mLogger.info("Deleting extension function definition to registry {}",functionDefinition.getFunctionQName().toString()); mFunctions.remove(functionDefinition.getFunctionQName().toJaxpQName()); }
@Override public Expression bindVariable(StructuredQName name) throws XPathException { if (!globals.containsKey(new QName(name.toJaxpQName()))) throw new XPathException("Variable is not defined: $" + name); return evaluator.getStaticContext().bindVariable(name); } };
@Override public Sequence<?> call(XPathContext context, Sequence[] arguments) throws XPathException { Configuration config = context.getConfiguration(); Object value = resolver.resolveVariable(name.toJaxpQName()); if (value == null) { return EmptySequence.getInstance(); } JPConverter converter = JPConverter.allocate(value.getClass(), null, config); return converter.convert(value, context); }
@Override public Sequence<?> call(XPathContext context, Sequence[] arguments) throws XPathException { Configuration config = context.getConfiguration(); Object value = resolver.resolveVariable(name.toJaxpQName()); if (value == null) { return EmptySequence.getInstance(); } JPConverter converter = JPConverter.allocate(value.getClass(), null, config); return converter.convert(value, context); }
private XQException convertXPathException(XPathException xpe) { XQException xqe; if (xpe.getErrorCodeQName() == null) { xqe = new XQException(xpe.getMessage()); } else { if (xpe.getLocator() == null) { xqe = new XQQueryException(xpe.getMessage(), xpe.getErrorCodeQName().toJaxpQName()); } else { xqe = new XQQueryException(xpe.getMessage(), xpe.getErrorCodeQName().toJaxpQName(), xpe.getLocator().getLineNumber(), xpe.getLocator().getColumnNumber(), 0); } } return xqe; }
while (variables.hasNext()) { XPathVariable var = variables.next(); QName name = new QName(var.getVariableQName().toJaxpQName()); dynamicContext.setVariable(var, globals.get(name).getStringValue());