When attempting to import records in FMP13.0.5 from an xml data source with "http request", I'm encountering this below error.
If i save the source to file and change its encoding to "UTF-8", it works.
How can i handle this?
My bad, missed this completely:
from an xml data source with "http request",
my suggestion was referring to a local xml file import. In your case you might try to use "insert from url" script step to get xml into a field, export it locally to UTF-8 and import back. You will need to use "Export Records" for one field one record as it allows you to specify encoding.
As you see, ISO-8859-9 is not supported.
Importing XML data
Can't you change the encoding using some option parameter in URL ?
Are you using a stylesheet (XSLT) with the import?
Thank you for your info.
i'm not authorized to change encoding parameter on the host.
Yes, i've prepared a xslt file before with UTF-8.
And it's not working with xslt too...
On a MAC you can try to change encoding prior to import:
run a calculated AppleScript:
Substitute("do shell script \"iconv -f iso-8859-9 -t utf-8 '" & $sourceLacation & "' > '" & $destinationLocation & "1" & "'\"";"\\";"\\\\")
Location pathshave to be POSIX, making the source and destination location the same did not work for me on OSX.
Sorry, i'm a newbie
Is this procedure runs on local xml file?
So, Before the import, should i download the and export the xml file and run the AppleScript on this exported xml file?
"it's not working" is a little vague. can you post the XSLT first few lines? especially include the prolog and attributes, stylesheet opening tag (and attributes) & output tag (and attributes).
this my very first xslt file
I got it. I will try.
ok. this is correct, but as user19752 says, the Xerces-C++ XML parser, does not allow for ISO-8859-9 in the source XML. you are limited to the import, export select encoding) and re-import with or without XSLT.
p.s. when I say "correct" (about the XSLT), I mean the top lines. I'm not sure you have the for-each and if correctly placed. so perhaps that was your error and "it's not working"... I would place these around the ROW element, as you want to bring in rows/records only if the test is true. I would also change the DATABASE attribute, RECORDS to be "" (empty)
Just noticed Beverly Voth reply, suggesting the same thing.
It gaves me same encoding error with your structure corrections.
many thanks to all.
I will be trying to export and replace encoding and than re-import...
mr.voyager, I think Beverly refers to the fact that xml produced by your first xslt will produce xml which will error on export .
This would not resolve the issue with encoding, but this would be your next issue when encoding is sorted out.
The second xslt looks fine though.
i can hadle it in sequence; insert from url, Substitue encoding to UTF-16, Export Field to xml file, re-import the file with xslt.
On Mar 23, 2015, at 10:33 AM, mr.voyager <email@example.com> wrote
we are glad it worked ok, using this method.
with your valuable help.
Retrieving data ...