home *** CD-ROM | disk | FTP | other *** search
/ MacFormat UK 160 - Disc 2 / MF_UK_160_2.iso / pc / DiscContent / Trials / oxygen / lib / oxygen.jar / builtin / nrl.rnc < prev    next >
Encoding:
Text File  |  2005-07-21  |  1.5 KB  |  73 lines

  1. default namespace = "http://www.thaiopensource.com/validate/nrl"
  2.  
  3. start =
  4.   element rules {
  5.     schemaType?,
  6.     (rule* | (attribute startMode { modeName }, mode+))
  7.   }
  8.  
  9. mode =
  10.   element mode {
  11.     attribute name { userModeName },
  12.     attribute extends { modeName }?,
  13.     rule*
  14.   }
  15.  
  16. rule =
  17.   element namespace {
  18.     attribute ns { xsd:anyURI },
  19.     ruleModel
  20.   }
  21.   | element anyNamespace { ruleModel }
  22.  
  23. ruleModel = attribute match { elementsOrAttributes }?, actions
  24.  
  25. elementsOrAttributes =
  26.   list {
  27.     ("elements", "attributes") 
  28.      | ("attributes", "elements") 
  29.      | "elements"
  30.      | "attributes"
  31.   }
  32.  
  33. actions =
  34.   noResultAction*, (noResultAction|resultAction), noResultAction*
  35.  
  36. noResultAction =
  37.   element validate {
  38.     attribute schema { xsd:anyURI },
  39.     schemaType?,
  40.     option*,
  41.     modeUsage
  42.   }
  43.   | element allow|reject { modeUsage }
  44.  
  45. resultAction =
  46.   element attach|unwrap { modeUsage }
  47.  
  48. option =
  49.   element option {
  50.     attribute name { xsd:anyURI },
  51.     attribute arg { text }?,
  52.     attribute mustSupport { xsd:boolean }?
  53.   }
  54.  
  55. modeUsage =
  56.   attribute useMode { modeName }?,
  57.   element context {
  58.     attribute path { path },
  59.     attribute useMode { modeName }?
  60.   }*
  61.  
  62. modeName = userModeName | builtinModeName
  63.  
  64. userModeName = xsd:NCName
  65. builtinModeName = "#attach" | "#allow" | "#reject" | "#unwrap"
  66.  
  67. schemaType = attribute schemaType { mediaType }
  68. mediaType = xsd:string  # should do better than this
  69. path =
  70.   xsd:string {
  71.     pattern = "\s*(/\s*)?\i\c*(\s*/\s*\i\c*)*\s*"
  72.               ~ "(|\s*(/\s*)?\i\c*(\s*/\s*\i\c*)*\s*)*"
  73.   }