Yes, there is!

Take a look at 'PrettyPrint'. You have to set it for each tag (which is not 
very convenient!!). I found no default setting for pretty printing, so I 
wrote a recursive function to set it for all tags of Html:

import org.apache.ecs.*;
import org.apache.ecs.html.*;
import java.util.*;

public class HtmlOutputFormater {

   public static void setPrettyPrint(Html html) {

       html.setPrettyPrint(true);
       setPretty(html.elements());
   }

   private static void setPretty(Enumeration elm) {

     while (elm.hasMoreElements())
     {
       ConcreteElement aSubElm = (ConcreteElement) elm.nextElement();
       aSubElm.setPrettyPrint(true);
       if (aSubElm.elements().hasMoreElements())
       { setPretty(aSubElm.elements()); }
     }

   }

}

Hope that helps!!


Christian

At 20:01 04.12.00 +0100, you wrote:
>Hi,
>
>is there some way of 'structuring' the html output? i.e., printing 
>something readable like:
>
>Body comes here
>...instead of:
>
>Body comes here
>
>Thanks in advance,
>
>Javier
>
>
>--
>------------------------------------------------------------
>To subscribe:        [EMAIL PROTECTED]
>To unsubscribe:      [EMAIL PROTECTED]
>Archives and Other:  <http://java.apache.org/main/mail.html>
>Problems?:           [EMAIL PROTECTED]




--
------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to