Browsable HTML Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: html/clark/strict/extracted
Source used for this grammar: James Clark, Modularization of XHTML in RELAX NG, xhtml-strict.rng, 28-Oct-2008

Summary

Syntax

applet ::=
	[applet]::(applet.attlist param* Flow.model)
applet.attlist ::=
	Core.attrib [alt]::Text.datatype [archive]::string? [code]::string? [codebase]::URI.datatype? [object]::string? [height]::Length.datatype [width]::Length.datatype
applet.attlist ::=
	name.attlist
Inline.class ::=
	applet
Inline.class ::=
	bdo
Inline.class ::=
	map
Inline.class ::=
	Edit.class
Inline.class ::=
	Formctrl.class
Inline.class ::=
	a
Inline.class ::=
	iframe
Inline.class ::=
	img
Inline.class ::=
	object
Inline.class ::=
	b
	big
	i
	small
	sub
	sup
	tt
Inline.class ::=
	Script.class
Inline.class ::=
	abbr
	acronym
	br
	cite
	code
	dfn
	em
	kbd
	q
	samp
	span
	strong
	var
id.attrib ::=
	[id]::ID.datatype?
class.attrib ::=
	[class]::NMTOKENS.datatype?
title.attrib ::=
	[title]::Text.datatype?
Core.attrib ::=
	id.attrib class.attrib title.attrib
Core.attrib ::=
	[style]::string?
lang.attrib ::=
	[xml:lang]::LanguageCode.datatype?
I18n.attrib ::=
	lang.attrib
I18n.attrib ::=
	dir.attrib?
Common.attrib ::=
	Core.attrib I18n.attrib
Common.attrib ::=
	Events.attrib
CommonIdRequired.attrib ::=
	[id]::ID.datatype class.attrib title.attrib I18n.attrib
CommonIdRequired.attrib ::=
	Events.attrib
base ::=
	[base]::base.attlist
base.attlist ::=
	[href]::URI.datatype
base.attlist ::=
	target.attrib
head.content ::=
	base?
head.content ::=
	link*
head.content ::=
	meta*
head.content ::=
	script*
head.content ::=
	title
head.content ::=
	style*
bdo ::=
	[bdo]::(bdo.attlist Inline.model)
bdo.attlist ::=
	Core.attrib lang.attrib dir.attrib
dir.attrib ::=
	[dir]::("ltr" | "rtl")
area ::=
	[area]::area.attlist
area.attlist ::=
	Common.attrib [href]::URI.datatype? shape.attrib coords.attrib [nohref]::"nohref"? [alt]::Text.datatype [tabindex]::Number.datatype? [accesskey]::Character.datatype?
area.attlist ::=
	[onblur]::Script.datatype? [onfocus]::Script.datatype?
area.attlist ::=
	target.attrib
map ::=
	[map]::(map.attlist (Block.class | area)+)
map.attlist ::=
	CommonIdRequired.attrib
map.attlist ::=
	name.attlist
a.attlist ::=
	shape.attrib coords.attrib
a.attlist ::=
	[onblur]::Script.datatype? [onfocus]::Script.datatype?
a.attlist ::=
	Common.attrib [href]::URI.datatype? [charset]::Charset.datatype? [type]::ContentType.datatype? [hreflang]::LanguageCode.datatype? [rel]::LinkTypes.datatype? [rev]::LinkTypes.datatype? [accesskey]::Character.datatype? [tabindex]::Number.datatype?
a.attlist ::=
	name.attlist
a.attlist ::=
	target.attrib
img.attlist ::=
	usemap.attlist
img.attlist ::=
	Common.attrib [src]::URI.datatype [alt]::Text.datatype [longdesc]::URI.datatype? [height]::Length.datatype? [width]::Length.datatype?
img.attlist ::=
	name.attlist
img.attlist ::=
	[ismap]::"ismap"?
object.attlist ::=
	usemap.attlist
