[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XML BNF

  • From: "Henry S. Thompson" <ht@c...>
  • To: xml-dev@i...
  • Date: Fri, 7 Mar 97 16:40:53 GMT

xml bnf
This was taken semi-automatically from the XML source for the spec
document treated as SGML.

Tim's version thereof had some bogus PC = codes in it, which I THINK
I've removed.  There is at least one real (i.e. in the original) bug
I've noticed so far -- there should be a * after the second-last ) in
the DOCTYPE disjunct of the Markup production.

Use at your own risk.

ht
-------------
S ::= (#x0020 | #x000a | #x000d | #x0009 | #x3000)+

Character ::= #x09 | #x0A | #x0D | [#x20-#xFFFD] | [#x00010000-#x7FFFFFFF]   /* any ISO 10646 31-bit code, FFFE and FFFF excluded */

BaseChar ::= [#x41-#x5A] | [#x61-#x7A]   /* Latin 1 upper and lowercase  */
	| #xAA | #xB5 | #xBA | [#xC0-#xD6] | [#xD8-#xF6]   /* Latin 1 supplementary  */
	| [#xF8-#xFF]   /* Latin 1 supplementary  */
	| [#x0100-#x017F]   /* Extended Latin-A  */
	| [#x0180-#x01F5] | [#x01FA-#x0217]   /* Extended Latin-B  */
	| [#x0250-#x02A8]   /* IPA Extensions */
	| [#x02B0-#x02B8] | [#x02BB-#x02C1] | [#x02E0-#x02E4]   /* Spacing Modifiers */
	| #x037A | #x0386 | [#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE] | [#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0 | [#x03E2-#x03F3]   /* Greek and Coptic */
	| [#x0401-#x040C] | [#x040E-#x044F] | [#x0451-#x045C] | [#x045E-#x0481] | [#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC] | [#x04D0-#x04EB] | [#x04EE-#x04F5] | [#x04F8-#x04F9]   /* Cyrillic */
	| [#x0531-#x0556] | [#x0559-#x055A] | [#x0561-#x0587]   /* Armenian */
	| [#x05D0-#x05EA] | [#x05F0-#x05F2]   /* Hebrew */
	| [#x0621-#x063A] | [#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] | [#x06C0-#x06CE] | [#x06D0-#x06D3] | [#x06D5-#x06D6] | [#x06E5-#x06E6]   /* Arabic */
	| [#x0905-#x0939] | #x093D | [#x0958-#x0961]   /* Devanagari */
	| #x0981 | [#x0985-#x098C] | [#x098F-#x0990] | [#x0993-#x09A8] | [#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9] | [#x09DC-#x09DD] | [#x09DF-#x09E1] | [#x09F0-#x09F1]   /* Bengali */
	| [#x0A05-#x0A0A] | [#x0A0F-#x0A10] | [#x0A13-#x0A28] | [#x0A2A-#x0A30] | [#x0A32-#x0A33] | [#x0A35-#x0A36] | [#x0A38-#x0A39]   /* Gurmukhi */
	| [#x0A8F-#x0A91] | [#x0A93-#x0AA8] | [#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0AE0   /* Gujarati */
	| [#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] | [#x0B2A-#x0B30] | [#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D | [#x0B5C-#x0B5D] | [#x0B5F-#x0B61]   /* Oriya */
	| [#x0B85-#x0B8A] | [#x0B8E-#x0B90] | [#x0B92-#x0B95] | [#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4] | [#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9]   /* Tamil */
	| [#x0C05-#x0C0C] | [#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33] | [#x0C35-#x0C39] | [#x0C60-#x0C61]   /* Telugu */
	| [#x0C85-#x0C8C] | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] | [#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] | #x0CDE | [#x0CE0-#x0CE1]   /* Kannada */
	| [#x0D05-#x0D0C] | [#x0D0E-#x0D10] | [#x0D12-#x0D28] | [#x0D2A-#x0D39] | [#x0D60-#x0D61]   /* Malayalam */
	| [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33] | [#x0E40-#x0E45]   /* Thai */
	| [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88] | #x0E8A | #x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F] | [#x0EA1-#x0EA3] | #x0EA5 | #x0EA7 | [#x0EAA-#x0EAB] | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] | #x0EBD | [#x0EC0-#x0EC4] | [#x0EDC-#x0EDD]   /* Lao */
	| [#x0F40-#x0F47] | [#x0F49-#x0F69]   /* Tibetan */
	| [#x10A0-#x10C5] | [#x10D0-#x10F6]   /* Georgian */
	| [#x1100-#x1159] | [#x115F-#x11A2] | [#x11A8-#x11F9]   /* Hangul Jamo */
	| [#x1E00-#x1E9B] | [#x1EA0-#x1EF9]   /* Add'l Extended Latin */
	| [#x1F00-#x1F15] | [#x1F18-#x1F1D] | [#x1F20-#x1F45] | [#x1F48-#x1F4D] | [#x1F50-#x1F57] | #x1F59 | #x1F5B | #x1F5D | [#x1F5F-#x1F7D] | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE | [#x1FC2-#x1FC4] | [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] | [#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC]   /* Greek Extensions */
	| #x207F   /* Super-, subscripts */
	| #x2102 | #x2107 | [#x210A-#x2113] | #x2115 | [#x2118-#x211D] | #x2124 | #x2126 | #x2128 | [#x212A-#x212D] | [#x212F-#x2131] | [#x2133-#x2138]   /* Letterlike Symbols */
	| [#x2160-#x2182]   /* Number forms */
	| [#x3041-#x3094]   /* Hiragana */
	| [#x30A1-#x30FA]   /* Katakana */
	| [#x3105-#x312C]   /* Bopomofo */
	| [#x3131-#x318E]   /* Hangul Jamo */
	| [#xAC00-#xD7A3]
	| [#xFB00-#xFB06] | [#xFB13-#xFB17] | [#xFB1F-#xFB28] | [#xFB2A-#xFB36] | [#xFB38-#xFB3C] | #xFB3E | [#xFB40-#xFB41] | [#xFB43-#xFB44] | [#xFB46-#xFB4F]   /* Alphabetic presentation forms */
	| [#xFB50-#xFBB1] | [#xFBD3-#xFD3D] | [#xFD50-#xFD8F] | [#xFD92-#xFDC7] | [#xFDF0-#xFDF8] | [#xFE70-#xFE72] | #xFE74 | [#xFE76-#xFEFC]   /* Arabic presentation forms */
	| [#xFF21-#xFF3A] | [#xFF41-#xFF5A] | [#xFF66-#xFF6F] | [#xFE71-#xFF9D] | [#xFFA0-#xFFBE] | [#xFFC2-#xFFC7] | [#xFFCA-#xFFCF] | [#xFFD2-#xFFD7] | [#xFFDA-#xFFDC]   /* Half- and fullwidth forms */

Ideographic ::= [#x4E00-#x9FA5] | [#xF900-#xFA2D] | #x3007 | [#x3021-#x3029]

CombiningChar ::= [#x0300-#x0361] | [#x0483-#x0486] | [#x0591-#x05C4] | [#x064B-#x0652] | #x0670 | [#x06D7-#x06DC] | [#x06DD-#x06DF] | [#x06E0-#x06E4] | [#x06E7-#x06E8] | [#x06EA-#x06ED] | [#x0901-#x0903] | [#x093E-#x094C] | #x094D | [#x0951-#x0954] | [#x0962-#x0963] | [#x0981-#x0983] | #x09BC | #x09BE | #x09BF | [#x09C0-#x09C4] | [#x09C7-#x09C8] | [#x09CB-#x09CD] | #x09D7 | [#x09E2-#x09E3] | #x0A02 | #x0A3C | #x0A3E | #x0A3F | [#x0A40-#x0A42] | [#x0A47-#x0A48] | [#x0A4B-#x0A4D] | [#x0A70-#x0A71] | [#x0A81-#x0A83] | #x0ABC | [#x0ABE-#x0AC5] | [#x0AC7-#x0AC9] | #x0ACB | #x0ACC | [#x0B01-#x0B03] | #x0B3C | [#x0B3E-#x0B43] | [#x0B47-#x0B48] | [#x0B4B-#x0B4C] | [#x0B56-#x0B57] | [#x0B82-#x0B83] | [#x0BBE-#x0BC2] | [#x0BC6-#x0BC8] | [#x0BCA-#x0BCC] | #x0BD7 | [#x0C01-#x0C03] | [#x0C3E-#x0C44] | [#x0C46-#x0C48] | [#x0C4A-#x0C4D] | [#x0C55-#x0C56] | [#x0C82-#x0C83] | [#x0CBE-#x0CC4] | [#x0CC6-#x0CC8] | [#x0CCA-#x0CCC] | [#x0CD5-#x0CD6] | [#x0D02-#x0D03] | [#x0D3E-#x0D43] | [#x0D46-!
 #x0D48] | [#x0D4A-#x0D4C] | #x0D57 | #x0E31 | [#x0E34-#x0E3A] | [#x0E47-#x0E4E] | #x0EB1 | [#x0EB4-#x0EB9] | [#x0EBB-#x0EBC] | [#x0EC8-#x0ECD] | [#x0F18-#x0F19] | #x0F35 | #x0F37 | #x0F39 | #x0F3E | #x0F3F | [#x0F71-#x0F84] | [#x0F86-#x0F8B] | [#x0F90-#x0F95] | #x0F97 | [#x0F99-#x0FAD] | [#x0FB1-#x0FB7] | #x0FB9 | [#x20D0-#x20DC]   | #x20E1 | [#x302A-#x302F] | #x3099 | #x309A | #xFB1E | [#xFE20-#xFE23]

Letter ::= (BaseChar CombiningChar*) | Ideographic

Digit ::= [#x0030-#x0039]   /* ISO 646 digits  */
	| [#x0660-#x0669]   /* Arabic-Indic digits  */
	| [#x06F0-#x06F9]   /* Eastern Arabic-Indic digits  */
	| [#x0966-#x096F]   /* Devanagari digits  */
	| [#x09E6-#x09EF]   /* Bengali digits  */
	| [#x0A66-#x0A6F]   /* Gurmukhi digits  */
	| [#x0AE6-#x0AEF]   /* Gujarati digits  */
	| [#x0B66-#x0B6F]   /* Oriya digits  */
	| [#x0BE7-#x0BEF]   /* Tamil digits (no zero)  */
	| [#x0C66-#x0C6F]   /* Telugu digits  */
	| [#x0CE6-#x0CEF]   /* Kannada digits  */
	| [#x0D66-#x0D6F]   /* Malayalam digits  */
	| [#x0E50-#x0E59]   /* Thai digits  */
	| [#x0ED0-#x0ED9]   /* Lao digits  */
	| [#x0F20-#x0F29]   /* Tibetan digits  */
	| [#xFF10-#xFF19]   /* Fullwidth digits */

Ignorable ::= [#x200C-#x200F]   /* zw layout */
	| [#x202A-#x202E]   /* bidi formatting */
	| [#x206A-#x206F]   /* alt formatting */
	| #xFEFF   /* zw nonbreak space */

Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] | [#x309B-#x309E] | [#x30FC-#x30FE] | #xFF70 | #xFF9E | #xFF9F

MiscName ::= '.' | Ignorable | Extender

NameChar ::= Letter | Digit | MiscName

Name ::= (Letter | '-') (NameChar)*

Nmtoken ::= (NameChar)+

Nmtokens ::= Nmtoken (S Nmtoken)*

Literal ::= '"' ([^"] | PEReference | CharRef)* '"' | "'" ([^'] | PEReference | CharRef)* "'"

QuotedCData ::= '"' ([^"<] | Reference)* '"' | "'" ([^'<] | Reference)* "'"

Trivial ::= (PCData | Markup)*

Eq ::= S? '=' S?

Markup ::= '<' Name (S Name Eq QuotedCData)* S? '>'   /* start-tags  */
	| '</' Name S? '>'   /* end-tags  */
	| '<' Name (S Name Eq QuotedCData)* S? '/>'   /* empty elements */
	| '&' Name ';'   /* entity references  */
	| '&#' [0-9]+ ';'   /* character references  */
	| '&u-' Hex4 ';'   /* character references  */
	| '<!--' [^-]* ('-' [^-]+)* '-->'   /* comments  */
	| '<![CDATA[' CData ']]>'   /* CDATA sections */
	| '<!DOCTYPE' [^]]+ ('[' (('<--' [^-]* ('-' [^-]+)* '-->') | ('"' [^"]* '"') | ("'" [^']* "'") | conditionalSect | [^]]* ) ']')? '>'   /* doc type declaration */
	| '<?' [^?]* ('?' [^>]+)* '?>'   /* processing instructions  */

PCData ::= [^<&]*

Comment ::= '<!--' [^-]* ('-' [^-]+)* '-->'

PI ::= '<?' Name S [^?]* ('?' [^>]+)* '?>'

CDSect ::= CDStart CData CDEnd

CDStart ::= '<![CDATA['

CData ::= [^]]* (((']' ([^]])) | (']]' [^>])) [^]]*)*

CDEnd ::= ']]>'

document ::= Prolog element Misc*

Prolog ::= XMLDecl Misc* doctypedecl? Misc*

XMLDecl ::= '<?XML' VersionInfo EncodingDecl? RMDecl? S? '?>'

VersionInfo ::= S 'version' Eq ('"1.0"' | "'1.0'")

Misc ::= Comment | PI | S

doctypedecl ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' internalsubset* ']' S?)? '>'

internalsubset ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PEReference | conditionalSect | PI | S | Comment

RMDecl ::=  'RMD' Eq ('NONE' | 'INTERNAL' | 'ALL') 

STag ::= '<' Name (S Attribute)* S? '>'

Attribute ::= Name Eq QuotedCData

ETag ::= '</' Name S? '>'

EmptyElement ::= '<' Name (S Attribute)* S? '/>';

content ::= (element | PCData | Reference | CDSect | PI | Comment)*

element ::= EmptyElement   /* empty elements  */
	| STag content ETag

elementdecl ::= '<!ELEMENT' S Name S ('EMPTY' | 'ANY' | Mixed | elements) S? '>'

Mixed ::= '(' S? '#PCDATA' ( S? '|' S? Name )* S? ')*' 
	| '(' S? '#PCDATA' S? ')'

elements ::= (choice | seq) ('?' | '*' | '+')?

cp ::= (Name | choice | seq) ('?' | '*' | '+')?

cps ::= S? cp S?

choice ::= '(' cps ('|' cps)+ ')'

seq ::= '(' cps (',' cps)* ')'

AttlistDecl ::= '<!ATTLIST' S Name AttDef+ S? '>'

AttDef ::= S Name S AttType S Default

AttType ::= StringType | TokenizedType | EnumeratedType

StringType ::= 'CDATA'

TokenizedType ::= 'ID'

EnumeratedType ::= NotationType | Enumeration

NotationType ::= 'NOTATION' S '(' S? Name (S? '|' S? Name)* S? ')'

Enumeration ::= '(' S? Nmtoken (S? '|' S? Nmtoken)* S? ')'

Default ::= '#REQUIRED' | '#IMPLIED' | ('#FIXED'? QuotedCData)

conditionalSect ::= '<![' CSKey '[' csdata ']]>'

CSKey ::= PEReference | 'INCLUDE' | 'IGNORE'

csdata ::= internalsubset

Hex ::= [0-9a-fA-F]

Hex4 ::= Hex Hex Hex Hex

CharRef ::= '&#' [0-9]+ ';' | '&u-' Hex4 ';'

Reference ::= EntityRef | CharRef

EntityRef ::= '&' Name ';'

PEReference ::= '%' Name ';'

EntityDecl ::= '<!ENTITY' S Name S EntityDef S? '>'   /* General entities */
	| '<!ENTITY' S '%' S Name S EntityDef S? '>'   /* Parameter entities */

EntityDef ::= Literal | ExternalDef;

ExternalDef ::= ExternalID NDataDecl?

ExternalID ::= 'SYSTEM' S SystemLiteral

SystemLiteral ::= '"' [^"]* '"' | "'" [^']* "'"

NDataDecl ::= S 'NDATA' S Name

EncodingDecl ::=  S 'encoding' Eq QEncoding 

EncodingPI ::= '<?XML' S 'encoding' Eq QEncoding S? '?>'

QEncoding ::= '"' Encoding '"' | "'" Encoding "'"

Encoding ::= LatinName

LatinName ::= [A-Za-z] ([A-Za-z0-9] | '-' | '.')*   /* Name comprising only Latin characters */

NotationDecl ::= '<!NOTATION' S Name S ExternalID S? '>'

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


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.