Package org.jdom.output

Examples of org.jdom.output.Format


        try
        {
            Document effectiveDocument = builder.build( new StringReader( effectivePom ) );

            StringWriter w = new StringWriter();
            Format format = Format.getPrettyFormat();
            XMLOutputter out = new XMLOutputter( format );
            out.output( effectiveDocument, w );

            return w.toString();
        }
View Full Code Here


                Element e = (Element) i.next();
                e.setNamespace( pomNamespace );
            }

            StringWriter w = new StringWriter();
            Format format = Format.getPrettyFormat();
            XMLOutputter out = new XMLOutputter( format );
            out.output( document.getRootElement(), w );

            return w.toString();
        }
View Full Code Here

          StandardLocation.SOURCE_OUTPUT, "", targetFacesConfigFile);
      info("Writing to file: " + resource.toUri());
      writer = resource.openWriter();

      StringWriter facesConfig = new StringWriter(1024);
      Format format = Format.getPrettyFormat();
      format.setLineSeparator(SEPARATOR);
      XMLOutputter out = new XMLOutputter(format);
      out.output(document, facesConfig);
      writer.append(facesConfig.toString());

    } finally {
View Full Code Here

      transformer = new XSLTransformer(filename);
      docTrans = transformer.transform(doc);
    } else {
      docTrans = doc;
    }
    Format format = Format.getPrettyFormat();
    format.setEncoding("utf-8");
    XMLOutputter xmlOut = new XMLOutputter(format);

    xmlOut.output(docTrans, out);

  }
View Full Code Here

      Helper.deleteDataInDir(new File(fileIn.getAbsolutePath()));

      /* ---------------------
       * xml-Datei schreiben
      * -------------------*/
      Format format = Format.getPrettyFormat();
      format.setEncoding("UTF-8");
      try {
         setStatusMessage("writing swapped.xml");
         XMLOutputter xmlOut = new XMLOutputter(format);
         FileOutputStream fos = new FileOutputStream(processDirectory + File.separator + "swapped.xml");
         xmlOut.output(doc, fos);
View Full Code Here

                    }
                }
            }

            // Serialize the updated XML doc to file.
            Format format = Format.getPrettyFormat();
            format.setIndent("  ");
            format.setEncoding("UTF-8");
            FileOutputStream fos = new FileOutputStream(xmlFile);
            OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");

            // Escape all the strings to an ASCII neutral encoding.
            XMLOutputter outp = new XMLOutputter(format) {
View Full Code Here

                    "No profile with the name " + profileName +
                            " was registered");
        }
        Repository repo = profile.getRepository();
        XMLOutputter outputter = new XMLOutputter();
        Format format = Format.getPrettyFormat();
        format.setExpandEmptyElements(true);
        outputter.setFormat(format);
        String html = outputter.outputString(doc);
        StringTokenizer tokenizer = new StringTokenizer(html, "@", true);
        StringBuilder resultHtml = new StringBuilder();
        boolean tokenFound = false;
View Full Code Here

                    }
                }
            }

            // Serialize the updated XML doc to file.
            Format format = Format.getPrettyFormat();
            format.setIndent("  ");
            format.setEncoding("UTF-8");
            FileOutputStream fos = new FileOutputStream(xmlFile);
            OutputStreamWriter osw = new OutputStreamWriter(fos, "UTF-8");

            // Escape all the strings to an ASCII neutral encoding.
            XMLOutputter outp = new XMLOutputter(format) {
View Full Code Here

            // per section 2.11 of the XML spec)
            normaliseLineEndings( document );

            // rewrite DOM as a string to find differences, since text outside the root element is not tracked
            StringWriter w = new StringWriter();
            Format format = Format.getRawFormat();
            format.setLineSeparator( ls );
            XMLOutputter out = new XMLOutputter( format );
            out.output( document.getRootElement(), w );

            int index = content.indexOf( w.toString() );
            if ( index >= 0 )
View Full Code Here

            if ( intro != null )
            {
                writer.write( intro );
            }

            Format format = Format.getRawFormat();
            format.setLineSeparator( ls );
            XMLOutputter out = new XMLOutputter( format );
            out.output( document.getRootElement(), writer );

            if ( outtro != null )
            {
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.