document = head, body head = about? about = element "about" {(title | attribute "url" url | author | editor | date | tag | link | serie | header)*} header = anyElem plain tag = element "tag" text author = element "author" entity editor = element "editor" entity date = element "date" {(attribute "year" xsd:int)? & (attribute "month" xsd:nat1)? & (attribute "day" xsd:nat1)?} entity = name? & (attribute "street" text)? & (attribute "zipcode" text)? & (attribute "city" text)? & (attribute "region" text)? & (attribute "country" text)? & (attribute "email" text)? & (attribute "tel" text)? & (attribute "fax" text)? & (attribute "url" url)? & (element "org" entity)? link = element "link" {name? & (attribute "href" url)? & (attribute "rel" text)? & (attribute "type" text)? & plainNode*} serie = element "serie" {name? & (attribute "id" text)?} alias = element "alias" {id?} body = (element "section" {commonAttrs, title, alias*, body} | block)* include = element "include" {(attribute "href" path)?} block = para | blockToC | blockToF | blockIndex | blockFigure | blockReferences blockToC = element "toc" {commonAttrs, (attribute "depth" xsd:nat)?} blockToF = element "tof" {commonAttrs, (element "ul" {(element "li" {element "para" text})*})?} blockIndex = element "index" {commonAttrs, (element "ul" {(element "li" {element "para" {text*}})*})?} blockFigure = element "figure" {commonAttrs, attribute "type" text, title?, para*} blockReferences = element "references" {commonAttrs, reference*} reference = element "reference" {id, (title | attribute "url" url | author | editor | date | tag | link | serie | header)*} para = paraItems | paraItem paraItem = element "ol" {(element "li" {attribute "name" text, para*})*} | element "ul" {(element "li" {para*})*} | element "artwork" {attribute "type" text, text} | element "quote" {attribute "type" text, para*} | plainNode+ | comment paraItems = element "para" {commonAttrs, paraItem*} plain = plainNode* plainNode = text | element "br" empty | element "b" plain | element "code" plain | element "del" plain | element "i" plain | element "q" plain | element "sc" plain | element "sub" plain | element "sup" plain | element "u" plain | element "note" {para*} | element "iref" {attribute "to" text, plain} | element "eref" {attribute "to" url, plain} | element "ref" {to, plain} | element "rref" {to, plain} commonAttrs = id? & class? ident = text title = element "title" plain name = attribute "name" text url = text path = text to = attribute "to" ident id = attribute "id" ident