2007-11-23 06:58:00 +00:00
|
|
|
# RELAX NG XML syntax expressed in RELAX NG Compact syntax.
|
|
|
|
|
2024-01-02 01:47:10 +00:00
|
|
|
# Copyright (C) 2003-2004, 2007-2024 Free Software Foundation, Inc.
|
2008-11-09 04:05:39 +00:00
|
|
|
|
|
|
|
# This file is part of GNU Emacs.
|
|
|
|
|
|
|
|
# GNU Emacs is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
|
|
|
|
# GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2008-11-09 04:05:39 +00:00
|
|
|
|
2007-11-23 06:58:00 +00:00
|
|
|
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+ }
|
|
|
|
|
2017-09-13 22:52:52 +00:00
|
|
|
grammarContent =
|
2007-11-23 06:58:00 +00:00
|
|
|
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" }
|
|
|
|
|
2017-09-13 22:52:52 +00:00
|
|
|
nameClass =
|
2007-11-23 06:58:00 +00:00
|
|
|
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*
|
|
|
|
|
2017-09-13 22:52:52 +00:00
|
|
|
commonAttributes =
|
2007-11-23 06:58:00 +00:00
|
|
|
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 }
|