Package org.w3c.dom

Examples of org.w3c.dom.Element.lookupNamespaceURI()


        e3.setAttributeNS(null, "q", "value");
        e2.appendChild(e3);
       
        assertEquals("urn:ns1", e1.lookupNamespaceURI(null));
        assertEquals("urn:ns1", e2.lookupNamespaceURI(null));
        assertNull(e3.lookupNamespaceURI(null));
       
        assertEquals("urn:ns2", e1.lookupNamespaceURI("p"));
        assertEquals("urn:ns3", e2.lookupNamespaceURI("p"));
        assertEquals("urn:ns3", e3.lookupNamespaceURI("p"));
       
View Full Code Here


        assertEquals("urn:ns1", e2.lookupNamespaceURI(null));
        assertNull(e3.lookupNamespaceURI(null));
       
        assertEquals("urn:ns2", e1.lookupNamespaceURI("p"));
        assertEquals("urn:ns3", e2.lookupNamespaceURI("p"));
        assertEquals("urn:ns3", e3.lookupNamespaceURI("p"));
       
        assertEquals("urn:ns4", e1.lookupNamespaceURI("q"));
        assertEquals(null, e2.lookupNamespaceURI("q"));
        assertEquals(null, e3.lookupNamespaceURI("q"));
    }
View Full Code Here

        assertEquals("urn:ns3", e2.lookupNamespaceURI("p"));
        assertEquals("urn:ns3", e3.lookupNamespaceURI("p"));
       
        assertEquals("urn:ns4", e1.lookupNamespaceURI("q"));
        assertEquals(null, e2.lookupNamespaceURI("q"));
        assertEquals(null, e3.lookupNamespaceURI("q"));
    }
}
View Full Code Here

                element2.lookupNamespaceURI(pref2));
        assertNull(element2.lookupNamespaceURI("ns0"));
        assertNull(element2.lookupNamespaceURI(null));
       
        assertEquals("Incorrect namespace returned for the given prefix", nsParent,
                element3.lookupNamespaceURI(prefParent));
        // This asserts that namespaces can only be defined implicitly by elements, but not attributes
        assertNull(element3.lookupNamespaceURI("ns3"));
    }

}
View Full Code Here

        assertNull(element2.lookupNamespaceURI(null));
       
        assertEquals("Incorrect namespace returned for the given prefix", nsParent,
                element3.lookupNamespaceURI(prefParent));
        // This asserts that namespaces can only be defined implicitly by elements, but not attributes
        assertNull(element3.lookupNamespaceURI("ns3"));
    }

}
View Full Code Here

                     DOMUtils.getAllContent(domResMsg.getNode().getFirstChild()).trim());
       
        Element el = (Element)domResMsg.getNode().getFirstChild();
        assertEquals("gmns", el.lookupPrefix("http://apache.org/hello_world_soap_http/types"));
        assertEquals("http://apache.org/hello_world_soap_http/types",
                     el.lookupNamespaceURI("gmns"));

        // Test invoke oneway
        InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
        SOAPMessage soapReqMsg1 = MessageFactory.newInstance().createMessage(null, is1);
        DOMSource domReqMsg1 = new DOMSource(soapReqMsg1.getSOAPPart());
View Full Code Here

                                pfxs = pfxs.substring(idx + 1);
                                pfx = pfx.substring(0, idx);
                            } else {
                                pfxs = "";
                            }
                            String ns = el.lookupNamespaceURI(pfx);
                            schemaNode.setAttribute("xmlns:" + pfx,
                                                    ns);
                        }
                    }
                }
View Full Code Here

                                pfxs = pfxs.substring(idx + 1);
                                pfx = pfx.substring(0, idx);
                            } else {
                                pfxs = "";
                            }
                            String ns = el.lookupNamespaceURI(pfx);
                            schemaNode.setAttribute("xmlns:" + pfx,
                                                    ns);
                        }
                    }
                }
View Full Code Here

                     DOMUtils.getAllContent(domResMsg.getNode().getFirstChild()).trim());
       
        Element el = (Element)domResMsg.getNode().getFirstChild();
        assertEquals("gmns", el.lookupPrefix("http://apache.org/hello_world_soap_http/types"));
        assertEquals("http://apache.org/hello_world_soap_http/types",
                     el.lookupNamespaceURI("gmns"));

        // Test invoke oneway
        InputStream is1 = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq1.xml");
        SOAPMessage soapReqMsg1 = MessageFactory.newInstance().createMessage(null, is1);
        DOMSource domReqMsg1 = new DOMSource(soapReqMsg1.getSOAPPart());
View Full Code Here

                                pfxs = pfxs.substring(idx + 1);
                                pfx = pfx.substring(0, idx);
                            } else {
                                pfxs = "";
                            }
                            String ns = el.lookupNamespaceURI(pfx);
                            schemaNode.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI,
                                                      "xmlns:" + pfx,
                                                      ns);
                        }
                    }
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.