January 27, 201312 yr 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.  Â
January 27, 201312 yr Seeing your starting point would help - either the Filemaker source file or the "raw" XML export (without any stylesheet applied).
January 27, 201312 yr 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.  Â
January 28, 201312 yr 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>
February 3, 201312 yr 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?  Â
Create an account or sign in to comment