Re: Comments on HTML WG face to face meetings in France Oct 08

Ian Hickson wrote:
> ...
> Incidentally, do you know if the current specs define how a user agent is 
> to handle the following bytes if they are received by the client _before_ 
> the client knows if there are any more bytes?
> 
>    <?xml-stylesheet href="data:text/css,*{font-weight:bold}"?>
>    <root>text <outer>outer <inner>inner</outer>

I assume the stylesheet PI is irrelevant here...

It seems you're asking whether it's legal for a recipient to start 
rendering before the full content has been received (which of course is 
something users want).

As far as I can tell, there's no reason not to do that; but if the XML 
content turns out to be non-wellformed (let's please ignore "invalid" in 
this context), the UA should notify the user that the message was 
broken, for instance by the famous "yellow screen of death".

As a matter of fact, this (progressively rendering and fail late when 
required) is what IE6 has been doing for eons when displaying generic 
XML (not XHTML) with an XSLT PI.

> I haven't been able to find where the XML spec defines how to process such 
> a document -- it's not strictly an "XML document" since it isn't 
> well-formed, but it might become well-formed if the next few bytes are 
> "</root>", or it might become definitely not well-formed if, say, there 
> are no more bytes. Surely the processing of the earlier part of the 
> document doesn't change based on later parts of the document. Indeed in 
> many applications, it couldn't change.

Of course it could. In the worst case an application can always collect 
the whole data and wait for the end of the document before doing 
something with the data.

And yes, there are case where this *is* desirable for robustness, and 
thus it would be bad if the XML spec mandated something different.

 > ...

BR, Julian

Received on Saturday, 6 December 2008 10:30:07 UTC