Re: Internal DTD subset without a displayed "]>"

Leif Halvard Silli, Tue, 23 Mar 2010 20:25:40 +0100:
> Leif Halvard Silli, Tue, 23 Mar 2010 19:56:17 +0100:
>> Krzysztof Maczyński, Mon, 22 Mar 2010 23:38:56 +0100:
>>> Thanks, Leif, for sharing your ideas ([1], [2])! They're definitely 
>>> interesting and occasionally useful.
>>> 
>>> I've got one more question. Can the parser-hack PI be hidden somehow 
>>> from a compliant XML parser?

Btw, the name 'parserhack' is purely for "human consumption". Call it 
whatever you like. It  must have a some kind of name, though, or else 
it will cause parse errors and not validate. The hack as a whole takes 
advantage of how text/html parsers are treating, amongst other things, 
the PI syntax. 

>> … there were no problems there, that I could see, when I tested the
>> hack on page served as application/xhtml+xml. [Except that] Webkit
>> had a problem - apparently a bug, related to how it treats <?pi ?> …

Found variant which works in Webkit as well:

 <?parserhack ]><!--?>
 ]>
 <!--><?!-->

Diff from the old [1] variant is the "]" on first line. Sample in full:

 <!DOCTYPE html SYSTEM 
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
 [
 <!ATTLIST html class CDATA #IMPLIED>
 <?parserhack ]><!--?>
 ]>
 <!--><?!-->

[1] http://lists.w3.org/Archives/Public/www-validator/2010Mar/0027

-- 
leif halvard silli

Received on Saturday, 17 April 2010 03:58:40 UTC