You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Laurie Harper <la...@holoweb.net> on 2005/05/18 18:18:02 UTC
XHTML compliance and 'name' vs. 'id'
Hi, I just want to check I'm not overlooking anything here. I use
<html:xhtml/> to have Struts render XHTML 1.0 which mostly does the
right thing. However, XHTML deprecates the 'name' attribute for <form/>
elements. It would be simple to change <html:form/> to emit an 'id'
attribute using the same value as 'name', retaining the 'name' attribute
as recommended for compatibility [1]. The existing 'styleId' attribute
would, of course, override this behaviour if supplied. Is that a
reasonable change to make in Struts at this point, or are there other
considerations I'm missing?
As a corollary, is there any way to get Struts to automatically follow
the compatibility guideline for all elements; i.e. to produce 'id'
attributes as well as 'name' attributes in all places the 'name'
attribute is produced? If not then, again, is this a reasonable
behaviour to introduce?
I realise that these changes could have impact on existing stylesheets;
would it make sense for the <html:xhtml/> and <html:html/> tags to
accept an additional attribute specifying the level of XHTML compliance
to render for? This would obviously be a larger impact change (for
example, requiring validator to be aware of the rendering context so it
could use the appropriate 'name' or 'id' attribute). Would it be a
reasonable first step to introduce an attribute to turn on the 'id'
handling behaviour described above, which could later be extended to
supply additional XHTML support?
Thoughts and feedback welcome :-)
L.
[1] http://www.w3.org/TR/xhtml1/#C_8http://www.w3.org/TR/xhtml1/#C_8
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org