K1200 Posted January 27, 2013 Posted January 27, 2013 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> </xsl:text> </xsl:if> </xsl:for-each> <xsl:if test="position()!=last()"> <xsl:text> </xsl:text> </xsl:if> </xsl:for-each> </xsl:template> </xsl:stylesheet> Thanks in advance for any help.  Â
comment Posted January 27, 2013 Posted January 27, 2013 Seeing your starting point would help - either the Filemaker source file or the "raw" XML export (without any stylesheet applied).
K1200 Posted January 27, 2013 Author Posted January 27, 2013 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.  Â
Newbies ozbigben Posted January 28, 2013 Newbies Posted January 28, 2013 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>
K1200 Posted February 3, 2013 Author Posted February 3, 2013 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?  Â
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now