Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4312 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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
Posted

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>
Posted

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

This topic is 4312 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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