document ::= |
( prolog element Misc* ) - ( Char* RestrictedChar Char* ) |
Char ::= |
[#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] |
/* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */ |
RestrictedChar ::= |
[#x1-#x8] | [#xB-#xC] | [#xE-#x1F] | [#x7F-#x84] | [#x86-#x9F] |
S ::= |
(#x20 | #x9 | #xD | #xA)+ |
NameStartChar ::= |
":" | [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] |
NameChar ::= |
NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040] |
Name ::= |
NameStartChar (NameChar)* |
Names ::= |
Name (#x20 Name)* |
Nmtoken ::= |
(NameChar)+ |
Nmtokens ::= |
Nmtoken (#x20 Nmtoken)* |
EntityValue ::= |
'"' ([^%&"] | PEReference | Reference)* '"' |
|
| "'" ([^%&'] | PEReference | Reference)* "'" |
AttValue ::= |
'"' ([^<&"] | Reference)* '"' |
|
| "'" ([^<&'] | Reference)* "'" |
SystemLiteral ::= |
('"' [^"]* '"') | ("'" [^']* "'") |
PubidLiteral ::= |
'"' PubidChar* '"' | "'" (PubidChar - "'")* "'" |
PubidChar ::= |
#x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] |
CharData ::= |
[^<&]* - ([^<&]* ']]>' [^<&]*) |
Comment ::= |
'<!--' ((Char - '-') | ('-' (Char - '-')))* '-->' |
PI ::= |
'<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>' |
PITarget ::= |
Name - (('X' | 'x') ('M' | 'm') ('L' | 'l')) |
CDSect ::= |
CDStart CData CDEnd |
CDStart ::= |
'<![CDATA[' |
CData ::= |
(Char* - (Char* ']]>' Char*)) |
CDEnd ::= |
']]>' |
prolog ::= |
XMLDecl Misc* (doctypedecl Misc*)? |
XMLDecl ::= |
'<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>' |
VersionInfo ::= |
S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"') |
Eq ::= |
S? '=' S? |
VersionNum ::= |
'1.1' |
Misc ::= |
Comment | PI | S |
doctypedecl ::= |
'<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>' |
[VC: Root Element Type] |
|
|
[WFC: External Subset] |
DeclSep ::= |
PEReference | S |
[WFC: PE Between Declarations] |
intSubset ::= |
(markupdecl | DeclSep)* |
markupdecl ::= |
elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment |
[VC: Proper Declaration/PE Nesting] |
|
|
[WFC: PEs in Internal Subset] |
extSubset ::= |
TextDecl? extSubsetDecl |
extSubsetDecl ::= |
( markupdecl | conditionalSect | DeclSep)* |
SDDecl ::= |
S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"')) |
[VC: Standalone Document Declaration] |
element ::= |
EmptyElemTag |
|
| STag content ETag |
[WFC: Element Type Match] |
|
|
[VC: Element Valid] |
STag ::= |
'<' Name (S Attribute)* S? '>' |
[WFC: Unique Att Spec] |
Attribute ::= |
Name Eq AttValue |
[VC: Attribute Value Type] |
|
|
[WFC: No External Entity References] |
|
|
[WFC: No < in Attribute Values] |
ETag ::= |
'</' Name S? '>' |
content ::= |
CharData? ((element | Reference | CDSect | PI | Comment) CharData?)* |
EmptyElemTag ::= |
'<' Name (S Attribute)* S? '/>' |
[WFC: Unique Att Spec] |
elementdecl ::= |
'<!ELEMENT' S Name S contentspec S? '>' |
[VC: Unique Element Type Declaration] |
contentspec ::= |
'EMPTY' | 'ANY' | Mixed | children |
children ::= |
(choice | seq) ('?' | '*' | '+')? |
cp ::= |
(Name | choice | seq) ('?' | '*' | '+')? |
choice ::= |
'(' S? cp ( S? '|' S? cp )+ S? ')' |
[VC: Proper Group/PE Nesting] |
seq ::= |
'(' S? cp ( S? ',' S? cp )* S? ')' |
[VC: Proper Group/PE Nesting] |
Mixed ::= |
'(' S? '#PCDATA' (S? '|' S? Name)* S? ')*' |
|
| '(' S? '#PCDATA' S? ')' |
[VC: Proper Group/PE Nesting] |
|
|
[VC: No Duplicate Types] |
AttlistDecl ::= |
'<!ATTLIST' S Name AttDef* S? '>' |
AttDef ::= |
S Name S AttType S DefaultDecl |
AttType ::= |
StringType | TokenizedType | EnumeratedType |
StringType ::= |
'CDATA' |
TokenizedType ::= |
'ID' |
[VC: ID] |
|
|
[VC: One ID per Element Type] |
|
|
[VC: ID Attribute Default] |
|
| 'IDREF' |
[VC: IDREF] |
|
| 'IDREFS' |
[VC: IDREF] |
|
| 'ENTITY' |
[VC: Entity Name] |
|
| 'ENTITIES' |
[VC: Entity Name] |
|
| 'NMTOKEN' |
[VC: Name Token] |
|
| 'NMTOKENS' |
[VC: Name Token] |
EnumeratedType ::= |
NotationType | Enumeration |
NotationType ::= |
'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' |
[VC: Notation Attributes] |
|
|
[VC: One Notation Per Element Type] |
|
|
[VC: No Notation on Empty Element] |
|
|
[VC: No Duplicate Tokens] |
Enumeration ::= |
'(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')' |
[VC: Enumeration] |
|
|
[VC: No Duplicate Tokens] |
DefaultDecl ::= |
'#REQUIRED' | '#IMPLIED' |
|
| (('#FIXED' S)? AttValue) |
[VC: Required Attribute] |
|
|
[VC: Attribute Default Value Syntactically Correct] |
|
|
[WFC: No < in Attribute Values] |
|
|
[VC: Fixed Attribute Default] |
|
|
[WFC: No External Entity References] |
conditionalSect ::= |
includeSect | ignoreSect |
includeSect ::= |
'<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>' |
[VC: Proper Conditional Section/PE Nesting] |
ignoreSect ::= |
'<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>' |
[VC: Proper Conditional Section/PE Nesting] |
ignoreSectContents ::= |
Ignore ('<![' ignoreSectContents ']]>' Ignore)* |
Ignore ::= |
Char* - (Char* ('<![' | ']]>') Char*) |
CharRef ::= |
'&#' [0-9]+ ';' |
|
| '&#x' [0-9a-fA-F]+ ';' |
[WFC: Legal Character] |
Reference ::= |
EntityRef | CharRef |
EntityRef ::= |
'&' Name ';' |
[WFC: Entity Declared] |
|
|
[VC: Entity Declared] |
|
|
[WFC: Parsed Entity] |
|
|
[WFC: No Recursion] |
PEReference ::= |
'%' Name ';' |
[VC: Entity Declared] |
|
|
[WFC: No Recursion] |
|
|
[WFC: In DTD] |
EntityDecl ::= |
GEDecl | PEDecl |
GEDecl ::= |
'<!ENTITY' S Name S EntityDef S? '>' |
PEDecl ::= |
'<!ENTITY' S '%' S Name S PEDef S? '>' |
EntityDef ::= |
EntityValue | (ExternalID NDataDecl?) |
PEDef ::= |
EntityValue | ExternalID |
ExternalID ::= |
'SYSTEM' S SystemLiteral |
|
| 'PUBLIC' S PubidLiteral S SystemLiteral |
NDataDecl ::= |
S 'NDATA' S Name |
[VC: Notation Declared] |
TextDecl ::= |
'<?xml' VersionInfo? EncodingDecl S? '?>' |
extParsedEnt ::= |
( TextDecl? content ) - ( Char* RestrictedChar Char* ) |
EncodingDecl ::= |
S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" ) |
EncName ::= |
[A-Za-z] ([A-Za-z0-9._] | '-')* |
/* Encoding name contains only Latin characters */ |
NotationDecl ::= |
'<!NOTATION' S Name S (ExternalID | PublicID) S? '>' |
[VC: Unique Notation Name] |
PublicID ::= |
'PUBLIC' S PubidLiteral |