Lập trình web nâng cao XML - Trường CĐN Đà Lạt - 28

</div>

</xsl:otherwise>

</xsl:choose>

<xsl:if test="@mandatory = 'yes'">

<div style="display:inline">

<font class="error">&#160;*</font>

</div>

</xsl:if>

</xsl:template>

<xsl:template match="courseList">

Có thể bạn quan tâm!

Xem toàn bộ 258 trang tài liệu này.

<table class="text" width="100%" cellspacing="0" cellpadding="0" border="0">

<xsl:apply-templates select="courseListItem" />

Lập trình web nâng cao XML - Trường CĐN Đà Lạt - 28

<xsl:if test="count(courseListItem) != 0">

<tr>

<td colspan="3" height="1" bgcolor="#000000">

<img src="./images/spacer.gif" height="1" />

</td>

</tr>

</xsl:if>

<tr>

<td colspan="3" bgcolor="#ffffff" class="text">

<xsl:value-of select="count(courseListItem)" /> course(s) satisfied your criteria

</td>

</tr>

<tr>

<td colspan="3" height="1" bgcolor="#000000">

<img src="./images/spacer.gif" height="1" />

</td>

</tr>

</table>

</xsl:template>

<xsl:template match="courseListItem">

<tr>

<xsl:choose>

<xsl:when test="position() mod 2">

<xsl:attribute name="style"> background-color:#D1D7DC

</xsl:attribute>

</xsl:when>

<xsl:otherwise>

<xsl:attribute name="style"> background-color:#f1f1f1

</xsl:attribute>

</xsl:otherwise>

</xsl:choose>

<td class="text" valign="top">

<a href="controller.asp?view=courseDetail&amp;id={id}">

<xsl:value-of select="name" />

</a>

</td>

<td class="text" valign="top">

<xsl:value-of select="city" />

</td>

<td class="text" valign="top">

<xsl:value-of select="state" />

</td>

</tr>

</xsl:template>

<xsl:template match="courseDetail">

<xsl:apply-templates select="courseDetailBlock" />

</xsl:template>

<xsl:template match="courseDetailBlock">

<xsl:variable name="numsections"

select="count(../courseDetailBlock)" />

<xsl:variable name="precedingsibs" select="count( preceding-sibling::courseDetailBlock)" />

<xsl:variable name="sectionid" select="concat('s_',

$precedingsibs)" />

<table id="{$sectionid}" class="tabHeader" cellspacing="0" cellpadding="2" align="center">

<xsl:if test="$precedingsibs > 0">

<xsl:attribute name="style">display:none</xsl:attribute>

</xsl:if>

<tr>

<td colspan="{$numsections}" height="5">

<img src="images/spacer.gif" height="5" />

</td>

</tr>

<tr align="center">

<xsl:for-each select="preceding-sibling::courseDetailBlock">

<td align="center">

<a id="button{position}" href="javascript:showTab({ position()-1},{$numsections})">

<xsl:value-of select="@description" />

</a>

</td>

</xsl:for-each>

<td align="center" class="activeTab">

<xsl:value-of select="@description" />

</td>

<xsl:for-each select="following-sibling::courseDetailBlock">

<td align="center">

<a id="button{position}" href="javascript:showTab ({$precedingsibs+position()},{$numsections})">

<xsl:value-of select="@description" />

</a>

</td>

</xsl:for-each>

</tr>

<tr>

<td>

<xsl:attribute name="colspan">

<xsl:value-of select="$numsections" />

</xsl:attribute>

<table class="text" width="100%" cellpadding="0" cellspacing="0" border="0">

<tr>

<td>

<xsl:apply-templates />

</td>

</tr>

</table>

</td>

</tr>

</table>

</xsl:template>

<xsl:template match="courseItem[@type='courseInfo']">

<xsl:apply-templates select="section" />

<table class="text">

<tr>

<td rowspan="3" valign="top">Address:</td>

<td>

<xsl:value-of select="address/address1" />

</td>

</tr>

<tr>

<td><xsl:value-of select="address/city" />, <xsl:value-of select="address/state"

/></td>


</tr>

<tr>

<td>

<xsl:value-of select="address/zip" />

</td>

</tr>

