Lists Home |
Date Index |
- From: Chris Hubick <email@example.com>
- To: firstname.lastname@example.org
- Date: Mon, 3 Aug 1998 16:47:33 +0000 (GMT)
The following is an attempt to construct BNF productions for XML in the
internal and external DTD subsets. These productions should reflect what
can occur in an XML file before any processing has occured. Basically I
am trying to figure out, in a well formed XML document, what can an XML
processor encounter while parsing any given section/production of
document. So I just went through the productions and added PEReferences
wherever one might occur (all over the place). I think the whitespace
appended to PE's when included (sec 4.4.8) helps make this a little
easier. As I understand it, a parser does NOT have to deal with:
<!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
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:
 EntityValue ::= '"' ([^%&"] | Reference)* '"' | "'" ([^%&'] | Reference)* "'"
External DTD subset:
 EntityValue ::= '"' ([^%&"] | PEReference | Reference)* '"' | "'" ([^%&'] | PEReference | Reference)* "'"
 AttValue ::= '"' ([^<&"] | Reference | PEReference)* '"' | "'" ([^<&'] | Reference | PEReference)* "'"
 elementdecl ::= '<!ELEMENT' S (Name | PEReference) S contentspec S? '>'
 contentspec ::= 'EMPTY' | 'ANY' | Mixed | children | PEReference
 children ::= (choice | seq | PEReference) ('?' | '*' | '+')?
 cp ::= (Name | choice | seq | PEReference) ('?' | '*' | '+')?
 AttlistDecl ::= '<!ATTLIST' S (Name | PEReference) (AttDef | PEReference)* S? '>'
 AttDef ::= S (Name | PEReference) S AttType S DefaultDecl
 AttType ::= StringType | TokenizedType | EnumeratedType | PEReference
 StringType ::= 'CDATA' | PEReference
 TokenizedType ::= 'ID' | 'IDREF' | 'IDREFS' | 'ENTITY' | 'ENTITIES' | 'NMTOKEN' | NMTOKENS' | PEReference
 EnumeratedType ::= NotationType | Enumeration | PEReference
 NotationType ::= ('NOTATION' | PEReference) S '(' S? (Name | PEReference) (S? '|' S? (Name | PEReference))* S? ')'
 Enumeration ::= '(' S? (Nmtoken | PEReference) (S? '|' S? (Nmtoken | PEReference))* S? ')'
 DefaultDecl ::= '#REQUIRED' | '#IMPLIED' | PEReference | (('#FIXED' S)? AttValue)
 GEDecl ::= '<!ENTITY' S (Name | PEReference) S EntityDef S? '>'
 PEDecl ::= '<!ENTITY' S '%' S Name S PEDef S? '>'
 EntityDef ::= EntityValue | PEReference | (ExternalID NDataDecl?)
 PEDef ::= EntityValue | ExternalID | PEReference
 ExternalID ::= ('SYSTEM' | PEReference) S (SystemLiteral | PEReference) | ('PUBLIC' | PEReference) S (PubidLiteral | PEReference) S (SystemLiteral | PEReference)
 NDataDecl ::= S ('NDATA' | PEReference) S (Name | PEReference)
 NotationDecl ::= '<!NOTATION' S (Name | PEReference) S (ExternalID | PublicID | PEReference) S? '>'
 PublicID ::= ('PUBLIC' | PEReference) S (PubidLiteral | PEReference)
xml-dev: A list for W3C XML Developers. To post, mailto:email@example.com
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:firstname.lastname@example.org the following message;
To subscribe to the digests, mailto:email@example.com the following message;
List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)