<!ENTITY % endecls '<!ENTITY'>
%endecls; % example 'test'>
This is not well formed, right? (please say yes)
How do other parsers deal with this? A PEReference preprocessor? A
preprocessor is hard, because what your preprocessing depends on the
results of the actual processing that would occur after the preprocessor
finished.
The following represent productions in the XML specification which need to
be changed to meet this goal.
I don't really know what I am doing here, I just threw this together in
5 minutes and I am doing it to generate feedback.
So am I completely off my rocker?
Help and guidance much appreciated, thanks!
----------------------
Internal DTD Subset:
[9] EntityValue ::= '"' ([^%&"] | Reference)* '"' | "'" ([^%&'] | Reference)* "'"
External DTD subset:
[9] EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' | "'" ([^%&'] | PEReference | Reference)* "'"
[10] AttValue ::= '"' ([^<&"] | Reference | PEReference)* '"' | "'" ([^<&'] | Reference | PEReference)* "'"
[45] elementdecl ::= '<!ELEMENT' S (Name | PEReference) S contentspec S? '>'
[46] contentspec ::= 'EMPTY' | 'ANY' | Mixed | children | PEReference
[47] children ::= (choice | seq | PEReference) ('?' | '*' | '+')?
[48] cp ::= (Name | choice | seq | PEReference) ('?' | '*' | '+')?
[52] AttlistDecl ::= '<!ATTLIST' S (Name | PEReference) (AttDef | PEReference)* S? '>'
[53] AttDef ::= S (Name | PEReference) S AttType S DefaultDecl
[54] AttType ::= StringType | TokenizedType | EnumeratedType | PEReference
[55] StringType ::= 'CDATA' | PEReference
[56] TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | NMTOKENS' | PEReference
[57] EnumeratedType ::= NotationType | Enumeration | PEReference
[58] NotationType ::= ('NOTATION' | PEReference) S '(' S? (Name | PEReference) (S? '|' S? (Name | PEReference))* S? ')'
[59] Enumeration ::= '(' S? (Nmtoken | PEReference) (S? '|' S? (Nmtoken | PEReference))* S? ')'
[60] DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | PEReference | (('#FIXED' S)? AttValue)
[71] GEDecl ::= '<!ENTITY' S (Name | PEReference) S EntityDef S? '>'
[72] PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
[73] EntityDef ::= EntityValue | PEReference | (ExternalID NDataDecl?)
[74] PEDef ::= EntityValue | ExternalID | PEReference
[75] ExternalID ::= ('SYSTEM' | PEReference) S (SystemLiteral | PEReference) | ('PUBLIC' | PEReference) S (PubidLiteral | PEReference) S (SystemLiteral | PEReference)
[76] NDataDecl ::= S ('NDATA' | PEReference) S (Name | PEReference)
[82] NotationDecl ::= '<!NOTATION' S (Name | PEReference) S (ExternalID | PublicID | PEReference) S? '>'
[83] PublicID ::= ('PUBLIC' | PEReference) S (PubidLiteral | PEReference)
--- Chris Hubick mailto:chris@hubick.com http://www.hubick.com/