Package org.exist.xquery

Examples of org.exist.xquery.VariableImpl


                                switch (_child.getNodeType()) {
                                case Node.ELEMENT_NODE:
                                    nodeName = ((ElementImpl) _child).getLocalName();
                                    if (nodeName.equals("param")) {
                                        el = ((ElementImpl) _child);
                                        Variable var = new VariableImpl(QName.parse(context, el.getAttribute("name")));

                                        String type = el.getAttribute("as");
                                        if ("xs:date".equals(type)) {
                                            var.setStaticType(Type.DATE);

                                            Sequence res = xquery.execute(el.getAttribute("select"), null, AccessContext.TEST);
                                            Assert.assertEquals(1, res.getItemCount());
                                            var.setValue(res);
                                        } else if ("xs:dateTime".equals(type)) {
                                            var.setStaticType(Type.DATE_TIME);

                                            Sequence res = xquery.execute(el.getAttribute("select"), null, AccessContext.TEST);
                                            Assert.assertEquals(1, res.getItemCount());
                                            var.setValue(res);
                                        } else if ("xs:string".equals(type)) {
                                            var.setStaticType(Type.STRING);

                                            Sequence res = xquery.execute(el.getAttribute("select"), null, AccessContext.TEST);
                                            Assert.assertEquals(1, res.getItemCount());
                                            var.setValue(res);
                                        } else {
                                            Assert.fail("unknown type '" + type + "'");
                                        }
                                        context.declareGlobalVariable(var);
                                    }
View Full Code Here

TOP

Related Classes of org.exist.xquery.VariableImpl

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.