1 / 3

1. (20) The following is a DTD for books. Please produce an XML document conforming to the DTD.

Assignment #2 Due: Nov. 06, 2013. 1. (20) The following is a DTD for books. Please produce an XML document conforming to the DTD. <!DOCTYPE AuthorBook [ <!ELEMENT AuthorBook (Author*, Book*)> <!ELEMENT Author (Name, Address+)> <!ATTLIST Author AuthorId ID #REQUIRED

zorana
Download Presentation

1. (20) The following is a DTD for books. Please produce an XML document conforming to the DTD.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Assignment #2 Due: Nov. 06, 2013 • 1. (20) The following is a DTD for books. Please produce an XML document conforming to the DTD. <!DOCTYPE AuthorBook [ <!ELEMENT AuthorBook (Author*, Book*)> <!ELEMENT Author (Name, Address+)> <!ATTLIST Author AuthorId ID #REQUIRED writing INREFS #IMPLIED > <!ELEMENT Name (#PCDATA)> <!ELEMENT Address (Street, City)> <!ELEMNT Street (#PCDATA)> <!ELEMENT City (#PCDATA)> <!ELEMENT Book (Title, Publisher, Year)> <!ATTLIST Book BookIn ID #REQUIRED authorOf IDREFS #REQUIRED > <!ELEMENT Title (#PCDATA)> <!ELEMENT Publisher (#PCDATA)> <!ELEMENT Year (#PCDATA)> ]> Yangjun Chen ACS-7102

  2. (20) Define an XML-schema which is equivalent to the DTD shown in Question 1. • (25) Assume that for an attribute of a table, m bit maps (bit vectors) are created and then compressed using the following procedure: • a. Decompose each bit vector into a series of runs such that each contains a set consecutive 0’s followed by • a 1. • b. compress each run with i 0’s as below: • part 1: i expressed as a binary number, denoted as b1(i). • part 2: Assume that b(i) is j bits long. Then, part 2 is a sequence of (j – 1) 1’s followed by a 0, denoted a b2(i). • c. The compressed bit string is set to be b2(i) b1(i). • Let sj be the jth compressed bit vector. Putting all the compressed bit vectors together, we get a bit string: • s = s1s2…sj…sm • Please design a method to uncompress any compressed bit vector efficiently. Yangjun Chen ACS-7102

  3. 4. (20) The following is a DTD for a set of documents on books. • (a) Write an FLWR expression to find all the books authored by D. Knuth. • (b) Write an FLWR expression to find all books published by Addison Wesley Longman in 2007. <!DOCTYPE AuthorBook [ <!ELEMENT AuthorBook (Author*, Book*)> <!ELEMENT Author (Name, Address+)> <!ATTLIST Author AuthorId ID #REQUIRED writing INREFS #IMPLIED > <!ELEMENT Name (#PCDATA)> <!ELEMENT Address (Street, City)> <!ELEMNT Street (#PCDATA)> <!ELEMENT City (#PCDATA)> <!ELEMENT Book (Title, Publisher, Year)> <!ATTLIST Book BookIn ID #REQUIRED authorOf IDREFS #REQUIRED > <!ELEMENT Title (#PCDATA)> <!ELEMENT Publisher (#PCDATA)> <!ELEMENT Year (#PCDATA)> ]> • 5. (15) According to the above DTD, construct an Xpath expression to find the author’s name who published a book entitles “Art of Programming” in 1972. Yangjun Chen ACS-7102

More Related