<tr>

<td rowspan="3" valign="top">Greens Fee:</td>

<td>$<xsl:value-of select="price" /></td>

</tr>

</table>

</xsl:template>

<xsl:template match="courseItem[@type='holeInfo']">

<xsl:apply-templates select="section" />

<table width="100%" cellspacing="0" cellpadding="0">

<tr>

<td valign="top" nowrap="yes">

<table width="100%" cellpadding="0" cellspacing="1">

<tr bgcolor="a0a0a0" style="padding:2px;spacing-top:0px">

<td class="text" align="center" style="color:black; font-weight:bold">

Hole

</td>

<td class="text" align="center" style="color:black; font-weight:bold">

Par

</td>

<td class="text" align="center" style="color:black; font-weight:bold">

Distance

</td>

<td class="text" align="center" style="color:black; font-weight:bold">

Handicap

</td>

</tr>

<xsl:apply-templates select="tees/tee" />

</table>

</td>

</tr>

<tr bgcolor="#336699">

<td height="1">

<img src="./images/spacer.gif" height="1" />

</td>

</tr>

</table>

</xsl:template>

<xsl:template match="tee">

<xsl:variable name="id" select="concat('v',generate-id())" />

<tr>

<xsl:attribute name="id">

<xsl:value-of select="$id" />

</xsl:attribute>

<td colspan="4">

<xsl:attribute name="id"><xsl:value-of select="$id" />_plus

</xsl:attribute>

<table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#e0e0e0" class="listgroup">

<xsl:attribute name="id">

<xsl:value-of select="$id" />_table</xsl:attribute>

<tr>

<td width="5" style="cursor:hand">

<img src="./images/plus.gif" hspace="4" style="border:1px outset">

