Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I can't figure out what is wrong with my logic...

Featured Replies

I'm trying to display a article summaries and each summary has a category. I want to display the category only when it is different . i.e. If the category for next following summaries is different from the previous then display it otherwise display a blank line.

Below is a snippet of my xsl file:

<table border="0" cellpadding="3" cellspacing="3">

<xsl:variable name="prev_category"><xsl:value-of select="fmp:RESULTSET/fmp:ROW[1]/fmp:COL[4]"/></xsl:variable>

<tr><td><xsl:value-of select="fmp:RESULTSET/fmp:ROW[1]/fmp:COL[4]"/></td></tr>

<xsl:for-each select="fmp:RESULTSET/fmp:ROW">

<xsl:variable name="related_url"><xsl:value-of select="fmp:COL[2]/fmp:DATA"/></xsl:variable>

<xsl:variable name="curr_category"><xsl:value-of select="fmp:COL[4]/fmp:DATA"/></xsl:variable>

<xsl:if test="$curr_category = $prev_category">

<tr><td>NBSP</td></tr>

<xsl:variable name="curr_category"><xsl:value-of select="fmp:COL[4]/fmp:DATA"/></xsl:variable>

</xsl:if>

<xsl:if test="$prev_category != $curr_category">

<tr><td><xsl:value-of select="fmp:COL[4]/fmp:DATA"/></td></tr>

<xsl:variable name="prev_category"><xsl:value-of select="fmp:COL[4]/fmp:DATA"/></xsl:variable>

</xsl:if>

<tr>

<td>

<p><xsl:value-of select="fmp:COL[1]/fmp:DATA"/></p>

<p> <xsl:value-of select="fmp:COL[3]/fmp:DATA"/></p>

<p>Related URL: <a href="http://{$related_url}"><xsl:value-of select="fmp:COL[2]/fmp:DATA"/></a></p>

</td>

</tr>

</xsl:for-each>

</table>

Here is an output of the snippet of code:

As you will read, the second "Category 2" should not be printed but rather a non-breaking space should be printed but it sill prints out "Category 2" I printed out the values of curr_category and prev_category

and prev_category always seems to remain as "Category1" which was initially set in the beginning....

Any ideas?

Category1

Title One

test test test test summary

url 1

&nbsp;

Title Two

test test test test summary 2

url 2

Category2

Title Threee

test test test test summary 3

url3

Category2

Title Four

test test test test summary 4

url4

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.