object.attlist ::=
	Common.attrib [declare]::"declare"? [classid]::URI.datatype? [codebase]::URI.datatype? [data]::URI.datatype? [type]::ContentType.datatype? [codetype]::ContentType.datatype? [archive]::URIs.datatype? [standby]::Text.datatype? [height]::Length.datatype? [width]::Length.datatype? [name]::string? [tabindex]::Number.datatype?
usemap.attlist ::=
	[usemap]::IDREF.datatype?
shape.attrib ::=
	[shape]::("rect" | "circle" | "poly" | "default")?
coords.attrib ::=
	[coords]::string?
Length.datatype ::=
	string
LinkTypes.datatype ::=
	NMTOKENS.datatype
MediaDesc.datatype ::=
	string
MultiLength.datatype ::=
	string
Number.datatype ::=
	string
Pixels.datatype ::=
	string
Script.datatype ::=
	string
Text.datatype ::=
	string
Character.datatype ::=
	string
Charset.datatype ::=
	string
Charsets.datatype ::=
	string
ContentType.datatype ::=
	string
ContentTypes.datatype ::=
	string
Datetime.datatype ::=
	string
FPI.datatype ::=
	string
LanguageCode.datatype ::=
	string
URI.datatype ::=
	string
URIs.datatype ::=
	string
NMTOKEN.datatype ::=
	string
NMTOKENS.datatype ::=
	string
ID.datatype ::=
	string
IDREF.datatype ::=
	string
IDREFS.datatype ::=
	string
del ::=
	[del]::(del.attlist Inline.model)
del.attlist ::=
	Edit.attrib
ins ::=
	[ins]::(ins.attlist Inline.model)
ins.attlist ::=
	Edit.attrib
Edit.attrib ::=
	[cite]::URI.datatype? [datetime]::Datetime.datatype?
Edit.class ::=
	del
	ins
Block.class ::=
	Edit.class
Block.class ::=
	Form.class
Block.class ::=
	List.class
Block.class ::=
	hr
Block.class ::=
	Script.class
Block.class ::=
	table
Block.class ::=
	address
	blockquote
	div
	p
	pre
	Heading.class
form.attlist ::=
	[onreset]::Script.datatype? [onsubmit]::Script.datatype?
form.attlist ::=
	[accept-charset]::Charsets.datatype? [accept]::ContentTypes.datatype?
form.attlist ::=
	Common.attrib [action]::URI.datatype [method]::("get" | "post")? [enctype]::ContentType.datatype?
form.attlist ::=
	name.attlist
form.attlist ::=
	target.attrib
body.attlist ::=
	[onload]::Script.datatype? [onunload]::Script.datatype?
body.attlist ::=
	Common.attrib
label.attlist ::=
	[onblur]::Script.datatype? [onfocus]::Script.datatype?
label.attlist ::=
	Common.attrib [for]::IDREF.datatype? [accesskey]::Character.datatype?
input.attlist ::=
	[onblur]::Script.datatype? [onchange]::Script.datatype? [onfocus]::Script.datatype? [onselect]::Script.datatype?
input.attlist ::=
	[disabled]::"disabled"? [readonly]::"readonly"? [alt]::string? [tabindex]::Number.datatype? [accept]::ContentTypes.datatype?
input.attlist ::=
	Common.attrib [type]::InputType.class? [name]::string? [value]::string? [checked]::"checked"? [size]::string? [maxlength]::Number.datatype? [src]::URI.datatype? [accesskey]::Character.datatype?
select.attlist ::=
	[onblur]::Script.datatype? [onchange]::Script.datatype? [onfocus]::Script.datatype?
select.attlist ::=
	[disabled]::"disabled"? [tabindex]::Number.datatype?
select.attlist ::=
	Common.attrib [name]::string? [size]::Number.datatype? [multiple]::"multiple"?
textarea.attlist ::=
	[onblur]::Script.datatype? [onchange]::Script.datatype? [onfocus]::Script.datatype? [onselect]::Script.datatype?
textarea.attlist ::=
	[disabled]::"disabled"? [readonly]::"readonly"? [tabindex]::Number.datatype?
textarea.attlist ::=
	Common.attrib [name]::string? [rows]::Number.datatype [cols]::Number.datatype [accesskey]::Character.datatype? string
