#$Id: nvdlSimple.rnc,v 1.1 2007/01/31 02:41:34 makoto Exp $ # # schema and message are annotation-free. namespace local = "" default namespace nvdl = "http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0" start = element rules { attribute startMode { xsd:NCName }, trigger*, mode+ } trigger = element trigger { attribute ns { xsd:string }, attribute nameList { list { xsd:NCName } } } mode = element mode { attribute name { xsd:NCName }, rule* } rule = element namespace { attribute ns { xsd:string }, attribute wildCard {xsd:string{maxLength = "1"}}, ruleModel } | element anyNamespace { ruleModel } ruleModel = attribute match { elementsOrAttributes }, actions elementsOrAttributes = "elements" | "attributes" actions = (noResultAction*, (noResultAction|resultAction), noResultAction*) noResultAction = element validate { schemaType?, (message | option)*, schema, modeUsage } schema = attribute schema { xsd:anyURI } | element schema {(text | foreignElement)} message = element message {text & attribute xml:lang {text}?} resultAction = element attach|attachPlaceholder|unwrap { message*, modeUsage } option = element option { attribute name { xsd:anyURI }, attribute arg { text }?, attribute mustSupport { xsd:boolean } } modeUsage = attribute useMode { xsd:NCName }, element context { attribute path { path }, attribute useMode { xsd:NCName } }* schemaType = attribute schemaType { mediaType } ## 5.1 of RFC 2045 allows , where ## ## tspecials := "(" / ")" / "<" / ">" / "@" / ## "," / ";" / ":" / "\" / <"> ## "/" / "[" / "]" / "?" / "=" ## mediaType = xsd:string { pattern = "\s*" ~ "[0-9A-Za-z!#$%&'\*\+\-\.\^_`\{\|\}~]*" ~ "/" ~ "[0-9A-Za-z!#$%&'\*\+\-\.\^_`\{\|\}~]*" ~ "\s*"} path = xsd:string { pattern = "\s*(/\s*)?\i\c*(\s*/\s*\i\c*)*\s*" ~ "(\|\s*(/\s*)?\i\c*(\s*/\s*\i\c*)*\s*)*" } foreignElement = element (* - nvdl:*) {attribute * {text}*, mixed{anyElement*}} anyElement = element * {attribute * {text}*, mixed{anyElement*}}