testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces2.java [35:48]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement root1 =
                AXIOMUtil.stringToOM(
                        factory,
                        "<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()));
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xpath/TestAddNamespaces.java [35:48]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected void runTest() throws Throwable {
        OMFactory factory = metaFactory.getOMFactory();
        OMElement root1 =
                AXIOMUtil.stringToOM(
                        factory,
                        "<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()));
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