button.attlist ::=
	[onblur]::Script.datatype? [onfocus]::Script.datatype?
button.attlist ::=
	Common.attrib [name]::string? [value]::string? [type]::("button" | "submit" | "reset")? [disabled]::"disabled"? [tabindex]::Number.datatype? [accesskey]::Character.datatype?
Events.attrib ::=
	[onclick]::Script.datatype? [ondblclick]::Script.datatype? [onmousedown]::Script.datatype? [onmouseup]::Script.datatype? [onmouseover]::Script.datatype? [onmousemove]::Script.datatype? [onmouseout]::Script.datatype? [onkeypress]::Script.datatype? [onkeydown]::Script.datatype? [onkeyup]::Script.datatype?
select ::=
	[select]::(select.attlist (option | optgroup)+)
select ::=
	[select]::(select.attlist option+)
InputType.class ::=
	"image"
	"button"
InputType.class ::=
	"text"
	"password"
	"checkbox"
	"radio"
	"submit"
	"reset"
	"hidden"
option.attlist ::=
	[disabled]::"disabled"? [label]::Text.datatype?
optgroup ::=
	[optgroup]::(optgroup.attlist option+)
optgroup.attlist ::=
	Common.attrib [disabled]::"disabled"? [label]::Text.datatype
fieldset ::=
	[fieldset]::(fieldset.attlist legend Flow.model)
fieldset.attlist ::=
	Common.attrib
button ::=
	[button]::(button.attlist Flow.model)
legend ::=
	[legend]::(legend.attlist Inline.model)
legend.attlist ::=
	Common.attrib [accesskey]::Character.datatype?
Form.class ::=
	fieldset
Form.class ::=
	form
Formctrl.class ::=
	button
Formctrl.class ::=
	input
	label
	select
	textarea
form ::=
	[form]::(form.attlist Block.class+)
label ::=
	[label]::(label.attlist Inline.model)
input ::=
	[input]::input.attlist
option ::=
	[option]::(Common.attrib [selected]::"selected"? [value]::string? string)
textarea ::=
	[textarea]::textarea.attlist
a ::=
	[a]::(a.attlist Inline.model)
iframe ::=
	[iframe]::(iframe.attlist Flow.model)
iframe.attlist ::=
	Core.attrib [longdesc]::URI.datatype? [src]::URI.datatype? [frameborder]::("1" | "0")? [width]::Length.datatype? [height]::Length.datatype? [marginwidth]::Pixels.datatype? [marginheight]::Pixels.datatype? [scrolling]::("yes" | "no" | "auto")?
iframe.attlist ::=
	name.attlist
img ::=
	[img]::img.attlist
link ::=
	[link]::link.attlist
link.attlist ::=
	Common.attrib [charset]::Charset.datatype? [href]::URI.datatype? [hreflang]::LanguageCode.datatype? [type]::ContentType.datatype? [rel]::LinkTypes.datatype? [rev]::LinkTypes.datatype? [media]::MediaDesc.datatype?
dl ::=
	[dl]::(dl.attlist (dt | dd)+)
dl.attlist ::=
	Common.attrib
dt ::=
	[dt]::(dt.attlist Inline.model)
dt.attlist ::=
	Common.attrib
dd ::=
	[dd]::(dd.attlist Flow.model)
dd.attlist ::=
	Common.attrib
ol ::=
	[ol]::(ol.attlist li+)
ol.attlist ::=
	Common.attrib
ul ::=
	[ul]::(ul.attlist li+)
ul.attlist ::=
	Common.attrib
li ::=
	[li]::(li.attlist Flow.model)
li.attlist ::=
	Common.attrib
List.class ::=
	ul
	ol
	dl
meta ::=
	[meta]::meta.attlist
meta.attlist ::=
	I18n.attrib [http-equiv]::NMTOKEN.datatype? [name]::NMTOKEN.datatype? [content]::string? [scheme]::string?
frame.attrib ::=
	name.attlist
frame.attrib ::=
	[frame]::("void" | "above" | "below" | "hsides" | "lhs" | "rhs" | "vsides" | "box" | "border")?
