1 2 3 Previous Next 44 Replies Latest reply on Feb 8, 2016 6:21 PM by cbishop

    XML error: Invalid character at line 1

    databuzz

      Summary

      XML error: Invalid character at line 1

      Product

      FileMaker Server

      Version

      13.0v1

      Operating system version

      Mavericks Mac OS X 10.9

      Description of the issue

      Using the FileMaker PHP API/Custom Web Publishing we're getting an error:

      XML error: Invalid character at line 1

      when performing a simple find Command. I'm not sure what the invalid character is - I printed to screen the result of the find command and all the data was there. This was at the top if that helps:

      [error_message_prefix] =>
          [mode] => 1
          [level] => 1024
          [code] => 401
          [message] => XML error: Invalid character at line 1
          [userinfo] =>
          [backtrace] => Array
              (
                  [0] => Array
                      (
                          [file] => /Library/FileMaker Server/Web Publishing/publishing-engine/php/mavericks/lib/php/FileMaker/Error.php
                          [line] => 52
                          [function] => PEAR_Error
                          [class] => PEAR_Error
                          [type] => ->
                          [args] => Array
                              (
                                  [0] => XML error: Invalid character at line 1
                                  [1] =>
                              )

                      )

      Steps to reproduce the problem

      Call the php page that performs a find on a contacts table. The layout referenced in the php page only contains 5 fields;

      First Name
      Last Name
      ContactID
      Email
      Phone

      Expected result

      Found set of records

      Actual result

      Error 401: XML error: Invalid character at line 1

      Exact text of any error message(s) that appear

      XML error: Invalid character at line 1

      Workaround

      None so far.

        • 1. Re: XML error: Invalid character at line 1
          TSGal

               databuzz:

               Thank you for your post.

               What Find are you performing with the query?  Are you using any wildcard characters or a character that isn't supported through XML?

               TSGal
               FileMaker, Inc.

          • 2. Re: XML error: Invalid character at line 1
            databuzz

                 Hi TSGal,

                 It's a simple find on an email address field. The find works for some email addresses but not others - it looks like for some records there is something in the returned XML that is causing an issue (the actual records are returned if you capture the returned XML) but there's something in the xml lt doesn't like for certain records.

            • 3. Re: XML error: Invalid character at line 1
              TSGal

                   databuzz:

                   Thank you for the additional information.

                   Since you are referencing an Email Address, are you referencing the "@" symbol?  This is also used in FileMaker Pro as a wildcard.

                   Can you post a few examples that perform properly and a few examples that fail?

                   TSGal
                   FileMaker, Inc.

              • 4. Re: XML error: Invalid character at line 1
                databuzz

                     We're not using the @ symbol in this case. We performing the find like this:

                     $request->addFindCriterion('Email', '=="'.$_POST['emailAddress'].'"');

                     In any case the issue is not with the find command but the result set - for some records there's some data in the returned XML that it doesn't like.

                     I'll have to get my client's permission to post some data - there's thousands of records so we're not sure which record/s has the problem.

                • 5. Re: XML error: Invalid character at line 1
                  TSGal

                       databuzz:

                       Check your Inbox at the top of this page for additional information.

                       TSGal
                       FileMaker, Inc.

                  • 6. Re: XML error: Invalid character at line 1
                    cuitw_1

                         I am having exactly the same problem, it is just a plain text field and the data are all in the same format - XXX-123456 3-4 english characters and some numbers separated by a dash.

                          

                         It was ok when we were using FM 11 server. After upgrading to FM 13 it just "sometimes" comes up with the "Invalid character at line 1 xml error". We notice that it only happen in some records, the rest are totally fine...

                    • 7. Re: XML error: Invalid character at line 1
                      cuitw_1

                           The error occurs after the execution of a search.

                      • 8. Re: XML error: Invalid character at line 1
                        TSGal

                             cultw:

                             Thank you for your posts.

                             If you have a simple example that is easily reproducible, then I'd also like to see your file and XML code.  Check your Inbox at the top of this page for instructions where to send the files.

                             TSGal
                             FileMaker, Inc.

                        • 9. Re: XML error: Invalid character at line 1
                          cuitw_1

                               Thank you for your reply. My apology for the late response. I have been in touch with FileMaker support. I think I will try to solve it there. I'll be sure to post the solution here if we can find a way!

                               Thank you, TSGal!

                          • 10. Re: XML error: Invalid character at line 1
                            CarlSchwarz

                                 This bug is VERY easy to reproduce.  Simply insert a special character into any record in a field that you are pulling via PHP and this error will show.

                                 For example in Filemaker press ctrl-S on a windows machine to insert the double exclamation mark special character and this error will show.  Delete that character from the field and then the PHP API will work fine.

                                 I have uploaded an image of a special character that will make the PHP API crash.


                                 I tested this bug with Filemaker Server 11 and it wasn't there, the special character simply wasn't passed through the PHP API.  This is a Server 13 bug.  I did not test Filemaker Server 12.

                            • 11. Re: XML error: Invalid character at line 1
                              TSGal

                                   Carl Schwarz:

                                   Thank you for your post.

                                   I am able to replicate the issue under FileMaker Server 13.  I have sent all posts to our Development and Testing departments for review.  When I receive any feedback, I will let everyone know.

                                   TSGal
                                   FileMaker, Inc.

                              • 12. Re: XML error: Invalid character at line 1
                                philmodjunk

                                     And will this error be produced regardless of the OS where the file is hosted?

                                     An entry in the Known Bugs List has been linked to this Issue Report. Any Comments/Questions/Suggested Corrections should be posted here or in a new thread. Please do not post such comments to the Known Bugs List thread.

                                • 13. Re: XML error: Invalid character at line 1
                                  TSGal

                                       PhilModJunk:

                                       Unknown.  However, I suspect any control character (below ASCII-32 - space) would cause this error regardless of operating system.

                                       When I receive confirmation, I will post again.

                                       TSGal
                                       FileMaker, Inc.

                                  • 14. Re: XML error: Invalid character at line 1
                                    CarlSchwarz

                                         I have only tested using windows servers but since the custom web publishing engine appears to be the issue then I'm assuming that it is a cross platform issue.

                                         FYI I tried passing the same characters through webdirect and it worked fine.  The characters were passed through to Internet Explorer however they were invisible and Webdirect did not crash and it worked fine.  I believe it is only a PHP API issue and is not a problem with webdirect.

                                          

                                         Also note that inserting these funny characters into a PHP based website and passing that back to Filemaker also crashes the API.

                                    1 2 3 Previous Next