Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I have a question. I am using a cr

Status
Not open for further replies.

nslink

IS-IT--Management
Oct 22, 2002
2
US
I have a question. I am using a credit card proccessor that formats its XML output like this:




<?xml version=&quot;1.0&quot; standalone=&quot;no&quot;?>
<XMLResponse xmlns:xsi=&quot;xsi:noNamespaceSchemaLocation=&quot;<XMLTrans>
<transType>05</transType>
<sourceEmail>test@nslink.net</sourceEmail>
<invNum>GH5514</invNum>
<status>69</status>
<transNum></transNum>
<authCode></authCode>
</XMLTrans>
</XMLResponse>


I have a script that will parse data that is outputted like this:
<!DOCTYPE pp.response PUBLIC &quot;-//IMALL//DTD PUREPAYMENTS 1.0//EN&quot; &quot;<pp.response>
<pp.authresponse merchant=&quot;1001&quot; ordernumber=&quot;18140517&quot; failure=&quot;true&quot;>Merchant not found</pp.authresponse>
<pp.authresponse merchant=&quot;1001&quot; ordernumber=&quot;18140518&quot; failure=&quot;true&quot;>Merchant not found</pp.authresponse>
</pp.response>


How do I modify the current script to parse the date from the first one. Please I need help with this. Just if you point me in the right direction. I could pay someone who knows what they are doing. This modification shouldn't be that hard
 
It all depends(tm).

Posting the script or showing me where the location of the script is would help alot, as I do not know what language you are using or even how you are parsing the information with the script.



 
Ok, I sort of understand.

As I understand it, you are trying to use information in the form of the first example XML for input into the credit card payment object that only understands the second example XML. Is this right?

Your best bet would be to use an intermediate stage that transforms the second XML into the first one. This is the best option, because you might as well keep the functinality incase your data changes again.

I suggest you either use XSLT to do this, or manually hack the XML from the first form into the second with PHP. Either way, this will allow you to build transformation scripts for any sort of xml data.


Hope this helps, &quot;No Payment Necessary :)&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top