Mega Code Archive

 
Categories / XML Tutorial / XML Schema
 

How we declare attributes

File: Data.xml <?xml version = "1.0" ?> <Customer customerID = "24332">    <FirstName>Raymond</FirstName>    <MiddleInitial>G</MiddleInitial>    <LastName>Bayliss</LastName> </Customer> File: Schema.xsd <?xml version = "1.0" ?> <schema xmlns = "http://www.w3.org/2001/XMLSchema">    <element name = "Customer">       <complexType>          <sequence>             <element name = "FirstName" type = "string" />             <element name = "MiddleInitial" type = "string" />             <element name = "LastName" type = "string" />          </sequence>          <attribute name = "customerID" type = "integer" />       </complexType>    </element> </schema>