Browsable HTML Grammar

CC-BY

Grammar extracted by Vadim Zaytsev, see the Grammar Zoo entry for details: html/guyard/extracted
Source used for this grammar: Pierrick Guyard, XHTML 1.0, XHTML.ecore, 2005/06/23

Summary

Syntax

ValuedElement ::=
	CDATA
ValuedElement ::=
	PCDATA
ValuedElement ::=
	NMTOKEN
ValuedElement ::=
	IDREF
ValuedElement ::=
	ID
CDATA ::=
	ContentType
CDATA ::=
	Charset
CDATA ::=
	Character
CDATA ::=
	Number
CDATA ::=
	LinkTypes
CDATA ::=
	MediaDesc
CDATA ::=
	URI
CDATA ::=
	Datetime
CDATA ::=
	ScriptExpression
CDATA ::=
	StyleSheet
CDATA ::=
	Text
CDATA ::=
	Length
CDATA ::=
	MultiLength
CDATA ::=
	Pixels
CDATA ::=
	ContentType
	Charset
	Character
	Number
	LinkTypes
	MediaDesc
	URI
	Datetime
	ScriptExpression
	StyleSheet
	Text
	Length
	MultiLength
	Pixels
PCDATA ::=
	Title
PCDATA ::=
	Style
PCDATA ::=
	Script
PCDATA ::=
	Textarea
NMTOKEN ::=
	LanguageCode
IDREF ::=
	[value]::String
IDREFS ::=
	[idrefs]::IDREF+
ID ::=
	[value]::String
EMPTY ::=
	Base
EMPTY ::=
	Meta
EMPTY ::=
	Link
EMPTY ::=
	Hr
EMPTY ::=
	Br
EMPTY ::=
	Param
EMPTY ::=
	Img
EMPTY ::=
	Area
EMPTY ::=
	Input
EMPTY ::=
	Col
ContentType ::=
	ε
ContentTypes ::=
	[contentTypes]::ContentType
Charset ::=
	ε
Charsets ::=
	[charsets]::Charset
LanguageCode ::=
	ε
Character ::=
	ε
Number ::=
	ε
LinkTypes ::=
	ε
MediaDesc ::=
	ε
URI ::=
	ε
UriList ::=
	[uris]::URI
Datetime ::=
	ε
ScriptExpression ::=
	ε
StyleSheet ::=
	ε
Text ::=
	ε
Length ::=
	ε
MultiLength ::=
	ε
Pixels ::=
	ε
Shape ::=
	[rect]::ε
	[circle]::ε
	[poly]::ε
	[default]::ε
Coords ::=
	[lengths]::Length
CoreAttrs ::=
	Attrs
CoreAttrs ::=
	Bdo
Direction ::=
	[ltr]::ε
	[rtl]::ε
I18n ::=
	Map
Attrs ::=
	Body
Attrs ::=
	Li
Attrs ::=
	DlElement
Attrs ::=
	Caption
Attrs ::=
	Noscript
Attrs ::=
	Div
Attrs ::=
	P
Attrs ::=
	H1
Attrs ::=
	H2
Attrs ::=
	H3
Attrs ::=
	H4
Attrs ::=
	H5
Attrs ::=
	H6
Attrs ::=
	Ul
Attrs ::=
	Ol
Attrs ::=
	Dl
Attrs ::=
	Address
Attrs ::=
	Pre
Attrs ::=
	Blockquote
Attrs ::=
	Ins
Attrs ::=
	Del
Attrs ::=
	A
Attrs ::=
	Span
Attrs ::=
	Em
Attrs ::=
	Strong
Attrs ::=
	Dfn
Attrs ::=
	Code
Attrs ::=
	Samp
Attrs ::=
	Kbd
Attrs ::=
	Var
Attrs ::=
	Cite
Attrs ::=
	Abbr
Attrs ::=
	Acronym
Attrs ::=
	Q
Attrs ::=
	Sub
Attrs ::=
	Sup
Attrs ::=
	Tt
Attrs ::=
	I
