XslGenerator:RegistrantList

Overview

This is a page that displays a listing of registrants in a list or as badges, depending on the link the user clicks on the top of the page.

Output

List Page

HTML Source:

<table border="0" cellpadding="0" cellspacing="0" width="100%">	<tr>		<td><A href="dynamicpage.aspx?webcode=RegList3&filename=badge">Badges</A> |  <A href="dynamicpage.aspx?webcode=RegList3&filename=list">List</A> 
| <A href="dynamicpage.aspx?webcode=ataglance">Back</A></td>			</tr>			<tr>				<td><DIV class="pageTitle">Registrants</DIV><DIV class="bodyTXT" style="float:left;width:150px">Jeff Smith</DIV><DIV class="bodyTXT" style="float:left;width:310px">AAAA</DIV><DIV class="bodyTXT" style="width:100px">03/13/2007</DIV><DIV class="bodyTXT" style="float:left;width:150px">John Doe</DIV><DIV class="bodyTXT" style="float:left;width:310px">ABCD</DIV><DIV class="bodyTXT" style="width:100px">03/12/2007</DIV>		</td>	</tr></table>


Badge Page

HTML source:

<table border="0" cellpadding="0" cellspacing="0" width="100%">			<tr>				<td><A href="dynamicpage.aspx?webcode=RegList3&filename=badge">Badges</A> |  <A href="dynamicpage.aspx?webcode=RegList3&filename=list">List</A> 
| <A href="dynamicpage.aspx?webcode=ataglance">Back</A></td>			</tr>			<tr>				<td><DIV class="pageTitle">Registrants</DIV><DIV style="width:600px;">  <DIV class="bodyTXT" style="float:left;width:230px;height:90px;border:1px solid #cccccc;margin-left:12px;margin-bottom:12px; margin-right:12px;padding:4px;">    <B>Soloveua Taisiya</B>    <br>AAAA (AvectraForum)</DIV>  <DIV class="bodyTXT" style="float:left;width:230px;height:90px;border:1px solid #cccccc;margin-left:12px;margin-bottom:12px; margin-right:12px;padding:4px;">    <B>Davis Kimberly</B>    <br>Association of Public Health Laboratories</DIV></td></tr></table>


Setup

There is another CMS: Web Content Detail of content type of HTMLabove this one with the following HTML:

<A href="dynamicpage.aspx?webcode=RegList3&filename=badge">Badges</A> |  <A href="dynamicpage.aspx?webcode=RegList3&filename=list">List</A>| <A href="dynamicpage.aspx?webcode=ataglance">Back</A>

Notice how the filename querystring parameter fed into the BeginXslFileName setting above, excerpted here:

{BeginXslFileName}style/xsl/{filename}.xsl{EndXslFileName}

Below is the XslGenerator content detail:

Important! The SQL commands on this page can be improved with SQL 2005's FOR XML PATH mode syntax. This feature is available in the 2007.01 build and later. Please see XWeb:ExecuteMethod_Case_Study1 for details on how to work with this new feature. These samples are still valid, but it is recommended that you use the newer syntax if your netFORUM site is on 2007.01 or later. Both DynamicXmlBuilder and XslGenerator work with this newer SQL syntax.

{BeginXmlBuilderXml}<Registrants>
<Registrant>
<sql>
SELECT DISTINCT reg_cst_key, reg_key, reg_evt_key, reg_add_date,
[BadgeName]=reg_badge_name,
[Name] = registrant.cst_sort_name_dn,
[Company] = case when cst_type='Individual' then cst_org_name_dn else '' end,
[RegDate] = convert(varchar(10), reg_add_date, 101),
[Address] = adr_line1+','+adr_city+','+adr_state,
[Email]=eml_address,
[Title]=ixo_title
FROM ev_registrant (nolock)
JOIN co_customer registrant (nolock)
ON registrant.cst_key = reg_cst_key
LEFT JOIN ev_registrant_type (nolock) ON rgt_key = reg_rgt_key
LEFT JOIN co_individual_x_organization (nolock) ON ixo_key=reg_ixo_key
JOIN co_customer_x_address (nolock) ON cxa_key=reg_cxa_key
JOIN co_address (nolock) ON adr_key=cxa_adr_key
LEFT JOIN co_email (nolock) ON eml_key=reg_eml_key
WHERE reg_evt_key = 'd109a06d-0e38-47b5-b392-9b37beb93229' AND reg_delete_flag=0 AND reg_cancel_date IS NULL
ORDER BY reg_add_date DESC
 
</sql>
</Registrant>
</Registrants>
{EndXmlBuilderXml}
 
{BeginXslFileName}style/xsl/{filename}.xsl{EndXslFileName}

The XLS file name for List.xsl is:

<?xml   version="1.0"   encoding="ISO-8859-1"   ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="pagerAlpha" />
<xsl:param name="pagerResults" />
<xsl:output method="html" />
<xsl:template match="/Registrants">
<DIV class="pageTitle">Registrants</DIV>
<xsl:apply-templates select="Registrant" />
<br>&#160;</br>
</xsl:template>
<xsl:template match="Registrant">
<DIV class="bodyTXT" style="float:left;width:150px">
<xsl:value-of select="Name" />
</DIV>
<DIV class="bodyTXT" style="float:left;width:310px">
<xsl:value-of select="Company" />
</DIV>
<DIV class="bodyTXT" style="width:100px">
<xsl:value-of select="RegDate" />
</DIV>
</xsl:template>
</xsl:stylesheet>


The XSL file for Badge.xls is:

<?xml   version="1.0"   encoding="ISO-8859-1"   ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:param name="pagerAlpha" />
<xsl:param name="pagerResults" />
<xsl:output method="html" />
<xsl:template match="/Registrants">
<DIV class="pageTitle">Registrants</DIV>
<DIV style="width:600px;">
<xsl:apply-templates select="Registrant" />
</DIV>
<br>&#160;</br>
</xsl:template>
<xsl:template match="Registrant">
<DIV class="bodyTXT" style="float:left;width:230px;height:90px;border:1px solid #cccccc;margin-left:12px;margin-bottom:12px; margin-right:12px;padding:4px;">
<B>
<xsl:value-of select="Name" />
</B>
<br></br>
<xsl:value-of select="Company" />
</DIV>
</xsl:template>
</xsl:stylesheet>