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
Whether you're new to XML or already an advanced user, the user-friendly views
and powerful entry helpers, wizards, and debuggers in XMLSpy are designed to
meet your XML and Web services development needs from start to finish.
- XML editor
- Graphical XML Schema / DTD editors
- XSLT 1.0/2.0 editor, debugger, profiler
- XQuery editor, debugger, profiler
- Support for Office Open XML (OOXML)
- Graphical WSDL editor & SOAP debugger
- Java, C#, C++ code generation
- And much more!
Download a fully functional free 30-day trial today!
|