Attrs ::=
	B
Attrs ::=
	Big
Attrs ::=
	Small
Attrs ::=
	Object
Attrs ::=
	Form
Attrs ::=
	Label
Attrs ::=
	Select
Attrs ::=
	Fieldset
Attrs ::=
	Legend
Attrs ::=
	Button
Attrs ::=
	Table
Attrs ::=
	Thead
Attrs ::=
	Tfoot
Attrs ::=
	Tbody
Attrs ::=
	Colgroup
Attrs ::=
	Tr
Attrs ::=
	Optgroup
Specialpre ::=
	Span
Special ::=
	Specialpre
Fontstyle ::=
	Tt
Fontstyle ::=
	I
Fontstyle ::=
	B
Fontstyle ::=
	Big
Fontstyle ::=
	Small
Phrase ::=
	Em
Phrase ::=
	Strong
Phrase ::=
	Dfn
Phrase ::=
	Code
Phrase ::=
	Samp
Phrase ::=
	Kbd
Phrase ::=
	Var
Phrase ::=
	Cite
Phrase ::=
	Abbr
Phrase ::=
	Acronym
Phrase ::=
	Q
Phrase ::=
	Sub
Phrase ::=
	Sup
Inlineforms ::=
	Label
Inlineforms ::=
	Select
Miscinline ::=
	Ins
Miscinline ::=
	Del
Misc ::=
	Miscinline
Misc ::=
	Noscript
inline ::=
	Special
inline ::=
	Fontstyle
inline ::=
	Phrase
inline ::=
	Inlineforms
Inline ::=
	inline
Heading ::=
	H1
Heading ::=
	H2
Heading ::=
	H3
Heading ::=
	H4
Heading ::=
	H5
Heading ::=
	H6
Lists ::=
	Ul
Lists ::=
	Ol
Lists ::=
	Dl
Blocktext ::=
	Address
Blocktext ::=
	Pre
Blocktext ::=
	Blockquote
block ::=
	Heading
block ::=
	Lists
block ::=
	Blocktext
block ::=
	Fieldset
Block ::=
	Misc
Block ::=
	block
Flow ::=
	Inline
PreContent ::=
	Specialpre
ButtonContent ::=
	Special
ButtonContent ::=
	Heading
ButtonContent ::=
	Lists
ButtonContent ::=
	Blocktext
Html ::=
	[i18n]::I18n [id]::ID [xmlns]::URI [head]::Head [body]::Body
HeadMisc ::=
	Meta
HeadMisc ::=
	Style
Head ::=
	[i18n]::I18n [id]::ID [profile]::URI [headmisc]::HeadMisc+ [headelement]::HeadElement [html]::Html
HeadElement ::=
	TitleHeadElement
HeadElement ::=
	BaseHeadElement
TitleHeadElement ::=
	[title]::Title [headmisc]::HeadMisc+ [baseTitleHeadElement]::BaseTitleHeadElement+
BaseTitleHeadElement ::=
	[base]::Base [headmisc]::HeadMisc+
BaseHeadElement ::=
	[base]::Base [headmisc]::HeadMisc+ [titleBaseHeadElement]::TitleBaseHeadElement+
TitleBaseHeadElement ::=
	[title]::Title [headmisc]::HeadMisc+
Title ::=
	[i18n]::I18n [id]::ID
Base ::=
	[href]::URI [id]::ID
Meta ::=
	[i18n]::I18n [id]::ID [httpequiv]::CDATA [name]::CDATA [content]::CDATA [scheme]::CDATA
Link ::=
	[charset]::Charset [href]::URI [hreflang]::LanguageCode [type]::ContentType [rel]::LinkTypes [rev]::LinkTypes [media]::MediaDesc
Style ::=
	[i18n]::I18n [id]::ID [type]::ContentType [media]::MediaDesc [title]::Text [xml:space]::String
Script ::=
	[id]::ID [charset]::Charset [type]::ContentType [src]::URI [defer]::String [xml:space]::String
Noscript ::=
	[block]::Block
