Normal Topic XML command questions (Read 1491 times)
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
XML command questions
Nov 19th, 2011 at 5:29pm
Print Post Print Post  
I am trying to parse XML that is being returned to an element from  @HTTPGetHTML . I was using a string array type method like below but because the data is not consistent it does not work well for me so I started playing with the XML commands.

     str1 = @replace(convertbox, "<", ";")      
str2 = @replace(str1, ">", ";")

First it seems like all the XML commands are looking for a file and I have not had luck using an element in place of the .xml file. I don't know if my problem is that the XML commands must read from a file or my code is fubar.

Next, I get that in XML there are reoccurring actions so I am looking for specific data between (Nodes I think) but I am having trouble using the XML commands in the proper order even with an XML file. I have tried everything including the walk the file subroutine but am not getting the file read properly. I believe my problem is that I need a better understanding of what steps I use the XML commands.

Is there a sample app with this technique floating around or a list of the steps to follow?

An example of the data is below. It obviously looks different when viewed in a text box then when viewed with a browser.

Thanks

<?xml version="1.0"?>
<TrackResponse><TrackInfo ID="9405503699300263527763"><TrackSummary><EventTime>12:14 pm</EventTime><EventDate>October 27, 2011</EventDate><Event>Delivered</Event><EventCity>PICO RIVERA</EventCity><EventState>CA</EventState><EventZIPCode>90660</EventZIPCode><
EventCountry/><FirmName/><Name/><AuthorizedAgent/></TrackSummary><TrackDetail><E
ventTime>8:07 am</EventTime><EventDate>October 27, 2011</EventDate><Event>Out for Delivery</Event><EventCity>PICO RIVERA</EventCity><EventState>CA</EventState><EventZIPCode>90660</EventZIPCode><
EventCountry/><FirmName/><Name/><AuthorizedAgent/></TrackDetail><TrackDetail><Ev
entTime>7:57 am</EventTime><EventDate>October 27, 2011</EventDate><Event>Sorting Complete</Event><EventCity>PICO RIVERA</EventCity><EventState>CA</EventState><EventZIPCode>90660</EventZIPCode><
EventCountry/><FirmName/><Name/><AuthorizedAgent/></TrackDetail><TrackDetail><Ev
entTime>6:27 am</EventTime><EventDate>October 27, 2011</EventDate><Event>Arrival at Post Office</Event><EventCity>PICO RIVERA</EventCity><EventState>CA</EventState><EventZIPCode>90660</EventZIPCode><
EventCountry/><FirmName/><Name/><AuthorizedAgent/></TrackDetail><TrackDetail><Ev
entTime>2:24 am</EventTime><EventDate>October 27, 2011</EventDate><Event>Processed through USPS Sort Facility</Event><EventCity>LONG BEACH</EventCity><EventState>CA</EventState><EventZIPCode>90809</EventZIPCode><E
ventCountry/><FirmName/><Name/><AuthorizedAgent/></TrackDetail><TrackDetail><Eve
ntTime>9:52 pm</EventTime><EventDate>October 26, 2011</EventDate><Event>Processed at USPS Origin Sort Facility</Event><EventCity>SANTA CLARITA</EventCity><EventState>CA</EventState><EventZIPCode>91383</EventZIPCode>
<EventCountry/><FirmName/><Name/><AuthorizedAgent/></TrackDetail><TrackDetail><E
ventTime>9:52 pm</EventTime><EventDate>October 26, 2011</EventDate><Event>Accepted at USPS Origin Sort Facility</Event><EventCity>SANTA CLARITA</EventCity><EventState>CA</EventState><EventZIPCode>91383</EventZIPCode>
<EventCountry/><FirmName/><Name/><AuthorizedAgent/></TrackDetail><TrackDetail><E
ventTime/><EventDate>October 26, 2011</EventDate><Event>Electronic Shipping Info Received</Event><EventCity/><EventState/><EventZIPCode/><EventCountry/><FirmName
/><Name/><AuthorizedAgent/></TrackDetail></TrackInfo>
</TrackResponse>
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: XML command questions
Reply #1 - Nov 19th, 2011 at 8:15pm
Print Post Print Post  
Have you checked out RegExBetweenString() commands? They were written for this sort of thing.

I'm also learning to work with XML data, (from UPS, Paypal, etc) so if there is any examples or such that you need, drop me an email.
  
Back to top
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: XML command questions
Reply #2 - Nov 21st, 2011 at 7:14pm
Print Post Print Post  
Thanks Steve I will Email you a couple of questions, thanks again.

seeing you are also playing with similar things started me wondering If anyone else on the Forum has gotten their Sesame application to communicate with a credit card authorization system like authorize.net or any other credit card clearing houses?

Also, anyone create an interface to the USPS system that allows the printing of USPS labels directly from their Sesame application? 

I almost have the tracking part working, I communicate great from sesame to and from the  USPS servers, I just haven't gotten a great way of displaying the data completed yet.

At present the labels are generated through another software,  But the labels from within Sesame is somewhere soon on my list and if someone else has some tips or ideas I would appreciate hearing them.

I figure those are 2 of the most common things people do today (charge credit cards and ship) Many Sesame users must be doing it now or will be doing those things in the future through Sesame.

Thanks
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: XML command questions
Reply #3 - Nov 21st, 2011 at 8:01pm
Print Post Print Post  
I can send you code to get a connection established with Authorize.Net and Paypal from within Sesame. I'd be eager to see how to connect to the API for UPS and FedEx if anyone is currently doing this.

Thanks,
Steve
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: XML command questions
Reply #4 - Nov 21st, 2011 at 8:07pm
Print Post Print Post  
Steve_in_Texas wrote on Nov 21st, 2011 at 8:01pm:
I can send you code to get a connection established with Authorize.Net and Paypal from within Sesame. I'd be eager to see how to connect to the API for UPS and FedEx if anyone is currently doing this.

Thanks,
Steve


I suspect that you will have to use SSL tunneling.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: XML command questions
Reply #5 - Nov 21st, 2011 at 8:28pm
Print Post Print Post  
Quote:
I suspect that you will have to use SSL tunneling.


No problem, since we can have Sesame launch the command using cURL.exe (which you and Erika set up for us months ago, and working like a champ still.)

Sesame3 will allow SSl tunneling?
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: XML command questions
Reply #6 - Nov 21st, 2011 at 8:43pm
Print Post Print Post  
Steve_in_Texas wrote on Nov 21st, 2011 at 8:28pm:
Sesame3 will allow SSl tunneling?


At the moment, no.

Sesame2 and 3 both will work through a tunnel, but we cannot provide built in SSL. End-user configurable encryption cannot be exported out of the US without a special export license.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: XML command questions
Reply #7 - Nov 21st, 2011 at 8:52pm
Print Post Print Post  
No problem. We'll continue to launch cURL.exe to handle SSL or I'll learn up on Tunneling at a later date.

As long as we can connect and retrieve the data we need without leaving Sesame, I'm very happy.
  
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: XML command questions
Reply #8 - Nov 21st, 2011 at 9:20pm
Print Post Print Post  
Hello Steve,
Would you please give us some info about cURL.exe and how does that work to overcome limitation to deal with SSL and how it is used to interact with the webdata? Thanks.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: XML command questions
Reply #9 - Nov 22nd, 2011 at 12:01am
Print Post Print Post  
Sure, Bharat. I'll start a new thread, since I've already derailed this one bad enough. (Sorry Robert)
  
Back to top
IP Logged