Name

define — Named pattern definition

Synopsis

element define
{
 attribute name { xsd:NCName },
 ( attribute combine { “choice” | “interleave” }? ),
 (
 attribute ns { text }?,
 attribute datatypeLibrary { xsd:anyURI }?,
 attribute * - (rng:* | local:*) { text }*
 ),
 (
 ( element * - rng:* { ... }* )
 & (
 element element { ... }
 | element attribute { ... }
 | element group { ... }
 | element interleave { ... }
 | element choice { ... }
 | element optional { ... }
 | element zeroOrMore { ... }
 | element oneOrMore { ... }
 | element list { ... }
 | element mixed { ... }
 | element ref { ... }
 | element parentRef { ... }
 | element empty { ... }
 | element text { ... }
 | element value { ... }
 | element data { ... }
 | element notAllowed { ... }
 | element externalRef { ... }
 | element grammar { ... }
 )+
 )
}

Class

define-element

May be included in

div, grammar, include

Compact syntax equivalent

identifier assignMethod pattern

Description

When define is embedded in a grammar, it defines a named pattern or combines a new definition with an existing one. Named patterns are global to a grammar and can be referenced by ref in the scope of their grammar and by parentRef in the scope of the grammars directly embedded in their grammar.

When define is embedded in include, the new definition is a redefinition. It replaces the definitions from the included grammar, unless a combine attribute is specified, in which case, the definitions are combined.

Restrictions

Named patterns are always global and apply only to patterns. ...

Get RELAX NG now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.