Jump to content

XML Import Error


3 Square

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

Recommended Posts

Hi

I've been having a bash with XML and getting data into FM 8.5 and it's been going OK so far. In brief I've got a URL that returns xml data into a web browser and I can save the file to my desktop, use FM and an xsl stylesheet to import the various elements into new records and fields, everything works fine doing it this way.

However, when I try and attempt the logical extension of this rather long winded process by using the http and xsl options available from the import script step I get an error as follows:

XML Parsing Error

An exeption occured NetAccessorException, Message could not connect to the socketfor URL '{0}' Error=1

Line Number: 0

Column Number: 0

Can anyone shed any light on why this might happen or if it's some kind of bug in FM?

Thanks in advance for any ideas or suggestions.

Andy Marsh

Link to comment
Share on other sites

I don't know if it's officially a bug, but it is, as far as I know, unexpected and undocumented behavior. I've always had problems when the xml location was remote and the xsl location was local. That's the error message I got. It seems you have 2 choices.

1. Put the xsl on a remote location, such as a web site, if you have one.

2. Write the xml data to a local file. Then your local xsl will work. This is fairly easy to do, using AppleScript in a Perform AppleScript step.

do shell script "do shell script "curl 'http://www.fentonjones.com' -o ~/desktop/FentonJones.html"

This is for a plain html. But an xml request URL would work the same, returning the result xml. Don't forget the apostrophe's, to quote the URL. Otherwise curl chokes on special characters in the request URL, such as &.

Spaces in the file path wil alsol need escaping. Several ways to do that.

do shell script "curl 'http://www.fentonjones.com' -o ~/desktop/Fenton' 'Jones.html"

Edited by Guest
Link to comment
Share on other sites

Thanks for the suggestions :smile2:

I was thinking that it might be an idea to have the xsl on one of our web servers instead as I couldn't really see any other variable in the operation other than the location differences.

As a result of messing with the import/export thing I've got a reliable crash happening...

1. export the content of a field that contains xml data grabbed from a website using the Troi URL plug-in to a file called export.xml

2. Import the export.xml file back into FM using the xsl file I've got

3. FileMaker crashes every time

(Mac OSX 10.4.7 and FM Advanced 8.5v01)

Just tried the remote xsl location and get the same result back as before.

Seems like this just doesn't want to work.

I'm definitely thinking this is something screwed with FM now as it chokes when trying to access the xsl file after sending the URL.

Link to comment
Share on other sites

I haven't tried xml since updating to 8.5. But I know that another way to cause FileMaker to quit unexpectedly is to have the wrong encoding on a file (not sure whether the xml, xsl, or either). I can't remember exactly what. But I know I've done it. Try it using 'curl' to download/write the file and see if it still crashes.

Link to comment
Share on other sites

I've decided to use the csv data option from the server rather than xml and just download it into a field using the Troi URL plug-in, export the contents as .csv and then import into the required table. Just as quick and a whole lot more reliable!

I've also got a FileMaker XML book to have a browse through to see if there's anything I've missed...

Link to comment
Share on other sites

By chance, are you trying to use an "authenticated" request (one including user & password)?

These fail sometimes. There's a work-around on the FMI site (XSLT library).

Link to comment
Share on other sites

Hi Beverly,

Thanks for the reply. It is indeed a request that uses account name and registration number.

I'll have a look at the FMI site and see if the work around fixes the problem.

I'm also 50 odd pages into your rather good XML book... :smile2:

Link to comment
Share on other sites

It is indeed a request that uses account name and registration number.

That's why you got the "An exeption occured NetAccessorException, Message could not connect to the socketfor URL '{0}' Error=1". It happened to me, too :)

Oddly, Mac to Mac, it seems to work...

While 'the book' is 3 years old, it still has some good stuff in it!

Thanks,

Link to comment
Share on other sites

Hi Beverly

I've looked on the XSLT library and can't find anything obvious for the work around. I don't suppose you can remember more specifically?

If it makes any difference, the http request is made to a remote server that is not a FileMaker server when it's sending the authentication elements.

Link to comment
Share on other sites

  • 2 weeks later...

This topic is 6500 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.