Schema Tutorial
XSD HOME
XSD Intro
XSD Why Use
XSD How To
XSD <schema>
Simple Types
XSD Elements
XSD Attributes
XSD Restrictions
Complex Types
XSD Elements
XSD Empty
XSD Elements Only
XSD Text Only
XSD Mixed
XSD Indicators
XSD <any>
XSD <anyAttribute>
XSD Substitution
XSD Example
Data Types
XSD String
XSD Date
XSD Numeric
XSD Misc
XSD Editor
XSD Summary
References
XSD Reference
XSD Validator
Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality
W3Schools Tutorials
W3Schools Forum
Helping W3Schools
|
XML Schema union Element
Complete XML Schema Reference
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:
<xs:element name="jeans_size">
<xs:simpleType>
<xs:union memberTypes="sizebyno sizebystring" />
</xs:simpleType>
</xs:element>
<xs:simpleType name="sizebyno">
<xs:restriction base="xs:positiveInteger">
<xs:maxInclusive value="42"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="sizebystring">
<xs:restriction base="xs:string">
<xs:enumeration value="small"/>
<xs:enumeration value="medium"/>
<xs:enumeration value="large"/>
</xs:restriction>
</xs:simpleType>
|
Complete XML Schema Reference
 |

|
|
See why there are 20,000+ Ektron integrations worldwide.
Request an INSTANT DEMO or download a FREE TRIAL today. |
|
|
|
|
Jump to: Top of Page
or HOME or
Printer friendly page
W3Schools provides material for training only. We do not warrant the correctness of its contents.
The risk from using it lies entirely with the user.
While using this site, you agree to have read and accepted our
terms of use and
privacy policy.
Copyright 1999-2009 by Refsnes Data. All Rights Reserved.
|
|
|