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

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

Recommended Posts

Posted

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

Posted (edited)

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
Posted

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.

Posted

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.

Posted

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

Posted

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

Posted

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:

Posted

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,

Posted

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.

  • 2 weeks later...
Posted

It makes no difference where the link is to.

Get this "Using an XSLT template file to retrieve data from a password protected Filemaker database" it should be the first link in the library FMI XSLT Library

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