Examples of NSContext


Examples of org.apache.ode.utils.NSContext

    }

    @Test
    public void testEvaluate_NaN() throws Exception {
        OXPath10Expression exp = compile("number('/tns:Title/tns:Data')");
        NSContext context = new NSContext();
        context.register("tns", "http://foobar");
        exp.namespaceCtx = context;

        Node retVal = _runtime.evaluateNode(exp, this);

        assertNotNull(retVal);
View Full Code Here

Examples of org.apache.ode.utils.NSContext

                    _compilerContext, out, source.getNamespaceContext(), _bpelNS);
            JaxpVariableResolver variableResolver = new JaxpVariableResolver(
                    _compilerContext, out);

            XQueryDeclarations declarations = new XQueryDeclarations();
            NSContext nsContext = source.getNamespaceContext();
            Set<String> prefixes = nsContext.getPrefixes();
            if (!nsContext.getUriSet().contains(Namespaces.ODE_EXTENSION_NS)) {
                nsContext.register("ode", Namespaces.ODE_EXTENSION_NS);
            }
            for (String prefix : prefixes) {
                String uri = nsContext.getNamespaceURI(prefix);
                staticContext.declareNamespace(prefix, uri);
                if ("".equals(prefix)) {
                    declarations.declareDefaultElementNamespace(uri);
                } else if ("bpws".equals(prefix)) {
                    declarations.declareNamespace("bpws", "java:" + Constants.XQUERY_FUNCTION_HANDLER_COMPILER);
View Full Code Here

Examples of org.apache.ode.utils.NSContext

                domElementNsUri,
                domElementQName);
       

        if (deepNS) {
            NSContext nscontext = new NSContext();
            buildNScontext(nscontext, element);
            DOMUtils.injectNamespacesWithAllPrefixes(domElement,nscontext);
        } else {
            if (element.getAllDeclaredNamespaces() != null) {
                for (Iterator<OMNamespace> i = element.getAllDeclaredNamespaces(); i.hasNext(); ) {
View Full Code Here

Examples of org.apache.ode.utils.NSContext

        OMElement omElement = parent == null ? omf.createOMElement(src.getLocalName(), namespace) :
        omf.createOMElement(src.getLocalName(), namespace, parent);

        if (parent == null) {
            NSContext nscontext = DOMUtils.getMyNSContext(src);
            injectNamespaces(omElement,nscontext.toMap(),omf);
        } else {
            Map<String,String> nss = DOMUtils.getMyNamespaces(src);
            injectNamespaces(omElement, nss,omf);
        }
View Full Code Here

Examples of org.apache.ode.utils.NSContext

    @SuppressWarnings("unchecked")
    public static Element toDOM(OMElement element, Document doc, boolean deepNS) {
        final Element domElement = doc.createElementNS(element.getQName().getNamespaceURI(), element.getQName().getLocalPart());

        if (deepNS) {
            NSContext nscontext = new NSContext();
            buildNScontext(nscontext, element);
            DOMUtils.injectNamespaces(domElement,nscontext);
        } else {
            if (element.getAllDeclaredNamespaces() != null) {
                for (Iterator<OMNamespace> i = element.getAllDeclaredNamespaces(); i.hasNext(); ) {
View Full Code Here

Examples of org.apache.ode.utils.NSContext

                omElement.setNamespace(omf.createOMNamespace(src.getNamespaceURI(), src.getPrefix()));
            else omElement.declareDefaultNamespace(src.getNamespaceURI());
        }
       
        if (parent == null) {
            NSContext nscontext = DOMUtils.getMyNSContext(src);
            injectNamespaces(omElement,nscontext.toMap());
        } else {
            Map<String,String> nss = DOMUtils.getMyNamespaces(src);
            injectNamespaces(omElement, nss);
        }
       
View Full Code Here

Examples of org.apache.ode.utils.NSContext

            configuration.setAllNodesUntyped(true);
            configuration.setHostLanguage(Configuration.XQUERY);

            XQStaticContext staticEnv = xqconn.getStaticContext();

            NSContext nsContext = oxquery10.namespaceCtx;
            Set<String> prefixes = nsContext.getPrefixes();
            for (String prefix : prefixes) {
                String uri = nsContext.getNamespaceURI(prefix);
                staticEnv.declareNamespace(prefix, uri);
            }

            configuration.setSchemaValidationMode(Validation.SKIP);
            xqconn.setStaticContext(staticEnv);
View Full Code Here

Examples of org.apache.ode.utils.NSContext

                    _compilerContext, out, source.getNamespaceContext(), _bpelNS);
            JaxpVariableResolver variableResolver = new JaxpVariableResolver(
                _compilerContext, out);

            XQueryDeclarations declarations = new XQueryDeclarations();           
            NSContext nsContext = source.getNamespaceContext();
          Set<String> prefixes = nsContext.getPrefixes();
          if (!nsContext.getUriSet().contains(Namespaces.ODE_EXTENSION_NS)) {
            nsContext.register("ode", Namespaces.ODE_EXTENSION_NS);
          }
          for (String prefix : prefixes) {
            String uri = nsContext.getNamespaceURI(prefix);
            staticContext.declareNamespace(prefix, uri);
            if ("".equals(prefix)) {
              declarations.declareDefaultElementNamespace(uri);
            } else if ("bpws".equals(prefix)) {
                    declarations.declareNamespace("bpws", "java:" + Constants.XQUERY_FUNCTION_HANDLER_COMPILER);
View Full Code Here

Examples of org.apache.ode.utils.NSContext

   

    public BpelObject(Element el) {
        _element = el;
        _type = new QName(el.getNamespaceURI(), el.getLocalName());
        _nsContext = new NSContext();
       
        initNSContext(el);
    }
View Full Code Here

Examples of org.apache.ode.utils.NSContext

     */
    public QName[] getProperties() {
        if (_props == null) {
            StringTokenizer st = new StringTokenizer(getAttribute("properties", ""));
            ArrayList<QName> al = new ArrayList<QName>();
            NSContext nsc = getNamespaceContext();
            for (; st.hasMoreTokens();) {
                String token = st.nextToken();
                if (token.startsWith("{")) {
                    String namespace = token.substring(1, token.indexOf("}"));
                    String localname = token.substring(token.indexOf("}") + 1, token.length());
                    al.add(new QName(namespace, localname));
                } else {
                    al.add(nsc.derefQName(token));
                }
            }
            _props = al.toArray(new QName[] {});
        }
        return _props;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.