Title: Re: [Axis2] Help using AXIOMXPath

Brian,

Similar to the following code worked for me. Please give it a try. Note that I am using Axis2 RC1.1 nightly, but you need to try to see if it makes any difference. If it does then you may need to upgrade to nightly:

        AXIOMXPath xpathExp = null;
        OMFactory fac = OMAbstractFactory.getOMFactory();
        OMDocument doc = fac.createOMDocument();
        doc.addChild(OM_Message);

        try {
            xpathExp = new AXIOMXPath(yourXpathString);
            xpathExp.addNamespace("whatever");
            OMElement selectedNode = (OMElement) xpathExp.selectSingleNode(doc);
            if (selectedNode != null) {
                System.out
                        .println("my node : " + selectedNode.getText() + '\n');
            }
        } catch (JaxenException e) {
           ...
        }

Reply via email to