Re: comments on the polyglot spec

"Leif Halvard Silli" <xn--mlform-iua@målform.no> wrote:

> > My point is that an HTML-only non-polyglot document edited using an
> > HTML-only DOM-based editor that implements parsing and serialization
> > per spec won't round-trip PHP. It's not a polyglot issue. Polyglot
> > is 
> > always more constrained than HTML-only.
> 
> As such, it could also be possible to define a subset of PIs that was
> possible to serve/edit both as text/html and as
> application/xhtml+xml.

There are no PIs in text/html. If you intersect the empty set with the set of PIs possible in XML, you get the empty set.

> > It's an issue of the PHP 
> > processing layer outputting stuff that's in scope for HTML5 but the
> > PHP layer itself not being in scope. Furthermore, adding PHP (or JSP
> > or ASP) round tripping would be incompatible with legacy 
> > Web-compatible text/html parsing, because bogus comments terminate
> on 
> > the first > as opposed to ?> or %>.
> 
> At least Opera doesn't treat ?> and %> the same: the latter is 
> rendered, while the former isn't. This is not about "PHP syntax" but 
> about PI syntax.

OK. Let's ignore %>. Try http://software.hixie.ch/utilities/js/live-dom-viewer/saved/487 in Opera. Notice where the node created by <? ends.

> I suppose that Daniel is thinking of a polyglot document being
> authored 
> in application/xhtml+xml mode. Why shouldn't PIs be permitted in such
> a 
> document?

Because polyglot means the file works the same as both HTML and XHTML and there are no PIs in HTML, so there can be no PIs in files that are polyglot.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Wednesday, 19 May 2010 11:20:29 UTC