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.

  1. {BeginXmlBuilderXml}
  2. <exhibitors>
  3. <exhibitor>
  4. <sql>
  5. SELECT DISTINCT exh_directory_name, exh_cst_key, exb_key
  6. FROM ex_exhibitor (nolock)
  7. JOIN ex_exhibitor_booth (nolock) ON exh_key = hxb_exh_key
  8. AND hxb_delete_flag != 1
  9. JOIN ac_invoice (nolock) ON hxb_inv_code = inv_code
  10. AND inv_delete_flag != 1
  11. JOIN ex_show (nolock) ON exh_exb_key = exb_key
  12. WHERE 1=1
  13. and exb_evt_key = {evt_key}
  14. AND exh_cancel_date IS NULL
  15. AND exh_delete_flag != 1
  16. order by 1
  17. </sql>
  18. </exhibitor>
  19. </exhibitors>
  20. {EndXmlBuilderXml}
  21. {BeginXmlBuilderParams}evt_key={evt_key}{EndXmlBuilderParams}
  22.  
  23. {BeginXsl}
  24. <?xml version="1.0" encoding="ISO-8859-1"?>
  25. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  26. <xsl:param name="pagerAlpha" />
  27. <xsl:param name="pagerResults" />
  28. <xsl:output method="html" />
  29.  
  30. <xsl:template match="/exhibitors">
  31. <DIV class="pageTitle">Exhibitors</DIV>
  32. <DIV class="tinyTXT"><xsl:value-of select="$pagerResults" disable-output-escaping="yes"></xsl:value-of></DIV>
  33. <DIV class="tinyTXT"><xsl:value-of select="$pagerAlpha" disable-output-escaping="yes"></xsl:value-of></DIV>
  34. <xsl:apply-templates select="exhibitor" />
  35. <br>&#160;</br>
  36. <DIV class="tinyTXT"><xsl:value-of select="$pagerResults" disable-output-escaping="yes"></xsl:value-of></DIV>
  37. <DIV class="tinyTXT"><xsl:value-of select="$pagerAlpha" disable-output-escaping="yes"></xsl:value-of></DIV>
  38. </xsl:template>
  39.  
  40. <xsl:template match="exhibitor">
  41. <DIV class="bodyTXT"><xsl:value-of select="exh_directory_name" /></DIV>
  42. </xsl:template>
  43. </xsl:stylesheet>
  44. {EndXsl}
  45. {BeginPagerPropertiesAlphaElement}exh_directory_name{EndPagerPropertiesAlphaElement}
  46. {BeginPagerProperties}50{EndPagerProperties}