Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

XML The Downtown Zoo has hired you to help work on their web site. They would li

ID: 3832575 • Letter: X

Question

XML

The Downtown Zoo has hired you to help work on their web site. They would like to create a page that displays the times that various animals are being fed. The Zoo has the information stored in an XML document, Zoo.xml. The web page should list the feeding times across the top as hyperlinks to the details of which animals are fed at that time. The page should look like this:

11:00 14:00 15:00 16:00 9:00

11:00 Feeding Time For:

Lion

Tortise

14:00 Feeding Time For:

Penguin

Hippo

15:00 Feeding Time For: Flamingo

16:00 Feeding Time For:

Ape

9:00 Feeding Time For:

Elephant

Rattle Snake

To complete this task you should do the following steps: 1. Create a new XSLT style sheet document Zoo.xsl with the basic structure of a stylesheet. 2. Create a stylesheet that displays the feeding times as links across the top of the page, and a list of the animals that are fed at each time within the page.

Zoo.xml xml-stylesheet hrefa "Zoo.xsl" type-"text/xsl"?> XML Kanimal name "Lion"

Explanation / Answer

1. I have created a Zoo.xsl document which specify the new XSLT style sheet.

Basic Structure:-

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<?xml-stylesheet type="text/css" href="animals.css"?>

<xsl:template match="/ANIMALS">
<HTML>
<HEAD>
<TITLE>
Downtown Zoo
</TITLE>
</HEAD>
<BODY>
<H1>
The Zoo.xsl File
</H1>
<TABLE>
               <TR>
<TD> Animal </TD>
                       <TR>
                       <TD> feeding-time </TD>
                       </TR>
               </TR>
<xsl:apply-templates/>
</TABLE>
</BODY>
</HTML>
</xsl:template>

2. Create an instance of CSS class for appending the links across the top of the page.

   <xsl:template match="/PLANETS">
<HTML>
<HEAD>
<TITLE>
Downtown Zoo
</TITLE>
</HEAD>
<BODY CLASS="animals">
          
<H1>
The Zoo.xsl File
</H1>
<TABLE>
               <TR>
<TD> Animal </TD>
                       <TR>
                       <TD> feeding-time </TD>
                       </TR>
               </TR>
<xsl:apply-templates/>
</TABLE>
</BODY>
</HTML>
</xsl:template>

CSS file:-

.animals {font-size:75%; margin:1.0em; font-family: Times New Roman; display:block}
TABLE {display:block; border: 1px solid GREY; margin:0.7em; padding:0.7em;background-color:BLUE;}