Click here to Skip to main content
15,879,326 members
Articles / Programming Languages / XML

XSD Tutorial - Part 4 of 5 - Namespaces

Rate me:
Please Sign up or sign in to vote.
4.92/5 (27 votes)
3 Jul 2014CPOL7 min read 77.5K   460   53  
This article gives a basic overview of the building blocks underlying XML Schemas.
��<?xml version="1.0" encoding="utf-16"?>

<!-- Created with Liquid XML Studio 0.9.8.0 (http://www.liquid-technologies.com) -->

<xs:schema targetNamespace="http://NamespaceTest.com/CommonTypes" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <xs:complexType name="AddressType">

    <xs:sequence>

      <xs:element name="Line1" type="xs:string" />

      <xs:element name="Line2" type="xs:string" />

    </xs:sequence>

  </xs:complexType>

  <xs:simpleType name="PriceType">

    <xs:restriction base="xs:decimal">

      <xs:fractionDigits value="2" />

    </xs:restriction>

  </xs:simpleType>

  <xs:simpleType name="PaymentMethodType">

    <xs:restriction base="xs:string">

      <xs:enumeration value="VISA" />

      <xs:enumeration value="MasterCard" />

      <xs:enumeration value="Cash" />

      <xs:enumeration value="Amex" />

    </xs:restriction>

  </xs:simpleType>

</xs:schema>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Liquid Technologies
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions