11-xml

11-xml - Announcements (Thu. Oct. 13) XML, DTD, and XML...

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

View Full Document Right Arrow Icon
1 XML, DTD, and XML Schema CPS 116 Introduction to Database Systems 2 Announcements (Thu. Oct. 13) ± Project milestone #1 due today! ± Midterm graded; sample solution available ² Highest: 49.5/50 ² Average: 40.0/50 ² Median: 43.0/50 ² Check your grades on Blackboard ± Graded Homework #2 available soon 3 Announcements (Tue. Oct. 18) ± Project milestone #1 feedback available by this weekend via email ± Graded Homework #2 available this Thursday ± Homework #3 available this Thursday 4 From HTML to XML (eXtensible Markup Language) ± HTML describes presentation of content <h1>Bibliography</h1> <p><i>Foundations of Databases</i> Abiteboul, Hull, and Vianu <br>Addison Wesley, 1995 <p>… ± XML describes only the content <bibliography> <book> <title>Foundations of Databases</title> <author>Abiteboul</author> <author>Hull</author> <author>Vianu</author> <publisher>Addison Wesley</publisher> <year>1995</year> </book> <book>…</book> </bibliography> ) Separation of content from presentation simplifies content extraction and allows the same content to be presented easily in different looks 5 Other nice features of XML ± Portability: Just like HTML, you can ship XML data across platforms ² Relational data requires heavy-weight protocols, e.g., JDBC ± Flexibility: You can represent any information (structured, semi-structured, documents, …) ² Relational data is best suited for structured data ± Extensibility: Since data describes itself, you can change the schema easily ² Relational schema is rigid and difficult to change 6 XML terminology ± Tag names: book , title , … ± Start tags: <book> , <title> , … ± End tags: </book> , </title> , … ± An element is enclosed by a pair of start and end tags: <book>…</book> ² Elements can be nested: <book>…<title>…</title>…</book> ² Empty elements: <is_textbook></is_textbook> • Can be abbreviated: <is_textbook/> ± Elements can also have attributes: <book ISBN=”…” price=”80.00”> ) Ordering generally matters, except for attributes <bibliography> <book ISBN=”ISBN-10” price=”80.00”> <title>Foundations of Databases</title> <is_textbook/> <author>Abiteboul</author> <author>Hull</author> <author>Vianu</author> <publisher>Addison Wesley</publisher> <year>1995</year> </book>… </bibliography>
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 7 Well-formed XML documents A well-formed XML document ± Follows XML lexical conventions ² Wrong: <section>We show that x < 0…</section> ² Right: <section>We show that x &lt; 0…</section> • Other special entities: > becomes &gt; and & becomes &amp; ± Contains a single root element ± Has properly matched tags and properly nested elements ² Right: <section>…<subsection>…</subsection>…</section> ² Wrong: <section>…<subsection>…</section>…</subsection> 8 A tree representation bibliography title author author author publisher year section book book Foundations of Databases Abiteboul Hull Vianu Addison Wesley 1995 title section section Introduction …… In this section we introduce the notion of content i semi- structured data 9 More XML features ± Comments: <!-- Comments here --> ± CDATA section: <![CDATA[Tags: <book>,…]]> ± ID’s and references
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 01/17/2012.

Page1 / 5

11-xml - Announcements (Thu. Oct. 13) XML, DTD, and XML...

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

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