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.

Need help from an XMLStyle expert

Featured Replies

I've implemented a very simple export of a text field using an XMLStyle.xsl file to format the result (a TXT file)

 

Everything works except that I can't get rid of the extra return characters.  I've attached a screen capture from a word processor that can show the paragraph marks.

 

How can I modify this style sheet to have only one paragraph mark for each new line character in the text field?

 

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:fm="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fm" >
	<xsl:output method="text" version="1.0" encoding="windows-1252" indent="no"/>
	<xsl:template match="/">
		<xsl:for-each select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW">
			<xsl:for-each select="fm:COL/fm:DATA">
				<xsl:value-of select="."/>
				<xsl:if test="position()!=last()">
					<xsl:text>&#10;</xsl:text>
				</xsl:if>
			</xsl:for-each>
			<xsl:if test="position()!=last()">
			<xsl:text>&#10;</xsl:text>
			</xsl:if>
		</xsl:for-each> 
	</xsl:template>
</xsl:stylesheet>

Thanks in advance for any help.

 

 

post-81548-0-97529800-1359272312_thumb.p

Seeing your starting point would help - either the Filemaker source file or the "raw" XML export (without any stylesheet applied).

  • Author

Yes, I didn't explain that well.  It's simply an export of a single field from three records, as shown in the attached diagram:

 

From FMP's documentation: "returns within text fields are replaced with another character, the ASCII character VTAB (decimal 11)."  (internally on stored text, not in the export)

 

The export is either turning each vertical tab into two carriage return characters ... or adding a couple more as part of the process.  I thought the XMLStyle.xsl controlled the details of the export process.

 

 

post-81548-0-52503400-1359296962_thumb.p

  • Newbies

I use the following xsl for exporting DOS batch files.  I was getting extra lines with indent="yes" , but you have this set to no as well.

<?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/fmpxmlresult"
exclude-result-prefixes="fmp">

<xsl:output method="html" version="1.0" encoding="utf-8" indent="no"/>


<!-- BEGIN TEMPLATE -->
<xsl:template match="/">
<xsl:for-each select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW">
<xsl:value-of select="fmp:COL[1]/fmp:DATA" disable-output-escaping="yes"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
  • Author

Thanks for the alternate XMLstyle.  I finally got back to my computer to test and got this (see attached) result: it goes too far the other way and removes all additional CRs.

 

What I need are all the CRs the user entered, but without "doubling" them in the TXT output.  I think this means removing the Vertical Tab characters FileMaker is inserting, but I haven't been able to find an XML equivalent of Substitute.

 

Any ideas?

 

 

post-81548-0-86334900-1359925253_thumb.p

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.