Page 1

CSC570 Lab 7-2 – Apply XML Editor to create XSD 1. In the previous lab exercise, you have created an XSD file named property.xsd to validate against property.xml. 2. In this exercise, you need to re-design the XSD file to make it more simple, easy to read and maintain by other person. This new design method is based on defining all elements and attributes first, and then referring to them using the ref attribute. Example: <xs:element name="property"> <xs:complexType> <xs:sequence> <xs:element ref="housing" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="housing"> <xs:complexType> <xs:sequence> <xs:element ref="title"/> <xs:element ref="location"/> <xs:element ref="contact"/> <xs:element ref="house" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="title" type="xs:string"/> <xs:element name="location" type="xs:string"/>

3. Refer https://www.w3schools.com/xml/schema_example.asp for more information. 4. Zip “property.xml and propertyref.xsd”. Rename the zip file to A_Lab7-2_fullname.zip and submit the file in XML Programming MOOCs – Chapter 7 – Lab 7-2, before the end of lab session.

Profile for xml programming

Lab 7-2 : Creating XSD using ref  

Lab 7-2 : Creating XSD using ref  

Advertisement