Package org.jdom.output

Examples of org.jdom.output.Format


        // Default
        return jdomObject.toString();       
    }
   
    public static Format getFormat(String indent, boolean newlines) {
        Format format = Format.getPrettyFormat();
        format.setIndent(indent);
        if (newlines) {
            format.setLineSeparator("\n"); //$NON-NLS-1$
        } else {
            format.setLineSeparator(""); //$NON-NLS-1$
        }
        return format;
    }
View Full Code Here


    org.jdom.Document doc;
    try {
      SAXBuilder builder = new SAXBuilder();
      doc = builder.build("C:/docs/bufr/wmo/Code-FlagTables-11-2007.xml");

      Format pretty = Format.getPrettyFormat();
      String sep = pretty.getLineSeparator();
      String ind = pretty.getIndent();
      String mine = "\r\n";
      pretty.setLineSeparator(mine);

      // wierd - cant pretty print ??!!
      XMLOutputter fmt = new XMLOutputter(pretty);
      Writer pw = new FileWriter("C:/docs/bufr/wmo/wordNice.txt");
      fmt.output(doc, pw);
View Full Code Here

  /*
   * @see org.rssowl.core.interpreter.ITypeExporter#exportTo(java.io.File,
   * java.util.Collection, java.util.Set)
   */
  public void exportTo(File destination, Collection<? extends IFolderChild> elements, Set<Options> options) throws InterpreterException {
    Format format = Format.getPrettyFormat();
    format.setEncoding(UTF_8);
    XMLOutputter output = new XMLOutputter(format);
    DateFormat dateFormat = DateFormat.getDateInstance();

    Document document = new Document();
    Element root = new Element(Tag.OPML.get());
View Full Code Here

    if (writer == null) {
      throw new RuntimeException("No writer has been initialized.");
    }

    // create XML outputter with indent: 2 spaces, print new lines.
    Format format = Format.getPrettyFormat();
    format.setEncoding(encoding);
    XMLOutputter outputter = new XMLOutputter(format);
   
    // ----
    Element rootElem = new Element("rss");
    rootElem.setAttribute("version", RSS_VERSION);
View Full Code Here

    if (writer == null) {
      throw new RuntimeException("No writer has been initialized.");
    }

    // create XML outputter with indent: 2 spaces, print new lines.
    Format format = Format.getPrettyFormat();
    format.setEncoding(encoding);
    XMLOutputter outputter = new XMLOutputter(format);

    Namespace defNs = Namespace.getNamespace(NS_DEFAULT);
    Namespace rdfNs = Namespace.getNamespace("rdf", NS_RDF);
    Namespace dcNs = Namespace.getNamespace("dc", NS_DC);
View Full Code Here

        if (writer == null) {
            throw new RuntimeException("No writer has been initialized.");
        }

        // create XML outputter with indent: 2 spaces, print new lines.
        Format format = Format.getPrettyFormat();
        format.setEncoding(encoding);
        XMLOutputter outputter = new XMLOutputter(format);
       
        Namespace dcNs = Namespace.getNamespace("dc", NS_DC);
        Namespace syNs = Namespace.getNamespace("sy", NS_SY);
        Namespace adminNs = Namespace.getNamespace("admin", NS_ADMIN);
View Full Code Here

  public static void saveXML(Document doc,String filename) {   

    try {
      //system.out.println("********************************************************************");
      JDOMSource in = new JDOMSource(doc);
      Format format = Format.getPrettyFormat();
      //format.setEncoding(encoding);     
      XMLOutputter outp = new XMLOutputter(format);         
      File f = new File(filename);
      outp.output(in.getDocument(), new FileWriter(f));     
      //system.out.println("xml datei wurde gespeichert: " + f.getCanonicalPath());
View Full Code Here

        in.close();
        out.close();
    }

    public static void saveInXmlFile(Document doc, String file) {
        Format f = Format.getPrettyFormat().setEncoding("UTF-8");

        XMLOutputter xop = new XMLOutputter(f);

        try {
View Full Code Here

      }
      writer =
          getEnv().getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File(targetFacesConfigFile), null);

      StringWriter facesConfig = new StringWriter(1024);
      Format format = Format.getPrettyFormat();
      format.setLineSeparator(SEPARATOR);
      XMLOutputter out = new XMLOutputter(format);
      out.output(document, facesConfig);
      if (is11()) {
        // TODO: is this replace really necessary?
        String facesConfigStr =
View Full Code Here

                collectionTitle.setText("entries");
                collection.addContent(collectionTitle);
                workspace.addContent(collection);

                XMLOutputter outputter = new XMLOutputter();
                Format format = Format.getPrettyFormat();
                format.setEncoding("UTF-8");
                outputter.setFormat(format);
                outputter.output(document, getWriter(response));

            } else if (path == null || path.length() == 0 || path.equals("/")) {
View Full Code Here

TOP

Related Classes of org.jdom.output.Format

Copyright © 2018 www.massapicom. 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.