Body ::=
	[bodyElements]::Block+ [onload]::ScriptExpression [onunload]::ScriptExpression [html]::Html
Div ::=
	[divElements]::Flow+
P ::=
	[pElements]::Inline+
H1 ::=
	[h1Elements]::Inline+
H2 ::=
	[h2Elements]::Inline+
H3 ::=
	[h3Elements]::Inline+
H4 ::=
	[h4Elements]::Inline+
H5 ::=
	[h5Elements]::Inline+
H6 ::=
	[h6Elements]::Inline+
Ul ::=
	[li]::Li+
Ol ::=
	[li]::Li+
Li ::=
	[liElements]::Flow+
Dl ::=
	[dlElements]::DlElement+
DlElement ::=
	Dt
DlElement ::=
	Dd
Dt ::=
	[dtElements]::Inline+
Dd ::=
	[ddElements]::Flow+
Address ::=
	[addressElements]::Inline+
Hr ::=
	ε
Pre ::=
	[preElements]::PreContent+ [xml:space]::String
Blockquote ::=
	[blockquoteElements]::Block+ [cite]::URI
Ins ::=
	[flowelement]::Flow+ [cite]::URI [datetime]::Datetime
Del ::=
	[flowelement]::Flow+ [cite]::URI [datetime]::Datetime
A ::=
	[acontent]::AContent+ [charset]::Charset [type]::ContentType [name]::NMTOKEN [href]::URI [hreflang]::LanguageCode [rel]::LinkTypes [rev]::LinkTypes [shape]::Shape [coords]::Coords
Span ::=
	[spanElements]::Inline+
Bdo ::=
	[bdoElements]::Inline+ [lang]::LanguageCode [xml:lang]::LanguageCode [dir]::Direction
Br ::=
	ε
Em ::=
	[emElements]::Inline+
Strong ::=
	[strongElements]::Inline+
Dfn ::=
	[dfnElements]::Inline+
Code ::=
	[codeElements]::Inline+
Samp ::=
	[sampElements]::Inline+
Kbd ::=
	[kbdElements]::Inline+
Var ::=
	[varElements]::Inline+
Cite ::=
	[citeElements]::Inline+
Abbr ::=
	[abbrElements]::Inline+
Acronym ::=
	[acronymElements]::Inline+
Q ::=
	[qElements]::Inline+ [cite]::URI
Sub ::=
	[subElements]::Inline+
Sup ::=
	[supElements]::Inline+
Tt ::=
	[ttElements]::Inline+
I ::=
	[iElements]::Inline+
B ::=
	[bElements]::Inline+
Big ::=
	[bigElements]::Inline+
Small ::=
	[smallElements]::Inline+
ObjectElement ::=
	Param
Object ::=
	[objectelement]::ObjectElement+ [declare]::Boolean [classid]::URI [codebase]::URI [data]::URI [type]::ContentType [codetype]::ContentType [archive]::UriList [standby]::Text [height]::Length [width]::Length [usemap]::URI [name]::NMTOKEN [tabindex]::Number
ValueType ::=
	[data]::ε
	[ref]::ε
	[object]::ε
Param ::=
	[id]::ID [name]::CDATA [value]::CDATA [valuetype]::ValueType [type]::ContentType
Img ::=
	[src]::URI [alt]::Text [longdesc]::URI [height]::Length [width]::Length [usemap]::URI [ismap]::Boolean
MapContent ::=
	[mapElements]::MapElement+
Map ::=
	[mapelement]::MapContent [id]::ID [class]::CDATA [style]::StyleSheet [title]::Text [name]::NMTOKEN
Area ::=
	[shape]::Shape [coords]::Coords [href]::URI [nohref]::Boolean [alt]::Text
FomeMethod ::=
	[get]::ε
	[post]::ε
Form ::=
	[formelement]::FormContent+ [action]::URI [method]::FomeMethod [enctype]::ContentType [onsubmit]::ScriptExpression [onreset]::ScriptExpression [accept]::ContentTypes [accept-charset]::Charsets
