Package org.apache.axiom.om.xpath

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


                        "file:src/test/resources/org/apache/synapse/core/registry/resource.xml");

        assertNotNull(omNode);

        AXIOMXPath xpath = new AXIOMXPath("//table/entry[@id='one']/value/child::text()");
        OMNode node = (OMNode) xpath.selectSingleNode(omNode);

        assertNotNull(node);
        assertTrue(node instanceof OMText);
        assertEquals("ValueOne", ((OMText) node).getText());
    }
View Full Code Here


        }

        String XPathString = "//elem1";

        AXIOMXPath XPath = new AXIOMXPath(XPathString);
        OMNode node = (OMNode) XPath.selectSingleNode(envelope);

        assertNotNull(node);
    }
}
View Full Code Here

     */
    public static String parseStandardQuoteResponse(OMElement result) throws Exception {

        AXIOMXPath xPath = new AXIOMXPath("//ns:last");
        xPath.addNamespace("ns","http://services.samples/xsd");
        OMElement last = (OMElement) xPath.selectSingleNode(result);
        if (last != null) {
            return last.getText();
        } else {
            throw new Exception("Unexpected response : " + result);
        }
View Full Code Here

     */
    public static String parseCustomQuoteResponse(OMElement result) throws Exception {

        AXIOMXPath xPath = new AXIOMXPath("//ns:Price");
        xPath.addNamespace("ns","http://services.samples/xsd");
        OMElement price = (OMElement) xPath.selectSingleNode(result);       
        if (price != null) {
            return price.getText();
        } else {
            throw new Exception("Unexpected response : " + result);
        }
View Full Code Here

        // get the 'pool' element and determine if we need to create a DataSource or
        // look up using JNDI
        try {
            AXIOMXPath xpath = new AXIOMXPath("//syn:connection/syn:pool");
            xpath.addNamespace("syn", XMLConfigConstants.SYNAPSE_NAMESPACE);
            pool = (OMElement) xpath.selectSingleNode(elem);

            if (pool.getFirstChildWithName(DRIVER_Q) != null) {
                mediator.setDataSource(createCustomDataSource(pool, mediator));

            } else if (
View Full Code Here

        assertNotNull(response);

        AXIOMXPath xPath = new AXIOMXPath("//return");
        xPath.addNamespace("ns","http://services.samples/xsd");
        OMElement returnEle = (OMElement) xPath.selectSingleNode(response);

        assertNotNull(returnEle);

        assertEquals(returnEle.getText().trim(),"100");
View Full Code Here

     */
    public static String parseStandardQuoteResponse(OMElement result) throws Exception {

        AXIOMXPath xPath = new AXIOMXPath("//ns:last");
        xPath.addNamespace("ns","http://services.samples/xsd");
        OMElement last = (OMElement) xPath.selectSingleNode(result);
        if (last != null) {
            return last.getText();
        } else {
            throw new Exception("Unexpected response : " + result);
        }
View Full Code Here

     */
    public static String parseCustomQuoteResponse(OMElement result) throws Exception {

        AXIOMXPath xPath = new AXIOMXPath("//ns:Price");
        xPath.addNamespace("ns","http://services.samples/xsd");
        OMElement price = (OMElement) xPath.selectSingleNode(result);       
        if (price != null) {
            return price.getText();
        } else {
            throw new Exception("Unexpected response : " + result);
        }
View Full Code Here

        try {
            OMElement element = AXIOMUtil.stringToOM(getXmlOfMediatorScenarioOneA("full"));

            AXIOMXPath xPath = new AXIOMXPath("//property/@name");
            //xPath.addNamespace(SynapseConstants.SYNAPSE_NAMESPACE, "");
            Object o = xPath.selectSingleNode(element);
            if (o instanceof OMAttribute) {
                System.out.println(((OMAttribute) o).getAttributeValue());
            }
        } catch (XMLStreamException e) {
            e.printStackTrace();
View Full Code Here

        if (rootElem == null) {
            rootElem = new StAXOMBuilder(getInputResourceStream()).getDocumentElement();
        }
        AXIOMXPath xPath = new AXIOMXPath("//service/operation[@name='"
                                          + operationName + "']");
        return (OMElement) xPath.selectSingleNode(rootElem);
    }

    public void setInputResourceStream(String filePath) throws FileNotFoundException {
        if (configsInputStream == null) {
            this.configsInputStream = new FileInputStream(filePath);
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.