Cool.

Hopefully you also support printing straight to an OutputStream (rather than
having to go through toString() on each element).  This could be a HUGE
performance boost.

Also, I imagine that you support iterating though the elements in a
container (e.g. Document)?

Actually, come to think of it, it would also be nice if it conformed to the
DOM spec.  Does it?

Scott

-----Original Message-----
From: jon * [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 15, 1999 5:21 PM
To: [EMAIL PROTECTED]
Subject: Re: HTML generation


> Jason Hunter himself was supposedly working on such a package (free, I
> believe).  Maybe info can be found at his website (www.servlets.com).
> Plus he'll probably chime in himself :-).

Actually, he is well aware of what Stephan and I are doing and is going to
support our work with Element Construction Set (ECS).

Regarding Nic's framework, while I'm sure it is cool (Nic writes good code),
it isn't even close to a complete solution. We had first called this htmlGen
but quickly realized that it was a framework for more than HTML
generation...can you say Dynamic XML/XSL? Literally ANY tag can be created
with this framework very easily.

Below is some example code to make you all drool...the output is all proper
html...it is also extremely fast and supports filtering of the outputstream
as well (ie: & turns into & automagicially). ;-)

I am in the process of figuring out who is going to be the distribution
point for this (hopefully the Java Apache Project). The core code is 99.9%
complete, we are just finishing up the rest of the HTML 4.0 tags. Nic, it
would be great if you included this in your product as a replacement for
your HtmlWriter class.

thanks,

-jon

BR br2 = new BR("right");
br2.setCase(ElementFactory.LOWERCASE);
System.out.println(br2.toString());

outputs: <br align="right">

BR br2 = new BR("right");
br2.setCase(ElementFactory.UPPERCASE);
System.out.println(br2.toString());

outputs: <BR ALIGN="right">

IMG img = new IMG();
img.setSrc("/some/source/path");
img.setClass("test_class");
img.setID("test_id");
img.setBorder(1);
System.out.println(img.toString());

Document doc = new Document();
doc.getTitle("This is the title");
NoFrames nf = new NoFrames("upgrade to a newer browser!");
FrameSet fs1 = new FrameSet().setCols("33%,33%,33%");
FrameSet fs2 = new FrameSet().setRows("*,200");
fs2.addElement ( new Frame().setSrc("contents_of_frame1.html" )
    .addElement ( new Frame().setSrc("contents_of_frame2.html" ) ) );
fs1.addElement(fs2)
    .addElement ( new Frame().setSrc("contents_of_frame3.html" ) )
    .addElement ( new Frame().setSrc("contents_of_frame4.html" ) );
doc.getBody(fs1).addElement(nf);

IFrame iframe = new IFrame().setSrc("foo.html")
    .setWidth(400).setHeight(500)
    .setScrolling (IFrame.auto)
    .setFrameBorder(true)
    .addElement("your browser does not support frames");

doc.getBody(iframe);

System.out.println(doc.toString());

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to