Package org.w3c.dom

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


                    int ci = name.indexOf(':');
                    if (ci != -1)
                      {
                        String prefix = name.substring(0, ci);
                        element.setTextContent(name.substring(ci + 1));
                        ns = element.lookupNamespaceURI(prefix);
                        element.setAttribute("ns", (ns == null) ? "" : ns);
                      }
                    // 4.16. Constraints
                    if (isDescendantOfFirstChildOfAttribute(element) &&
                        "".equals(element.getAttribute("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

        for (int x = 0; x < mp.getLength(); x++) {
            Attr attr = (Attr)mp.item(x);
            if (attr.getNamespaceURI() != null
                && !"".equals(attr.getNamespaceURI())
                && !Constants.XMLNS_ATTRIBUTE_NS_URI.equals(attr.getNamespaceURI())) {
                String ns = del.lookupNamespaceURI(attr.getPrefix());
                String pfx = del.lookupPrefix(attr.getNamespaceURI());
                assertEquals(attr.getPrefix(), pfx);
                assertEquals(attr.getNamespaceURI(), 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

                                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

       
        Element el = (Element)domResMsg.getNode().getFirstChild();
        System.out.println(DOMUtils.getElementQName(el));
        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

                     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

                     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

                prefix = NokogiriHelpers.getPrefix(e.getNodeName());
            } else if (currentNS != null) {
                prefix = e.lookupPrefix(currentNS);
            }
            e.getOwnerDocument().setStrictErrorChecking(false);
            String nsURI = e.lookupNamespaceURI(prefix);
            this.node = NokogiriHelpers.renameNode(e, nsURI, e.getNodeName());

            if (e.hasAttributes()) {
                NamedNodeMap attrs = e.getAttributes();
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.