billwentworth Posted June 8, 2005 Posted June 8, 2005 First I would like to thank Jerry (Quintech) for his help in the other forum with this issue, he re-directed me here. I actually just had a breakthrough in being able to import weather XML data into Filemaker during an import. The XML link I used to get the live data is http://weather.gov/data/current_obs/KOWD.xml I have also attached the XSLT that I used to do this to translate into the correct grammar for Filemaker (I think that's what it's doing, I'm still new to XML/XLST). I just want to make sure that is a logical way of doing this. I think the next task for me is going to be writing a script to auto-import this data into the appropriate fields for whenever a new record is created. If anyone has any ideas on this, I'd really appreciate it. Thanks! try2.txt
QuinTech Posted June 8, 2005 Posted June 8, 2005 I thought you said you didn't know XML? You seem to be writing XSLT's like an old pro! Either that or you are a true google whiz. I had suggested you post here because I anticipated a lot of questions about XML. Your next question is actually a completely different topic; you are way too fast for us! The XML looks logical to me; not exactly the way I would have written it, but that may be more a style thing than anything else. If it works, it works. Others with more knowledge than I may have other comments. As far as automatically importing on creation of a new record, there aren't really any good ways to do that in FMP6. My suggestion would be to steer people away from the "New Record" command (there are ways to disable this command if gentle persuasion doesn't work) and instead give them a button which is tied to a script. The script does not create a new record, just does an XML import with the XSLT and the URL you specified. Make sense? J
billwentworth Posted June 8, 2005 Author Posted June 8, 2005 Haha, yea I guess I'm good at finding things. I found the XSLT from the filemaker website and was able to do a little research to find out what the address of the NOAA weather XML data site was. I understand what you are saying about the button, but I've searched through the script options and I'm not sure which command to use to get started creating a script to do an XML import. Any suggestions on that? Thanks again for you help! B
QuinTech Posted June 8, 2005 Posted June 8, 2005 It's a little tricky. First, before even beginning the script, I would start out by doing an import from File > Import Records > XML Source, making sure to map fields correctly in the ever-so-painful import dialog. Now that you've executed that import, FM retains it in memory. Now go into Scriptmaker and create your script. You will need exactly one step to do what you've asked so far: Import Records. When you specify the file to import in Scriptmaker, change your File Type selection to XML and you will be presenting with a dialog specific to XML import. Enter your URL for the weather data as your data source, and then specify your style sheet. (From what I understand, using a local file here is the least reliable method, using the HTTP request is the most reliable method, and the field is somewhere in between. If you use the field, set the contents of this field to the contents of the XSLT file you wrote.) Click OK, make sure to set "Perform without dialog", and you should be good to go.
billwentworth Posted June 8, 2005 Author Posted June 8, 2005 Thanks a lot! I got it to work like a charm. I know that Filemaker doesn't have the ability to auto-execute a script on creation of a new record, but I wish that it did. I don't feel like adding a plug-in on this app. Thanks so much for your help! Really appreciate it.
Recommended Posts
This topic is 7106 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 accountSign in
Already have an account? Sign in here.
Sign In Now