Package org.htmlcleaner

Examples of org.htmlcleaner.PrettyXmlSerializer


    // serialize a node to a file, output stream, DOM, JDom...
    System.out.println( "\n\n\nINICIO");

    HtmlCleaner cleaner = new HtmlCleaner();
    CleanerProperties props = cleaner.getProperties();
    PrettyXmlSerializer serializer = new PrettyXmlSerializer( props);
 
    for( int i=0 ; i<nodes.length ; i++) {
      System.out.println( "######################## Va uno " + i);

      OutputStream oStream = new ByteArrayOutputStream( );
      if( nodes[i] instanceof TagNode) {
        serializer.writeXmlToStream( (TagNode)nodes[i], oStream);
      }
      else {
        oStream.write( nodes[i].toString().getBytes());
      }
      System.out.println( oStream)
View Full Code Here


    Object[] myNodes;
        myNodes = node.evaluateXPath( "body");
       
    // serialize a node to a file, output stream, DOM, JDom...
    System.out.println( "\n\n\nINICIO");
    PrettyXmlSerializer serializer = new PrettyXmlSerializer( props);



   
//    Util.printTagNodes( myNodes);
View Full Code Here

  private static TagNode parse(String document) throws IOException {
    return getCleaner().clean(document);
  }
 
  private static String write(TagNode node) throws IOException {
    XmlSerializer serializer = new PrettyXmlSerializer(getCleaner()
        .getProperties());
    StringWriter writer = new StringWriter();
    node.serialize(serializer, writer);
    return writer.toString();
  }
View Full Code Here

TOP

Related Classes of org.htmlcleaner.PrettyXmlSerializer

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.