0

My xml export from Filemaker is to feed an InDesign template. I don't want avoid carriage returns in the InDesign doc. After some research I found a solution by substituting

Substitute ( textfield ; "¶" ; "
" )

(InDesign will give lovely 'soft returns' in return.) When I export the records to plain text, 
 is preserved, though to xml it becomes




My conclusion that is an encoding issue. Is it? I tried different encodings without result. What is the solution? How can I force plain text into the xml file? thank you n

ADDED: The header of the xslt template:

<?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/fmpdsoresult" exclude-result-prefixes="fm">
<xsl:output version='1.0' encoding='utf-8' indent='yes' method='xml' />
<xsl:template match="/">
numbernine
  • 13
  • 6

2 Answers2

1

My conclusion that is an encoding issue. Is it?

No, it is not.

The problem is that you are trying to fool Filemaker's XML export logic and it won't let you. If you want the field to contain a character, you must use the character itself in the calculation, not its hexadecimal code (which is meaningless in Filemaker). That would mean:

Substitute ( textfield ; ¶ ; Char ( 8232 ) )

The other option is to do this in the XSLT stylesheet by:

<xsl:value-of select="translate(., '&#xa;', '&#x2028;')"/>

This has the advantage of keeping all the export-related logic in the stylesheet and not burdening the solution with extra fields that serve no internal purpose.

michael.hor257k
  • 113,275
  • 6
  • 33
  • 51
  • I see... The explanation makes a lot of sense. Thank you again. I agree about separating 'tasks'. Both methods easy to implement and worked from start. thanks, n – numbernine Aug 27 '15 at 05:04
0

You may be having problems with utf-16. Per this post, you can easily Export XML specifying an XSLT document to force output content to utf-8. Here's the xslt template from the referenced post:

<?xml version="1.0" encoding="UTF-8" ?>
<!--
Beverly Voth
beverlyvoth@gmail.com
SEP 2012

# this XSLT will work with any version of FileMaker that uses the 
# FMPXMLRESULT grammar as export.
# Use with one record - one field to preserve the UTF-8.
# Alternate for Export Field Contents, which is UTF-16.

-->
<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" />
    <xsl:variable name="row" select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW[1]" />
    <xsl:template match="/">
        <xsl:copy-of select="$row/fm:COL/fm:DATA[1]" />
    </xsl:template>
</xsl:stylesheet>
brian_schick
  • 151
  • 6