Package javax.xml.parsers

Examples of javax.xml.parsers.DocumentBuilder.newDocument()


  }

  private void createXMLDocument() throws Exception {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    document = db.newDocument();
    root = document.createElement("scenepackage");
    document.appendChild(root);
    getResources();
    getHierarchy();
  }
View Full Code Here


 
  private Document createDocumentForException(String message) {
    try {
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
      DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
      Document errorDocument = documentBuilder.newDocument();
      Element root = errorDocument.createElement("error");
      errorDocument.appendChild(root);
      Node input = errorDocument.createElement("reason");
      input.setTextContent(message);
      root.appendChild(input);
View Full Code Here

    try {
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
          .newInstance();
      DocumentBuilder documentBuilder = documentBuilderFactory
          .newDocumentBuilder();
      document = documentBuilder.newDocument();

      elem = createXML(document);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

    try {
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
          .newInstance();
      DocumentBuilder documentBuilder = documentBuilderFactory
          .newDocumentBuilder();
      document = documentBuilder.newDocument();

      elem = createXML(document);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

    try {
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
          .newInstance();
      DocumentBuilder documentBuilder = documentBuilderFactory
          .newDocumentBuilder();
      document = documentBuilder.newDocument();

      elem = createXML(document);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

    try {
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
          .newInstance();
      DocumentBuilder documentBuilder = documentBuilderFactory
          .newDocumentBuilder();
      document = documentBuilder.newDocument();

      elem = createXML(document);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

    try {
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
          .newInstance();
      DocumentBuilder documentBuilder = documentBuilderFactory
          .newDocumentBuilder();
      document = documentBuilder.newDocument();

      elem = createXML(document);
    } catch (ParserConfigurationException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

  public Document createXML() throws ParserConfigurationException {
    DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory
        .newInstance();
    DocumentBuilder documentBuilder = documentBuilderFactory
        .newDocumentBuilder();
    Document document = documentBuilder.newDocument();
    Element root = document.createElement("api-request");
    document.appendChild(root);

    // input
    Node input = document.createElement("input");
View Full Code Here

    } catch (ParserConfigurationException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
      System.out.println("parser error");
    }
    Document document = builder.newDocument();
      Element root = (Element) document.createElement("rootElement");
      document.appendChild(root);
      return document;
  }
 
View Full Code Here

        if (epr == null || epr.getAddress() == null) {
            return;
        }
        try {
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            Document document = documentBuilder.newDocument();
            Element address = document.createElementNS(getNamespaceUri(), QNameUtils.toQualifiedName(getAddressName()));
            address.setTextContent(epr.getAddress().toString());
            transform(new DOMSource(address), headerElement.getResult());
            if (getReferenceParametersName() != null && !epr.getReferenceParameters().isEmpty()) {
                Element referenceParams = document.createElementNS(getNamespaceUri(),
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.