Re: validating XML made more difficult than necessary

<?xml

Martin Duerst <duerst@it.aoyama.ac.jp> wrote:

> At 14:54 06/10/05, olivier Thereaux wrote:

>> On Oct 3, 2006, at 10:46 , Martin Duerst wrote:

>>> - A document starting with "<?xml" can easily be guessed to be XML
>>> rather than SGML.

I guess you are reading XML right now.

>> I guess, although I'm sure the usual suspects on this list will
>> happily prove you wrong with some fun corner case.

It's the WWW, and it's not (only) about corner cases and standards but  
specifically about UA's doctype sniffing.

> But even if technically possible,

There's not really an *if*; an SGML document instance that does not  
contain the SGML declaration -- say, any practical application of HTML --  
can start with an arbitrary processing instruction.

> anybody who
> wants to validate a document starting with <?xml with an SGML
> declaration that does not correspond exactly to XML (at which
> point we are back to validating with XML :-) is just a danger
> to him/herself.

Oh, why?  And I wouldn't want that, you were suggesting it.  In practice,  
the string literal '<?xml >' is good enough for CSS1Compat mode in IE 7 --  
if you'd want to take advantage of that -- while it keeps one's legacy  
hacks and cracks in sync with reality (and older versions).

If neither practical applications nor reality matter, it's still  
conforming to ISO 8879, and considerably more convenient than e.g.

<!--[if lt IE 7]><!-- -- BackCompat -- --><![endif]-->

Received on Thursday, 12 October 2006 21:21:23 UTC