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.

how avoid double-spaced output?

Featured Replies

I'm exporting to an xml file using an xsl stylesheet. The fmp file has fields "alpha" and "beta" (I'm simplifying this down to its essentials). The contents of these fields are respectively "one" and "two". Here's what I want in the output document:

one

two

I've tried various methods to achieve this. However, if I use the standard technique:

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

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

I get:

one

two

(Actually, it's "one" followed by 0D0D0A; i.e. there's an extra carriage return.)

I've tried just about everything else I could think of, such as:

<xsl:value-of select="fmp:alpha"/>&#xD;<xsl:value-of select="fmp:beta"/>

But the character reference is completely ignored:

onetwo

I realize that xsl provides limited control over whitespace, but this business of an extra return is pretty odd. The FMP doc says it uses Xalan to process xsl, but when I try the first method in Xalan-Java 2.4.1 directly (on a file exported from FMP without applying a stylesheet), it works. Is there some way to obtain the actual Xalan behavior, or a workaround?

  • Author

Thanks, but xsl:preserve-space is no help here. As your link states: "Preserving white space is the default setting, so using the <xsl:preserve-space> element is only necessary if the <xsl:strip-space> element is used."

OK, the do a strip-space. And enable preserve-space only for the elements where you need them

or

check the line breaks in your xsl file (CRLF,just CR, just LF?). They should correspond to your platform. (win,mac,unix). Maybe you have copied something from a web page or a file that originated fro anorther platform. Use "show invisibles" in your texteditor to check.

  • Author

The line breaks in my xsl are normal for Windows. As I mentioned, Xalan itself behaves normally - it is only when I export from FileMaker that I get the extra CR in the output. xsl:preserve-space and xsl:strip-space apply to whitespace-only nodes in the input, which are irrelevant in this case. I did try adding xml:space="preserve", but still get CR CR LF where I should get CR LF. This appears to be a bug in FileMaker's xsl processing. If you create a FMP file with fields "alpha" and "beta" and export to FMPDSORESULT applying the stylesheet below, I believe you'll get the same results.

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fmp="http://www.filemaker.com/fmpdsoresult">

<xsl:output method="xml" version="1.0"/>

<xsl:template match="/">

<xsl:apply-templates select="fmp:FMPDSORESULT/fmp:ROW"/>

</xsl:template>

<xsl:template match="fmp:FMPDSORESULT/fmp:ROW">

<foo xml:space="preserve">

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

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

</foo>

</xsl:template>

</xsl:stylesheet>

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.