Re: Why polyglot is needed

"T.V Raman" <raman@google.com>, 2013-03-19 16:44 -0700:

> A better example fo rHenry might be the following anchor tag:
> 
> <a href=/>Root</a>

What exactly is better about that example? It seems contrived to me. If you
mean there's some ambiguity about whether the slash in <a href=/> is meant
to be a self-closing start tag or a URL, then that doesn't seem to me to be
a very good example of that. For one thing, you've got the closing </a> tag
there, which a real author would not include if the <a href=/> tag was
intended as a self-closing start tag. And what sound reason would anybody
ever have for a self-closing <a> element with an href attribute?

> What does the above do?
> 
> In one interpretation as per html5 parsing, that could be a
> hyperlink to the root directory.

That's the only possible interpretation of it -- because it's not
well-formed XML and therefore couldn't be used in an XHTML document served
with an XML mime type. It's also the only reasonable common-sense way to
interpret that example, from an authoring point of view.

  --Mike

> 
> Henry S. Thompson writes:
>  > Michael[tm] Smith writes:
>  > 
>  > > Sure, but then that <a> element is no longer serving any actual purpose in
>  > > your document at all. So it's not a very compelling example of a real use
>  > > case in need of polyglot markup.
>  > 
>  > The void element issue comes up all over the place.  I just checked a
>  > small subset of the XHTML I have lying around, and 37 out of 100 had 
>  >  <p></p>
>  > 35 out of a (different) 100 had
>  >  <p/>
>  > 
>  > I also found 56 instances of XHTML files with one or more of
>  >  <title></title>
>  >  <a></a>
>  >  <td></td>
>  >  <strong></strong>
>  > alongside 25 instances of XHTML files with either or both of
>  >  <td/>
>  >  <title/>
>  > so this is not a corner case.
>  > 
>  > ht

-- 
Michael[tm] Smith http://people.w3.org/mike

Received on Wednesday, 20 March 2013 00:00:11 UTC