[Seaside] XHTML compliance
Michel Bany
m.bany at wanadoo.fr
Thu Jun 3 08:23:41 CEST 2004
I found out that Seaside output is generally not quite XHTML compliant
although it pretends to be
according to its header.
Therefore I am adding a link to the Seaside toolbar (WAToolFrame) that
submits the Seaside
generated HTML output to the XHTML validator :
renderToolbarOn: html
html paragraph.
html
divNamed: 'toolbar'
with:
[html anchorWithUrl: self session application baseUrl do:
[html text: 'New Session']; space.
self actions do:
[:ea |
html anchorOn: ea of: self; space].
self tools do:
[:ea |
html anchorWithAction: [self openTool: ea] text: ea
linkText; space].
"Link to XHTML validator"
html anchorWithPopupUrl: 'http://validator.w3.org/check/referer'
extent: 1024 at 768
text:
[html attributeAt: 'height' put: 15; attributeAt:
'style' put: 'border: none'.
html image:
'http://www.w3.org/Icons/valid-xhtml10.png' altText: 'Valid XHTML'].
]
This helps me checking XHTML compliance from time to time.
You can verify that the simple counter app is not XHTML compliant,
because it is lacking the
title tag in the head section.
There are plenty of things in Seaside that are not yet XHTML compliant.
For instance, the form
constructs are never XHTML compliant, because a least one container must
be supplied
for the input items i.e.
<form ...
<p> or <div>
<input ...
</p> or </div>
</form>
For now, I am addressing the form compliance with the patch below
(WAHtmlRenderer)
that inserts a div container in every forms :
form: aBlock
self
formWithMethod: 'post'
action: context actionUrl urlString
do:
[self div: "Controls must be enclosed in some container
according to XHTML"
[context actionUrl parameters keysAndValuesDo:
[:k :v |
self inputWithType: 'hidden' named: k value: v].
aBlock value]].
Michel.
More information about the Seaside
mailing list