Package org.apache.axiom.om.xpath

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


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

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


//    factory.createOMDocument().addChild(envelope);

        String XPathString = "//elem1";

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


        assertNotNull(node);
    }
View Full Code Here

        factory.createOMDocument().addChild(envelope);

        String XPathString = "//elem1";

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


        assertNotNull(node);
    }
}
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("self::node()/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

        try {
            String xPathExpr = seperator + seperator + nsPrefix + colon + echoStringResponse +
                    seperator + ret + seperator + textNodeSelector;
            AXIOMXPath xpath = new AXIOMXPath(xPathExpr);
            addNamespaces(xpath);
            OMText textElem = (OMText)xpath.selectSingleNode(payload);
            assertNotNull(textElem);

            assertEquals(textElem.getText(), WhiteMesaConstants.ECHO_STRING);
        } catch (JaxenException e) {
            throw AxisFault.makeFault(e);
View Full Code Here

        try {
            String xPathExpr = seperator + seperator + nsPrefix + colon + echoIntegerResponse +
                    seperator + ret + seperator + textNodeSelector;
            AXIOMXPath xpath = new AXIOMXPath(xPathExpr);
            addNamespaces(xpath);
            OMText textElem = (OMText)xpath.selectSingleNode(payload);
            assertNotNull(textElem);

            assertEquals(textElem.getText(), WhiteMesaConstants.ECHO_INTEGER);
        } catch (JaxenException e) {
            throw AxisFault.makeFault(e);
View Full Code Here

        try {
            String xPathExpr = seperator + seperator + nsPrefix + colon + echoFloatResponse +
                    seperator + ret + seperator + textNodeSelector;
            AXIOMXPath xpath = new AXIOMXPath(xPathExpr);
            addNamespaces(xpath);
            OMText textElem = (OMText)xpath.selectSingleNode(payload);
            assertNotNull(textElem);

            assertEquals(textElem.getText(), WhiteMesaConstants.ECHO_FLOAT);
        } catch (JaxenException e) {
            throw AxisFault.makeFault(e);
View Full Code Here

        try {
            String xPathExpr = seperator + seperator + nsPrefix + colon + echoStructResponse +
                    seperator + ret + seperator + varInt;
            AXIOMXPath xpath = new AXIOMXPath(xPathExpr);
            addNamespaces(xpath);
            OMText textElem = (OMText)xpath.selectSingleNode(payload);
            assertNotNull(textElem);
            assertEquals(textElem.getText(), WhiteMesaConstants.ECHO_STRUCT_INT);

            xPathExpr = seperator + seperator + nsPrefix + colon + echoFloatResponse + seperator +
                    ret + seperator + varFloat;
View Full Code Here

            xPathExpr = seperator + seperator + nsPrefix + colon + echoFloatResponse + seperator +
                    ret + seperator + varFloat;
            xpath = new AXIOMXPath(xPathExpr);
            addNamespaces(xpath);
            textElem = (OMText)xpath.selectSingleNode(payload);
            assertNotNull(textElem);
            assertEquals(textElem.getText(), WhiteMesaConstants.ECHO_STRUCT_FLOAT);

            xPathExpr = seperator + seperator + nsPrefix + colon + echoFloatResponse + seperator +
                    ret + seperator + varFloat;
View Full Code Here

            xPathExpr = seperator + seperator + nsPrefix + colon + echoFloatResponse + seperator +
                    ret + seperator + varFloat;
            xpath = new AXIOMXPath(xPathExpr);
            addNamespaces(xpath);
            textElem = (OMText)xpath.selectSingleNode(payload);
            assertNotNull(textElem);
            assertEquals(textElem.getText(), WhiteMesaConstants.ECHO_STRUCT_STRING);

        } catch (JaxenException e) {
            throw AxisFault.makeFault(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.