Package org.w3c.dom

Examples of org.w3c.dom.Document.createElementNS()


                  Message odeResponse = mex.createMessage(mex.getOperation().getOutput().getMessage().getQName());
                  if(soapResponseMessage.getSOAPBody().hasFault())
                  {
                    // fault handling
                    Document odeMsg = DOMUtils.newDocument();
                    Element odeMsgEl = odeMsg.createElementNS(null, "message");
                    odeMsg.appendChild(odeMsgEl);
                   
                    Fault fault = messageAdapter.parseSoapFault(odeMsgEl, soapResponseMessage, mex.getOperation());

                    handleFault(mex, fault, soapResponseMessage.getSOAPBody().getFault(), odeMsgEl);
View Full Code Here


                 
              } catch(javax.xml.ws.soap.SOAPFaultException fe) {
               
                    // fault handling
                    Document odeMsg = DOMUtils.newDocument();
                    Element odeMsgEl = odeMsg.createElementNS(null, "message");
                    odeMsg.appendChild(odeMsgEl);
                   
                  if (log.isDebugEnabled()) {
                    log.debug("Riftsaw soap fault: \n" + DOMWriter.printNode(fe.getFault(), true));
                  }
View Full Code Here

    Document ret=null;

    try {
      ret = javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();

      org.w3c.dom.Element elem=ret.createElementNS(Namespaces.SOAP_NS, "address");
      elem.setAttribute("location", getServiceUrl().toExternalForm());
      elem.setAttribute("endpointId", getEndpointId());
      elem.setAttribute("deploymentName", getDeploymentName());

      ret.appendChild(elem);
View Full Code Here

             nl = (NodeList) exprFrom.evaluate(source, XPathConstants.NODESET);
        } else if (source instanceof String) {
            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            Document doc = builder.newDocument();
            //quirky: create a temporary element, use its nodelist
            Element temp = doc.createElementNS(null, "temp");
            temp.appendChild(doc.createTextNode((String) source));
            nl = temp.getChildNodes();
        } else if (source == null) {
            // don't throw errors yet ?
            throw new RuntimeException("Source value was null for source " + sourceExpr);
View Full Code Here

   
   
    public void testSingleElement() throws Exception
    {
        Document doc = getDocument();
        Element e = doc.createElementNS("urn:test","root");
        e.setAttribute("xmlns", "urn:test");
        doc.appendChild(e);
       
        assertEquals(1, e.getAttributes().getLength());
        System.out.println("start: " + XMLStreamReader.START_ELEMENT);
View Full Code Here

   
   
    public void testTextChild() throws Exception
    {
        Document doc = getDocument();
        Element e = doc.createElementNS( "urn:test","root");
        e.setAttribute("xmlns", "urn:test");
        doc.appendChild(e);
        Node text = doc.createTextNode("Hello World");
        e.appendChild(text);
       
View Full Code Here

   
    public void testAttributes() throws Exception
    {
        Document doc = getDocument();
       
        Element e = doc.createElementNS("urn:test","root");
        e.setAttribute("xmlns", "urn:test");
        doc.appendChild(e);
        e.setAttribute("att1", "value1");
       
        Attr attr = doc.createAttributeNS("urn:test2","att2");
View Full Code Here

    }
   
    public void testElementChild() throws Exception
    {
        Document doc = getDocument();
        Element e = doc.createElementNS("urn:test","root");
        e.setAttribute("xmlns", "urn:test");
        Element child =  doc.createElementNS("urn:test2","child");
        child.setAttribute("xmlns:a", "urn:test2");
       
        child.setPrefix("a");
View Full Code Here

    public void testElementChild() throws Exception
    {
        Document doc = getDocument();
        Element e = doc.createElementNS("urn:test","root");
        e.setAttribute("xmlns", "urn:test");
        Element child =  doc.createElementNS("urn:test2","child");
        child.setAttribute("xmlns:a", "urn:test2");
       
        child.setPrefix("a");
        e.appendChild(child);
        doc.appendChild(e);
View Full Code Here

    }
   
    public void testEmptyElement() throws Exception
    {
        Document doc = getDocument();
        Element e = doc.createElementNS("urn:test","root");
        W3CDOMStreamReader reader = new W3CDOMStreamReader(e);
        assertNotNull(reader.getElementText());
        assertEquals("", reader.getElementText());
    }
}
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.