Client-Side Presentation Logic
631
String myStr = myFinder.locateDealsXML(0);
int chop = myStr.indexOf(">");
myStr = myStr.substring(chop + 1); %>
<%= myStr %>
</XML>
<table width="600">
<tr>
<td><H1>Wrox Vacations Center</H1></td>
</tr>
<tr>
<td><H3>Trips tabulated via XML data island</H3></td>
</tr>
</table>
<table datasrc="#vacDeals" border="1">
<tr>
<td><div datafld="location"></div></td>
<td><div datafld="startdate"></div></td>
<td><div datafld="duration"></div></td>
</tr>
</table>
<P>
<table width="600">
<tr>
<td><H3>Script code reading the XML data island</H3></td>
</tr>
</table>
<script>
document.write("The first special has a start date of " +
vacDeals.XMLDocument
.documentElement
.childNodes.item(0)
.childNodes.item(0).text +
" and has duration of " +
vacDeals.XMLDocument
.documentElement
.childNodes.item(0)
.childNodes.item(1).text +
"<P>" );
document.write("The second special has destination of " +
vacDeals.XMLDocument.documentElement.childNodes.item(1).childNodes.item(2).text);
</script>
</BODY>
</HTML>
Note that this actually generates an HTML file, and not an XML data set as the previous IE5xslt.jsp
did. If you access the URL:
http://localhost:8080/vacserv/jsp/IE5island.jsp