You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Travis McCauley <tw...@virginia.edu> on 2003/04/28 18:14:24 UTC

Re: invalid HTML for option component?

Hello,

This post from the archives caught my interest. How high is valid 
markup on the priority list? I think there are organizations that are 
required by law to produce w3c-compliant code for accessibility 
reasons. I like it just because I'm a geek and I think validating is 
fun. Plus I like my code to be what it says it is.

Would bugzilla reports about invalid html be welcome or just an 
annoyance? If welcome, what would be a good target DTD to work 
against? HTML 4.01 Transitional?

The "<option/> Label" issue might start to come up more frequently 
since Apple will likely start shippping Safari as the default browser 
in its next system release. Safari uses the same HTML parser and 
rendering engine as Konqueror mentioned below. I think it's kHtml or 
something like that.

Sincerely,
Travis McCauley
Charlottesville, VA

>Hello
>
>I am using the option element inside a select inside a form. After 
>successfully running the app in Mozilla, I tried testing it with a 
>test engine which uses a HTML parser to drive the app. However, the 
>parser (NekoHTML) was not able to cope with the HTML tapestry 
>generates. A little testing showed that Konqueror has the same 
>problem (showing empty selection lists). The problem seems to be 
>that Tapestry generates this HTML:
>
><option value="1"/>Option Label1
><option value="2"/>Option Label2
>
>Which seems to be invalid (?). The correct form, of course, would be
>
><option value="1">Option Label1</option>
><option value="2">Option Label2</option>
>
>or, for convenience without the terminating </option>. What throws 
>the parser off is the element terminator ("/>") *before* the option 
>label.
>
>BTW, PropertySelection is better behaved.
>
>Is this a (known) bug?
>Christian
>
>
>for reference, excerpts from my HTML and jwc below:
>
><input jwcid="selectLocale" size="1">
>    <span jwcid="foreachLocale">
>       <option jwcid="optionLocale"/>
>     </span>
></input>
>
>the components are declared as:
>
><component id="selectLocale" type="Select"/>
>
><component id="foreachLocale" type="Foreach">
>    <binding name="source" expression="sortedLocales"/>
>    <binding name="value" expression="foreachLocale"/>
></component>


RE: invalid HTML for option component?

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
I personally feel that the goal of Tapestry is to output valid XHTML.  Bug
reports are always welcome!  Being able to cite specific w3c documentation
is even better.

The specific bug mentioned has been fixed (I can't remember whether its
fixed in 2.3 or in the 3.0 code base).

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Travis McCauley [mailto:twm4g@virginia.edu] 
> Sent: Monday, April 28, 2003 12:14 PM
> To: tapestry-user@jakarta.apache.org
> Subject: Re: invalid HTML for option component?
> 
> 
> Hello,
> 
> This post from the archives caught my interest. How high is valid 
> markup on the priority list? I think there are organizations that are 
> required by law to produce w3c-compliant code for accessibility 
> reasons. I like it just because I'm a geek and I think validating is 
> fun. Plus I like my code to be what it says it is.
> 
> Would bugzilla reports about invalid html be welcome or just an 
> annoyance? If welcome, what would be a good target DTD to work 
> against? HTML 4.01 Transitional?
> 
> The "<option/> Label" issue might start to come up more frequently 
> since Apple will likely start shippping Safari as the default browser 
> in its next system release. Safari uses the same HTML parser and 
> rendering engine as Konqueror mentioned below. I think it's kHtml or 
> something like that.
> 
> Sincerely,
> Travis McCauley
> Charlottesville, VA
> 
> >Hello
> >
> >I am using the option element inside a select inside a form. After
> >successfully running the app in Mozilla, I tried testing it with a 
> >test engine which uses a HTML parser to drive the app. However, the 
> >parser (NekoHTML) was not able to cope with the HTML tapestry 
> >generates. A little testing showed that Konqueror has the same 
> >problem (showing empty selection lists). The problem seems to be 
> >that Tapestry generates this HTML:
> >
> ><option value="1"/>Option Label1
> ><option value="2"/>Option Label2
> >
> >Which seems to be invalid (?). The correct form, of course, would be
> >
> ><option value="1">Option Label1</option>
> ><option value="2">Option Label2</option>
> >
> >or, for convenience without the terminating </option>. What throws
> >the parser off is the element terminator ("/>") *before* the option 
> >label.
> >
> >BTW, PropertySelection is better behaved.
> >
> >Is this a (known) bug?
> >Christian
> >
> >
> >for reference, excerpts from my HTML and jwc below:
> >
> ><input jwcid="selectLocale" size="1">
> >    <span jwcid="foreachLocale">
> >       <option jwcid="optionLocale"/>
> >     </span>
> ></input>
> >
> >the components are declared as:
> >
> ><component id="selectLocale" type="Select"/>
> >
> ><component id="foreachLocale" type="Foreach">
> >    <binding name="source" expression="sortedLocales"/>
> >    <binding name="value" expression="foreachLocale"/> </component>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>