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.

Stylesheet export inserts extra Return when last field is empty

Featured Replies

I guess the question is any ideas on how to change this so that if an exported field is empty I don't get an extra $newrecord but do still get the $newrecord needed at the end of each record???

Note: setting Qu to '0' if empty is not an option....

Example:

ItemName Price Qu

Product1 $9.95

Product2 $7.95

Product3 $8.95

This may not show but there is a tab after each price before the return/new line

Yet I get:

ItemName Price Qu

Product1 $9.95

Product2 $7.95

Product3 $8.95

Here's the stylesheet section.......


           	 <xsl:choose>

                    <xsl:when test="position()=last()">

                        <xsl:value-of select="fmp:DATA"/>

                        <xsl:value-of select="$newrecord"/>

                    </xsl:when>

                    <xsl:otherwise>

                        <xsl:value-of select="fmp:DATA"/>

                        <xsl:value-of select="$delimiter"/>

                    </xsl:otherwise>

                </xsl:choose>

Thanks to anyone who can help.....

Please post your entire stylesheet. An example source file would be also helpful.

  • 2 weeks later...

put an xsl:if around the xsl:choose. test for != '' (xsl:if test="fmp:DATA != ''") or actually you want to make it another xsl:when in the xsl:choose, so that you can also test for the last record (even if empty, add the $newrecord...)

when fmp:DATA = '' AND last record, $newrecord

when fmpDATA != '' AND last record, $newrecord

otherwise, $delimiter

Maybe the entire XSLT would help??

  • Author

Sorry people ..... I've been sick and out of it for a while.

Just now catching up on things....

Maybe the entire XSLT would help??

I'm just using the basic FMP example, with a little editing, which I posted on another topic.:

http://fmforums.com/...__fromsearch__1

I'll see how this works and repost here if it does....

Thanks Beverly

EDIT : I go back to test it and it's working fine WITHOUT changing the xsl ..... huummmmmm.

EDIT#2 : You gave me an idea that actually would help me a lot ...... what if all three fields were empty, or basically an empty record?

I'm just using the basic FMP example, with a little editing, which I posted on another topic.

Are you sure the double returns appear only when the last field is empty?

when fmp:DATA = '' AND last record, $newrecord

when fmpDATA != '' AND last record, $newrecord

otherwise, $delimiter

:Ask:

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.