Unformatted text preview:

IT 241 LT: Web Design: Introduction to XML Second Exam Linn CollinsGeneral Directions:Answer every question on the exam.If you finish early, you can leave early.IT 241 LT: Web Design: Introduction to XML Second Exam Linn CollinsGeneral Directions:Answer every question on the exam.Answers will be graded on the basis of accuracy and completeness. When you finish, copy your file(s) into the folder with your name on my ZIP disk.You have until 8:20 to finish the exam.If you finish early, you can leave early.A. Describe the main difference between simple and complex types. (10 points)- A simple type can contain text only. It may not contain other elements and it may not have attributes. There are many pre-defined simple types and you can custom make your own simple type definition.- A complex type can contain other elements or is allowed to contain attributes. Complex types describe the structure rather than the content. There are four kinds of complex type:“element only”, “empty”, “mixed content”, and “text only”.B. Complete the following table. For every simple type, include an example of an XML elementthat would be valid for that type. (23 questions x 3 points each = 69 points)1.<xsd:element name="debt" type="xsd:nonPositiveInteger"/> <debt>-1234.56</debt>2.<xsd:element name="population" type="xsd:nonNegativeInteger"/> <population>17,000</population>3.<xsd:element name="dinner_time" type="xsd:time"/> <dinner_time>18:30Z</dinner_time>4.<xsd:element name="semester" type="xsd:timeDuration"/> <semester>P5M14D</semester>5.<xsd:element name="time_of_birth" type="xsd:timeInstant"/> <time_of_birth>1963-07-19T09:27:33.4698Z</time_of_birth>6.<xsd:element name="last_sighting" type="xsd:month"/> <last_sighting>1945-05</last_sighting>7.<xsd:element name="year_of_extinction" type="xsd:year"/> <year_of_extinction>1875</year_of_extinction>8.<xsd:element name="century_greatest_loss" type="xsd:century"/> <century_greatest_loss>19</century_greatest_loss>9.<xsd:element name="birthday" type="xsd:recurringDate"/> <birthday>--07-19</birthday>10.<xsd:element name="payday" type="xsd:recurringDay"/> <payday>---01</payday>11<xsd:element name="density" type="xsd:decimal"/> <density>2.36</density>12.<xsd:element name="change_in_population" type="xsd:integer"/> <change_in_population>875</ change_in_population>13.<xsd:element name="change_due_to_births" type="xsd:positiveInteger"/> <change_due_to_births>346</ change_due_to_births>14.<xsd:element name="change_due_to_deaths" type="xsd:negativeInteger"/> <change_due_to_deaths>-43</ change_due_to_deaths>15.<xsd:element name="date_of_graduation" type="xsd:date"/> <date_of_graduation>2005-06-01</ date_of_graduation>16.<xsd:element name="zipcode"><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:pattern value="\d{5}(-\d{4})?"/></xsd:restriction></xsd:simpleType></xsd:element> <zipcode>87544-3702</zipcode>17.<xsd:element name="continent"><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:enumeration value="Asia"/><xsd:enumeration value="Africa"/><xsd:enumeration value="Australia"/><xsd:enumeration value="Europe"/><xsd:enumeration value="North America"/><xsd:enumeration value="South America"/><xsd:enumeration value="Antarctica"/></xsd:restriction></xsd:simpleType></xsd:element><continent>Australia</continent>18.<xsd:element name="invoice_number"><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:pattern value="INV #99\d{3}"/></xsd:restriction></xsd:simpleType></xsd:element><invoice_number>1001</invoice_number>19.<xsd:element name="population"><xsd:simpleType><xsd:restriction base="xsd:integer"><xsd:maxInclusive value="5000"/></xsd:restriction></xsd:simpleType></xsd:element><population>4999</population>20.<xsd:element name="animal_code"><animal_code>2185</animal_code><xsd:simpleType><xsd:restriction base="xsd:string"><xsd:length value="4"/></xsd:restriction></xsd:simpleType></xsd:element>21.<xsd:element name="vacation_cost"><xsd:simpleType><xsd:restriction base="xsd:decimal"><xsd:precision value="7"/><xsd:scale value="2"/></xsd:restriction></xsd:simpleType></xsd:element><vacation_cost>569.00</vacation_cost>22.<xsd:simpleType name="datelist"><xsd:list base="xsd:date"/></xsd:list></xsd:simpleType><xsd:element name="list_of_birthdays" type="datelist"/> <list_of_birthdays >1989-04-09 1986-10-11</ list_of_birthdays >23.<xsd:element name="status" type="xsd:string" fixed="endangered/"><status>endangered</status>C. Complete the following table. For every complex type, include an example of XML elements that would be valid for that type. (3 questions x 7 points each = 21 points)<xsd:complexType name="bookType"><xsd:sequence><xsd:element name="title" type="xsd:string"/><xsd:element name="author" type="xsd:string"/><xsd:element name="genre_or_type" type="xsd:string"/><xsd:element name="length" type="xsd:string"/><xsd:element name="price" type="xsd:positiveInteger"/></xsd:sequence></xsd:complexType> <title>Carrie</title><author>Stephen King</author><genre_or_type>fiction</genre_or_type><length>365 pages</length><price>7.99</price><xsd:complexType name="videoType"><xsd:sequence><xsd:element name="title" type="xsd:string"/><xsd:element name="director" type="xsd:string"/><xsd:element name="genre_or_type" type="xsd:string"/><xsd:element name="length" type="xsd:string"/><xsd:element name="price" type="xsd:positiveInteger"/></xsd:sequence></xsd:complexType> <title>E.T.</title><director>Steven Spielburg</director><genre_or_type>fiction</genre_or_type><length>1 hour 49 min</length><price>12.99</price><xsd:complexType name="mediaType"><xsd:choice><xsd:element name="book" type="bookType"/><xsd:element name="video" type="videoType"/></xsd:choice> <book>The Green


View Full Document

UNM IT 241 - IT 241 Second Exam

Download IT 241 Second Exam
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view IT 241 Second Exam and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view IT 241 Second Exam 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?