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

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

Recommended Posts

  • Newbies
Posted (edited)

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 by Guest
  • Newbies
Posted

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?

Posted

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

)

Posted (edited)

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 by Guest

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