name.attlist ::=
	[name]::string?
object ::=
	[object]::(object.attlist param* Flow.model)
param ::=
	[param]::param.attlist
param.attlist ::=
	id.attrib [name]::string [value]::string? [valuetype]::("data" | "ref" | "object")? [type]::ContentType.datatype?
hr ::=
	[hr]::hr.attlist
hr.attlist ::=
	Common.attrib
b ::=
	[b]::(b.attlist Inline.model)
b.attlist ::=
	Common.attrib
big ::=
	[big]::(big.attlist Inline.model)
big.attlist ::=
	Common.attrib
i ::=
	[i]::(i.attlist Inline.model)
i.attlist ::=
	Common.attrib
small ::=
	[small]::(small.attlist Inline.model)
small.attlist ::=
	Common.attrib
sub ::=
	[sub]::(sub.attlist Inline.model)
sub.attlist ::=
	Common.attrib
sup ::=
	[sup]::(sup.attlist Inline.model)
sup.attlist ::=
	Common.attrib
tt ::=
	[tt]::(tt.attlist Inline.model)
tt.attlist ::=
	Common.attrib
script ::=
	[script]::(script.attlist string)
script.attlist ::=
	[charset]::Charset.datatype? [type]::ContentType.datatype [src]::URI.datatype? [defer]::"defer"? [xml:space]::"preserve"?
noscript ::=
	[noscript]::(noscript.attlist Block.model)
noscript.attlist ::=
	Common.attrib
Script.class ::=
	noscript
	script
title ::=
	[title]::(title.attlist string)
title.attlist ::=
	I18n.attrib
head ::=
	[head]::(head.attlist head.content)
head.attlist ::=
	I18n.attrib profile.attlist
profile.attlist ::=
	[profile]::URI.datatype?
body ::=
	[body]::(body.attlist Block.model)
html ::=
	[html]::(html.attlist head body)
html.attlist ::=
	XHTML.version.attrib I18n.attrib
XHTML.version.attrib ::=
	[version]::FPI.datatype?
style ::=
	[style]::(style.attlist string)
style.attlist ::=
	title.attrib I18n.attrib [type]::ContentType.datatype [media]::MediaDesc.datatype? [xml:space]::"preserve"?
table ::=
	[table]::(table.attlist caption? (col* | colgroup*) (thead? tfoot? tbody+ | tr+))
table ::=
	[table]::(table.attlist caption? tr+)
th ::=
	[th]::(th.attlist Flow.model)
td ::=
	[td]::(td.attlist Flow.model)
CellHAlign.attrib ::=
	[align]::("left" | "center" | "right" | "justify" | "char")? [char]::Character.datatype? [charoff]::Length.datatype?
CellHAlign.attrib ::=
	[align]::("left" | "center" | "right")?
CellVAlign.attrib ::=
	[valign]::("top" | "middle" | "bottom" | "baseline")?
CellVAlign.attrib ::=
	[valign]::("top" | "middle" | "bottom")?
scope.attrib ::=
	[scope]::("row" | "col" | "rowgroup" | "colgroup")?
scope.attrib ::=
	[scope]::("row" | "col")?
table.attlist ::=
	[width]::Length.datatype? [border]::Pixels.datatype? frame.attrib rules.attrib [cellspacing]::Length.datatype? [cellpadding]::Length.datatype?
table.attlist ::=
	Common.attrib [summary]::Text.datatype?
col ::=
	[col]::col.attlist
col.attlist ::=
	Common.attrib [span]::Number.datatype? [width]::MultiLength.datatype? CellHAlign.attrib CellVAlign.attrib
colgroup ::=
	[colgroup]::(colgroup.attlist col*)
colgroup.attlist ::=
	Common.attrib [span]::Number.datatype? [width]::MultiLength.datatype? CellHAlign.attrib CellVAlign.attrib
tbody ::=
	[tbody]::(tbody.attlist tr+)
tbody.attlist ::=
	Common.attrib CellHAlign.attrib CellVAlign.attrib
