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

attribute Element


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

Syntax

<attribute
    default="default-value" 
    type="attribute-type"
    [required="{yes | no}"] > 

Attributes

default
Default value for the attribute. This specified default takes precedence over any default provided on the AttributeType element it refers to.
type
Name of an AttributeType element defined in this schema (or another schema indicated by the specified namespace). The supplied value must correspond to the name attribute on the AttributeType element. Note that the type can include a namespace prefix.
required
Indicator of whether the attribute must be present on the element. Optional if the required attribute is present on the referenced AttributeType.

Element Information

Number of occurrences Number of attribute types specified in the schema.
Parent elements ElementType
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

When the required attribute is set to "yes" and the default attribute specifies a default value, the supplied default value must always be the value, and documents containing other attribute values are invalid.

When the required attribute is set to "yes" and no default is specified, each element whose type is declared to have the attribute must supply its value.



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.