OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   External DTD Grammar

[ Lists Home | Date Index | Thread Index ]
  • From: Chris Hubick <maillist@chris.hubick.com>
  • To: xml-dev@ic.ac.uk
  • 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
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/



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS