UserPreferences

ExtensibilityFrameworkGrammar


Specification: Grammar & Node Tests

NOTE: This is an attempt at a formal grammar for the ExtensibilityFramework, or EF. It is, however, a work in both flux and progress. There are Python/SAX and XSLT implementations for this grammar.

Synopsis: Compact RELAX NG Grammar

default namespace = ""
namespace atom = "http://purl.org/atom/ns#"

start = element atom:atom { XMLAtts, Property* } | Property

Property = SimpleProp | LiteralProp | ComplexLiteralProp
SimpleProp = element * { (XMLAtts, RefAttr) | (XMLAtts, RefAttr?, Property*) }
LiteralProp = element * { (XMLAtts, text) | (XMLAtts, ModeAttr, any) }
ComplexLiteralProp = element * { XMLAtts, NonSpecialAttr+, ModeAttr?, any }

RefAttr = attribute ref { xsd:anyURI }
ModeAttr = attribute mode { text }
XMLAtts = attribute xml:* { text }*
NonSpecialAttr = attribute * - (mode | ref | xml:*) { text }
any = (element * { attribute * { text }*, any } | text)* 

There is [WWW]an example of an Atom XML document that conforms to the .rnc schema above according to James Clark's [WWW]Jing. Note that xml:base and xml:lang are both supported.

Description

Terminology, for an element event e:-

The attributes @ref, @mode, and @xml:* are treated as special. Hence, non-special attributes are those which do not belong to that set. (Note that this specification only supports @xml:base and @xml:lang; all other attributes in the xml:* namespace are ignored).

start = element atom:atom { Property* } | Property 

Property = SimpleProp | LiteralProp | ComplexLiteralProp 

SimpleProp = element * { (XMLAtts, RefAttr) | (XMLAtts, RefAttr?, Property*) } 

LiteralProp = element * { (XMLAtts, text) | (XMLAtts, ModeAttr, any) } 

ComplexLiteralProp = element * { XMLAtts, NonSpecialAttr+, ModeAttr?, any } 

XPath Node Matches

For use in, e.g., XSLT. Transcribed from Sjoerd Visscher's [WWW]XSLT for AtomEF.

One may also, of course, parse the three in SimpleProp, LiteralProp, ComplexLiteralProp order, but the order above was found to produce the most readable results.