Click to return to the XML (Extensible Markup Language) home page    
description Element     ElementType Element     XML Schema Preview    
Web Workshop  |  XML (Extensible Markup Language)

element Element


Refers to a declared element type that can appear within the scope of the named ElementType element.

Syntax

<element
    type="element-type" 
    [minOccurs="{0 | 1}"] 
    [maxOccurs="{1 | *}"] 
>

Attributes

type
Name of an ElementType element defined in this schema (or another schema indicated by the specified namespace). The supplied value must correspond to the name attribute on the ElementType element. Note that the type can include a namespace prefix.
minOccurs
Optional. Minimum number of times the reference element type can occur on the element. The following values can be assigned to this attribute.
0 When the minimum value is zero, the specified element is not required; the element is optional.
1 The specified element must occur at least once.
maxOccurs
Optional. Maximum number of times the element can occur on the element. The following values can be assigned to this attribute.
1 Can occur at most once.
* Unlimited number of occurrences.

Element Information

Number of occurrences Number of element types defined in the schema.
Parent elements ElementType, group
Child elements (No child elements)
Requires closing tag Yes. XML Schema is an XML grammar and, like all XML grammars, all tags must have closing tags to satisfy the definition of well-formed.

Remarks

ElementType declarations can constrain the content and attributes that appear in elements of the named type by referring to other element type or attribute type declarations.

The minOccurs and maxOccurs attributes have the default value "1." An element with neither attribute specified uses these default values and therefore must appear once and only once in a content model.



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.