XslGenerator:Exhibitor
Overview
Here is a template for a simple exhibitor listing for an event, with an alpha pager showing 50 exhibitors per page. Each exhibitor is hyperlinked to a drill-down page.
Content Detail Definition
In this example, all of the content information (SQL and XSL) is contained in the content detail; there is no separate XSL file or web service.
Note the WHERE clause accepts a parameter {evt_key} on line 13 to select the exhibit (based on the linked Event); this parameter is passed from a querystring to the DynamicXmlBuilder through this {BeginXmlBuilderParams}evt_key={evt_key}{EndXmlBuilderParams} on line 21.
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} <exhibitors> <exhibitor> <sql> SELECT DISTINCT exh_directory_name, exh_cst_key, exb_key FROM ex_exhibitor (nolock) JOIN ex_exhibitor_booth (nolock) ON exh_key = hxb_exh_key AND hxb_delete_flag != 1 JOIN ac_invoice (nolock) ON hxb_inv_code = inv_code AND inv_delete_flag != 1 JOIN ex_show (nolock) ON exh_exb_key = exb_key WHERE 1=1 and exb_evt_key = {evt_key} AND exh_cancel_date IS NULL AND exh_delete_flag != 1 order by 1 </sql> </exhibitor> </exhibitors> {EndXmlBuilderXml} {BeginXmlBuilderParams}evt_key={evt_key}{EndXmlBuilderParams} {BeginXsl} <?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="/exhibitors"> <DIV class="pageTitle">Exhibitors</DIV> <DIV class="tinyTXT"><xsl:value-of select="$pagerResults" disable-output-escaping="yes"></xsl:value-of></DIV> <DIV class="tinyTXT"><xsl:value-of select="$pagerAlpha" disable-output-escaping="yes"></xsl:value-of></DIV> <xsl:apply-templates select="exhibitor" /> <br> </br> <DIV class="tinyTXT"><xsl:value-of select="$pagerResults" disable-output-escaping="yes"></xsl:value-of></DIV> <DIV class="tinyTXT"><xsl:value-of select="$pagerAlpha" disable-output-escaping="yes"></xsl:value-of></DIV> </xsl:template> <xsl:template match="exhibitor"> <DIV class="bodyTXT"><xsl:value-of select="exh_directory_name" /></DIV> </xsl:template> </xsl:stylesheet> {EndXsl} {BeginPagerPropertiesAlphaElement}exh_directory_name{EndPagerPropertiesAlphaElement} {BeginPagerProperties}50{EndPagerProperties}