AnsweredAssumed Answered

SAXParseException on exporting XML with XSLT specified if the field contains an invalid character.

Question asked by IwaoAVE! on Oct 24, 2010
Latest reply on Nov 24, 2010 by TSGal

Summary

SAXParseException on exporting XML with XSLT specified if the field contains an invalid character.

Product

FileMaker Pro

Version

11.0v2

Operating system version

Mac OS X 10.6.4

Description of the issue

When a field data contains characters like 0x1c, 0x0c, etc. that are not valid in XML (*1), these characters should be removed on exporting records as XML.
Currently, FileMaker exports them as they are and this behavior results in an SAXParseException if an XSLT style sheet is specified on export.

These invalid characters are sometimes entered by copy & paste from other applications unintentionally.

*1: http://www.w3.org/TR/2000/REC-xml-20001006#NT-Char

Steps to reproduce the problem

1. Create a new database file with a calculation field (= "a" & Char(12) & "c" ).
2. Create a XSLT style sheet as follows.

  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fmp="http://www.filemaker.com/fmpxmlresult"
  exclude-result-prefixes="fmp">




</xsl:for-each>



3. Choose 'Export Records...' from the 'File' menu.
4. In the 'Export Records to File' dialog, select 'XML' as the 'Type' and press 'Save'.
5. In the 'Specify XML and XSL Options' dialog, select 'FMPXMLRESULT' as 'Grammar' and enable 'Use XSL style sheet'. Then press 'Specify...' button to choose the style sheet created in step 2.
6. In the 'Specify Field Order for Export' dialog, add the calculation field to the exported field list and press 'Export'.

Expected result

As the second character in the field (0x0c) is invalid in XML document, exported data should contain only two characters 'ac'.

Actual result

A dialog with the following error message is displayed.

SAXParseException: invalid character 0xC (Occurred in entity '/private/var/folders/nE/nE6-KkOFH8eW6ewqNFzWFE+++TI/-Tmp-/FMTEMPFM4cc4f24b0015.xml', at line 1, column 434.)

Exact text of any error message(s) that appear

See the 'Actual result'.

Workaround

Find and remove invalid characters prior to export.
This is not easy if the export involves many fields and records.

Outcomes