Ignoring the fact that your XSL appears to do the same thing if the
Category matches and if it doesn't match, this appears to be a simple
case of applying the appropriate XPath to filter out nodes which match
the alumniID parameter (which you would pass to the XSLT in the same
way as the other parameters).

Here's the relevant part of the (modified) XSLT :

---
<xsl:when test="$myXSLcategory='f' ">
  <xsl:variable name="numProfiles" select="alumniProfiles/profi...@id !
= $alumniID]" />
  <xsl:choose>
    <xsl:when test="count($numProfiles) = 0">
      <xsl:call-template name="NoResults" />
    </xsl:when>
    <xsl:otherwise>
      <xsl:for-each select="$numProfiles">
        <xsl:choose>
          <xsl:when test="function = $myXSLmatchme">
            <li>
              <a>
                <xsl:attribute name="href">
                  <xsl:value-of select="link"/>?ref=f
                </xsl:attribute>
                <xsl:value-of select="careerTopics/topic/title"/>
                <strong>
                  &#160; -&#160;
                  <xsl:value-of select="firstName"/>
                  &#160;
                  <xsl:value-of select="lastName"/>
                </strong>
              </a>
            </li>
            <br />
          </xsl:when>
        </xsl:choose>
      </xsl:for-each>
    </xsl:otherwise>
  </xsl:choose>
</xsl:when>
<xsl:otherwise>
...
...
</xsl:otherwise>

...
...
<xsl:template name="NoResults">
  <p>
    Sorry, No other related links at this time.
  </p>
</xsl:template>

---

Hope this helps !

On Jan 12, 9:09 pm, Ena <[email protected]> wrote:
> Hi,
>
> I have a webpage that contains a person's bio and profile (50 pages,
> 50
> profiles). On the page, below the bio, are a list of links relate to
> the
> current profile. The links are pulled into the page based on matching
> the
> variables declared in the .aspx page to the values of nodes in the
> xml. If I
> am using the following XSLT code to display links on the page that
> are
> related to the current page:
>
> <xsl:param name="myXSLmatchme" select="blank"/>
> <xsl:param name="myXSLcategory" select="blank"/>
> <xsl:param name="alumniID" select="blank"/>
>
>   <xsl:template match="/">
>     <table cellpadding="20">
>       <tr>
>         <td>
>           <ul id="relatedprofiles">
>             <xsl:choose>
>
>               <xsl:when test="$myXSLcategory='f' ">
>                 <xsl:for-each select="alumniProfiles/profile">
>                   <xsl:choose>
>                     <xsl:when test="function = $myXSLmatchme">
>                       <li>
>                         <a>
>                           <xsl:attribute name="href">
>                             <xsl:value-of select="link"/>?ref=f
>                             </xsl:attribute>
>                           <xsl:value-of
> select="careerTopics/topic/title"/>
>                               <strong>&nbsp; -&nbsp;
>                     <xsl:value-of select="firstName"/>&nbsp;
>                     <xsl:value-of select="lastName"/>
>                     </strong>
>                         </a>
>                       </li>
>                       <br />
>                     </xsl:when>
>                   </xsl:choose>
>                 </xsl:for-each>
>               </xsl:when>
>
>               <xsl:otherwise>
>                 <xsl:for-each select="alumniProfiles/profile">
>                   <xsl:choose>
>                     <xsl:when test="function = $myXSLmatchme">
>                       <li>
>                         <a>
>                           <xsl:attribute name="href">
>                             <xsl:value-of select="link"/>?ref=f
>                             </xsl:attribute>
>                           <xsl:value-of
> select="careerTopics/topic/title"/>
>                               <strong>&nbsp; -&nbsp;
>                     <xsl:value-of select="firstName"/>&nbsp;
>                     <xsl:value-of select="lastName"/>
>                     </strong>                        </a>
>                       </li>
>                       <br />
>                     </xsl:when>
>                   </xsl:choose>
>                 </xsl:for-each>
>               </xsl:otherwise>
>
>             </xsl:choose>
>           </ul>
>         </td>
>       </tr>
>     </table>
>   </xsl:template>
> </xsl:stylesheet>
>
> ...and I am determining which links are related to the person on the
> page by
> matching values defined in the .aspx this way: (*"alumniID"* is a
> unique
> value)
>
> <script runat="server">
> void Page_Load () {
>  string industry="Banking";
>  string function="Consulting";
>  string geography="United States";
>  string experience="20-25 Years";
>  string theme="Conducting an Effective Global Job Search";
>  string keyword="";
> string alumniID="0035";
>  string myref="f";
>  string matchme="";
>                 XsltArgumentList parameters = new XsltArgumentList();
> if (Request.QueryString["ref"] == null) {
>
> } else {
>
> myref=Request.QueryString["ref"];
>
> }
>
> switch(myref){
> case "f":
> matchme=function;
>     break;
> case "i":
> matchme=industry;
>     break;
> case "e":
> matchme=experience;
>     break;
> case "t":
> matchme=theme;
>     break;
> case "g":
> matchme=geography;
>     break;
> default:
> matchme=function;
>     break;
>
> }
>
> parameters.AddParam("myXSLmatchme", "", matchme);
> parameters.AddParam("myXSLcategory", "", myref);
>
>                 XsltProcessor1.TransformArgumentList = parameters;
>
> }
>
> </script>
>
> How would I pull in the "alumniID" value of the current page and use
> it to
> exclude that profile link from the results?
>
> Also, how do I display and alternate message like "No other related
> links at
> this time" if there are no other related links?
>
> The XML:
>
> <alumniProfiles>
>
>   <profile id="0001">
>     <firstName>Alexis</firstName>
>     <lastName>Sermeno</lastName>
>     <link>/alumniprofiles/profiles/sermeno.aspx</link>
>     <function>Consulting</function>
>     <industry>Consulting</industry>
>     <yearsExperience>15-20 Years</yearsExperience>
>     <geography>
>       <location primary="yes">
>         <continent>North America</continent>
>         <country>United States</country>
>         <state>Illinois</state>
>         <city>Chicago</city>
>       </location>
>     </geography>
>     <careerTopics>
>       <topic>
>         <theme>What's Your Story</theme>
>         <title>"I went from corporate to consulting"</title>
>       </topic>
>     </careerTopics>
>   </profile>
>
> </alumniProfiles>
>
> Any help would be appreciated - Thanks
>
> -Ena

Reply via email to