/* (non-Javadoc)
* @see JXPathBindingBuilderBase#buildBinding(Element, JXPathBindingManager.Assistant)
*/
public JXPathBindingBase buildBinding(Element bindingElm, Assistant assistant)
throws BindingException {
Library lib = assistant.getContext().getLocalLibrary();
String prefix = DomHelper.getAttribute(bindingElm, "prefix", null);
String uri = DomHelper.getAttribute(bindingElm, "uri", null);
if (prefix == null || uri == null) {
throw new BindingException("Import needs to specify both @uri and @prefix! (at " + DomHelper.getLocation(bindingElm) + ")");
}
try {
lib.includeAs(prefix, uri);
} catch (LibraryException e) {
throw new BindingException("Could not import library !(at " + DomHelper.getLocation(bindingElm) + ")", e);
}
return new ImportJXPathBinding();