I've got a script setup right now that takes an XML and grabs a specific node based on the value of one of the elements and then parses out the data for that node. An XML example is here: http://www.carvertubs.com/temp/applications/freightQuote/xmlResponse/15497231.xml
. The current script I'm using is as follows:
'Select the <CARRIER> node based on the value of <SCAC> child node
Set centralFreightNode = objXML.selectSingleNode("/
'Make sure the node was found
If NOT TypeName(centralFreightNod
'Node was found - now get the values you want from the XML
carrierRate = centralFreightNode.selectS
freightCost = centralFreightNode.selectS
arrivalNotification = centralFreightNode.selectS
residentialFee = centralFreightNode.selectS
liftGate = centralFreightNode.selectS
fuelSurcharge = centralFreightNode.selectS
transitTime = centralFreightNode.selectS
Set centralFreightNode = Nothing
'Handle if not found
The reason behind this is that we only wanted to ship with Central Freight, which isn't always returned by the API, depending on the particular request. So, if Central Freight is returned by the API this grabs that data and displays, otherwise I simply display a message asking them to call.
We've added a couple of carriers to the list of people that we can use. These carriers have different values, of course, for FQQUOTE/CARRIER/SCAC element. There are 3 different ones I can use now, CEDE, RDWY, and DAFG. How can I edit this so that it does what it's doing now for all 3 of these carriers, and then only returns the data for the one with the lowest value for RATE? At times all 3 will come back, at times only 1 or 2 will, and at very rare times none could come back.
Any information on this would be greatly appreciated. Thanks!