SAXParseException on exporting XML with XSLT specified if the field contains an invalid character.
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.
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.
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'.
As the second character in the field (0x0c) is invalid in XML document, exported data should contain only two characters 'ac'.
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'.
Find and remove invalid characters prior to export.
This is not easy if the export involves many fields and records.