Label ::=
	[labelelements]::Inline+ [for]::IDREF [accesskey]::Character [onfocus]::ScriptExpression [onblur]::ScriptExpression
InputType ::=
	[text]::ε
	[password]::ε
	[checkbox]::ε
	[radio]::ε
	[submit]::ε
	[reset]::ε
	[file]::ε
	[hidden]::ε
	[image]::ε
	[button]::ε
Input ::=
	[type]::InputType [name]::CDATA [value]::CDATA [checked]::Boolean [disabled]::Boolean [readonly]::Boolean [size]::CDATA [maxlength]::Number [src]::URI [alt]::CDATA [usemap]::URI [onselect]::ScriptExpression [onchange]::ScriptExpression [accept]::ContentTypes
Select ::=
	[selectelement]::SelectElement+ [name]::CDATA [size]::Number [multiple]::Boolean [disabled]::Boolean [tabindex]::Number [onfocus]::ScriptExpression [onblur]::ScriptExpression [onchange]::ScriptExpression
SelectElement ::=
	Optgroup
SelectElement ::=
	Option
Optgroup ::=
	[options]::Option+ [disabled]::Boolean [label]::Text
Option ::=
	[selected]::Boolean [disabled]::Boolean [label]::Text [optionvalue]::CDATA
Textarea ::=
	[name]::CDATA [rows]::Number [cols]::Number [disabled]::Boolean [readonly]::Boolean [onselect]::ScriptExpression [onchange]::ScriptExpression
FieldsetElement ::=
	Legend
Fieldset ::=
	[fieldsetelements]::FieldsetElement+
Legend ::=
	[legendelement]::Inline+ [accesskey]::Character
ButtonType ::=
	[button]::ε
	[submit]::ε
	[reset]::ε
Button ::=
	[buttoncontent]::ButtonContent+ [name]::CDATA [value]::CDATA [type]::ButtonType [disabled]::Boolean
TFrame ::=
	[void]::ε
	[above]::ε
	[below]::ε
	[hsides]::ε
	[lhs]::ε
	[rhs]::ε
	[vsides]::ε
	[box]::ε
	[border]::ε
TRules ::=
	[none]::ε
	[groups]::ε
	[rows]::ε
	[cols]::ε
	[all]::ε
CellHAlign ::=
	[left]::ε
	[center]::ε
	[right]::ε
	[justify]::ε
	[char]::ε
CellVAlign ::=
	[top]::ε
	[middle]::ε
	[bottom]::ε
	[baseline]::ε
Table ::=
	[caption]::Caption+ [colelement]::ColElement [thead]::Thead [tfoot]::Tfoot [tableelement]::TableElement [summary]::Text [width]::Length [border]::Pixels [frame]::TFrame [rules]::TRules [cellspacing]::Length [cellpadding]::Length
ColElement ::=
	[cols]::Col+ [colgroup]::Colgroup+
TableElement ::=
	[tbody]::Tbody+ [tr]::Tr+
Caption ::=
	[captionelement]::Inline+
Thead ::=
	[tr]::Tr+
Tfoot ::=
	[tr]::Tr+
Tbody ::=
	[tr]::Tr+
Colgroup ::=
	[cols]::Col+ [span]::Number [width]::MultiLength
Col ::=
	[span]::Number [width]::MultiLength
Tr ::=
	[trelements]::TrElement+
TrElement ::=
	Th
TrElement ::=
	Td
Scope ::=
	[row]::ε
	[col]::ε
	[rowgroup]::ε
	[colgroup]::ε
Th ::=
	[thelement]::Flow+ [abbr]::Text [axis]::CDATA [headers]::IDREFS [scope]::Scope [rowspan]::Number [colspan]::Number
Td ::=
	[tdelement]::Flow+ [abbr]::Text [axis]::CDATA [headers]::IDREFS [scope]::Scope [rowspan]::Number [colspan]::Number
String ::=
	string
Integer ::=
	integer
Boolean ::=
	"true"
	"false"

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