You are given the following list of authors(separated by semi-colon) and their m
ID: 3742855 • Letter: Y
Question
You are given the following list of authors(separated by semi-colon) and their main work:
Harper Lee, To Kill a Mockingbird; Jack London, The Call of the Wild; Herman Melville, Moby-Dick; Margaret Mitchell, Gone with the Wind; Edgar Allan Poe, The Raven; John Steinbeck, The Grapes of Wrath
Display in a table all the above data. Also, display only book(s) by John Steinbeck
PS: Create an XML document with the above information and create an XSL document that style the XML into a Web page that displays the required information.
Explanation / Answer
we will use following xml documents:-
<?xml version="1.0" encoding="UTF-8"?>
<author_books>
<work>
<name> Harper Lee </name>
<book>To Kill a Mockingbird </bird>
</work>
<work>
<name> Jack London </name>
<book> The Call of the Wild <book>
</work>
<work>
<name> Herman Melville </name>
<book> Moby-Dick </book>
</work>
<work>
<name> Margaret Mitchell </name>
<book> Gone with the Wind </book>
</work>
<work>
<name> Edgar Allan Poe <name>
<book> The Ravan </book>
</work>
<work>
<book> The Grapes of Wrath </book>
</work>
</author_books>
now ,using xsl document to design xml into a web page that dispaly required information...
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="url path">
<xsl:template match="/">
<html>
<body>
<h2> Author Books </h2>
<table border="1">
<tr bgcolor="#9acd32">
<th> Book </th>
<th> Name </th>
</tr>
<xsl:for-each select="author_name/work">
<tr>
<td><xsl:value-of select="name"/></td>
<td><xsl:vlaue-of select="book"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
using this whole code we can able to use xml and xsl for web page display for the given information.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.