document | → | prolog element (misc)* |
char | → | [\t\n\r -\xd7ff\xe000-\xfffd\x10000-\x10ffff] |
s | → | [ \t\r\n]+ |
name‑start‑char | → | [:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\x2ff\x370-\x37d\x37f-\x1fff\x200c-\x200d\x2070-\x218f\x2c00-\x2fef\x3001-\xd7ff\xf900-\xfdcf\xfdf0-\xfffd\x10000-\xeffff] |
name‑char | → | name‑start‑char | [-.0-9\xb7\x300-\x36f\x203f-\x2040] |
name | → | name‑start‑char name‑char* |
names | → | name ( name)* |
nm‑token | → | name‑char+ |
nm‑tokens | → | nm‑token ( nm‑token)* |
prolog | → | xml‑decl? misc* (doc‑type‑decl misc*)? |
xml‑decl | → | <?xml version‑info encoding‑decl? sd‑decl? s? ?> |
version‑info | → | s version eq version‑number |
version‑num | → | 1 . [0-9]+ |
version‑num‑dq | → | \" version‑num \" |
version‑num‑sq | → | \' version‑num \' |
version‑number | → | version‑num‑dq | version‑num‑sq |
encoding‑decl | → | s encoding eq enc‑name |
encoding‑name | → | [A-Za-z] [A-Za-z0-9._-]* |
enc‑name‑dq | → | \" encoding‑name \" |
enc‑name‑sq | → | \' encoding‑name \' |
enc‑name | → | enc‑name‑dq | enc‑name‑sq |
sd‑decl | → | s standalone eq yes‑no |
doc‑type‑decl | → | <!DOCTYPE s name (s external‑id)? s? ([ int‑subset ] s?)? > |
external‑id | → | (SYSTEM s system‑literal) | (PUBLIC s pub‑id‑literal s system‑literal) |
system‑literal | → | (\" ([^\"]*) \") | (\' ([^\']*) \') |
pub‑id‑literal | → | \" (pub‑id‑char*) \" | \' ((pub‑id‑char − \')*) \' |
pub‑id‑char | → | [ \r\n] | [a-zA-Z0-9] | [-\'()+,./:=?;!*#@$_%] |
int‑subset | → | (markup‑decl | decl‑sep)* |
markup‑decl | → | element‑decl | attlist‑decl | entity‑decl | notation‑decl | pi | comment |
decl‑sep | → | pe‑reference | s |
element‑decl | → | <!ELEMENT s name s content‑spec s? > |
content‑spec | → | EMPTY | ANY | mixed | children |
children | → | (choice | seq) (? | * | +)? |
cp | → | (name | choice | seq) (? | * | +)? |
choice | → | ( s? cp (s? | s? cp)+ s? ) |
seq | → | ( s? cp (s? , s? cp)* s? ) |
mixed | → | ( s? #PCDATA (s? | s? name)* s? )* | ( s? #PCDATA s? ) |
attlist‑decl | → | <!ATTLIST s name att‑def* s? > |
att‑def | → | s name s att‑type s default‑decl |
att‑type | → | string‑type | tokenized‑type | enumerated‑type |
string‑type | → | CDATA |
tokenized‑type | → | ID | IDREF | IDREFS | ENTITY | ENTITIES | NMTOKEN | NMTOKENS |
enumerated‑type | → | notation‑type | enumeration |
notation‑type | → | NOTATION s ( s? name (s? | s? name)* s? ) |
enumeration | → | ( s? nm‑token (s? | s? nm‑token)* s? ) |
default‑decl | → | #REQUIRED | #IMPLIED | ((#FIXED s)? att‑value) |
entity‑decl | → | ge‑decl | pe‑decl |
ge‑decl | → | <!ENTITY s name s entity‑def s? > |
pe‑decl | → | <!ENTITY s % s name s pe‑def s? > |
entity‑def | → | entity‑value | (external‑id ndata‑decl?) |
pe‑def | → | entity‑value | external‑id |
entity‑value | → | \" ([^%&\"] | pe‑reference | reference)* \" | \' ([^%&\'] | pe‑reference | reference)* \' |
ndata‑decl | → | s NDATA s name |
pe‑reference | → | % name ; |
notation‑decl | → | <!NOTATION s name s (external‑id | public‑id) s? > |
public‑id | → | PUBLIC s pub‑id‑literal |
element | → | < name (s attribute)* s? (/> | > content etag) |
etag | → | </ name s? > |
content | → | char‑data? ((element | reference | cd‑sect | pi | comment) char‑data?)* |
char‑data‑char | → | [^<&] |
char‑data | → | char‑data‑char* − ([^<&]* ]]> [^<&]*) |
cd‑sect | → | <![CDATA[ char − ]]>* ]]> |
attribute | → | name eq att‑value |
att‑value‑dq | → | \" ([^<&\"] | reference)* \" |
att‑value‑sq | → | \' ([^<&\'] | reference)* \' |
att‑value | → | att‑value‑dq | att‑value‑sq |
entity‑ref | → | & name ; |
dec‑code‑point | → | [0-9]+ |
hex‑code‑point | → | [0-9a-fA-F]+ |
char‑ref | → | &# dec‑code‑point ; | &#x hex‑code‑point ; |
reference | → | entity‑ref | char‑ref |
misc | → | comment | pi | s |
comment | → | <!-- (char − - | - char − -)* --> |
pi | → | <? pi‑target s char − ?>* ?> |
pi‑target | → | name − xml |
xml | → | [xX] [mM] [lL] |
eq | → | s? = s? |
yes‑no | → | \"yes\" | \"no\" |