Ok I am having trouble with this homework assignment. I need to modify the code to sort by the number of pages rather than by chapte number. I get this part but the code I need to modify will not display correctly in my internet browser. All I see is my code and never the image it is meant to display. Here is the code.
.xml code
<?xml version = "1.0"?>
<?xml-stylesheet type = "text/xsl" href = "sorting.xsl"?>
<!-- Fig. 15.20 sorting.xml -->
<!-- XML document containing book information -->
<book isbn = "999-99999-9-X">
<title>Deitel's XML Primer</title>
<author>
<firstName>Jane</firstName>
<lastName>Blue</lastName>
</author> <chapters>
<frontMatter>
<preface pages = "2" />
<contents pages = "5" />
<illustrations pages = "4" />
</frontMatter>
<chapter number = "3" pages = "44">Advanced XML</chapter>
<chapter number = "2" pages = "35">Intermediate XML</chapter>
<appendix number = "B" pages = "26">Parsers and Tools</appendix>
<appendix number = "A" pages = "7">Entities</appendix>
<chapter number = "1" pages = "28">XML Fundamentals</chapter>
</chapters>
<media type = "CD" />
</book>
<!--
.xsl code
<?xml version = "1.0"?>
<!-- Fig. 15.21: sorting.xsl -->
<!-- Transformation of book information into HTML5 -->
<xsl:stylesheet version = "1.0"
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">
<!-- write XML declaration and DOCTYPE DTD information -->
<xsl:output method = "html" doctype-system = "about:legacy-compat" />
<!-- match document root -->
<xsl:template match = "/">
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<!-- match book -->
<xsl:template match = "book">
<head>
<meta charset = "utf-8"/>
<link rel = "stylesheet" type = "text/css" href = "style.css"/>
<title>ISBN <xsl:value-of select = "@isbn"/> -
<xsl:value-of select = "title"/></title>
</head>
<body>
<h1><xsl:value-of select = "title"/></h1>
<h2>by
<xsl:value-of select = "author/lastName"/>,
<xsl:value-of select = "author/firstName"/></h2>
<table>
<xsl:for-each select = "chapters/frontMatter/*">
<tr>
<td>
<xsl:value-of select = "name()"/>
</td>
<td>
( <xsl:value-of select = "@pages"/> pages )
</td>
</tr>
</xsl:for-each>
<xsl:for-each select = "chapters/chapter">
<xsl:sort select = "@number" data-type = "number"
order = "ascending"/>
<tr>
<td>
Chapter <xsl:value-of select = "@number"/>
</td>
<td>
<xsl:value-of select = "text()"/>
( <xsl:value-of select = "@pages"/> pages )
</td>
</tr>
</xsl:for-each>
<xsl:for-each select = "chapters/appendix">
<xsl:sort select = "@number" data-type = "text"
order = "ascending"/>
<tr>
<td>
Appendix <xsl:value-of select = "@number"/>
</td>
<td>
<xsl:value-of select = "text()"/>
( <xsl:value-of select = "@pages"/> pages )
</td>
</tr>
</xsl:for-each>
</table>
<p>Pages:
<xsl:variable name = "pagecount"
select = "sum(chapters//*/@pages)"/>
<xsl:value-of select = "$pagecount"/></p>
<p>Media Type: <xsl:value-of select = "media/@type"/></p>
</body>
</xsl:template>
</xsl:stylesheet> <chapters>
<frontMatter>
<preface pages = "2" />
<contents pages = "5" />
<illustrations pages = "4" />
</frontMatter>
<chapter number = "3" pages = "44">Advanced XML</chapter>
<chapter number = "2" pages = "35">Intermediate XML</chapter>
<appendix number = "B" pages = "26">Parsers and Tools</appendix>
<appendix number = "A" pages = "7">Entities</appendix>
<chapter number = "1" pages = "28">XML Fundamentals</chapter>
</chapters>
<media type = "CD" />
</book>
<!--
How do I get this code to properly render the image that I need?