8 Replies Latest reply on Jun 22, 2011 11:31 AM by bueller

    xml Import Problem

    jgraff

      Summary

      xml Import Problem

      Product

      FileMaker Pro

      Version

      11.0v1

      Operating system version

      Windows XP Pro, Service Pack 3

      Description of the issue

      When importing from an XML file in a script  and the XML data source is base on a calculation, the file path ends up mangled when you run the script.
      Exact steps to reproduce the issue:
      1. Create a new script
      2. Add an Import Records Script Step
      3. Specify data source as XML Data... > specify XML data source as File with a value of: filewin:/C:/folder/file.xml > immediately change the specify XML data source to calculation with a value of "filewin://server/sharename/folder/" & table::field & ".xml".
      4. Save the script
      5. Run scriptExpected Result:Prompted to specify import order of fields to be imported

      Actual Result:
      Error message is produced

      Exact text of any error message(s) that appeared:
      XML parsing error:unable to open primary document entity'C:\folder\/filewin://server/share/folder/filename.xml'
      Line Number: 0
      Column Number: 0

      Any additional configuration information/troubleshooting that is relevant to the issue:
      When importing xml file based on calculation, the import path will include the last static file location you specified in filemaker and then the calculated location.  For example, if you specify the xml file location as a calculation and then specify > Use XSL Style Sheet and specify the File.  The resulting import location for the XML file will be: '\X:\DIRECTORY WHERE XSLT FILE IS LOCATED\/filewin://server/share/folder/filename.xml'.
      Any workarounds that you have found:
      Use FileMaker 10 -Jake

        • 1. Re: xml Import Problem
          TSGal

          jgraff:

           

          Thank you for your post.

           

          I have forwarded your entire post to our Development and Software Quality Assurance (Testing) departments for review and confirmation.  When information becomes available, I will let you know.

           

          TSGal

          FileMaker, Inc.

          • 2. Re: xml Import Problem
            TSGal

            jgraff:

             

            The following information was forwarded to me from our Testing department.

             

            "If I understand correctly, when using a calculation that generates the file path for XML file, you need to use the standard system format, rather than the FileMaker path format.  It works if you remove "filewin:/" from the path."

             

            Can you verify?

             

            TSGal

            FileMaker, Inc.

            • 3. Re: xml Import Problem
              jgraff

              Hi TSGal,

               

              Thanks for looking into this.

               

              Based on my example from my original post, if I remove "filewin:/", I'm left with "/server/sharename/folder/" & table::field & ".xml".  When I modify the script step and run the script, I still receive the same error message.  Additionally, if follow what the Testing Department suggests and use Windows Standard System format, I believe I would replace all forward slashed with back slashes.  System format on windows to a network share looks like:  \\server\share\folder\.  I tried this (keeping in mind a backslash comments out the following character in the string), so the syntax for the calculation looks like this:  "\\\\" & "server" & "\\" & "share" & "\\" & "folder" & "\\" & table::field & ".xml".  When the script is run, the dialogue box displays the path to the network share correctly: \\server\share\folder\file.xml, but it still returns the same error message.  In this case, the error message appears as follows:

               

              XML parsing error:

              unable to open primary document entity
              ''

              Line Number: 0
              Column Number: 0

               

              Thanks,

               

              -Jake



              • 4. Re: xml Import Problem
                TSGal

                jgraff:

                 

                I've sent your post back to the Tester for additional comments.

                 

                TSGal

                FileMaker, Inc.

                • 5. Re: xml Import Problem
                  dcohensitt

                  Hi TSGal,

                   

                  Is there any word on the resolution on this issue?  I have a very similar (if not identical) problem with a scripted import of an xml file using FM11.  This script worked flawlessly in FM9 & 10 but suddenly "broke" in 11. 

                   

                  The script contains an Import Records script step that specifies the xml and xsl stylesheets paths in script variables using FileMaker supported file path syntax.  The xml file & the xsl stylesheet that the script refer to both work fine if I import the file manually using File->Import XML.  I've tried various types of syntax using relative and absolute paths but nothing works.  I'm getting the same errors as jgraff reports.

                   

                  Configurations tested:  FileMaker 11, FileMaker 11 Advanced; Mac OSX 10.5.8.

                   

                  Examples of file path syntax that I've tried for the xml data file (all of which work in FM10 & FM9): 

                   

                  file:///volumes/Macintosh HD/username/desktop/shopsite_orders.xml  (this is what was originally being used and worked in FM9 & 10)

                  filemac:/Macintosh HD/Users/username/desktop/shopsite_orders.xml (I tried this to be specific and absolute but it still failed)

                   

                  as well as a few others.  I tried the same syntaxes for the xsl stylesheets.

                   

                  The database files are hosted and the xml/xsl files are stored locally on the client's machine.  However, i've also tested this with the database files opened on the local machine and still get the same errors.

                   

                  I've been able to successfully use the scripted import if I set the import records script step to show dialogs, then manually change the file reference dialog by clicking on the File... button and navigating to the hard drive to point FM to the correct xml & xsl files.

                   

                  Please advise if this is a known bug in FM11 or if there's something I'm missing.  I have a client who desperately wants to upgrade all of his licenses to 11 but cannot do so until this issue is resolved, since the scripts & file path syntax we've been using work fine in FM10.

                   

                  thanks!

                   

                  -deb : )

                   

                  • 6. Re: xml Import Problem
                    dcohensitt

                    WOW.  I just realized the problem.  When the file is opened in FM11 and I look at the Import Records script step's Specify XML dialog, it shows that the $path variable I'm using was placed in the Specify Calculation option of the specify xml file dialog. 

                     

                    The text below the Specify Calculation button states "File or HTTP request specified by calculation".  But when FM 11 goes to evaluate this during the script, it fails.  When I run the script and show the Import Records dialog, the Specify XML window pops up and displays the variable $path in the HTTP Request field and not in the File field.

                     

                    It was then that I decided to put the $path variable in where the File option is (in lieu of typing in an actual file path I typed $path which of course I know works in other file specification dialogs) and saved the script and it worked.  Did the same for the xsl file reference and everything worked perfectly.

                     

                    Why did this change between FM10 & 11 ?   Did I miss something?  Anyway, all is good now.  Hope this helps others.

                     

                    -deb : )

                    • 7. Re: xml Import Problem
                      TSGal

                      dcohensitt:

                      I apologize for the late reply.

                      First, I'm glad you found the solution.

                      Second, our Testing department has confirmed this does indeed fail for remote files, but works correctly for local files.  As you discovered, this is a change between FileMaker Pro 10 and FileMaker Pro 11.  This has been sent to Development for further review.

                      TSGal
                      FileMaker, Inc.

                      • 8. Re: xml Import Problem
                        bueller

                        I was stuck on this issue all day yesterday. Glad I found the workaround for it. By the way, it wouldn't work for me locally no matter how I configured the file path, I had to use the "File" option instead of the "Calculation" option. Also, I'm still working with FMP 9 Advanced.