Search code examples
xmlfilemakermailchimp

Extracting XML data from a FileMaker Web Viewer using a Custom Function


I have a script in Filemaker that calls a Brian Dunning hosted custom function called extractData this function looks for a given instance of a given attribute within a given XML contents. this however is not working for me (this may be due to FileMaker's reliance upon the default browser which in most cases will be IE, but more on that later).

The problem is this, I have a number of campaigns hosted on MailChimp and I wish to use their API to bring back the details about my campaigns I have the URL working in browsers so know I have this part right the content is being returned as XML, as requested within the URL.

my problem lies within FileMaker I am trying to get FileMaker to parse the XML using a custom function that I found on Brian Dunning's very useful site. if I pass this custom function some simple XML it works fine but when using a web viewer to process the URL and then extract the XML from that to pass to the custom function the whole process seems to fail. I am at a loss as to how I can extract the contents of the XML attributes being clearly displayed within my XML content.

Any help would be greatly appreciated.


Solution

  • The web viewer might not be getting the complete XML document. You need to pause and wait for the web viewer to finish loading. Or, use a plugin to get the URL contents.

    Set a break point and use the debugger to dump the XML contents you're getting before parsing.