AnsweredAssumed Answered

Import XML - specify source

Question asked by Extensitech on May 3, 2016
Latest reply on May 4, 2016 by electon

Doing a bit of xml "publish and subscribe", which overall is going pretty well.


From one solution, I need to export a series of xml files, which get placed in a web-accessible directory. Done and done.


From another solution, I need to import a small, one-record xml file from that directory, find out if there's an update, and if so, import the other xml files. Again, done and done.


Now I'm trying to introduce a "rollback" option in the first solution. It's basically the same as the "update" in the second, but I'll import the xml data from the temp directory rather than the http path. Basically, same routine with just a different path variable.


However, here's where I'm seeing something I don't understand. (The script step in question is a bit dialog/option heavy, so this might make more sense if you look at the step while reading this.):


I'm in the "Import Records" script step, with "XML data" as the data source.


For "specify xml data source", I'm using "Calculation" ("File or HTTP request specified by calculation"), and using $pth_fil, which, as I can see in my data viewer, currently equals filewin:/C:/Users/ccain/AppData/Local/Temp/S10.16/SYS.xml


Now, I've had that variable pointing to an http address before this, and it's worked fine, but now that $pth_fil is a file path, it's not recognizing the file. The mapping shows nothing on the left, and if I run the step I get error 717.


If I change the option from calculation to "file", and put in the variable, I get the same result (not really surprised).


If I take the contents of the variable (filewin:/C:/Users/ccain/AppData/Local/Temp/S10.16/SYS.xml) and paste it into the File dialog, I can then see fields on the left of the mapping dialog.


Also, if I manually select the file, it gets entered in the File list exactly as it appears in my variable.


So... what's going on here?


I need this file path to be a variable, since it's going to be performed client-side and paths change. I've tried a few file path syntax variations with no success, but my experience to date has been that if you can get the variable to look like what you get when manually selecting a file, there's a reasonable expectation that it'll work.


Anyone encountered this before? Can anyone spot in my description what I might be doing wrong?


Chris Cain