- From: Henry S. Thompson <ht@inf.ed.ac.uk>
- Date: Tue, 18 Dec 2012 18:46:07 +0000
- To: James Clark <jjc@jclark.com>
- Cc: John Cowan <cowan@mercury.ccil.org>, public-microxml@w3.org
James Clark writes: > . . . > My general feeling is the PossibleChild/NonPossibleChild (ExcludedChild?) > property is the most basic. It's hard to imagine any schema language that > doesn't have something to say about which elements are possible children of > other elements. In my attempt at a declarative reconstruction of tag-soup [1], I found it useful to allow for PreferreParent information, both on a per-element basis and for orphaned text. So for example the 'badChild' condition, which occurs when a elt is not a PossibleChild of the current stack head, says: The default fixup is to postpone the current event and process an open event for the preferred parent element (if specified in the grammar) or an arbitrary allowed parent element (otherwise) instead I found this necessary to get intuitively satisfying behaviour from some real-world HTML examples, so it might be worth considering. . . For HTML (4, as then was), out of 77 elements, 52 had a preferred parent in the schema I used, for 51 of which it was 'div', (the 52nd was div itself, whose preferred parent was 'body'). Elts such as code, del, dfn, dl, em have 'div' -- most of the 25 w/o any preferred parent, e.g. area, body, param, occur as the PossibleChild of only one parent, so don't need it. ht [1] http://conferences.idealliance.org/extreme/html/2007/Thompson01/EML2007Thompson01.html -- Henry S. Thompson, School of Informatics, University of Edinburgh 10 Crichton Street, Edinburgh EH8 9AB, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/ [mail from me _always_ has a .sig like this -- mail without it is forged spam]
Received on Tuesday, 18 December 2012 18:46:51 UTC