Please visit our sponsors !
The union Element
Definition and Usage
The union element defines a simple type as a collection (union) of values
from specified simple data types.
Element Information
- Parent elements: simpleType
Syntax
<union
id=ID
memberTypes="list of QNames"
any attributes
>
(annotation?,(simpleType*))
</union>
|
(The ? sign declares that the element can occur zero or one time inside the
union element)
Attribute |
Description |
id |
Optional. Specifies a unique ID for the element |
memberTypes |
Optional. Specifies a list of built-in data types or
simpleType elements defined in a schema |
any attributes |
Optional. Specifies any other attributes with non-schema
namespace |
Example 1
This example shows a simple type that is a union of two simple types:
<xsd:element name="jeans_size">
<xsd:simpleType>
<xsd:union memberTypes="sizebyno sizebystring" />
</xsd:simpleType>
</xsd:element>
<xsd:simpleType name="sizebyno">
<xsd:restriction base="xsd:positiveInteger">
<xsd:maxInclusive="42"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="sizebystring">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="small"/>
<xsd:enumeration value="medium"/>
<xsd:enumeration value="large"/>
</xsd:restriction>
</xsd:simpleType>
|
Jump to: Top of Page
or HOME or
Printer friendly page
Search W3Schools:
What Others Say About Us
Does the world know about us? Check out these places:
Dogpile
Alta Vista
MSN
Google
Excite
Lycos
Yahoo
Ask Jeeves
We Help You For Free. You Can Help Us!
W3Schools is for training only. We do not warrant its correctness or its fitness for use.
The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2002 by Refsnes Data. All Rights Reserved
|