@@ -15,3 +15,115 @@
15[20] CData ::= (Char* - (Char* ']]>' Char*))
15[20] CData ::= (Char* - (Char* ']]>' Char*))
16[21] CDEnd ::= ']]>'
16[21] CDEnd ::= ']]>'
17[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
17[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
19+-- The original, mechanically extracted
21+[1] document ::= ( prolog element Misc* ) - ( Char* RestrictedChar Char* )
22+[2] Char ::= [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] /* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */
23+[2a] RestrictedChar ::= [#x1-#x8] | [#xB-#xC] | [#xE-#x1F] | [#x7F-#x84] | [#x86-#x9F]
24+[3] S ::= (#x20 | #x9 | #xD | #xA)+
25+[4] 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]
26+[4a] NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
27+[5] Name ::= NameStartChar (NameChar)*
28+[6] Names ::= Name (#x20 Name)*
29+[7] Nmtoken ::= (NameChar)+
30+[8] Nmtokens ::= Nmtoken (#x20 Nmtoken)*
31+[9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"'
32+| "'" ([^%&'] | PEReference | Reference)* "'"
33+[10] AttValue ::= '"' ([^<&"] | Reference)* '"'
34+| "'" ([^<&'] | Reference)* "'"
35+[11] SystemLiteral ::= ('"' [^"]* '"') | ("'" [^']* "'")
36+[12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'"
37+[13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
38+[14] CharData ::= [^<&]* - ([^<&]* ']]>' [^<&]*)
39+[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
40+[16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
41+[17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
42+[18] CDSect ::= CDStart CData CDEnd
43+[19] CDStart ::= '<![CDATA['
44+[20] CData ::= (Char* - (Char* ']]>' Char*))
46+[22] prolog ::= XMLDecl Misc* (doctypedecl Misc*)?
47+[23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
48+[24] VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
50+[26] VersionNum ::= '1.1'
51+[27] Misc ::= Comment | PI | S
52+[28] doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>' [VC: Root Element Type] [WFC: External Subset]
53+[28a] DeclSep ::= PEReference | S [WFC: PE Between Declarations]
54+[28b] intSubset ::= (markupdecl | DeclSep)*
55+[29] markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment [VC: Proper Declaration/PE Nesting] [WFC: PEs in Internal Subset]
56+[30] extSubset ::= TextDecl? extSubsetDecl
57+[31] extSubsetDecl ::= ( markupdecl | conditionalSect | DeclSep)*
58+[32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'") | ('"' ('yes' | 'no') '"')) [VC: Standalone Document Declaration]
59+[39] element ::= EmptyElemTag
60+| STag content ETag [WFC: Element Type Match]
62+[40] STag ::= '<' Name (S Attribute)* S? '>' [WFC: Unique Att Spec]
63+[41] Attribute ::= Name Eq AttValue [VC: Attribute Value Type]
64+[WFC: No External Entity References]
65+[WFC: No < in Attribute Values]
66+[42] ETag ::= '</' Name S? '>'
67+[43] content ::= CharData? ((element | Reference | CDSect | PI | Comment) CharData?)*
68+[44] EmptyElemTag ::= '<' Name (S Attribute)* S? '/>' [WFC: Unique Att Spec]
69+[45] elementdecl ::= '<!ELEMENT' S Name S contentspec S? '>' [VC: Unique Element Type Declaration]
70+[46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children
71+[47] children ::= (choice | seq) ('?' | '*' | '+')?
72+[48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
73+[49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')' [VC: Proper Group/PE Nesting]
74+[50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')' [VC: Proper Group/PE Nesting]
75+[51] Mixed ::= '(' S? '#PCDATA' (S? '|' S? Name)* S? ')*'
76+| '(' S? '#PCDATA' S? ')' [VC: Proper Group/PE Nesting]
77+[VC: No Duplicate Types]
78+[52] AttlistDecl ::= '<!ATTLIST' S Name AttDef* S? '>'
79+[53] AttDef ::= S Name S AttType S DefaultDecl
80+[54] AttType ::= StringType | TokenizedType | EnumeratedType
81+[55] StringType ::= 'CDATA'
82+[56] TokenizedType ::= 'ID' [VC: ID]
83+[VC: One ID per Element Type]
84+[VC: ID Attribute Default]
86+| 'IDREFS' [VC: IDREF]
87+| 'ENTITY' [VC: Entity Name]
88+[57] EnumeratedType ::= NotationType | Enumeration
89+[58] NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')' [VC: Notation Attributes]
90+[VC: One Notation Per Element Type]
91+[VC: No Notation on Empty Element]
92+[VC: No Duplicate Tokens]
93+[59] Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')' [VC: Enumeration]
94+[VC: No Duplicate Tokens]
95+[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED'
96+| (('#FIXED' S)? AttValue) [VC: Required Attribute]
97+[VC: Attribute Default Value Syntactically Correct]
98+[WFC: No < in Attribute Values]
99+[VC: Fixed Attribute Default]
100+[WFC: No External Entity References]
101+[61] conditionalSect ::= includeSect | ignoreSect
102+[62] includeSect ::= '<![' S? 'INCLUDE' S? '[' extSubsetDecl ']]>' [VC: Proper Conditional Section/PE Nesting]
103+[63] ignoreSect ::= '<![' S? 'IGNORE' S? '[' ignoreSectContents* ']]>' [VC: Proper Conditional Section/PE Nesting]
104+[64] ignoreSectContents ::= Ignore ('<![' ignoreSectContents ']]>' Ignore)*
105+[65] Ignore ::= Char* - (Char* ('<![' | ']]>') Char*)
106+[66] CharRef ::= '&#' [0-9]+ ';'
107+| '&#x' [0-9a-fA-F]+ ';' [WFC: Legal Character]
108+[67] Reference ::= EntityRef | CharRef
109+[68] EntityRef ::= '&' Name ';' [WFC: Entity Declared]
110+[VC: Entity Declared]
113+[69] PEReference ::= '%' Name ';' [VC: Entity Declared]
116+[70] EntityDecl ::= GEDecl | PEDecl
117+[71] GEDecl ::= '<!ENTITY' S Name S EntityDef S? '>'
118+[72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
119+[73] EntityDef ::= EntityValue | (ExternalID NDataDecl?)
120+[74] PEDef ::= EntityValue | ExternalID
121+[75] ExternalID ::= 'SYSTEM' S SystemLiteral
122+| 'PUBLIC' S PubidLiteral S SystemLiteral
123+[76] NDataDecl ::= S 'NDATA' S Name [VC: Notation Declared]
124+[77] TextDecl ::= '<?xml' VersionInfo? EncodingDecl S? '?>'
125+[78] extParsedEnt ::= ( TextDecl? content ) - ( Char* RestrictedChar Char* )
126+[80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' | "'" EncName "'" )
127+[81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')* /* Encoding name contains only Latin characters */
128+[82] NotationDecl ::= '<!NOTATION' S Name S (ExternalID | PublicID) S? '>' [VC: Unique Notation Name]
129+[83] PublicID ::= 'PUBLIC' S PubidLiteral