# A RELAX NG Grammar for necho # # $Id: necho.rnc,v 1.2 2003/07/10 13:55:11 ndw Exp $ # # Author: Norman Walsh # Version: 0.1 # # Copyright (C) 2003 Norman Walsh. Permission is hereby granted to do anything # you please with this grammar. No warranty is expressed or implied. namespace local = "" namespace necho = "http://example.com/newformat#" default namespace = "http://example.com/newformat#" start = feed common.attrib = attribute xml:lang { text* }?, attribute xml:base { xsd:anyURI }?, anyForeignAttribute* feed = element feed { common.attrib, attribute version { text* }, title, subtitle, link, modified?, (entry|anyForeignElement)* } title = element title { common.attrib, text* } subtitle = element subtitle { common.attrib, text* } summary = element summary { common.attrib, text* } link = element link { common.attrib, xsd:anyURI } modified = element modified { common.attrib, xsd:dateTime } created = element created { common.attrib, xsd:dateTime } issued = element issued { common.attrib, xsd:dateTime } entry &= element entry { common.attrib, title, subtitle, summary, author, contributor*, link, id, created?, issued, modified, (content|anyForeignElement)* } contributor.content = name, homepage*, weblog* author = element author { common.attrib, contributor.content } contributor = element contributor { common.attrib, contributor.content } name = element name { common.attrib, text* } homepage = element homepage { common.attrib, xsd:anyURI } weblog = element weblog { common.attrib, xsd:anyURI } id = element id { common.attrib, xsd:anyURI } inline.content = element content { common.attrib, attribute type { text* }, attribute mode { "escaped" }?, (text|anyElement)* } outofline.content = element content { common.attrib, attribute type { text* }?, attribute src { xsd:anyURI }, empty } content = inline.content|outofline.content anyForeignElement = element * - necho:* { (attribute * { text } | text | anyForeignElement)* } anyForeignAttribute = attribute * - (necho:* | local:* | xml:*) { text } anyElement = element * { (attribute * { text } | text | anyElement)* }