Package org.exist.xquery

Examples of org.exist.xquery.UserDefinedFunction


        final ProcessMonitor pm = db.getProcessMonitor();

            //execute the XQuery
            try {
            final UserDefinedFunction function = context.resolveFunction(functionName, 0);
            if (function != null) {
                  context.getProfiler().traceQueryStart();
                  pm.queryStarted(context.getWatchDog());
                 
                  final FunctionCall call = new FunctionCall(context, function);
View Full Code Here


            //look at each function
            final Iterator<UserDefinedFunction> itFunctions = compiled.getContext().localFunctions();

            final Set<URI> xqueryLocations = new HashSet<URI>();
            while(itFunctions.hasNext()) {
                final UserDefinedFunction function = itFunctions.next();
                final Annotation annotations[] = function.getSignature().getAnnotations();

                Set<org.exquery.xquery3.Annotation> functionRestAnnotations = null;

                //process the function annotations
                for(final Annotation annotation : annotations) {
View Full Code Here

            Source query = new ClassLoaderSource(source);
           
            CompiledXQuery compiledQuery = xquery.compile(context, query);
           
      for(Iterator<UserDefinedFunction> i = context.localFunctions(); i.hasNext(); ) {
        UserDefinedFunction func = i.next();
        FunctionSignature sig = func.getSignature();
       
        for (Annotation ann : sig.getAnnotations()) {
          if ("http://exist-db.org/xquery/xUnit".equals( ann.getName().getNamespaceURI())) {
            System.out.println(ann.getName().getLocalName());
           
View Full Code Here

           
            //get a compiled query service from the cache
            xquery = cache.getCompiledQuery(broker, resourceFunction.getXQueryLocation());
           
            //find the function that we will execute
            final UserDefinedFunction fn = findFunction(xquery, resourceFunction.getFunctionSignature());
           
            final XQueryContext xqueryContext = xquery.getContext();
           
            //set the request object - can later be used by the EXQuery Request Module
            xqueryContext.setAttribute(EXQ_REQUEST_ATTR, request);
View Full Code Here

            funcName = funcName.substring(0, p);
        }
        try {
            final QName fqn = QName.parse(context, funcName);
            final Module module = context.getModule(fqn.getNamespaceURI());
            UserDefinedFunction func = null;
            if (module != null)
                {func = ((ExternalModule)module).getFunction(fqn, arity, context);}
            else
                {func = context.resolveFunction(fqn, arity);}
            call = new FunctionCall(context, func);
View Full Code Here

   
    final XQueryContext context = compiledQuery.getContext();
        //execute the XQuery
        try {
         
        final UserDefinedFunction function = context.resolveFunction(functionName, urls.length);
        if (function != null) {
          final List<Expression> args = new ArrayList<Expression>(urls.length);
          for (int i = 0; i < urls.length; i++)
            args.add(new LiteralValue(context, new AnyURIValue(urls[i])));
         
View Full Code Here

TOP

Related Classes of org.exist.xquery.UserDefinedFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.