Package org.w3c.dom

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


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

      org.w3c.dom.Element elem=ret.createElement(CLIENT_EPR_ELEMENT);
      elem.setAttribute("endpointId", endpointId);

      ret.appendChild(elem);
    } catch(Exception e) {
      e.printStackTrace();
    }

    return(ret);
View Full Code Here


                  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

      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);
    } catch(Exception e) {
      e.printStackTrace();
    }

    return(ret);
View Full Code Here

        ex.appendChild(doc.createTextNode(Message));
        if (Code != null)
            ex.setAttribute("code", Code);

        root.appendChild(ex);
        doc.appendChild(root);

        StringWriter strWriter = new StringWriter();
//        XMLSerializer serializer = null;
//        OutputFormat outFormat = null;
        Transformer tr = TransformerFactory.newInstance().newTransformer();
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);
        System.out.println("attr: " + XMLStreamReader.ATTRIBUTE);
        System.out.println("ns: " + XMLStreamReader.NAMESPACE);
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);
       
        DOMUtils.writeXml(doc,System.out);
       
View Full Code Here

    {
        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");
        attr.setValue("value2");
        attr.setPrefix("p");
View Full Code Here

        Element child =  doc.createElementNS("urn:test2","child");
        child.setAttribute("xmlns:a", "urn:test2");
       
        child.setPrefix("a");
        e.appendChild(child);
        doc.appendChild(e);
        DOMUtils.writeXml(doc,System.out);
       
        W3CDOMStreamReader reader = new W3CDOMStreamReader(e);
        testElementChild(reader);
    }
View Full Code Here

         Text        numRowsValue = doc.createTextNode("" + rows);
  
         numRows.appendChild(numRowsValue);
         desc.appendChild(numRows);
  
         doc.appendChild(root);
  
         return doc;

      }
      catch (Exception e) {
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.