Package org.jdom2.output

Examples of org.jdom2.output.DOMOutputter


  /**
   *
   */
  private void openSQList()
  {
    SAXBuilder sxb = new SAXBuilder();
    try {
      this.root = sxb.build(new File(SQCalculator.xmlPath)).getRootElement();
    } catch (JDOMException | IOException e) {
      e.printStackTrace();
    }
  }
View Full Code Here


   * @param lang A formated tag language (<b>Ex : </b>Fr-FR, En-EN). Use locale.toLanguageTag() method to be sure of your parameter.
   * </b>
   */
  private void openLangFile()
  {
    SAXBuilder sxb = new SAXBuilder();
    try {
      this.root = sxb.build(new File(Language.xmlPath)).getRootElement();
      this.openLocaleLang();
    } catch (JDOMException | IOException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

      {
        System.out.println("-----------Checking file: "+file.getName()+ " "+String.valueOf(x)+"/"+String.valueOf(files.size())+"--------------");
        x++;
        try
        {
          SAXBuilder builder=new SAXBuilder();
          Document xml=(Document)builder.build(file);
          ArrayList<Element> words=new ArrayList<Element>();
          for(Element word:xml.getDescendants(new ElementFilter("wf")))
            words.add(word);
          for(int w=0;w<words.size();w++)
          {
View Full Code Here

     * @throws JDOMException
     * @throws IOException
     */
    private Element htmlStringToElement( String html ) throws JDOMException, IOException
    {
        SAXBuilder builder = new SAXBuilder( CYBERNEKO_PARSER, true );
        Document doc = builder.build( new StringReader( html ) );
        Element element = doc.getRootElement();
        return element;
    }
View Full Code Here

   *             thrown if the W3C DOM document for the feed could not be created.
   *
   */
  public org.w3c.dom.Document outputW3CDom(WireFeed feed) throws IllegalArgumentException, FeedException {
    Document doc = outputJDom(feed);
    DOMOutputter outputter = new DOMOutputter();
    try {
      return outputter.output(doc);
    } catch (JDOMException jdomEx) {
      throw new FeedException("Could not create DOM", jdomEx);
    }
  }
View Full Code Here

     * @throws FeedException thrown if the W3C DOM document for the feed could not be created.
     *
     */
    public org.w3c.dom.Document outputW3CDom(WireFeed feed) throws IllegalArgumentException,FeedException {
        Document doc = outputJDom(feed);
        DOMOutputter outputter = new DOMOutputter();
        try {
            return outputter.output(doc);
        }
        catch (JDOMException jdomEx) {
            throw new FeedException("Could not create DOM",jdomEx);
        }
    }
View Full Code Here

     * @throws FeedException thrown if the W3C DOM document for the feed could not be created.
     *
     */
    public org.w3c.dom.Document outputW3CDom(final WireFeed feed) throws IllegalArgumentException, FeedException {
        final Document doc = outputJDom(feed);
        final DOMOutputter outputter = new DOMOutputter();
        try {
            return outputter.output(doc);
        } catch (final JDOMException jdomEx) {
            throw new FeedException("Could not create DOM", jdomEx);
        }
    }
View Full Code Here

            try
            {
                Element root = layout.getAsElement();
                File file = new File(layout.name + ".xml");
                FileOutputStream fileOutputStream = new FileOutputStream(file);
                Format format = Format.getPrettyFormat();
                format.setEncoding("utf-16");
                format.setTextMode(Format.TextMode.TRIM);
                XMLOutputter outputter = new XMLOutputter(format);
                outputter.output(new Document(root), fileOutputStream);
                fileOutputStream.close();
            } catch (Exception e)
            {
View Full Code Here

        CustomXMLOutputProcessor processor = new CustomXMLOutputProcessor();
        XMLOutputter output = new XMLOutputter(processor);
       
        StringWriter out = new StringWriter();
       
        Format fmt = Format.getRawFormat();
        fmt.setExpandEmptyElements( false );
        fmt.setLineSeparator( LINEBREAK );

        output.setFormat( fmt );
        output.outputElementContent( m_document.getRootElement(), out );
       
        String result = out.toString();
View Full Code Here

                File file = new File(layout.name + ".xml");
                FileOutputStream fileOutputStream = new FileOutputStream(file);
                Format format = Format.getPrettyFormat();
                format.setEncoding("utf-16");
                format.setTextMode(Format.TextMode.TRIM);
                XMLOutputter outputter = new XMLOutputter(format);
                outputter.output(new Document(root), fileOutputStream);
                fileOutputStream.close();
            } catch (Exception e)
            {
                e.printStackTrace();
            }
View Full Code Here

TOP

Related Classes of org.jdom2.output.DOMOutputter

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.