<staff>

A group of equidistant horizontal lines on which notes are placed in order to represent pitch or a grouping element for individual 'strands' of notes, rests, etc. that may or may not actually be rendered on staff lines; that is, both diastematic and non-diastematic signs.
Module
Attributes
@label, @n, @type, @xml:id
@label(optional)Captures text to be used to generate a label for the element to which it’s attached, a "tool tip" or prefatory text, for example. Should not be used to record document content. Value is plain text.
@n(optional)Provides a numeric designation that indicates an element’s position in a sequence of similar elements. Its value must be a non-negative integer. Value is a positive integer, including 0.
@type(optional)Designation which characterizes the element in some sense, using any convenient classification scheme or typology that employs single-token labels. One or more values of datatype NMTOKEN, separated by spaces.
@xml:id(optional)Regularizes the naming of an element and thus facilitates building links between it and other resources. Each id attribute within a document must have a unique value. Value is a valid xml:id.
(MEI.shared) Attributes that form the basis of the att.common class.
(MEI.shared) Attributes that uniquely identify an element.
@xml:id(optional)Regularizes the naming of an element and thus facilitates building links between it and other resources. Each id attribute within a document must have a unique value. Value is a valid xml:id.
(MEI.shared)
@label(optional)Captures text to be used to generate a label for the element to which it’s attached, a "tool tip" or prefatory text, for example. Should not be used to record document content. Value is plain text.
(MEI.shared) Attributes used to supply an integer number designation for an element.
@n(optional)Provides a numeric designation that indicates an element’s position in a sequence of similar elements. Its value must be a non-negative integer. Value is a positive integer, including 0.
(MEI.shared) Attributes which can be used to classify features.
@type(optional)Designation which characterizes the element in some sense, using any convenient classification scheme or typology that employs single-token labels. One or more values of datatype NMTOKEN, separated by spaces.
(MEI.visual) Visual domain attributes.
@label(optional)Captures text to be used to generate a label for the element to which it’s attached, a "tool tip" or prefatory text, for example. Should not be used to record document content. Value is plain text.
@n(optional)Provides a numeric designation that indicates an element’s position in a sequence of similar elements. Its value must be a non-negative integer. Value is a positive integer, including 0.
@type(optional)Designation which characterizes the element in some sense, using any convenient classification scheme or typology that employs single-token labels. One or more values of datatype NMTOKEN, separated by spaces.
@xml:id(optional)Regularizes the naming of an element and thus facilitates building links between it and other resources. Each id attribute within a document must have a unique value. Value is a valid xml:id.
Member of
model.staffLikeGroups elements that function like staves.
Contained By
(MEI.shared) Groups elements that function like staves.
(MEI.cmn) Groups elements that may appear within a CMN measure.
<measure>Unit of musical time consisting of a fixed number of note values of a given type, as determined by the prevailing meter, and delimited in musical notation by bar lines.
<measure>Unit of musical time consisting of a fixed number of note values of a given type, as determined by the prevailing meter, and delimited in musical notation by bar lines.
May Contain
(MEI.shared) Groups annotation-like elements.
(MEI.shared) Groups milestone-style elements found in music notation.
<sb>An empty formatting element that forces musical notation to begin on a new line.
(MEI.shared) Groups page beginning-like elements.
<pb>An empty formatting element that forces text to begin on a new page.
(MEI.shared) Collects elements that express a relationship.
(MEI.shared) Groups elements that permit declaration of staff properties.
<staffDef>Container for staff meta-information.
(MEI.shared) Groups elements that are components of a staff.
(MEI.cmn) Groups elements that function like ossia.
(MEI.shared) Groups elements that function as notational layers within a staff.
<layer>An independent stream of events on a staff.
<layer>An independent stream of events on a staff.
<pb>An empty formatting element that forces text to begin on a new page.
<sb>An empty formatting element that forces musical notation to begin on a new line.
<staffDef>Container for staff meta-information.
Remarks

The @def attribute may be used to create a connection with a <staffDef> element where logical and visual information about the staff is recorded. Alternatively, the @n attribute may be used as a reference to a <staffDef> element with the same value in its @n attribute or the staff may contain a staffDef element that defines it. If neither @def nor @n attributes are present, then the encoding order of the staves is presumed to match the encoding order of the staff definitions.

Constraints

There must be a preceding staffDef with a matching value of @n, a preceding staff with a matching @n value containing a staffDef, or a staffDef child element.

Declaration
<elementSpec rend="add" ident="staff" module="MEI.shared">
<desc xml:lang="en">A group of equidistant horizontal lines on which notes are placed in order to represent pitch or a grouping element for individual 'strands' of notes, rests, etc. that may or may not actually be rendered on staff lines; that is, both diastematic and non-diastematic signs.</desc>
<classes>
<memberOf key="att.basic"/>
<memberOf key="att.labelled"/>
<memberOf key="att.nInteger"/>
<memberOf key="att.typed"/>
<memberOf key="att.staff.vis"/>
<memberOf key="model.staffLike"/>
</classes>
<content>
<zeroOrMore>
<choice>
<ref name="model.annotLike"/>
<ref name="model.appLike"/>
<ref name="model.editLike"/>
<ref name="model.relationLike"/>
<ref name="model.staffDefLike"/>
<ref name="model.staffPart"/>
</choice>
</zeroOrMore>
</content>
<constraintSpec ident="checkStaff_n" scheme="schematron">
<constraint>
<sch:rule context="mei:staff[@n]">
<sch:let name="thisstaff" value="@n"/>
<sch:assert test="preceding::mei:staffDef[@n=$thisstaff] or preceding::mei:staff[@n=$thisstaff]/mei:staffDef or mei:staffDef">There must be a preceding staffDef with a matching value of @n, a preceding staff with a matching @n value containing a staffDef, or a staffDef child element.</sch:assert>
</sch:rule>
</constraint>
</constraintSpec>
<remarks xml:lang="en">
<p>The <att>def</att> attribute may be used to create a connection with a <gi scheme="MEI">staffDef</gi> element where logical and visual information about the staff is recorded. Alternatively, the <att>n</att> attribute may be used as a reference to a <gi scheme="MEI">staffDef</gi> element with the same value in its <att>n</att> attribute or the staff may contain a staffDef element that defines it. If neither <att>def</att> nor <att>n</att> attributes are present, then the encoding order of the staves is presumed to match the encoding order of the staff definitions.</p>
</remarks>
</elementSpec>