Notification Service: NoticeTemplate XSL
2 November 2008The last little chunk of code left for the server side components of the NoticeTemplate maintenance subsystem is the XSL stylesheet for the NoticeTemplate XML. Again, this looks pretty much just like ones we have done here before for other, similar projects:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>Notice Template</title>
<link rel="stylesheet" type="text/css" href="/core/css/xsl.css" />
</head>
<body>
<center>
<h2>Notice Template</h2>
<table>
<tr>
<td class="label">Context:</td>
<td class="value">
<xsl:value-of select="//@context"/>
</td>
</tr>
<tr>
<td class="label">Name:</td>
<td class="value">
<xsl:value-of select="//@name"/>
</td>
</tr>
<tr>
<td class="label">Description:</td>
<td class="value">
<xsl:value-of select="//description"/>
</td>
</tr>
<tr>
<td class="label">Content Type:</td>
<td class="value">
<xsl:value-of select="//contentType"/>
</td>
</tr>
<tr>
<td class="label">Default Delivery Method:</td>
<td class="value">
<xsl:value-of select="//defaultDeliveryMethod"/>
</td>
</tr>
<tr>
<td class="label">Title/Subject:</td>
<td class="value">
<xsl:value-of select="//titleSubject"/>
</td>
</tr>
<tr>
<td class="label">Title/Subject:</td>
<td class="value">
<xsl:value-of select="//titleSubject"/>
</td>
</tr>
<tr>
<td class="label" colspan="2">Body:</td>
</tr>
<tr>
<td class="value" colspan="2">
<pre>
<xsl:value-of select="//body"/>
</pre>
</td>
</tr>
</table>
<p><a href="javascript: window.close();">Close window</a></p>
</center>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I’m definitely going to go back and play with this one a little bit later on in the area where we format the template body. Right now, I am assuming a content type of text/plain, which is why I surrounded the body text with the HTML <pre> tags, but as we start adding different content types such as text/html, I am going to want to adjust that based on the value of the contentType field. For now, though, this is good enough to complete this part of the project and move on the HTML pages and related Javascript that will utilize this servlet via Ajax to maintain the template information. We’ll start on that list of parts the next time out …
Leave a reply
You must be logged in to post a comment.





