Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListHelp with XSL filter, please?Help with XSL filter, please?
Previous
 
Next
New Post
5/12/2008 4:42 PM
 

 

Hi
I have a UDT which I'm formatting with a user-specific transformation (XSL shown below)  I have a field (Lists) in each record which describes the tabs in which I wish to display that entry, so, the Lists field may be "FPT" meaning that this record should be displayed on tabs F and P and T. Knowing nothing of XSL, I really need some help in setting up a filter to select only those records with say "P" in the Lists field (like SQL "SELECT * FROM UDT WHERE Lists LIKE '%P%'").
Can anyone help, please?
Regards
Rae MacLeman

---------------------------------------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:udt="DotNetNuke/UserDefinedTable">
  <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
  <!--
  This prefix is used to generate module specific query strings
  Each querystring or form value that starts with udt_{ModuleId}_param
  will be added as parameter starting with param
  -->
  <xsl:variable name="prefix_param">udt_<xsl:value-of select="//udt:Context/udt:ModuleId" />_param</xsl:variable>

  <xsl:template match="udt:Data" mode="list">
    <tr class="normal">
      <td>
      </td>
      <td>
        <xsl:call-template name="EditLink" />
      </td>
    </tr>
    <tr class="normal">
      <td>
        <xsl:value-of select="udt:Image" disable-output-escaping="yes" />
      </td>
      <td>
      </td>
    </tr>
    <tr class="normal">
      <td>
      </td>
      <td>
        <xsl:value-of select="udt:Company_x0020_Name" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td>
      </td>
      <td>
        <xsl:value-of select="udt:Business_x0020_Sector" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Training Locations</td>
      <td>
        <xsl:value-of select="udt:Training_x0020_Locations" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">List</td>
      <td>
        <xsl:value-of select="udt:Lists" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Undergraduate Vacation Placements</td>
      <td>
        <xsl:value-of select="udt:Undergraduate_x0020_Vacation_x0020_Placements" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Undergraduate 12 mth Placements</td>
      <td>
        <xsl:value-of select="udt:Undergraduate_x0020_12_x0020_mth_x0020_Placements" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Undergraduate Sponsorships</td>
      <td>
        <xsl:value-of select="udt:Undergraduate_x0020_Sponsorships" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Bursary Level</td>
      <td>
        <xsl:value-of select="udt:Bursary_x0020_Level" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Application Years</td>
      <td>
        <xsl:value-of select="udt:Application_x0020_Years" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Placement or sponsored course subjects</td>
      <td>
        <xsl:value-of select="udt:Placement_x0020_or_x0020_sponsored_x0020_course_x0020_subjects" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Graduate Vacancies</td>
      <td>
        <xsl:value-of select="udt:Graduate_x0020_Vacancies" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Postgraduate bursary</td>
      <td>
        <xsl:value-of select="udt:Postgraduate_x0020_bursary" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Expected Professional Qualifications</td>
      <td>
        <xsl:value-of select="udt:Expected_x0020_Professional_x0020_Qualifications" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Preferred Universities</td>
      <td>
        <xsl:value-of select="udt:Preferred_x0020_Universities" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Other relevant information</td>
      <td>
        <xsl:value-of select="udt:Other_x0020_relevant_x0020_information" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Contact</td>
      <td>
        <xsl:value-of select="udt:Contact" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Address</td>
      <td>
        <xsl:value-of select="udt:Address" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Website</td>
      <td>
        <xsl:value-of select="udt:Website" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Email</td>
      <td>
        <xsl:value-of select="udt:Email" disable-output-escaping="yes" />
      </td>
    </tr>
    <tr class="normal">
      <td align="right">Company Description</td>
      <td>
        <xsl:value-of select="udt:Company_x0020_Description_x002F_Activities" disable-output-escaping="yes" />
      </td>
    </tr>
  </xsl:template>

  <xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentData" select="udt:Data" />
    <table>
      <xsl:apply-templates select="$currentData" mode="list">
      </xsl:apply-templates>
    </table>
  </xsl:template>

  <xsl:template name="EditLink">
    <xsl:if test="udt:EditLink">
      <a href="{udt:EditLink}">
        <img border="0" alt="edit" src="{//udt:Context/udt:ApplicationPath}/images/edit.gif" />
      </a>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>

 
New Post
5/13/2008 4:03 AM
 

....

 <xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentData" select="udt:Data[contains(udt:Lists,'P')]" />
    <table>
      <xsl:apply-templates select="$currentData" mode="list">
      </xsl:apply-templates>
    </table>
  </xsl:template>

....

 

 
New Post
5/13/2008 7:50 AM
 

Stefan,

Thank you - this solution works like a charm!

Kind regards
Rae MacLeman

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListHelp with XSL filter, please?Help with XSL filter, please?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out