Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Export with stylesheet - how to handle multiple lines within a text field


This topic is 5126 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

I am exporting to XML and producing a Tab-Delimited file. Everything exports well except for text fields that have multiple lines in them. How do I make the stylesheet handle the multiple lines per field so they stay in the same field?

Example of multiple lines:

This tool is 18Volts.

This tool has no charger.

Also, how do I change the stylesheet to enclose each field with double-quotes?

Thank you Fenton for your excellent help on this earlier. You provided a stylesheet that works very well. Here is the stylesheet that I have:

<?xml version="1.0" encoding="utf-8"?>



xmlns:fm="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fm" >

















	









































	



	





 

Edited by Guest
Posted

Your stylesheet does NOT produce a CSV file (there isn't a comma anywhere in the code). Perhaps it produces a tab-separated file (hard to tell what's inside the element)?

A tab-separated file cannot contain in-field carriage returns or tabs - so the question is what do you want to have there instead.

Posted

Thank you for the correction. It is a Tab-delimited file that I am making.

I am submitting two files here for perusal.

The first (this_file_works) was exported from FMP as a .mer file, opened in OpenOffice and then saved as tab-delimited.

The second (this_file_doesnt_work) was exported from FMP as an xml using the stylesheet that I posted.

Can you help? I need to get the 2nd file to output just like the first so I can eliminate the extra steps after exporting. Incidentally, Excel, OpenOffice for Windows, and OpenOffice for Mac all require different processing steps to create the same type of file. That's why I want to use xml with a stylesheet, to eliminate that for my clients.

this_one_works.txt.txt

this_one_doesnt_work.txt

Posted

This (the "working" file) is a very strange format: a tab-separated file with fields (and field names) enclosed in quotes. In any case, if that's what you really need, it can be made - but you still need to provide an answer to my earlier question. I don't know if the source had any in-field carriage returns and/or tabs; I suggest you make a test and see what happens to those in your current process, so that the new process can do the same.

Posted

I have to provide feeds to 3 different channels and may have gotten them mixed up.

So, attached is the source xml as exported from FMP (test_xml.txt). It has one additional field that the previous attachments don't have, the last one.

Also attached (textworks.txt) is the same date that has been exported as a .mer file, opened and then closed within OpenOffice, and is ready for uploading to the website.

It looks like that last field had carriage returns in the XML file and they were converted to VT (vertical tabs?) in the tab-delimited file that came out of OpenOffice. Whatever they were turned into, they work when importing into the website.

test_xml.txt.txt

testworks.txt

Posted

It looks like that last field had carriage returns in the XML file and they were converted to VT (vertical tabs?)

Yes, that is correct - but unfortunately it won't work, because a vertical tab is not a legal XML character.

What is your target application? As I mentioned earlier, the "working file" has a weird non-standard format. Perhaps there is another format that will be accepted?

Posted

The target application is an Amazon Seller Central Product Feed. We use this feed to create new amazon listings and to revise quantities and prices on amazon.

This topic is 5126 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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