<xsl:attribute name="onClick">ExpandCollapse ('<xsl:for-each select="holes/*[name() = 'hole']">

<xsl:value-of select="concat('v',generate-id())" />

<xsl:if test="last() > position()">,</xsl:if>

</xsl:for-each>','<xsl:value-of select="$id"

/><xsl:for-each select=".//*[name() = 'hole']">,<xsl:value-of select="concat('v',generate-id())" /></xsl:for-each>')</xsl:attribute>

<xsl:attribute name="id"><xsl:value-of select="$id"

/>_plus_image</xsl:attribute>

</img>

</td>

<td align="left" class="text">

<xsl:value-of select="description" /> Tee: Distance:

<xsl:value-of select="distance" /> yards&#160;Slope: <xsl:value-of select="slope" />

</td>

</tr>

</table>

</td>

</tr>

<xsl:apply-templates select="holes" />

</xsl:template>

<xsl:template match="hole">

<xsl:variable name="id" select="concat('v',generate-id())" />

<tr>

<xsl:choose>

<xsl:when test="position() mod 2">

<xsl:attribute name="style"> background-color:#ffffff;display:none

</xsl:attribute>

</xsl:when>

<xsl:otherwise>

<xsl:attribute name="style"> background-color:#f1f1f1;display:none

</xsl:attribute>

</xsl:otherwise>

</xsl:choose>

<xsl:attribute name="id">

<xsl:value-of select="$id" />

</xsl:attribute>

<td class="text" valign="top">

<xsl:value-of select="@number" />

</td>

<td class="text" valign="top">

<xsl:value-of select="par" />

</td>

<td class="text" valign="top">

<xsl:value-of select="distance" />

</td>

<td class="text" valign="top">

<xsl:value-of select="handicap" />

</td>

</tr>

</xsl:template>

<xsl:template match="courseItem[@type='scheduleTeeTime']">

<xsl:apply-templates select="section" />

</xsl:template>

<xsl:template match="TeeTimes">

<table class="text" width="100%" cellspacing="0" cellpadding="1" border="0">

<tr bgcolor="#a0a0a0" style="padding:2px;spacing-top:0px">

<td class="text" align="left" style="color:black; font-weight:bold">

Date

</td>

<td class="text" align="left" style="color:black; font-weight:bold">

Time

</td>

<td class="text" align="right" style="color:black; font-weight:bold">

Reserve It!

</td>

</tr>

<xsl:apply-templates select="teeTime" />

</table>

</xsl:template>

<xsl:template match="teeTime">

<tr>

<xsl:choose>

<xsl:when test="position() mod 2">

<xsl:attribute name="style"> background-color:#D1D7DC

</xsl:attribute>

</xsl:when>

<xsl:otherwise>

<xsl:attribute name="style"> background-color:#f1f1f1

</xsl:attribute>

</xsl:otherwise>

</xsl:choose>

<td class="text" valign="top">

<xsl:value-of select="date" />

</td>

<td class="text" valign="top">

<xsl:value-of select="time" />

</td>

<td class="text" valign="top" align="right">

<xsl:choose>

<xsl:when test="taken"> Tee Time Reserved

</xsl:when>

<xsl:when test="../noRegister"> login to register

</xsl:when>

<xsl:otherwise>

<a>

<xsl:attribute name="href">controller.asp?view= scheduleTeeTime&amp;golferId=<xsl:value-of select="../golferId"

/>&amp;courseId=<xsl:value-of select="../courseId" />&amp; teeTime=<xsl:value-of select="TeeTimesystemDate" /></xsl:attribute>

Reserve Tee Time</a>

</xsl:otherwise>

</xsl:choose>

</td>

</tr>

</xsl:template>

<xsl:template match="teeTimeDetail">

<table cellpadding="2" class="text">

<tr>

<td>Golfer:</td>

<td>

<xsl:value-of select="golfer/name" />

</td>

</tr>

<tr>

<td>Course:</td>

<td>

<a>

<xsl:attribute name="href"> controller.asp?view=courseDetail&amp;id=<xsl:value-of select="course/id" />

</xsl:attribute>

<xsl:value-of select="course/name" />

</a>

</td>

</tr>

<tr>

<td>Date:</td>

<td>

<xsl:value-of select="date" />

</td>

</tr>

<tr>

<td>Time:</td>

<td>

<xsl:value-of select="time" />

</td>

</tr>

</table>

</xsl:template>

<xsl:template match="myTeeTimes">

<table class="text" width="100%" cellspacing="0" cellpadding="0" border="0">

<tr bgcolor="#a0a0a0" style="padding:2px;spacing-top:0px">

<td class="text" align="left" style="color:black; font-weight:bold">

Course

</td>

<td class="text" align="left" style="color:black; font-weight:bold">

Date

</td>

<td class="text" align="right" style="color:black; font-weight:bold">

Time

</td>

</tr>

<xsl:choose>

<xsl:when test="myTeeTime">

<xsl:apply-templates select="myTeeTime" />

</xsl:when>

<xsl:otherwise>

<tr>

<td colspan="3">

You have no tee times scheduled

</td>

</tr>

</xsl:otherwise>

</xsl:choose>

<tr>

<td colspan="3" height="1" bgcolor="#000000">

<img src="images/spacer.gif" height="1" />

</td>

</tr>

</table>

</xsl:template>

<xsl:template match="myTeeTime">

<tr>

<xsl:choose>

<xsl:when test="position() mod 2">

<xsl:attribute name="style"> background-color:#D1D7DC

</xsl:attribute>

</xsl:when>

<xsl:otherwise>

<xsl:attribute name="style"> background-color:#f1f1f1

</xsl:attribute>

</xsl:otherwise>

</xsl:choose>

<td class="text" valign="top">

<a>

<xsl:attribute name="href">

controller.asp?view=courseDetail&amp;id=<xsl:value-of select="course/courseId"

/>

</xsl:attribute>

<xsl:value-of select="course/name" />

</a>

</td>

<td class="text" valign="top">

<xsl:value-of select="teeTime/date" />

</td>

<td class="text" valign="top" align="right">

<xsl:value-of select="teeTime/time" />

</td>

</tr>

</xsl:template>

</xsl:stylesheet>


BÀI TẬP VỀ NHÀ

1. Nêu các phương pháp tích hợp và đặc điểm của từng phương pháp?

2. Hãy trình bày cách xây dựng ứng dụng mức server?

3. Hãy trình bày cách xây dựng ứng dụng mức Client?

..... Xem trang tiếp theo?
⇦ Trang trước - Trang tiếp theo ⇨

Ngày đăng: 19/11/2023