December 29, 200718 yr Newbies I have created a custom web viewer that pulls an xml file that I need to extract information from. I need help making the script that pulls the numbers that are from 6-7 numbers in length and they appear in the xml as follows "[color:red]503998< /amount> These numbers change with each file, and I need to set the portion in [color:red]red to a field. I added the space to the amount tag. Any help is appreciated I just cannot figure out how to refer to these numbers in the scriptmaker. Edited December 29, 200718 yr by Guest
December 30, 200718 yr Why not import the XML file? http://www.filemaker.com/help/12-Import%20export15.html
December 30, 200718 yr Author Newbies I am getting an XML parsing error, also I really dont think this will work because it seems like the XML import is something done to import multiple records. In my case I need to run a separate http request for each record and extract the unique number that I show in my above post. Thanks for the help but I am really trying to find a way to automate this external lookup for each record, maybe on an original import if I could run a script that loaded it for all my records, that would be great. Any ideas?
December 30, 200718 yr You can import any number of records - including one. Of course, you will need a XSLT style sheet in order to import into Filemaker. I am guessing that's why you got the parsing error. Alternatively, if there's only one occurrence of amount in dollars in the text, you can extract it by: Let ( [ prefix = "" ; pos = Position ( text ; prefix ; 1 ; 1 ) ; start = pos + Length ( prefix ) ; end = Position ( text ; "<" ; start ; 1 ) ] ; Case ( pos ; Middle ( text ; start ; end - start ) ) )
December 30, 200718 yr We could likely help better with the XSL stylesheet if we saw the http request, if it is available to the general public. Or the xml file returned (attached to a post, not pasted into one, as the makes a mess of it). I really don't see why the discrepancy between what you request and what you get (record vs. records), or why it's a problem. You can use Import, with the "Matching records" option, to line up imported data to the correct record. Or you can specify particular pieces of data in the xml for a record. There are several examples here in the fmforums xml forum of successful imports; though every one is slightly different. Or you can do as comment suggested in his last post, just parse the data out. Edited December 30, 200718 yr by Guest
Create an account or sign in to comment