Parent/Content Models
= Shorthand Notations =

= Index DOT Html by Brian Wilson =

Parent/Content Models: General | Parent | Content, %Parameter Entities%
Main Index | Element Tree | Element Index | HTML Support History

The nuts and bolts definitions for HTML/xHTML are expressed using SGML and XML Document Type Definitions (DTDs.) This site presents as many of the details found in DTDs as possible, often using or drawing direct inspiration from DTD concepts. These DTD details can be fairly difficult to decode on the first through third (or more!) glance without some major explanation.

Parent/Content Models
A DTD defines, among other things, the syntax of elements and their attributes. It also specifies "Content Models" for each element - describing which elements (if any) are directly nestable inside of a given element. This is accomplished in a DTD using a simplified BNF syntax that specifies content order, occurrence and exclusion behaviors for each HTML element.

Content Models in SGML DTDs only specify allowed HTML element relationships in terms of element content (which elements are allowed to directly nest inside of another HTML element.) Obviously, this is only a one-way relationship definition. This site also lists "Parent Models" for each element (which elements are allowed as direct parents of a specific element.) So - how does one come up with these parent relationships? Thankfully, taking all the element Content Models in a DTD as a whole *ALSO* implicitly defines all the allowed Parent Elements for any given element.

In an early HTML 2.0 DTD draft I used long ago, these parent relationships were explicitly defined alongside the usual Content Models for each element, and I found this information to be useful - Useful enough to document and explicitly include on this site as well.

General Models
%Text% includes:
Text | Character Entities

%Form Fields% includes:
<Input Type=Button> | <Input Type=Checkbox> | <Input Type=File> | <Input Type=Hidden> | <Input Type=Image> | <Input Type=Password> | <Input Type=Radio> | <Input Type=Readonly> | <Input Type=Reset> | <Input Type=Submit> | <Input Type=Text> | <Button> | <Label> | <Select> | <Textarea>

Parent Models
%Block Parent% includes:
Lists: <Dd> | <Li>
Tables: <Td> | <Th>
Multimedia: <Applet> | <Embed> | <Iframe> | <Object>
Backward Compatibility: <Noembed> | <Noframes> | <Nolayer> | <Noscript>
General Block: <Basefont> | <Blockquote> | <Body> | <Center> | <Div> | <Fieldset> | <Form> | <Layer> | <Multicol> | <Pre>
Obsolete Elements: <Listing> | <Plaintext> | <Xmp>
%In-line Parent% includes:
Font Markup: <B> | <Big> | <Blink> | <Font> | <I> | <Nobr> | <S> | <Small> | <Strike> | <Sub> | <Sup> | <Tt> | <U>
Phrase Markup: <Abbr> | <Acronym> | <Cite> | <Code> | <Dfn> | <Em> | <Inlineinput> | <Kbd> | <Q> | <Samp> | <Span> | <Spell> | <Strong> | <Var>
Anchors: <A href> | <A name>
General Elements: <Address> | <Bdo> | <Button> | <Caption> | <Dt> | <Hx> | <Ilayer> | <Label> | <Legend> | <Marquee> | <P> | <Ruby>

Content Models
%Head Content% includes:
<Base> | <BGSound> | <Isindex> | <Link> | <Meta> | <NextID> | <Script> | <Sound> | <Style> | <Title>

%Block Content% includes:
General Block: <Address> | <Basefont> | <Blockquote> | <Div> | <Hr> | <Hx> | <Isindex> | <Layer> | <Marquee> | <Multicol> <P> | <Pre> | <Table>
Lists: <Dir> | <Dl> | <Menu> | <Ol> | <Ul>
Form Structures: <Fieldset> | <Form>
Backward Compatibility: <Noembed> | <Noframes> | <Nolayer> | <Noscript>
Obsolete Elements: <Listing> | <Plaintext> | <Xmp>

%In-line Content% includes:
Text: %Text%
Form Fields: %Form Fields%
Font Markup: <B> | <Big> | <Blink> | <Font> | <I> | <Nobr> | <S> | <Small> | <Strike> | <Sub> | <Sup> | <Tt> | <U>
Phrase Markup: <Abbr> | <Acronym> | <Cite> | <Code> | <Dfn> | <Em> | <Inlineinput> | <Kbd> | <Q> | <Samp> | <Span> | <Spell> | <Strong> | <Var>
Anchors: <A href> | <A name>
Line-breaking: <Br> | <Wbr>
Languages and Positioning: <Bdo> | <Ilayer> | <Ruby> | <Script> | <Spacer>
Multimedia: <Applet> | <BGSound> | <Embed> | <Img> | <Iframe> | <Map> | <Object> | <Sound>
%Parameter Entities%
Another bit of syntax which draws inspiration from SGML are the "Shorthand" notations used for defining Parent and Content Model groupings. This shorthand form is also used to define the Common Attributes categories. Throughout the HTML reference site, these hyperlinked "macros" may be found, beginning and ending with a "%" character. This syntax is based on an SGML DTD construct known as a "Parameter Entity" - a form of macro which is used to save time and space in cross-referencing information within the DTD.

The shorthand macros I have defined (click on the hyperlinks to expand the macros) are usually directly related to Parameter Entities that are defined in the HTML 4.0 DTD (eg: the "%Core%" macro on this site refers to the CLASS, ID and STYLE attributes, while the "%coreattrs" Parameter Entity in HTML 4.0 refers to the CLASS, ID, STYLE, and TITLE attributes.)

Boring Copyright Stuff...