Element Declarations : element « XML Schema « XML Tutorial






File: Schema.xsd
<?xml version = "1.0" ?>
<schema xmlns = "http://www.w3.org/2001/XMLSchema">

<element name = "Address">
   <complexType>
      <sequence>
         <element name = "Street" type = "string" />
         <element name = "Town" type = "string" />
         <element name = "City" type = "string" />
         <element name = "StateProvinceCounty" type = "string" />
         <element name = "Country" type = "string" />
         <element name = "ZipPostCode" type = "string" />
      </sequence>
   </complexType>
</element>
</schema>

File: Data.xml
<?xml version = "1.0" ?>
<Address>
   <Street>10 Place</Street>
   <Town>A</Town>
   <City>B</City>
   <StateProvinceCounty>C</StateProvinceCounty>
   <Country>D</Country>
   <ZipPostCode>2021</ZipPostCode>
</Address>








3.89.element
3.89.1. Declarations
3.89.2.An element may be named and defined locally.
3.89.3.An element may be named and defined globally.
3.89.4.Element Declarations