<?xml version=\"1.0\"?> <?xml-stylesheet type=\"text/xsl\" href=\"myfile.xsl\" ?
ID: 3862169 • Letter: #
Question
<?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> <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 Answer the io lowing questio about OODD. HWH 1.pdf a) Discuss the concept rator overloading b) What primary characteristics should an CID possess? Exercise 2: Write the following XPath queries on the "inventory.xml" to select: a) All award elements in the document. b) The author(s) of the last book element c) All magazine elements whose style attribute value is equal to glossy value of the bookstore element at the root of the document. d) All award elements that belong to book elements that have an id attribute. e) All title elements one or more levels deep in the bookstore element. f) All price elements elements of the book elements. g) All author elements of books whose prices is less than 30 or greater than 50. h) All magazine elements with style attributes.Explanation / Answer
a. //award - this will select all award elemtents
b./bookstore/book[last()]//author
c.
d./bookstore/book[@id]
e. /bookstore//title
f. /bookstroe/book//price
g. /boolstore/book[price<30&&price>50]/author
h. //maganize[@style]
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.