2 Replies Latest reply on Mar 17, 2015 2:50 PM by c.wagner1

    Problem specifying path for xslt in a variable in the Export Records Script Step

    c.wagner1

      Title

      Problem specifying path for xslt in a variable in the Export Records Script Step

      Post

      I am writing a script to export some records to XML.  I need to pass the data through a XSLT to format them properly.  I have all of that working properly and I can export the records manually so the XSLT works and the proper fields are being exported.

      I started thinking about it and realized I needed to plan a little bit in case the solution is being used in a networked environment or on a different computer.  There is no way to know if the required XSLT would be present.  I thought I had a very elegant solution to this problem.  I created a global container field and put the XSLT file in it.  I then created a start up script that exports the container field contents to the temp folder.  The script is really 2 lines...

      Set Variable [$path; Value: Get(TemporaryPath) & "export.xls"]
      Export Field Contents [g_container; $path]

       

      This works flawlessly.  After the file is opened is can navigate to the temp folder and find the XLST.  The problem is in the script to export the records.  I have tried every combination possible but can not get the required path correct to the XLST.  You would think it would be something simple like

      Set Variable [$xlsPath; Value: Get(TemporaryPath) & "export.xls"]
      Export Records [No dialog; "$exportedRecordsPath"; "FMPXMLRESULT"; "xlsPath"; Unicode (UTF-8)]

       

      I have tried everything for the calculation for $xlsPath and can not get it to work.  Anybody know what it should be?  A calculation that is system independent would be nice, but if too difficult just one for OS X is fine.

       

      Thanks