Examples of XmlWriter


Examples of org.dbunit.util.xml.XmlWriter

     * @throws UnsupportedEncodingException
     */
    public XmlDataSetWriter(OutputStream outputStream, String encoding)
    throws UnsupportedEncodingException
    {
        _xmlWriter = new XmlWriter(outputStream, encoding);
        _xmlWriter.enablePrettyPrint(true);
    }
View Full Code Here

Examples of org.dom4j.io.XMLWriter

        this.writer = writer;
    }

    public void doWork() {
        try {
            XMLWriter output = new XMLWriter(writer, new OutputFormat("  ", true));
            output.write(createDocument());
            output.close();
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }
View Full Code Here

Examples of org.dom4j.io.XMLWriter

                // Set the streamID returned from the server
                connectionID = xpp.getAttributeValue("", "id");
                if (xpp.getAttributeValue("", "from") != null) {
                    this.domain = xpp.getAttributeValue("", "from");
                }
                xmlSerializer = new XMLWriter(writer);

                // Handshake with the server
                stream = new StringBuilder();
                stream.append("<handshake>");
                stream.append(StringUtils.hash(connectionID + manager.getSecretKey(subdomain)));
View Full Code Here

Examples of org.dom4j.io.XMLWriter

        return element.asXML();
    }

    public String toString() {
        StringWriter out = new StringWriter();
        XMLWriter writer = new XMLWriter(out, OutputFormat.createPrettyPrint());
        try {
            writer.write(element);
        }
        catch (Exception e) { }
        return out.toString();
    }
View Full Code Here

Examples of org.dom4j.io.XMLWriter

        return element.asXML();
    }

    public String toString() {
        StringWriter out = new StringWriter();
        XMLWriter writer = new XMLWriter(out, OutputFormat.createPrettyPrint());
        try {
            writer.write(element);
        }
        catch (Exception e) {
            // Ignore.
        }
        return out.toString();
View Full Code Here

Examples of org.dom4j.io.XMLWriter

        return element.asXML();
    }

    public String toString() {
        StringWriter out = new StringWriter();
        XMLWriter writer = new XMLWriter(out, OutputFormat.createPrettyPrint());
        try {
            writer.write(element);
        }
        catch (Exception e) {
            // Ignore.
        }
        return out.toString();
View Full Code Here

Examples of org.dom4j.io.XMLWriter

            exportInteraction.reportError("Could not write to file: " + file.getAbsolutePath());
            return;
        }

        try {
            XMLWriter xmlWriter = new XMLWriter(fileOutputStream, OutputFormat.createPrettyPrint());

            Document document = DocumentHelper.createDocument();
            Element rootElement = document.addElement(rootElementTag);
            DOM4JSettingsNode settingsNode = new DOM4JSettingsNode(rootElement);
            for (int index = 0; index < serializables.length; index++) {
                SettingsSerializable serializable = serializables[index];
                try //don't let a single serializer stop the entire thing from being written in.
                    serializable.serializeOut(settingsNode);
                } catch (Exception e) {
                    LOGGER.error("serializing", e);
                }
            }
            xmlWriter.write(document);
        } catch (Throwable t) {
            LOGGER.error("Failed to save", t);
            exportInteraction.reportError("Internal error. Failed to save.");
        } finally {
            closeQuietly(fileOutputStream);
View Full Code Here

Examples of org.dom4j.io.XMLWriter

            exportInteraction.reportError("Could not write to file: " + file.getAbsolutePath());
            return;
        }

        try {
            XMLWriter xmlWriter = new XMLWriter(fileOutputStream, OutputFormat.createPrettyPrint());
            Element rootElement = settingsNode.getElement();
            rootElement.detach();

            Document document = DocumentHelper.createDocument(rootElement);

            xmlWriter.write(document);
        } catch (Throwable t) {
            LOGGER.error("Internal error. Failed to save.", t);
            exportInteraction.reportError("Internal error. Failed to save.");
        } finally {
            closeQuietly(fileOutputStream);
View Full Code Here

Examples of org.eclipse.core.internal.resources.XMLWriter

    public void beginWriting(String outputResource, long entitiesCount) {
      try {

        fOs = new FileOutputStream(outputResource);
        writer = new XMLWriter(fOs);

        // Printing entities opening tag
        HashMap args = new HashMap<String, String>();
        args.put(ALL, entitiesCount + "");
        writer.printTag(MAJOR_TAG, args);
View Full Code Here

Examples of org.eclipse.php.internal.core.util.XMLWriter

   * @param out
   *            Output stream to print the XML to
   * @throws Exception
   */
  private ASTPrintVisitor(OutputStream out) throws Exception {
    xmlWriter = new XMLWriter(out, false);
  }
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.