Package org.apache.axiom.om.xpath

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


        {
          OMNamespace tmpNs = (OMNamespace)nsIter.next();
          xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
        }
       
        List selectedNodes = xp.selectNodes(envelope);
       
        Iterator nodesIter = selectedNodes.iterator();
          while (nodesIter.hasNext())
          {
            OMElement e = (OMElement)nodesIter.next();
View Full Code Here


                        {
                                OMNamespace tmpNs = (OMNamespace)nsIter.next();
                                xp.addNamespace(tmpNs.getPrefix(), tmpNs.getNamespaceURI());
                        }
                       
                        List selectedNodes = xp.selectNodes(header);
                       
                        if (selectedNodes.size() == 0 ) {
                            return false;
                        }
               
View Full Code Here

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

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

                while (nodesIterator.hasNext()) {
                    decryptedElements.put(nodesIterator.next(), Boolean.valueOf(dataRef.isContent()));
                }
View Full Code Here

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

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

                while (nodesIterator.hasNext()) {
                    Object result = decryptedElements.get(nodesIterator.next());
                    if (result != null &&
                            ("Element".equals(encPart.getEncModifier())
View Full Code Here

        if (nsURI!=null){
            SimpleNamespaceContext nsContext = new SimpleNamespaceContext();
            nsContext.addNamespace(null,nsURI);
            xpath.setNamespaceContext(nsContext);
        }
        return xpath.selectNodes(element);
    }


}
View Full Code Here

        if (nsURI != null) {
            SimpleNamespaceContext nsContext = new SimpleNamespaceContext();
            nsContext.addNamespace(null, nsURI);
            xpath.setNamespaceContext(nsContext);
        }
        return xpath.selectNodes(element);
    }


}
View Full Code Here

            if (docEle != null) {
                SimpleNamespaceContext nsCtx = new SimpleNamespaceContext();
                nsCtx.addNamespace("wsas", ServerConstants.CARBON_SERVER_XML_NAMESPACE);
                XPath xp = new AXIOMXPath("//wsas:HttpGetRequestProcessors/wsas:Processor");
                xp.setNamespaceContext(nsCtx);
                List nodeList = xp.selectNodes(docEle);
                for (Object aNodeList : nodeList) {
                    OMElement processorEle = (OMElement) aNodeList;
                    OMElement itemEle = processorEle.getFirstChildWithName(ITEM_QN);
                    if (itemEle == null) {
                        throw new ServletException("Required element, 'Item' not found!");
View Full Code Here

        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 {
        InputStream inputStream = new ByteArrayInputStream(content.getBytes());
        XMLStreamReader parser;
View Full Code Here

        try {
            XPath xp = new AXIOMXPath(xPath);
            xp.setNamespaceContext(nsCtx);
            OMElement elem = builder.getDocumentElement();
            if (elem != null) {
                List nodeList = xp.selectNodes(elem);
                Object obj;
                if (!nodeList.isEmpty() && ((obj = nodeList.get(0)) != null)) {
                    return ((OMElement) obj).getText();
                }
            }
View Full Code Here

        try {
            XPath xp = new AXIOMXPath(xPath);
            xp.setNamespaceContext(nsCtx);
            OMElement elem = builder.getDocumentElement();
            if (elem != null) {
                List nodeList = xp.selectNodes(elem);
                return (OMElement[]) nodeList.toArray(new OMElement[nodeList.size()]);
            }
        } catch (JaxenException e) {
            throw new RuntimeException("XPath expression " + xPath + " failed", e);
        }
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.