Skip to content

Instantly share code, notes, and snippets.

@shravan-kuchkula
Created July 26, 2017 19:08
Show Gist options
  • Save shravan-kuchkula/822a79fc4ff25a3d5ffd799a40d3f76c to your computer and use it in GitHub Desktop.
Save shravan-kuchkula/822a79fc4ff25a3d5ffd799a40d3f76c to your computer and use it in GitHub Desktop.
XML Mini project
<?xml version="1.0" encoding="UTF-8"?>
<TLSales xmlns="http://tlsales.com/namespace" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tlsales.com/namespace /tmp/msds7330/customer.xsd">
<Address>
<Name>Addr1</Name>
<Street>123 Main St.</Street>
<City>Seattle</City>
</Address>
<Customer OneTime="true" Regular="false" Senior="false" Discount="5">
<First>John Q.</First>
<Last>Public</Last>
<Phone>555-4566</Phone>
<Email>[email protected]</Email>
<DiscountCode>889</DiscountCode>
</Customer>
<Customer OneTime="false" Regular="true" Senior="false" Discount="10">
<First>Myrtle</First>
<Last>Philips</Last>
<Phone>555-9898</Phone>
<Email>[email protected]</Email>
<DiscountCode>22</DiscountCode>
</Customer>
<Customer OneTime="true" Regular="true" Senior="true" Discount="15">
<First>Tom</First>
<Last>Jones</Last>
<Phone>555-9823</Phone>
<Fax>555-2398</Fax>
<Email>[email protected]</Email>
<DiscountCode>483</DiscountCode>
</Customer>
</TLSales>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://tlsales.com/namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://tlsales.com/namespace" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="TLSales">
<xs:annotation>
<xs:documentation>TLSales customer schema</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Address">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Street" type="xs:string"/>
<xs:element name="City" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Customer" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="First" type="xs:string"/>
<xs:element name="Last" type="xs:string"/>
<xs:element name="Phone" type="xs:string"/>
<xs:element name="Fax" type="xs:string" minOccurs="0"/>
<xs:element name="Email" type="xs:string"/>
<xs:element name="DiscountCode">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:maxInclusive value="999"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:attribute name="OneTime" type="xs:string"/>
<xs:attribute name="Regular" type="xs:string"/>
<xs:attribute name="Senior" type="xs:string"/>
<xs:attribute name="Discount" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment