Package org.w3c.dom

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


      elem = createXML(document);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException(e);
    }
    if (elem != null) {
      document.appendChild(elem);
      try {
        return XmlUtility.xmltoString(document);
      } catch (TransformerException e) {
        throw new RuntimeException(e);
      }
View Full Code Here


      elem = createXML(document);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException(e);
    }
    if (elem != null) {
      document.appendChild(elem);
      try {
        return XmlUtility.xmltoString(document);
      } catch (TransformerException e) {
        throw new RuntimeException(e);
      }
View Full Code Here

      elem = createXML(document);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException(e);
    }
    if (elem != null) {
      document.appendChild(elem);
      try {
        return XmlUtility.xmltoString(document);
      } catch (TransformerException e) {
        throw new RuntimeException(e);
      }
View Full Code Here

        .newInstance();
    DocumentBuilder documentBuilder = documentBuilderFactory
        .newDocumentBuilder();
    Document document = documentBuilder.newDocument();
    Element root = document.createElement("api-request");
    document.appendChild(root);

    // input
    Node input = document.createElement("input");
    input.setTextContent(this.inputPath);
    root.appendChild(input);
View Full Code Here

      e1.printStackTrace();
      System.out.println("parser error");
    }
    Document document = builder.newDocument();
      Element root = (Element) document.createElement("rootElement");
      document.appendChild(root);
      return document;
  }
 
  Document buildXMLDocumentFromStream(InputStream xmlStream){
    //parse the returned XML
View Full Code Here

        root.setAttribute("xmlns","http://www.gexf.net/1.2draft");
        root.setAttribute("xmlns:viz", "http://www.gexf.net/1.2draft/viz");
        root.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
        root.setAttribute("version","1.2");
        root.setAttribute("xsi:schemaLocation","http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd");
        doc.appendChild(root);

        Element graph = doc.createElement("graph");
        graph.setAttribute("defaultedgetype","undirected");
        root.appendChild(graph);
View Full Code Here

        root.setAttribute("xmlns","http://www.gexf.net/1.2draft");
        root.setAttribute("xmlns:viz", "http://www.gexf.net/1.2draft/viz");
        root.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
        root.setAttribute("version","1.2");
        root.setAttribute("xsi:schemaLocation","http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd");
        doc.appendChild(root);

        Element graph = doc.createElement("graph");
        graph.setAttribute("defaultedgetype","undirected");
        root.appendChild(graph);
View Full Code Here

        root.setAttribute("xmlns","http://www.gexf.net/1.2draft");
        root.setAttribute("xmlns:viz", "http://www.gexf.net/1.2draft/viz");
        root.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
        root.setAttribute("version","1.2");
        root.setAttribute("xsi:schemaLocation","http://www.gexf.net/1.2draft http://www.gexf.net/1.2draft/gexf.xsd");
        doc.appendChild(root);

        Element graph = doc.createElement("graph");
        graph.setAttribute("defaultedgetype","undirected");
        root.appendChild(graph);
View Full Code Here

  public static void print(URI uri, File file) throws Exception {
    Document schema = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
    schema.setDocumentURI(NAMESPACE_URI);
     
    Element root = schema.createElement("schema");
    schema.appendChild(root);
   
    root.setAttribute("targetNamespace", uri.toString());
    root.setAttribute("elementFormDefault", "qualified");

    addSwixmlTags(schema, root);
View Full Code Here

  public static void print() throws Exception {
    Document schema = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
   
    Element root = schema.createElementNS(NAMESPACE_URI, "schema");
    root.setPrefix(NAMESPACE_PREFIX);
    schema.appendChild(root);

    root.setAttribute("targetNamespace", new URI("http://www.swixml.org/2007/Swixml").toString());
    root.setAttribute("elementFormDefault", "qualified");

    addSwixmlTags(schema, root);
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.