Package xbird.xquery.expr.ext

Examples of xbird.xquery.expr.ext.MapExpr


                                colpath = "/";
                            } else {
                                XQExpression argExpr = params.get(0);
                                colpath = argExpr.eval(null, DynamicContext.DUMMY).toString();
                            }
                            MapExpr mapExpr = new MapExpr(colpath, bindingVar, flwrExpr);
                            return mapExpr.staticAnalysis(statEnv);
                        }
                    }
                }
            } else if(expr instanceof PathExpr) {
                PathExpr pathExpr = (PathExpr) expr;
                List<XQExpression> steps = pathExpr.getSteps();
                if(steps.size() > 1) {
                    XQExpression firstStep = steps.get(0);
                    if(firstStep instanceof DirectFunctionCall) {
                        DirectFunctionCall funcall = (DirectFunctionCall) firstStep;
                        if(FnCollection.FUNC_NAME.equals(funcall.getFuncName())) {
                            List<XQExpression> params = funcall.getParams();
                            final String colpath;
                            if(params.isEmpty()) {
                                colpath = "/";
                            } else {
                                XQExpression argExpr = params.get(0);
                                colpath = argExpr.eval(null, DynamicContext.DUMMY).toString();
                            }

                            FLWRExpr newFlwr = new FLWRExpr();
                            ForVariable forVar = new ForVariable();
                            forVar.setValue(funcall);
                            newFlwr.addClause(new ForClause(forVar));
                            VarRef varref = new VarRef(forVar);
                            steps.set(0, varref);
                            newFlwr.setFilteredReturnExpr(pathExpr);

                            MapExpr mapExpr = new MapExpr(colpath, forVar, newFlwr);
                            return mapExpr.staticAnalysis(statEnv);
                        }
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of xbird.xquery.expr.ext.MapExpr

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.