blob: 03d7708364b73ee65b2c361e8746a1f5e294837c [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0 which is available at
http://www.eclipse.org/legal/epl-2.0,
or the Eclipse Distribution License v. 1.0 which is available at
http://www.eclipse.org/org/documents/edl-v10.php.
SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.example.org" targetNamespace="http://www.example.org" elementFormDefault="qualified" attributeFormDefault="qualified">
<xsd:complexType name="Items">
<xsd:sequence>
<xsd:sequence>
<xsd:sequence>
<xsd:element name="item" type="LineItemType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:sequence>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="usAddressType">
<xsd:complexContent>
<xsd:extension base="AddressType">
<xsd:sequence>
<xsd:element name="state" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="zip" type="xsd:int"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="AddressType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:string" default="US"/>
</xsd:complexType>
<xsd:complexType name="LineItemType">
<xsd:sequence>
<xsd:element name="productName" type="xsd:string"/>
<xsd:choice>
<xsd:element name="USPrice" type="xsd:float"/>
<xsd:sequence>
<xsd:element name="CDNPrice" type="xsd:float"/>
<xsd:element name="exchangeRate" type="xsd:float"/>
</xsd:sequence>
</xsd:choice>
<xsd:element name="shipDate" type="xsd:date"/>
<xsd:element name="comment" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="partNum" type="SKU"/>
<xsd:attribute name="quantity" type="quantityType"/>
</xsd:complexType>
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="shipTo" type="AddressType"/>
<xsd:element name="billTo" type="AddressType"/>
<xsd:element name="comment" type="xsd:string"/>
<xsd:element name="items" type="Items"/>
<xsd:element name="customer" type="CustomerType"/>
</xsd:sequence>
<xsd:attribute name="poId" type="xsd:string"/>
<xsd:attribute name="orderDate" type="xsd:date"/>
</xsd:complexType>
<xsd:complexType name="CustomerType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="gender" type="gender"/>
<xsd:element name="phoneNumber">
<xsd:simpleType>
<xsd:restriction base="xsd:int">
<xsd:length value="10"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="namePrefix">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="Dr."/>
<xsd:enumeration value="Mrs."/>
<xsd:enumeration value="Mr."/>
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="cdnAddressType">
<xsd:complexContent>
<xsd:extension base="addressType">
<xsd:sequence>
<xsd:choice>
<xsd:sequence>
<xsd:element name="province" type="xsd:string"/>
</xsd:sequence>
<xsd:element name="territory" type="xsd:string"/>
</xsd:choice>
<xsd:element name="postalcode" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
<xsd:simpleType name="gender">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="male"/>
<xsd:enumeration value="female"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="quantityType">
<xsd:restriction base="xsd:int"/>
</xsd:simpleType>
<xsd:simpleType name="SKU">
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
</xsd:schema>