thead ::=
	[thead]::(thead.attlist tr+)
thead.attlist ::=
	Common.attrib CellHAlign.attrib CellVAlign.attrib
tfoot ::=
	[tfoot]::(tfoot.attlist tr+)
tfoot.attlist ::=
	Common.attrib CellHAlign.attrib CellVAlign.attrib
rules.attrib ::=
	[rules]::("none" | "groups" | "rows" | "cols" | "all")?
caption ::=
	[caption]::(caption.attlist Inline.model)
caption.attlist ::=
	Common.attrib
tr ::=
	[tr]::(tr.attlist (th | td)+)
tr.attlist ::=
	Common.attrib CellHAlign.attrib CellVAlign.attrib
th.attlist ::=
	Cell.attrib
td.attlist ::=
	Cell.attrib
Cell.attrib ::=
	Common.attrib [abbr]::Text.datatype? [axis]::string? [headers]::IDREFS.datatype? scope.attrib [rowspan]::Number.datatype? [colspan]::Number.datatype? CellHAlign.attrib CellVAlign.attrib
link.attrib ::=
	target.attrib
target.attrib ::=
	[target]::string?
br ::=
	[br]::br.attlist
br.attlist ::=
	Core.attrib
span ::=
	[span]::(span.attlist Inline.model)
span.attlist ::=
	Common.attrib
abbr ::=
	[abbr]::(abbr.attlist Inline.model)
abbr.attlist ::=
	Common.attrib
acronym ::=
	[acronym]::(acronym.attlist Inline.model)
acronym.attlist ::=
	Common.attrib
cite ::=
	[cite]::(cite.attlist Inline.model)
cite.attlist ::=
	Common.attrib
code ::=
	[code]::(code.attlist Inline.model)
code.attlist ::=
	Common.attrib
dfn ::=
	[dfn]::(dfn.attlist Inline.model)
dfn.attlist ::=
	Common.attrib
em ::=
	[em]::(em.attlist Inline.model)
em.attlist ::=
	Common.attrib
kbd ::=
	[kbd]::(kbd.attlist Inline.model)
kbd.attlist ::=
	Common.attrib
q ::=
	[q]::(q.attlist Inline.model)
q.attlist ::=
	Common.attrib [cite]::URI.datatype?
samp ::=
	[samp]::(samp.attlist Inline.model)
samp.attlist ::=
	Common.attrib
strong ::=
	[strong]::(strong.attlist Inline.model)
strong.attlist ::=
	Common.attrib
var ::=
	[var]::(var.attlist Inline.model)
var.attlist ::=
	Common.attrib
div ::=
	[div]::(div.attlist Flow.model)
div.attlist ::=
	Common.attrib
p ::=
	[p]::(p.attlist Inline.model)
p.attlist ::=
	Common.attrib
address ::=
	[address]::(address.attlist Inline.model)
address.attlist ::=
	Common.attrib
blockquote ::=
	[blockquote]::(blockquote.attlist Block.model)
blockquote.attlist ::=
	Common.attrib [cite]::URI.datatype?
pre ::=
	[pre]::(pre.attlist Inline.model)
pre.attlist ::=
	Common.attrib [xml:space]::"preserve"?
h1 ::=
	[h1]::(Heading.attrib Heading.content)
h2 ::=
	[h2]::(Heading.attrib Heading.content)
h3 ::=
	[h3]::(Heading.attrib Heading.content)
h4 ::=
	[h4]::(Heading.attrib Heading.content)
h5 ::=
	[h5]::(Heading.attrib Heading.content)
h6 ::=
	[h6]::(Heading.attrib Heading.content)
Heading.attrib ::=
	Common.attrib
Heading.content ::=
	Inline.model
Heading.class ::=
	h1
	h2
	h3
	h4
	h5
	h6
Inline.model ::=
	(string | Inline.class)*
Block.mix ::=
	Block.class
Block.model ::=
	Block.mix+
Flow.model ::=
	(string | Inline.class | Block.class)*

GrammarLabMaintained by Dr. Vadim Zaytsev a.k.a. @grammarware. Last updated in September 2015. []