Package org.apache.axiom.om.xpath

Examples of org.apache.axiom.om.xpath.AXIOMXPath.addNamespace()


        // create a new filter mediator
        FilterMediator filter = new FilterMediator();

        // set source xpath condition to //symbol
        AXIOMXPath source = new AXIOMXPath("//wsx:symbol");
        source.addNamespace("wsx", "http://www.webserviceX.NET/");
        filter.setSource(source);

        // set regex to MSFT
        Pattern regex = Pattern.compile("MSFT");
        filter.setRegex(regex);
View Full Code Here


        // create a new switch mediator
        switchMediator = new SwitchMediator();

        // set xpath condition to select symbol
        AXIOMXPath xpath = new AXIOMXPath("//wsx:symbol");
        xpath.addNamespace("wsx", "http://www.webserviceX.NET/");
        switchMediator.setSource(xpath);

        // set ibm mediator to be called for IBM, msft for MSFT and default for others..
        switchMediator.addCase(new SwitchCaseMediator(Pattern.compile("IBM"), false,
            Arrays.asList(new Mediator[] {ibmMediator})));
View Full Code Here

                Iterator nsIter = namespaces.iterator();

                while (nsIter.hasNext())
                {
                    OMNamespace tmpNs = (OMNamespace)nsIter.next();
                    xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
                }

                Iterator nodesIterator = xp.selectNodes(envelope).iterator();

                while (nodesIterator.hasNext()) {
View Full Code Here

                XPath xp = new AXIOMXPath(xpath);
                Iterator nsIter = namespaces.iterator();

                while (nsIter.hasNext()) {
                    OMNamespace tmpNs = (OMNamespace) nsIter.next();
                    xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
                }

                Iterator nodesIterator = xp.selectNodes(envelope).iterator();

                while (nodesIterator.hasNext()) {
View Full Code Here

                                                           OMElement root) throws Exception {
        String[] nsPrefixes = wsdlPrefixes;
        AXIOMXPath xpathExpression = new AXIOMXPath(expression);

        for (int j = 0; j < nsPrefixes.length; j ++) {
            xpathExpression.addNamespace(nsPrefixes[j++], nsPrefixes[j]);
        }
        return (List<OMElement>)xpathExpression.selectNodes(root);
    }

    private static OMElement buildOMElement(String content) throws Exception {
View Full Code Here

            // mappings
            if ((namespacePrefixes == null) || namespacePrefixes.isEmpty()) {
                xpath.addNamespaces(eventOMElement);
            } else {
                for(XpathDefinition xpathDefinition : namespacePrefixes){
                    xpath.addNamespace(xpathDefinition.getPrefix(),xpathDefinition.getNamespace());
                }
               /* for (String prefix : namespacePrefixes.keySet()) {
                    xpath.addNamespace(prefix, namespacePrefixes.get(prefix));
                }*/
            }
View Full Code Here

    if (!path.startsWith("//")) {
      path = "/" + path;
    }
    path = path.substring(0, 1) + path.substring(1).replaceAll("/", "/ns:");
    AXIOMXPath xpathe = new AXIOMXPath(path);
    xpathe.addNamespace("ns", ns);
    return xpathe;
  }

  public static boolean validateResultStructure(OMElement result,
      String schemaPath) throws Exception {
View Full Code Here

        }
        try {
            AXIOMXPath axiomxPath = new AXIOMXPath(xpath.trim());
            for (OMNamespace omNamespace : omNameSpaces) {
                if (omNamespace != null) {
                    axiomxPath.addNamespace(omNamespace.getPrefix(), omNamespace.getNamespaceURI());
                }
            }
            return axiomxPath;
        } catch (JaxenException e) {
            throw new LoggedRuntimeException("Invalid XPapth expression : " +
View Full Code Here

                Iterator nsIter = namespaces.iterator();

                while (nsIter.hasNext()) {
                    OMNamespace tmpNs = (OMNamespace) nsIter.next();
                    xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
                }

                Iterator nodesIterator = xp.selectNodes(envelope).iterator();

                while (nodesIterator.hasNext()) {
View Full Code Here

                XPath xp = new AXIOMXPath(xpath);
                Iterator nsIter = namespaces.iterator();

                while (nsIter.hasNext()) {
                    OMNamespace tmpNs = (OMNamespace) nsIter.next();
                    xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
                }

                Iterator nodesIterator = xp.selectNodes(envelope).iterator();

                while (nodesIterator.hasNext()) {
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.