Click here to Skip to main content
15,881,139 members
Articles / Programming Languages / XML

XSD Tutorial - Part 1 of 5 - Elements and Attributes

Rate me:
Please Sign up or sign in to vote.
4.95/5 (84 votes)
3 Jul 2014CPOL9 min read 279.6K   2.3K   226  
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 xmlns:cmn="http://NamespaceTest.com/CommonTypes" elementFormDefault="qualified" targetNamespace="http://NamespaceTest.com/OrderTypes" xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:import schemaLocation="CommonTypes.xsd" namespace="http://NamespaceTest.com/CommonTypes" />

  <xs:complexType name="OrderType">

    <xs:sequence>

      <xs:element maxOccurs="unbounded" name="Item">

        <xs:complexType>

          <xs:sequence>

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

            <xs:element name="Quantity" type="xs:int" />

            <xs:element name="UnitPrice" type="cmn:PriceType" />

          </xs:sequence>

        </xs:complexType>

      </xs:element>

    </xs:sequence>

  </xs:complexType>

</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