Name

xs:attribute(reference or local definition) — Reference to a global attribute definition or local definition (local definitions cannot be referenced).

Synopsis

<xs:attribute
           default        = xs:string
           fixed          = xs:string
           form           = ( “qualified” | “unqualified” )
           id             = xs:ID
           name           = xs:NCName
           ref            = xs:QName
           type           = xs:QName
           use            = ( “prohibited” | “optional” | “required” ) : “optional”
           {any attributes with non-schema namespace}
           >
           Content: ((xs:annotation?), (xs:simpleType?))
</xs:attribute>

May be included in: xs:attributeGroup (global definition), xs:complexType (local definition), xs:complexType (global definition), xs:extension (complex content), xs:extension (simple content), xs:restriction (complex content), xs:restriction (simple content)

Description

This element serves two different purposes and has two different content models for these two purposes: it can either be a reference to a globally defined attribute or it can be a local attribute definition. These options are mutually exclusive.

When used as a reference to an attribute, the ref attribute must contain the qualified name of the attribute (with its namespace prefix).

When used as a local definition, the definition is done by assigning a simple datatype to the attribute. This assignment can be done either by reference, using the type attribute to refer to a simple datatype by its qualified name, or inline, by embedding the definition of the simple type (xs:simpleType element) within the xs:attribute element.

Restrictions

Locally ...

Get XML Schema 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.