filemakernewb2011 Posted October 19, 2011 Posted October 19, 2011 I've created a scripted process by which a snapshot link (SNL) is created manually using a series of custom functions. I'm doing this because the creation of the SNL needs to happen server-side, but the resulting SNL is sent to remote users. A native SNL created server side stores a local path to the file which then breaks for those not on the same network. The process works great and I do get a resulting SNL file, but here is the problem.. I need to use a line break to separate the record ID's. I've tried to use the pilcrow character, Char (13) and Char (10), but the resulting SNL file does not respect these characters. If you open the resulting file with a text editor and simply replace the line breaks between each of the ID's, the file works. I've also played with various encoding options both with the global temp field where I store the XML (pre-export) and with the export encoding as well, but no dice. I'm hoping I'm just missing something.. I have attached a demo file and a movie showing what I mean by replacing the line breaks which then works. Any thoughts? snapshotlink.mov CreateSNL.fp7.zip
comment Posted October 19, 2011 Posted October 19, 2011 When you export as tab-delimited, any in-field carriage returns are converted to vertical tab characters. You could export the global field's contents - but then the file's encoding will be UTF-16 (which may be fine for Filemaker, or not). Have you tried exporting as XML, using a suitable XSLT stylesheet?
filemakernewb2011 Posted October 19, 2011 Author Posted October 19, 2011 Great suggestion.. I modified the script so that it exported the field contents.. The only other modification required was to change the header row of the XML output so that it was also encoded with UTF-16. Meaning, change this: <?xml version="1.0" encoding="UTF-8"?> To this: <?xml version="1.0" encoding="UTF-16"?> It works beautifully now.. Thanks a million!!! I've attached the working file here: CreateSNL_fixed.fp7.zip
filemakernewb2011 Posted October 19, 2011 Author Posted October 19, 2011 Ah.. heck.. spoke to soon.... Export Field Contents is NOT a supported server-side script step.. It seems the only option then must be to export as XML with an XSLT stylesheet, but I'm not at all familiar with creating XSLT stylesheets from scratch. Any advice about how to go about creating a stylesheet to do what I need?
comment Posted October 20, 2011 Posted October 20, 2011 See if this can get you started. Custom Snaphot.zip
filemakernewb2011 Posted October 20, 2011 Author Posted October 20, 2011 Fascinating! Thank you for taking the time to put an example together. I've learned quite a few things as a result.
Newbies Rjakes Posted October 23, 2011 Newbies Posted October 23, 2011 It's pretty trivial to write an XSL transform to flip out the paths node [of a native snl] with whatever you want. If your server is Mac OS, it's also trivial to perform the transformation via shell script (and maybe on Win too, I just haven't tried it.)
Recommended Posts
This topic is 4779 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now