[whatwg] Partial HTML5 documents

Ian Hickson ian at hixie.ch
Tue Dec 7 16:44:15 PST 2010


On Thu, 9 Sep 2010, Rostislav Hristov wrote:
> 
> I'm looking for a way to define valid partial HTML fragments that can be 
> included into other documents using a server-side language or injected 
> using AJAX. The current specification doesn't have any major 
> restrictions in this area but it always require the presence of a TITLE 
> tag which in this specific case is not needed. Does anybody have an idea 
> if the TITLE can be skipped somehow or how this whole thing can be 
> implemented properly? Do you think it should be specified?

On Thu, 9 Sep 2010, Rostislav Hristov wrote:
>
> I'm actually looking into manually editing these in an authoring 
> environment and this is why I want them to be valid.

I would recommend just defining what you're trying to do as a combination 
of syntax elements from the spec's synatx section and content models from 
the spec's element descriptions. For example, you could say that your 
fragments are "a sequence of text, character references, elements, and 
comments, but the text must not contain the character U+003C LESS-THAN 
SIGN (<) or an ambiguous ampersand, and the elements must be flow 
content", where the terms are from the syntax section of the HTML spec, 
except for "flow content", which is from the elements section.

In practice of course exactly what's allowed where depends on what you put 
where, which is why the spec doesn't define anything other than the 
validity of a whole document.

HTH,
-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list