Package org.apache.axiom.om.xpath

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


                "<ns1:root xmlns:ns1='urn:ns1'><ns1:child xmlns:ns2='urn:ns2'/></root>");
        OMElement root2 = AXIOMUtil.stringToOM(
                "<root xmlns='urn:ns1'><child xmlns='urn:ns2'>text</child></root>");
        AXIOMXPath xpath = new AXIOMXPath("/ns1:root/ns2:child");
        xpath.addNamespaces(root1.getFirstElement());
        assertEquals("text", xpath.stringValueOf(root2.getParent()));
    }

    public void testAddNamespaces2() throws Exception {
        OMElement root1 = AXIOMUtil.stringToOM(
                "<ns:root xmlns:ns='urn:ns1'><ns:child xmlns:ns='urn:ns2'/></root>");
View Full Code Here


                "<ns:root xmlns:ns='urn:ns1'><ns:child xmlns:ns='urn:ns2'/></root>");
        OMElement root2 = AXIOMUtil.stringToOM(
                "<root xmlns='urn:ns1'><child xmlns='urn:ns2'>text</child></root>");
        AXIOMXPath xpath = new AXIOMXPath("//ns:child");
        xpath.addNamespaces(root1.getFirstElement());
        assertEquals("text", xpath.stringValueOf(root2.getParent()));
    }
}
View Full Code Here

                "<ns1:root xmlns:ns1='urn:ns1'><ns1:child xmlns:ns2='urn:ns2'/></root>");
        OMElement root2 = AXIOMUtil.stringToOM(factory,
                "<root xmlns='urn:ns1'><child xmlns='urn:ns2'>text</child></root>");
        AXIOMXPath xpath = new AXIOMXPath("/ns1:root/ns2:child");
        xpath.addNamespaces(root1.getFirstElement());
        assertEquals("text", xpath.stringValueOf(root2.getParent()));
    }
}
View Full Code Here

                "<ns:root xmlns:ns='urn:ns1'><ns:child xmlns:ns='urn:ns2'/></root>");
        OMElement root2 = AXIOMUtil.stringToOM(factory,
                "<root xmlns='urn:ns1'><child xmlns='urn:ns2'>text</child></root>");
        AXIOMXPath xpath = new AXIOMXPath("//ns:child");
        xpath.addNamespaces(root1.getFirstElement());
        assertEquals("text", xpath.stringValueOf(root2.getParent()));
    }
}
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.