by Eric van der Vlist is published by O'Reilly & Associates (ISBN: 0596004214)


Name

start — Start of a grammar

Synopsis

element start
{
 ( 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

start-element

May be included in

div, grammar, include

Compact syntax equivalent

start

Description

The start pattern defines the "start" of a grammar. When this grammar is used to validate a complete document, the start pattern specifies which elements can be used as the document (root) element. When this grammar is embedded in another grammar, the start pattern specifies which pattern should be applied at the location where the grammar is embedded. Like named pattern definitions, start patterns may be combined by choice or interleave and redefined when they are included in include patterns.

Example

<start>
 <element name="library">
  <oneOrMore>
   <ref name="book-element"/>
  </oneOrMore>
 </element>
</start>
<start combine="choice">
  <ref name="book-element"/>
</start>
<define name="author-element">
  <grammar>
    <start>
      <element name="author">
        <attribute name="id"/>
        <ref name="name-element"/>
        <ref name="born-element"/>
        <optional>
          <ref name="died-element"/>
        </optional>
      </element>
    </start>
    <define name="name-element">
      <element name="name">
        <text/>
      </element>
    </define>
    <define name="born-element">
      <element name="born">
        <text/>
      </element>
    </define>
    <define name="died-element">
      <element name="died">
        <text/>
      </element>
    </define>
  </grammar>
</define>

Attributes

combine

This attribute specifies how multiple definitions of start pattern should be combined. The possible values are choice and interleave.

When the combine attribute is specified and set to choice, multiple definitions of a start pattern are combined in a choice pattern. When the combine attribute is specified and set to interleave, multiple definitions of a start pattern are combined in an interleave pattern.

Note that it is forbidden to specify more than one start with the same name and no combine attribute or multiple start with different values of combine attribute.

datatypeLibrary

This attribute defines the default datatype library. The value is inherited.

ns

This attribute defines the default namespace for the elements defined in a portion of schema. The value is inherited.


This text is released under the Free Software Foundation GFDL.