ITC 298 Assignment 4

Description

For this assignment we are going to use xpath to extract and summarize data. The file that we are going to summarize is doctorwho.xml

I am going to lead you through the process. The code for the xpath is listed below, but we will go through it setp by step. I have used the full location paths and axis rather than the abbreviated to give a better sense of what the xpath is doing.

To Do

		
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
		
		
		
<xsl:template match="/">
<html>
<head>
<title>Xpath Assignment</title>
</head>
<body>
<h1>Doctor Who</h1>
		
		
<p> There have been<xsl:value-of select="count(descendant-or-self::doctor)" /> doctors</p>		
		
		
<p>The total number of  Doctor who episodes (including the new series) is 
<xsl:value-of select="sum(descendant-or-self::doctor/child::episodes) "/>
</p>
		
<p>The most popular doctor was
<xsl:value-of select="descendant-or-self::doctor[attribute::ID= 'four']/child::name" />

<p>Doctor Who began in <xsl:value-of select="descendant-or-self::doctor[attribute::ID='one']/begin" /> and ended in <xsl:value-of select="descendant-or-self::doctor[attribute::ID='seven']/child::end" />.

<p>The original show ran for a total of 
<xsl:value-of select="(descendant-or-self::doctor[attribute::ID='seven']/child::end)-(descendant-or-self::doctor[attribute::ID='one']/child::begin)" /> 
years.</p>
<p>There was an eigth doctor, 
	
		
		
		
<xsl:value-of select="descendant-or-self::doctor[attribute::ID='eight']/child::name" />, who starred in a
television movie. </p>	
 <p>In 2005 the series was resurrected. The ninth doctor was 
<xsl:value-of select="descendant-or-self::doctor[attribute::ID='nine']/child::name" />
 He worked for one year and then 
<xsl:value-of select="descendant-or-self::doctor[attribute::ID='ten']/child::name" /> 
became the new doctor. 
 He is currently continuing in the role.
</p>		
		
		

To turn in

Print or email me the code for the xslt/xpath file