I followed the wiki instructions and the other posts here and yes, I am generating correct XHTML now.
I haven't attempted to remove the superfluous tapestry css file nor have I convinced the library to put the Content-Type meta tag first - but I'm satisfied with valid XHTML. The only other style *thing* I've been been disappointed with is that things like the provided beaneditform template (from the tutorial) include Javascript files within the html body tags. Although it generally works in most browsers, I don't think script tags are legal body tag children .. ie: not XHTML compliant. I loved to be proved wrong but as far as I know, it is generally considered poor practice to include Javascript in the body tags of the html. That said, I'm not sure whether this component just needs to be tweaked or if this is inherent in component html frameworks since the Javascript is relevant to the component being referenced. The [EMAIL PROTECTED] makes me think that it is also possible to do the same for Javascript files - but I've not written or tried to fix the provided beaneditform. I found this: [EMAIL PROTECTED]("${tapestry.scriptaculous}/dragdrop.js") but I have to assume it is being used in the beaneditform - and in that case, it is NOT pushing these script includes into HEAD ... but I suppose it'd be best to look at the source in this case. All in all - these are minor style points - it really is a fantastic framework. -Luther On Tue, Sep 9, 2008 at 11:18 AM, ProAdmin Dariusz Dwornikowski < [EMAIL PROTECTED]> wrote: > Did you manage to achieve it in 5.0.14 ? Im very curious, how to do the > Wiki > method in 5.0.14. > > 2008/9/1 Luther Baker <[EMAIL PROTECTED]> > > > Is there a way to adjust the html that is generated - especially in the > > header? > > > > Specifically, the generated head section does not appear to be xhtml > > compliant. > > > > Here is what I'm including in my own custom "wrapping" component: > > > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" > > lang="en"> > > <head> > > <meta http-equiv="Content-Type" content="text/html; > charset=UTF-8"/> > > <title>${pageTitle}</title> > > <link rel="stylesheet" href="css/styles.css" type="text/css"/> > > </head> > > > > > > *A few points: > > * > > a) The xhtml strict DOCTYPE should be pretty straightforward > > b) I want the Content-Type first in the <head> tag > > c) The meta tag *MUST* have a closing slash - otherwise the document is > not > > well formed. > > d) The same goes for the two <link tags. XHTML dictates that all tags > must > > be well formed. > > > > > > *Unfortunately, my application ends up generating > > * > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> > > <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> > > <head> > > <link href="assets/tapestry/5.0.14/default.css" rel="stylesheet" > > type="text/css"> > > <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> > > <title>Home</title> > > <link href="css/styles.css" rel="stylesheet" type="text/css"> > > </head> > > > > > > For the most part - this is fine ... but in the details, I believe my > > problem is two fold: > > > > 1) I would really like the "Content-Type" to be the first tag in head. > > 2) The link and meta tags are not properly closed. Unfortunately, this > > code-gen is just not valid xhtml. > > > > I do have one last (not so terrible) issue with the EXTRA <link tag > > (tapestry specific css) that is showing up in the head as well. I'm sure > it > > is nice for exceptions (which the final user should never see) but it has > a > > few more problems: > > > > 1) It tells everyone what version of a particular library I am using. I'd > > rather not do that. > > 2) The tag appears before my Content-Type tag - which as I mentioned, I'd > > prefer FIRST in the hierarchy. > > 3) Finally, the tapestry stylesheet is not well formed. Again, proper > xhtml > > demands that tags be balanced/closed. > > > > I know Code Gen is hard -- but I generally pay extra attention to ensure > I > > produce valid, well formed xhtml documents and the codegen going on > behind > > the scenes here is making that a bit hard. > > > > Thoughts? > > > > I'm not sure how to close the tags - maybe I can set a flag or pass > > something else in as an xml attribute of the root tag of my templates? > > Regarding the extra tapestry css file inserted ... maybe the Tapestry > > library has a DEBUG and a RELEASE mode? Maybe there a flag to turn off > the > > DEBUG mode and put this library into RELEASE mode? I really don't want > that > > tapestry specfiic css page requested everytime I serve up a page. I > > understand the filter takes care of it ... but it still shows up in my > > request logs, on user pages, in proxies, etc ... > > > > Is it even wise to consider opening up the tapestry JARs and see if the > > components implementeing this section of code can simply be tweaked to > have > > proper xhtml balance. > > > > On a positive note, the library is working well and I enjoy the general > > programming model. I think convention is great - but it needs to be valid > > in > > this case. Thanks again in advance for any thoughts. > > > > -Luther > > > > > > -- > Pozdrawiam, > Dariusz Dwornikowski > ------------------------------------ > ProAdmin > ul. Królowej Jadwigi 44/2 > 61-872 Poznań > tel: 061 623-20-92 > kom: 0601 59-64-74 > fax: 061 623-20-93 > www.proadmin.com.pl > [EMAIL PROTECTED] >