1411365 DB Design and Implementation inventory.xml <?xml version=\"1.0\"?> <?xml
ID: 3677348 • Letter: 1
Question
1411365 DB Design and Implementation
inventory.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="myfile.xsl" ?>
<bookstore specialty="novel">
<book>
<author>
<first-name>Joe</first-name>
<last-name>Bob</last-name>
<award>Trenton Literary Review Honorable Mention</award>
</author>
<price>12</price>
</book>
<book>
<author>
<first-name>Mary</first-name>
<last-name>Bob</last-name>
<publication>Selected Short Stories</publication>
</author>
<editor>
<first-name>Britney</first-name>
<last-name>Bob</last-name>
</editor>
<price>55</price>
</book>
<magazine frequency="monthly">
<price>2.50</price>
<subscription price="24" per="year"/>
</magazine>
<book id="myfave">
<author>
<first-name>Toni</first-name>
<last-name>Bob</last-name>
<degree from="Trenton U">B.A.</degree>
<degree from="Harvard">Ph.D.</degree>
<award>Pulitzer</award>
<publication>Still in Trenton</publication>
<publication>Trenton Forever</publication>
</author>
<price intl="Canada" exchange="0.7">6.50</price>
<excerpt>
<p>It was a dark and stormy night.</p>
<p>But then all nights in Trenton seem dark and
stormy to someone who has gone through what
<emph>I</emph> have.</p>
<definition-list>
<term>Trenton</term>
<definition>misery</definition>
</definition-list>
</excerpt>
</book>
<my:book xmlns:my="uri:mynamespace" price="29.50">
<my:title>Who's Who in Trenton</my:title>
<my:author>Robert Bob</my:author>
</my:book>
</bookstore>
Exercise 1: Answer the following questions about OODB: a) Discuss the concept of information hiding in OODB. b) Give examples of inheritance, multiple inheritance, and selective inheritance? c) What is the difference between persistent and transient objects? Exercise 2: Write the following XPath queries on the "inventory.xml" to select: a) All editors elements in the document. b) The author(s) of the third book element c) All book elements whose style attribute value is equal to the textbook attribute value of the bookstore element at the root of the document. d) All award elements that belong to book elements. e) All title elements one or more levels deep in theExplanation / Answer
Exerciese 2:
1. //editor
2. //book[3]//author
3. //book[@style='textbook']
4. //book//award
5. /bookstore//title
6. //magazine//price
7. /bookstore/book[price>50]//author
8. //book[@style]
Reference to study: http://www.w3schools.com/xsl/xpath_syntax.asp
Reference to test query: http://www.freeformatter.com/xpath-tester.html
Please post the first exercise as a separate question.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.