I need to access attribute values in an XML document returned to me from a 
CFHTTP POST operation.

A typical response will look like:

<!DOCTYPE pp.response PUBLIC "-//IMALL//DTD PUREPAYMENTS 1.0//EN" 
"http://www.purepayments.com/dtd/purepayments.dtd";>
<pp.response>
<pp.authresponse merchant="1001" ordernumber="1" authstatus="DCL" 
transactionid="CC_FU2CBD48812C" failure="true">Card declined</pp.authresponse>
</pp.response>


I specifically need to pull the last 3 attributes in the <pp.authresponse> 
element.

I've tried several custom CF tags that turn the xml data into a structure, 
but they're very complex structures, and the element names tend to get 
munged because of the period (which shouldn't happen, it's a valid name 
character).

So, I've installed XML Toolkit, and it looks promising, either by using 
subset or the xpath features.


Where I'm stuck is how to get the resulting xpath value into something I 
can then use directly in CF --, e.g. <CFIF #value# = "DCL">
     do this
<CFELSE>
     do that

and then storing transaction ids in my database, etc.

So how do I assign those values to some 
object/structure/parameter/variable/whatever, that I can then manipulate in 
CF?

Ann
-----
Ann Navarro, WebGeek, Inc.
http://www.webgeek.com

say what? http://www.snorf.net/blog


-----------------------+
cf-xml mailing list
http://torchbox.com/xml/list.cfm

Reply via email to