view etc/schema/relaxng.rnc @ 96126:fcd827c4a553

Fix up docstring conventions. Move vars to before their first use. (rst-mode): Don't mess with font-lock-support-mode. (rst-suggest-new-decoration, rst-adjust-decoration): Avoid CL's copy-list. (rst-delete-entire-line): Use line-beginning-position. (rst-position): New fun. (rst-straighten-decorations): Use it instead of CL's position. (rst-straighten-bullets-region): Avoid CL's mapcar*. (rst-toc-mode): Use define-derived-mode. (rst-iterate-leftmost-paragraphs, rst-iterate-leftmost-paragraphs-2): Remove unused var `in-par'. Use `point' rather than `point-marker'. (rst-line-block-region): Reduce redundancy. Use the `pfxarg' arg. (rst-replace-lines): Simplify.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 20 Jun 2008 17:53:42 +0000
parents 38f93f3d00a2
children ef31eb276c4b
line wrap: on
line source

# RELAX NG XML syntax expressed in RELAX NG Compact syntax.

default namespace rng = "http://relaxng.org/ns/structure/1.0"
namespace local = ""
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes"

start = pattern

pattern =
  element element { (nameQName | nameClass), (common & pattern+) }
  | element attribute { (nameQName | nameClass), (common & pattern?) }
  | element group|interleave|choice|optional
            |zeroOrMore|oneOrMore|list|mixed { common & pattern+ }
  | element ref|parentRef { nameNCName, common }
  | element empty|notAllowed|text { common }
  | element data { type, param*, (common & exceptPattern?) }
  | element value { commonAttributes, type?, xsd:string }
  | element externalRef { href, common }
  | element grammar { common & grammarContent* }

param = element param { commonAttributes, nameNCName, xsd:string }

exceptPattern = element except { common & pattern+ }

grammarContent = 
  definition
  | element div { common & grammarContent* }
  | element include { href, (common & includeContent*) }

includeContent =
  definition
  | element div { common & includeContent* }

definition =
  element start { combine?, (common & pattern+) }
  | element define { nameNCName, combine?, (common & pattern+) }

combine = attribute combine { "choice" | "interleave" }

nameClass = 
  element name { commonAttributes, xsd:QName }
  | element anyName { common & exceptNameClass? }
  | element nsName { common & exceptNameClass? }
  | element choice { common & nameClass+ }

exceptNameClass = element except { common & nameClass+ }

nameQName = attribute name { xsd:QName }
nameNCName = attribute name { xsd:NCName }
href = attribute href { xsd:anyURI }
type = attribute type { xsd:NCName }

common = commonAttributes, foreignElement*

commonAttributes = 
  attribute ns { xsd:string }?,
  attribute datatypeLibrary { xsd:anyURI }?,
  foreignAttribute*

foreignElement = element * - rng:* { (anyAttribute | text | anyElement)* }
foreignAttribute = attribute * - (rng:*|local:*) { text }
anyElement = element * { (anyAttribute | text | anyElement)* }
anyAttribute = attribute * { text }