CS122aSlides19

CS122aSlides19 - CS122A / EECS116 Introduction to Data...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CS122A / EECS116 Introduction to Data Management Spring 2009 Prof. Mike Carey Bren School of ICS UC Irvine Slides based on previous CS122a lecture notes as well as  material borrowed from U-Wisconsin, Stanford, & Berkeley
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS122A/EECS116 Notes 16 2 Final Announcements Happenings this week still Part 4 of project is due tonight by midnight HW #7 is due tomorrow by midnight Don’t miss Alex’s discussion tomorrow…! (Review of relational design theory with a chance to practice using it.) Final exam info (“sliding cumulative”) Here in this room on Tue, June 9 th , 10:30am-12:30pm Today’s plan Last time we learned about XML data (and DTDs)… For our last trick, we’ll learn how to query XML data! But first, a quick mention of XML Schema…
Background image of page 2
Limitations of DTDs DTDs describe only the “grammar” of an XML file, not the detailed structure and/or data types This grammatical description has some limitations: Cannot say that the “length” element must contain a non-negative number (constraints on atomic value types for an elements or attributes) Cannot say that the “unit” element should only be allowed when “amount” is present (co-occurrence constraints) Cannot say that the “comment” element should be allowed to appear anywhere (schema flexibility) Cannot constrain the target type or target location of an IDREF or IDREFS attribute (referential constraints) Also, DTDs are not themselves expressed in XML…!
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
XML Schema To The Rescue Describes complex types and simple types Complex type correspond to records in relational “string" and “int” are examples of built-in simple types Supports both built-in types and user-defined types Complex types are user-defined (See Section 11.4 of text for more information) Elements may have complex types or simple types, while attributes must always have simple types Mostly a (vast) superset of DTDs Schemas are XML documents ( i.e., XML syntax) XML Schema supports namespaces ( e.g., < mjc:book> )
Background image of page 4
XML Schema Example ( FYI ) Consider the following simple XML document <?xml version="1.0" encoding="utf-16"?> <company>   <person>       <ssn> 12345 </ssn>       <name> Joe </name>       <age units=" yrs "> 22 </age>       <phone> x1234 </phone>       <phone> x5678 </phone>   </person>   <person>       <ssn> 67890 </ssn>       <name> Jane </name>    </person> </company>
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
XML Schema Example ( FYI, cont. ) <?xml version="1.0" encoding="utf-16"?> <xsd:schema version="1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">    <xsd:element name="company" type="companyType" />   <xsd:complexType name=" companyType ">      <xsd:sequence>         <xsd:element maxOccurs="unbounded" name="person" type="personType" />      </xsd:sequence>   </xsd:complexType>
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 39

CS122aSlides19 - CS122A / EECS116 Introduction to Data...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online