Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Trouble exporting line breaks as XML

Featured Replies

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

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?

  • Author

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

  • Author

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?

  • Author

Fascinating!

Thank you for taking the time to put an example together.

I've learned quite a few things as a result.

  • Newbies

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.)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.