<?xml version="1.0" encoding="iso-8859-1"?><xsl:stylesheet version="1.0" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'  	xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" 	xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" 	xmlns:rs="urn:schemas-microsoft-com:rowset" 	xmlns:z="#RowsetSchema" 	xmlns:str="http://www.ora.com/XSLTCookbook/namespaces/strings" extension-element-prefixes="str"><xsl:output 	method="xml" 	version="1.0" 	indent="yes" /><xsl:variable name="year">2004</xsl:variable><xsl:variable name="termCode">Fall</xsl:variable><xsl:variable name="baseURL">/crs/<xsl:value-of select="$year"/>/<xsl:value-of select="$termCode"/></xsl:variable><xsl:variable name="UIUCCoursesBaseURL">http://courses.uiuc.edu/catalog/urbana/</xsl:variable><xsl:variable name="courseCatalogURL">http://courses.uiuc.edu/catalog/urbana</xsl:variable><xsl:template match="/" >	<xsl:apply-templates select="/data/addData/coedata" /></xsl:template><!-- COE Hompage i.e. http://devwww.ed.uiuc.edu/crs --><xsl:template match="/data/addData/coedata[@coursepagetype='coeindex']">	<div id="maincontent" class="mmhide_content" >		<div id="courseIndex">		<h1>College of Education Courses</h1>			<xsl:apply-templates select="/data/subject[departmentCode='1613' or 			departmentCode='1674' or 			departmentCode='1640' or			departmentCode='1616' or			departmentCode='1541' or			departmentCode='1570' or			departmentCode='1760' ]" mode="department" />			</div>	</div></xsl:template><xsl:template match="/data/subject" mode="department">	<div class="unitLink"><a href="{$baseURL}/{subjectCode}"><xsl:value-of select="unitName" /></a></div></xsl:template><!-- COE Unit Listing i.e. http://devwww.ed.uiuc.edu/crs/2004/Fall/CI --><xsl:template match="/data/addData/coedata[@coursepagetype='coesubindex']" >	<xsl:variable name="year"><xsl:value-of select="/data/subject/year" /></xsl:variable>	<xsl:variable name="termCode"><xsl:value-of select="/data/subject/termCode" /></xsl:variable>	<xsl:variable name="baseURL">crs/<xsl:value-of select="$year" />/<xsl:value-of select="$termCode" />/</xsl:variable>	<xsl:for-each select="/data">		<div id="maincontent" class="mmhide_content" >		<div id="courseIndex">			<h1><xsl:value-of select="subject/subjectDescription"/></h1>						<xsl:for-each select="subject/course">				<div class="course" id="{campusCode}{year}{termCode}{subjectCode}{courseNumber}">					<span class="subjectCode"><xsl:value-of select="subjectCode" /></span>&#160;					<span class="courseNumber"><xsl:value-of select="courseNumber" /></span>&#160;					<span class="courseDetailLink"><a href="{subjectCode}/{courseNumber}"><xsl:value-of select="title" /></a></span>				</div>						</xsl:for-each>		</div>		</div>	</xsl:for-each></xsl:template><!-- Course Detail i.e http://devwww.ed.uiuc.edu/crs/2004/Fall/CI/199 OR http://devwww.ed.uiuc.edu/eps/crs/2004/Fall/201 --><xsl:template match="/data/addData/coedata[@coursepagetype='coedetail' or @coursepagetype='unitdetail']" >	<xsl:for-each select="/data/subject/course">		<div id="maincontent" class="mmhide_content" >		<div id="courseDetail"> 			<h1><xsl:value-of select="subjectCode"/>&#160;<xsl:value-of select="courseNumber"/><br/><xsl:value-of select="title"/></h1> 				<div id="credits"><span id="credit">Credit:</span><span id="creditHours"><xsl:value-of select="hours"/></span></div> 				<div id="htmlDescription">				<xsl:copy-of select="description" />			<!--	<xsl:call-template name="str:replace">					<xsl:with-param name="input"><xsl:value-of select="htmlDescription" disable-output-escaping="yes"/></xsl:with-param>					<xsl:with-param name="search-string" select="'../'" />					<xsl:with-param name="unit_id" select="'EPS'" />					<xsl:with-param name="replace-string" select="$UIUCCoursesBaseURL" />				</xsl:call-template>  -->			</div> 					<div id="available">				<a href="http://courses.uiuc.edu/schedule/urbana/{subjectCode}/{courseNumber}.html">Available&#160;<xsl:value-of select="termCode"/>&#160;<xsl:value-of select="year"/></a>			</div>		</div> 		</div>  	</xsl:for-each></xsl:template><!-- Unit index  i.e. http://devwww.ed.uiuc.edu/eps/crs --><xsl:template match="/data/addData/coedata[@coursepagetype='unitindex']" >	<xsl:variable name="year"><xsl:value-of select="/data/subject/year" /></xsl:variable>	<xsl:variable name="termCode"><xsl:value-of select="/data/subject/termCode" /></xsl:variable>	<xsl:variable name="baseURL">crs/<xsl:value-of select="$year" />/<xsl:value-of select="$termCode" />/</xsl:variable>	<xsl:for-each select="/data">		<div id="maincontent" class="mmhide_content" >			<div id="courseIndex">			<h1><xsl:value-of select="subject/subjectDescription"/></h1>			<div id="deptContactTitle"><span class="tableAttribute"><xsl:value-of select="subject/contactTitle"/>:</span><span class="tableValue"><xsl:value-of select="subject/contact"/></span></div>			<div id="deptContactAddress"><span class="tableAttribute"><xsl:value-of select="subject/address1"/>:</span><span class="tableValue"><xsl:value-of select="subject/address2"/></span></div>			<div id="courseCatalogLink"><a href="{$courseCatalogURL}">Complete University of Illinois at Urbana-Champaign Course Catalog</a></div>			<xsl:for-each select="subject/course">				<div class="course" id="{campusCode}{year}{termCode}{subjectCode}{courseNumber}">					<span class="subjectCode"><xsl:value-of select="subjectCode" /></span>&#160;					<span class="courseNumber"><xsl:value-of select="courseNumber" /></span>&#160;					<span class="courseDetailLink"><a href="{$baseURL}{courseNumber}"><xsl:value-of select="title" /></a></span>				</div>						</xsl:for-each>			</div>		</div>	</xsl:for-each></xsl:template><xsl:template name="str:replace">	<xsl:param name="input"/>	<xsl:param name="search-string"/>	<xsl:param name="unit_id"/>	<xsl:param name="replace-string"/>		<xsl:choose>		<!-- See if the input contains the search string -->		<xsl:when test="substring(substring-after($input,$search-string),1,string-length($unit_id) ) = $unit_id">			<!-- replace first instance of .html -->			<xsl:variable name="replacement1">				<xsl:value-of select="substring-before($input,concat('../',$unit_id,'/'))" disable-output-escaping="yes" />				<xsl:value-of select="substring-after($input,concat('../',$unit_id,'/'))" disable-output-escaping="yes" />			</xsl:variable>			<xsl:value-of select="substring-before($replacement1,'.html')" disable-output-escaping="yes" />			<xsl:call-template name="str:replace">				<xsl:with-param name="input"				select="substring-after($replacement1,'.html')"/>				<xsl:with-param name="search-string" 				select="$search-string"/>				<xsl:with-param name="unit_id" select="$unit_id" />				<xsl:with-param name="replace-string" 					select="$replace-string"/>			</xsl:call-template>		</xsl:when>		<xsl:when test="contains($input,$search-string)">		<!-- If so, then concatenate the substring before the search		string to the replacement string and to the result of		recursively applying this template to the remaining sub-string.		-->			<xsl:value-of select="substring-before($input,$search-string)" disable-output-escaping="yes"/>			<xsl:value-of select="$replace-string" disable-output-escaping="yes"/>			<xsl:call-template name="str:replace">				<xsl:with-param name="input"				select="substring-after($input,$search-string)"/>				<xsl:with-param name="search-string" 				select="$search-string"/>				<xsl:with-param name="unit_id" select="$unit_id" />				<xsl:with-param name="replace-string" 					select="$replace-string"/>			</xsl:call-template>		</xsl:when>		<xsl:otherwise>			<!-- There are no more occurences of the search string so 			just return the current input string -->			<xsl:value-of select="$input" disable-output-escaping="yes"/>		</xsl:otherwise>	</xsl:choose></xsl:template></xsl:stylesheet>
