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.

XSLT in changing the value of a variable...

Featured Replies

What I am attempting to do is to display the category heading if they are different from the previous record.

i.e.

Category Heading 1

Record

Record

Record

Category Heading 2

Record

Record

Category Heading 3

Record

.

.

So I figured to use 2 <xsl:variables>, one to keep track of the current record's category heading and another 1 to keep track of the previous record's category heading. The current record category heading is placed in a <xsl:variable name="category">. This is found in the <xsl:for-each select="/filemaker:FMPDSORESULT/filemaker:ROW"> tag. This works correct however the problem is when the variable that keep tracks of the previous record category.

I figured to use ^_^

<xsl:variable name="prev_category"><xsl:value-of select="/filemaker:FMPDSORESULT/filemaker:ROW[$d]/filemaker:category" /></xsl:variable>

where $d = position() -1;

Value of $d is correct but the value of prev_category is always set to the first category heading of the first record.

I am wondering why the code is not working of saving the state of previous record's category heading.

How can I implement this...

Thanks.

  • 1 year later...

You should look at "Grouping Using the Muenchian Method". A very good example of XSLT grouping is on Jeni Tennison's site <a href="http://www.jenitennison.com/xslt/grouping/index.html">http://www.jenitennison.com/xslt/grouping/index.html</a>.

You should look at "Grouping Using the Muenchian Method". A very good example of XSLT grouping is on Jeni Tennison's site <a href="http://www.jenitennison.com/xslt/grouping/index.html">http://www.jenitennison.com/xslt/grouping/index.html</a>.

You should look at "Grouping Using the Muenchian Method". A very good example of XSLT grouping is on Jeni Tennison's site <a href="http://www.jenitennison.com/xslt/grouping/index.html">http://www.jenitennison.com/xslt/grouping/index.html</a>.

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.